
001package org.hl7.fhir.r4.formats; 002 003import java.io.IOException; 004 005import org.hl7.fhir.exceptions.FHIRFormatError; 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 Thu, Dec 13, 2018 14:07+1100 for FHIR v4.0.0 037import org.hl7.fhir.r4.model.*; 038import org.hl7.fhir.utilities.Utilities; 039import org.hl7.fhir.utilities.json.JsonTrackingParser.PresentedBigDecimal; 040import org.hl7.fhir.utilities.xhtml.XhtmlNode; 041 042import com.google.gson.JsonArray; 043import com.google.gson.JsonObject; 044 045public class JsonParser extends JsonParserBase { 046 047 public JsonParser() { 048 super(); 049 } 050 051 public JsonParser(boolean allowUnknownContent) { 052 super(); 053 setAllowUnknownContent(allowUnknownContent); 054 } 055 056 public JsonParser(boolean allowUnknownContent, boolean allowComments) { 057 super(); 058 setAllowUnknownContent(allowUnknownContent); 059 setAllowComments(allowComments); 060 } 061 062 protected void parseElementProperties(JsonObject json, Element element) throws IOException, FHIRFormatError { 063 super.parseElementProperties(json, element); 064 if (json.has("extension")) { 065 JsonArray array = json.getAsJsonArray("extension"); 066 for (int i = 0; i < array.size(); i++) { 067 element.getExtension().add(parseExtension(array.get(i).getAsJsonObject())); 068 } 069 } 070 ; 071 } 072 073 protected void parseBackboneElementProperties(JsonObject json, BackboneElement element) 074 throws IOException, FHIRFormatError { 075 parseElementProperties(json, element); 076 if (json.has("modifierExtension")) { 077 JsonArray array = json.getAsJsonArray("modifierExtension"); 078 for (int i = 0; i < array.size(); i++) { 079 element.getModifierExtension().add(parseExtension(array.get(i).getAsJsonObject())); 080 } 081 } 082 } 083 084 protected void parseBackboneElementProperties(JsonObject json, BackboneType element) 085 throws IOException, FHIRFormatError { 086 parseElementProperties(json, element); 087 if (json.has("modifierExtension")) { 088 JsonArray array = json.getAsJsonArray("modifierExtension"); 089 for (int i = 0; i < array.size(); i++) { 090 element.getModifierExtension().add(parseExtension(array.get(i).getAsJsonObject())); 091 } 092 } 093 } 094 095 protected void parseTypeProperties(JsonObject json, Element element) throws IOException, FHIRFormatError { 096 parseElementProperties(json, element); 097 } 098 099 @SuppressWarnings("unchecked") 100 protected <E extends Enum<E>> Enumeration<E> parseEnumeration(String s, E item, EnumFactory e) 101 throws IOException, FHIRFormatError { 102 Enumeration<E> res = new Enumeration<E>(e); 103 if (s != null) 104 res.setValue((E) e.fromCode(s)); 105 return res; 106 } 107 108 protected DateType parseDate(String v) throws IOException, FHIRFormatError { 109 DateType res = new DateType(v); 110 return res; 111 } 112 113 protected DateTimeType parseDateTime(String v) throws IOException, FHIRFormatError { 114 DateTimeType res = new DateTimeType(v); 115 return res; 116 } 117 118 protected CodeType parseCode(String v) throws IOException, FHIRFormatError { 119 CodeType res = new CodeType(v); 120 return res; 121 } 122 123 protected StringType parseString(String v) throws IOException, FHIRFormatError { 124 StringType res = new StringType(v); 125 return res; 126 } 127 128 protected IntegerType parseInteger(java.lang.Long v) throws IOException, FHIRFormatError { 129 IntegerType res = new IntegerType(v); 130 return res; 131 } 132 133 protected OidType parseOid(String v) throws IOException, FHIRFormatError { 134 OidType res = new OidType(v); 135 return res; 136 } 137 138 protected CanonicalType parseCanonical(String v) throws IOException, FHIRFormatError { 139 CanonicalType res = new CanonicalType(v); 140 return res; 141 } 142 143 protected UriType parseUri(String v) throws IOException, FHIRFormatError { 144 UriType res = new UriType(v); 145 return res; 146 } 147 148 protected UuidType parseUuid(String v) throws IOException, FHIRFormatError { 149 UuidType res = new UuidType(v); 150 return res; 151 } 152 153 protected UrlType parseUrl(String v) throws IOException, FHIRFormatError { 154 UrlType res = new UrlType(v); 155 return res; 156 } 157 158 protected InstantType parseInstant(String v) throws IOException, FHIRFormatError { 159 InstantType res = new InstantType(v); 160 return res; 161 } 162 163 protected BooleanType parseBoolean(java.lang.Boolean v) throws IOException, FHIRFormatError { 164 BooleanType res = new BooleanType(v); 165 return res; 166 } 167 168 protected Base64BinaryType parseBase64Binary(String v) throws IOException, FHIRFormatError { 169 Base64BinaryType res = new Base64BinaryType(v); 170 return res; 171 } 172 173 protected UnsignedIntType parseUnsignedInt(String v) throws IOException, FHIRFormatError { 174 UnsignedIntType res = new UnsignedIntType(v); 175 return res; 176 } 177 178 protected MarkdownType parseMarkdown(String v) throws IOException, FHIRFormatError { 179 MarkdownType res = new MarkdownType(v); 180 return res; 181 } 182 183 protected TimeType parseTime(String v) throws IOException, FHIRFormatError { 184 TimeType res = new TimeType(v); 185 return res; 186 } 187 188 protected IdType parseId(String v) throws IOException, FHIRFormatError { 189 IdType res = new IdType(v); 190 return res; 191 } 192 193 protected PositiveIntType parsePositiveInt(String v) throws IOException, FHIRFormatError { 194 PositiveIntType res = new PositiveIntType(v); 195 return res; 196 } 197 198 protected DecimalType parseDecimal(java.math.BigDecimal v) throws IOException, FHIRFormatError { 199 DecimalType res = new DecimalType(v); 200 if (v instanceof PresentedBigDecimal) 201 res.setRepresentation(((PresentedBigDecimal) v).getPresentation()); 202 return res; 203 } 204 205 protected Extension parseExtension(JsonObject json) throws IOException, FHIRFormatError { 206 Extension res = new Extension(); 207 parseExtensionProperties(json, res); 208 return res; 209 } 210 211 protected void parseExtensionProperties(JsonObject json, Extension res) throws IOException, FHIRFormatError { 212 parseTypeProperties(json, res); 213 if (json.has("url")) 214 res.setUrlElement(parseUri(json.get("url").getAsString())); 215 if (json.has("_url")) 216 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 217 Type value = parseType("value", json); 218 if (value != null) 219 res.setValue(value); 220 } 221 222 protected Narrative parseNarrative(JsonObject json) throws IOException, FHIRFormatError { 223 Narrative res = new Narrative(); 224 parseNarrativeProperties(json, res); 225 return res; 226 } 227 228 protected void parseNarrativeProperties(JsonObject json, Narrative res) throws IOException, FHIRFormatError { 229 parseTypeProperties(json, res); 230 if (json.has("status")) 231 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Narrative.NarrativeStatus.NULL, 232 new Narrative.NarrativeStatusEnumFactory())); 233 if (json.has("_status")) 234 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 235 if (json.has("div")) 236 res.setDiv(parseXhtml(json.get("div").getAsString())); 237 } 238 239 protected Meta parseMeta(JsonObject json) throws IOException, FHIRFormatError { 240 Meta res = new Meta(); 241 parseMetaProperties(json, res); 242 return res; 243 } 244 245 protected void parseMetaProperties(JsonObject json, Meta res) throws IOException, FHIRFormatError { 246 parseElementProperties(json, res); 247 if (json.has("versionId")) 248 res.setVersionIdElement(parseId(json.get("versionId").getAsString())); 249 if (json.has("_versionId")) 250 parseElementProperties(getJObject(json, "_versionId"), res.getVersionIdElement()); 251 if (json.has("lastUpdated")) 252 res.setLastUpdatedElement(parseInstant(json.get("lastUpdated").getAsString())); 253 if (json.has("_lastUpdated")) 254 parseElementProperties(getJObject(json, "_lastUpdated"), res.getLastUpdatedElement()); 255 if (json.has("source")) 256 res.setSourceElement(parseUri(json.get("source").getAsString())); 257 if (json.has("_source")) 258 parseElementProperties(getJObject(json, "_source"), res.getSourceElement()); 259 if (json.has("profile")) { 260 JsonArray array = json.getAsJsonArray("profile"); 261 for (int i = 0; i < array.size(); i++) { 262 if (array.get(i).isJsonNull()) { 263 res.getProfile().add(new CanonicalType()); 264 } else { 265 res.getProfile().add(parseCanonical(array.get(i).getAsString())); 266 } 267 } 268 } 269 ; 270 if (json.has("_profile")) { 271 JsonArray array = json.getAsJsonArray("_profile"); 272 for (int i = 0; i < array.size(); i++) { 273 if (i == res.getProfile().size()) 274 res.getProfile().add(parseCanonical(null)); 275 if (array.get(i) instanceof JsonObject) 276 parseElementProperties(array.get(i).getAsJsonObject(), res.getProfile().get(i)); 277 } 278 } 279 ; 280 if (json.has("security")) { 281 JsonArray array = json.getAsJsonArray("security"); 282 for (int i = 0; i < array.size(); i++) { 283 res.getSecurity().add(parseCoding(array.get(i).getAsJsonObject())); 284 } 285 } 286 ; 287 if (json.has("tag")) { 288 JsonArray array = json.getAsJsonArray("tag"); 289 for (int i = 0; i < array.size(); i++) { 290 res.getTag().add(parseCoding(array.get(i).getAsJsonObject())); 291 } 292 } 293 ; 294 } 295 296 protected Address parseAddress(JsonObject json) throws IOException, FHIRFormatError { 297 Address res = new Address(); 298 parseAddressProperties(json, res); 299 return res; 300 } 301 302 protected void parseAddressProperties(JsonObject json, Address res) throws IOException, FHIRFormatError { 303 parseTypeProperties(json, res); 304 if (json.has("use")) 305 res.setUseElement(parseEnumeration(json.get("use").getAsString(), Address.AddressUse.NULL, 306 new Address.AddressUseEnumFactory())); 307 if (json.has("_use")) 308 parseElementProperties(getJObject(json, "_use"), res.getUseElement()); 309 if (json.has("type")) 310 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), Address.AddressType.NULL, 311 new Address.AddressTypeEnumFactory())); 312 if (json.has("_type")) 313 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 314 if (json.has("text")) 315 res.setTextElement(parseString(json.get("text").getAsString())); 316 if (json.has("_text")) 317 parseElementProperties(getJObject(json, "_text"), res.getTextElement()); 318 if (json.has("line")) { 319 JsonArray array = json.getAsJsonArray("line"); 320 for (int i = 0; i < array.size(); i++) { 321 if (array.get(i).isJsonNull()) { 322 res.getLine().add(new StringType()); 323 } else { 324 res.getLine().add(parseString(array.get(i).getAsString())); 325 } 326 } 327 } 328 ; 329 if (json.has("_line")) { 330 JsonArray array = json.getAsJsonArray("_line"); 331 for (int i = 0; i < array.size(); i++) { 332 if (i == res.getLine().size()) 333 res.getLine().add(parseString(null)); 334 if (array.get(i) instanceof JsonObject) 335 parseElementProperties(array.get(i).getAsJsonObject(), res.getLine().get(i)); 336 } 337 } 338 ; 339 if (json.has("city")) 340 res.setCityElement(parseString(json.get("city").getAsString())); 341 if (json.has("_city")) 342 parseElementProperties(getJObject(json, "_city"), res.getCityElement()); 343 if (json.has("district")) 344 res.setDistrictElement(parseString(json.get("district").getAsString())); 345 if (json.has("_district")) 346 parseElementProperties(getJObject(json, "_district"), res.getDistrictElement()); 347 if (json.has("state")) 348 res.setStateElement(parseString(json.get("state").getAsString())); 349 if (json.has("_state")) 350 parseElementProperties(getJObject(json, "_state"), res.getStateElement()); 351 if (json.has("postalCode")) 352 res.setPostalCodeElement(parseString(json.get("postalCode").getAsString())); 353 if (json.has("_postalCode")) 354 parseElementProperties(getJObject(json, "_postalCode"), res.getPostalCodeElement()); 355 if (json.has("country")) 356 res.setCountryElement(parseString(json.get("country").getAsString())); 357 if (json.has("_country")) 358 parseElementProperties(getJObject(json, "_country"), res.getCountryElement()); 359 if (json.has("period")) 360 res.setPeriod(parsePeriod(getJObject(json, "period"))); 361 } 362 363 protected Contributor parseContributor(JsonObject json) throws IOException, FHIRFormatError { 364 Contributor res = new Contributor(); 365 parseContributorProperties(json, res); 366 return res; 367 } 368 369 protected void parseContributorProperties(JsonObject json, Contributor res) throws IOException, FHIRFormatError { 370 parseTypeProperties(json, res); 371 if (json.has("type")) 372 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), Contributor.ContributorType.NULL, 373 new Contributor.ContributorTypeEnumFactory())); 374 if (json.has("_type")) 375 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 376 if (json.has("name")) 377 res.setNameElement(parseString(json.get("name").getAsString())); 378 if (json.has("_name")) 379 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 380 if (json.has("contact")) { 381 JsonArray array = json.getAsJsonArray("contact"); 382 for (int i = 0; i < array.size(); i++) { 383 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 384 } 385 } 386 ; 387 } 388 389 protected Attachment parseAttachment(JsonObject json) throws IOException, FHIRFormatError { 390 Attachment res = new Attachment(); 391 parseAttachmentProperties(json, res); 392 return res; 393 } 394 395 protected void parseAttachmentProperties(JsonObject json, Attachment res) throws IOException, FHIRFormatError { 396 parseTypeProperties(json, res); 397 if (json.has("contentType")) 398 res.setContentTypeElement(parseCode(json.get("contentType").getAsString())); 399 if (json.has("_contentType")) 400 parseElementProperties(getJObject(json, "_contentType"), res.getContentTypeElement()); 401 if (json.has("language")) 402 res.setLanguageElement(parseCode(json.get("language").getAsString())); 403 if (json.has("_language")) 404 parseElementProperties(getJObject(json, "_language"), res.getLanguageElement()); 405 if (json.has("data")) 406 res.setDataElement(parseBase64Binary(json.get("data").getAsString())); 407 if (json.has("_data")) 408 parseElementProperties(getJObject(json, "_data"), res.getDataElement()); 409 if (json.has("url")) 410 res.setUrlElement(parseUrl(json.get("url").getAsString())); 411 if (json.has("_url")) 412 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 413 if (json.has("size")) 414 res.setSizeElement(parseUnsignedInt(json.get("size").getAsString())); 415 if (json.has("_size")) 416 parseElementProperties(getJObject(json, "_size"), res.getSizeElement()); 417 if (json.has("hash")) 418 res.setHashElement(parseBase64Binary(json.get("hash").getAsString())); 419 if (json.has("_hash")) 420 parseElementProperties(getJObject(json, "_hash"), res.getHashElement()); 421 if (json.has("title")) 422 res.setTitleElement(parseString(json.get("title").getAsString())); 423 if (json.has("_title")) 424 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 425 if (json.has("creation")) 426 res.setCreationElement(parseDateTime(json.get("creation").getAsString())); 427 if (json.has("_creation")) 428 parseElementProperties(getJObject(json, "_creation"), res.getCreationElement()); 429 } 430 431 protected Count parseCount(JsonObject json) throws IOException, FHIRFormatError { 432 Count res = new Count(); 433 parseCountProperties(json, res); 434 return res; 435 } 436 437 protected void parseCountProperties(JsonObject json, Count res) throws IOException, FHIRFormatError { 438 parseQuantityProperties(json, res); 439 } 440 441 protected DataRequirement parseDataRequirement(JsonObject json) throws IOException, FHIRFormatError { 442 DataRequirement res = new DataRequirement(); 443 parseDataRequirementProperties(json, res); 444 return res; 445 } 446 447 protected void parseDataRequirementProperties(JsonObject json, DataRequirement res) 448 throws IOException, FHIRFormatError { 449 parseTypeProperties(json, res); 450 if (json.has("type")) 451 res.setTypeElement(parseCode(json.get("type").getAsString())); 452 if (json.has("_type")) 453 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 454 if (json.has("profile")) { 455 JsonArray array = json.getAsJsonArray("profile"); 456 for (int i = 0; i < array.size(); i++) { 457 if (array.get(i).isJsonNull()) { 458 res.getProfile().add(new CanonicalType()); 459 } else { 460 res.getProfile().add(parseCanonical(array.get(i).getAsString())); 461 } 462 } 463 } 464 ; 465 if (json.has("_profile")) { 466 JsonArray array = json.getAsJsonArray("_profile"); 467 for (int i = 0; i < array.size(); i++) { 468 if (i == res.getProfile().size()) 469 res.getProfile().add(parseCanonical(null)); 470 if (array.get(i) instanceof JsonObject) 471 parseElementProperties(array.get(i).getAsJsonObject(), res.getProfile().get(i)); 472 } 473 } 474 ; 475 Type subject = parseType("subject", json); 476 if (subject != null) 477 res.setSubject(subject); 478 if (json.has("mustSupport")) { 479 JsonArray array = json.getAsJsonArray("mustSupport"); 480 for (int i = 0; i < array.size(); i++) { 481 if (array.get(i).isJsonNull()) { 482 res.getMustSupport().add(new StringType()); 483 } else { 484 res.getMustSupport().add(parseString(array.get(i).getAsString())); 485 } 486 } 487 } 488 ; 489 if (json.has("_mustSupport")) { 490 JsonArray array = json.getAsJsonArray("_mustSupport"); 491 for (int i = 0; i < array.size(); i++) { 492 if (i == res.getMustSupport().size()) 493 res.getMustSupport().add(parseString(null)); 494 if (array.get(i) instanceof JsonObject) 495 parseElementProperties(array.get(i).getAsJsonObject(), res.getMustSupport().get(i)); 496 } 497 } 498 ; 499 if (json.has("codeFilter")) { 500 JsonArray array = json.getAsJsonArray("codeFilter"); 501 for (int i = 0; i < array.size(); i++) { 502 res.getCodeFilter() 503 .add(parseDataRequirementDataRequirementCodeFilterComponent(array.get(i).getAsJsonObject(), res)); 504 } 505 } 506 ; 507 if (json.has("dateFilter")) { 508 JsonArray array = json.getAsJsonArray("dateFilter"); 509 for (int i = 0; i < array.size(); i++) { 510 res.getDateFilter() 511 .add(parseDataRequirementDataRequirementDateFilterComponent(array.get(i).getAsJsonObject(), res)); 512 } 513 } 514 ; 515 if (json.has("limit")) 516 res.setLimitElement(parsePositiveInt(json.get("limit").getAsString())); 517 if (json.has("_limit")) 518 parseElementProperties(getJObject(json, "_limit"), res.getLimitElement()); 519 if (json.has("sort")) { 520 JsonArray array = json.getAsJsonArray("sort"); 521 for (int i = 0; i < array.size(); i++) { 522 res.getSort().add(parseDataRequirementDataRequirementSortComponent(array.get(i).getAsJsonObject(), res)); 523 } 524 } 525 ; 526 } 527 528 protected DataRequirement.DataRequirementCodeFilterComponent parseDataRequirementDataRequirementCodeFilterComponent( 529 JsonObject json, DataRequirement owner) throws IOException, FHIRFormatError { 530 DataRequirement.DataRequirementCodeFilterComponent res = new DataRequirement.DataRequirementCodeFilterComponent(); 531 parseDataRequirementDataRequirementCodeFilterComponentProperties(json, owner, res); 532 return res; 533 } 534 535 protected void parseDataRequirementDataRequirementCodeFilterComponentProperties(JsonObject json, 536 DataRequirement owner, DataRequirement.DataRequirementCodeFilterComponent res) 537 throws IOException, FHIRFormatError { 538 parseTypeProperties(json, res); 539 if (json.has("path")) 540 res.setPathElement(parseString(json.get("path").getAsString())); 541 if (json.has("_path")) 542 parseElementProperties(getJObject(json, "_path"), res.getPathElement()); 543 if (json.has("searchParam")) 544 res.setSearchParamElement(parseString(json.get("searchParam").getAsString())); 545 if (json.has("_searchParam")) 546 parseElementProperties(getJObject(json, "_searchParam"), res.getSearchParamElement()); 547 if (json.has("valueSet")) 548 res.setValueSetElement(parseCanonical(json.get("valueSet").getAsString())); 549 if (json.has("_valueSet")) 550 parseElementProperties(getJObject(json, "_valueSet"), res.getValueSetElement()); 551 if (json.has("code")) { 552 JsonArray array = json.getAsJsonArray("code"); 553 for (int i = 0; i < array.size(); i++) { 554 res.getCode().add(parseCoding(array.get(i).getAsJsonObject())); 555 } 556 } 557 ; 558 } 559 560 protected DataRequirement.DataRequirementDateFilterComponent parseDataRequirementDataRequirementDateFilterComponent( 561 JsonObject json, DataRequirement owner) throws IOException, FHIRFormatError { 562 DataRequirement.DataRequirementDateFilterComponent res = new DataRequirement.DataRequirementDateFilterComponent(); 563 parseDataRequirementDataRequirementDateFilterComponentProperties(json, owner, res); 564 return res; 565 } 566 567 protected void parseDataRequirementDataRequirementDateFilterComponentProperties(JsonObject json, 568 DataRequirement owner, DataRequirement.DataRequirementDateFilterComponent res) 569 throws IOException, FHIRFormatError { 570 parseTypeProperties(json, res); 571 if (json.has("path")) 572 res.setPathElement(parseString(json.get("path").getAsString())); 573 if (json.has("_path")) 574 parseElementProperties(getJObject(json, "_path"), res.getPathElement()); 575 if (json.has("searchParam")) 576 res.setSearchParamElement(parseString(json.get("searchParam").getAsString())); 577 if (json.has("_searchParam")) 578 parseElementProperties(getJObject(json, "_searchParam"), res.getSearchParamElement()); 579 Type value = parseType("value", json); 580 if (value != null) 581 res.setValue(value); 582 } 583 584 protected DataRequirement.DataRequirementSortComponent parseDataRequirementDataRequirementSortComponent( 585 JsonObject json, DataRequirement owner) throws IOException, FHIRFormatError { 586 DataRequirement.DataRequirementSortComponent res = new DataRequirement.DataRequirementSortComponent(); 587 parseDataRequirementDataRequirementSortComponentProperties(json, owner, res); 588 return res; 589 } 590 591 protected void parseDataRequirementDataRequirementSortComponentProperties(JsonObject json, DataRequirement owner, 592 DataRequirement.DataRequirementSortComponent res) throws IOException, FHIRFormatError { 593 parseTypeProperties(json, res); 594 if (json.has("path")) 595 res.setPathElement(parseString(json.get("path").getAsString())); 596 if (json.has("_path")) 597 parseElementProperties(getJObject(json, "_path"), res.getPathElement()); 598 if (json.has("direction")) 599 res.setDirectionElement(parseEnumeration(json.get("direction").getAsString(), DataRequirement.SortDirection.NULL, 600 new DataRequirement.SortDirectionEnumFactory())); 601 if (json.has("_direction")) 602 parseElementProperties(getJObject(json, "_direction"), res.getDirectionElement()); 603 } 604 605 protected Dosage parseDosage(JsonObject json) throws IOException, FHIRFormatError { 606 Dosage res = new Dosage(); 607 parseDosageProperties(json, res); 608 return res; 609 } 610 611 protected void parseDosageProperties(JsonObject json, Dosage res) throws IOException, FHIRFormatError { 612 parseBackboneElementProperties(json, res); 613 if (json.has("sequence")) 614 res.setSequenceElement(parseInteger(json.get("sequence").getAsLong())); 615 if (json.has("_sequence")) 616 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 617 if (json.has("text")) 618 res.setTextElement(parseString(json.get("text").getAsString())); 619 if (json.has("_text")) 620 parseElementProperties(getJObject(json, "_text"), res.getTextElement()); 621 if (json.has("additionalInstruction")) { 622 JsonArray array = json.getAsJsonArray("additionalInstruction"); 623 for (int i = 0; i < array.size(); i++) { 624 res.getAdditionalInstruction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 625 } 626 } 627 ; 628 if (json.has("patientInstruction")) 629 res.setPatientInstructionElement(parseString(json.get("patientInstruction").getAsString())); 630 if (json.has("_patientInstruction")) 631 parseElementProperties(getJObject(json, "_patientInstruction"), res.getPatientInstructionElement()); 632 if (json.has("timing")) 633 res.setTiming(parseTiming(getJObject(json, "timing"))); 634 Type asNeeded = parseType("asNeeded", json); 635 if (asNeeded != null) 636 res.setAsNeeded(asNeeded); 637 if (json.has("site")) 638 res.setSite(parseCodeableConcept(getJObject(json, "site"))); 639 if (json.has("route")) 640 res.setRoute(parseCodeableConcept(getJObject(json, "route"))); 641 if (json.has("method")) 642 res.setMethod(parseCodeableConcept(getJObject(json, "method"))); 643 if (json.has("doseAndRate")) { 644 JsonArray array = json.getAsJsonArray("doseAndRate"); 645 for (int i = 0; i < array.size(); i++) { 646 res.getDoseAndRate().add(parseDosageDosageDoseAndRateComponent(array.get(i).getAsJsonObject(), res)); 647 } 648 } 649 ; 650 if (json.has("maxDosePerPeriod")) 651 res.setMaxDosePerPeriod(parseRatio(getJObject(json, "maxDosePerPeriod"))); 652 if (json.has("maxDosePerAdministration")) 653 res.setMaxDosePerAdministration(parseQuantity(getJObject(json, "maxDosePerAdministration"))); 654 if (json.has("maxDosePerLifetime")) 655 res.setMaxDosePerLifetime(parseQuantity(getJObject(json, "maxDosePerLifetime"))); 656 } 657 658 protected Dosage.DosageDoseAndRateComponent parseDosageDosageDoseAndRateComponent(JsonObject json, Dosage owner) 659 throws IOException, FHIRFormatError { 660 Dosage.DosageDoseAndRateComponent res = new Dosage.DosageDoseAndRateComponent(); 661 parseDosageDosageDoseAndRateComponentProperties(json, owner, res); 662 return res; 663 } 664 665 protected void parseDosageDosageDoseAndRateComponentProperties(JsonObject json, Dosage owner, 666 Dosage.DosageDoseAndRateComponent res) throws IOException, FHIRFormatError { 667 parseTypeProperties(json, res); 668 if (json.has("type")) 669 res.setType(parseCodeableConcept(getJObject(json, "type"))); 670 Type dose = parseType("dose", json); 671 if (dose != null) 672 res.setDose(dose); 673 Type rate = parseType("rate", json); 674 if (rate != null) 675 res.setRate(rate); 676 } 677 678 protected Money parseMoney(JsonObject json) throws IOException, FHIRFormatError { 679 Money res = new Money(); 680 parseMoneyProperties(json, res); 681 return res; 682 } 683 684 protected void parseMoneyProperties(JsonObject json, Money res) throws IOException, FHIRFormatError { 685 parseTypeProperties(json, res); 686 if (json.has("value")) 687 res.setValueElement(parseDecimal(json.get("value").getAsBigDecimal())); 688 if (json.has("_value")) 689 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 690 if (json.has("currency")) 691 res.setCurrencyElement(parseCode(json.get("currency").getAsString())); 692 if (json.has("_currency")) 693 parseElementProperties(getJObject(json, "_currency"), res.getCurrencyElement()); 694 } 695 696 protected HumanName parseHumanName(JsonObject json) throws IOException, FHIRFormatError { 697 HumanName res = new HumanName(); 698 parseHumanNameProperties(json, res); 699 return res; 700 } 701 702 protected void parseHumanNameProperties(JsonObject json, HumanName res) throws IOException, FHIRFormatError { 703 parseTypeProperties(json, res); 704 if (json.has("use")) 705 res.setUseElement( 706 parseEnumeration(json.get("use").getAsString(), HumanName.NameUse.NULL, new HumanName.NameUseEnumFactory())); 707 if (json.has("_use")) 708 parseElementProperties(getJObject(json, "_use"), res.getUseElement()); 709 if (json.has("text")) 710 res.setTextElement(parseString(json.get("text").getAsString())); 711 if (json.has("_text")) 712 parseElementProperties(getJObject(json, "_text"), res.getTextElement()); 713 if (json.has("family")) 714 res.setFamilyElement(parseString(json.get("family").getAsString())); 715 if (json.has("_family")) 716 parseElementProperties(getJObject(json, "_family"), res.getFamilyElement()); 717 if (json.has("given")) { 718 JsonArray array = json.getAsJsonArray("given"); 719 for (int i = 0; i < array.size(); i++) { 720 if (array.get(i).isJsonNull()) { 721 res.getGiven().add(new StringType()); 722 } else { 723 res.getGiven().add(parseString(array.get(i).getAsString())); 724 } 725 } 726 } 727 ; 728 if (json.has("_given")) { 729 JsonArray array = json.getAsJsonArray("_given"); 730 for (int i = 0; i < array.size(); i++) { 731 if (i == res.getGiven().size()) 732 res.getGiven().add(parseString(null)); 733 if (array.get(i) instanceof JsonObject) 734 parseElementProperties(array.get(i).getAsJsonObject(), res.getGiven().get(i)); 735 } 736 } 737 ; 738 if (json.has("prefix")) { 739 JsonArray array = json.getAsJsonArray("prefix"); 740 for (int i = 0; i < array.size(); i++) { 741 if (array.get(i).isJsonNull()) { 742 res.getPrefix().add(new StringType()); 743 } else { 744 res.getPrefix().add(parseString(array.get(i).getAsString())); 745 } 746 } 747 } 748 ; 749 if (json.has("_prefix")) { 750 JsonArray array = json.getAsJsonArray("_prefix"); 751 for (int i = 0; i < array.size(); i++) { 752 if (i == res.getPrefix().size()) 753 res.getPrefix().add(parseString(null)); 754 if (array.get(i) instanceof JsonObject) 755 parseElementProperties(array.get(i).getAsJsonObject(), res.getPrefix().get(i)); 756 } 757 } 758 ; 759 if (json.has("suffix")) { 760 JsonArray array = json.getAsJsonArray("suffix"); 761 for (int i = 0; i < array.size(); i++) { 762 if (array.get(i).isJsonNull()) { 763 res.getSuffix().add(new StringType()); 764 } else { 765 res.getSuffix().add(parseString(array.get(i).getAsString())); 766 } 767 } 768 } 769 ; 770 if (json.has("_suffix")) { 771 JsonArray array = json.getAsJsonArray("_suffix"); 772 for (int i = 0; i < array.size(); i++) { 773 if (i == res.getSuffix().size()) 774 res.getSuffix().add(parseString(null)); 775 if (array.get(i) instanceof JsonObject) 776 parseElementProperties(array.get(i).getAsJsonObject(), res.getSuffix().get(i)); 777 } 778 } 779 ; 780 if (json.has("period")) 781 res.setPeriod(parsePeriod(getJObject(json, "period"))); 782 } 783 784 protected ContactPoint parseContactPoint(JsonObject json) throws IOException, FHIRFormatError { 785 ContactPoint res = new ContactPoint(); 786 parseContactPointProperties(json, res); 787 return res; 788 } 789 790 protected void parseContactPointProperties(JsonObject json, ContactPoint res) throws IOException, FHIRFormatError { 791 parseTypeProperties(json, res); 792 if (json.has("system")) 793 res.setSystemElement(parseEnumeration(json.get("system").getAsString(), ContactPoint.ContactPointSystem.NULL, 794 new ContactPoint.ContactPointSystemEnumFactory())); 795 if (json.has("_system")) 796 parseElementProperties(getJObject(json, "_system"), res.getSystemElement()); 797 if (json.has("value")) 798 res.setValueElement(parseString(json.get("value").getAsString())); 799 if (json.has("_value")) 800 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 801 if (json.has("use")) 802 res.setUseElement(parseEnumeration(json.get("use").getAsString(), ContactPoint.ContactPointUse.NULL, 803 new ContactPoint.ContactPointUseEnumFactory())); 804 if (json.has("_use")) 805 parseElementProperties(getJObject(json, "_use"), res.getUseElement()); 806 if (json.has("rank")) 807 res.setRankElement(parsePositiveInt(json.get("rank").getAsString())); 808 if (json.has("_rank")) 809 parseElementProperties(getJObject(json, "_rank"), res.getRankElement()); 810 if (json.has("period")) 811 res.setPeriod(parsePeriod(getJObject(json, "period"))); 812 } 813 814 protected MarketingStatus parseMarketingStatus(JsonObject json) throws IOException, FHIRFormatError { 815 MarketingStatus res = new MarketingStatus(); 816 parseMarketingStatusProperties(json, res); 817 return res; 818 } 819 820 protected void parseMarketingStatusProperties(JsonObject json, MarketingStatus res) 821 throws IOException, FHIRFormatError { 822 parseBackboneElementProperties(json, res); 823 if (json.has("country")) 824 res.setCountry(parseCodeableConcept(getJObject(json, "country"))); 825 if (json.has("jurisdiction")) 826 res.setJurisdiction(parseCodeableConcept(getJObject(json, "jurisdiction"))); 827 if (json.has("status")) 828 res.setStatus(parseCodeableConcept(getJObject(json, "status"))); 829 if (json.has("dateRange")) 830 res.setDateRange(parsePeriod(getJObject(json, "dateRange"))); 831 if (json.has("restoreDate")) 832 res.setRestoreDateElement(parseDateTime(json.get("restoreDate").getAsString())); 833 if (json.has("_restoreDate")) 834 parseElementProperties(getJObject(json, "_restoreDate"), res.getRestoreDateElement()); 835 } 836 837 protected Identifier parseIdentifier(JsonObject json) throws IOException, FHIRFormatError { 838 Identifier res = new Identifier(); 839 parseIdentifierProperties(json, res); 840 return res; 841 } 842 843 protected void parseIdentifierProperties(JsonObject json, Identifier res) throws IOException, FHIRFormatError { 844 parseTypeProperties(json, res); 845 if (json.has("use")) 846 res.setUseElement(parseEnumeration(json.get("use").getAsString(), Identifier.IdentifierUse.NULL, 847 new Identifier.IdentifierUseEnumFactory())); 848 if (json.has("_use")) 849 parseElementProperties(getJObject(json, "_use"), res.getUseElement()); 850 if (json.has("type")) 851 res.setType(parseCodeableConcept(getJObject(json, "type"))); 852 if (json.has("system")) 853 res.setSystemElement(parseUri(json.get("system").getAsString())); 854 if (json.has("_system")) 855 parseElementProperties(getJObject(json, "_system"), res.getSystemElement()); 856 if (json.has("value")) 857 res.setValueElement(parseString(json.get("value").getAsString())); 858 if (json.has("_value")) 859 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 860 if (json.has("period")) 861 res.setPeriod(parsePeriod(getJObject(json, "period"))); 862 if (json.has("assigner")) 863 res.setAssigner(parseReference(getJObject(json, "assigner"))); 864 } 865 866 protected SubstanceAmount parseSubstanceAmount(JsonObject json) throws IOException, FHIRFormatError { 867 SubstanceAmount res = new SubstanceAmount(); 868 parseSubstanceAmountProperties(json, res); 869 return res; 870 } 871 872 protected void parseSubstanceAmountProperties(JsonObject json, SubstanceAmount res) 873 throws IOException, FHIRFormatError { 874 parseBackboneElementProperties(json, res); 875 Type amount = parseType("amount", json); 876 if (amount != null) 877 res.setAmount(amount); 878 if (json.has("amountType")) 879 res.setAmountType(parseCodeableConcept(getJObject(json, "amountType"))); 880 if (json.has("amountText")) 881 res.setAmountTextElement(parseString(json.get("amountText").getAsString())); 882 if (json.has("_amountText")) 883 parseElementProperties(getJObject(json, "_amountText"), res.getAmountTextElement()); 884 if (json.has("referenceRange")) 885 res.setReferenceRange( 886 parseSubstanceAmountSubstanceAmountReferenceRangeComponent(getJObject(json, "referenceRange"), res)); 887 } 888 889 protected SubstanceAmount.SubstanceAmountReferenceRangeComponent parseSubstanceAmountSubstanceAmountReferenceRangeComponent( 890 JsonObject json, SubstanceAmount owner) throws IOException, FHIRFormatError { 891 SubstanceAmount.SubstanceAmountReferenceRangeComponent res = new SubstanceAmount.SubstanceAmountReferenceRangeComponent(); 892 parseSubstanceAmountSubstanceAmountReferenceRangeComponentProperties(json, owner, res); 893 return res; 894 } 895 896 protected void parseSubstanceAmountSubstanceAmountReferenceRangeComponentProperties(JsonObject json, 897 SubstanceAmount owner, SubstanceAmount.SubstanceAmountReferenceRangeComponent res) 898 throws IOException, FHIRFormatError { 899 parseTypeProperties(json, res); 900 if (json.has("lowLimit")) 901 res.setLowLimit(parseQuantity(getJObject(json, "lowLimit"))); 902 if (json.has("highLimit")) 903 res.setHighLimit(parseQuantity(getJObject(json, "highLimit"))); 904 } 905 906 protected Coding parseCoding(JsonObject json) throws IOException, FHIRFormatError { 907 Coding res = new Coding(); 908 parseCodingProperties(json, res); 909 return res; 910 } 911 912 protected void parseCodingProperties(JsonObject json, Coding res) throws IOException, FHIRFormatError { 913 parseTypeProperties(json, res); 914 if (json.has("system")) 915 res.setSystemElement(parseUri(json.get("system").getAsString())); 916 if (json.has("_system")) 917 parseElementProperties(getJObject(json, "_system"), res.getSystemElement()); 918 if (json.has("version")) 919 res.setVersionElement(parseString(json.get("version").getAsString())); 920 if (json.has("_version")) 921 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 922 if (json.has("code")) 923 res.setCodeElement(parseCode(json.get("code").getAsString())); 924 if (json.has("_code")) 925 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 926 if (json.has("display")) 927 res.setDisplayElement(parseString(json.get("display").getAsString())); 928 if (json.has("_display")) 929 parseElementProperties(getJObject(json, "_display"), res.getDisplayElement()); 930 if (json.has("userSelected")) 931 res.setUserSelectedElement(parseBoolean(json.get("userSelected").getAsBoolean())); 932 if (json.has("_userSelected")) 933 parseElementProperties(getJObject(json, "_userSelected"), res.getUserSelectedElement()); 934 } 935 936 protected SampledData parseSampledData(JsonObject json) throws IOException, FHIRFormatError { 937 SampledData res = new SampledData(); 938 parseSampledDataProperties(json, res); 939 return res; 940 } 941 942 protected void parseSampledDataProperties(JsonObject json, SampledData res) throws IOException, FHIRFormatError { 943 parseTypeProperties(json, res); 944 if (json.has("origin")) 945 res.setOrigin(parseQuantity(getJObject(json, "origin"))); 946 if (json.has("period")) 947 res.setPeriodElement(parseDecimal(json.get("period").getAsBigDecimal())); 948 if (json.has("_period")) 949 parseElementProperties(getJObject(json, "_period"), res.getPeriodElement()); 950 if (json.has("factor")) 951 res.setFactorElement(parseDecimal(json.get("factor").getAsBigDecimal())); 952 if (json.has("_factor")) 953 parseElementProperties(getJObject(json, "_factor"), res.getFactorElement()); 954 if (json.has("lowerLimit")) 955 res.setLowerLimitElement(parseDecimal(json.get("lowerLimit").getAsBigDecimal())); 956 if (json.has("_lowerLimit")) 957 parseElementProperties(getJObject(json, "_lowerLimit"), res.getLowerLimitElement()); 958 if (json.has("upperLimit")) 959 res.setUpperLimitElement(parseDecimal(json.get("upperLimit").getAsBigDecimal())); 960 if (json.has("_upperLimit")) 961 parseElementProperties(getJObject(json, "_upperLimit"), res.getUpperLimitElement()); 962 if (json.has("dimensions")) 963 res.setDimensionsElement(parsePositiveInt(json.get("dimensions").getAsString())); 964 if (json.has("_dimensions")) 965 parseElementProperties(getJObject(json, "_dimensions"), res.getDimensionsElement()); 966 if (json.has("data")) 967 res.setDataElement(parseString(json.get("data").getAsString())); 968 if (json.has("_data")) 969 parseElementProperties(getJObject(json, "_data"), res.getDataElement()); 970 } 971 972 protected Population parsePopulation(JsonObject json) throws IOException, FHIRFormatError { 973 Population res = new Population(); 974 parsePopulationProperties(json, res); 975 return res; 976 } 977 978 protected void parsePopulationProperties(JsonObject json, Population res) throws IOException, FHIRFormatError { 979 parseBackboneElementProperties(json, res); 980 Type age = parseType("age", json); 981 if (age != null) 982 res.setAge(age); 983 if (json.has("gender")) 984 res.setGender(parseCodeableConcept(getJObject(json, "gender"))); 985 if (json.has("race")) 986 res.setRace(parseCodeableConcept(getJObject(json, "race"))); 987 if (json.has("physiologicalCondition")) 988 res.setPhysiologicalCondition(parseCodeableConcept(getJObject(json, "physiologicalCondition"))); 989 } 990 991 protected Ratio parseRatio(JsonObject json) throws IOException, FHIRFormatError { 992 Ratio res = new Ratio(); 993 parseRatioProperties(json, res); 994 return res; 995 } 996 997 protected void parseRatioProperties(JsonObject json, Ratio res) throws IOException, FHIRFormatError { 998 parseTypeProperties(json, res); 999 if (json.has("numerator")) 1000 res.setNumerator(parseQuantity(getJObject(json, "numerator"))); 1001 if (json.has("denominator")) 1002 res.setDenominator(parseQuantity(getJObject(json, "denominator"))); 1003 } 1004 1005 protected Distance parseDistance(JsonObject json) throws IOException, FHIRFormatError { 1006 Distance res = new Distance(); 1007 parseDistanceProperties(json, res); 1008 return res; 1009 } 1010 1011 protected void parseDistanceProperties(JsonObject json, Distance res) throws IOException, FHIRFormatError { 1012 parseQuantityProperties(json, res); 1013 } 1014 1015 protected Age parseAge(JsonObject json) throws IOException, FHIRFormatError { 1016 Age res = new Age(); 1017 parseAgeProperties(json, res); 1018 return res; 1019 } 1020 1021 protected void parseAgeProperties(JsonObject json, Age res) throws IOException, FHIRFormatError { 1022 parseQuantityProperties(json, res); 1023 } 1024 1025 protected Reference parseReference(JsonObject json) throws IOException, FHIRFormatError { 1026 Reference res = new Reference(); 1027 parseReferenceProperties(json, res); 1028 return res; 1029 } 1030 1031 protected void parseReferenceProperties(JsonObject json, Reference res) throws IOException, FHIRFormatError { 1032 parseTypeProperties(json, res); 1033 if (json.has("reference")) 1034 res.setReferenceElement(parseString(json.get("reference").getAsString())); 1035 if (json.has("_reference")) 1036 parseElementProperties(getJObject(json, "_reference"), res.getReferenceElement()); 1037 if (json.has("type")) 1038 res.setTypeElement(parseUri(json.get("type").getAsString())); 1039 if (json.has("_type")) 1040 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 1041 if (json.has("identifier")) 1042 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 1043 if (json.has("display")) 1044 res.setDisplayElement(parseString(json.get("display").getAsString())); 1045 if (json.has("_display")) 1046 parseElementProperties(getJObject(json, "_display"), res.getDisplayElement()); 1047 } 1048 1049 protected TriggerDefinition parseTriggerDefinition(JsonObject json) throws IOException, FHIRFormatError { 1050 TriggerDefinition res = new TriggerDefinition(); 1051 parseTriggerDefinitionProperties(json, res); 1052 return res; 1053 } 1054 1055 protected void parseTriggerDefinitionProperties(JsonObject json, TriggerDefinition res) 1056 throws IOException, FHIRFormatError { 1057 parseTypeProperties(json, res); 1058 if (json.has("type")) 1059 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), TriggerDefinition.TriggerType.NULL, 1060 new TriggerDefinition.TriggerTypeEnumFactory())); 1061 if (json.has("_type")) 1062 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 1063 if (json.has("name")) 1064 res.setNameElement(parseString(json.get("name").getAsString())); 1065 if (json.has("_name")) 1066 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 1067 Type timing = parseType("timing", json); 1068 if (timing != null) 1069 res.setTiming(timing); 1070 if (json.has("data")) { 1071 JsonArray array = json.getAsJsonArray("data"); 1072 for (int i = 0; i < array.size(); i++) { 1073 res.getData().add(parseDataRequirement(array.get(i).getAsJsonObject())); 1074 } 1075 } 1076 ; 1077 if (json.has("condition")) 1078 res.setCondition(parseExpression(getJObject(json, "condition"))); 1079 } 1080 1081 protected Quantity parseQuantity(JsonObject json) throws IOException, FHIRFormatError { 1082 Quantity res = new Quantity(); 1083 parseQuantityProperties(json, res); 1084 return res; 1085 } 1086 1087 protected void parseQuantityProperties(JsonObject json, Quantity res) throws IOException, FHIRFormatError { 1088 parseTypeProperties(json, res); 1089 if (json.has("value")) 1090 res.setValueElement(parseDecimal(json.get("value").getAsBigDecimal())); 1091 if (json.has("_value")) 1092 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 1093 if (json.has("comparator")) 1094 res.setComparatorElement(parseEnumeration(json.get("comparator").getAsString(), Quantity.QuantityComparator.NULL, 1095 new Quantity.QuantityComparatorEnumFactory())); 1096 if (json.has("_comparator")) 1097 parseElementProperties(getJObject(json, "_comparator"), res.getComparatorElement()); 1098 if (json.has("unit")) 1099 res.setUnitElement(parseString(json.get("unit").getAsString())); 1100 if (json.has("_unit")) 1101 parseElementProperties(getJObject(json, "_unit"), res.getUnitElement()); 1102 if (json.has("system")) 1103 res.setSystemElement(parseUri(json.get("system").getAsString())); 1104 if (json.has("_system")) 1105 parseElementProperties(getJObject(json, "_system"), res.getSystemElement()); 1106 if (json.has("code")) 1107 res.setCodeElement(parseCode(json.get("code").getAsString())); 1108 if (json.has("_code")) 1109 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 1110 } 1111 1112 protected Period parsePeriod(JsonObject json) throws IOException, FHIRFormatError { 1113 Period res = new Period(); 1114 parsePeriodProperties(json, res); 1115 return res; 1116 } 1117 1118 protected void parsePeriodProperties(JsonObject json, Period res) throws IOException, FHIRFormatError { 1119 parseTypeProperties(json, res); 1120 if (json.has("start")) 1121 res.setStartElement(parseDateTime(json.get("start").getAsString())); 1122 if (json.has("_start")) 1123 parseElementProperties(getJObject(json, "_start"), res.getStartElement()); 1124 if (json.has("end")) 1125 res.setEndElement(parseDateTime(json.get("end").getAsString())); 1126 if (json.has("_end")) 1127 parseElementProperties(getJObject(json, "_end"), res.getEndElement()); 1128 } 1129 1130 protected Duration parseDuration(JsonObject json) throws IOException, FHIRFormatError { 1131 Duration res = new Duration(); 1132 parseDurationProperties(json, res); 1133 return res; 1134 } 1135 1136 protected void parseDurationProperties(JsonObject json, Duration res) throws IOException, FHIRFormatError { 1137 parseQuantityProperties(json, res); 1138 } 1139 1140 protected Range parseRange(JsonObject json) throws IOException, FHIRFormatError { 1141 Range res = new Range(); 1142 parseRangeProperties(json, res); 1143 return res; 1144 } 1145 1146 protected void parseRangeProperties(JsonObject json, Range res) throws IOException, FHIRFormatError { 1147 parseTypeProperties(json, res); 1148 if (json.has("low")) 1149 res.setLow(parseQuantity(getJObject(json, "low"))); 1150 if (json.has("high")) 1151 res.setHigh(parseQuantity(getJObject(json, "high"))); 1152 } 1153 1154 protected RelatedArtifact parseRelatedArtifact(JsonObject json) throws IOException, FHIRFormatError { 1155 RelatedArtifact res = new RelatedArtifact(); 1156 parseRelatedArtifactProperties(json, res); 1157 return res; 1158 } 1159 1160 protected void parseRelatedArtifactProperties(JsonObject json, RelatedArtifact res) 1161 throws IOException, FHIRFormatError { 1162 parseTypeProperties(json, res); 1163 if (json.has("type")) 1164 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), RelatedArtifact.RelatedArtifactType.NULL, 1165 new RelatedArtifact.RelatedArtifactTypeEnumFactory())); 1166 if (json.has("_type")) 1167 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 1168 if (json.has("label")) 1169 res.setLabelElement(parseString(json.get("label").getAsString())); 1170 if (json.has("_label")) 1171 parseElementProperties(getJObject(json, "_label"), res.getLabelElement()); 1172 if (json.has("display")) 1173 res.setDisplayElement(parseString(json.get("display").getAsString())); 1174 if (json.has("_display")) 1175 parseElementProperties(getJObject(json, "_display"), res.getDisplayElement()); 1176 if (json.has("citation")) 1177 res.setCitationElement(parseMarkdown(json.get("citation").getAsString())); 1178 if (json.has("_citation")) 1179 parseElementProperties(getJObject(json, "_citation"), res.getCitationElement()); 1180 if (json.has("url")) 1181 res.setUrlElement(parseUrl(json.get("url").getAsString())); 1182 if (json.has("_url")) 1183 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 1184 if (json.has("document")) 1185 res.setDocument(parseAttachment(getJObject(json, "document"))); 1186 if (json.has("resource")) 1187 res.setResourceElement(parseCanonical(json.get("resource").getAsString())); 1188 if (json.has("_resource")) 1189 parseElementProperties(getJObject(json, "_resource"), res.getResourceElement()); 1190 } 1191 1192 protected Annotation parseAnnotation(JsonObject json) throws IOException, FHIRFormatError { 1193 Annotation res = new Annotation(); 1194 parseAnnotationProperties(json, res); 1195 return res; 1196 } 1197 1198 protected void parseAnnotationProperties(JsonObject json, Annotation res) throws IOException, FHIRFormatError { 1199 parseTypeProperties(json, res); 1200 Type author = parseType("author", json); 1201 if (author != null) 1202 res.setAuthor(author); 1203 if (json.has("time")) 1204 res.setTimeElement(parseDateTime(json.get("time").getAsString())); 1205 if (json.has("_time")) 1206 parseElementProperties(getJObject(json, "_time"), res.getTimeElement()); 1207 if (json.has("text")) 1208 res.setTextElement(parseMarkdown(json.get("text").getAsString())); 1209 if (json.has("_text")) 1210 parseElementProperties(getJObject(json, "_text"), res.getTextElement()); 1211 } 1212 1213 protected ProductShelfLife parseProductShelfLife(JsonObject json) throws IOException, FHIRFormatError { 1214 ProductShelfLife res = new ProductShelfLife(); 1215 parseProductShelfLifeProperties(json, res); 1216 return res; 1217 } 1218 1219 protected void parseProductShelfLifeProperties(JsonObject json, ProductShelfLife res) 1220 throws IOException, FHIRFormatError { 1221 parseBackboneElementProperties(json, res); 1222 if (json.has("identifier")) 1223 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 1224 if (json.has("type")) 1225 res.setType(parseCodeableConcept(getJObject(json, "type"))); 1226 if (json.has("period")) 1227 res.setPeriod(parseQuantity(getJObject(json, "period"))); 1228 if (json.has("specialPrecautionsForStorage")) { 1229 JsonArray array = json.getAsJsonArray("specialPrecautionsForStorage"); 1230 for (int i = 0; i < array.size(); i++) { 1231 res.getSpecialPrecautionsForStorage().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 1232 } 1233 } 1234 ; 1235 } 1236 1237 protected ContactDetail parseContactDetail(JsonObject json) throws IOException, FHIRFormatError { 1238 ContactDetail res = new ContactDetail(); 1239 parseContactDetailProperties(json, res); 1240 return res; 1241 } 1242 1243 protected void parseContactDetailProperties(JsonObject json, ContactDetail res) throws IOException, FHIRFormatError { 1244 parseTypeProperties(json, res); 1245 if (json.has("name")) 1246 res.setNameElement(parseString(json.get("name").getAsString())); 1247 if (json.has("_name")) 1248 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 1249 if (json.has("telecom")) { 1250 JsonArray array = json.getAsJsonArray("telecom"); 1251 for (int i = 0; i < array.size(); i++) { 1252 res.getTelecom().add(parseContactPoint(array.get(i).getAsJsonObject())); 1253 } 1254 } 1255 ; 1256 } 1257 1258 protected UsageContext parseUsageContext(JsonObject json) throws IOException, FHIRFormatError { 1259 UsageContext res = new UsageContext(); 1260 parseUsageContextProperties(json, res); 1261 return res; 1262 } 1263 1264 protected void parseUsageContextProperties(JsonObject json, UsageContext res) throws IOException, FHIRFormatError { 1265 parseTypeProperties(json, res); 1266 if (json.has("code")) 1267 res.setCode(parseCoding(getJObject(json, "code"))); 1268 Type value = parseType("value", json); 1269 if (value != null) 1270 res.setValue(value); 1271 } 1272 1273 protected Expression parseExpression(JsonObject json) throws IOException, FHIRFormatError { 1274 Expression res = new Expression(); 1275 parseExpressionProperties(json, res); 1276 return res; 1277 } 1278 1279 protected void parseExpressionProperties(JsonObject json, Expression res) throws IOException, FHIRFormatError { 1280 parseElementProperties(json, res); 1281 if (json.has("description")) 1282 res.setDescriptionElement(parseString(json.get("description").getAsString())); 1283 if (json.has("_description")) 1284 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 1285 if (json.has("name")) 1286 res.setNameElement(parseId(json.get("name").getAsString())); 1287 if (json.has("_name")) 1288 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 1289 if (json.has("language")) 1290 res.setLanguageElement(parseCode(json.get("language").getAsString())); 1291 if (json.has("_language")) 1292 parseElementProperties(getJObject(json, "_language"), res.getLanguageElement()); 1293 if (json.has("expression")) 1294 res.setExpressionElement(parseString(json.get("expression").getAsString())); 1295 if (json.has("_expression")) 1296 parseElementProperties(getJObject(json, "_expression"), res.getExpressionElement()); 1297 if (json.has("reference")) 1298 res.setReferenceElement(parseUri(json.get("reference").getAsString())); 1299 if (json.has("_reference")) 1300 parseElementProperties(getJObject(json, "_reference"), res.getReferenceElement()); 1301 } 1302 1303 protected Signature parseSignature(JsonObject json) throws IOException, FHIRFormatError { 1304 Signature res = new Signature(); 1305 parseSignatureProperties(json, res); 1306 return res; 1307 } 1308 1309 protected void parseSignatureProperties(JsonObject json, Signature res) throws IOException, FHIRFormatError { 1310 parseTypeProperties(json, res); 1311 if (json.has("type")) { 1312 JsonArray array = json.getAsJsonArray("type"); 1313 for (int i = 0; i < array.size(); i++) { 1314 res.getType().add(parseCoding(array.get(i).getAsJsonObject())); 1315 } 1316 } 1317 ; 1318 if (json.has("when")) 1319 res.setWhenElement(parseInstant(json.get("when").getAsString())); 1320 if (json.has("_when")) 1321 parseElementProperties(getJObject(json, "_when"), res.getWhenElement()); 1322 if (json.has("who")) 1323 res.setWho(parseReference(getJObject(json, "who"))); 1324 if (json.has("onBehalfOf")) 1325 res.setOnBehalfOf(parseReference(getJObject(json, "onBehalfOf"))); 1326 if (json.has("targetFormat")) 1327 res.setTargetFormatElement(parseCode(json.get("targetFormat").getAsString())); 1328 if (json.has("_targetFormat")) 1329 parseElementProperties(getJObject(json, "_targetFormat"), res.getTargetFormatElement()); 1330 if (json.has("sigFormat")) 1331 res.setSigFormatElement(parseCode(json.get("sigFormat").getAsString())); 1332 if (json.has("_sigFormat")) 1333 parseElementProperties(getJObject(json, "_sigFormat"), res.getSigFormatElement()); 1334 if (json.has("data")) 1335 res.setDataElement(parseBase64Binary(json.get("data").getAsString())); 1336 if (json.has("_data")) 1337 parseElementProperties(getJObject(json, "_data"), res.getDataElement()); 1338 } 1339 1340 protected Timing parseTiming(JsonObject json) throws IOException, FHIRFormatError { 1341 Timing res = new Timing(); 1342 parseTimingProperties(json, res); 1343 return res; 1344 } 1345 1346 protected void parseTimingProperties(JsonObject json, Timing res) throws IOException, FHIRFormatError { 1347 parseBackboneElementProperties(json, res); 1348 if (json.has("event")) { 1349 JsonArray array = json.getAsJsonArray("event"); 1350 for (int i = 0; i < array.size(); i++) { 1351 if (array.get(i).isJsonNull()) { 1352 res.getEvent().add(new DateTimeType()); 1353 } else { 1354 res.getEvent().add(parseDateTime(array.get(i).getAsString())); 1355 } 1356 } 1357 } 1358 ; 1359 if (json.has("_event")) { 1360 JsonArray array = json.getAsJsonArray("_event"); 1361 for (int i = 0; i < array.size(); i++) { 1362 if (i == res.getEvent().size()) 1363 res.getEvent().add(parseDateTime(null)); 1364 if (array.get(i) instanceof JsonObject) 1365 parseElementProperties(array.get(i).getAsJsonObject(), res.getEvent().get(i)); 1366 } 1367 } 1368 ; 1369 if (json.has("repeat")) 1370 res.setRepeat(parseTimingTimingRepeatComponent(getJObject(json, "repeat"), res)); 1371 if (json.has("code")) 1372 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 1373 } 1374 1375 protected Timing.TimingRepeatComponent parseTimingTimingRepeatComponent(JsonObject json, Timing owner) 1376 throws IOException, FHIRFormatError { 1377 Timing.TimingRepeatComponent res = new Timing.TimingRepeatComponent(); 1378 parseTimingTimingRepeatComponentProperties(json, owner, res); 1379 return res; 1380 } 1381 1382 protected void parseTimingTimingRepeatComponentProperties(JsonObject json, Timing owner, 1383 Timing.TimingRepeatComponent res) throws IOException, FHIRFormatError { 1384 parseTypeProperties(json, res); 1385 Type bounds = parseType("bounds", json); 1386 if (bounds != null) 1387 res.setBounds(bounds); 1388 if (json.has("count")) 1389 res.setCountElement(parsePositiveInt(json.get("count").getAsString())); 1390 if (json.has("_count")) 1391 parseElementProperties(getJObject(json, "_count"), res.getCountElement()); 1392 if (json.has("countMax")) 1393 res.setCountMaxElement(parsePositiveInt(json.get("countMax").getAsString())); 1394 if (json.has("_countMax")) 1395 parseElementProperties(getJObject(json, "_countMax"), res.getCountMaxElement()); 1396 if (json.has("duration")) 1397 res.setDurationElement(parseDecimal(json.get("duration").getAsBigDecimal())); 1398 if (json.has("_duration")) 1399 parseElementProperties(getJObject(json, "_duration"), res.getDurationElement()); 1400 if (json.has("durationMax")) 1401 res.setDurationMaxElement(parseDecimal(json.get("durationMax").getAsBigDecimal())); 1402 if (json.has("_durationMax")) 1403 parseElementProperties(getJObject(json, "_durationMax"), res.getDurationMaxElement()); 1404 if (json.has("durationUnit")) 1405 res.setDurationUnitElement(parseEnumeration(json.get("durationUnit").getAsString(), Timing.UnitsOfTime.NULL, 1406 new Timing.UnitsOfTimeEnumFactory())); 1407 if (json.has("_durationUnit")) 1408 parseElementProperties(getJObject(json, "_durationUnit"), res.getDurationUnitElement()); 1409 if (json.has("frequency")) 1410 res.setFrequencyElement(parsePositiveInt(json.get("frequency").getAsString())); 1411 if (json.has("_frequency")) 1412 parseElementProperties(getJObject(json, "_frequency"), res.getFrequencyElement()); 1413 if (json.has("frequencyMax")) 1414 res.setFrequencyMaxElement(parsePositiveInt(json.get("frequencyMax").getAsString())); 1415 if (json.has("_frequencyMax")) 1416 parseElementProperties(getJObject(json, "_frequencyMax"), res.getFrequencyMaxElement()); 1417 if (json.has("period")) 1418 res.setPeriodElement(parseDecimal(json.get("period").getAsBigDecimal())); 1419 if (json.has("_period")) 1420 parseElementProperties(getJObject(json, "_period"), res.getPeriodElement()); 1421 if (json.has("periodMax")) 1422 res.setPeriodMaxElement(parseDecimal(json.get("periodMax").getAsBigDecimal())); 1423 if (json.has("_periodMax")) 1424 parseElementProperties(getJObject(json, "_periodMax"), res.getPeriodMaxElement()); 1425 if (json.has("periodUnit")) 1426 res.setPeriodUnitElement(parseEnumeration(json.get("periodUnit").getAsString(), Timing.UnitsOfTime.NULL, 1427 new Timing.UnitsOfTimeEnumFactory())); 1428 if (json.has("_periodUnit")) 1429 parseElementProperties(getJObject(json, "_periodUnit"), res.getPeriodUnitElement()); 1430 if (json.has("dayOfWeek")) { 1431 JsonArray array = json.getAsJsonArray("dayOfWeek"); 1432 for (int i = 0; i < array.size(); i++) { 1433 if (array.get(i).isJsonNull()) { 1434 res.getDayOfWeek().add(new Enumeration<Timing.DayOfWeek>()); 1435 } else { 1436 res.getDayOfWeek().add( 1437 parseEnumeration(array.get(i).getAsString(), Timing.DayOfWeek.NULL, new Timing.DayOfWeekEnumFactory())); 1438 } 1439 } 1440 } 1441 ; 1442 if (json.has("_dayOfWeek")) { 1443 JsonArray array = json.getAsJsonArray("_dayOfWeek"); 1444 for (int i = 0; i < array.size(); i++) { 1445 if (i == res.getDayOfWeek().size()) 1446 res.getDayOfWeek().add(parseEnumeration(null, Timing.DayOfWeek.NULL, new Timing.DayOfWeekEnumFactory())); 1447 if (array.get(i) instanceof JsonObject) 1448 parseElementProperties(array.get(i).getAsJsonObject(), res.getDayOfWeek().get(i)); 1449 } 1450 } 1451 ; 1452 if (json.has("timeOfDay")) { 1453 JsonArray array = json.getAsJsonArray("timeOfDay"); 1454 for (int i = 0; i < array.size(); i++) { 1455 if (array.get(i).isJsonNull()) { 1456 res.getTimeOfDay().add(new TimeType()); 1457 } else { 1458 res.getTimeOfDay().add(parseTime(array.get(i).getAsString())); 1459 } 1460 } 1461 } 1462 ; 1463 if (json.has("_timeOfDay")) { 1464 JsonArray array = json.getAsJsonArray("_timeOfDay"); 1465 for (int i = 0; i < array.size(); i++) { 1466 if (i == res.getTimeOfDay().size()) 1467 res.getTimeOfDay().add(parseTime(null)); 1468 if (array.get(i) instanceof JsonObject) 1469 parseElementProperties(array.get(i).getAsJsonObject(), res.getTimeOfDay().get(i)); 1470 } 1471 } 1472 ; 1473 if (json.has("when")) { 1474 JsonArray array = json.getAsJsonArray("when"); 1475 for (int i = 0; i < array.size(); i++) { 1476 if (array.get(i).isJsonNull()) { 1477 res.getWhen().add(new Enumeration<Timing.EventTiming>()); 1478 } else { 1479 res.getWhen().add(parseEnumeration(array.get(i).getAsString(), Timing.EventTiming.NULL, 1480 new Timing.EventTimingEnumFactory())); 1481 } 1482 } 1483 } 1484 ; 1485 if (json.has("_when")) { 1486 JsonArray array = json.getAsJsonArray("_when"); 1487 for (int i = 0; i < array.size(); i++) { 1488 if (i == res.getWhen().size()) 1489 res.getWhen().add(parseEnumeration(null, Timing.EventTiming.NULL, new Timing.EventTimingEnumFactory())); 1490 if (array.get(i) instanceof JsonObject) 1491 parseElementProperties(array.get(i).getAsJsonObject(), res.getWhen().get(i)); 1492 } 1493 } 1494 ; 1495 if (json.has("offset")) 1496 res.setOffsetElement(parseUnsignedInt(json.get("offset").getAsString())); 1497 if (json.has("_offset")) 1498 parseElementProperties(getJObject(json, "_offset"), res.getOffsetElement()); 1499 } 1500 1501 protected ProdCharacteristic parseProdCharacteristic(JsonObject json) throws IOException, FHIRFormatError { 1502 ProdCharacteristic res = new ProdCharacteristic(); 1503 parseProdCharacteristicProperties(json, res); 1504 return res; 1505 } 1506 1507 protected void parseProdCharacteristicProperties(JsonObject json, ProdCharacteristic res) 1508 throws IOException, FHIRFormatError { 1509 parseBackboneElementProperties(json, res); 1510 if (json.has("height")) 1511 res.setHeight(parseQuantity(getJObject(json, "height"))); 1512 if (json.has("width")) 1513 res.setWidth(parseQuantity(getJObject(json, "width"))); 1514 if (json.has("depth")) 1515 res.setDepth(parseQuantity(getJObject(json, "depth"))); 1516 if (json.has("weight")) 1517 res.setWeight(parseQuantity(getJObject(json, "weight"))); 1518 if (json.has("nominalVolume")) 1519 res.setNominalVolume(parseQuantity(getJObject(json, "nominalVolume"))); 1520 if (json.has("externalDiameter")) 1521 res.setExternalDiameter(parseQuantity(getJObject(json, "externalDiameter"))); 1522 if (json.has("shape")) 1523 res.setShapeElement(parseString(json.get("shape").getAsString())); 1524 if (json.has("_shape")) 1525 parseElementProperties(getJObject(json, "_shape"), res.getShapeElement()); 1526 if (json.has("color")) { 1527 JsonArray array = json.getAsJsonArray("color"); 1528 for (int i = 0; i < array.size(); i++) { 1529 if (array.get(i).isJsonNull()) { 1530 res.getColor().add(new StringType()); 1531 } else { 1532 res.getColor().add(parseString(array.get(i).getAsString())); 1533 } 1534 } 1535 } 1536 ; 1537 if (json.has("_color")) { 1538 JsonArray array = json.getAsJsonArray("_color"); 1539 for (int i = 0; i < array.size(); i++) { 1540 if (i == res.getColor().size()) 1541 res.getColor().add(parseString(null)); 1542 if (array.get(i) instanceof JsonObject) 1543 parseElementProperties(array.get(i).getAsJsonObject(), res.getColor().get(i)); 1544 } 1545 } 1546 ; 1547 if (json.has("imprint")) { 1548 JsonArray array = json.getAsJsonArray("imprint"); 1549 for (int i = 0; i < array.size(); i++) { 1550 if (array.get(i).isJsonNull()) { 1551 res.getImprint().add(new StringType()); 1552 } else { 1553 res.getImprint().add(parseString(array.get(i).getAsString())); 1554 } 1555 } 1556 } 1557 ; 1558 if (json.has("_imprint")) { 1559 JsonArray array = json.getAsJsonArray("_imprint"); 1560 for (int i = 0; i < array.size(); i++) { 1561 if (i == res.getImprint().size()) 1562 res.getImprint().add(parseString(null)); 1563 if (array.get(i) instanceof JsonObject) 1564 parseElementProperties(array.get(i).getAsJsonObject(), res.getImprint().get(i)); 1565 } 1566 } 1567 ; 1568 if (json.has("image")) { 1569 JsonArray array = json.getAsJsonArray("image"); 1570 for (int i = 0; i < array.size(); i++) { 1571 res.getImage().add(parseAttachment(array.get(i).getAsJsonObject())); 1572 } 1573 } 1574 ; 1575 if (json.has("scoring")) 1576 res.setScoring(parseCodeableConcept(getJObject(json, "scoring"))); 1577 } 1578 1579 protected CodeableConcept parseCodeableConcept(JsonObject json) throws IOException, FHIRFormatError { 1580 CodeableConcept res = new CodeableConcept(); 1581 parseCodeableConceptProperties(json, res); 1582 return res; 1583 } 1584 1585 protected void parseCodeableConceptProperties(JsonObject json, CodeableConcept res) 1586 throws IOException, FHIRFormatError { 1587 parseTypeProperties(json, res); 1588 if (json.has("coding")) { 1589 JsonArray array = json.getAsJsonArray("coding"); 1590 for (int i = 0; i < array.size(); i++) { 1591 res.getCoding().add(parseCoding(array.get(i).getAsJsonObject())); 1592 } 1593 } 1594 ; 1595 if (json.has("text")) 1596 res.setTextElement(parseString(json.get("text").getAsString())); 1597 if (json.has("_text")) 1598 parseElementProperties(getJObject(json, "_text"), res.getTextElement()); 1599 } 1600 1601 protected ParameterDefinition parseParameterDefinition(JsonObject json) throws IOException, FHIRFormatError { 1602 ParameterDefinition res = new ParameterDefinition(); 1603 parseParameterDefinitionProperties(json, res); 1604 return res; 1605 } 1606 1607 protected void parseParameterDefinitionProperties(JsonObject json, ParameterDefinition res) 1608 throws IOException, FHIRFormatError { 1609 parseTypeProperties(json, res); 1610 if (json.has("name")) 1611 res.setNameElement(parseCode(json.get("name").getAsString())); 1612 if (json.has("_name")) 1613 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 1614 if (json.has("use")) 1615 res.setUseElement(parseEnumeration(json.get("use").getAsString(), ParameterDefinition.ParameterUse.NULL, 1616 new ParameterDefinition.ParameterUseEnumFactory())); 1617 if (json.has("_use")) 1618 parseElementProperties(getJObject(json, "_use"), res.getUseElement()); 1619 if (json.has("min")) 1620 res.setMinElement(parseInteger(json.get("min").getAsLong())); 1621 if (json.has("_min")) 1622 parseElementProperties(getJObject(json, "_min"), res.getMinElement()); 1623 if (json.has("max")) 1624 res.setMaxElement(parseString(json.get("max").getAsString())); 1625 if (json.has("_max")) 1626 parseElementProperties(getJObject(json, "_max"), res.getMaxElement()); 1627 if (json.has("documentation")) 1628 res.setDocumentationElement(parseString(json.get("documentation").getAsString())); 1629 if (json.has("_documentation")) 1630 parseElementProperties(getJObject(json, "_documentation"), res.getDocumentationElement()); 1631 if (json.has("type")) 1632 res.setTypeElement(parseCode(json.get("type").getAsString())); 1633 if (json.has("_type")) 1634 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 1635 if (json.has("profile")) 1636 res.setProfileElement(parseCanonical(json.get("profile").getAsString())); 1637 if (json.has("_profile")) 1638 parseElementProperties(getJObject(json, "_profile"), res.getProfileElement()); 1639 } 1640 1641 protected ElementDefinition parseElementDefinition(JsonObject json) throws IOException, FHIRFormatError { 1642 ElementDefinition res = new ElementDefinition(); 1643 parseElementDefinitionProperties(json, res); 1644 return res; 1645 } 1646 1647 protected void parseElementDefinitionProperties(JsonObject json, ElementDefinition res) 1648 throws IOException, FHIRFormatError { 1649 parseBackboneElementProperties(json, res); 1650 if (json.has("path")) 1651 res.setPathElement(parseString(json.get("path").getAsString())); 1652 if (json.has("_path")) 1653 parseElementProperties(getJObject(json, "_path"), res.getPathElement()); 1654 if (json.has("representation")) { 1655 JsonArray array = json.getAsJsonArray("representation"); 1656 for (int i = 0; i < array.size(); i++) { 1657 if (array.get(i).isJsonNull()) { 1658 res.getRepresentation().add(new Enumeration<ElementDefinition.PropertyRepresentation>()); 1659 } else { 1660 res.getRepresentation() 1661 .add(parseEnumeration(array.get(i).getAsString(), ElementDefinition.PropertyRepresentation.NULL, 1662 new ElementDefinition.PropertyRepresentationEnumFactory())); 1663 } 1664 } 1665 } 1666 ; 1667 if (json.has("_representation")) { 1668 JsonArray array = json.getAsJsonArray("_representation"); 1669 for (int i = 0; i < array.size(); i++) { 1670 if (i == res.getRepresentation().size()) 1671 res.getRepresentation().add(parseEnumeration(null, ElementDefinition.PropertyRepresentation.NULL, 1672 new ElementDefinition.PropertyRepresentationEnumFactory())); 1673 if (array.get(i) instanceof JsonObject) 1674 parseElementProperties(array.get(i).getAsJsonObject(), res.getRepresentation().get(i)); 1675 } 1676 } 1677 ; 1678 if (json.has("sliceName")) 1679 res.setSliceNameElement(parseString(json.get("sliceName").getAsString())); 1680 if (json.has("_sliceName")) 1681 parseElementProperties(getJObject(json, "_sliceName"), res.getSliceNameElement()); 1682 if (json.has("sliceIsConstraining")) 1683 res.setSliceIsConstrainingElement(parseBoolean(json.get("sliceIsConstraining").getAsBoolean())); 1684 if (json.has("_sliceIsConstraining")) 1685 parseElementProperties(getJObject(json, "_sliceIsConstraining"), res.getSliceIsConstrainingElement()); 1686 if (json.has("label")) 1687 res.setLabelElement(parseString(json.get("label").getAsString())); 1688 if (json.has("_label")) 1689 parseElementProperties(getJObject(json, "_label"), res.getLabelElement()); 1690 if (json.has("code")) { 1691 JsonArray array = json.getAsJsonArray("code"); 1692 for (int i = 0; i < array.size(); i++) { 1693 res.getCode().add(parseCoding(array.get(i).getAsJsonObject())); 1694 } 1695 } 1696 ; 1697 if (json.has("slicing")) 1698 res.setSlicing(parseElementDefinitionElementDefinitionSlicingComponent(getJObject(json, "slicing"), res)); 1699 if (json.has("short")) 1700 res.setShortElement(parseString(json.get("short").getAsString())); 1701 if (json.has("_short")) 1702 parseElementProperties(getJObject(json, "_short"), res.getShortElement()); 1703 if (json.has("definition")) 1704 res.setDefinitionElement(parseMarkdown(json.get("definition").getAsString())); 1705 if (json.has("_definition")) 1706 parseElementProperties(getJObject(json, "_definition"), res.getDefinitionElement()); 1707 if (json.has("comment")) 1708 res.setCommentElement(parseMarkdown(json.get("comment").getAsString())); 1709 if (json.has("_comment")) 1710 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 1711 if (json.has("requirements")) 1712 res.setRequirementsElement(parseMarkdown(json.get("requirements").getAsString())); 1713 if (json.has("_requirements")) 1714 parseElementProperties(getJObject(json, "_requirements"), res.getRequirementsElement()); 1715 if (json.has("alias")) { 1716 JsonArray array = json.getAsJsonArray("alias"); 1717 for (int i = 0; i < array.size(); i++) { 1718 if (array.get(i).isJsonNull()) { 1719 res.getAlias().add(new StringType()); 1720 } else { 1721 res.getAlias().add(parseString(array.get(i).getAsString())); 1722 } 1723 } 1724 } 1725 ; 1726 if (json.has("_alias")) { 1727 JsonArray array = json.getAsJsonArray("_alias"); 1728 for (int i = 0; i < array.size(); i++) { 1729 if (i == res.getAlias().size()) 1730 res.getAlias().add(parseString(null)); 1731 if (array.get(i) instanceof JsonObject) 1732 parseElementProperties(array.get(i).getAsJsonObject(), res.getAlias().get(i)); 1733 } 1734 } 1735 ; 1736 if (json.has("min")) 1737 res.setMinElement(parseUnsignedInt(json.get("min").getAsString())); 1738 if (json.has("_min")) 1739 parseElementProperties(getJObject(json, "_min"), res.getMinElement()); 1740 if (json.has("max")) 1741 res.setMaxElement(parseString(json.get("max").getAsString())); 1742 if (json.has("_max")) 1743 parseElementProperties(getJObject(json, "_max"), res.getMaxElement()); 1744 if (json.has("base")) 1745 res.setBase(parseElementDefinitionElementDefinitionBaseComponent(getJObject(json, "base"), res)); 1746 if (json.has("contentReference")) 1747 res.setContentReferenceElement(parseUri(json.get("contentReference").getAsString())); 1748 if (json.has("_contentReference")) 1749 parseElementProperties(getJObject(json, "_contentReference"), res.getContentReferenceElement()); 1750 if (json.has("type")) { 1751 JsonArray array = json.getAsJsonArray("type"); 1752 for (int i = 0; i < array.size(); i++) { 1753 res.getType().add(parseElementDefinitionTypeRefComponent(array.get(i).getAsJsonObject(), res)); 1754 } 1755 } 1756 ; 1757 Type defaultValue = parseType("defaultValue", json); 1758 if (defaultValue != null) 1759 res.setDefaultValue(defaultValue); 1760 if (json.has("meaningWhenMissing")) 1761 res.setMeaningWhenMissingElement(parseMarkdown(json.get("meaningWhenMissing").getAsString())); 1762 if (json.has("_meaningWhenMissing")) 1763 parseElementProperties(getJObject(json, "_meaningWhenMissing"), res.getMeaningWhenMissingElement()); 1764 if (json.has("orderMeaning")) 1765 res.setOrderMeaningElement(parseString(json.get("orderMeaning").getAsString())); 1766 if (json.has("_orderMeaning")) 1767 parseElementProperties(getJObject(json, "_orderMeaning"), res.getOrderMeaningElement()); 1768 Type fixed = parseType("fixed", json); 1769 if (fixed != null) 1770 res.setFixed(fixed); 1771 Type pattern = parseType("pattern", json); 1772 if (pattern != null) 1773 res.setPattern(pattern); 1774 if (json.has("example")) { 1775 JsonArray array = json.getAsJsonArray("example"); 1776 for (int i = 0; i < array.size(); i++) { 1777 res.getExample() 1778 .add(parseElementDefinitionElementDefinitionExampleComponent(array.get(i).getAsJsonObject(), res)); 1779 } 1780 } 1781 ; 1782 Type minValue = parseType("minValue", json); 1783 if (minValue != null) 1784 res.setMinValue(minValue); 1785 Type maxValue = parseType("maxValue", json); 1786 if (maxValue != null) 1787 res.setMaxValue(maxValue); 1788 if (json.has("maxLength")) 1789 res.setMaxLengthElement(parseInteger(json.get("maxLength").getAsLong())); 1790 if (json.has("_maxLength")) 1791 parseElementProperties(getJObject(json, "_maxLength"), res.getMaxLengthElement()); 1792 if (json.has("condition")) { 1793 JsonArray array = json.getAsJsonArray("condition"); 1794 for (int i = 0; i < array.size(); i++) { 1795 if (array.get(i).isJsonNull()) { 1796 res.getCondition().add(new IdType()); 1797 } else { 1798 res.getCondition().add(parseId(array.get(i).getAsString())); 1799 } 1800 } 1801 } 1802 ; 1803 if (json.has("_condition")) { 1804 JsonArray array = json.getAsJsonArray("_condition"); 1805 for (int i = 0; i < array.size(); i++) { 1806 if (i == res.getCondition().size()) 1807 res.getCondition().add(parseId(null)); 1808 if (array.get(i) instanceof JsonObject) 1809 parseElementProperties(array.get(i).getAsJsonObject(), res.getCondition().get(i)); 1810 } 1811 } 1812 ; 1813 if (json.has("constraint")) { 1814 JsonArray array = json.getAsJsonArray("constraint"); 1815 for (int i = 0; i < array.size(); i++) { 1816 res.getConstraint() 1817 .add(parseElementDefinitionElementDefinitionConstraintComponent(array.get(i).getAsJsonObject(), res)); 1818 } 1819 } 1820 ; 1821 if (json.has("mustSupport")) 1822 res.setMustSupportElement(parseBoolean(json.get("mustSupport").getAsBoolean())); 1823 if (json.has("_mustSupport")) 1824 parseElementProperties(getJObject(json, "_mustSupport"), res.getMustSupportElement()); 1825 if (json.has("isModifier")) 1826 res.setIsModifierElement(parseBoolean(json.get("isModifier").getAsBoolean())); 1827 if (json.has("_isModifier")) 1828 parseElementProperties(getJObject(json, "_isModifier"), res.getIsModifierElement()); 1829 if (json.has("isModifierReason")) 1830 res.setIsModifierReasonElement(parseString(json.get("isModifierReason").getAsString())); 1831 if (json.has("_isModifierReason")) 1832 parseElementProperties(getJObject(json, "_isModifierReason"), res.getIsModifierReasonElement()); 1833 if (json.has("isSummary")) 1834 res.setIsSummaryElement(parseBoolean(json.get("isSummary").getAsBoolean())); 1835 if (json.has("_isSummary")) 1836 parseElementProperties(getJObject(json, "_isSummary"), res.getIsSummaryElement()); 1837 if (json.has("binding")) 1838 res.setBinding(parseElementDefinitionElementDefinitionBindingComponent(getJObject(json, "binding"), res)); 1839 if (json.has("mapping")) { 1840 JsonArray array = json.getAsJsonArray("mapping"); 1841 for (int i = 0; i < array.size(); i++) { 1842 res.getMapping() 1843 .add(parseElementDefinitionElementDefinitionMappingComponent(array.get(i).getAsJsonObject(), res)); 1844 } 1845 } 1846 ; 1847 } 1848 1849 protected ElementDefinition.ElementDefinitionSlicingComponent parseElementDefinitionElementDefinitionSlicingComponent( 1850 JsonObject json, ElementDefinition owner) throws IOException, FHIRFormatError { 1851 ElementDefinition.ElementDefinitionSlicingComponent res = new ElementDefinition.ElementDefinitionSlicingComponent(); 1852 parseElementDefinitionElementDefinitionSlicingComponentProperties(json, owner, res); 1853 return res; 1854 } 1855 1856 protected void parseElementDefinitionElementDefinitionSlicingComponentProperties(JsonObject json, 1857 ElementDefinition owner, ElementDefinition.ElementDefinitionSlicingComponent res) 1858 throws IOException, FHIRFormatError { 1859 parseTypeProperties(json, res); 1860 if (json.has("discriminator")) { 1861 JsonArray array = json.getAsJsonArray("discriminator"); 1862 for (int i = 0; i < array.size(); i++) { 1863 res.getDiscriminator().add(parseElementDefinitionElementDefinitionSlicingDiscriminatorComponent( 1864 array.get(i).getAsJsonObject(), owner)); 1865 } 1866 } 1867 ; 1868 if (json.has("description")) 1869 res.setDescriptionElement(parseString(json.get("description").getAsString())); 1870 if (json.has("_description")) 1871 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 1872 if (json.has("ordered")) 1873 res.setOrderedElement(parseBoolean(json.get("ordered").getAsBoolean())); 1874 if (json.has("_ordered")) 1875 parseElementProperties(getJObject(json, "_ordered"), res.getOrderedElement()); 1876 if (json.has("rules")) 1877 res.setRulesElement(parseEnumeration(json.get("rules").getAsString(), ElementDefinition.SlicingRules.NULL, 1878 new ElementDefinition.SlicingRulesEnumFactory())); 1879 if (json.has("_rules")) 1880 parseElementProperties(getJObject(json, "_rules"), res.getRulesElement()); 1881 } 1882 1883 protected ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent parseElementDefinitionElementDefinitionSlicingDiscriminatorComponent( 1884 JsonObject json, ElementDefinition owner) throws IOException, FHIRFormatError { 1885 ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent res = new ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent(); 1886 parseElementDefinitionElementDefinitionSlicingDiscriminatorComponentProperties(json, owner, res); 1887 return res; 1888 } 1889 1890 protected void parseElementDefinitionElementDefinitionSlicingDiscriminatorComponentProperties(JsonObject json, 1891 ElementDefinition owner, ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent res) 1892 throws IOException, FHIRFormatError { 1893 parseTypeProperties(json, res); 1894 if (json.has("type")) 1895 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), ElementDefinition.DiscriminatorType.NULL, 1896 new ElementDefinition.DiscriminatorTypeEnumFactory())); 1897 if (json.has("_type")) 1898 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 1899 if (json.has("path")) 1900 res.setPathElement(parseString(json.get("path").getAsString())); 1901 if (json.has("_path")) 1902 parseElementProperties(getJObject(json, "_path"), res.getPathElement()); 1903 } 1904 1905 protected ElementDefinition.ElementDefinitionBaseComponent parseElementDefinitionElementDefinitionBaseComponent( 1906 JsonObject json, ElementDefinition owner) throws IOException, FHIRFormatError { 1907 ElementDefinition.ElementDefinitionBaseComponent res = new ElementDefinition.ElementDefinitionBaseComponent(); 1908 parseElementDefinitionElementDefinitionBaseComponentProperties(json, owner, res); 1909 return res; 1910 } 1911 1912 protected void parseElementDefinitionElementDefinitionBaseComponentProperties(JsonObject json, 1913 ElementDefinition owner, ElementDefinition.ElementDefinitionBaseComponent res) 1914 throws IOException, FHIRFormatError { 1915 parseTypeProperties(json, res); 1916 if (json.has("path")) 1917 res.setPathElement(parseString(json.get("path").getAsString())); 1918 if (json.has("_path")) 1919 parseElementProperties(getJObject(json, "_path"), res.getPathElement()); 1920 if (json.has("min")) 1921 res.setMinElement(parseUnsignedInt(json.get("min").getAsString())); 1922 if (json.has("_min")) 1923 parseElementProperties(getJObject(json, "_min"), res.getMinElement()); 1924 if (json.has("max")) 1925 res.setMaxElement(parseString(json.get("max").getAsString())); 1926 if (json.has("_max")) 1927 parseElementProperties(getJObject(json, "_max"), res.getMaxElement()); 1928 } 1929 1930 protected ElementDefinition.TypeRefComponent parseElementDefinitionTypeRefComponent(JsonObject json, 1931 ElementDefinition owner) throws IOException, FHIRFormatError { 1932 ElementDefinition.TypeRefComponent res = new ElementDefinition.TypeRefComponent(); 1933 parseElementDefinitionTypeRefComponentProperties(json, owner, res); 1934 return res; 1935 } 1936 1937 protected void parseElementDefinitionTypeRefComponentProperties(JsonObject json, ElementDefinition owner, 1938 ElementDefinition.TypeRefComponent res) throws IOException, FHIRFormatError { 1939 parseTypeProperties(json, res); 1940 if (json.has("code")) 1941 res.setCodeElement(parseUri(json.get("code").getAsString())); 1942 if (json.has("_code")) 1943 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 1944 if (json.has("profile")) { 1945 JsonArray array = json.getAsJsonArray("profile"); 1946 for (int i = 0; i < array.size(); i++) { 1947 if (array.get(i).isJsonNull()) { 1948 res.getProfile().add(new CanonicalType()); 1949 } else { 1950 res.getProfile().add(parseCanonical(array.get(i).getAsString())); 1951 } 1952 } 1953 } 1954 ; 1955 if (json.has("_profile")) { 1956 JsonArray array = json.getAsJsonArray("_profile"); 1957 for (int i = 0; i < array.size(); i++) { 1958 if (i == res.getProfile().size()) 1959 res.getProfile().add(parseCanonical(null)); 1960 if (array.get(i) instanceof JsonObject) 1961 parseElementProperties(array.get(i).getAsJsonObject(), res.getProfile().get(i)); 1962 } 1963 } 1964 ; 1965 if (json.has("targetProfile")) { 1966 JsonArray array = json.getAsJsonArray("targetProfile"); 1967 for (int i = 0; i < array.size(); i++) { 1968 if (array.get(i).isJsonNull()) { 1969 res.getTargetProfile().add(new CanonicalType()); 1970 } else { 1971 res.getTargetProfile().add(parseCanonical(array.get(i).getAsString())); 1972 } 1973 } 1974 } 1975 ; 1976 if (json.has("_targetProfile")) { 1977 JsonArray array = json.getAsJsonArray("_targetProfile"); 1978 for (int i = 0; i < array.size(); i++) { 1979 if (i == res.getTargetProfile().size()) 1980 res.getTargetProfile().add(parseCanonical(null)); 1981 if (array.get(i) instanceof JsonObject) 1982 parseElementProperties(array.get(i).getAsJsonObject(), res.getTargetProfile().get(i)); 1983 } 1984 } 1985 ; 1986 if (json.has("aggregation")) { 1987 JsonArray array = json.getAsJsonArray("aggregation"); 1988 for (int i = 0; i < array.size(); i++) { 1989 if (array.get(i).isJsonNull()) { 1990 res.getAggregation().add(new Enumeration<ElementDefinition.AggregationMode>()); 1991 } else { 1992 res.getAggregation().add(parseEnumeration(array.get(i).getAsString(), ElementDefinition.AggregationMode.NULL, 1993 new ElementDefinition.AggregationModeEnumFactory())); 1994 } 1995 } 1996 } 1997 ; 1998 if (json.has("_aggregation")) { 1999 JsonArray array = json.getAsJsonArray("_aggregation"); 2000 for (int i = 0; i < array.size(); i++) { 2001 if (i == res.getAggregation().size()) 2002 res.getAggregation().add(parseEnumeration(null, ElementDefinition.AggregationMode.NULL, 2003 new ElementDefinition.AggregationModeEnumFactory())); 2004 if (array.get(i) instanceof JsonObject) 2005 parseElementProperties(array.get(i).getAsJsonObject(), res.getAggregation().get(i)); 2006 } 2007 } 2008 ; 2009 if (json.has("versioning")) 2010 res.setVersioningElement(parseEnumeration(json.get("versioning").getAsString(), 2011 ElementDefinition.ReferenceVersionRules.NULL, new ElementDefinition.ReferenceVersionRulesEnumFactory())); 2012 if (json.has("_versioning")) 2013 parseElementProperties(getJObject(json, "_versioning"), res.getVersioningElement()); 2014 } 2015 2016 protected ElementDefinition.ElementDefinitionExampleComponent parseElementDefinitionElementDefinitionExampleComponent( 2017 JsonObject json, ElementDefinition owner) throws IOException, FHIRFormatError { 2018 ElementDefinition.ElementDefinitionExampleComponent res = new ElementDefinition.ElementDefinitionExampleComponent(); 2019 parseElementDefinitionElementDefinitionExampleComponentProperties(json, owner, res); 2020 return res; 2021 } 2022 2023 protected void parseElementDefinitionElementDefinitionExampleComponentProperties(JsonObject json, 2024 ElementDefinition owner, ElementDefinition.ElementDefinitionExampleComponent res) 2025 throws IOException, FHIRFormatError { 2026 parseTypeProperties(json, res); 2027 if (json.has("label")) 2028 res.setLabelElement(parseString(json.get("label").getAsString())); 2029 if (json.has("_label")) 2030 parseElementProperties(getJObject(json, "_label"), res.getLabelElement()); 2031 Type value = parseType("value", json); 2032 if (value != null) 2033 res.setValue(value); 2034 } 2035 2036 protected ElementDefinition.ElementDefinitionConstraintComponent parseElementDefinitionElementDefinitionConstraintComponent( 2037 JsonObject json, ElementDefinition owner) throws IOException, FHIRFormatError { 2038 ElementDefinition.ElementDefinitionConstraintComponent res = new ElementDefinition.ElementDefinitionConstraintComponent(); 2039 parseElementDefinitionElementDefinitionConstraintComponentProperties(json, owner, res); 2040 return res; 2041 } 2042 2043 protected void parseElementDefinitionElementDefinitionConstraintComponentProperties(JsonObject json, 2044 ElementDefinition owner, ElementDefinition.ElementDefinitionConstraintComponent res) 2045 throws IOException, FHIRFormatError { 2046 parseTypeProperties(json, res); 2047 if (json.has("key")) 2048 res.setKeyElement(parseId(json.get("key").getAsString())); 2049 if (json.has("_key")) 2050 parseElementProperties(getJObject(json, "_key"), res.getKeyElement()); 2051 if (json.has("requirements")) 2052 res.setRequirementsElement(parseString(json.get("requirements").getAsString())); 2053 if (json.has("_requirements")) 2054 parseElementProperties(getJObject(json, "_requirements"), res.getRequirementsElement()); 2055 if (json.has("severity")) 2056 res.setSeverityElement(parseEnumeration(json.get("severity").getAsString(), 2057 ElementDefinition.ConstraintSeverity.NULL, new ElementDefinition.ConstraintSeverityEnumFactory())); 2058 if (json.has("_severity")) 2059 parseElementProperties(getJObject(json, "_severity"), res.getSeverityElement()); 2060 if (json.has("human")) 2061 res.setHumanElement(parseString(json.get("human").getAsString())); 2062 if (json.has("_human")) 2063 parseElementProperties(getJObject(json, "_human"), res.getHumanElement()); 2064 if (json.has("expression")) 2065 res.setExpressionElement(parseString(json.get("expression").getAsString())); 2066 if (json.has("_expression")) 2067 parseElementProperties(getJObject(json, "_expression"), res.getExpressionElement()); 2068 if (json.has("xpath")) 2069 res.setXpathElement(parseString(json.get("xpath").getAsString())); 2070 if (json.has("_xpath")) 2071 parseElementProperties(getJObject(json, "_xpath"), res.getXpathElement()); 2072 if (json.has("source")) 2073 res.setSourceElement(parseCanonical(json.get("source").getAsString())); 2074 if (json.has("_source")) 2075 parseElementProperties(getJObject(json, "_source"), res.getSourceElement()); 2076 } 2077 2078 protected ElementDefinition.ElementDefinitionBindingComponent parseElementDefinitionElementDefinitionBindingComponent( 2079 JsonObject json, ElementDefinition owner) throws IOException, FHIRFormatError { 2080 ElementDefinition.ElementDefinitionBindingComponent res = new ElementDefinition.ElementDefinitionBindingComponent(); 2081 parseElementDefinitionElementDefinitionBindingComponentProperties(json, owner, res); 2082 return res; 2083 } 2084 2085 protected void parseElementDefinitionElementDefinitionBindingComponentProperties(JsonObject json, 2086 ElementDefinition owner, ElementDefinition.ElementDefinitionBindingComponent res) 2087 throws IOException, FHIRFormatError { 2088 parseTypeProperties(json, res); 2089 if (json.has("strength")) 2090 res.setStrengthElement(parseEnumeration(json.get("strength").getAsString(), Enumerations.BindingStrength.NULL, 2091 new Enumerations.BindingStrengthEnumFactory())); 2092 if (json.has("_strength")) 2093 parseElementProperties(getJObject(json, "_strength"), res.getStrengthElement()); 2094 if (json.has("description")) 2095 res.setDescriptionElement(parseString(json.get("description").getAsString())); 2096 if (json.has("_description")) 2097 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 2098 if (json.has("valueSet")) 2099 res.setValueSetElement(parseCanonical(json.get("valueSet").getAsString())); 2100 if (json.has("_valueSet")) 2101 parseElementProperties(getJObject(json, "_valueSet"), res.getValueSetElement()); 2102 } 2103 2104 protected ElementDefinition.ElementDefinitionMappingComponent parseElementDefinitionElementDefinitionMappingComponent( 2105 JsonObject json, ElementDefinition owner) throws IOException, FHIRFormatError { 2106 ElementDefinition.ElementDefinitionMappingComponent res = new ElementDefinition.ElementDefinitionMappingComponent(); 2107 parseElementDefinitionElementDefinitionMappingComponentProperties(json, owner, res); 2108 return res; 2109 } 2110 2111 protected void parseElementDefinitionElementDefinitionMappingComponentProperties(JsonObject json, 2112 ElementDefinition owner, ElementDefinition.ElementDefinitionMappingComponent res) 2113 throws IOException, FHIRFormatError { 2114 parseTypeProperties(json, res); 2115 if (json.has("identity")) 2116 res.setIdentityElement(parseId(json.get("identity").getAsString())); 2117 if (json.has("_identity")) 2118 parseElementProperties(getJObject(json, "_identity"), res.getIdentityElement()); 2119 if (json.has("language")) 2120 res.setLanguageElement(parseCode(json.get("language").getAsString())); 2121 if (json.has("_language")) 2122 parseElementProperties(getJObject(json, "_language"), res.getLanguageElement()); 2123 if (json.has("map")) 2124 res.setMapElement(parseString(json.get("map").getAsString())); 2125 if (json.has("_map")) 2126 parseElementProperties(getJObject(json, "_map"), res.getMapElement()); 2127 if (json.has("comment")) 2128 res.setCommentElement(parseString(json.get("comment").getAsString())); 2129 if (json.has("_comment")) 2130 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 2131 } 2132 2133 protected void parseDomainResourceProperties(JsonObject json, DomainResource res) 2134 throws IOException, FHIRFormatError { 2135 parseResourceProperties(json, res); 2136 if (json.has("text")) 2137 res.setText(parseNarrative(getJObject(json, "text"))); 2138 if (json.has("contained")) { 2139 JsonArray array = json.getAsJsonArray("contained"); 2140 for (int i = 0; i < array.size(); i++) { 2141 res.getContained().add(parseResource(array.get(i).getAsJsonObject())); 2142 } 2143 } 2144 ; 2145 if (json.has("extension")) { 2146 JsonArray array = json.getAsJsonArray("extension"); 2147 for (int i = 0; i < array.size(); i++) { 2148 res.getExtension().add(parseExtension(array.get(i).getAsJsonObject())); 2149 } 2150 } 2151 ; 2152 if (json.has("modifierExtension")) { 2153 JsonArray array = json.getAsJsonArray("modifierExtension"); 2154 for (int i = 0; i < array.size(); i++) { 2155 res.getModifierExtension().add(parseExtension(array.get(i).getAsJsonObject())); 2156 } 2157 } 2158 ; 2159 } 2160 2161 protected Parameters parseParameters(JsonObject json) throws IOException, FHIRFormatError { 2162 Parameters res = new Parameters(); 2163 parseParametersProperties(json, res); 2164 return res; 2165 } 2166 2167 protected void parseParametersProperties(JsonObject json, Parameters res) throws IOException, FHIRFormatError { 2168 parseResourceProperties(json, res); 2169 if (json.has("parameter")) { 2170 JsonArray array = json.getAsJsonArray("parameter"); 2171 for (int i = 0; i < array.size(); i++) { 2172 res.getParameter().add(parseParametersParametersParameterComponent(array.get(i).getAsJsonObject(), res)); 2173 } 2174 } 2175 ; 2176 } 2177 2178 protected Parameters.ParametersParameterComponent parseParametersParametersParameterComponent(JsonObject json, 2179 Parameters owner) throws IOException, FHIRFormatError { 2180 Parameters.ParametersParameterComponent res = new Parameters.ParametersParameterComponent(); 2181 parseParametersParametersParameterComponentProperties(json, owner, res); 2182 return res; 2183 } 2184 2185 protected void parseParametersParametersParameterComponentProperties(JsonObject json, Parameters owner, 2186 Parameters.ParametersParameterComponent res) throws IOException, FHIRFormatError { 2187 parseBackboneElementProperties(json, res); 2188 if (json.has("name")) 2189 res.setNameElement(parseString(json.get("name").getAsString())); 2190 if (json.has("_name")) 2191 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 2192 Type value = parseType("value", json); 2193 if (value != null) 2194 res.setValue(value); 2195 if (json.has("resource")) 2196 res.setResource(parseResource(getJObject(json, "resource"))); 2197 if (json.has("part")) { 2198 JsonArray array = json.getAsJsonArray("part"); 2199 for (int i = 0; i < array.size(); i++) { 2200 res.getPart().add(parseParametersParametersParameterComponent(array.get(i).getAsJsonObject(), owner)); 2201 } 2202 } 2203 ; 2204 } 2205 2206 protected void parseResourceProperties(JsonObject json, Resource res) throws IOException, FHIRFormatError { 2207 if (json.has("id")) 2208 res.setIdElement(parseId(json.get("id").getAsString())); 2209 if (json.has("_id")) 2210 parseElementProperties(getJObject(json, "_id"), res.getIdElement()); 2211 if (json.has("meta")) 2212 res.setMeta(parseMeta(getJObject(json, "meta"))); 2213 if (json.has("implicitRules")) 2214 res.setImplicitRulesElement(parseUri(json.get("implicitRules").getAsString())); 2215 if (json.has("_implicitRules")) 2216 parseElementProperties(getJObject(json, "_implicitRules"), res.getImplicitRulesElement()); 2217 if (json.has("language")) 2218 res.setLanguageElement(parseCode(json.get("language").getAsString())); 2219 if (json.has("_language")) 2220 parseElementProperties(getJObject(json, "_language"), res.getLanguageElement()); 2221 } 2222 2223 protected Account parseAccount(JsonObject json) throws IOException, FHIRFormatError { 2224 Account res = new Account(); 2225 parseAccountProperties(json, res); 2226 return res; 2227 } 2228 2229 protected void parseAccountProperties(JsonObject json, Account res) throws IOException, FHIRFormatError { 2230 parseDomainResourceProperties(json, res); 2231 if (json.has("identifier")) { 2232 JsonArray array = json.getAsJsonArray("identifier"); 2233 for (int i = 0; i < array.size(); i++) { 2234 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 2235 } 2236 } 2237 ; 2238 if (json.has("status")) 2239 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Account.AccountStatus.NULL, 2240 new Account.AccountStatusEnumFactory())); 2241 if (json.has("_status")) 2242 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 2243 if (json.has("type")) 2244 res.setType(parseCodeableConcept(getJObject(json, "type"))); 2245 if (json.has("name")) 2246 res.setNameElement(parseString(json.get("name").getAsString())); 2247 if (json.has("_name")) 2248 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 2249 if (json.has("subject")) { 2250 JsonArray array = json.getAsJsonArray("subject"); 2251 for (int i = 0; i < array.size(); i++) { 2252 res.getSubject().add(parseReference(array.get(i).getAsJsonObject())); 2253 } 2254 } 2255 ; 2256 if (json.has("servicePeriod")) 2257 res.setServicePeriod(parsePeriod(getJObject(json, "servicePeriod"))); 2258 if (json.has("coverage")) { 2259 JsonArray array = json.getAsJsonArray("coverage"); 2260 for (int i = 0; i < array.size(); i++) { 2261 res.getCoverage().add(parseAccountCoverageComponent(array.get(i).getAsJsonObject(), res)); 2262 } 2263 } 2264 ; 2265 if (json.has("owner")) 2266 res.setOwner(parseReference(getJObject(json, "owner"))); 2267 if (json.has("description")) 2268 res.setDescriptionElement(parseString(json.get("description").getAsString())); 2269 if (json.has("_description")) 2270 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 2271 if (json.has("guarantor")) { 2272 JsonArray array = json.getAsJsonArray("guarantor"); 2273 for (int i = 0; i < array.size(); i++) { 2274 res.getGuarantor().add(parseAccountGuarantorComponent(array.get(i).getAsJsonObject(), res)); 2275 } 2276 } 2277 ; 2278 if (json.has("partOf")) 2279 res.setPartOf(parseReference(getJObject(json, "partOf"))); 2280 } 2281 2282 protected Account.CoverageComponent parseAccountCoverageComponent(JsonObject json, Account owner) 2283 throws IOException, FHIRFormatError { 2284 Account.CoverageComponent res = new Account.CoverageComponent(); 2285 parseAccountCoverageComponentProperties(json, owner, res); 2286 return res; 2287 } 2288 2289 protected void parseAccountCoverageComponentProperties(JsonObject json, Account owner, Account.CoverageComponent res) 2290 throws IOException, FHIRFormatError { 2291 parseBackboneElementProperties(json, res); 2292 if (json.has("coverage")) 2293 res.setCoverage(parseReference(getJObject(json, "coverage"))); 2294 if (json.has("priority")) 2295 res.setPriorityElement(parsePositiveInt(json.get("priority").getAsString())); 2296 if (json.has("_priority")) 2297 parseElementProperties(getJObject(json, "_priority"), res.getPriorityElement()); 2298 } 2299 2300 protected Account.GuarantorComponent parseAccountGuarantorComponent(JsonObject json, Account owner) 2301 throws IOException, FHIRFormatError { 2302 Account.GuarantorComponent res = new Account.GuarantorComponent(); 2303 parseAccountGuarantorComponentProperties(json, owner, res); 2304 return res; 2305 } 2306 2307 protected void parseAccountGuarantorComponentProperties(JsonObject json, Account owner, 2308 Account.GuarantorComponent res) throws IOException, FHIRFormatError { 2309 parseBackboneElementProperties(json, res); 2310 if (json.has("party")) 2311 res.setParty(parseReference(getJObject(json, "party"))); 2312 if (json.has("onHold")) 2313 res.setOnHoldElement(parseBoolean(json.get("onHold").getAsBoolean())); 2314 if (json.has("_onHold")) 2315 parseElementProperties(getJObject(json, "_onHold"), res.getOnHoldElement()); 2316 if (json.has("period")) 2317 res.setPeriod(parsePeriod(getJObject(json, "period"))); 2318 } 2319 2320 protected ActivityDefinition parseActivityDefinition(JsonObject json) throws IOException, FHIRFormatError { 2321 ActivityDefinition res = new ActivityDefinition(); 2322 parseActivityDefinitionProperties(json, res); 2323 return res; 2324 } 2325 2326 protected void parseActivityDefinitionProperties(JsonObject json, ActivityDefinition res) 2327 throws IOException, FHIRFormatError { 2328 parseDomainResourceProperties(json, res); 2329 if (json.has("url")) 2330 res.setUrlElement(parseUri(json.get("url").getAsString())); 2331 if (json.has("_url")) 2332 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 2333 if (json.has("identifier")) { 2334 JsonArray array = json.getAsJsonArray("identifier"); 2335 for (int i = 0; i < array.size(); i++) { 2336 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 2337 } 2338 } 2339 ; 2340 if (json.has("version")) 2341 res.setVersionElement(parseString(json.get("version").getAsString())); 2342 if (json.has("_version")) 2343 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 2344 if (json.has("name")) 2345 res.setNameElement(parseString(json.get("name").getAsString())); 2346 if (json.has("_name")) 2347 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 2348 if (json.has("title")) 2349 res.setTitleElement(parseString(json.get("title").getAsString())); 2350 if (json.has("_title")) 2351 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 2352 if (json.has("subtitle")) 2353 res.setSubtitleElement(parseString(json.get("subtitle").getAsString())); 2354 if (json.has("_subtitle")) 2355 parseElementProperties(getJObject(json, "_subtitle"), res.getSubtitleElement()); 2356 if (json.has("status")) 2357 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 2358 new Enumerations.PublicationStatusEnumFactory())); 2359 if (json.has("_status")) 2360 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 2361 if (json.has("experimental")) 2362 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 2363 if (json.has("_experimental")) 2364 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 2365 Type subject = parseType("subject", json); 2366 if (subject != null) 2367 res.setSubject(subject); 2368 if (json.has("date")) 2369 res.setDateElement(parseDateTime(json.get("date").getAsString())); 2370 if (json.has("_date")) 2371 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 2372 if (json.has("publisher")) 2373 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 2374 if (json.has("_publisher")) 2375 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 2376 if (json.has("contact")) { 2377 JsonArray array = json.getAsJsonArray("contact"); 2378 for (int i = 0; i < array.size(); i++) { 2379 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 2380 } 2381 } 2382 ; 2383 if (json.has("description")) 2384 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 2385 if (json.has("_description")) 2386 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 2387 if (json.has("useContext")) { 2388 JsonArray array = json.getAsJsonArray("useContext"); 2389 for (int i = 0; i < array.size(); i++) { 2390 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 2391 } 2392 } 2393 ; 2394 if (json.has("jurisdiction")) { 2395 JsonArray array = json.getAsJsonArray("jurisdiction"); 2396 for (int i = 0; i < array.size(); i++) { 2397 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 2398 } 2399 } 2400 ; 2401 if (json.has("purpose")) 2402 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 2403 if (json.has("_purpose")) 2404 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 2405 if (json.has("usage")) 2406 res.setUsageElement(parseString(json.get("usage").getAsString())); 2407 if (json.has("_usage")) 2408 parseElementProperties(getJObject(json, "_usage"), res.getUsageElement()); 2409 if (json.has("copyright")) 2410 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 2411 if (json.has("_copyright")) 2412 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 2413 if (json.has("approvalDate")) 2414 res.setApprovalDateElement(parseDate(json.get("approvalDate").getAsString())); 2415 if (json.has("_approvalDate")) 2416 parseElementProperties(getJObject(json, "_approvalDate"), res.getApprovalDateElement()); 2417 if (json.has("lastReviewDate")) 2418 res.setLastReviewDateElement(parseDate(json.get("lastReviewDate").getAsString())); 2419 if (json.has("_lastReviewDate")) 2420 parseElementProperties(getJObject(json, "_lastReviewDate"), res.getLastReviewDateElement()); 2421 if (json.has("effectivePeriod")) 2422 res.setEffectivePeriod(parsePeriod(getJObject(json, "effectivePeriod"))); 2423 if (json.has("topic")) { 2424 JsonArray array = json.getAsJsonArray("topic"); 2425 for (int i = 0; i < array.size(); i++) { 2426 res.getTopic().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 2427 } 2428 } 2429 ; 2430 if (json.has("author")) { 2431 JsonArray array = json.getAsJsonArray("author"); 2432 for (int i = 0; i < array.size(); i++) { 2433 res.getAuthor().add(parseContactDetail(array.get(i).getAsJsonObject())); 2434 } 2435 } 2436 ; 2437 if (json.has("editor")) { 2438 JsonArray array = json.getAsJsonArray("editor"); 2439 for (int i = 0; i < array.size(); i++) { 2440 res.getEditor().add(parseContactDetail(array.get(i).getAsJsonObject())); 2441 } 2442 } 2443 ; 2444 if (json.has("reviewer")) { 2445 JsonArray array = json.getAsJsonArray("reviewer"); 2446 for (int i = 0; i < array.size(); i++) { 2447 res.getReviewer().add(parseContactDetail(array.get(i).getAsJsonObject())); 2448 } 2449 } 2450 ; 2451 if (json.has("endorser")) { 2452 JsonArray array = json.getAsJsonArray("endorser"); 2453 for (int i = 0; i < array.size(); i++) { 2454 res.getEndorser().add(parseContactDetail(array.get(i).getAsJsonObject())); 2455 } 2456 } 2457 ; 2458 if (json.has("relatedArtifact")) { 2459 JsonArray array = json.getAsJsonArray("relatedArtifact"); 2460 for (int i = 0; i < array.size(); i++) { 2461 res.getRelatedArtifact().add(parseRelatedArtifact(array.get(i).getAsJsonObject())); 2462 } 2463 } 2464 ; 2465 if (json.has("library")) { 2466 JsonArray array = json.getAsJsonArray("library"); 2467 for (int i = 0; i < array.size(); i++) { 2468 if (array.get(i).isJsonNull()) { 2469 res.getLibrary().add(new CanonicalType()); 2470 } else { 2471 res.getLibrary().add(parseCanonical(array.get(i).getAsString())); 2472 } 2473 } 2474 } 2475 ; 2476 if (json.has("_library")) { 2477 JsonArray array = json.getAsJsonArray("_library"); 2478 for (int i = 0; i < array.size(); i++) { 2479 if (i == res.getLibrary().size()) 2480 res.getLibrary().add(parseCanonical(null)); 2481 if (array.get(i) instanceof JsonObject) 2482 parseElementProperties(array.get(i).getAsJsonObject(), res.getLibrary().get(i)); 2483 } 2484 } 2485 ; 2486 if (json.has("kind")) 2487 res.setKindElement(parseEnumeration(json.get("kind").getAsString(), 2488 ActivityDefinition.ActivityDefinitionKind.NULL, new ActivityDefinition.ActivityDefinitionKindEnumFactory())); 2489 if (json.has("_kind")) 2490 parseElementProperties(getJObject(json, "_kind"), res.getKindElement()); 2491 if (json.has("profile")) 2492 res.setProfileElement(parseCanonical(json.get("profile").getAsString())); 2493 if (json.has("_profile")) 2494 parseElementProperties(getJObject(json, "_profile"), res.getProfileElement()); 2495 if (json.has("code")) 2496 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 2497 if (json.has("intent")) 2498 res.setIntentElement(parseEnumeration(json.get("intent").getAsString(), ActivityDefinition.RequestIntent.NULL, 2499 new ActivityDefinition.RequestIntentEnumFactory())); 2500 if (json.has("_intent")) 2501 parseElementProperties(getJObject(json, "_intent"), res.getIntentElement()); 2502 if (json.has("priority")) 2503 res.setPriorityElement(parseEnumeration(json.get("priority").getAsString(), 2504 ActivityDefinition.RequestPriority.NULL, new ActivityDefinition.RequestPriorityEnumFactory())); 2505 if (json.has("_priority")) 2506 parseElementProperties(getJObject(json, "_priority"), res.getPriorityElement()); 2507 if (json.has("doNotPerform")) 2508 res.setDoNotPerformElement(parseBoolean(json.get("doNotPerform").getAsBoolean())); 2509 if (json.has("_doNotPerform")) 2510 parseElementProperties(getJObject(json, "_doNotPerform"), res.getDoNotPerformElement()); 2511 Type timing = parseType("timing", json); 2512 if (timing != null) 2513 res.setTiming(timing); 2514 if (json.has("location")) 2515 res.setLocation(parseReference(getJObject(json, "location"))); 2516 if (json.has("participant")) { 2517 JsonArray array = json.getAsJsonArray("participant"); 2518 for (int i = 0; i < array.size(); i++) { 2519 res.getParticipant() 2520 .add(parseActivityDefinitionActivityDefinitionParticipantComponent(array.get(i).getAsJsonObject(), res)); 2521 } 2522 } 2523 ; 2524 Type product = parseType("product", json); 2525 if (product != null) 2526 res.setProduct(product); 2527 if (json.has("quantity")) 2528 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 2529 if (json.has("dosage")) { 2530 JsonArray array = json.getAsJsonArray("dosage"); 2531 for (int i = 0; i < array.size(); i++) { 2532 res.getDosage().add(parseDosage(array.get(i).getAsJsonObject())); 2533 } 2534 } 2535 ; 2536 if (json.has("bodySite")) { 2537 JsonArray array = json.getAsJsonArray("bodySite"); 2538 for (int i = 0; i < array.size(); i++) { 2539 res.getBodySite().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 2540 } 2541 } 2542 ; 2543 if (json.has("specimenRequirement")) { 2544 JsonArray array = json.getAsJsonArray("specimenRequirement"); 2545 for (int i = 0; i < array.size(); i++) { 2546 res.getSpecimenRequirement().add(parseReference(array.get(i).getAsJsonObject())); 2547 } 2548 } 2549 ; 2550 if (json.has("observationRequirement")) { 2551 JsonArray array = json.getAsJsonArray("observationRequirement"); 2552 for (int i = 0; i < array.size(); i++) { 2553 res.getObservationRequirement().add(parseReference(array.get(i).getAsJsonObject())); 2554 } 2555 } 2556 ; 2557 if (json.has("observationResultRequirement")) { 2558 JsonArray array = json.getAsJsonArray("observationResultRequirement"); 2559 for (int i = 0; i < array.size(); i++) { 2560 res.getObservationResultRequirement().add(parseReference(array.get(i).getAsJsonObject())); 2561 } 2562 } 2563 ; 2564 if (json.has("transform")) 2565 res.setTransformElement(parseCanonical(json.get("transform").getAsString())); 2566 if (json.has("_transform")) 2567 parseElementProperties(getJObject(json, "_transform"), res.getTransformElement()); 2568 if (json.has("dynamicValue")) { 2569 JsonArray array = json.getAsJsonArray("dynamicValue"); 2570 for (int i = 0; i < array.size(); i++) { 2571 res.getDynamicValue() 2572 .add(parseActivityDefinitionActivityDefinitionDynamicValueComponent(array.get(i).getAsJsonObject(), res)); 2573 } 2574 } 2575 ; 2576 } 2577 2578 protected ActivityDefinition.ActivityDefinitionParticipantComponent parseActivityDefinitionActivityDefinitionParticipantComponent( 2579 JsonObject json, ActivityDefinition owner) throws IOException, FHIRFormatError { 2580 ActivityDefinition.ActivityDefinitionParticipantComponent res = new ActivityDefinition.ActivityDefinitionParticipantComponent(); 2581 parseActivityDefinitionActivityDefinitionParticipantComponentProperties(json, owner, res); 2582 return res; 2583 } 2584 2585 protected void parseActivityDefinitionActivityDefinitionParticipantComponentProperties(JsonObject json, 2586 ActivityDefinition owner, ActivityDefinition.ActivityDefinitionParticipantComponent res) 2587 throws IOException, FHIRFormatError { 2588 parseBackboneElementProperties(json, res); 2589 if (json.has("type")) 2590 res.setTypeElement( 2591 parseEnumeration(json.get("type").getAsString(), ActivityDefinition.ActivityParticipantType.NULL, 2592 new ActivityDefinition.ActivityParticipantTypeEnumFactory())); 2593 if (json.has("_type")) 2594 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 2595 if (json.has("role")) 2596 res.setRole(parseCodeableConcept(getJObject(json, "role"))); 2597 } 2598 2599 protected ActivityDefinition.ActivityDefinitionDynamicValueComponent parseActivityDefinitionActivityDefinitionDynamicValueComponent( 2600 JsonObject json, ActivityDefinition owner) throws IOException, FHIRFormatError { 2601 ActivityDefinition.ActivityDefinitionDynamicValueComponent res = new ActivityDefinition.ActivityDefinitionDynamicValueComponent(); 2602 parseActivityDefinitionActivityDefinitionDynamicValueComponentProperties(json, owner, res); 2603 return res; 2604 } 2605 2606 protected void parseActivityDefinitionActivityDefinitionDynamicValueComponentProperties(JsonObject json, 2607 ActivityDefinition owner, ActivityDefinition.ActivityDefinitionDynamicValueComponent res) 2608 throws IOException, FHIRFormatError { 2609 parseBackboneElementProperties(json, res); 2610 if (json.has("path")) 2611 res.setPathElement(parseString(json.get("path").getAsString())); 2612 if (json.has("_path")) 2613 parseElementProperties(getJObject(json, "_path"), res.getPathElement()); 2614 if (json.has("expression")) 2615 res.setExpression(parseExpression(getJObject(json, "expression"))); 2616 } 2617 2618 protected AdverseEvent parseAdverseEvent(JsonObject json) throws IOException, FHIRFormatError { 2619 AdverseEvent res = new AdverseEvent(); 2620 parseAdverseEventProperties(json, res); 2621 return res; 2622 } 2623 2624 protected void parseAdverseEventProperties(JsonObject json, AdverseEvent res) throws IOException, FHIRFormatError { 2625 parseDomainResourceProperties(json, res); 2626 if (json.has("identifier")) 2627 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 2628 if (json.has("actuality")) 2629 res.setActualityElement(parseEnumeration(json.get("actuality").getAsString(), 2630 AdverseEvent.AdverseEventActuality.NULL, new AdverseEvent.AdverseEventActualityEnumFactory())); 2631 if (json.has("_actuality")) 2632 parseElementProperties(getJObject(json, "_actuality"), res.getActualityElement()); 2633 if (json.has("category")) { 2634 JsonArray array = json.getAsJsonArray("category"); 2635 for (int i = 0; i < array.size(); i++) { 2636 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 2637 } 2638 } 2639 ; 2640 if (json.has("event")) 2641 res.setEvent(parseCodeableConcept(getJObject(json, "event"))); 2642 if (json.has("subject")) 2643 res.setSubject(parseReference(getJObject(json, "subject"))); 2644 if (json.has("encounter")) 2645 res.setEncounter(parseReference(getJObject(json, "encounter"))); 2646 if (json.has("date")) 2647 res.setDateElement(parseDateTime(json.get("date").getAsString())); 2648 if (json.has("_date")) 2649 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 2650 if (json.has("detected")) 2651 res.setDetectedElement(parseDateTime(json.get("detected").getAsString())); 2652 if (json.has("_detected")) 2653 parseElementProperties(getJObject(json, "_detected"), res.getDetectedElement()); 2654 if (json.has("recordedDate")) 2655 res.setRecordedDateElement(parseDateTime(json.get("recordedDate").getAsString())); 2656 if (json.has("_recordedDate")) 2657 parseElementProperties(getJObject(json, "_recordedDate"), res.getRecordedDateElement()); 2658 if (json.has("resultingCondition")) { 2659 JsonArray array = json.getAsJsonArray("resultingCondition"); 2660 for (int i = 0; i < array.size(); i++) { 2661 res.getResultingCondition().add(parseReference(array.get(i).getAsJsonObject())); 2662 } 2663 } 2664 ; 2665 if (json.has("location")) 2666 res.setLocation(parseReference(getJObject(json, "location"))); 2667 if (json.has("seriousness")) 2668 res.setSeriousness(parseCodeableConcept(getJObject(json, "seriousness"))); 2669 if (json.has("severity")) 2670 res.setSeverity(parseCodeableConcept(getJObject(json, "severity"))); 2671 if (json.has("outcome")) 2672 res.setOutcome(parseCodeableConcept(getJObject(json, "outcome"))); 2673 if (json.has("recorder")) 2674 res.setRecorder(parseReference(getJObject(json, "recorder"))); 2675 if (json.has("contributor")) { 2676 JsonArray array = json.getAsJsonArray("contributor"); 2677 for (int i = 0; i < array.size(); i++) { 2678 res.getContributor().add(parseReference(array.get(i).getAsJsonObject())); 2679 } 2680 } 2681 ; 2682 if (json.has("suspectEntity")) { 2683 JsonArray array = json.getAsJsonArray("suspectEntity"); 2684 for (int i = 0; i < array.size(); i++) { 2685 res.getSuspectEntity() 2686 .add(parseAdverseEventAdverseEventSuspectEntityComponent(array.get(i).getAsJsonObject(), res)); 2687 } 2688 } 2689 ; 2690 if (json.has("subjectMedicalHistory")) { 2691 JsonArray array = json.getAsJsonArray("subjectMedicalHistory"); 2692 for (int i = 0; i < array.size(); i++) { 2693 res.getSubjectMedicalHistory().add(parseReference(array.get(i).getAsJsonObject())); 2694 } 2695 } 2696 ; 2697 if (json.has("referenceDocument")) { 2698 JsonArray array = json.getAsJsonArray("referenceDocument"); 2699 for (int i = 0; i < array.size(); i++) { 2700 res.getReferenceDocument().add(parseReference(array.get(i).getAsJsonObject())); 2701 } 2702 } 2703 ; 2704 if (json.has("study")) { 2705 JsonArray array = json.getAsJsonArray("study"); 2706 for (int i = 0; i < array.size(); i++) { 2707 res.getStudy().add(parseReference(array.get(i).getAsJsonObject())); 2708 } 2709 } 2710 ; 2711 } 2712 2713 protected AdverseEvent.AdverseEventSuspectEntityComponent parseAdverseEventAdverseEventSuspectEntityComponent( 2714 JsonObject json, AdverseEvent owner) throws IOException, FHIRFormatError { 2715 AdverseEvent.AdverseEventSuspectEntityComponent res = new AdverseEvent.AdverseEventSuspectEntityComponent(); 2716 parseAdverseEventAdverseEventSuspectEntityComponentProperties(json, owner, res); 2717 return res; 2718 } 2719 2720 protected void parseAdverseEventAdverseEventSuspectEntityComponentProperties(JsonObject json, AdverseEvent owner, 2721 AdverseEvent.AdverseEventSuspectEntityComponent res) throws IOException, FHIRFormatError { 2722 parseBackboneElementProperties(json, res); 2723 if (json.has("instance")) 2724 res.setInstance(parseReference(getJObject(json, "instance"))); 2725 if (json.has("causality")) { 2726 JsonArray array = json.getAsJsonArray("causality"); 2727 for (int i = 0; i < array.size(); i++) { 2728 res.getCausality() 2729 .add(parseAdverseEventAdverseEventSuspectEntityCausalityComponent(array.get(i).getAsJsonObject(), owner)); 2730 } 2731 } 2732 ; 2733 } 2734 2735 protected AdverseEvent.AdverseEventSuspectEntityCausalityComponent parseAdverseEventAdverseEventSuspectEntityCausalityComponent( 2736 JsonObject json, AdverseEvent owner) throws IOException, FHIRFormatError { 2737 AdverseEvent.AdverseEventSuspectEntityCausalityComponent res = new AdverseEvent.AdverseEventSuspectEntityCausalityComponent(); 2738 parseAdverseEventAdverseEventSuspectEntityCausalityComponentProperties(json, owner, res); 2739 return res; 2740 } 2741 2742 protected void parseAdverseEventAdverseEventSuspectEntityCausalityComponentProperties(JsonObject json, 2743 AdverseEvent owner, AdverseEvent.AdverseEventSuspectEntityCausalityComponent res) 2744 throws IOException, FHIRFormatError { 2745 parseBackboneElementProperties(json, res); 2746 if (json.has("assessment")) 2747 res.setAssessment(parseCodeableConcept(getJObject(json, "assessment"))); 2748 if (json.has("productRelatedness")) 2749 res.setProductRelatednessElement(parseString(json.get("productRelatedness").getAsString())); 2750 if (json.has("_productRelatedness")) 2751 parseElementProperties(getJObject(json, "_productRelatedness"), res.getProductRelatednessElement()); 2752 if (json.has("author")) 2753 res.setAuthor(parseReference(getJObject(json, "author"))); 2754 if (json.has("method")) 2755 res.setMethod(parseCodeableConcept(getJObject(json, "method"))); 2756 } 2757 2758 protected AllergyIntolerance parseAllergyIntolerance(JsonObject json) throws IOException, FHIRFormatError { 2759 AllergyIntolerance res = new AllergyIntolerance(); 2760 parseAllergyIntoleranceProperties(json, res); 2761 return res; 2762 } 2763 2764 protected void parseAllergyIntoleranceProperties(JsonObject json, AllergyIntolerance res) 2765 throws IOException, FHIRFormatError { 2766 parseDomainResourceProperties(json, res); 2767 if (json.has("identifier")) { 2768 JsonArray array = json.getAsJsonArray("identifier"); 2769 for (int i = 0; i < array.size(); i++) { 2770 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 2771 } 2772 } 2773 ; 2774 if (json.has("clinicalStatus")) 2775 res.setClinicalStatus(parseCodeableConcept(getJObject(json, "clinicalStatus"))); 2776 if (json.has("verificationStatus")) 2777 res.setVerificationStatus(parseCodeableConcept(getJObject(json, "verificationStatus"))); 2778 if (json.has("type")) 2779 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), 2780 AllergyIntolerance.AllergyIntoleranceType.NULL, new AllergyIntolerance.AllergyIntoleranceTypeEnumFactory())); 2781 if (json.has("_type")) 2782 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 2783 if (json.has("category")) { 2784 JsonArray array = json.getAsJsonArray("category"); 2785 for (int i = 0; i < array.size(); i++) { 2786 if (array.get(i).isJsonNull()) { 2787 res.getCategory().add(new Enumeration<AllergyIntolerance.AllergyIntoleranceCategory>()); 2788 } else { 2789 res.getCategory() 2790 .add(parseEnumeration(array.get(i).getAsString(), AllergyIntolerance.AllergyIntoleranceCategory.NULL, 2791 new AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory())); 2792 } 2793 } 2794 } 2795 ; 2796 if (json.has("_category")) { 2797 JsonArray array = json.getAsJsonArray("_category"); 2798 for (int i = 0; i < array.size(); i++) { 2799 if (i == res.getCategory().size()) 2800 res.getCategory().add(parseEnumeration(null, AllergyIntolerance.AllergyIntoleranceCategory.NULL, 2801 new AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory())); 2802 if (array.get(i) instanceof JsonObject) 2803 parseElementProperties(array.get(i).getAsJsonObject(), res.getCategory().get(i)); 2804 } 2805 } 2806 ; 2807 if (json.has("criticality")) 2808 res.setCriticalityElement( 2809 parseEnumeration(json.get("criticality").getAsString(), AllergyIntolerance.AllergyIntoleranceCriticality.NULL, 2810 new AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory())); 2811 if (json.has("_criticality")) 2812 parseElementProperties(getJObject(json, "_criticality"), res.getCriticalityElement()); 2813 if (json.has("code")) 2814 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 2815 if (json.has("patient")) 2816 res.setPatient(parseReference(getJObject(json, "patient"))); 2817 if (json.has("encounter")) 2818 res.setEncounter(parseReference(getJObject(json, "encounter"))); 2819 Type onset = parseType("onset", json); 2820 if (onset != null) 2821 res.setOnset(onset); 2822 if (json.has("recordedDate")) 2823 res.setRecordedDateElement(parseDateTime(json.get("recordedDate").getAsString())); 2824 if (json.has("_recordedDate")) 2825 parseElementProperties(getJObject(json, "_recordedDate"), res.getRecordedDateElement()); 2826 if (json.has("recorder")) 2827 res.setRecorder(parseReference(getJObject(json, "recorder"))); 2828 if (json.has("asserter")) 2829 res.setAsserter(parseReference(getJObject(json, "asserter"))); 2830 if (json.has("lastOccurrence")) 2831 res.setLastOccurrenceElement(parseDateTime(json.get("lastOccurrence").getAsString())); 2832 if (json.has("_lastOccurrence")) 2833 parseElementProperties(getJObject(json, "_lastOccurrence"), res.getLastOccurrenceElement()); 2834 if (json.has("note")) { 2835 JsonArray array = json.getAsJsonArray("note"); 2836 for (int i = 0; i < array.size(); i++) { 2837 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 2838 } 2839 } 2840 ; 2841 if (json.has("reaction")) { 2842 JsonArray array = json.getAsJsonArray("reaction"); 2843 for (int i = 0; i < array.size(); i++) { 2844 res.getReaction() 2845 .add(parseAllergyIntoleranceAllergyIntoleranceReactionComponent(array.get(i).getAsJsonObject(), res)); 2846 } 2847 } 2848 ; 2849 } 2850 2851 protected AllergyIntolerance.AllergyIntoleranceReactionComponent parseAllergyIntoleranceAllergyIntoleranceReactionComponent( 2852 JsonObject json, AllergyIntolerance owner) throws IOException, FHIRFormatError { 2853 AllergyIntolerance.AllergyIntoleranceReactionComponent res = new AllergyIntolerance.AllergyIntoleranceReactionComponent(); 2854 parseAllergyIntoleranceAllergyIntoleranceReactionComponentProperties(json, owner, res); 2855 return res; 2856 } 2857 2858 protected void parseAllergyIntoleranceAllergyIntoleranceReactionComponentProperties(JsonObject json, 2859 AllergyIntolerance owner, AllergyIntolerance.AllergyIntoleranceReactionComponent res) 2860 throws IOException, FHIRFormatError { 2861 parseBackboneElementProperties(json, res); 2862 if (json.has("substance")) 2863 res.setSubstance(parseCodeableConcept(getJObject(json, "substance"))); 2864 if (json.has("manifestation")) { 2865 JsonArray array = json.getAsJsonArray("manifestation"); 2866 for (int i = 0; i < array.size(); i++) { 2867 res.getManifestation().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 2868 } 2869 } 2870 ; 2871 if (json.has("description")) 2872 res.setDescriptionElement(parseString(json.get("description").getAsString())); 2873 if (json.has("_description")) 2874 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 2875 if (json.has("onset")) 2876 res.setOnsetElement(parseDateTime(json.get("onset").getAsString())); 2877 if (json.has("_onset")) 2878 parseElementProperties(getJObject(json, "_onset"), res.getOnsetElement()); 2879 if (json.has("severity")) 2880 res.setSeverityElement( 2881 parseEnumeration(json.get("severity").getAsString(), AllergyIntolerance.AllergyIntoleranceSeverity.NULL, 2882 new AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory())); 2883 if (json.has("_severity")) 2884 parseElementProperties(getJObject(json, "_severity"), res.getSeverityElement()); 2885 if (json.has("exposureRoute")) 2886 res.setExposureRoute(parseCodeableConcept(getJObject(json, "exposureRoute"))); 2887 if (json.has("note")) { 2888 JsonArray array = json.getAsJsonArray("note"); 2889 for (int i = 0; i < array.size(); i++) { 2890 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 2891 } 2892 } 2893 ; 2894 } 2895 2896 protected Appointment parseAppointment(JsonObject json) throws IOException, FHIRFormatError { 2897 Appointment res = new Appointment(); 2898 parseAppointmentProperties(json, res); 2899 return res; 2900 } 2901 2902 protected void parseAppointmentProperties(JsonObject json, Appointment res) throws IOException, FHIRFormatError { 2903 parseDomainResourceProperties(json, res); 2904 if (json.has("identifier")) { 2905 JsonArray array = json.getAsJsonArray("identifier"); 2906 for (int i = 0; i < array.size(); i++) { 2907 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 2908 } 2909 } 2910 ; 2911 if (json.has("status")) 2912 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Appointment.AppointmentStatus.NULL, 2913 new Appointment.AppointmentStatusEnumFactory())); 2914 if (json.has("_status")) 2915 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 2916 if (json.has("cancelationReason")) 2917 res.setCancelationReason(parseCodeableConcept(getJObject(json, "cancelationReason"))); 2918 if (json.has("serviceCategory")) { 2919 JsonArray array = json.getAsJsonArray("serviceCategory"); 2920 for (int i = 0; i < array.size(); i++) { 2921 res.getServiceCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 2922 } 2923 } 2924 ; 2925 if (json.has("serviceType")) { 2926 JsonArray array = json.getAsJsonArray("serviceType"); 2927 for (int i = 0; i < array.size(); i++) { 2928 res.getServiceType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 2929 } 2930 } 2931 ; 2932 if (json.has("specialty")) { 2933 JsonArray array = json.getAsJsonArray("specialty"); 2934 for (int i = 0; i < array.size(); i++) { 2935 res.getSpecialty().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 2936 } 2937 } 2938 ; 2939 if (json.has("appointmentType")) 2940 res.setAppointmentType(parseCodeableConcept(getJObject(json, "appointmentType"))); 2941 if (json.has("reasonCode")) { 2942 JsonArray array = json.getAsJsonArray("reasonCode"); 2943 for (int i = 0; i < array.size(); i++) { 2944 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 2945 } 2946 } 2947 ; 2948 if (json.has("reasonReference")) { 2949 JsonArray array = json.getAsJsonArray("reasonReference"); 2950 for (int i = 0; i < array.size(); i++) { 2951 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 2952 } 2953 } 2954 ; 2955 if (json.has("priority")) 2956 res.setPriorityElement(parseUnsignedInt(json.get("priority").getAsString())); 2957 if (json.has("_priority")) 2958 parseElementProperties(getJObject(json, "_priority"), res.getPriorityElement()); 2959 if (json.has("description")) 2960 res.setDescriptionElement(parseString(json.get("description").getAsString())); 2961 if (json.has("_description")) 2962 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 2963 if (json.has("supportingInformation")) { 2964 JsonArray array = json.getAsJsonArray("supportingInformation"); 2965 for (int i = 0; i < array.size(); i++) { 2966 res.getSupportingInformation().add(parseReference(array.get(i).getAsJsonObject())); 2967 } 2968 } 2969 ; 2970 if (json.has("start")) 2971 res.setStartElement(parseInstant(json.get("start").getAsString())); 2972 if (json.has("_start")) 2973 parseElementProperties(getJObject(json, "_start"), res.getStartElement()); 2974 if (json.has("end")) 2975 res.setEndElement(parseInstant(json.get("end").getAsString())); 2976 if (json.has("_end")) 2977 parseElementProperties(getJObject(json, "_end"), res.getEndElement()); 2978 if (json.has("minutesDuration")) 2979 res.setMinutesDurationElement(parsePositiveInt(json.get("minutesDuration").getAsString())); 2980 if (json.has("_minutesDuration")) 2981 parseElementProperties(getJObject(json, "_minutesDuration"), res.getMinutesDurationElement()); 2982 if (json.has("slot")) { 2983 JsonArray array = json.getAsJsonArray("slot"); 2984 for (int i = 0; i < array.size(); i++) { 2985 res.getSlot().add(parseReference(array.get(i).getAsJsonObject())); 2986 } 2987 } 2988 ; 2989 if (json.has("created")) 2990 res.setCreatedElement(parseDateTime(json.get("created").getAsString())); 2991 if (json.has("_created")) 2992 parseElementProperties(getJObject(json, "_created"), res.getCreatedElement()); 2993 if (json.has("comment")) 2994 res.setCommentElement(parseString(json.get("comment").getAsString())); 2995 if (json.has("_comment")) 2996 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 2997 if (json.has("patientInstruction")) 2998 res.setPatientInstructionElement(parseString(json.get("patientInstruction").getAsString())); 2999 if (json.has("_patientInstruction")) 3000 parseElementProperties(getJObject(json, "_patientInstruction"), res.getPatientInstructionElement()); 3001 if (json.has("basedOn")) { 3002 JsonArray array = json.getAsJsonArray("basedOn"); 3003 for (int i = 0; i < array.size(); i++) { 3004 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 3005 } 3006 } 3007 ; 3008 if (json.has("participant")) { 3009 JsonArray array = json.getAsJsonArray("participant"); 3010 for (int i = 0; i < array.size(); i++) { 3011 res.getParticipant().add(parseAppointmentAppointmentParticipantComponent(array.get(i).getAsJsonObject(), res)); 3012 } 3013 } 3014 ; 3015 if (json.has("requestedPeriod")) { 3016 JsonArray array = json.getAsJsonArray("requestedPeriod"); 3017 for (int i = 0; i < array.size(); i++) { 3018 res.getRequestedPeriod().add(parsePeriod(array.get(i).getAsJsonObject())); 3019 } 3020 } 3021 ; 3022 } 3023 3024 protected Appointment.AppointmentParticipantComponent parseAppointmentAppointmentParticipantComponent(JsonObject json, 3025 Appointment owner) throws IOException, FHIRFormatError { 3026 Appointment.AppointmentParticipantComponent res = new Appointment.AppointmentParticipantComponent(); 3027 parseAppointmentAppointmentParticipantComponentProperties(json, owner, res); 3028 return res; 3029 } 3030 3031 protected void parseAppointmentAppointmentParticipantComponentProperties(JsonObject json, Appointment owner, 3032 Appointment.AppointmentParticipantComponent res) throws IOException, FHIRFormatError { 3033 parseBackboneElementProperties(json, res); 3034 if (json.has("type")) { 3035 JsonArray array = json.getAsJsonArray("type"); 3036 for (int i = 0; i < array.size(); i++) { 3037 res.getType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 3038 } 3039 } 3040 ; 3041 if (json.has("actor")) 3042 res.setActor(parseReference(getJObject(json, "actor"))); 3043 if (json.has("required")) 3044 res.setRequiredElement(parseEnumeration(json.get("required").getAsString(), Appointment.ParticipantRequired.NULL, 3045 new Appointment.ParticipantRequiredEnumFactory())); 3046 if (json.has("_required")) 3047 parseElementProperties(getJObject(json, "_required"), res.getRequiredElement()); 3048 if (json.has("status")) 3049 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Appointment.ParticipationStatus.NULL, 3050 new Appointment.ParticipationStatusEnumFactory())); 3051 if (json.has("_status")) 3052 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 3053 if (json.has("period")) 3054 res.setPeriod(parsePeriod(getJObject(json, "period"))); 3055 } 3056 3057 protected AppointmentResponse parseAppointmentResponse(JsonObject json) throws IOException, FHIRFormatError { 3058 AppointmentResponse res = new AppointmentResponse(); 3059 parseAppointmentResponseProperties(json, res); 3060 return res; 3061 } 3062 3063 protected void parseAppointmentResponseProperties(JsonObject json, AppointmentResponse res) 3064 throws IOException, FHIRFormatError { 3065 parseDomainResourceProperties(json, res); 3066 if (json.has("identifier")) { 3067 JsonArray array = json.getAsJsonArray("identifier"); 3068 for (int i = 0; i < array.size(); i++) { 3069 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 3070 } 3071 } 3072 ; 3073 if (json.has("appointment")) 3074 res.setAppointment(parseReference(getJObject(json, "appointment"))); 3075 if (json.has("start")) 3076 res.setStartElement(parseInstant(json.get("start").getAsString())); 3077 if (json.has("_start")) 3078 parseElementProperties(getJObject(json, "_start"), res.getStartElement()); 3079 if (json.has("end")) 3080 res.setEndElement(parseInstant(json.get("end").getAsString())); 3081 if (json.has("_end")) 3082 parseElementProperties(getJObject(json, "_end"), res.getEndElement()); 3083 if (json.has("participantType")) { 3084 JsonArray array = json.getAsJsonArray("participantType"); 3085 for (int i = 0; i < array.size(); i++) { 3086 res.getParticipantType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 3087 } 3088 } 3089 ; 3090 if (json.has("actor")) 3091 res.setActor(parseReference(getJObject(json, "actor"))); 3092 if (json.has("participantStatus")) 3093 res.setParticipantStatusElement(parseEnumeration(json.get("participantStatus").getAsString(), 3094 AppointmentResponse.ParticipantStatus.NULL, new AppointmentResponse.ParticipantStatusEnumFactory())); 3095 if (json.has("_participantStatus")) 3096 parseElementProperties(getJObject(json, "_participantStatus"), res.getParticipantStatusElement()); 3097 if (json.has("comment")) 3098 res.setCommentElement(parseString(json.get("comment").getAsString())); 3099 if (json.has("_comment")) 3100 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 3101 } 3102 3103 protected AuditEvent parseAuditEvent(JsonObject json) throws IOException, FHIRFormatError { 3104 AuditEvent res = new AuditEvent(); 3105 parseAuditEventProperties(json, res); 3106 return res; 3107 } 3108 3109 protected void parseAuditEventProperties(JsonObject json, AuditEvent res) throws IOException, FHIRFormatError { 3110 parseDomainResourceProperties(json, res); 3111 if (json.has("type")) 3112 res.setType(parseCoding(getJObject(json, "type"))); 3113 if (json.has("subtype")) { 3114 JsonArray array = json.getAsJsonArray("subtype"); 3115 for (int i = 0; i < array.size(); i++) { 3116 res.getSubtype().add(parseCoding(array.get(i).getAsJsonObject())); 3117 } 3118 } 3119 ; 3120 if (json.has("action")) 3121 res.setActionElement(parseEnumeration(json.get("action").getAsString(), AuditEvent.AuditEventAction.NULL, 3122 new AuditEvent.AuditEventActionEnumFactory())); 3123 if (json.has("_action")) 3124 parseElementProperties(getJObject(json, "_action"), res.getActionElement()); 3125 if (json.has("period")) 3126 res.setPeriod(parsePeriod(getJObject(json, "period"))); 3127 if (json.has("recorded")) 3128 res.setRecordedElement(parseInstant(json.get("recorded").getAsString())); 3129 if (json.has("_recorded")) 3130 parseElementProperties(getJObject(json, "_recorded"), res.getRecordedElement()); 3131 if (json.has("outcome")) 3132 res.setOutcomeElement(parseEnumeration(json.get("outcome").getAsString(), AuditEvent.AuditEventOutcome.NULL, 3133 new AuditEvent.AuditEventOutcomeEnumFactory())); 3134 if (json.has("_outcome")) 3135 parseElementProperties(getJObject(json, "_outcome"), res.getOutcomeElement()); 3136 if (json.has("outcomeDesc")) 3137 res.setOutcomeDescElement(parseString(json.get("outcomeDesc").getAsString())); 3138 if (json.has("_outcomeDesc")) 3139 parseElementProperties(getJObject(json, "_outcomeDesc"), res.getOutcomeDescElement()); 3140 if (json.has("purposeOfEvent")) { 3141 JsonArray array = json.getAsJsonArray("purposeOfEvent"); 3142 for (int i = 0; i < array.size(); i++) { 3143 res.getPurposeOfEvent().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 3144 } 3145 } 3146 ; 3147 if (json.has("agent")) { 3148 JsonArray array = json.getAsJsonArray("agent"); 3149 for (int i = 0; i < array.size(); i++) { 3150 res.getAgent().add(parseAuditEventAuditEventAgentComponent(array.get(i).getAsJsonObject(), res)); 3151 } 3152 } 3153 ; 3154 if (json.has("source")) 3155 res.setSource(parseAuditEventAuditEventSourceComponent(getJObject(json, "source"), res)); 3156 if (json.has("entity")) { 3157 JsonArray array = json.getAsJsonArray("entity"); 3158 for (int i = 0; i < array.size(); i++) { 3159 res.getEntity().add(parseAuditEventAuditEventEntityComponent(array.get(i).getAsJsonObject(), res)); 3160 } 3161 } 3162 ; 3163 } 3164 3165 protected AuditEvent.AuditEventAgentComponent parseAuditEventAuditEventAgentComponent(JsonObject json, 3166 AuditEvent owner) throws IOException, FHIRFormatError { 3167 AuditEvent.AuditEventAgentComponent res = new AuditEvent.AuditEventAgentComponent(); 3168 parseAuditEventAuditEventAgentComponentProperties(json, owner, res); 3169 return res; 3170 } 3171 3172 protected void parseAuditEventAuditEventAgentComponentProperties(JsonObject json, AuditEvent owner, 3173 AuditEvent.AuditEventAgentComponent res) throws IOException, FHIRFormatError { 3174 parseBackboneElementProperties(json, res); 3175 if (json.has("type")) 3176 res.setType(parseCodeableConcept(getJObject(json, "type"))); 3177 if (json.has("role")) { 3178 JsonArray array = json.getAsJsonArray("role"); 3179 for (int i = 0; i < array.size(); i++) { 3180 res.getRole().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 3181 } 3182 } 3183 ; 3184 if (json.has("who")) 3185 res.setWho(parseReference(getJObject(json, "who"))); 3186 if (json.has("altId")) 3187 res.setAltIdElement(parseString(json.get("altId").getAsString())); 3188 if (json.has("_altId")) 3189 parseElementProperties(getJObject(json, "_altId"), res.getAltIdElement()); 3190 if (json.has("name")) 3191 res.setNameElement(parseString(json.get("name").getAsString())); 3192 if (json.has("_name")) 3193 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 3194 if (json.has("requestor")) 3195 res.setRequestorElement(parseBoolean(json.get("requestor").getAsBoolean())); 3196 if (json.has("_requestor")) 3197 parseElementProperties(getJObject(json, "_requestor"), res.getRequestorElement()); 3198 if (json.has("location")) 3199 res.setLocation(parseReference(getJObject(json, "location"))); 3200 if (json.has("policy")) { 3201 JsonArray array = json.getAsJsonArray("policy"); 3202 for (int i = 0; i < array.size(); i++) { 3203 if (array.get(i).isJsonNull()) { 3204 res.getPolicy().add(new UriType()); 3205 } else { 3206 res.getPolicy().add(parseUri(array.get(i).getAsString())); 3207 } 3208 } 3209 } 3210 ; 3211 if (json.has("_policy")) { 3212 JsonArray array = json.getAsJsonArray("_policy"); 3213 for (int i = 0; i < array.size(); i++) { 3214 if (i == res.getPolicy().size()) 3215 res.getPolicy().add(parseUri(null)); 3216 if (array.get(i) instanceof JsonObject) 3217 parseElementProperties(array.get(i).getAsJsonObject(), res.getPolicy().get(i)); 3218 } 3219 } 3220 ; 3221 if (json.has("media")) 3222 res.setMedia(parseCoding(getJObject(json, "media"))); 3223 if (json.has("network")) 3224 res.setNetwork(parseAuditEventAuditEventAgentNetworkComponent(getJObject(json, "network"), owner)); 3225 if (json.has("purposeOfUse")) { 3226 JsonArray array = json.getAsJsonArray("purposeOfUse"); 3227 for (int i = 0; i < array.size(); i++) { 3228 res.getPurposeOfUse().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 3229 } 3230 } 3231 ; 3232 } 3233 3234 protected AuditEvent.AuditEventAgentNetworkComponent parseAuditEventAuditEventAgentNetworkComponent(JsonObject json, 3235 AuditEvent owner) throws IOException, FHIRFormatError { 3236 AuditEvent.AuditEventAgentNetworkComponent res = new AuditEvent.AuditEventAgentNetworkComponent(); 3237 parseAuditEventAuditEventAgentNetworkComponentProperties(json, owner, res); 3238 return res; 3239 } 3240 3241 protected void parseAuditEventAuditEventAgentNetworkComponentProperties(JsonObject json, AuditEvent owner, 3242 AuditEvent.AuditEventAgentNetworkComponent res) throws IOException, FHIRFormatError { 3243 parseBackboneElementProperties(json, res); 3244 if (json.has("address")) 3245 res.setAddressElement(parseString(json.get("address").getAsString())); 3246 if (json.has("_address")) 3247 parseElementProperties(getJObject(json, "_address"), res.getAddressElement()); 3248 if (json.has("type")) 3249 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), AuditEvent.AuditEventAgentNetworkType.NULL, 3250 new AuditEvent.AuditEventAgentNetworkTypeEnumFactory())); 3251 if (json.has("_type")) 3252 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 3253 } 3254 3255 protected AuditEvent.AuditEventSourceComponent parseAuditEventAuditEventSourceComponent(JsonObject json, 3256 AuditEvent owner) throws IOException, FHIRFormatError { 3257 AuditEvent.AuditEventSourceComponent res = new AuditEvent.AuditEventSourceComponent(); 3258 parseAuditEventAuditEventSourceComponentProperties(json, owner, res); 3259 return res; 3260 } 3261 3262 protected void parseAuditEventAuditEventSourceComponentProperties(JsonObject json, AuditEvent owner, 3263 AuditEvent.AuditEventSourceComponent res) throws IOException, FHIRFormatError { 3264 parseBackboneElementProperties(json, res); 3265 if (json.has("site")) 3266 res.setSiteElement(parseString(json.get("site").getAsString())); 3267 if (json.has("_site")) 3268 parseElementProperties(getJObject(json, "_site"), res.getSiteElement()); 3269 if (json.has("observer")) 3270 res.setObserver(parseReference(getJObject(json, "observer"))); 3271 if (json.has("type")) { 3272 JsonArray array = json.getAsJsonArray("type"); 3273 for (int i = 0; i < array.size(); i++) { 3274 res.getType().add(parseCoding(array.get(i).getAsJsonObject())); 3275 } 3276 } 3277 ; 3278 } 3279 3280 protected AuditEvent.AuditEventEntityComponent parseAuditEventAuditEventEntityComponent(JsonObject json, 3281 AuditEvent owner) throws IOException, FHIRFormatError { 3282 AuditEvent.AuditEventEntityComponent res = new AuditEvent.AuditEventEntityComponent(); 3283 parseAuditEventAuditEventEntityComponentProperties(json, owner, res); 3284 return res; 3285 } 3286 3287 protected void parseAuditEventAuditEventEntityComponentProperties(JsonObject json, AuditEvent owner, 3288 AuditEvent.AuditEventEntityComponent res) throws IOException, FHIRFormatError { 3289 parseBackboneElementProperties(json, res); 3290 if (json.has("what")) 3291 res.setWhat(parseReference(getJObject(json, "what"))); 3292 if (json.has("type")) 3293 res.setType(parseCoding(getJObject(json, "type"))); 3294 if (json.has("role")) 3295 res.setRole(parseCoding(getJObject(json, "role"))); 3296 if (json.has("lifecycle")) 3297 res.setLifecycle(parseCoding(getJObject(json, "lifecycle"))); 3298 if (json.has("securityLabel")) { 3299 JsonArray array = json.getAsJsonArray("securityLabel"); 3300 for (int i = 0; i < array.size(); i++) { 3301 res.getSecurityLabel().add(parseCoding(array.get(i).getAsJsonObject())); 3302 } 3303 } 3304 ; 3305 if (json.has("name")) 3306 res.setNameElement(parseString(json.get("name").getAsString())); 3307 if (json.has("_name")) 3308 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 3309 if (json.has("description")) 3310 res.setDescriptionElement(parseString(json.get("description").getAsString())); 3311 if (json.has("_description")) 3312 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 3313 if (json.has("query")) 3314 res.setQueryElement(parseBase64Binary(json.get("query").getAsString())); 3315 if (json.has("_query")) 3316 parseElementProperties(getJObject(json, "_query"), res.getQueryElement()); 3317 if (json.has("detail")) { 3318 JsonArray array = json.getAsJsonArray("detail"); 3319 for (int i = 0; i < array.size(); i++) { 3320 res.getDetail().add(parseAuditEventAuditEventEntityDetailComponent(array.get(i).getAsJsonObject(), owner)); 3321 } 3322 } 3323 ; 3324 } 3325 3326 protected AuditEvent.AuditEventEntityDetailComponent parseAuditEventAuditEventEntityDetailComponent(JsonObject json, 3327 AuditEvent owner) throws IOException, FHIRFormatError { 3328 AuditEvent.AuditEventEntityDetailComponent res = new AuditEvent.AuditEventEntityDetailComponent(); 3329 parseAuditEventAuditEventEntityDetailComponentProperties(json, owner, res); 3330 return res; 3331 } 3332 3333 protected void parseAuditEventAuditEventEntityDetailComponentProperties(JsonObject json, AuditEvent owner, 3334 AuditEvent.AuditEventEntityDetailComponent res) throws IOException, FHIRFormatError { 3335 parseBackboneElementProperties(json, res); 3336 if (json.has("type")) 3337 res.setTypeElement(parseString(json.get("type").getAsString())); 3338 if (json.has("_type")) 3339 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 3340 Type value = parseType("value", json); 3341 if (value != null) 3342 res.setValue(value); 3343 } 3344 3345 protected Basic parseBasic(JsonObject json) throws IOException, FHIRFormatError { 3346 Basic res = new Basic(); 3347 parseBasicProperties(json, res); 3348 return res; 3349 } 3350 3351 protected void parseBasicProperties(JsonObject json, Basic res) throws IOException, FHIRFormatError { 3352 parseDomainResourceProperties(json, res); 3353 if (json.has("identifier")) { 3354 JsonArray array = json.getAsJsonArray("identifier"); 3355 for (int i = 0; i < array.size(); i++) { 3356 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 3357 } 3358 } 3359 ; 3360 if (json.has("code")) 3361 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 3362 if (json.has("subject")) 3363 res.setSubject(parseReference(getJObject(json, "subject"))); 3364 if (json.has("created")) 3365 res.setCreatedElement(parseDate(json.get("created").getAsString())); 3366 if (json.has("_created")) 3367 parseElementProperties(getJObject(json, "_created"), res.getCreatedElement()); 3368 if (json.has("author")) 3369 res.setAuthor(parseReference(getJObject(json, "author"))); 3370 } 3371 3372 protected Binary parseBinary(JsonObject json) throws IOException, FHIRFormatError { 3373 Binary res = new Binary(); 3374 parseBinaryProperties(json, res); 3375 return res; 3376 } 3377 3378 protected void parseBinaryProperties(JsonObject json, Binary res) throws IOException, FHIRFormatError { 3379 parseResourceProperties(json, res); 3380 if (json.has("contentType")) 3381 res.setContentTypeElement(parseCode(json.get("contentType").getAsString())); 3382 if (json.has("_contentType")) 3383 parseElementProperties(getJObject(json, "_contentType"), res.getContentTypeElement()); 3384 if (json.has("securityContext")) 3385 res.setSecurityContext(parseReference(getJObject(json, "securityContext"))); 3386 if (json.has("data")) 3387 res.setDataElement(parseBase64Binary(json.get("data").getAsString())); 3388 if (json.has("_data")) 3389 parseElementProperties(getJObject(json, "_data"), res.getDataElement()); 3390 } 3391 3392 protected BiologicallyDerivedProduct parseBiologicallyDerivedProduct(JsonObject json) 3393 throws IOException, FHIRFormatError { 3394 BiologicallyDerivedProduct res = new BiologicallyDerivedProduct(); 3395 parseBiologicallyDerivedProductProperties(json, res); 3396 return res; 3397 } 3398 3399 protected void parseBiologicallyDerivedProductProperties(JsonObject json, BiologicallyDerivedProduct res) 3400 throws IOException, FHIRFormatError { 3401 parseDomainResourceProperties(json, res); 3402 if (json.has("identifier")) { 3403 JsonArray array = json.getAsJsonArray("identifier"); 3404 for (int i = 0; i < array.size(); i++) { 3405 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 3406 } 3407 } 3408 ; 3409 if (json.has("productCategory")) 3410 res.setProductCategoryElement(parseEnumeration(json.get("productCategory").getAsString(), 3411 BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.NULL, 3412 new BiologicallyDerivedProduct.BiologicallyDerivedProductCategoryEnumFactory())); 3413 if (json.has("_productCategory")) 3414 parseElementProperties(getJObject(json, "_productCategory"), res.getProductCategoryElement()); 3415 if (json.has("productCode")) 3416 res.setProductCode(parseCodeableConcept(getJObject(json, "productCode"))); 3417 if (json.has("status")) 3418 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), 3419 BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.NULL, 3420 new BiologicallyDerivedProduct.BiologicallyDerivedProductStatusEnumFactory())); 3421 if (json.has("_status")) 3422 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 3423 if (json.has("request")) { 3424 JsonArray array = json.getAsJsonArray("request"); 3425 for (int i = 0; i < array.size(); i++) { 3426 res.getRequest().add(parseReference(array.get(i).getAsJsonObject())); 3427 } 3428 } 3429 ; 3430 if (json.has("quantity")) 3431 res.setQuantityElement(parseInteger(json.get("quantity").getAsLong())); 3432 if (json.has("_quantity")) 3433 parseElementProperties(getJObject(json, "_quantity"), res.getQuantityElement()); 3434 if (json.has("parent")) { 3435 JsonArray array = json.getAsJsonArray("parent"); 3436 for (int i = 0; i < array.size(); i++) { 3437 res.getParent().add(parseReference(array.get(i).getAsJsonObject())); 3438 } 3439 } 3440 ; 3441 if (json.has("collection")) 3442 res.setCollection(parseBiologicallyDerivedProductBiologicallyDerivedProductCollectionComponent( 3443 getJObject(json, "collection"), res)); 3444 if (json.has("processing")) { 3445 JsonArray array = json.getAsJsonArray("processing"); 3446 for (int i = 0; i < array.size(); i++) { 3447 res.getProcessing().add(parseBiologicallyDerivedProductBiologicallyDerivedProductProcessingComponent( 3448 array.get(i).getAsJsonObject(), res)); 3449 } 3450 } 3451 ; 3452 if (json.has("manipulation")) 3453 res.setManipulation(parseBiologicallyDerivedProductBiologicallyDerivedProductManipulationComponent( 3454 getJObject(json, "manipulation"), res)); 3455 if (json.has("storage")) { 3456 JsonArray array = json.getAsJsonArray("storage"); 3457 for (int i = 0; i < array.size(); i++) { 3458 res.getStorage().add(parseBiologicallyDerivedProductBiologicallyDerivedProductStorageComponent( 3459 array.get(i).getAsJsonObject(), res)); 3460 } 3461 } 3462 ; 3463 } 3464 3465 protected BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent parseBiologicallyDerivedProductBiologicallyDerivedProductCollectionComponent( 3466 JsonObject json, BiologicallyDerivedProduct owner) throws IOException, FHIRFormatError { 3467 BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent res = new BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent(); 3468 parseBiologicallyDerivedProductBiologicallyDerivedProductCollectionComponentProperties(json, owner, res); 3469 return res; 3470 } 3471 3472 protected void parseBiologicallyDerivedProductBiologicallyDerivedProductCollectionComponentProperties(JsonObject json, 3473 BiologicallyDerivedProduct owner, BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent res) 3474 throws IOException, FHIRFormatError { 3475 parseBackboneElementProperties(json, res); 3476 if (json.has("collector")) 3477 res.setCollector(parseReference(getJObject(json, "collector"))); 3478 if (json.has("source")) 3479 res.setSource(parseReference(getJObject(json, "source"))); 3480 Type collected = parseType("collected", json); 3481 if (collected != null) 3482 res.setCollected(collected); 3483 } 3484 3485 protected BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent parseBiologicallyDerivedProductBiologicallyDerivedProductProcessingComponent( 3486 JsonObject json, BiologicallyDerivedProduct owner) throws IOException, FHIRFormatError { 3487 BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent res = new BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent(); 3488 parseBiologicallyDerivedProductBiologicallyDerivedProductProcessingComponentProperties(json, owner, res); 3489 return res; 3490 } 3491 3492 protected void parseBiologicallyDerivedProductBiologicallyDerivedProductProcessingComponentProperties(JsonObject json, 3493 BiologicallyDerivedProduct owner, BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent res) 3494 throws IOException, FHIRFormatError { 3495 parseBackboneElementProperties(json, res); 3496 if (json.has("description")) 3497 res.setDescriptionElement(parseString(json.get("description").getAsString())); 3498 if (json.has("_description")) 3499 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 3500 if (json.has("procedure")) 3501 res.setProcedure(parseCodeableConcept(getJObject(json, "procedure"))); 3502 if (json.has("additive")) 3503 res.setAdditive(parseReference(getJObject(json, "additive"))); 3504 Type time = parseType("time", json); 3505 if (time != null) 3506 res.setTime(time); 3507 } 3508 3509 protected BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent parseBiologicallyDerivedProductBiologicallyDerivedProductManipulationComponent( 3510 JsonObject json, BiologicallyDerivedProduct owner) throws IOException, FHIRFormatError { 3511 BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent res = new BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent(); 3512 parseBiologicallyDerivedProductBiologicallyDerivedProductManipulationComponentProperties(json, owner, res); 3513 return res; 3514 } 3515 3516 protected void parseBiologicallyDerivedProductBiologicallyDerivedProductManipulationComponentProperties( 3517 JsonObject json, BiologicallyDerivedProduct owner, 3518 BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent res) 3519 throws IOException, FHIRFormatError { 3520 parseBackboneElementProperties(json, res); 3521 if (json.has("description")) 3522 res.setDescriptionElement(parseString(json.get("description").getAsString())); 3523 if (json.has("_description")) 3524 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 3525 Type time = parseType("time", json); 3526 if (time != null) 3527 res.setTime(time); 3528 } 3529 3530 protected BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent parseBiologicallyDerivedProductBiologicallyDerivedProductStorageComponent( 3531 JsonObject json, BiologicallyDerivedProduct owner) throws IOException, FHIRFormatError { 3532 BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent res = new BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent(); 3533 parseBiologicallyDerivedProductBiologicallyDerivedProductStorageComponentProperties(json, owner, res); 3534 return res; 3535 } 3536 3537 protected void parseBiologicallyDerivedProductBiologicallyDerivedProductStorageComponentProperties(JsonObject json, 3538 BiologicallyDerivedProduct owner, BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent res) 3539 throws IOException, FHIRFormatError { 3540 parseBackboneElementProperties(json, res); 3541 if (json.has("description")) 3542 res.setDescriptionElement(parseString(json.get("description").getAsString())); 3543 if (json.has("_description")) 3544 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 3545 if (json.has("temperature")) 3546 res.setTemperatureElement(parseDecimal(json.get("temperature").getAsBigDecimal())); 3547 if (json.has("_temperature")) 3548 parseElementProperties(getJObject(json, "_temperature"), res.getTemperatureElement()); 3549 if (json.has("scale")) 3550 res.setScaleElement(parseEnumeration(json.get("scale").getAsString(), 3551 BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.NULL, 3552 new BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScaleEnumFactory())); 3553 if (json.has("_scale")) 3554 parseElementProperties(getJObject(json, "_scale"), res.getScaleElement()); 3555 if (json.has("duration")) 3556 res.setDuration(parsePeriod(getJObject(json, "duration"))); 3557 } 3558 3559 protected BodyStructure parseBodyStructure(JsonObject json) throws IOException, FHIRFormatError { 3560 BodyStructure res = new BodyStructure(); 3561 parseBodyStructureProperties(json, res); 3562 return res; 3563 } 3564 3565 protected void parseBodyStructureProperties(JsonObject json, BodyStructure res) throws IOException, FHIRFormatError { 3566 parseDomainResourceProperties(json, res); 3567 if (json.has("identifier")) { 3568 JsonArray array = json.getAsJsonArray("identifier"); 3569 for (int i = 0; i < array.size(); i++) { 3570 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 3571 } 3572 } 3573 ; 3574 if (json.has("active")) 3575 res.setActiveElement(parseBoolean(json.get("active").getAsBoolean())); 3576 if (json.has("_active")) 3577 parseElementProperties(getJObject(json, "_active"), res.getActiveElement()); 3578 if (json.has("morphology")) 3579 res.setMorphology(parseCodeableConcept(getJObject(json, "morphology"))); 3580 if (json.has("location")) 3581 res.setLocation(parseCodeableConcept(getJObject(json, "location"))); 3582 if (json.has("locationQualifier")) { 3583 JsonArray array = json.getAsJsonArray("locationQualifier"); 3584 for (int i = 0; i < array.size(); i++) { 3585 res.getLocationQualifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 3586 } 3587 } 3588 ; 3589 if (json.has("description")) 3590 res.setDescriptionElement(parseString(json.get("description").getAsString())); 3591 if (json.has("_description")) 3592 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 3593 if (json.has("image")) { 3594 JsonArray array = json.getAsJsonArray("image"); 3595 for (int i = 0; i < array.size(); i++) { 3596 res.getImage().add(parseAttachment(array.get(i).getAsJsonObject())); 3597 } 3598 } 3599 ; 3600 if (json.has("patient")) 3601 res.setPatient(parseReference(getJObject(json, "patient"))); 3602 } 3603 3604 protected Bundle parseBundle(JsonObject json) throws IOException, FHIRFormatError { 3605 Bundle res = new Bundle(); 3606 parseBundleProperties(json, res); 3607 return res; 3608 } 3609 3610 protected void parseBundleProperties(JsonObject json, Bundle res) throws IOException, FHIRFormatError { 3611 parseResourceProperties(json, res); 3612 if (json.has("identifier")) 3613 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 3614 if (json.has("type")) 3615 res.setTypeElement( 3616 parseEnumeration(json.get("type").getAsString(), Bundle.BundleType.NULL, new Bundle.BundleTypeEnumFactory())); 3617 if (json.has("_type")) 3618 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 3619 if (json.has("timestamp")) 3620 res.setTimestampElement(parseInstant(json.get("timestamp").getAsString())); 3621 if (json.has("_timestamp")) 3622 parseElementProperties(getJObject(json, "_timestamp"), res.getTimestampElement()); 3623 if (json.has("total")) 3624 res.setTotalElement(parseUnsignedInt(json.get("total").getAsString())); 3625 if (json.has("_total")) 3626 parseElementProperties(getJObject(json, "_total"), res.getTotalElement()); 3627 if (json.has("link")) { 3628 JsonArray array = json.getAsJsonArray("link"); 3629 for (int i = 0; i < array.size(); i++) { 3630 res.getLink().add(parseBundleBundleLinkComponent(array.get(i).getAsJsonObject(), res)); 3631 } 3632 } 3633 ; 3634 if (json.has("entry")) { 3635 JsonArray array = json.getAsJsonArray("entry"); 3636 for (int i = 0; i < array.size(); i++) { 3637 res.getEntry().add(parseBundleBundleEntryComponent(array.get(i).getAsJsonObject(), res)); 3638 } 3639 } 3640 ; 3641 if (json.has("signature")) 3642 res.setSignature(parseSignature(getJObject(json, "signature"))); 3643 } 3644 3645 protected Bundle.BundleLinkComponent parseBundleBundleLinkComponent(JsonObject json, Bundle owner) 3646 throws IOException, FHIRFormatError { 3647 Bundle.BundleLinkComponent res = new Bundle.BundleLinkComponent(); 3648 parseBundleBundleLinkComponentProperties(json, owner, res); 3649 return res; 3650 } 3651 3652 protected void parseBundleBundleLinkComponentProperties(JsonObject json, Bundle owner, Bundle.BundleLinkComponent res) 3653 throws IOException, FHIRFormatError { 3654 parseBackboneElementProperties(json, res); 3655 if (json.has("relation")) 3656 res.setRelationElement(parseString(json.get("relation").getAsString())); 3657 if (json.has("_relation")) 3658 parseElementProperties(getJObject(json, "_relation"), res.getRelationElement()); 3659 if (json.has("url")) 3660 res.setUrlElement(parseUri(json.get("url").getAsString())); 3661 if (json.has("_url")) 3662 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 3663 } 3664 3665 protected Bundle.BundleEntryComponent parseBundleBundleEntryComponent(JsonObject json, Bundle owner) 3666 throws IOException, FHIRFormatError { 3667 Bundle.BundleEntryComponent res = new Bundle.BundleEntryComponent(); 3668 parseBundleBundleEntryComponentProperties(json, owner, res); 3669 return res; 3670 } 3671 3672 protected void parseBundleBundleEntryComponentProperties(JsonObject json, Bundle owner, 3673 Bundle.BundleEntryComponent res) throws IOException, FHIRFormatError { 3674 parseBackboneElementProperties(json, res); 3675 if (json.has("link")) { 3676 JsonArray array = json.getAsJsonArray("link"); 3677 for (int i = 0; i < array.size(); i++) { 3678 res.getLink().add(parseBundleBundleLinkComponent(array.get(i).getAsJsonObject(), owner)); 3679 } 3680 } 3681 ; 3682 if (json.has("fullUrl")) 3683 res.setFullUrlElement(parseUri(json.get("fullUrl").getAsString())); 3684 if (json.has("_fullUrl")) 3685 parseElementProperties(getJObject(json, "_fullUrl"), res.getFullUrlElement()); 3686 if (json.has("resource")) 3687 res.setResource(parseResource(getJObject(json, "resource"))); 3688 if (json.has("search")) 3689 res.setSearch(parseBundleBundleEntrySearchComponent(getJObject(json, "search"), owner)); 3690 if (json.has("request")) 3691 res.setRequest(parseBundleBundleEntryRequestComponent(getJObject(json, "request"), owner)); 3692 if (json.has("response")) 3693 res.setResponse(parseBundleBundleEntryResponseComponent(getJObject(json, "response"), owner)); 3694 } 3695 3696 protected Bundle.BundleEntrySearchComponent parseBundleBundleEntrySearchComponent(JsonObject json, Bundle owner) 3697 throws IOException, FHIRFormatError { 3698 Bundle.BundleEntrySearchComponent res = new Bundle.BundleEntrySearchComponent(); 3699 parseBundleBundleEntrySearchComponentProperties(json, owner, res); 3700 return res; 3701 } 3702 3703 protected void parseBundleBundleEntrySearchComponentProperties(JsonObject json, Bundle owner, 3704 Bundle.BundleEntrySearchComponent res) throws IOException, FHIRFormatError { 3705 parseBackboneElementProperties(json, res); 3706 if (json.has("mode")) 3707 res.setModeElement(parseEnumeration(json.get("mode").getAsString(), Bundle.SearchEntryMode.NULL, 3708 new Bundle.SearchEntryModeEnumFactory())); 3709 if (json.has("_mode")) 3710 parseElementProperties(getJObject(json, "_mode"), res.getModeElement()); 3711 if (json.has("score")) 3712 res.setScoreElement(parseDecimal(json.get("score").getAsBigDecimal())); 3713 if (json.has("_score")) 3714 parseElementProperties(getJObject(json, "_score"), res.getScoreElement()); 3715 } 3716 3717 protected Bundle.BundleEntryRequestComponent parseBundleBundleEntryRequestComponent(JsonObject json, Bundle owner) 3718 throws IOException, FHIRFormatError { 3719 Bundle.BundleEntryRequestComponent res = new Bundle.BundleEntryRequestComponent(); 3720 parseBundleBundleEntryRequestComponentProperties(json, owner, res); 3721 return res; 3722 } 3723 3724 protected void parseBundleBundleEntryRequestComponentProperties(JsonObject json, Bundle owner, 3725 Bundle.BundleEntryRequestComponent res) throws IOException, FHIRFormatError { 3726 parseBackboneElementProperties(json, res); 3727 if (json.has("method")) 3728 res.setMethodElement( 3729 parseEnumeration(json.get("method").getAsString(), Bundle.HTTPVerb.NULL, new Bundle.HTTPVerbEnumFactory())); 3730 if (json.has("_method")) 3731 parseElementProperties(getJObject(json, "_method"), res.getMethodElement()); 3732 if (json.has("url")) 3733 res.setUrlElement(parseUri(json.get("url").getAsString())); 3734 if (json.has("_url")) 3735 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 3736 if (json.has("ifNoneMatch")) 3737 res.setIfNoneMatchElement(parseString(json.get("ifNoneMatch").getAsString())); 3738 if (json.has("_ifNoneMatch")) 3739 parseElementProperties(getJObject(json, "_ifNoneMatch"), res.getIfNoneMatchElement()); 3740 if (json.has("ifModifiedSince")) 3741 res.setIfModifiedSinceElement(parseInstant(json.get("ifModifiedSince").getAsString())); 3742 if (json.has("_ifModifiedSince")) 3743 parseElementProperties(getJObject(json, "_ifModifiedSince"), res.getIfModifiedSinceElement()); 3744 if (json.has("ifMatch")) 3745 res.setIfMatchElement(parseString(json.get("ifMatch").getAsString())); 3746 if (json.has("_ifMatch")) 3747 parseElementProperties(getJObject(json, "_ifMatch"), res.getIfMatchElement()); 3748 if (json.has("ifNoneExist")) 3749 res.setIfNoneExistElement(parseString(json.get("ifNoneExist").getAsString())); 3750 if (json.has("_ifNoneExist")) 3751 parseElementProperties(getJObject(json, "_ifNoneExist"), res.getIfNoneExistElement()); 3752 } 3753 3754 protected Bundle.BundleEntryResponseComponent parseBundleBundleEntryResponseComponent(JsonObject json, Bundle owner) 3755 throws IOException, FHIRFormatError { 3756 Bundle.BundleEntryResponseComponent res = new Bundle.BundleEntryResponseComponent(); 3757 parseBundleBundleEntryResponseComponentProperties(json, owner, res); 3758 return res; 3759 } 3760 3761 protected void parseBundleBundleEntryResponseComponentProperties(JsonObject json, Bundle owner, 3762 Bundle.BundleEntryResponseComponent res) throws IOException, FHIRFormatError { 3763 parseBackboneElementProperties(json, res); 3764 if (json.has("status")) 3765 res.setStatusElement(parseString(json.get("status").getAsString())); 3766 if (json.has("_status")) 3767 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 3768 if (json.has("location")) 3769 res.setLocationElement(parseUri(json.get("location").getAsString())); 3770 if (json.has("_location")) 3771 parseElementProperties(getJObject(json, "_location"), res.getLocationElement()); 3772 if (json.has("etag")) 3773 res.setEtagElement(parseString(json.get("etag").getAsString())); 3774 if (json.has("_etag")) 3775 parseElementProperties(getJObject(json, "_etag"), res.getEtagElement()); 3776 if (json.has("lastModified")) 3777 res.setLastModifiedElement(parseInstant(json.get("lastModified").getAsString())); 3778 if (json.has("_lastModified")) 3779 parseElementProperties(getJObject(json, "_lastModified"), res.getLastModifiedElement()); 3780 if (json.has("outcome")) 3781 res.setOutcome(parseResource(getJObject(json, "outcome"))); 3782 } 3783 3784 protected CapabilityStatement parseCapabilityStatement(JsonObject json) throws IOException, FHIRFormatError { 3785 CapabilityStatement res = new CapabilityStatement(); 3786 parseCapabilityStatementProperties(json, res); 3787 return res; 3788 } 3789 3790 protected void parseCapabilityStatementProperties(JsonObject json, CapabilityStatement res) 3791 throws IOException, FHIRFormatError { 3792 parseDomainResourceProperties(json, res); 3793 if (json.has("url")) 3794 res.setUrlElement(parseUri(json.get("url").getAsString())); 3795 if (json.has("_url")) 3796 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 3797 if (json.has("version")) 3798 res.setVersionElement(parseString(json.get("version").getAsString())); 3799 if (json.has("_version")) 3800 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 3801 if (json.has("name")) 3802 res.setNameElement(parseString(json.get("name").getAsString())); 3803 if (json.has("_name")) 3804 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 3805 if (json.has("title")) 3806 res.setTitleElement(parseString(json.get("title").getAsString())); 3807 if (json.has("_title")) 3808 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 3809 if (json.has("status")) 3810 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 3811 new Enumerations.PublicationStatusEnumFactory())); 3812 if (json.has("_status")) 3813 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 3814 if (json.has("experimental")) 3815 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 3816 if (json.has("_experimental")) 3817 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 3818 if (json.has("date")) 3819 res.setDateElement(parseDateTime(json.get("date").getAsString())); 3820 if (json.has("_date")) 3821 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 3822 if (json.has("publisher")) 3823 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 3824 if (json.has("_publisher")) 3825 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 3826 if (json.has("contact")) { 3827 JsonArray array = json.getAsJsonArray("contact"); 3828 for (int i = 0; i < array.size(); i++) { 3829 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 3830 } 3831 } 3832 ; 3833 if (json.has("description")) 3834 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 3835 if (json.has("_description")) 3836 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 3837 if (json.has("useContext")) { 3838 JsonArray array = json.getAsJsonArray("useContext"); 3839 for (int i = 0; i < array.size(); i++) { 3840 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 3841 } 3842 } 3843 ; 3844 if (json.has("jurisdiction")) { 3845 JsonArray array = json.getAsJsonArray("jurisdiction"); 3846 for (int i = 0; i < array.size(); i++) { 3847 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 3848 } 3849 } 3850 ; 3851 if (json.has("purpose")) 3852 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 3853 if (json.has("_purpose")) 3854 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 3855 if (json.has("copyright")) 3856 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 3857 if (json.has("_copyright")) 3858 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 3859 if (json.has("kind")) 3860 res.setKindElement( 3861 parseEnumeration(json.get("kind").getAsString(), CapabilityStatement.CapabilityStatementKind.NULL, 3862 new CapabilityStatement.CapabilityStatementKindEnumFactory())); 3863 if (json.has("_kind")) 3864 parseElementProperties(getJObject(json, "_kind"), res.getKindElement()); 3865 if (json.has("instantiates")) { 3866 JsonArray array = json.getAsJsonArray("instantiates"); 3867 for (int i = 0; i < array.size(); i++) { 3868 if (array.get(i).isJsonNull()) { 3869 res.getInstantiates().add(new CanonicalType()); 3870 } else { 3871 res.getInstantiates().add(parseCanonical(array.get(i).getAsString())); 3872 } 3873 } 3874 } 3875 ; 3876 if (json.has("_instantiates")) { 3877 JsonArray array = json.getAsJsonArray("_instantiates"); 3878 for (int i = 0; i < array.size(); i++) { 3879 if (i == res.getInstantiates().size()) 3880 res.getInstantiates().add(parseCanonical(null)); 3881 if (array.get(i) instanceof JsonObject) 3882 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiates().get(i)); 3883 } 3884 } 3885 ; 3886 if (json.has("imports")) { 3887 JsonArray array = json.getAsJsonArray("imports"); 3888 for (int i = 0; i < array.size(); i++) { 3889 if (array.get(i).isJsonNull()) { 3890 res.getImports().add(new CanonicalType()); 3891 } else { 3892 res.getImports().add(parseCanonical(array.get(i).getAsString())); 3893 } 3894 } 3895 } 3896 ; 3897 if (json.has("_imports")) { 3898 JsonArray array = json.getAsJsonArray("_imports"); 3899 for (int i = 0; i < array.size(); i++) { 3900 if (i == res.getImports().size()) 3901 res.getImports().add(parseCanonical(null)); 3902 if (array.get(i) instanceof JsonObject) 3903 parseElementProperties(array.get(i).getAsJsonObject(), res.getImports().get(i)); 3904 } 3905 } 3906 ; 3907 if (json.has("software")) 3908 res.setSoftware(parseCapabilityStatementCapabilityStatementSoftwareComponent(getJObject(json, "software"), res)); 3909 if (json.has("implementation")) 3910 res.setImplementation( 3911 parseCapabilityStatementCapabilityStatementImplementationComponent(getJObject(json, "implementation"), res)); 3912 if (json.has("fhirVersion")) 3913 res.setFhirVersionElement(parseEnumeration(json.get("fhirVersion").getAsString(), Enumerations.FHIRVersion.NULL, 3914 new Enumerations.FHIRVersionEnumFactory())); 3915 if (json.has("_fhirVersion")) 3916 parseElementProperties(getJObject(json, "_fhirVersion"), res.getFhirVersionElement()); 3917 if (json.has("format")) { 3918 JsonArray array = json.getAsJsonArray("format"); 3919 for (int i = 0; i < array.size(); i++) { 3920 if (array.get(i).isJsonNull()) { 3921 res.getFormat().add(new CodeType()); 3922 } else { 3923 res.getFormat().add(parseCode(array.get(i).getAsString())); 3924 } 3925 } 3926 } 3927 ; 3928 if (json.has("_format")) { 3929 JsonArray array = json.getAsJsonArray("_format"); 3930 for (int i = 0; i < array.size(); i++) { 3931 if (i == res.getFormat().size()) 3932 res.getFormat().add(parseCode(null)); 3933 if (array.get(i) instanceof JsonObject) 3934 parseElementProperties(array.get(i).getAsJsonObject(), res.getFormat().get(i)); 3935 } 3936 } 3937 ; 3938 if (json.has("patchFormat")) { 3939 JsonArray array = json.getAsJsonArray("patchFormat"); 3940 for (int i = 0; i < array.size(); i++) { 3941 if (array.get(i).isJsonNull()) { 3942 res.getPatchFormat().add(new CodeType()); 3943 } else { 3944 res.getPatchFormat().add(parseCode(array.get(i).getAsString())); 3945 } 3946 } 3947 } 3948 ; 3949 if (json.has("_patchFormat")) { 3950 JsonArray array = json.getAsJsonArray("_patchFormat"); 3951 for (int i = 0; i < array.size(); i++) { 3952 if (i == res.getPatchFormat().size()) 3953 res.getPatchFormat().add(parseCode(null)); 3954 if (array.get(i) instanceof JsonObject) 3955 parseElementProperties(array.get(i).getAsJsonObject(), res.getPatchFormat().get(i)); 3956 } 3957 } 3958 ; 3959 if (json.has("implementationGuide")) { 3960 JsonArray array = json.getAsJsonArray("implementationGuide"); 3961 for (int i = 0; i < array.size(); i++) { 3962 if (array.get(i).isJsonNull()) { 3963 res.getImplementationGuide().add(new CanonicalType()); 3964 } else { 3965 res.getImplementationGuide().add(parseCanonical(array.get(i).getAsString())); 3966 } 3967 } 3968 } 3969 ; 3970 if (json.has("_implementationGuide")) { 3971 JsonArray array = json.getAsJsonArray("_implementationGuide"); 3972 for (int i = 0; i < array.size(); i++) { 3973 if (i == res.getImplementationGuide().size()) 3974 res.getImplementationGuide().add(parseCanonical(null)); 3975 if (array.get(i) instanceof JsonObject) 3976 parseElementProperties(array.get(i).getAsJsonObject(), res.getImplementationGuide().get(i)); 3977 } 3978 } 3979 ; 3980 if (json.has("rest")) { 3981 JsonArray array = json.getAsJsonArray("rest"); 3982 for (int i = 0; i < array.size(); i++) { 3983 res.getRest() 3984 .add(parseCapabilityStatementCapabilityStatementRestComponent(array.get(i).getAsJsonObject(), res)); 3985 } 3986 } 3987 ; 3988 if (json.has("messaging")) { 3989 JsonArray array = json.getAsJsonArray("messaging"); 3990 for (int i = 0; i < array.size(); i++) { 3991 res.getMessaging() 3992 .add(parseCapabilityStatementCapabilityStatementMessagingComponent(array.get(i).getAsJsonObject(), res)); 3993 } 3994 } 3995 ; 3996 if (json.has("document")) { 3997 JsonArray array = json.getAsJsonArray("document"); 3998 for (int i = 0; i < array.size(); i++) { 3999 res.getDocument() 4000 .add(parseCapabilityStatementCapabilityStatementDocumentComponent(array.get(i).getAsJsonObject(), res)); 4001 } 4002 } 4003 ; 4004 } 4005 4006 protected CapabilityStatement.CapabilityStatementSoftwareComponent parseCapabilityStatementCapabilityStatementSoftwareComponent( 4007 JsonObject json, CapabilityStatement owner) throws IOException, FHIRFormatError { 4008 CapabilityStatement.CapabilityStatementSoftwareComponent res = new CapabilityStatement.CapabilityStatementSoftwareComponent(); 4009 parseCapabilityStatementCapabilityStatementSoftwareComponentProperties(json, owner, res); 4010 return res; 4011 } 4012 4013 protected void parseCapabilityStatementCapabilityStatementSoftwareComponentProperties(JsonObject json, 4014 CapabilityStatement owner, CapabilityStatement.CapabilityStatementSoftwareComponent res) 4015 throws IOException, FHIRFormatError { 4016 parseBackboneElementProperties(json, res); 4017 if (json.has("name")) 4018 res.setNameElement(parseString(json.get("name").getAsString())); 4019 if (json.has("_name")) 4020 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 4021 if (json.has("version")) 4022 res.setVersionElement(parseString(json.get("version").getAsString())); 4023 if (json.has("_version")) 4024 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 4025 if (json.has("releaseDate")) 4026 res.setReleaseDateElement(parseDateTime(json.get("releaseDate").getAsString())); 4027 if (json.has("_releaseDate")) 4028 parseElementProperties(getJObject(json, "_releaseDate"), res.getReleaseDateElement()); 4029 } 4030 4031 protected CapabilityStatement.CapabilityStatementImplementationComponent parseCapabilityStatementCapabilityStatementImplementationComponent( 4032 JsonObject json, CapabilityStatement owner) throws IOException, FHIRFormatError { 4033 CapabilityStatement.CapabilityStatementImplementationComponent res = new CapabilityStatement.CapabilityStatementImplementationComponent(); 4034 parseCapabilityStatementCapabilityStatementImplementationComponentProperties(json, owner, res); 4035 return res; 4036 } 4037 4038 protected void parseCapabilityStatementCapabilityStatementImplementationComponentProperties(JsonObject json, 4039 CapabilityStatement owner, CapabilityStatement.CapabilityStatementImplementationComponent res) 4040 throws IOException, FHIRFormatError { 4041 parseBackboneElementProperties(json, res); 4042 if (json.has("description")) 4043 res.setDescriptionElement(parseString(json.get("description").getAsString())); 4044 if (json.has("_description")) 4045 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 4046 if (json.has("url")) 4047 res.setUrlElement(parseUrl(json.get("url").getAsString())); 4048 if (json.has("_url")) 4049 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 4050 if (json.has("custodian")) 4051 res.setCustodian(parseReference(getJObject(json, "custodian"))); 4052 } 4053 4054 protected CapabilityStatement.CapabilityStatementRestComponent parseCapabilityStatementCapabilityStatementRestComponent( 4055 JsonObject json, CapabilityStatement owner) throws IOException, FHIRFormatError { 4056 CapabilityStatement.CapabilityStatementRestComponent res = new CapabilityStatement.CapabilityStatementRestComponent(); 4057 parseCapabilityStatementCapabilityStatementRestComponentProperties(json, owner, res); 4058 return res; 4059 } 4060 4061 protected void parseCapabilityStatementCapabilityStatementRestComponentProperties(JsonObject json, 4062 CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestComponent res) 4063 throws IOException, FHIRFormatError { 4064 parseBackboneElementProperties(json, res); 4065 if (json.has("mode")) 4066 res.setModeElement(parseEnumeration(json.get("mode").getAsString(), 4067 CapabilityStatement.RestfulCapabilityMode.NULL, new CapabilityStatement.RestfulCapabilityModeEnumFactory())); 4068 if (json.has("_mode")) 4069 parseElementProperties(getJObject(json, "_mode"), res.getModeElement()); 4070 if (json.has("documentation")) 4071 res.setDocumentationElement(parseMarkdown(json.get("documentation").getAsString())); 4072 if (json.has("_documentation")) 4073 parseElementProperties(getJObject(json, "_documentation"), res.getDocumentationElement()); 4074 if (json.has("security")) 4075 res.setSecurity( 4076 parseCapabilityStatementCapabilityStatementRestSecurityComponent(getJObject(json, "security"), owner)); 4077 if (json.has("resource")) { 4078 JsonArray array = json.getAsJsonArray("resource"); 4079 for (int i = 0; i < array.size(); i++) { 4080 res.getResource().add( 4081 parseCapabilityStatementCapabilityStatementRestResourceComponent(array.get(i).getAsJsonObject(), owner)); 4082 } 4083 } 4084 ; 4085 if (json.has("interaction")) { 4086 JsonArray array = json.getAsJsonArray("interaction"); 4087 for (int i = 0; i < array.size(); i++) { 4088 res.getInteraction() 4089 .add(parseCapabilityStatementSystemInteractionComponent(array.get(i).getAsJsonObject(), owner)); 4090 } 4091 } 4092 ; 4093 if (json.has("searchParam")) { 4094 JsonArray array = json.getAsJsonArray("searchParam"); 4095 for (int i = 0; i < array.size(); i++) { 4096 res.getSearchParam().add(parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponent( 4097 array.get(i).getAsJsonObject(), owner)); 4098 } 4099 } 4100 ; 4101 if (json.has("operation")) { 4102 JsonArray array = json.getAsJsonArray("operation"); 4103 for (int i = 0; i < array.size(); i++) { 4104 res.getOperation().add(parseCapabilityStatementCapabilityStatementRestResourceOperationComponent( 4105 array.get(i).getAsJsonObject(), owner)); 4106 } 4107 } 4108 ; 4109 if (json.has("compartment")) { 4110 JsonArray array = json.getAsJsonArray("compartment"); 4111 for (int i = 0; i < array.size(); i++) { 4112 if (array.get(i).isJsonNull()) { 4113 res.getCompartment().add(new CanonicalType()); 4114 } else { 4115 res.getCompartment().add(parseCanonical(array.get(i).getAsString())); 4116 } 4117 } 4118 } 4119 ; 4120 if (json.has("_compartment")) { 4121 JsonArray array = json.getAsJsonArray("_compartment"); 4122 for (int i = 0; i < array.size(); i++) { 4123 if (i == res.getCompartment().size()) 4124 res.getCompartment().add(parseCanonical(null)); 4125 if (array.get(i) instanceof JsonObject) 4126 parseElementProperties(array.get(i).getAsJsonObject(), res.getCompartment().get(i)); 4127 } 4128 } 4129 ; 4130 } 4131 4132 protected CapabilityStatement.CapabilityStatementRestSecurityComponent parseCapabilityStatementCapabilityStatementRestSecurityComponent( 4133 JsonObject json, CapabilityStatement owner) throws IOException, FHIRFormatError { 4134 CapabilityStatement.CapabilityStatementRestSecurityComponent res = new CapabilityStatement.CapabilityStatementRestSecurityComponent(); 4135 parseCapabilityStatementCapabilityStatementRestSecurityComponentProperties(json, owner, res); 4136 return res; 4137 } 4138 4139 protected void parseCapabilityStatementCapabilityStatementRestSecurityComponentProperties(JsonObject json, 4140 CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestSecurityComponent res) 4141 throws IOException, FHIRFormatError { 4142 parseBackboneElementProperties(json, res); 4143 if (json.has("cors")) 4144 res.setCorsElement(parseBoolean(json.get("cors").getAsBoolean())); 4145 if (json.has("_cors")) 4146 parseElementProperties(getJObject(json, "_cors"), res.getCorsElement()); 4147 if (json.has("service")) { 4148 JsonArray array = json.getAsJsonArray("service"); 4149 for (int i = 0; i < array.size(); i++) { 4150 res.getService().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 4151 } 4152 } 4153 ; 4154 if (json.has("description")) 4155 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 4156 if (json.has("_description")) 4157 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 4158 } 4159 4160 protected CapabilityStatement.CapabilityStatementRestResourceComponent parseCapabilityStatementCapabilityStatementRestResourceComponent( 4161 JsonObject json, CapabilityStatement owner) throws IOException, FHIRFormatError { 4162 CapabilityStatement.CapabilityStatementRestResourceComponent res = new CapabilityStatement.CapabilityStatementRestResourceComponent(); 4163 parseCapabilityStatementCapabilityStatementRestResourceComponentProperties(json, owner, res); 4164 return res; 4165 } 4166 4167 protected void parseCapabilityStatementCapabilityStatementRestResourceComponentProperties(JsonObject json, 4168 CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestResourceComponent res) 4169 throws IOException, FHIRFormatError { 4170 parseBackboneElementProperties(json, res); 4171 if (json.has("type")) 4172 res.setTypeElement(parseCode(json.get("type").getAsString())); 4173 if (json.has("_type")) 4174 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 4175 if (json.has("profile")) 4176 res.setProfileElement(parseCanonical(json.get("profile").getAsString())); 4177 if (json.has("_profile")) 4178 parseElementProperties(getJObject(json, "_profile"), res.getProfileElement()); 4179 if (json.has("supportedProfile")) { 4180 JsonArray array = json.getAsJsonArray("supportedProfile"); 4181 for (int i = 0; i < array.size(); i++) { 4182 if (array.get(i).isJsonNull()) { 4183 res.getSupportedProfile().add(new CanonicalType()); 4184 } else { 4185 res.getSupportedProfile().add(parseCanonical(array.get(i).getAsString())); 4186 } 4187 } 4188 } 4189 ; 4190 if (json.has("_supportedProfile")) { 4191 JsonArray array = json.getAsJsonArray("_supportedProfile"); 4192 for (int i = 0; i < array.size(); i++) { 4193 if (i == res.getSupportedProfile().size()) 4194 res.getSupportedProfile().add(parseCanonical(null)); 4195 if (array.get(i) instanceof JsonObject) 4196 parseElementProperties(array.get(i).getAsJsonObject(), res.getSupportedProfile().get(i)); 4197 } 4198 } 4199 ; 4200 if (json.has("documentation")) 4201 res.setDocumentationElement(parseMarkdown(json.get("documentation").getAsString())); 4202 if (json.has("_documentation")) 4203 parseElementProperties(getJObject(json, "_documentation"), res.getDocumentationElement()); 4204 if (json.has("interaction")) { 4205 JsonArray array = json.getAsJsonArray("interaction"); 4206 for (int i = 0; i < array.size(); i++) { 4207 res.getInteraction() 4208 .add(parseCapabilityStatementResourceInteractionComponent(array.get(i).getAsJsonObject(), owner)); 4209 } 4210 } 4211 ; 4212 if (json.has("versioning")) 4213 res.setVersioningElement(parseEnumeration(json.get("versioning").getAsString(), 4214 CapabilityStatement.ResourceVersionPolicy.NULL, new CapabilityStatement.ResourceVersionPolicyEnumFactory())); 4215 if (json.has("_versioning")) 4216 parseElementProperties(getJObject(json, "_versioning"), res.getVersioningElement()); 4217 if (json.has("readHistory")) 4218 res.setReadHistoryElement(parseBoolean(json.get("readHistory").getAsBoolean())); 4219 if (json.has("_readHistory")) 4220 parseElementProperties(getJObject(json, "_readHistory"), res.getReadHistoryElement()); 4221 if (json.has("updateCreate")) 4222 res.setUpdateCreateElement(parseBoolean(json.get("updateCreate").getAsBoolean())); 4223 if (json.has("_updateCreate")) 4224 parseElementProperties(getJObject(json, "_updateCreate"), res.getUpdateCreateElement()); 4225 if (json.has("conditionalCreate")) 4226 res.setConditionalCreateElement(parseBoolean(json.get("conditionalCreate").getAsBoolean())); 4227 if (json.has("_conditionalCreate")) 4228 parseElementProperties(getJObject(json, "_conditionalCreate"), res.getConditionalCreateElement()); 4229 if (json.has("conditionalRead")) 4230 res.setConditionalReadElement(parseEnumeration(json.get("conditionalRead").getAsString(), 4231 CapabilityStatement.ConditionalReadStatus.NULL, new CapabilityStatement.ConditionalReadStatusEnumFactory())); 4232 if (json.has("_conditionalRead")) 4233 parseElementProperties(getJObject(json, "_conditionalRead"), res.getConditionalReadElement()); 4234 if (json.has("conditionalUpdate")) 4235 res.setConditionalUpdateElement(parseBoolean(json.get("conditionalUpdate").getAsBoolean())); 4236 if (json.has("_conditionalUpdate")) 4237 parseElementProperties(getJObject(json, "_conditionalUpdate"), res.getConditionalUpdateElement()); 4238 if (json.has("conditionalDelete")) 4239 res.setConditionalDeleteElement(parseEnumeration(json.get("conditionalDelete").getAsString(), 4240 CapabilityStatement.ConditionalDeleteStatus.NULL, 4241 new CapabilityStatement.ConditionalDeleteStatusEnumFactory())); 4242 if (json.has("_conditionalDelete")) 4243 parseElementProperties(getJObject(json, "_conditionalDelete"), res.getConditionalDeleteElement()); 4244 if (json.has("referencePolicy")) { 4245 JsonArray array = json.getAsJsonArray("referencePolicy"); 4246 for (int i = 0; i < array.size(); i++) { 4247 if (array.get(i).isJsonNull()) { 4248 res.getReferencePolicy().add(new Enumeration<CapabilityStatement.ReferenceHandlingPolicy>()); 4249 } else { 4250 res.getReferencePolicy() 4251 .add(parseEnumeration(array.get(i).getAsString(), CapabilityStatement.ReferenceHandlingPolicy.NULL, 4252 new CapabilityStatement.ReferenceHandlingPolicyEnumFactory())); 4253 } 4254 } 4255 } 4256 ; 4257 if (json.has("_referencePolicy")) { 4258 JsonArray array = json.getAsJsonArray("_referencePolicy"); 4259 for (int i = 0; i < array.size(); i++) { 4260 if (i == res.getReferencePolicy().size()) 4261 res.getReferencePolicy().add(parseEnumeration(null, CapabilityStatement.ReferenceHandlingPolicy.NULL, 4262 new CapabilityStatement.ReferenceHandlingPolicyEnumFactory())); 4263 if (array.get(i) instanceof JsonObject) 4264 parseElementProperties(array.get(i).getAsJsonObject(), res.getReferencePolicy().get(i)); 4265 } 4266 } 4267 ; 4268 if (json.has("searchInclude")) { 4269 JsonArray array = json.getAsJsonArray("searchInclude"); 4270 for (int i = 0; i < array.size(); i++) { 4271 if (array.get(i).isJsonNull()) { 4272 res.getSearchInclude().add(new StringType()); 4273 } else { 4274 res.getSearchInclude().add(parseString(array.get(i).getAsString())); 4275 } 4276 } 4277 } 4278 ; 4279 if (json.has("_searchInclude")) { 4280 JsonArray array = json.getAsJsonArray("_searchInclude"); 4281 for (int i = 0; i < array.size(); i++) { 4282 if (i == res.getSearchInclude().size()) 4283 res.getSearchInclude().add(parseString(null)); 4284 if (array.get(i) instanceof JsonObject) 4285 parseElementProperties(array.get(i).getAsJsonObject(), res.getSearchInclude().get(i)); 4286 } 4287 } 4288 ; 4289 if (json.has("searchRevInclude")) { 4290 JsonArray array = json.getAsJsonArray("searchRevInclude"); 4291 for (int i = 0; i < array.size(); i++) { 4292 if (array.get(i).isJsonNull()) { 4293 res.getSearchRevInclude().add(new StringType()); 4294 } else { 4295 res.getSearchRevInclude().add(parseString(array.get(i).getAsString())); 4296 } 4297 } 4298 } 4299 ; 4300 if (json.has("_searchRevInclude")) { 4301 JsonArray array = json.getAsJsonArray("_searchRevInclude"); 4302 for (int i = 0; i < array.size(); i++) { 4303 if (i == res.getSearchRevInclude().size()) 4304 res.getSearchRevInclude().add(parseString(null)); 4305 if (array.get(i) instanceof JsonObject) 4306 parseElementProperties(array.get(i).getAsJsonObject(), res.getSearchRevInclude().get(i)); 4307 } 4308 } 4309 ; 4310 if (json.has("searchParam")) { 4311 JsonArray array = json.getAsJsonArray("searchParam"); 4312 for (int i = 0; i < array.size(); i++) { 4313 res.getSearchParam().add(parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponent( 4314 array.get(i).getAsJsonObject(), owner)); 4315 } 4316 } 4317 ; 4318 if (json.has("operation")) { 4319 JsonArray array = json.getAsJsonArray("operation"); 4320 for (int i = 0; i < array.size(); i++) { 4321 res.getOperation().add(parseCapabilityStatementCapabilityStatementRestResourceOperationComponent( 4322 array.get(i).getAsJsonObject(), owner)); 4323 } 4324 } 4325 ; 4326 } 4327 4328 protected CapabilityStatement.ResourceInteractionComponent parseCapabilityStatementResourceInteractionComponent( 4329 JsonObject json, CapabilityStatement owner) throws IOException, FHIRFormatError { 4330 CapabilityStatement.ResourceInteractionComponent res = new CapabilityStatement.ResourceInteractionComponent(); 4331 parseCapabilityStatementResourceInteractionComponentProperties(json, owner, res); 4332 return res; 4333 } 4334 4335 protected void parseCapabilityStatementResourceInteractionComponentProperties(JsonObject json, 4336 CapabilityStatement owner, CapabilityStatement.ResourceInteractionComponent res) 4337 throws IOException, FHIRFormatError { 4338 parseBackboneElementProperties(json, res); 4339 if (json.has("code")) 4340 res.setCodeElement( 4341 parseEnumeration(json.get("code").getAsString(), CapabilityStatement.TypeRestfulInteraction.NULL, 4342 new CapabilityStatement.TypeRestfulInteractionEnumFactory())); 4343 if (json.has("_code")) 4344 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 4345 if (json.has("documentation")) 4346 res.setDocumentationElement(parseMarkdown(json.get("documentation").getAsString())); 4347 if (json.has("_documentation")) 4348 parseElementProperties(getJObject(json, "_documentation"), res.getDocumentationElement()); 4349 } 4350 4351 protected CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponent( 4352 JsonObject json, CapabilityStatement owner) throws IOException, FHIRFormatError { 4353 CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent res = new CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent(); 4354 parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponentProperties(json, owner, res); 4355 return res; 4356 } 4357 4358 protected void parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponentProperties(JsonObject json, 4359 CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent res) 4360 throws IOException, FHIRFormatError { 4361 parseBackboneElementProperties(json, res); 4362 if (json.has("name")) 4363 res.setNameElement(parseString(json.get("name").getAsString())); 4364 if (json.has("_name")) 4365 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 4366 if (json.has("definition")) 4367 res.setDefinitionElement(parseCanonical(json.get("definition").getAsString())); 4368 if (json.has("_definition")) 4369 parseElementProperties(getJObject(json, "_definition"), res.getDefinitionElement()); 4370 if (json.has("type")) 4371 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), Enumerations.SearchParamType.NULL, 4372 new Enumerations.SearchParamTypeEnumFactory())); 4373 if (json.has("_type")) 4374 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 4375 if (json.has("documentation")) 4376 res.setDocumentationElement(parseMarkdown(json.get("documentation").getAsString())); 4377 if (json.has("_documentation")) 4378 parseElementProperties(getJObject(json, "_documentation"), res.getDocumentationElement()); 4379 } 4380 4381 protected CapabilityStatement.CapabilityStatementRestResourceOperationComponent parseCapabilityStatementCapabilityStatementRestResourceOperationComponent( 4382 JsonObject json, CapabilityStatement owner) throws IOException, FHIRFormatError { 4383 CapabilityStatement.CapabilityStatementRestResourceOperationComponent res = new CapabilityStatement.CapabilityStatementRestResourceOperationComponent(); 4384 parseCapabilityStatementCapabilityStatementRestResourceOperationComponentProperties(json, owner, res); 4385 return res; 4386 } 4387 4388 protected void parseCapabilityStatementCapabilityStatementRestResourceOperationComponentProperties(JsonObject json, 4389 CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestResourceOperationComponent res) 4390 throws IOException, FHIRFormatError { 4391 parseBackboneElementProperties(json, res); 4392 if (json.has("name")) 4393 res.setNameElement(parseString(json.get("name").getAsString())); 4394 if (json.has("_name")) 4395 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 4396 if (json.has("definition")) 4397 res.setDefinitionElement(parseCanonical(json.get("definition").getAsString())); 4398 if (json.has("_definition")) 4399 parseElementProperties(getJObject(json, "_definition"), res.getDefinitionElement()); 4400 if (json.has("documentation")) 4401 res.setDocumentationElement(parseMarkdown(json.get("documentation").getAsString())); 4402 if (json.has("_documentation")) 4403 parseElementProperties(getJObject(json, "_documentation"), res.getDocumentationElement()); 4404 } 4405 4406 protected CapabilityStatement.SystemInteractionComponent parseCapabilityStatementSystemInteractionComponent( 4407 JsonObject json, CapabilityStatement owner) throws IOException, FHIRFormatError { 4408 CapabilityStatement.SystemInteractionComponent res = new CapabilityStatement.SystemInteractionComponent(); 4409 parseCapabilityStatementSystemInteractionComponentProperties(json, owner, res); 4410 return res; 4411 } 4412 4413 protected void parseCapabilityStatementSystemInteractionComponentProperties(JsonObject json, 4414 CapabilityStatement owner, CapabilityStatement.SystemInteractionComponent res) 4415 throws IOException, FHIRFormatError { 4416 parseBackboneElementProperties(json, res); 4417 if (json.has("code")) 4418 res.setCodeElement( 4419 parseEnumeration(json.get("code").getAsString(), CapabilityStatement.SystemRestfulInteraction.NULL, 4420 new CapabilityStatement.SystemRestfulInteractionEnumFactory())); 4421 if (json.has("_code")) 4422 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 4423 if (json.has("documentation")) 4424 res.setDocumentationElement(parseMarkdown(json.get("documentation").getAsString())); 4425 if (json.has("_documentation")) 4426 parseElementProperties(getJObject(json, "_documentation"), res.getDocumentationElement()); 4427 } 4428 4429 protected CapabilityStatement.CapabilityStatementMessagingComponent parseCapabilityStatementCapabilityStatementMessagingComponent( 4430 JsonObject json, CapabilityStatement owner) throws IOException, FHIRFormatError { 4431 CapabilityStatement.CapabilityStatementMessagingComponent res = new CapabilityStatement.CapabilityStatementMessagingComponent(); 4432 parseCapabilityStatementCapabilityStatementMessagingComponentProperties(json, owner, res); 4433 return res; 4434 } 4435 4436 protected void parseCapabilityStatementCapabilityStatementMessagingComponentProperties(JsonObject json, 4437 CapabilityStatement owner, CapabilityStatement.CapabilityStatementMessagingComponent res) 4438 throws IOException, FHIRFormatError { 4439 parseBackboneElementProperties(json, res); 4440 if (json.has("endpoint")) { 4441 JsonArray array = json.getAsJsonArray("endpoint"); 4442 for (int i = 0; i < array.size(); i++) { 4443 res.getEndpoint().add(parseCapabilityStatementCapabilityStatementMessagingEndpointComponent( 4444 array.get(i).getAsJsonObject(), owner)); 4445 } 4446 } 4447 ; 4448 if (json.has("reliableCache")) 4449 res.setReliableCacheElement(parseUnsignedInt(json.get("reliableCache").getAsString())); 4450 if (json.has("_reliableCache")) 4451 parseElementProperties(getJObject(json, "_reliableCache"), res.getReliableCacheElement()); 4452 if (json.has("documentation")) 4453 res.setDocumentationElement(parseMarkdown(json.get("documentation").getAsString())); 4454 if (json.has("_documentation")) 4455 parseElementProperties(getJObject(json, "_documentation"), res.getDocumentationElement()); 4456 if (json.has("supportedMessage")) { 4457 JsonArray array = json.getAsJsonArray("supportedMessage"); 4458 for (int i = 0; i < array.size(); i++) { 4459 res.getSupportedMessage().add(parseCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent( 4460 array.get(i).getAsJsonObject(), owner)); 4461 } 4462 } 4463 ; 4464 } 4465 4466 protected CapabilityStatement.CapabilityStatementMessagingEndpointComponent parseCapabilityStatementCapabilityStatementMessagingEndpointComponent( 4467 JsonObject json, CapabilityStatement owner) throws IOException, FHIRFormatError { 4468 CapabilityStatement.CapabilityStatementMessagingEndpointComponent res = new CapabilityStatement.CapabilityStatementMessagingEndpointComponent(); 4469 parseCapabilityStatementCapabilityStatementMessagingEndpointComponentProperties(json, owner, res); 4470 return res; 4471 } 4472 4473 protected void parseCapabilityStatementCapabilityStatementMessagingEndpointComponentProperties(JsonObject json, 4474 CapabilityStatement owner, CapabilityStatement.CapabilityStatementMessagingEndpointComponent res) 4475 throws IOException, FHIRFormatError { 4476 parseBackboneElementProperties(json, res); 4477 if (json.has("protocol")) 4478 res.setProtocol(parseCoding(getJObject(json, "protocol"))); 4479 if (json.has("address")) 4480 res.setAddressElement(parseUrl(json.get("address").getAsString())); 4481 if (json.has("_address")) 4482 parseElementProperties(getJObject(json, "_address"), res.getAddressElement()); 4483 } 4484 4485 protected CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent parseCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent( 4486 JsonObject json, CapabilityStatement owner) throws IOException, FHIRFormatError { 4487 CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent res = new CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent(); 4488 parseCapabilityStatementCapabilityStatementMessagingSupportedMessageComponentProperties(json, owner, res); 4489 return res; 4490 } 4491 4492 protected void parseCapabilityStatementCapabilityStatementMessagingSupportedMessageComponentProperties( 4493 JsonObject json, CapabilityStatement owner, 4494 CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent res) 4495 throws IOException, FHIRFormatError { 4496 parseBackboneElementProperties(json, res); 4497 if (json.has("mode")) 4498 res.setModeElement(parseEnumeration(json.get("mode").getAsString(), CapabilityStatement.EventCapabilityMode.NULL, 4499 new CapabilityStatement.EventCapabilityModeEnumFactory())); 4500 if (json.has("_mode")) 4501 parseElementProperties(getJObject(json, "_mode"), res.getModeElement()); 4502 if (json.has("definition")) 4503 res.setDefinitionElement(parseCanonical(json.get("definition").getAsString())); 4504 if (json.has("_definition")) 4505 parseElementProperties(getJObject(json, "_definition"), res.getDefinitionElement()); 4506 } 4507 4508 protected CapabilityStatement.CapabilityStatementDocumentComponent parseCapabilityStatementCapabilityStatementDocumentComponent( 4509 JsonObject json, CapabilityStatement owner) throws IOException, FHIRFormatError { 4510 CapabilityStatement.CapabilityStatementDocumentComponent res = new CapabilityStatement.CapabilityStatementDocumentComponent(); 4511 parseCapabilityStatementCapabilityStatementDocumentComponentProperties(json, owner, res); 4512 return res; 4513 } 4514 4515 protected void parseCapabilityStatementCapabilityStatementDocumentComponentProperties(JsonObject json, 4516 CapabilityStatement owner, CapabilityStatement.CapabilityStatementDocumentComponent res) 4517 throws IOException, FHIRFormatError { 4518 parseBackboneElementProperties(json, res); 4519 if (json.has("mode")) 4520 res.setModeElement(parseEnumeration(json.get("mode").getAsString(), CapabilityStatement.DocumentMode.NULL, 4521 new CapabilityStatement.DocumentModeEnumFactory())); 4522 if (json.has("_mode")) 4523 parseElementProperties(getJObject(json, "_mode"), res.getModeElement()); 4524 if (json.has("documentation")) 4525 res.setDocumentationElement(parseMarkdown(json.get("documentation").getAsString())); 4526 if (json.has("_documentation")) 4527 parseElementProperties(getJObject(json, "_documentation"), res.getDocumentationElement()); 4528 if (json.has("profile")) 4529 res.setProfileElement(parseCanonical(json.get("profile").getAsString())); 4530 if (json.has("_profile")) 4531 parseElementProperties(getJObject(json, "_profile"), res.getProfileElement()); 4532 } 4533 4534 protected CarePlan parseCarePlan(JsonObject json) throws IOException, FHIRFormatError { 4535 CarePlan res = new CarePlan(); 4536 parseCarePlanProperties(json, res); 4537 return res; 4538 } 4539 4540 protected void parseCarePlanProperties(JsonObject json, CarePlan res) throws IOException, FHIRFormatError { 4541 parseDomainResourceProperties(json, res); 4542 if (json.has("identifier")) { 4543 JsonArray array = json.getAsJsonArray("identifier"); 4544 for (int i = 0; i < array.size(); i++) { 4545 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 4546 } 4547 } 4548 ; 4549 if (json.has("instantiatesCanonical")) { 4550 JsonArray array = json.getAsJsonArray("instantiatesCanonical"); 4551 for (int i = 0; i < array.size(); i++) { 4552 if (array.get(i).isJsonNull()) { 4553 res.getInstantiatesCanonical().add(new CanonicalType()); 4554 } else { 4555 res.getInstantiatesCanonical().add(parseCanonical(array.get(i).getAsString())); 4556 } 4557 } 4558 } 4559 ; 4560 if (json.has("_instantiatesCanonical")) { 4561 JsonArray array = json.getAsJsonArray("_instantiatesCanonical"); 4562 for (int i = 0; i < array.size(); i++) { 4563 if (i == res.getInstantiatesCanonical().size()) 4564 res.getInstantiatesCanonical().add(parseCanonical(null)); 4565 if (array.get(i) instanceof JsonObject) 4566 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesCanonical().get(i)); 4567 } 4568 } 4569 ; 4570 if (json.has("instantiatesUri")) { 4571 JsonArray array = json.getAsJsonArray("instantiatesUri"); 4572 for (int i = 0; i < array.size(); i++) { 4573 if (array.get(i).isJsonNull()) { 4574 res.getInstantiatesUri().add(new UriType()); 4575 } else { 4576 res.getInstantiatesUri().add(parseUri(array.get(i).getAsString())); 4577 } 4578 } 4579 } 4580 ; 4581 if (json.has("_instantiatesUri")) { 4582 JsonArray array = json.getAsJsonArray("_instantiatesUri"); 4583 for (int i = 0; i < array.size(); i++) { 4584 if (i == res.getInstantiatesUri().size()) 4585 res.getInstantiatesUri().add(parseUri(null)); 4586 if (array.get(i) instanceof JsonObject) 4587 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesUri().get(i)); 4588 } 4589 } 4590 ; 4591 if (json.has("basedOn")) { 4592 JsonArray array = json.getAsJsonArray("basedOn"); 4593 for (int i = 0; i < array.size(); i++) { 4594 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 4595 } 4596 } 4597 ; 4598 if (json.has("replaces")) { 4599 JsonArray array = json.getAsJsonArray("replaces"); 4600 for (int i = 0; i < array.size(); i++) { 4601 res.getReplaces().add(parseReference(array.get(i).getAsJsonObject())); 4602 } 4603 } 4604 ; 4605 if (json.has("partOf")) { 4606 JsonArray array = json.getAsJsonArray("partOf"); 4607 for (int i = 0; i < array.size(); i++) { 4608 res.getPartOf().add(parseReference(array.get(i).getAsJsonObject())); 4609 } 4610 } 4611 ; 4612 if (json.has("status")) 4613 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), CarePlan.CarePlanStatus.NULL, 4614 new CarePlan.CarePlanStatusEnumFactory())); 4615 if (json.has("_status")) 4616 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 4617 if (json.has("intent")) 4618 res.setIntentElement(parseEnumeration(json.get("intent").getAsString(), CarePlan.CarePlanIntent.NULL, 4619 new CarePlan.CarePlanIntentEnumFactory())); 4620 if (json.has("_intent")) 4621 parseElementProperties(getJObject(json, "_intent"), res.getIntentElement()); 4622 if (json.has("category")) { 4623 JsonArray array = json.getAsJsonArray("category"); 4624 for (int i = 0; i < array.size(); i++) { 4625 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 4626 } 4627 } 4628 ; 4629 if (json.has("title")) 4630 res.setTitleElement(parseString(json.get("title").getAsString())); 4631 if (json.has("_title")) 4632 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 4633 if (json.has("description")) 4634 res.setDescriptionElement(parseString(json.get("description").getAsString())); 4635 if (json.has("_description")) 4636 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 4637 if (json.has("subject")) 4638 res.setSubject(parseReference(getJObject(json, "subject"))); 4639 if (json.has("encounter")) 4640 res.setEncounter(parseReference(getJObject(json, "encounter"))); 4641 if (json.has("period")) 4642 res.setPeriod(parsePeriod(getJObject(json, "period"))); 4643 if (json.has("created")) 4644 res.setCreatedElement(parseDateTime(json.get("created").getAsString())); 4645 if (json.has("_created")) 4646 parseElementProperties(getJObject(json, "_created"), res.getCreatedElement()); 4647 if (json.has("author")) 4648 res.setAuthor(parseReference(getJObject(json, "author"))); 4649 if (json.has("contributor")) { 4650 JsonArray array = json.getAsJsonArray("contributor"); 4651 for (int i = 0; i < array.size(); i++) { 4652 res.getContributor().add(parseReference(array.get(i).getAsJsonObject())); 4653 } 4654 } 4655 ; 4656 if (json.has("careTeam")) { 4657 JsonArray array = json.getAsJsonArray("careTeam"); 4658 for (int i = 0; i < array.size(); i++) { 4659 res.getCareTeam().add(parseReference(array.get(i).getAsJsonObject())); 4660 } 4661 } 4662 ; 4663 if (json.has("addresses")) { 4664 JsonArray array = json.getAsJsonArray("addresses"); 4665 for (int i = 0; i < array.size(); i++) { 4666 res.getAddresses().add(parseReference(array.get(i).getAsJsonObject())); 4667 } 4668 } 4669 ; 4670 if (json.has("supportingInfo")) { 4671 JsonArray array = json.getAsJsonArray("supportingInfo"); 4672 for (int i = 0; i < array.size(); i++) { 4673 res.getSupportingInfo().add(parseReference(array.get(i).getAsJsonObject())); 4674 } 4675 } 4676 ; 4677 if (json.has("goal")) { 4678 JsonArray array = json.getAsJsonArray("goal"); 4679 for (int i = 0; i < array.size(); i++) { 4680 res.getGoal().add(parseReference(array.get(i).getAsJsonObject())); 4681 } 4682 } 4683 ; 4684 if (json.has("activity")) { 4685 JsonArray array = json.getAsJsonArray("activity"); 4686 for (int i = 0; i < array.size(); i++) { 4687 res.getActivity().add(parseCarePlanCarePlanActivityComponent(array.get(i).getAsJsonObject(), res)); 4688 } 4689 } 4690 ; 4691 if (json.has("note")) { 4692 JsonArray array = json.getAsJsonArray("note"); 4693 for (int i = 0; i < array.size(); i++) { 4694 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 4695 } 4696 } 4697 ; 4698 } 4699 4700 protected CarePlan.CarePlanActivityComponent parseCarePlanCarePlanActivityComponent(JsonObject json, CarePlan owner) 4701 throws IOException, FHIRFormatError { 4702 CarePlan.CarePlanActivityComponent res = new CarePlan.CarePlanActivityComponent(); 4703 parseCarePlanCarePlanActivityComponentProperties(json, owner, res); 4704 return res; 4705 } 4706 4707 protected void parseCarePlanCarePlanActivityComponentProperties(JsonObject json, CarePlan owner, 4708 CarePlan.CarePlanActivityComponent res) throws IOException, FHIRFormatError { 4709 parseBackboneElementProperties(json, res); 4710 if (json.has("outcomeCodeableConcept")) { 4711 JsonArray array = json.getAsJsonArray("outcomeCodeableConcept"); 4712 for (int i = 0; i < array.size(); i++) { 4713 res.getOutcomeCodeableConcept().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 4714 } 4715 } 4716 ; 4717 if (json.has("outcomeReference")) { 4718 JsonArray array = json.getAsJsonArray("outcomeReference"); 4719 for (int i = 0; i < array.size(); i++) { 4720 res.getOutcomeReference().add(parseReference(array.get(i).getAsJsonObject())); 4721 } 4722 } 4723 ; 4724 if (json.has("progress")) { 4725 JsonArray array = json.getAsJsonArray("progress"); 4726 for (int i = 0; i < array.size(); i++) { 4727 res.getProgress().add(parseAnnotation(array.get(i).getAsJsonObject())); 4728 } 4729 } 4730 ; 4731 if (json.has("reference")) 4732 res.setReference(parseReference(getJObject(json, "reference"))); 4733 if (json.has("detail")) 4734 res.setDetail(parseCarePlanCarePlanActivityDetailComponent(getJObject(json, "detail"), owner)); 4735 } 4736 4737 protected CarePlan.CarePlanActivityDetailComponent parseCarePlanCarePlanActivityDetailComponent(JsonObject json, 4738 CarePlan owner) throws IOException, FHIRFormatError { 4739 CarePlan.CarePlanActivityDetailComponent res = new CarePlan.CarePlanActivityDetailComponent(); 4740 parseCarePlanCarePlanActivityDetailComponentProperties(json, owner, res); 4741 return res; 4742 } 4743 4744 protected void parseCarePlanCarePlanActivityDetailComponentProperties(JsonObject json, CarePlan owner, 4745 CarePlan.CarePlanActivityDetailComponent res) throws IOException, FHIRFormatError { 4746 parseBackboneElementProperties(json, res); 4747 if (json.has("kind")) 4748 res.setKindElement(parseEnumeration(json.get("kind").getAsString(), CarePlan.CarePlanActivityKind.NULL, 4749 new CarePlan.CarePlanActivityKindEnumFactory())); 4750 if (json.has("_kind")) 4751 parseElementProperties(getJObject(json, "_kind"), res.getKindElement()); 4752 if (json.has("instantiatesCanonical")) { 4753 JsonArray array = json.getAsJsonArray("instantiatesCanonical"); 4754 for (int i = 0; i < array.size(); i++) { 4755 if (array.get(i).isJsonNull()) { 4756 res.getInstantiatesCanonical().add(new CanonicalType()); 4757 } else { 4758 res.getInstantiatesCanonical().add(parseCanonical(array.get(i).getAsString())); 4759 } 4760 } 4761 } 4762 ; 4763 if (json.has("_instantiatesCanonical")) { 4764 JsonArray array = json.getAsJsonArray("_instantiatesCanonical"); 4765 for (int i = 0; i < array.size(); i++) { 4766 if (i == res.getInstantiatesCanonical().size()) 4767 res.getInstantiatesCanonical().add(parseCanonical(null)); 4768 if (array.get(i) instanceof JsonObject) 4769 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesCanonical().get(i)); 4770 } 4771 } 4772 ; 4773 if (json.has("instantiatesUri")) { 4774 JsonArray array = json.getAsJsonArray("instantiatesUri"); 4775 for (int i = 0; i < array.size(); i++) { 4776 if (array.get(i).isJsonNull()) { 4777 res.getInstantiatesUri().add(new UriType()); 4778 } else { 4779 res.getInstantiatesUri().add(parseUri(array.get(i).getAsString())); 4780 } 4781 } 4782 } 4783 ; 4784 if (json.has("_instantiatesUri")) { 4785 JsonArray array = json.getAsJsonArray("_instantiatesUri"); 4786 for (int i = 0; i < array.size(); i++) { 4787 if (i == res.getInstantiatesUri().size()) 4788 res.getInstantiatesUri().add(parseUri(null)); 4789 if (array.get(i) instanceof JsonObject) 4790 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesUri().get(i)); 4791 } 4792 } 4793 ; 4794 if (json.has("code")) 4795 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 4796 if (json.has("reasonCode")) { 4797 JsonArray array = json.getAsJsonArray("reasonCode"); 4798 for (int i = 0; i < array.size(); i++) { 4799 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 4800 } 4801 } 4802 ; 4803 if (json.has("reasonReference")) { 4804 JsonArray array = json.getAsJsonArray("reasonReference"); 4805 for (int i = 0; i < array.size(); i++) { 4806 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 4807 } 4808 } 4809 ; 4810 if (json.has("goal")) { 4811 JsonArray array = json.getAsJsonArray("goal"); 4812 for (int i = 0; i < array.size(); i++) { 4813 res.getGoal().add(parseReference(array.get(i).getAsJsonObject())); 4814 } 4815 } 4816 ; 4817 if (json.has("status")) 4818 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), CarePlan.CarePlanActivityStatus.NULL, 4819 new CarePlan.CarePlanActivityStatusEnumFactory())); 4820 if (json.has("_status")) 4821 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 4822 if (json.has("statusReason")) 4823 res.setStatusReason(parseCodeableConcept(getJObject(json, "statusReason"))); 4824 if (json.has("doNotPerform")) 4825 res.setDoNotPerformElement(parseBoolean(json.get("doNotPerform").getAsBoolean())); 4826 if (json.has("_doNotPerform")) 4827 parseElementProperties(getJObject(json, "_doNotPerform"), res.getDoNotPerformElement()); 4828 Type scheduled = parseType("scheduled", json); 4829 if (scheduled != null) 4830 res.setScheduled(scheduled); 4831 if (json.has("location")) 4832 res.setLocation(parseReference(getJObject(json, "location"))); 4833 if (json.has("performer")) { 4834 JsonArray array = json.getAsJsonArray("performer"); 4835 for (int i = 0; i < array.size(); i++) { 4836 res.getPerformer().add(parseReference(array.get(i).getAsJsonObject())); 4837 } 4838 } 4839 ; 4840 Type product = parseType("product", json); 4841 if (product != null) 4842 res.setProduct(product); 4843 if (json.has("dailyAmount")) 4844 res.setDailyAmount(parseQuantity(getJObject(json, "dailyAmount"))); 4845 if (json.has("quantity")) 4846 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 4847 if (json.has("description")) 4848 res.setDescriptionElement(parseString(json.get("description").getAsString())); 4849 if (json.has("_description")) 4850 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 4851 } 4852 4853 protected CareTeam parseCareTeam(JsonObject json) throws IOException, FHIRFormatError { 4854 CareTeam res = new CareTeam(); 4855 parseCareTeamProperties(json, res); 4856 return res; 4857 } 4858 4859 protected void parseCareTeamProperties(JsonObject json, CareTeam res) throws IOException, FHIRFormatError { 4860 parseDomainResourceProperties(json, res); 4861 if (json.has("identifier")) { 4862 JsonArray array = json.getAsJsonArray("identifier"); 4863 for (int i = 0; i < array.size(); i++) { 4864 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 4865 } 4866 } 4867 ; 4868 if (json.has("status")) 4869 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), CareTeam.CareTeamStatus.NULL, 4870 new CareTeam.CareTeamStatusEnumFactory())); 4871 if (json.has("_status")) 4872 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 4873 if (json.has("category")) { 4874 JsonArray array = json.getAsJsonArray("category"); 4875 for (int i = 0; i < array.size(); i++) { 4876 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 4877 } 4878 } 4879 ; 4880 if (json.has("name")) 4881 res.setNameElement(parseString(json.get("name").getAsString())); 4882 if (json.has("_name")) 4883 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 4884 if (json.has("subject")) 4885 res.setSubject(parseReference(getJObject(json, "subject"))); 4886 if (json.has("encounter")) 4887 res.setEncounter(parseReference(getJObject(json, "encounter"))); 4888 if (json.has("period")) 4889 res.setPeriod(parsePeriod(getJObject(json, "period"))); 4890 if (json.has("participant")) { 4891 JsonArray array = json.getAsJsonArray("participant"); 4892 for (int i = 0; i < array.size(); i++) { 4893 res.getParticipant().add(parseCareTeamCareTeamParticipantComponent(array.get(i).getAsJsonObject(), res)); 4894 } 4895 } 4896 ; 4897 if (json.has("reasonCode")) { 4898 JsonArray array = json.getAsJsonArray("reasonCode"); 4899 for (int i = 0; i < array.size(); i++) { 4900 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 4901 } 4902 } 4903 ; 4904 if (json.has("reasonReference")) { 4905 JsonArray array = json.getAsJsonArray("reasonReference"); 4906 for (int i = 0; i < array.size(); i++) { 4907 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 4908 } 4909 } 4910 ; 4911 if (json.has("managingOrganization")) { 4912 JsonArray array = json.getAsJsonArray("managingOrganization"); 4913 for (int i = 0; i < array.size(); i++) { 4914 res.getManagingOrganization().add(parseReference(array.get(i).getAsJsonObject())); 4915 } 4916 } 4917 ; 4918 if (json.has("telecom")) { 4919 JsonArray array = json.getAsJsonArray("telecom"); 4920 for (int i = 0; i < array.size(); i++) { 4921 res.getTelecom().add(parseContactPoint(array.get(i).getAsJsonObject())); 4922 } 4923 } 4924 ; 4925 if (json.has("note")) { 4926 JsonArray array = json.getAsJsonArray("note"); 4927 for (int i = 0; i < array.size(); i++) { 4928 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 4929 } 4930 } 4931 ; 4932 } 4933 4934 protected CareTeam.CareTeamParticipantComponent parseCareTeamCareTeamParticipantComponent(JsonObject json, 4935 CareTeam owner) throws IOException, FHIRFormatError { 4936 CareTeam.CareTeamParticipantComponent res = new CareTeam.CareTeamParticipantComponent(); 4937 parseCareTeamCareTeamParticipantComponentProperties(json, owner, res); 4938 return res; 4939 } 4940 4941 protected void parseCareTeamCareTeamParticipantComponentProperties(JsonObject json, CareTeam owner, 4942 CareTeam.CareTeamParticipantComponent res) throws IOException, FHIRFormatError { 4943 parseBackboneElementProperties(json, res); 4944 if (json.has("role")) { 4945 JsonArray array = json.getAsJsonArray("role"); 4946 for (int i = 0; i < array.size(); i++) { 4947 res.getRole().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 4948 } 4949 } 4950 ; 4951 if (json.has("member")) 4952 res.setMember(parseReference(getJObject(json, "member"))); 4953 if (json.has("onBehalfOf")) 4954 res.setOnBehalfOf(parseReference(getJObject(json, "onBehalfOf"))); 4955 if (json.has("period")) 4956 res.setPeriod(parsePeriod(getJObject(json, "period"))); 4957 } 4958 4959 protected CatalogEntry parseCatalogEntry(JsonObject json) throws IOException, FHIRFormatError { 4960 CatalogEntry res = new CatalogEntry(); 4961 parseCatalogEntryProperties(json, res); 4962 return res; 4963 } 4964 4965 protected void parseCatalogEntryProperties(JsonObject json, CatalogEntry res) throws IOException, FHIRFormatError { 4966 parseDomainResourceProperties(json, res); 4967 if (json.has("identifier")) { 4968 JsonArray array = json.getAsJsonArray("identifier"); 4969 for (int i = 0; i < array.size(); i++) { 4970 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 4971 } 4972 } 4973 ; 4974 if (json.has("type")) 4975 res.setType(parseCodeableConcept(getJObject(json, "type"))); 4976 if (json.has("orderable")) 4977 res.setOrderableElement(parseBoolean(json.get("orderable").getAsBoolean())); 4978 if (json.has("_orderable")) 4979 parseElementProperties(getJObject(json, "_orderable"), res.getOrderableElement()); 4980 if (json.has("referencedItem")) 4981 res.setReferencedItem(parseReference(getJObject(json, "referencedItem"))); 4982 if (json.has("additionalIdentifier")) { 4983 JsonArray array = json.getAsJsonArray("additionalIdentifier"); 4984 for (int i = 0; i < array.size(); i++) { 4985 res.getAdditionalIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 4986 } 4987 } 4988 ; 4989 if (json.has("classification")) { 4990 JsonArray array = json.getAsJsonArray("classification"); 4991 for (int i = 0; i < array.size(); i++) { 4992 res.getClassification().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 4993 } 4994 } 4995 ; 4996 if (json.has("status")) 4997 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 4998 new Enumerations.PublicationStatusEnumFactory())); 4999 if (json.has("_status")) 5000 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 5001 if (json.has("validityPeriod")) 5002 res.setValidityPeriod(parsePeriod(getJObject(json, "validityPeriod"))); 5003 if (json.has("validTo")) 5004 res.setValidToElement(parseDateTime(json.get("validTo").getAsString())); 5005 if (json.has("_validTo")) 5006 parseElementProperties(getJObject(json, "_validTo"), res.getValidToElement()); 5007 if (json.has("lastUpdated")) 5008 res.setLastUpdatedElement(parseDateTime(json.get("lastUpdated").getAsString())); 5009 if (json.has("_lastUpdated")) 5010 parseElementProperties(getJObject(json, "_lastUpdated"), res.getLastUpdatedElement()); 5011 if (json.has("additionalCharacteristic")) { 5012 JsonArray array = json.getAsJsonArray("additionalCharacteristic"); 5013 for (int i = 0; i < array.size(); i++) { 5014 res.getAdditionalCharacteristic().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 5015 } 5016 } 5017 ; 5018 if (json.has("additionalClassification")) { 5019 JsonArray array = json.getAsJsonArray("additionalClassification"); 5020 for (int i = 0; i < array.size(); i++) { 5021 res.getAdditionalClassification().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 5022 } 5023 } 5024 ; 5025 if (json.has("relatedEntry")) { 5026 JsonArray array = json.getAsJsonArray("relatedEntry"); 5027 for (int i = 0; i < array.size(); i++) { 5028 res.getRelatedEntry() 5029 .add(parseCatalogEntryCatalogEntryRelatedEntryComponent(array.get(i).getAsJsonObject(), res)); 5030 } 5031 } 5032 ; 5033 } 5034 5035 protected CatalogEntry.CatalogEntryRelatedEntryComponent parseCatalogEntryCatalogEntryRelatedEntryComponent( 5036 JsonObject json, CatalogEntry owner) throws IOException, FHIRFormatError { 5037 CatalogEntry.CatalogEntryRelatedEntryComponent res = new CatalogEntry.CatalogEntryRelatedEntryComponent(); 5038 parseCatalogEntryCatalogEntryRelatedEntryComponentProperties(json, owner, res); 5039 return res; 5040 } 5041 5042 protected void parseCatalogEntryCatalogEntryRelatedEntryComponentProperties(JsonObject json, CatalogEntry owner, 5043 CatalogEntry.CatalogEntryRelatedEntryComponent res) throws IOException, FHIRFormatError { 5044 parseBackboneElementProperties(json, res); 5045 if (json.has("relationtype")) 5046 res.setRelationtypeElement(parseEnumeration(json.get("relationtype").getAsString(), 5047 CatalogEntry.CatalogEntryRelationType.NULL, new CatalogEntry.CatalogEntryRelationTypeEnumFactory())); 5048 if (json.has("_relationtype")) 5049 parseElementProperties(getJObject(json, "_relationtype"), res.getRelationtypeElement()); 5050 if (json.has("item")) 5051 res.setItem(parseReference(getJObject(json, "item"))); 5052 } 5053 5054 protected ChargeItem parseChargeItem(JsonObject json) throws IOException, FHIRFormatError { 5055 ChargeItem res = new ChargeItem(); 5056 parseChargeItemProperties(json, res); 5057 return res; 5058 } 5059 5060 protected void parseChargeItemProperties(JsonObject json, ChargeItem res) throws IOException, FHIRFormatError { 5061 parseDomainResourceProperties(json, res); 5062 if (json.has("identifier")) { 5063 JsonArray array = json.getAsJsonArray("identifier"); 5064 for (int i = 0; i < array.size(); i++) { 5065 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 5066 } 5067 } 5068 ; 5069 if (json.has("definitionUri")) { 5070 JsonArray array = json.getAsJsonArray("definitionUri"); 5071 for (int i = 0; i < array.size(); i++) { 5072 if (array.get(i).isJsonNull()) { 5073 res.getDefinitionUri().add(new UriType()); 5074 } else { 5075 res.getDefinitionUri().add(parseUri(array.get(i).getAsString())); 5076 } 5077 } 5078 } 5079 ; 5080 if (json.has("_definitionUri")) { 5081 JsonArray array = json.getAsJsonArray("_definitionUri"); 5082 for (int i = 0; i < array.size(); i++) { 5083 if (i == res.getDefinitionUri().size()) 5084 res.getDefinitionUri().add(parseUri(null)); 5085 if (array.get(i) instanceof JsonObject) 5086 parseElementProperties(array.get(i).getAsJsonObject(), res.getDefinitionUri().get(i)); 5087 } 5088 } 5089 ; 5090 if (json.has("definitionCanonical")) { 5091 JsonArray array = json.getAsJsonArray("definitionCanonical"); 5092 for (int i = 0; i < array.size(); i++) { 5093 if (array.get(i).isJsonNull()) { 5094 res.getDefinitionCanonical().add(new CanonicalType()); 5095 } else { 5096 res.getDefinitionCanonical().add(parseCanonical(array.get(i).getAsString())); 5097 } 5098 } 5099 } 5100 ; 5101 if (json.has("_definitionCanonical")) { 5102 JsonArray array = json.getAsJsonArray("_definitionCanonical"); 5103 for (int i = 0; i < array.size(); i++) { 5104 if (i == res.getDefinitionCanonical().size()) 5105 res.getDefinitionCanonical().add(parseCanonical(null)); 5106 if (array.get(i) instanceof JsonObject) 5107 parseElementProperties(array.get(i).getAsJsonObject(), res.getDefinitionCanonical().get(i)); 5108 } 5109 } 5110 ; 5111 if (json.has("status")) 5112 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), ChargeItem.ChargeItemStatus.NULL, 5113 new ChargeItem.ChargeItemStatusEnumFactory())); 5114 if (json.has("_status")) 5115 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 5116 if (json.has("partOf")) { 5117 JsonArray array = json.getAsJsonArray("partOf"); 5118 for (int i = 0; i < array.size(); i++) { 5119 res.getPartOf().add(parseReference(array.get(i).getAsJsonObject())); 5120 } 5121 } 5122 ; 5123 if (json.has("code")) 5124 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 5125 if (json.has("subject")) 5126 res.setSubject(parseReference(getJObject(json, "subject"))); 5127 if (json.has("context")) 5128 res.setContext(parseReference(getJObject(json, "context"))); 5129 Type occurrence = parseType("occurrence", json); 5130 if (occurrence != null) 5131 res.setOccurrence(occurrence); 5132 if (json.has("performer")) { 5133 JsonArray array = json.getAsJsonArray("performer"); 5134 for (int i = 0; i < array.size(); i++) { 5135 res.getPerformer().add(parseChargeItemChargeItemPerformerComponent(array.get(i).getAsJsonObject(), res)); 5136 } 5137 } 5138 ; 5139 if (json.has("performingOrganization")) 5140 res.setPerformingOrganization(parseReference(getJObject(json, "performingOrganization"))); 5141 if (json.has("requestingOrganization")) 5142 res.setRequestingOrganization(parseReference(getJObject(json, "requestingOrganization"))); 5143 if (json.has("costCenter")) 5144 res.setCostCenter(parseReference(getJObject(json, "costCenter"))); 5145 if (json.has("quantity")) 5146 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 5147 if (json.has("bodysite")) { 5148 JsonArray array = json.getAsJsonArray("bodysite"); 5149 for (int i = 0; i < array.size(); i++) { 5150 res.getBodysite().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 5151 } 5152 } 5153 ; 5154 if (json.has("factorOverride")) 5155 res.setFactorOverrideElement(parseDecimal(json.get("factorOverride").getAsBigDecimal())); 5156 if (json.has("_factorOverride")) 5157 parseElementProperties(getJObject(json, "_factorOverride"), res.getFactorOverrideElement()); 5158 if (json.has("priceOverride")) 5159 res.setPriceOverride(parseMoney(getJObject(json, "priceOverride"))); 5160 if (json.has("overrideReason")) 5161 res.setOverrideReasonElement(parseString(json.get("overrideReason").getAsString())); 5162 if (json.has("_overrideReason")) 5163 parseElementProperties(getJObject(json, "_overrideReason"), res.getOverrideReasonElement()); 5164 if (json.has("enterer")) 5165 res.setEnterer(parseReference(getJObject(json, "enterer"))); 5166 if (json.has("enteredDate")) 5167 res.setEnteredDateElement(parseDateTime(json.get("enteredDate").getAsString())); 5168 if (json.has("_enteredDate")) 5169 parseElementProperties(getJObject(json, "_enteredDate"), res.getEnteredDateElement()); 5170 if (json.has("reason")) { 5171 JsonArray array = json.getAsJsonArray("reason"); 5172 for (int i = 0; i < array.size(); i++) { 5173 res.getReason().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 5174 } 5175 } 5176 ; 5177 if (json.has("service")) { 5178 JsonArray array = json.getAsJsonArray("service"); 5179 for (int i = 0; i < array.size(); i++) { 5180 res.getService().add(parseReference(array.get(i).getAsJsonObject())); 5181 } 5182 } 5183 ; 5184 Type product = parseType("product", json); 5185 if (product != null) 5186 res.setProduct(product); 5187 if (json.has("account")) { 5188 JsonArray array = json.getAsJsonArray("account"); 5189 for (int i = 0; i < array.size(); i++) { 5190 res.getAccount().add(parseReference(array.get(i).getAsJsonObject())); 5191 } 5192 } 5193 ; 5194 if (json.has("note")) { 5195 JsonArray array = json.getAsJsonArray("note"); 5196 for (int i = 0; i < array.size(); i++) { 5197 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 5198 } 5199 } 5200 ; 5201 if (json.has("supportingInformation")) { 5202 JsonArray array = json.getAsJsonArray("supportingInformation"); 5203 for (int i = 0; i < array.size(); i++) { 5204 res.getSupportingInformation().add(parseReference(array.get(i).getAsJsonObject())); 5205 } 5206 } 5207 ; 5208 } 5209 5210 protected ChargeItem.ChargeItemPerformerComponent parseChargeItemChargeItemPerformerComponent(JsonObject json, 5211 ChargeItem owner) throws IOException, FHIRFormatError { 5212 ChargeItem.ChargeItemPerformerComponent res = new ChargeItem.ChargeItemPerformerComponent(); 5213 parseChargeItemChargeItemPerformerComponentProperties(json, owner, res); 5214 return res; 5215 } 5216 5217 protected void parseChargeItemChargeItemPerformerComponentProperties(JsonObject json, ChargeItem owner, 5218 ChargeItem.ChargeItemPerformerComponent res) throws IOException, FHIRFormatError { 5219 parseBackboneElementProperties(json, res); 5220 if (json.has("function")) 5221 res.setFunction(parseCodeableConcept(getJObject(json, "function"))); 5222 if (json.has("actor")) 5223 res.setActor(parseReference(getJObject(json, "actor"))); 5224 } 5225 5226 protected ChargeItemDefinition parseChargeItemDefinition(JsonObject json) throws IOException, FHIRFormatError { 5227 ChargeItemDefinition res = new ChargeItemDefinition(); 5228 parseChargeItemDefinitionProperties(json, res); 5229 return res; 5230 } 5231 5232 protected void parseChargeItemDefinitionProperties(JsonObject json, ChargeItemDefinition res) 5233 throws IOException, FHIRFormatError { 5234 parseDomainResourceProperties(json, res); 5235 if (json.has("url")) 5236 res.setUrlElement(parseUri(json.get("url").getAsString())); 5237 if (json.has("_url")) 5238 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 5239 if (json.has("identifier")) { 5240 JsonArray array = json.getAsJsonArray("identifier"); 5241 for (int i = 0; i < array.size(); i++) { 5242 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 5243 } 5244 } 5245 ; 5246 if (json.has("version")) 5247 res.setVersionElement(parseString(json.get("version").getAsString())); 5248 if (json.has("_version")) 5249 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 5250 if (json.has("title")) 5251 res.setTitleElement(parseString(json.get("title").getAsString())); 5252 if (json.has("_title")) 5253 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 5254 if (json.has("derivedFromUri")) { 5255 JsonArray array = json.getAsJsonArray("derivedFromUri"); 5256 for (int i = 0; i < array.size(); i++) { 5257 if (array.get(i).isJsonNull()) { 5258 res.getDerivedFromUri().add(new UriType()); 5259 } else { 5260 res.getDerivedFromUri().add(parseUri(array.get(i).getAsString())); 5261 } 5262 } 5263 } 5264 ; 5265 if (json.has("_derivedFromUri")) { 5266 JsonArray array = json.getAsJsonArray("_derivedFromUri"); 5267 for (int i = 0; i < array.size(); i++) { 5268 if (i == res.getDerivedFromUri().size()) 5269 res.getDerivedFromUri().add(parseUri(null)); 5270 if (array.get(i) instanceof JsonObject) 5271 parseElementProperties(array.get(i).getAsJsonObject(), res.getDerivedFromUri().get(i)); 5272 } 5273 } 5274 ; 5275 if (json.has("partOf")) { 5276 JsonArray array = json.getAsJsonArray("partOf"); 5277 for (int i = 0; i < array.size(); i++) { 5278 if (array.get(i).isJsonNull()) { 5279 res.getPartOf().add(new CanonicalType()); 5280 } else { 5281 res.getPartOf().add(parseCanonical(array.get(i).getAsString())); 5282 } 5283 } 5284 } 5285 ; 5286 if (json.has("_partOf")) { 5287 JsonArray array = json.getAsJsonArray("_partOf"); 5288 for (int i = 0; i < array.size(); i++) { 5289 if (i == res.getPartOf().size()) 5290 res.getPartOf().add(parseCanonical(null)); 5291 if (array.get(i) instanceof JsonObject) 5292 parseElementProperties(array.get(i).getAsJsonObject(), res.getPartOf().get(i)); 5293 } 5294 } 5295 ; 5296 if (json.has("replaces")) { 5297 JsonArray array = json.getAsJsonArray("replaces"); 5298 for (int i = 0; i < array.size(); i++) { 5299 if (array.get(i).isJsonNull()) { 5300 res.getReplaces().add(new CanonicalType()); 5301 } else { 5302 res.getReplaces().add(parseCanonical(array.get(i).getAsString())); 5303 } 5304 } 5305 } 5306 ; 5307 if (json.has("_replaces")) { 5308 JsonArray array = json.getAsJsonArray("_replaces"); 5309 for (int i = 0; i < array.size(); i++) { 5310 if (i == res.getReplaces().size()) 5311 res.getReplaces().add(parseCanonical(null)); 5312 if (array.get(i) instanceof JsonObject) 5313 parseElementProperties(array.get(i).getAsJsonObject(), res.getReplaces().get(i)); 5314 } 5315 } 5316 ; 5317 if (json.has("status")) 5318 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 5319 new Enumerations.PublicationStatusEnumFactory())); 5320 if (json.has("_status")) 5321 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 5322 if (json.has("experimental")) 5323 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 5324 if (json.has("_experimental")) 5325 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 5326 if (json.has("date")) 5327 res.setDateElement(parseDateTime(json.get("date").getAsString())); 5328 if (json.has("_date")) 5329 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 5330 if (json.has("publisher")) 5331 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 5332 if (json.has("_publisher")) 5333 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 5334 if (json.has("contact")) { 5335 JsonArray array = json.getAsJsonArray("contact"); 5336 for (int i = 0; i < array.size(); i++) { 5337 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 5338 } 5339 } 5340 ; 5341 if (json.has("description")) 5342 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 5343 if (json.has("_description")) 5344 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 5345 if (json.has("useContext")) { 5346 JsonArray array = json.getAsJsonArray("useContext"); 5347 for (int i = 0; i < array.size(); i++) { 5348 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 5349 } 5350 } 5351 ; 5352 if (json.has("jurisdiction")) { 5353 JsonArray array = json.getAsJsonArray("jurisdiction"); 5354 for (int i = 0; i < array.size(); i++) { 5355 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 5356 } 5357 } 5358 ; 5359 if (json.has("copyright")) 5360 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 5361 if (json.has("_copyright")) 5362 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 5363 if (json.has("approvalDate")) 5364 res.setApprovalDateElement(parseDate(json.get("approvalDate").getAsString())); 5365 if (json.has("_approvalDate")) 5366 parseElementProperties(getJObject(json, "_approvalDate"), res.getApprovalDateElement()); 5367 if (json.has("lastReviewDate")) 5368 res.setLastReviewDateElement(parseDate(json.get("lastReviewDate").getAsString())); 5369 if (json.has("_lastReviewDate")) 5370 parseElementProperties(getJObject(json, "_lastReviewDate"), res.getLastReviewDateElement()); 5371 if (json.has("effectivePeriod")) 5372 res.setEffectivePeriod(parsePeriod(getJObject(json, "effectivePeriod"))); 5373 if (json.has("code")) 5374 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 5375 if (json.has("instance")) { 5376 JsonArray array = json.getAsJsonArray("instance"); 5377 for (int i = 0; i < array.size(); i++) { 5378 res.getInstance().add(parseReference(array.get(i).getAsJsonObject())); 5379 } 5380 } 5381 ; 5382 if (json.has("applicability")) { 5383 JsonArray array = json.getAsJsonArray("applicability"); 5384 for (int i = 0; i < array.size(); i++) { 5385 res.getApplicability().add( 5386 parseChargeItemDefinitionChargeItemDefinitionApplicabilityComponent(array.get(i).getAsJsonObject(), res)); 5387 } 5388 } 5389 ; 5390 if (json.has("propertyGroup")) { 5391 JsonArray array = json.getAsJsonArray("propertyGroup"); 5392 for (int i = 0; i < array.size(); i++) { 5393 res.getPropertyGroup().add( 5394 parseChargeItemDefinitionChargeItemDefinitionPropertyGroupComponent(array.get(i).getAsJsonObject(), res)); 5395 } 5396 } 5397 ; 5398 } 5399 5400 protected ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent parseChargeItemDefinitionChargeItemDefinitionApplicabilityComponent( 5401 JsonObject json, ChargeItemDefinition owner) throws IOException, FHIRFormatError { 5402 ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent res = new ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent(); 5403 parseChargeItemDefinitionChargeItemDefinitionApplicabilityComponentProperties(json, owner, res); 5404 return res; 5405 } 5406 5407 protected void parseChargeItemDefinitionChargeItemDefinitionApplicabilityComponentProperties(JsonObject json, 5408 ChargeItemDefinition owner, ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent res) 5409 throws IOException, FHIRFormatError { 5410 parseBackboneElementProperties(json, res); 5411 if (json.has("description")) 5412 res.setDescriptionElement(parseString(json.get("description").getAsString())); 5413 if (json.has("_description")) 5414 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 5415 if (json.has("language")) 5416 res.setLanguageElement(parseString(json.get("language").getAsString())); 5417 if (json.has("_language")) 5418 parseElementProperties(getJObject(json, "_language"), res.getLanguageElement()); 5419 if (json.has("expression")) 5420 res.setExpressionElement(parseString(json.get("expression").getAsString())); 5421 if (json.has("_expression")) 5422 parseElementProperties(getJObject(json, "_expression"), res.getExpressionElement()); 5423 } 5424 5425 protected ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent parseChargeItemDefinitionChargeItemDefinitionPropertyGroupComponent( 5426 JsonObject json, ChargeItemDefinition owner) throws IOException, FHIRFormatError { 5427 ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent res = new ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent(); 5428 parseChargeItemDefinitionChargeItemDefinitionPropertyGroupComponentProperties(json, owner, res); 5429 return res; 5430 } 5431 5432 protected void parseChargeItemDefinitionChargeItemDefinitionPropertyGroupComponentProperties(JsonObject json, 5433 ChargeItemDefinition owner, ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent res) 5434 throws IOException, FHIRFormatError { 5435 parseBackboneElementProperties(json, res); 5436 if (json.has("applicability")) { 5437 JsonArray array = json.getAsJsonArray("applicability"); 5438 for (int i = 0; i < array.size(); i++) { 5439 res.getApplicability().add( 5440 parseChargeItemDefinitionChargeItemDefinitionApplicabilityComponent(array.get(i).getAsJsonObject(), owner)); 5441 } 5442 } 5443 ; 5444 if (json.has("priceComponent")) { 5445 JsonArray array = json.getAsJsonArray("priceComponent"); 5446 for (int i = 0; i < array.size(); i++) { 5447 res.getPriceComponent().add(parseChargeItemDefinitionChargeItemDefinitionPropertyGroupPriceComponentComponent( 5448 array.get(i).getAsJsonObject(), owner)); 5449 } 5450 } 5451 ; 5452 } 5453 5454 protected ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent parseChargeItemDefinitionChargeItemDefinitionPropertyGroupPriceComponentComponent( 5455 JsonObject json, ChargeItemDefinition owner) throws IOException, FHIRFormatError { 5456 ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent res = new ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent(); 5457 parseChargeItemDefinitionChargeItemDefinitionPropertyGroupPriceComponentComponentProperties(json, owner, res); 5458 return res; 5459 } 5460 5461 protected void parseChargeItemDefinitionChargeItemDefinitionPropertyGroupPriceComponentComponentProperties( 5462 JsonObject json, ChargeItemDefinition owner, 5463 ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent res) 5464 throws IOException, FHIRFormatError { 5465 parseBackboneElementProperties(json, res); 5466 if (json.has("type")) 5467 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), 5468 ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.NULL, 5469 new ChargeItemDefinition.ChargeItemDefinitionPriceComponentTypeEnumFactory())); 5470 if (json.has("_type")) 5471 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 5472 if (json.has("code")) 5473 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 5474 if (json.has("factor")) 5475 res.setFactorElement(parseDecimal(json.get("factor").getAsBigDecimal())); 5476 if (json.has("_factor")) 5477 parseElementProperties(getJObject(json, "_factor"), res.getFactorElement()); 5478 if (json.has("amount")) 5479 res.setAmount(parseMoney(getJObject(json, "amount"))); 5480 } 5481 5482 protected Claim parseClaim(JsonObject json) throws IOException, FHIRFormatError { 5483 Claim res = new Claim(); 5484 parseClaimProperties(json, res); 5485 return res; 5486 } 5487 5488 protected void parseClaimProperties(JsonObject json, Claim res) throws IOException, FHIRFormatError { 5489 parseDomainResourceProperties(json, res); 5490 if (json.has("identifier")) { 5491 JsonArray array = json.getAsJsonArray("identifier"); 5492 for (int i = 0; i < array.size(); i++) { 5493 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 5494 } 5495 } 5496 ; 5497 if (json.has("status")) 5498 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Claim.ClaimStatus.NULL, 5499 new Claim.ClaimStatusEnumFactory())); 5500 if (json.has("_status")) 5501 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 5502 if (json.has("type")) 5503 res.setType(parseCodeableConcept(getJObject(json, "type"))); 5504 if (json.has("subType")) 5505 res.setSubType(parseCodeableConcept(getJObject(json, "subType"))); 5506 if (json.has("use")) 5507 res.setUseElement(parseEnumeration(json.get("use").getAsString(), Claim.Use.NULL, new Claim.UseEnumFactory())); 5508 if (json.has("_use")) 5509 parseElementProperties(getJObject(json, "_use"), res.getUseElement()); 5510 if (json.has("patient")) 5511 res.setPatient(parseReference(getJObject(json, "patient"))); 5512 if (json.has("billablePeriod")) 5513 res.setBillablePeriod(parsePeriod(getJObject(json, "billablePeriod"))); 5514 if (json.has("created")) 5515 res.setCreatedElement(parseDateTime(json.get("created").getAsString())); 5516 if (json.has("_created")) 5517 parseElementProperties(getJObject(json, "_created"), res.getCreatedElement()); 5518 if (json.has("enterer")) 5519 res.setEnterer(parseReference(getJObject(json, "enterer"))); 5520 if (json.has("insurer")) 5521 res.setInsurer(parseReference(getJObject(json, "insurer"))); 5522 if (json.has("provider")) 5523 res.setProvider(parseReference(getJObject(json, "provider"))); 5524 if (json.has("priority")) 5525 res.setPriority(parseCodeableConcept(getJObject(json, "priority"))); 5526 if (json.has("fundsReserve")) 5527 res.setFundsReserve(parseCodeableConcept(getJObject(json, "fundsReserve"))); 5528 if (json.has("related")) { 5529 JsonArray array = json.getAsJsonArray("related"); 5530 for (int i = 0; i < array.size(); i++) { 5531 res.getRelated().add(parseClaimRelatedClaimComponent(array.get(i).getAsJsonObject(), res)); 5532 } 5533 } 5534 ; 5535 if (json.has("prescription")) 5536 res.setPrescription(parseReference(getJObject(json, "prescription"))); 5537 if (json.has("originalPrescription")) 5538 res.setOriginalPrescription(parseReference(getJObject(json, "originalPrescription"))); 5539 if (json.has("payee")) 5540 res.setPayee(parseClaimPayeeComponent(getJObject(json, "payee"), res)); 5541 if (json.has("referral")) 5542 res.setReferral(parseReference(getJObject(json, "referral"))); 5543 if (json.has("facility")) 5544 res.setFacility(parseReference(getJObject(json, "facility"))); 5545 if (json.has("careTeam")) { 5546 JsonArray array = json.getAsJsonArray("careTeam"); 5547 for (int i = 0; i < array.size(); i++) { 5548 res.getCareTeam().add(parseClaimCareTeamComponent(array.get(i).getAsJsonObject(), res)); 5549 } 5550 } 5551 ; 5552 if (json.has("supportingInfo")) { 5553 JsonArray array = json.getAsJsonArray("supportingInfo"); 5554 for (int i = 0; i < array.size(); i++) { 5555 res.getSupportingInfo().add(parseClaimSupportingInformationComponent(array.get(i).getAsJsonObject(), res)); 5556 } 5557 } 5558 ; 5559 if (json.has("diagnosis")) { 5560 JsonArray array = json.getAsJsonArray("diagnosis"); 5561 for (int i = 0; i < array.size(); i++) { 5562 res.getDiagnosis().add(parseClaimDiagnosisComponent(array.get(i).getAsJsonObject(), res)); 5563 } 5564 } 5565 ; 5566 if (json.has("procedure")) { 5567 JsonArray array = json.getAsJsonArray("procedure"); 5568 for (int i = 0; i < array.size(); i++) { 5569 res.getProcedure().add(parseClaimProcedureComponent(array.get(i).getAsJsonObject(), res)); 5570 } 5571 } 5572 ; 5573 if (json.has("insurance")) { 5574 JsonArray array = json.getAsJsonArray("insurance"); 5575 for (int i = 0; i < array.size(); i++) { 5576 res.getInsurance().add(parseClaimInsuranceComponent(array.get(i).getAsJsonObject(), res)); 5577 } 5578 } 5579 ; 5580 if (json.has("accident")) 5581 res.setAccident(parseClaimAccidentComponent(getJObject(json, "accident"), res)); 5582 if (json.has("item")) { 5583 JsonArray array = json.getAsJsonArray("item"); 5584 for (int i = 0; i < array.size(); i++) { 5585 res.getItem().add(parseClaimItemComponent(array.get(i).getAsJsonObject(), res)); 5586 } 5587 } 5588 ; 5589 if (json.has("total")) 5590 res.setTotal(parseMoney(getJObject(json, "total"))); 5591 } 5592 5593 protected Claim.RelatedClaimComponent parseClaimRelatedClaimComponent(JsonObject json, Claim owner) 5594 throws IOException, FHIRFormatError { 5595 Claim.RelatedClaimComponent res = new Claim.RelatedClaimComponent(); 5596 parseClaimRelatedClaimComponentProperties(json, owner, res); 5597 return res; 5598 } 5599 5600 protected void parseClaimRelatedClaimComponentProperties(JsonObject json, Claim owner, 5601 Claim.RelatedClaimComponent res) throws IOException, FHIRFormatError { 5602 parseBackboneElementProperties(json, res); 5603 if (json.has("claim")) 5604 res.setClaim(parseReference(getJObject(json, "claim"))); 5605 if (json.has("relationship")) 5606 res.setRelationship(parseCodeableConcept(getJObject(json, "relationship"))); 5607 if (json.has("reference")) 5608 res.setReference(parseIdentifier(getJObject(json, "reference"))); 5609 } 5610 5611 protected Claim.PayeeComponent parseClaimPayeeComponent(JsonObject json, Claim owner) 5612 throws IOException, FHIRFormatError { 5613 Claim.PayeeComponent res = new Claim.PayeeComponent(); 5614 parseClaimPayeeComponentProperties(json, owner, res); 5615 return res; 5616 } 5617 5618 protected void parseClaimPayeeComponentProperties(JsonObject json, Claim owner, Claim.PayeeComponent res) 5619 throws IOException, FHIRFormatError { 5620 parseBackboneElementProperties(json, res); 5621 if (json.has("type")) 5622 res.setType(parseCodeableConcept(getJObject(json, "type"))); 5623 if (json.has("party")) 5624 res.setParty(parseReference(getJObject(json, "party"))); 5625 } 5626 5627 protected Claim.CareTeamComponent parseClaimCareTeamComponent(JsonObject json, Claim owner) 5628 throws IOException, FHIRFormatError { 5629 Claim.CareTeamComponent res = new Claim.CareTeamComponent(); 5630 parseClaimCareTeamComponentProperties(json, owner, res); 5631 return res; 5632 } 5633 5634 protected void parseClaimCareTeamComponentProperties(JsonObject json, Claim owner, Claim.CareTeamComponent res) 5635 throws IOException, FHIRFormatError { 5636 parseBackboneElementProperties(json, res); 5637 if (json.has("sequence")) 5638 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 5639 if (json.has("_sequence")) 5640 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 5641 if (json.has("provider")) 5642 res.setProvider(parseReference(getJObject(json, "provider"))); 5643 if (json.has("responsible")) 5644 res.setResponsibleElement(parseBoolean(json.get("responsible").getAsBoolean())); 5645 if (json.has("_responsible")) 5646 parseElementProperties(getJObject(json, "_responsible"), res.getResponsibleElement()); 5647 if (json.has("role")) 5648 res.setRole(parseCodeableConcept(getJObject(json, "role"))); 5649 if (json.has("qualification")) 5650 res.setQualification(parseCodeableConcept(getJObject(json, "qualification"))); 5651 } 5652 5653 protected Claim.SupportingInformationComponent parseClaimSupportingInformationComponent(JsonObject json, Claim owner) 5654 throws IOException, FHIRFormatError { 5655 Claim.SupportingInformationComponent res = new Claim.SupportingInformationComponent(); 5656 parseClaimSupportingInformationComponentProperties(json, owner, res); 5657 return res; 5658 } 5659 5660 protected void parseClaimSupportingInformationComponentProperties(JsonObject json, Claim owner, 5661 Claim.SupportingInformationComponent res) throws IOException, FHIRFormatError { 5662 parseBackboneElementProperties(json, res); 5663 if (json.has("sequence")) 5664 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 5665 if (json.has("_sequence")) 5666 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 5667 if (json.has("category")) 5668 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 5669 if (json.has("code")) 5670 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 5671 Type timing = parseType("timing", json); 5672 if (timing != null) 5673 res.setTiming(timing); 5674 Type value = parseType("value", json); 5675 if (value != null) 5676 res.setValue(value); 5677 if (json.has("reason")) 5678 res.setReason(parseCodeableConcept(getJObject(json, "reason"))); 5679 } 5680 5681 protected Claim.DiagnosisComponent parseClaimDiagnosisComponent(JsonObject json, Claim owner) 5682 throws IOException, FHIRFormatError { 5683 Claim.DiagnosisComponent res = new Claim.DiagnosisComponent(); 5684 parseClaimDiagnosisComponentProperties(json, owner, res); 5685 return res; 5686 } 5687 5688 protected void parseClaimDiagnosisComponentProperties(JsonObject json, Claim owner, Claim.DiagnosisComponent res) 5689 throws IOException, FHIRFormatError { 5690 parseBackboneElementProperties(json, res); 5691 if (json.has("sequence")) 5692 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 5693 if (json.has("_sequence")) 5694 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 5695 Type diagnosis = parseType("diagnosis", json); 5696 if (diagnosis != null) 5697 res.setDiagnosis(diagnosis); 5698 if (json.has("type")) { 5699 JsonArray array = json.getAsJsonArray("type"); 5700 for (int i = 0; i < array.size(); i++) { 5701 res.getType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 5702 } 5703 } 5704 ; 5705 if (json.has("onAdmission")) 5706 res.setOnAdmission(parseCodeableConcept(getJObject(json, "onAdmission"))); 5707 if (json.has("packageCode")) 5708 res.setPackageCode(parseCodeableConcept(getJObject(json, "packageCode"))); 5709 } 5710 5711 protected Claim.ProcedureComponent parseClaimProcedureComponent(JsonObject json, Claim owner) 5712 throws IOException, FHIRFormatError { 5713 Claim.ProcedureComponent res = new Claim.ProcedureComponent(); 5714 parseClaimProcedureComponentProperties(json, owner, res); 5715 return res; 5716 } 5717 5718 protected void parseClaimProcedureComponentProperties(JsonObject json, Claim owner, Claim.ProcedureComponent res) 5719 throws IOException, FHIRFormatError { 5720 parseBackboneElementProperties(json, res); 5721 if (json.has("sequence")) 5722 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 5723 if (json.has("_sequence")) 5724 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 5725 if (json.has("type")) { 5726 JsonArray array = json.getAsJsonArray("type"); 5727 for (int i = 0; i < array.size(); i++) { 5728 res.getType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 5729 } 5730 } 5731 ; 5732 if (json.has("date")) 5733 res.setDateElement(parseDateTime(json.get("date").getAsString())); 5734 if (json.has("_date")) 5735 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 5736 Type procedure = parseType("procedure", json); 5737 if (procedure != null) 5738 res.setProcedure(procedure); 5739 if (json.has("udi")) { 5740 JsonArray array = json.getAsJsonArray("udi"); 5741 for (int i = 0; i < array.size(); i++) { 5742 res.getUdi().add(parseReference(array.get(i).getAsJsonObject())); 5743 } 5744 } 5745 ; 5746 } 5747 5748 protected Claim.InsuranceComponent parseClaimInsuranceComponent(JsonObject json, Claim owner) 5749 throws IOException, FHIRFormatError { 5750 Claim.InsuranceComponent res = new Claim.InsuranceComponent(); 5751 parseClaimInsuranceComponentProperties(json, owner, res); 5752 return res; 5753 } 5754 5755 protected void parseClaimInsuranceComponentProperties(JsonObject json, Claim owner, Claim.InsuranceComponent res) 5756 throws IOException, FHIRFormatError { 5757 parseBackboneElementProperties(json, res); 5758 if (json.has("sequence")) 5759 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 5760 if (json.has("_sequence")) 5761 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 5762 if (json.has("focal")) 5763 res.setFocalElement(parseBoolean(json.get("focal").getAsBoolean())); 5764 if (json.has("_focal")) 5765 parseElementProperties(getJObject(json, "_focal"), res.getFocalElement()); 5766 if (json.has("identifier")) 5767 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 5768 if (json.has("coverage")) 5769 res.setCoverage(parseReference(getJObject(json, "coverage"))); 5770 if (json.has("businessArrangement")) 5771 res.setBusinessArrangementElement(parseString(json.get("businessArrangement").getAsString())); 5772 if (json.has("_businessArrangement")) 5773 parseElementProperties(getJObject(json, "_businessArrangement"), res.getBusinessArrangementElement()); 5774 if (json.has("preAuthRef")) { 5775 JsonArray array = json.getAsJsonArray("preAuthRef"); 5776 for (int i = 0; i < array.size(); i++) { 5777 if (array.get(i).isJsonNull()) { 5778 res.getPreAuthRef().add(new StringType()); 5779 } else { 5780 res.getPreAuthRef().add(parseString(array.get(i).getAsString())); 5781 } 5782 } 5783 } 5784 ; 5785 if (json.has("_preAuthRef")) { 5786 JsonArray array = json.getAsJsonArray("_preAuthRef"); 5787 for (int i = 0; i < array.size(); i++) { 5788 if (i == res.getPreAuthRef().size()) 5789 res.getPreAuthRef().add(parseString(null)); 5790 if (array.get(i) instanceof JsonObject) 5791 parseElementProperties(array.get(i).getAsJsonObject(), res.getPreAuthRef().get(i)); 5792 } 5793 } 5794 ; 5795 if (json.has("claimResponse")) 5796 res.setClaimResponse(parseReference(getJObject(json, "claimResponse"))); 5797 } 5798 5799 protected Claim.AccidentComponent parseClaimAccidentComponent(JsonObject json, Claim owner) 5800 throws IOException, FHIRFormatError { 5801 Claim.AccidentComponent res = new Claim.AccidentComponent(); 5802 parseClaimAccidentComponentProperties(json, owner, res); 5803 return res; 5804 } 5805 5806 protected void parseClaimAccidentComponentProperties(JsonObject json, Claim owner, Claim.AccidentComponent res) 5807 throws IOException, FHIRFormatError { 5808 parseBackboneElementProperties(json, res); 5809 if (json.has("date")) 5810 res.setDateElement(parseDate(json.get("date").getAsString())); 5811 if (json.has("_date")) 5812 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 5813 if (json.has("type")) 5814 res.setType(parseCodeableConcept(getJObject(json, "type"))); 5815 Type location = parseType("location", json); 5816 if (location != null) 5817 res.setLocation(location); 5818 } 5819 5820 protected Claim.ItemComponent parseClaimItemComponent(JsonObject json, Claim owner) 5821 throws IOException, FHIRFormatError { 5822 Claim.ItemComponent res = new Claim.ItemComponent(); 5823 parseClaimItemComponentProperties(json, owner, res); 5824 return res; 5825 } 5826 5827 protected void parseClaimItemComponentProperties(JsonObject json, Claim owner, Claim.ItemComponent res) 5828 throws IOException, FHIRFormatError { 5829 parseBackboneElementProperties(json, res); 5830 if (json.has("sequence")) 5831 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 5832 if (json.has("_sequence")) 5833 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 5834 if (json.has("careTeamSequence")) { 5835 JsonArray array = json.getAsJsonArray("careTeamSequence"); 5836 for (int i = 0; i < array.size(); i++) { 5837 if (array.get(i).isJsonNull()) { 5838 res.getCareTeamSequence().add(new PositiveIntType()); 5839 } else { 5840 res.getCareTeamSequence().add(parsePositiveInt(array.get(i).getAsString())); 5841 } 5842 } 5843 } 5844 ; 5845 if (json.has("_careTeamSequence")) { 5846 JsonArray array = json.getAsJsonArray("_careTeamSequence"); 5847 for (int i = 0; i < array.size(); i++) { 5848 if (i == res.getCareTeamSequence().size()) 5849 res.getCareTeamSequence().add(parsePositiveInt(null)); 5850 if (array.get(i) instanceof JsonObject) 5851 parseElementProperties(array.get(i).getAsJsonObject(), res.getCareTeamSequence().get(i)); 5852 } 5853 } 5854 ; 5855 if (json.has("diagnosisSequence")) { 5856 JsonArray array = json.getAsJsonArray("diagnosisSequence"); 5857 for (int i = 0; i < array.size(); i++) { 5858 if (array.get(i).isJsonNull()) { 5859 res.getDiagnosisSequence().add(new PositiveIntType()); 5860 } else { 5861 res.getDiagnosisSequence().add(parsePositiveInt(array.get(i).getAsString())); 5862 } 5863 } 5864 } 5865 ; 5866 if (json.has("_diagnosisSequence")) { 5867 JsonArray array = json.getAsJsonArray("_diagnosisSequence"); 5868 for (int i = 0; i < array.size(); i++) { 5869 if (i == res.getDiagnosisSequence().size()) 5870 res.getDiagnosisSequence().add(parsePositiveInt(null)); 5871 if (array.get(i) instanceof JsonObject) 5872 parseElementProperties(array.get(i).getAsJsonObject(), res.getDiagnosisSequence().get(i)); 5873 } 5874 } 5875 ; 5876 if (json.has("procedureSequence")) { 5877 JsonArray array = json.getAsJsonArray("procedureSequence"); 5878 for (int i = 0; i < array.size(); i++) { 5879 if (array.get(i).isJsonNull()) { 5880 res.getProcedureSequence().add(new PositiveIntType()); 5881 } else { 5882 res.getProcedureSequence().add(parsePositiveInt(array.get(i).getAsString())); 5883 } 5884 } 5885 } 5886 ; 5887 if (json.has("_procedureSequence")) { 5888 JsonArray array = json.getAsJsonArray("_procedureSequence"); 5889 for (int i = 0; i < array.size(); i++) { 5890 if (i == res.getProcedureSequence().size()) 5891 res.getProcedureSequence().add(parsePositiveInt(null)); 5892 if (array.get(i) instanceof JsonObject) 5893 parseElementProperties(array.get(i).getAsJsonObject(), res.getProcedureSequence().get(i)); 5894 } 5895 } 5896 ; 5897 if (json.has("informationSequence")) { 5898 JsonArray array = json.getAsJsonArray("informationSequence"); 5899 for (int i = 0; i < array.size(); i++) { 5900 if (array.get(i).isJsonNull()) { 5901 res.getInformationSequence().add(new PositiveIntType()); 5902 } else { 5903 res.getInformationSequence().add(parsePositiveInt(array.get(i).getAsString())); 5904 } 5905 } 5906 } 5907 ; 5908 if (json.has("_informationSequence")) { 5909 JsonArray array = json.getAsJsonArray("_informationSequence"); 5910 for (int i = 0; i < array.size(); i++) { 5911 if (i == res.getInformationSequence().size()) 5912 res.getInformationSequence().add(parsePositiveInt(null)); 5913 if (array.get(i) instanceof JsonObject) 5914 parseElementProperties(array.get(i).getAsJsonObject(), res.getInformationSequence().get(i)); 5915 } 5916 } 5917 ; 5918 if (json.has("revenue")) 5919 res.setRevenue(parseCodeableConcept(getJObject(json, "revenue"))); 5920 if (json.has("category")) 5921 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 5922 if (json.has("productOrService")) 5923 res.setProductOrService(parseCodeableConcept(getJObject(json, "productOrService"))); 5924 if (json.has("modifier")) { 5925 JsonArray array = json.getAsJsonArray("modifier"); 5926 for (int i = 0; i < array.size(); i++) { 5927 res.getModifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 5928 } 5929 } 5930 ; 5931 if (json.has("programCode")) { 5932 JsonArray array = json.getAsJsonArray("programCode"); 5933 for (int i = 0; i < array.size(); i++) { 5934 res.getProgramCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 5935 } 5936 } 5937 ; 5938 Type serviced = parseType("serviced", json); 5939 if (serviced != null) 5940 res.setServiced(serviced); 5941 Type location = parseType("location", json); 5942 if (location != null) 5943 res.setLocation(location); 5944 if (json.has("quantity")) 5945 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 5946 if (json.has("unitPrice")) 5947 res.setUnitPrice(parseMoney(getJObject(json, "unitPrice"))); 5948 if (json.has("factor")) 5949 res.setFactorElement(parseDecimal(json.get("factor").getAsBigDecimal())); 5950 if (json.has("_factor")) 5951 parseElementProperties(getJObject(json, "_factor"), res.getFactorElement()); 5952 if (json.has("net")) 5953 res.setNet(parseMoney(getJObject(json, "net"))); 5954 if (json.has("udi")) { 5955 JsonArray array = json.getAsJsonArray("udi"); 5956 for (int i = 0; i < array.size(); i++) { 5957 res.getUdi().add(parseReference(array.get(i).getAsJsonObject())); 5958 } 5959 } 5960 ; 5961 if (json.has("bodySite")) 5962 res.setBodySite(parseCodeableConcept(getJObject(json, "bodySite"))); 5963 if (json.has("subSite")) { 5964 JsonArray array = json.getAsJsonArray("subSite"); 5965 for (int i = 0; i < array.size(); i++) { 5966 res.getSubSite().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 5967 } 5968 } 5969 ; 5970 if (json.has("encounter")) { 5971 JsonArray array = json.getAsJsonArray("encounter"); 5972 for (int i = 0; i < array.size(); i++) { 5973 res.getEncounter().add(parseReference(array.get(i).getAsJsonObject())); 5974 } 5975 } 5976 ; 5977 if (json.has("detail")) { 5978 JsonArray array = json.getAsJsonArray("detail"); 5979 for (int i = 0; i < array.size(); i++) { 5980 res.getDetail().add(parseClaimDetailComponent(array.get(i).getAsJsonObject(), owner)); 5981 } 5982 } 5983 ; 5984 } 5985 5986 protected Claim.DetailComponent parseClaimDetailComponent(JsonObject json, Claim owner) 5987 throws IOException, FHIRFormatError { 5988 Claim.DetailComponent res = new Claim.DetailComponent(); 5989 parseClaimDetailComponentProperties(json, owner, res); 5990 return res; 5991 } 5992 5993 protected void parseClaimDetailComponentProperties(JsonObject json, Claim owner, Claim.DetailComponent res) 5994 throws IOException, FHIRFormatError { 5995 parseBackboneElementProperties(json, res); 5996 if (json.has("sequence")) 5997 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 5998 if (json.has("_sequence")) 5999 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 6000 if (json.has("revenue")) 6001 res.setRevenue(parseCodeableConcept(getJObject(json, "revenue"))); 6002 if (json.has("category")) 6003 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 6004 if (json.has("productOrService")) 6005 res.setProductOrService(parseCodeableConcept(getJObject(json, "productOrService"))); 6006 if (json.has("modifier")) { 6007 JsonArray array = json.getAsJsonArray("modifier"); 6008 for (int i = 0; i < array.size(); i++) { 6009 res.getModifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 6010 } 6011 } 6012 ; 6013 if (json.has("programCode")) { 6014 JsonArray array = json.getAsJsonArray("programCode"); 6015 for (int i = 0; i < array.size(); i++) { 6016 res.getProgramCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 6017 } 6018 } 6019 ; 6020 if (json.has("quantity")) 6021 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 6022 if (json.has("unitPrice")) 6023 res.setUnitPrice(parseMoney(getJObject(json, "unitPrice"))); 6024 if (json.has("factor")) 6025 res.setFactorElement(parseDecimal(json.get("factor").getAsBigDecimal())); 6026 if (json.has("_factor")) 6027 parseElementProperties(getJObject(json, "_factor"), res.getFactorElement()); 6028 if (json.has("net")) 6029 res.setNet(parseMoney(getJObject(json, "net"))); 6030 if (json.has("udi")) { 6031 JsonArray array = json.getAsJsonArray("udi"); 6032 for (int i = 0; i < array.size(); i++) { 6033 res.getUdi().add(parseReference(array.get(i).getAsJsonObject())); 6034 } 6035 } 6036 ; 6037 if (json.has("subDetail")) { 6038 JsonArray array = json.getAsJsonArray("subDetail"); 6039 for (int i = 0; i < array.size(); i++) { 6040 res.getSubDetail().add(parseClaimSubDetailComponent(array.get(i).getAsJsonObject(), owner)); 6041 } 6042 } 6043 ; 6044 } 6045 6046 protected Claim.SubDetailComponent parseClaimSubDetailComponent(JsonObject json, Claim owner) 6047 throws IOException, FHIRFormatError { 6048 Claim.SubDetailComponent res = new Claim.SubDetailComponent(); 6049 parseClaimSubDetailComponentProperties(json, owner, res); 6050 return res; 6051 } 6052 6053 protected void parseClaimSubDetailComponentProperties(JsonObject json, Claim owner, Claim.SubDetailComponent res) 6054 throws IOException, FHIRFormatError { 6055 parseBackboneElementProperties(json, res); 6056 if (json.has("sequence")) 6057 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 6058 if (json.has("_sequence")) 6059 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 6060 if (json.has("revenue")) 6061 res.setRevenue(parseCodeableConcept(getJObject(json, "revenue"))); 6062 if (json.has("category")) 6063 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 6064 if (json.has("productOrService")) 6065 res.setProductOrService(parseCodeableConcept(getJObject(json, "productOrService"))); 6066 if (json.has("modifier")) { 6067 JsonArray array = json.getAsJsonArray("modifier"); 6068 for (int i = 0; i < array.size(); i++) { 6069 res.getModifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 6070 } 6071 } 6072 ; 6073 if (json.has("programCode")) { 6074 JsonArray array = json.getAsJsonArray("programCode"); 6075 for (int i = 0; i < array.size(); i++) { 6076 res.getProgramCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 6077 } 6078 } 6079 ; 6080 if (json.has("quantity")) 6081 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 6082 if (json.has("unitPrice")) 6083 res.setUnitPrice(parseMoney(getJObject(json, "unitPrice"))); 6084 if (json.has("factor")) 6085 res.setFactorElement(parseDecimal(json.get("factor").getAsBigDecimal())); 6086 if (json.has("_factor")) 6087 parseElementProperties(getJObject(json, "_factor"), res.getFactorElement()); 6088 if (json.has("net")) 6089 res.setNet(parseMoney(getJObject(json, "net"))); 6090 if (json.has("udi")) { 6091 JsonArray array = json.getAsJsonArray("udi"); 6092 for (int i = 0; i < array.size(); i++) { 6093 res.getUdi().add(parseReference(array.get(i).getAsJsonObject())); 6094 } 6095 } 6096 ; 6097 } 6098 6099 protected ClaimResponse parseClaimResponse(JsonObject json) throws IOException, FHIRFormatError { 6100 ClaimResponse res = new ClaimResponse(); 6101 parseClaimResponseProperties(json, res); 6102 return res; 6103 } 6104 6105 protected void parseClaimResponseProperties(JsonObject json, ClaimResponse res) throws IOException, FHIRFormatError { 6106 parseDomainResourceProperties(json, res); 6107 if (json.has("identifier")) { 6108 JsonArray array = json.getAsJsonArray("identifier"); 6109 for (int i = 0; i < array.size(); i++) { 6110 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 6111 } 6112 } 6113 ; 6114 if (json.has("status")) 6115 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), ClaimResponse.ClaimResponseStatus.NULL, 6116 new ClaimResponse.ClaimResponseStatusEnumFactory())); 6117 if (json.has("_status")) 6118 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 6119 if (json.has("type")) 6120 res.setType(parseCodeableConcept(getJObject(json, "type"))); 6121 if (json.has("subType")) 6122 res.setSubType(parseCodeableConcept(getJObject(json, "subType"))); 6123 if (json.has("use")) 6124 res.setUseElement( 6125 parseEnumeration(json.get("use").getAsString(), ClaimResponse.Use.NULL, new ClaimResponse.UseEnumFactory())); 6126 if (json.has("_use")) 6127 parseElementProperties(getJObject(json, "_use"), res.getUseElement()); 6128 if (json.has("patient")) 6129 res.setPatient(parseReference(getJObject(json, "patient"))); 6130 if (json.has("created")) 6131 res.setCreatedElement(parseDateTime(json.get("created").getAsString())); 6132 if (json.has("_created")) 6133 parseElementProperties(getJObject(json, "_created"), res.getCreatedElement()); 6134 if (json.has("insurer")) 6135 res.setInsurer(parseReference(getJObject(json, "insurer"))); 6136 if (json.has("requestor")) 6137 res.setRequestor(parseReference(getJObject(json, "requestor"))); 6138 if (json.has("request")) 6139 res.setRequest(parseReference(getJObject(json, "request"))); 6140 if (json.has("outcome")) 6141 res.setOutcomeElement(parseEnumeration(json.get("outcome").getAsString(), ClaimResponse.RemittanceOutcome.NULL, 6142 new ClaimResponse.RemittanceOutcomeEnumFactory())); 6143 if (json.has("_outcome")) 6144 parseElementProperties(getJObject(json, "_outcome"), res.getOutcomeElement()); 6145 if (json.has("disposition")) 6146 res.setDispositionElement(parseString(json.get("disposition").getAsString())); 6147 if (json.has("_disposition")) 6148 parseElementProperties(getJObject(json, "_disposition"), res.getDispositionElement()); 6149 if (json.has("preAuthRef")) 6150 res.setPreAuthRefElement(parseString(json.get("preAuthRef").getAsString())); 6151 if (json.has("_preAuthRef")) 6152 parseElementProperties(getJObject(json, "_preAuthRef"), res.getPreAuthRefElement()); 6153 if (json.has("preAuthPeriod")) 6154 res.setPreAuthPeriod(parsePeriod(getJObject(json, "preAuthPeriod"))); 6155 if (json.has("payeeType")) 6156 res.setPayeeType(parseCodeableConcept(getJObject(json, "payeeType"))); 6157 if (json.has("item")) { 6158 JsonArray array = json.getAsJsonArray("item"); 6159 for (int i = 0; i < array.size(); i++) { 6160 res.getItem().add(parseClaimResponseItemComponent(array.get(i).getAsJsonObject(), res)); 6161 } 6162 } 6163 ; 6164 if (json.has("addItem")) { 6165 JsonArray array = json.getAsJsonArray("addItem"); 6166 for (int i = 0; i < array.size(); i++) { 6167 res.getAddItem().add(parseClaimResponseAddedItemComponent(array.get(i).getAsJsonObject(), res)); 6168 } 6169 } 6170 ; 6171 if (json.has("adjudication")) { 6172 JsonArray array = json.getAsJsonArray("adjudication"); 6173 for (int i = 0; i < array.size(); i++) { 6174 res.getAdjudication().add(parseClaimResponseAdjudicationComponent(array.get(i).getAsJsonObject(), res)); 6175 } 6176 } 6177 ; 6178 if (json.has("total")) { 6179 JsonArray array = json.getAsJsonArray("total"); 6180 for (int i = 0; i < array.size(); i++) { 6181 res.getTotal().add(parseClaimResponseTotalComponent(array.get(i).getAsJsonObject(), res)); 6182 } 6183 } 6184 ; 6185 if (json.has("payment")) 6186 res.setPayment(parseClaimResponsePaymentComponent(getJObject(json, "payment"), res)); 6187 if (json.has("fundsReserve")) 6188 res.setFundsReserve(parseCodeableConcept(getJObject(json, "fundsReserve"))); 6189 if (json.has("formCode")) 6190 res.setFormCode(parseCodeableConcept(getJObject(json, "formCode"))); 6191 if (json.has("form")) 6192 res.setForm(parseAttachment(getJObject(json, "form"))); 6193 if (json.has("processNote")) { 6194 JsonArray array = json.getAsJsonArray("processNote"); 6195 for (int i = 0; i < array.size(); i++) { 6196 res.getProcessNote().add(parseClaimResponseNoteComponent(array.get(i).getAsJsonObject(), res)); 6197 } 6198 } 6199 ; 6200 if (json.has("communicationRequest")) { 6201 JsonArray array = json.getAsJsonArray("communicationRequest"); 6202 for (int i = 0; i < array.size(); i++) { 6203 res.getCommunicationRequest().add(parseReference(array.get(i).getAsJsonObject())); 6204 } 6205 } 6206 ; 6207 if (json.has("insurance")) { 6208 JsonArray array = json.getAsJsonArray("insurance"); 6209 for (int i = 0; i < array.size(); i++) { 6210 res.getInsurance().add(parseClaimResponseInsuranceComponent(array.get(i).getAsJsonObject(), res)); 6211 } 6212 } 6213 ; 6214 if (json.has("error")) { 6215 JsonArray array = json.getAsJsonArray("error"); 6216 for (int i = 0; i < array.size(); i++) { 6217 res.getError().add(parseClaimResponseErrorComponent(array.get(i).getAsJsonObject(), res)); 6218 } 6219 } 6220 ; 6221 } 6222 6223 protected ClaimResponse.ItemComponent parseClaimResponseItemComponent(JsonObject json, ClaimResponse owner) 6224 throws IOException, FHIRFormatError { 6225 ClaimResponse.ItemComponent res = new ClaimResponse.ItemComponent(); 6226 parseClaimResponseItemComponentProperties(json, owner, res); 6227 return res; 6228 } 6229 6230 protected void parseClaimResponseItemComponentProperties(JsonObject json, ClaimResponse owner, 6231 ClaimResponse.ItemComponent res) throws IOException, FHIRFormatError { 6232 parseBackboneElementProperties(json, res); 6233 if (json.has("itemSequence")) 6234 res.setItemSequenceElement(parsePositiveInt(json.get("itemSequence").getAsString())); 6235 if (json.has("_itemSequence")) 6236 parseElementProperties(getJObject(json, "_itemSequence"), res.getItemSequenceElement()); 6237 if (json.has("noteNumber")) { 6238 JsonArray array = json.getAsJsonArray("noteNumber"); 6239 for (int i = 0; i < array.size(); i++) { 6240 if (array.get(i).isJsonNull()) { 6241 res.getNoteNumber().add(new PositiveIntType()); 6242 } else { 6243 res.getNoteNumber().add(parsePositiveInt(array.get(i).getAsString())); 6244 } 6245 } 6246 } 6247 ; 6248 if (json.has("_noteNumber")) { 6249 JsonArray array = json.getAsJsonArray("_noteNumber"); 6250 for (int i = 0; i < array.size(); i++) { 6251 if (i == res.getNoteNumber().size()) 6252 res.getNoteNumber().add(parsePositiveInt(null)); 6253 if (array.get(i) instanceof JsonObject) 6254 parseElementProperties(array.get(i).getAsJsonObject(), res.getNoteNumber().get(i)); 6255 } 6256 } 6257 ; 6258 if (json.has("adjudication")) { 6259 JsonArray array = json.getAsJsonArray("adjudication"); 6260 for (int i = 0; i < array.size(); i++) { 6261 res.getAdjudication().add(parseClaimResponseAdjudicationComponent(array.get(i).getAsJsonObject(), owner)); 6262 } 6263 } 6264 ; 6265 if (json.has("detail")) { 6266 JsonArray array = json.getAsJsonArray("detail"); 6267 for (int i = 0; i < array.size(); i++) { 6268 res.getDetail().add(parseClaimResponseItemDetailComponent(array.get(i).getAsJsonObject(), owner)); 6269 } 6270 } 6271 ; 6272 } 6273 6274 protected ClaimResponse.AdjudicationComponent parseClaimResponseAdjudicationComponent(JsonObject json, 6275 ClaimResponse owner) throws IOException, FHIRFormatError { 6276 ClaimResponse.AdjudicationComponent res = new ClaimResponse.AdjudicationComponent(); 6277 parseClaimResponseAdjudicationComponentProperties(json, owner, res); 6278 return res; 6279 } 6280 6281 protected void parseClaimResponseAdjudicationComponentProperties(JsonObject json, ClaimResponse owner, 6282 ClaimResponse.AdjudicationComponent res) throws IOException, FHIRFormatError { 6283 parseBackboneElementProperties(json, res); 6284 if (json.has("category")) 6285 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 6286 if (json.has("reason")) 6287 res.setReason(parseCodeableConcept(getJObject(json, "reason"))); 6288 if (json.has("amount")) 6289 res.setAmount(parseMoney(getJObject(json, "amount"))); 6290 if (json.has("value")) 6291 res.setValueElement(parseDecimal(json.get("value").getAsBigDecimal())); 6292 if (json.has("_value")) 6293 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 6294 } 6295 6296 protected ClaimResponse.ItemDetailComponent parseClaimResponseItemDetailComponent(JsonObject json, 6297 ClaimResponse owner) throws IOException, FHIRFormatError { 6298 ClaimResponse.ItemDetailComponent res = new ClaimResponse.ItemDetailComponent(); 6299 parseClaimResponseItemDetailComponentProperties(json, owner, res); 6300 return res; 6301 } 6302 6303 protected void parseClaimResponseItemDetailComponentProperties(JsonObject json, ClaimResponse owner, 6304 ClaimResponse.ItemDetailComponent res) throws IOException, FHIRFormatError { 6305 parseBackboneElementProperties(json, res); 6306 if (json.has("detailSequence")) 6307 res.setDetailSequenceElement(parsePositiveInt(json.get("detailSequence").getAsString())); 6308 if (json.has("_detailSequence")) 6309 parseElementProperties(getJObject(json, "_detailSequence"), res.getDetailSequenceElement()); 6310 if (json.has("noteNumber")) { 6311 JsonArray array = json.getAsJsonArray("noteNumber"); 6312 for (int i = 0; i < array.size(); i++) { 6313 if (array.get(i).isJsonNull()) { 6314 res.getNoteNumber().add(new PositiveIntType()); 6315 } else { 6316 res.getNoteNumber().add(parsePositiveInt(array.get(i).getAsString())); 6317 } 6318 } 6319 } 6320 ; 6321 if (json.has("_noteNumber")) { 6322 JsonArray array = json.getAsJsonArray("_noteNumber"); 6323 for (int i = 0; i < array.size(); i++) { 6324 if (i == res.getNoteNumber().size()) 6325 res.getNoteNumber().add(parsePositiveInt(null)); 6326 if (array.get(i) instanceof JsonObject) 6327 parseElementProperties(array.get(i).getAsJsonObject(), res.getNoteNumber().get(i)); 6328 } 6329 } 6330 ; 6331 if (json.has("adjudication")) { 6332 JsonArray array = json.getAsJsonArray("adjudication"); 6333 for (int i = 0; i < array.size(); i++) { 6334 res.getAdjudication().add(parseClaimResponseAdjudicationComponent(array.get(i).getAsJsonObject(), owner)); 6335 } 6336 } 6337 ; 6338 if (json.has("subDetail")) { 6339 JsonArray array = json.getAsJsonArray("subDetail"); 6340 for (int i = 0; i < array.size(); i++) { 6341 res.getSubDetail().add(parseClaimResponseSubDetailComponent(array.get(i).getAsJsonObject(), owner)); 6342 } 6343 } 6344 ; 6345 } 6346 6347 protected ClaimResponse.SubDetailComponent parseClaimResponseSubDetailComponent(JsonObject json, ClaimResponse owner) 6348 throws IOException, FHIRFormatError { 6349 ClaimResponse.SubDetailComponent res = new ClaimResponse.SubDetailComponent(); 6350 parseClaimResponseSubDetailComponentProperties(json, owner, res); 6351 return res; 6352 } 6353 6354 protected void parseClaimResponseSubDetailComponentProperties(JsonObject json, ClaimResponse owner, 6355 ClaimResponse.SubDetailComponent res) throws IOException, FHIRFormatError { 6356 parseBackboneElementProperties(json, res); 6357 if (json.has("subDetailSequence")) 6358 res.setSubDetailSequenceElement(parsePositiveInt(json.get("subDetailSequence").getAsString())); 6359 if (json.has("_subDetailSequence")) 6360 parseElementProperties(getJObject(json, "_subDetailSequence"), res.getSubDetailSequenceElement()); 6361 if (json.has("noteNumber")) { 6362 JsonArray array = json.getAsJsonArray("noteNumber"); 6363 for (int i = 0; i < array.size(); i++) { 6364 if (array.get(i).isJsonNull()) { 6365 res.getNoteNumber().add(new PositiveIntType()); 6366 } else { 6367 res.getNoteNumber().add(parsePositiveInt(array.get(i).getAsString())); 6368 } 6369 } 6370 } 6371 ; 6372 if (json.has("_noteNumber")) { 6373 JsonArray array = json.getAsJsonArray("_noteNumber"); 6374 for (int i = 0; i < array.size(); i++) { 6375 if (i == res.getNoteNumber().size()) 6376 res.getNoteNumber().add(parsePositiveInt(null)); 6377 if (array.get(i) instanceof JsonObject) 6378 parseElementProperties(array.get(i).getAsJsonObject(), res.getNoteNumber().get(i)); 6379 } 6380 } 6381 ; 6382 if (json.has("adjudication")) { 6383 JsonArray array = json.getAsJsonArray("adjudication"); 6384 for (int i = 0; i < array.size(); i++) { 6385 res.getAdjudication().add(parseClaimResponseAdjudicationComponent(array.get(i).getAsJsonObject(), owner)); 6386 } 6387 } 6388 ; 6389 } 6390 6391 protected ClaimResponse.AddedItemComponent parseClaimResponseAddedItemComponent(JsonObject json, ClaimResponse owner) 6392 throws IOException, FHIRFormatError { 6393 ClaimResponse.AddedItemComponent res = new ClaimResponse.AddedItemComponent(); 6394 parseClaimResponseAddedItemComponentProperties(json, owner, res); 6395 return res; 6396 } 6397 6398 protected void parseClaimResponseAddedItemComponentProperties(JsonObject json, ClaimResponse owner, 6399 ClaimResponse.AddedItemComponent res) throws IOException, FHIRFormatError { 6400 parseBackboneElementProperties(json, res); 6401 if (json.has("itemSequence")) { 6402 JsonArray array = json.getAsJsonArray("itemSequence"); 6403 for (int i = 0; i < array.size(); i++) { 6404 if (array.get(i).isJsonNull()) { 6405 res.getItemSequence().add(new PositiveIntType()); 6406 } else { 6407 res.getItemSequence().add(parsePositiveInt(array.get(i).getAsString())); 6408 } 6409 } 6410 } 6411 ; 6412 if (json.has("_itemSequence")) { 6413 JsonArray array = json.getAsJsonArray("_itemSequence"); 6414 for (int i = 0; i < array.size(); i++) { 6415 if (i == res.getItemSequence().size()) 6416 res.getItemSequence().add(parsePositiveInt(null)); 6417 if (array.get(i) instanceof JsonObject) 6418 parseElementProperties(array.get(i).getAsJsonObject(), res.getItemSequence().get(i)); 6419 } 6420 } 6421 ; 6422 if (json.has("detailSequence")) { 6423 JsonArray array = json.getAsJsonArray("detailSequence"); 6424 for (int i = 0; i < array.size(); i++) { 6425 if (array.get(i).isJsonNull()) { 6426 res.getDetailSequence().add(new PositiveIntType()); 6427 } else { 6428 res.getDetailSequence().add(parsePositiveInt(array.get(i).getAsString())); 6429 } 6430 } 6431 } 6432 ; 6433 if (json.has("_detailSequence")) { 6434 JsonArray array = json.getAsJsonArray("_detailSequence"); 6435 for (int i = 0; i < array.size(); i++) { 6436 if (i == res.getDetailSequence().size()) 6437 res.getDetailSequence().add(parsePositiveInt(null)); 6438 if (array.get(i) instanceof JsonObject) 6439 parseElementProperties(array.get(i).getAsJsonObject(), res.getDetailSequence().get(i)); 6440 } 6441 } 6442 ; 6443 if (json.has("subdetailSequence")) { 6444 JsonArray array = json.getAsJsonArray("subdetailSequence"); 6445 for (int i = 0; i < array.size(); i++) { 6446 if (array.get(i).isJsonNull()) { 6447 res.getSubdetailSequence().add(new PositiveIntType()); 6448 } else { 6449 res.getSubdetailSequence().add(parsePositiveInt(array.get(i).getAsString())); 6450 } 6451 } 6452 } 6453 ; 6454 if (json.has("_subdetailSequence")) { 6455 JsonArray array = json.getAsJsonArray("_subdetailSequence"); 6456 for (int i = 0; i < array.size(); i++) { 6457 if (i == res.getSubdetailSequence().size()) 6458 res.getSubdetailSequence().add(parsePositiveInt(null)); 6459 if (array.get(i) instanceof JsonObject) 6460 parseElementProperties(array.get(i).getAsJsonObject(), res.getSubdetailSequence().get(i)); 6461 } 6462 } 6463 ; 6464 if (json.has("provider")) { 6465 JsonArray array = json.getAsJsonArray("provider"); 6466 for (int i = 0; i < array.size(); i++) { 6467 res.getProvider().add(parseReference(array.get(i).getAsJsonObject())); 6468 } 6469 } 6470 ; 6471 if (json.has("productOrService")) 6472 res.setProductOrService(parseCodeableConcept(getJObject(json, "productOrService"))); 6473 if (json.has("modifier")) { 6474 JsonArray array = json.getAsJsonArray("modifier"); 6475 for (int i = 0; i < array.size(); i++) { 6476 res.getModifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 6477 } 6478 } 6479 ; 6480 if (json.has("programCode")) { 6481 JsonArray array = json.getAsJsonArray("programCode"); 6482 for (int i = 0; i < array.size(); i++) { 6483 res.getProgramCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 6484 } 6485 } 6486 ; 6487 Type serviced = parseType("serviced", json); 6488 if (serviced != null) 6489 res.setServiced(serviced); 6490 Type location = parseType("location", json); 6491 if (location != null) 6492 res.setLocation(location); 6493 if (json.has("quantity")) 6494 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 6495 if (json.has("unitPrice")) 6496 res.setUnitPrice(parseMoney(getJObject(json, "unitPrice"))); 6497 if (json.has("factor")) 6498 res.setFactorElement(parseDecimal(json.get("factor").getAsBigDecimal())); 6499 if (json.has("_factor")) 6500 parseElementProperties(getJObject(json, "_factor"), res.getFactorElement()); 6501 if (json.has("net")) 6502 res.setNet(parseMoney(getJObject(json, "net"))); 6503 if (json.has("bodySite")) 6504 res.setBodySite(parseCodeableConcept(getJObject(json, "bodySite"))); 6505 if (json.has("subSite")) { 6506 JsonArray array = json.getAsJsonArray("subSite"); 6507 for (int i = 0; i < array.size(); i++) { 6508 res.getSubSite().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 6509 } 6510 } 6511 ; 6512 if (json.has("noteNumber")) { 6513 JsonArray array = json.getAsJsonArray("noteNumber"); 6514 for (int i = 0; i < array.size(); i++) { 6515 if (array.get(i).isJsonNull()) { 6516 res.getNoteNumber().add(new PositiveIntType()); 6517 } else { 6518 res.getNoteNumber().add(parsePositiveInt(array.get(i).getAsString())); 6519 } 6520 } 6521 } 6522 ; 6523 if (json.has("_noteNumber")) { 6524 JsonArray array = json.getAsJsonArray("_noteNumber"); 6525 for (int i = 0; i < array.size(); i++) { 6526 if (i == res.getNoteNumber().size()) 6527 res.getNoteNumber().add(parsePositiveInt(null)); 6528 if (array.get(i) instanceof JsonObject) 6529 parseElementProperties(array.get(i).getAsJsonObject(), res.getNoteNumber().get(i)); 6530 } 6531 } 6532 ; 6533 if (json.has("adjudication")) { 6534 JsonArray array = json.getAsJsonArray("adjudication"); 6535 for (int i = 0; i < array.size(); i++) { 6536 res.getAdjudication().add(parseClaimResponseAdjudicationComponent(array.get(i).getAsJsonObject(), owner)); 6537 } 6538 } 6539 ; 6540 if (json.has("detail")) { 6541 JsonArray array = json.getAsJsonArray("detail"); 6542 for (int i = 0; i < array.size(); i++) { 6543 res.getDetail().add(parseClaimResponseAddedItemDetailComponent(array.get(i).getAsJsonObject(), owner)); 6544 } 6545 } 6546 ; 6547 } 6548 6549 protected ClaimResponse.AddedItemDetailComponent parseClaimResponseAddedItemDetailComponent(JsonObject json, 6550 ClaimResponse owner) throws IOException, FHIRFormatError { 6551 ClaimResponse.AddedItemDetailComponent res = new ClaimResponse.AddedItemDetailComponent(); 6552 parseClaimResponseAddedItemDetailComponentProperties(json, owner, res); 6553 return res; 6554 } 6555 6556 protected void parseClaimResponseAddedItemDetailComponentProperties(JsonObject json, ClaimResponse owner, 6557 ClaimResponse.AddedItemDetailComponent res) throws IOException, FHIRFormatError { 6558 parseBackboneElementProperties(json, res); 6559 if (json.has("productOrService")) 6560 res.setProductOrService(parseCodeableConcept(getJObject(json, "productOrService"))); 6561 if (json.has("modifier")) { 6562 JsonArray array = json.getAsJsonArray("modifier"); 6563 for (int i = 0; i < array.size(); i++) { 6564 res.getModifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 6565 } 6566 } 6567 ; 6568 if (json.has("quantity")) 6569 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 6570 if (json.has("unitPrice")) 6571 res.setUnitPrice(parseMoney(getJObject(json, "unitPrice"))); 6572 if (json.has("factor")) 6573 res.setFactorElement(parseDecimal(json.get("factor").getAsBigDecimal())); 6574 if (json.has("_factor")) 6575 parseElementProperties(getJObject(json, "_factor"), res.getFactorElement()); 6576 if (json.has("net")) 6577 res.setNet(parseMoney(getJObject(json, "net"))); 6578 if (json.has("noteNumber")) { 6579 JsonArray array = json.getAsJsonArray("noteNumber"); 6580 for (int i = 0; i < array.size(); i++) { 6581 if (array.get(i).isJsonNull()) { 6582 res.getNoteNumber().add(new PositiveIntType()); 6583 } else { 6584 res.getNoteNumber().add(parsePositiveInt(array.get(i).getAsString())); 6585 } 6586 } 6587 } 6588 ; 6589 if (json.has("_noteNumber")) { 6590 JsonArray array = json.getAsJsonArray("_noteNumber"); 6591 for (int i = 0; i < array.size(); i++) { 6592 if (i == res.getNoteNumber().size()) 6593 res.getNoteNumber().add(parsePositiveInt(null)); 6594 if (array.get(i) instanceof JsonObject) 6595 parseElementProperties(array.get(i).getAsJsonObject(), res.getNoteNumber().get(i)); 6596 } 6597 } 6598 ; 6599 if (json.has("adjudication")) { 6600 JsonArray array = json.getAsJsonArray("adjudication"); 6601 for (int i = 0; i < array.size(); i++) { 6602 res.getAdjudication().add(parseClaimResponseAdjudicationComponent(array.get(i).getAsJsonObject(), owner)); 6603 } 6604 } 6605 ; 6606 if (json.has("subDetail")) { 6607 JsonArray array = json.getAsJsonArray("subDetail"); 6608 for (int i = 0; i < array.size(); i++) { 6609 res.getSubDetail().add(parseClaimResponseAddedItemSubDetailComponent(array.get(i).getAsJsonObject(), owner)); 6610 } 6611 } 6612 ; 6613 } 6614 6615 protected ClaimResponse.AddedItemSubDetailComponent parseClaimResponseAddedItemSubDetailComponent(JsonObject json, 6616 ClaimResponse owner) throws IOException, FHIRFormatError { 6617 ClaimResponse.AddedItemSubDetailComponent res = new ClaimResponse.AddedItemSubDetailComponent(); 6618 parseClaimResponseAddedItemSubDetailComponentProperties(json, owner, res); 6619 return res; 6620 } 6621 6622 protected void parseClaimResponseAddedItemSubDetailComponentProperties(JsonObject json, ClaimResponse owner, 6623 ClaimResponse.AddedItemSubDetailComponent res) throws IOException, FHIRFormatError { 6624 parseBackboneElementProperties(json, res); 6625 if (json.has("productOrService")) 6626 res.setProductOrService(parseCodeableConcept(getJObject(json, "productOrService"))); 6627 if (json.has("modifier")) { 6628 JsonArray array = json.getAsJsonArray("modifier"); 6629 for (int i = 0; i < array.size(); i++) { 6630 res.getModifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 6631 } 6632 } 6633 ; 6634 if (json.has("quantity")) 6635 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 6636 if (json.has("unitPrice")) 6637 res.setUnitPrice(parseMoney(getJObject(json, "unitPrice"))); 6638 if (json.has("factor")) 6639 res.setFactorElement(parseDecimal(json.get("factor").getAsBigDecimal())); 6640 if (json.has("_factor")) 6641 parseElementProperties(getJObject(json, "_factor"), res.getFactorElement()); 6642 if (json.has("net")) 6643 res.setNet(parseMoney(getJObject(json, "net"))); 6644 if (json.has("noteNumber")) { 6645 JsonArray array = json.getAsJsonArray("noteNumber"); 6646 for (int i = 0; i < array.size(); i++) { 6647 if (array.get(i).isJsonNull()) { 6648 res.getNoteNumber().add(new PositiveIntType()); 6649 } else { 6650 res.getNoteNumber().add(parsePositiveInt(array.get(i).getAsString())); 6651 } 6652 } 6653 } 6654 ; 6655 if (json.has("_noteNumber")) { 6656 JsonArray array = json.getAsJsonArray("_noteNumber"); 6657 for (int i = 0; i < array.size(); i++) { 6658 if (i == res.getNoteNumber().size()) 6659 res.getNoteNumber().add(parsePositiveInt(null)); 6660 if (array.get(i) instanceof JsonObject) 6661 parseElementProperties(array.get(i).getAsJsonObject(), res.getNoteNumber().get(i)); 6662 } 6663 } 6664 ; 6665 if (json.has("adjudication")) { 6666 JsonArray array = json.getAsJsonArray("adjudication"); 6667 for (int i = 0; i < array.size(); i++) { 6668 res.getAdjudication().add(parseClaimResponseAdjudicationComponent(array.get(i).getAsJsonObject(), owner)); 6669 } 6670 } 6671 ; 6672 } 6673 6674 protected ClaimResponse.TotalComponent parseClaimResponseTotalComponent(JsonObject json, ClaimResponse owner) 6675 throws IOException, FHIRFormatError { 6676 ClaimResponse.TotalComponent res = new ClaimResponse.TotalComponent(); 6677 parseClaimResponseTotalComponentProperties(json, owner, res); 6678 return res; 6679 } 6680 6681 protected void parseClaimResponseTotalComponentProperties(JsonObject json, ClaimResponse owner, 6682 ClaimResponse.TotalComponent res) throws IOException, FHIRFormatError { 6683 parseBackboneElementProperties(json, res); 6684 if (json.has("category")) 6685 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 6686 if (json.has("amount")) 6687 res.setAmount(parseMoney(getJObject(json, "amount"))); 6688 } 6689 6690 protected ClaimResponse.PaymentComponent parseClaimResponsePaymentComponent(JsonObject json, ClaimResponse owner) 6691 throws IOException, FHIRFormatError { 6692 ClaimResponse.PaymentComponent res = new ClaimResponse.PaymentComponent(); 6693 parseClaimResponsePaymentComponentProperties(json, owner, res); 6694 return res; 6695 } 6696 6697 protected void parseClaimResponsePaymentComponentProperties(JsonObject json, ClaimResponse owner, 6698 ClaimResponse.PaymentComponent res) throws IOException, FHIRFormatError { 6699 parseBackboneElementProperties(json, res); 6700 if (json.has("type")) 6701 res.setType(parseCodeableConcept(getJObject(json, "type"))); 6702 if (json.has("adjustment")) 6703 res.setAdjustment(parseMoney(getJObject(json, "adjustment"))); 6704 if (json.has("adjustmentReason")) 6705 res.setAdjustmentReason(parseCodeableConcept(getJObject(json, "adjustmentReason"))); 6706 if (json.has("date")) 6707 res.setDateElement(parseDate(json.get("date").getAsString())); 6708 if (json.has("_date")) 6709 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 6710 if (json.has("amount")) 6711 res.setAmount(parseMoney(getJObject(json, "amount"))); 6712 if (json.has("identifier")) 6713 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 6714 } 6715 6716 protected ClaimResponse.NoteComponent parseClaimResponseNoteComponent(JsonObject json, ClaimResponse owner) 6717 throws IOException, FHIRFormatError { 6718 ClaimResponse.NoteComponent res = new ClaimResponse.NoteComponent(); 6719 parseClaimResponseNoteComponentProperties(json, owner, res); 6720 return res; 6721 } 6722 6723 protected void parseClaimResponseNoteComponentProperties(JsonObject json, ClaimResponse owner, 6724 ClaimResponse.NoteComponent res) throws IOException, FHIRFormatError { 6725 parseBackboneElementProperties(json, res); 6726 if (json.has("number")) 6727 res.setNumberElement(parsePositiveInt(json.get("number").getAsString())); 6728 if (json.has("_number")) 6729 parseElementProperties(getJObject(json, "_number"), res.getNumberElement()); 6730 if (json.has("type")) 6731 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), Enumerations.NoteType.NULL, 6732 new Enumerations.NoteTypeEnumFactory())); 6733 if (json.has("_type")) 6734 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 6735 if (json.has("text")) 6736 res.setTextElement(parseString(json.get("text").getAsString())); 6737 if (json.has("_text")) 6738 parseElementProperties(getJObject(json, "_text"), res.getTextElement()); 6739 if (json.has("language")) 6740 res.setLanguage(parseCodeableConcept(getJObject(json, "language"))); 6741 } 6742 6743 protected ClaimResponse.InsuranceComponent parseClaimResponseInsuranceComponent(JsonObject json, ClaimResponse owner) 6744 throws IOException, FHIRFormatError { 6745 ClaimResponse.InsuranceComponent res = new ClaimResponse.InsuranceComponent(); 6746 parseClaimResponseInsuranceComponentProperties(json, owner, res); 6747 return res; 6748 } 6749 6750 protected void parseClaimResponseInsuranceComponentProperties(JsonObject json, ClaimResponse owner, 6751 ClaimResponse.InsuranceComponent res) throws IOException, FHIRFormatError { 6752 parseBackboneElementProperties(json, res); 6753 if (json.has("sequence")) 6754 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 6755 if (json.has("_sequence")) 6756 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 6757 if (json.has("focal")) 6758 res.setFocalElement(parseBoolean(json.get("focal").getAsBoolean())); 6759 if (json.has("_focal")) 6760 parseElementProperties(getJObject(json, "_focal"), res.getFocalElement()); 6761 if (json.has("coverage")) 6762 res.setCoverage(parseReference(getJObject(json, "coverage"))); 6763 if (json.has("businessArrangement")) 6764 res.setBusinessArrangementElement(parseString(json.get("businessArrangement").getAsString())); 6765 if (json.has("_businessArrangement")) 6766 parseElementProperties(getJObject(json, "_businessArrangement"), res.getBusinessArrangementElement()); 6767 if (json.has("claimResponse")) 6768 res.setClaimResponse(parseReference(getJObject(json, "claimResponse"))); 6769 } 6770 6771 protected ClaimResponse.ErrorComponent parseClaimResponseErrorComponent(JsonObject json, ClaimResponse owner) 6772 throws IOException, FHIRFormatError { 6773 ClaimResponse.ErrorComponent res = new ClaimResponse.ErrorComponent(); 6774 parseClaimResponseErrorComponentProperties(json, owner, res); 6775 return res; 6776 } 6777 6778 protected void parseClaimResponseErrorComponentProperties(JsonObject json, ClaimResponse owner, 6779 ClaimResponse.ErrorComponent res) throws IOException, FHIRFormatError { 6780 parseBackboneElementProperties(json, res); 6781 if (json.has("itemSequence")) 6782 res.setItemSequenceElement(parsePositiveInt(json.get("itemSequence").getAsString())); 6783 if (json.has("_itemSequence")) 6784 parseElementProperties(getJObject(json, "_itemSequence"), res.getItemSequenceElement()); 6785 if (json.has("detailSequence")) 6786 res.setDetailSequenceElement(parsePositiveInt(json.get("detailSequence").getAsString())); 6787 if (json.has("_detailSequence")) 6788 parseElementProperties(getJObject(json, "_detailSequence"), res.getDetailSequenceElement()); 6789 if (json.has("subDetailSequence")) 6790 res.setSubDetailSequenceElement(parsePositiveInt(json.get("subDetailSequence").getAsString())); 6791 if (json.has("_subDetailSequence")) 6792 parseElementProperties(getJObject(json, "_subDetailSequence"), res.getSubDetailSequenceElement()); 6793 if (json.has("code")) 6794 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 6795 } 6796 6797 protected ClinicalImpression parseClinicalImpression(JsonObject json) throws IOException, FHIRFormatError { 6798 ClinicalImpression res = new ClinicalImpression(); 6799 parseClinicalImpressionProperties(json, res); 6800 return res; 6801 } 6802 6803 protected void parseClinicalImpressionProperties(JsonObject json, ClinicalImpression res) 6804 throws IOException, FHIRFormatError { 6805 parseDomainResourceProperties(json, res); 6806 if (json.has("identifier")) { 6807 JsonArray array = json.getAsJsonArray("identifier"); 6808 for (int i = 0; i < array.size(); i++) { 6809 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 6810 } 6811 } 6812 ; 6813 if (json.has("status")) 6814 res.setStatusElement( 6815 parseEnumeration(json.get("status").getAsString(), ClinicalImpression.ClinicalImpressionStatus.NULL, 6816 new ClinicalImpression.ClinicalImpressionStatusEnumFactory())); 6817 if (json.has("_status")) 6818 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 6819 if (json.has("statusReason")) 6820 res.setStatusReason(parseCodeableConcept(getJObject(json, "statusReason"))); 6821 if (json.has("code")) 6822 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 6823 if (json.has("description")) 6824 res.setDescriptionElement(parseString(json.get("description").getAsString())); 6825 if (json.has("_description")) 6826 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 6827 if (json.has("subject")) 6828 res.setSubject(parseReference(getJObject(json, "subject"))); 6829 if (json.has("encounter")) 6830 res.setEncounter(parseReference(getJObject(json, "encounter"))); 6831 Type effective = parseType("effective", json); 6832 if (effective != null) 6833 res.setEffective(effective); 6834 if (json.has("date")) 6835 res.setDateElement(parseDateTime(json.get("date").getAsString())); 6836 if (json.has("_date")) 6837 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 6838 if (json.has("assessor")) 6839 res.setAssessor(parseReference(getJObject(json, "assessor"))); 6840 if (json.has("previous")) 6841 res.setPrevious(parseReference(getJObject(json, "previous"))); 6842 if (json.has("problem")) { 6843 JsonArray array = json.getAsJsonArray("problem"); 6844 for (int i = 0; i < array.size(); i++) { 6845 res.getProblem().add(parseReference(array.get(i).getAsJsonObject())); 6846 } 6847 } 6848 ; 6849 if (json.has("investigation")) { 6850 JsonArray array = json.getAsJsonArray("investigation"); 6851 for (int i = 0; i < array.size(); i++) { 6852 res.getInvestigation() 6853 .add(parseClinicalImpressionClinicalImpressionInvestigationComponent(array.get(i).getAsJsonObject(), res)); 6854 } 6855 } 6856 ; 6857 if (json.has("protocol")) { 6858 JsonArray array = json.getAsJsonArray("protocol"); 6859 for (int i = 0; i < array.size(); i++) { 6860 if (array.get(i).isJsonNull()) { 6861 res.getProtocol().add(new UriType()); 6862 } else { 6863 res.getProtocol().add(parseUri(array.get(i).getAsString())); 6864 } 6865 } 6866 } 6867 ; 6868 if (json.has("_protocol")) { 6869 JsonArray array = json.getAsJsonArray("_protocol"); 6870 for (int i = 0; i < array.size(); i++) { 6871 if (i == res.getProtocol().size()) 6872 res.getProtocol().add(parseUri(null)); 6873 if (array.get(i) instanceof JsonObject) 6874 parseElementProperties(array.get(i).getAsJsonObject(), res.getProtocol().get(i)); 6875 } 6876 } 6877 ; 6878 if (json.has("summary")) 6879 res.setSummaryElement(parseString(json.get("summary").getAsString())); 6880 if (json.has("_summary")) 6881 parseElementProperties(getJObject(json, "_summary"), res.getSummaryElement()); 6882 if (json.has("finding")) { 6883 JsonArray array = json.getAsJsonArray("finding"); 6884 for (int i = 0; i < array.size(); i++) { 6885 res.getFinding() 6886 .add(parseClinicalImpressionClinicalImpressionFindingComponent(array.get(i).getAsJsonObject(), res)); 6887 } 6888 } 6889 ; 6890 if (json.has("prognosisCodeableConcept")) { 6891 JsonArray array = json.getAsJsonArray("prognosisCodeableConcept"); 6892 for (int i = 0; i < array.size(); i++) { 6893 res.getPrognosisCodeableConcept().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 6894 } 6895 } 6896 ; 6897 if (json.has("prognosisReference")) { 6898 JsonArray array = json.getAsJsonArray("prognosisReference"); 6899 for (int i = 0; i < array.size(); i++) { 6900 res.getPrognosisReference().add(parseReference(array.get(i).getAsJsonObject())); 6901 } 6902 } 6903 ; 6904 if (json.has("supportingInfo")) { 6905 JsonArray array = json.getAsJsonArray("supportingInfo"); 6906 for (int i = 0; i < array.size(); i++) { 6907 res.getSupportingInfo().add(parseReference(array.get(i).getAsJsonObject())); 6908 } 6909 } 6910 ; 6911 if (json.has("note")) { 6912 JsonArray array = json.getAsJsonArray("note"); 6913 for (int i = 0; i < array.size(); i++) { 6914 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 6915 } 6916 } 6917 ; 6918 } 6919 6920 protected ClinicalImpression.ClinicalImpressionInvestigationComponent parseClinicalImpressionClinicalImpressionInvestigationComponent( 6921 JsonObject json, ClinicalImpression owner) throws IOException, FHIRFormatError { 6922 ClinicalImpression.ClinicalImpressionInvestigationComponent res = new ClinicalImpression.ClinicalImpressionInvestigationComponent(); 6923 parseClinicalImpressionClinicalImpressionInvestigationComponentProperties(json, owner, res); 6924 return res; 6925 } 6926 6927 protected void parseClinicalImpressionClinicalImpressionInvestigationComponentProperties(JsonObject json, 6928 ClinicalImpression owner, ClinicalImpression.ClinicalImpressionInvestigationComponent res) 6929 throws IOException, FHIRFormatError { 6930 parseBackboneElementProperties(json, res); 6931 if (json.has("code")) 6932 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 6933 if (json.has("item")) { 6934 JsonArray array = json.getAsJsonArray("item"); 6935 for (int i = 0; i < array.size(); i++) { 6936 res.getItem().add(parseReference(array.get(i).getAsJsonObject())); 6937 } 6938 } 6939 ; 6940 } 6941 6942 protected ClinicalImpression.ClinicalImpressionFindingComponent parseClinicalImpressionClinicalImpressionFindingComponent( 6943 JsonObject json, ClinicalImpression owner) throws IOException, FHIRFormatError { 6944 ClinicalImpression.ClinicalImpressionFindingComponent res = new ClinicalImpression.ClinicalImpressionFindingComponent(); 6945 parseClinicalImpressionClinicalImpressionFindingComponentProperties(json, owner, res); 6946 return res; 6947 } 6948 6949 protected void parseClinicalImpressionClinicalImpressionFindingComponentProperties(JsonObject json, 6950 ClinicalImpression owner, ClinicalImpression.ClinicalImpressionFindingComponent res) 6951 throws IOException, FHIRFormatError { 6952 parseBackboneElementProperties(json, res); 6953 if (json.has("itemCodeableConcept")) 6954 res.setItemCodeableConcept(parseCodeableConcept(getJObject(json, "itemCodeableConcept"))); 6955 if (json.has("itemReference")) 6956 res.setItemReference(parseReference(getJObject(json, "itemReference"))); 6957 if (json.has("basis")) 6958 res.setBasisElement(parseString(json.get("basis").getAsString())); 6959 if (json.has("_basis")) 6960 parseElementProperties(getJObject(json, "_basis"), res.getBasisElement()); 6961 } 6962 6963 protected CodeSystem parseCodeSystem(JsonObject json) throws IOException, FHIRFormatError { 6964 CodeSystem res = new CodeSystem(); 6965 parseCodeSystemProperties(json, res); 6966 return res; 6967 } 6968 6969 protected void parseCodeSystemProperties(JsonObject json, CodeSystem res) throws IOException, FHIRFormatError { 6970 parseDomainResourceProperties(json, res); 6971 if (json.has("url")) 6972 res.setUrlElement(parseUri(json.get("url").getAsString())); 6973 if (json.has("_url")) 6974 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 6975 if (json.has("identifier")) { 6976 JsonArray array = json.getAsJsonArray("identifier"); 6977 for (int i = 0; i < array.size(); i++) { 6978 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 6979 } 6980 } 6981 ; 6982 if (json.has("version")) 6983 res.setVersionElement(parseString(json.get("version").getAsString())); 6984 if (json.has("_version")) 6985 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 6986 if (json.has("name")) 6987 res.setNameElement(parseString(json.get("name").getAsString())); 6988 if (json.has("_name")) 6989 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 6990 if (json.has("title")) 6991 res.setTitleElement(parseString(json.get("title").getAsString())); 6992 if (json.has("_title")) 6993 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 6994 if (json.has("status")) 6995 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 6996 new Enumerations.PublicationStatusEnumFactory())); 6997 if (json.has("_status")) 6998 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 6999 if (json.has("experimental")) 7000 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 7001 if (json.has("_experimental")) 7002 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 7003 if (json.has("date")) 7004 res.setDateElement(parseDateTime(json.get("date").getAsString())); 7005 if (json.has("_date")) 7006 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 7007 if (json.has("publisher")) 7008 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 7009 if (json.has("_publisher")) 7010 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 7011 if (json.has("contact")) { 7012 JsonArray array = json.getAsJsonArray("contact"); 7013 for (int i = 0; i < array.size(); i++) { 7014 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 7015 } 7016 } 7017 ; 7018 if (json.has("description")) 7019 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 7020 if (json.has("_description")) 7021 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 7022 if (json.has("useContext")) { 7023 JsonArray array = json.getAsJsonArray("useContext"); 7024 for (int i = 0; i < array.size(); i++) { 7025 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 7026 } 7027 } 7028 ; 7029 if (json.has("jurisdiction")) { 7030 JsonArray array = json.getAsJsonArray("jurisdiction"); 7031 for (int i = 0; i < array.size(); i++) { 7032 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 7033 } 7034 } 7035 ; 7036 if (json.has("purpose")) 7037 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 7038 if (json.has("_purpose")) 7039 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 7040 if (json.has("copyright")) 7041 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 7042 if (json.has("_copyright")) 7043 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 7044 if (json.has("caseSensitive")) 7045 res.setCaseSensitiveElement(parseBoolean(json.get("caseSensitive").getAsBoolean())); 7046 if (json.has("_caseSensitive")) 7047 parseElementProperties(getJObject(json, "_caseSensitive"), res.getCaseSensitiveElement()); 7048 if (json.has("valueSet")) 7049 res.setValueSetElement(parseCanonical(json.get("valueSet").getAsString())); 7050 if (json.has("_valueSet")) 7051 parseElementProperties(getJObject(json, "_valueSet"), res.getValueSetElement()); 7052 if (json.has("hierarchyMeaning")) 7053 res.setHierarchyMeaningElement(parseEnumeration(json.get("hierarchyMeaning").getAsString(), 7054 CodeSystem.CodeSystemHierarchyMeaning.NULL, new CodeSystem.CodeSystemHierarchyMeaningEnumFactory())); 7055 if (json.has("_hierarchyMeaning")) 7056 parseElementProperties(getJObject(json, "_hierarchyMeaning"), res.getHierarchyMeaningElement()); 7057 if (json.has("compositional")) 7058 res.setCompositionalElement(parseBoolean(json.get("compositional").getAsBoolean())); 7059 if (json.has("_compositional")) 7060 parseElementProperties(getJObject(json, "_compositional"), res.getCompositionalElement()); 7061 if (json.has("versionNeeded")) 7062 res.setVersionNeededElement(parseBoolean(json.get("versionNeeded").getAsBoolean())); 7063 if (json.has("_versionNeeded")) 7064 parseElementProperties(getJObject(json, "_versionNeeded"), res.getVersionNeededElement()); 7065 if (json.has("content")) 7066 res.setContentElement(parseEnumeration(json.get("content").getAsString(), CodeSystem.CodeSystemContentMode.NULL, 7067 new CodeSystem.CodeSystemContentModeEnumFactory())); 7068 if (json.has("_content")) 7069 parseElementProperties(getJObject(json, "_content"), res.getContentElement()); 7070 if (json.has("supplements")) 7071 res.setSupplementsElement(parseCanonical(json.get("supplements").getAsString())); 7072 if (json.has("_supplements")) 7073 parseElementProperties(getJObject(json, "_supplements"), res.getSupplementsElement()); 7074 if (json.has("count")) 7075 res.setCountElement(parseUnsignedInt(json.get("count").getAsString())); 7076 if (json.has("_count")) 7077 parseElementProperties(getJObject(json, "_count"), res.getCountElement()); 7078 if (json.has("filter")) { 7079 JsonArray array = json.getAsJsonArray("filter"); 7080 for (int i = 0; i < array.size(); i++) { 7081 res.getFilter().add(parseCodeSystemCodeSystemFilterComponent(array.get(i).getAsJsonObject(), res)); 7082 } 7083 } 7084 ; 7085 if (json.has("property")) { 7086 JsonArray array = json.getAsJsonArray("property"); 7087 for (int i = 0; i < array.size(); i++) { 7088 res.getProperty().add(parseCodeSystemPropertyComponent(array.get(i).getAsJsonObject(), res)); 7089 } 7090 } 7091 ; 7092 if (json.has("concept")) { 7093 JsonArray array = json.getAsJsonArray("concept"); 7094 for (int i = 0; i < array.size(); i++) { 7095 res.getConcept().add(parseCodeSystemConceptDefinitionComponent(array.get(i).getAsJsonObject(), res)); 7096 } 7097 } 7098 ; 7099 } 7100 7101 protected CodeSystem.CodeSystemFilterComponent parseCodeSystemCodeSystemFilterComponent(JsonObject json, 7102 CodeSystem owner) throws IOException, FHIRFormatError { 7103 CodeSystem.CodeSystemFilterComponent res = new CodeSystem.CodeSystemFilterComponent(); 7104 parseCodeSystemCodeSystemFilterComponentProperties(json, owner, res); 7105 return res; 7106 } 7107 7108 protected void parseCodeSystemCodeSystemFilterComponentProperties(JsonObject json, CodeSystem owner, 7109 CodeSystem.CodeSystemFilterComponent res) throws IOException, FHIRFormatError { 7110 parseBackboneElementProperties(json, res); 7111 if (json.has("code")) 7112 res.setCodeElement(parseCode(json.get("code").getAsString())); 7113 if (json.has("_code")) 7114 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 7115 if (json.has("description")) 7116 res.setDescriptionElement(parseString(json.get("description").getAsString())); 7117 if (json.has("_description")) 7118 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 7119 if (json.has("operator")) { 7120 JsonArray array = json.getAsJsonArray("operator"); 7121 for (int i = 0; i < array.size(); i++) { 7122 if (array.get(i).isJsonNull()) { 7123 res.getOperator().add(new Enumeration<CodeSystem.FilterOperator>()); 7124 } else { 7125 res.getOperator().add(parseEnumeration(array.get(i).getAsString(), CodeSystem.FilterOperator.NULL, 7126 new CodeSystem.FilterOperatorEnumFactory())); 7127 } 7128 } 7129 } 7130 ; 7131 if (json.has("_operator")) { 7132 JsonArray array = json.getAsJsonArray("_operator"); 7133 for (int i = 0; i < array.size(); i++) { 7134 if (i == res.getOperator().size()) 7135 res.getOperator() 7136 .add(parseEnumeration(null, CodeSystem.FilterOperator.NULL, new CodeSystem.FilterOperatorEnumFactory())); 7137 if (array.get(i) instanceof JsonObject) 7138 parseElementProperties(array.get(i).getAsJsonObject(), res.getOperator().get(i)); 7139 } 7140 } 7141 ; 7142 if (json.has("value")) 7143 res.setValueElement(parseString(json.get("value").getAsString())); 7144 if (json.has("_value")) 7145 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 7146 } 7147 7148 protected CodeSystem.PropertyComponent parseCodeSystemPropertyComponent(JsonObject json, CodeSystem owner) 7149 throws IOException, FHIRFormatError { 7150 CodeSystem.PropertyComponent res = new CodeSystem.PropertyComponent(); 7151 parseCodeSystemPropertyComponentProperties(json, owner, res); 7152 return res; 7153 } 7154 7155 protected void parseCodeSystemPropertyComponentProperties(JsonObject json, CodeSystem owner, 7156 CodeSystem.PropertyComponent res) throws IOException, FHIRFormatError { 7157 parseBackboneElementProperties(json, res); 7158 if (json.has("code")) 7159 res.setCodeElement(parseCode(json.get("code").getAsString())); 7160 if (json.has("_code")) 7161 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 7162 if (json.has("uri")) 7163 res.setUriElement(parseUri(json.get("uri").getAsString())); 7164 if (json.has("_uri")) 7165 parseElementProperties(getJObject(json, "_uri"), res.getUriElement()); 7166 if (json.has("description")) 7167 res.setDescriptionElement(parseString(json.get("description").getAsString())); 7168 if (json.has("_description")) 7169 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 7170 if (json.has("type")) 7171 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), CodeSystem.PropertyType.NULL, 7172 new CodeSystem.PropertyTypeEnumFactory())); 7173 if (json.has("_type")) 7174 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 7175 } 7176 7177 protected CodeSystem.ConceptDefinitionComponent parseCodeSystemConceptDefinitionComponent(JsonObject json, 7178 CodeSystem owner) throws IOException, FHIRFormatError { 7179 CodeSystem.ConceptDefinitionComponent res = new CodeSystem.ConceptDefinitionComponent(); 7180 parseCodeSystemConceptDefinitionComponentProperties(json, owner, res); 7181 return res; 7182 } 7183 7184 protected void parseCodeSystemConceptDefinitionComponentProperties(JsonObject json, CodeSystem owner, 7185 CodeSystem.ConceptDefinitionComponent res) throws IOException, FHIRFormatError { 7186 parseBackboneElementProperties(json, res); 7187 if (json.has("code")) 7188 res.setCodeElement(parseCode(json.get("code").getAsString())); 7189 if (json.has("_code")) 7190 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 7191 if (json.has("display")) 7192 res.setDisplayElement(parseString(json.get("display").getAsString())); 7193 if (json.has("_display")) 7194 parseElementProperties(getJObject(json, "_display"), res.getDisplayElement()); 7195 if (json.has("definition")) 7196 res.setDefinitionElement(parseString(json.get("definition").getAsString())); 7197 if (json.has("_definition")) 7198 parseElementProperties(getJObject(json, "_definition"), res.getDefinitionElement()); 7199 if (json.has("designation")) { 7200 JsonArray array = json.getAsJsonArray("designation"); 7201 for (int i = 0; i < array.size(); i++) { 7202 res.getDesignation() 7203 .add(parseCodeSystemConceptDefinitionDesignationComponent(array.get(i).getAsJsonObject(), owner)); 7204 } 7205 } 7206 ; 7207 if (json.has("property")) { 7208 JsonArray array = json.getAsJsonArray("property"); 7209 for (int i = 0; i < array.size(); i++) { 7210 res.getProperty().add(parseCodeSystemConceptPropertyComponent(array.get(i).getAsJsonObject(), owner)); 7211 } 7212 } 7213 ; 7214 if (json.has("concept")) { 7215 JsonArray array = json.getAsJsonArray("concept"); 7216 for (int i = 0; i < array.size(); i++) { 7217 res.getConcept().add(parseCodeSystemConceptDefinitionComponent(array.get(i).getAsJsonObject(), owner)); 7218 } 7219 } 7220 ; 7221 } 7222 7223 protected CodeSystem.ConceptDefinitionDesignationComponent parseCodeSystemConceptDefinitionDesignationComponent( 7224 JsonObject json, CodeSystem owner) throws IOException, FHIRFormatError { 7225 CodeSystem.ConceptDefinitionDesignationComponent res = new CodeSystem.ConceptDefinitionDesignationComponent(); 7226 parseCodeSystemConceptDefinitionDesignationComponentProperties(json, owner, res); 7227 return res; 7228 } 7229 7230 protected void parseCodeSystemConceptDefinitionDesignationComponentProperties(JsonObject json, CodeSystem owner, 7231 CodeSystem.ConceptDefinitionDesignationComponent res) throws IOException, FHIRFormatError { 7232 parseBackboneElementProperties(json, res); 7233 if (json.has("language")) 7234 res.setLanguageElement(parseCode(json.get("language").getAsString())); 7235 if (json.has("_language")) 7236 parseElementProperties(getJObject(json, "_language"), res.getLanguageElement()); 7237 if (json.has("use")) 7238 res.setUse(parseCoding(getJObject(json, "use"))); 7239 if (json.has("value")) 7240 res.setValueElement(parseString(json.get("value").getAsString())); 7241 if (json.has("_value")) 7242 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 7243 } 7244 7245 protected CodeSystem.ConceptPropertyComponent parseCodeSystemConceptPropertyComponent(JsonObject json, 7246 CodeSystem owner) throws IOException, FHIRFormatError { 7247 CodeSystem.ConceptPropertyComponent res = new CodeSystem.ConceptPropertyComponent(); 7248 parseCodeSystemConceptPropertyComponentProperties(json, owner, res); 7249 return res; 7250 } 7251 7252 protected void parseCodeSystemConceptPropertyComponentProperties(JsonObject json, CodeSystem owner, 7253 CodeSystem.ConceptPropertyComponent res) throws IOException, FHIRFormatError { 7254 parseBackboneElementProperties(json, res); 7255 if (json.has("code")) 7256 res.setCodeElement(parseCode(json.get("code").getAsString())); 7257 if (json.has("_code")) 7258 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 7259 Type value = parseType("value", json); 7260 if (value != null) 7261 res.setValue(value); 7262 } 7263 7264 protected Communication parseCommunication(JsonObject json) throws IOException, FHIRFormatError { 7265 Communication res = new Communication(); 7266 parseCommunicationProperties(json, res); 7267 return res; 7268 } 7269 7270 protected void parseCommunicationProperties(JsonObject json, Communication res) throws IOException, FHIRFormatError { 7271 parseDomainResourceProperties(json, res); 7272 if (json.has("identifier")) { 7273 JsonArray array = json.getAsJsonArray("identifier"); 7274 for (int i = 0; i < array.size(); i++) { 7275 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 7276 } 7277 } 7278 ; 7279 if (json.has("instantiatesCanonical")) { 7280 JsonArray array = json.getAsJsonArray("instantiatesCanonical"); 7281 for (int i = 0; i < array.size(); i++) { 7282 if (array.get(i).isJsonNull()) { 7283 res.getInstantiatesCanonical().add(new CanonicalType()); 7284 } else { 7285 res.getInstantiatesCanonical().add(parseCanonical(array.get(i).getAsString())); 7286 } 7287 } 7288 } 7289 ; 7290 if (json.has("_instantiatesCanonical")) { 7291 JsonArray array = json.getAsJsonArray("_instantiatesCanonical"); 7292 for (int i = 0; i < array.size(); i++) { 7293 if (i == res.getInstantiatesCanonical().size()) 7294 res.getInstantiatesCanonical().add(parseCanonical(null)); 7295 if (array.get(i) instanceof JsonObject) 7296 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesCanonical().get(i)); 7297 } 7298 } 7299 ; 7300 if (json.has("instantiatesUri")) { 7301 JsonArray array = json.getAsJsonArray("instantiatesUri"); 7302 for (int i = 0; i < array.size(); i++) { 7303 if (array.get(i).isJsonNull()) { 7304 res.getInstantiatesUri().add(new UriType()); 7305 } else { 7306 res.getInstantiatesUri().add(parseUri(array.get(i).getAsString())); 7307 } 7308 } 7309 } 7310 ; 7311 if (json.has("_instantiatesUri")) { 7312 JsonArray array = json.getAsJsonArray("_instantiatesUri"); 7313 for (int i = 0; i < array.size(); i++) { 7314 if (i == res.getInstantiatesUri().size()) 7315 res.getInstantiatesUri().add(parseUri(null)); 7316 if (array.get(i) instanceof JsonObject) 7317 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesUri().get(i)); 7318 } 7319 } 7320 ; 7321 if (json.has("basedOn")) { 7322 JsonArray array = json.getAsJsonArray("basedOn"); 7323 for (int i = 0; i < array.size(); i++) { 7324 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 7325 } 7326 } 7327 ; 7328 if (json.has("partOf")) { 7329 JsonArray array = json.getAsJsonArray("partOf"); 7330 for (int i = 0; i < array.size(); i++) { 7331 res.getPartOf().add(parseReference(array.get(i).getAsJsonObject())); 7332 } 7333 } 7334 ; 7335 if (json.has("inResponseTo")) { 7336 JsonArray array = json.getAsJsonArray("inResponseTo"); 7337 for (int i = 0; i < array.size(); i++) { 7338 res.getInResponseTo().add(parseReference(array.get(i).getAsJsonObject())); 7339 } 7340 } 7341 ; 7342 if (json.has("status")) 7343 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Communication.CommunicationStatus.NULL, 7344 new Communication.CommunicationStatusEnumFactory())); 7345 if (json.has("_status")) 7346 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 7347 if (json.has("statusReason")) 7348 res.setStatusReason(parseCodeableConcept(getJObject(json, "statusReason"))); 7349 if (json.has("category")) { 7350 JsonArray array = json.getAsJsonArray("category"); 7351 for (int i = 0; i < array.size(); i++) { 7352 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 7353 } 7354 } 7355 ; 7356 if (json.has("priority")) 7357 res.setPriorityElement(parseEnumeration(json.get("priority").getAsString(), 7358 Communication.CommunicationPriority.NULL, new Communication.CommunicationPriorityEnumFactory())); 7359 if (json.has("_priority")) 7360 parseElementProperties(getJObject(json, "_priority"), res.getPriorityElement()); 7361 if (json.has("medium")) { 7362 JsonArray array = json.getAsJsonArray("medium"); 7363 for (int i = 0; i < array.size(); i++) { 7364 res.getMedium().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 7365 } 7366 } 7367 ; 7368 if (json.has("subject")) 7369 res.setSubject(parseReference(getJObject(json, "subject"))); 7370 if (json.has("topic")) 7371 res.setTopic(parseCodeableConcept(getJObject(json, "topic"))); 7372 if (json.has("about")) { 7373 JsonArray array = json.getAsJsonArray("about"); 7374 for (int i = 0; i < array.size(); i++) { 7375 res.getAbout().add(parseReference(array.get(i).getAsJsonObject())); 7376 } 7377 } 7378 ; 7379 if (json.has("encounter")) 7380 res.setEncounter(parseReference(getJObject(json, "encounter"))); 7381 if (json.has("sent")) 7382 res.setSentElement(parseDateTime(json.get("sent").getAsString())); 7383 if (json.has("_sent")) 7384 parseElementProperties(getJObject(json, "_sent"), res.getSentElement()); 7385 if (json.has("received")) 7386 res.setReceivedElement(parseDateTime(json.get("received").getAsString())); 7387 if (json.has("_received")) 7388 parseElementProperties(getJObject(json, "_received"), res.getReceivedElement()); 7389 if (json.has("recipient")) { 7390 JsonArray array = json.getAsJsonArray("recipient"); 7391 for (int i = 0; i < array.size(); i++) { 7392 res.getRecipient().add(parseReference(array.get(i).getAsJsonObject())); 7393 } 7394 } 7395 ; 7396 if (json.has("sender")) 7397 res.setSender(parseReference(getJObject(json, "sender"))); 7398 if (json.has("reasonCode")) { 7399 JsonArray array = json.getAsJsonArray("reasonCode"); 7400 for (int i = 0; i < array.size(); i++) { 7401 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 7402 } 7403 } 7404 ; 7405 if (json.has("reasonReference")) { 7406 JsonArray array = json.getAsJsonArray("reasonReference"); 7407 for (int i = 0; i < array.size(); i++) { 7408 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 7409 } 7410 } 7411 ; 7412 if (json.has("payload")) { 7413 JsonArray array = json.getAsJsonArray("payload"); 7414 for (int i = 0; i < array.size(); i++) { 7415 res.getPayload().add(parseCommunicationCommunicationPayloadComponent(array.get(i).getAsJsonObject(), res)); 7416 } 7417 } 7418 ; 7419 if (json.has("note")) { 7420 JsonArray array = json.getAsJsonArray("note"); 7421 for (int i = 0; i < array.size(); i++) { 7422 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 7423 } 7424 } 7425 ; 7426 } 7427 7428 protected Communication.CommunicationPayloadComponent parseCommunicationCommunicationPayloadComponent(JsonObject json, 7429 Communication owner) throws IOException, FHIRFormatError { 7430 Communication.CommunicationPayloadComponent res = new Communication.CommunicationPayloadComponent(); 7431 parseCommunicationCommunicationPayloadComponentProperties(json, owner, res); 7432 return res; 7433 } 7434 7435 protected void parseCommunicationCommunicationPayloadComponentProperties(JsonObject json, Communication owner, 7436 Communication.CommunicationPayloadComponent res) throws IOException, FHIRFormatError { 7437 parseBackboneElementProperties(json, res); 7438 Type content = parseType("content", json); 7439 if (content != null) 7440 res.setContent(content); 7441 } 7442 7443 protected CommunicationRequest parseCommunicationRequest(JsonObject json) throws IOException, FHIRFormatError { 7444 CommunicationRequest res = new CommunicationRequest(); 7445 parseCommunicationRequestProperties(json, res); 7446 return res; 7447 } 7448 7449 protected void parseCommunicationRequestProperties(JsonObject json, CommunicationRequest res) 7450 throws IOException, FHIRFormatError { 7451 parseDomainResourceProperties(json, res); 7452 if (json.has("identifier")) { 7453 JsonArray array = json.getAsJsonArray("identifier"); 7454 for (int i = 0; i < array.size(); i++) { 7455 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 7456 } 7457 } 7458 ; 7459 if (json.has("basedOn")) { 7460 JsonArray array = json.getAsJsonArray("basedOn"); 7461 for (int i = 0; i < array.size(); i++) { 7462 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 7463 } 7464 } 7465 ; 7466 if (json.has("replaces")) { 7467 JsonArray array = json.getAsJsonArray("replaces"); 7468 for (int i = 0; i < array.size(); i++) { 7469 res.getReplaces().add(parseReference(array.get(i).getAsJsonObject())); 7470 } 7471 } 7472 ; 7473 if (json.has("groupIdentifier")) 7474 res.setGroupIdentifier(parseIdentifier(getJObject(json, "groupIdentifier"))); 7475 if (json.has("status")) 7476 res.setStatusElement( 7477 parseEnumeration(json.get("status").getAsString(), CommunicationRequest.CommunicationRequestStatus.NULL, 7478 new CommunicationRequest.CommunicationRequestStatusEnumFactory())); 7479 if (json.has("_status")) 7480 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 7481 if (json.has("statusReason")) 7482 res.setStatusReason(parseCodeableConcept(getJObject(json, "statusReason"))); 7483 if (json.has("category")) { 7484 JsonArray array = json.getAsJsonArray("category"); 7485 for (int i = 0; i < array.size(); i++) { 7486 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 7487 } 7488 } 7489 ; 7490 if (json.has("priority")) 7491 res.setPriorityElement( 7492 parseEnumeration(json.get("priority").getAsString(), CommunicationRequest.CommunicationPriority.NULL, 7493 new CommunicationRequest.CommunicationPriorityEnumFactory())); 7494 if (json.has("_priority")) 7495 parseElementProperties(getJObject(json, "_priority"), res.getPriorityElement()); 7496 if (json.has("doNotPerform")) 7497 res.setDoNotPerformElement(parseBoolean(json.get("doNotPerform").getAsBoolean())); 7498 if (json.has("_doNotPerform")) 7499 parseElementProperties(getJObject(json, "_doNotPerform"), res.getDoNotPerformElement()); 7500 if (json.has("medium")) { 7501 JsonArray array = json.getAsJsonArray("medium"); 7502 for (int i = 0; i < array.size(); i++) { 7503 res.getMedium().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 7504 } 7505 } 7506 ; 7507 if (json.has("subject")) 7508 res.setSubject(parseReference(getJObject(json, "subject"))); 7509 if (json.has("about")) { 7510 JsonArray array = json.getAsJsonArray("about"); 7511 for (int i = 0; i < array.size(); i++) { 7512 res.getAbout().add(parseReference(array.get(i).getAsJsonObject())); 7513 } 7514 } 7515 ; 7516 if (json.has("encounter")) 7517 res.setEncounter(parseReference(getJObject(json, "encounter"))); 7518 if (json.has("payload")) { 7519 JsonArray array = json.getAsJsonArray("payload"); 7520 for (int i = 0; i < array.size(); i++) { 7521 res.getPayload() 7522 .add(parseCommunicationRequestCommunicationRequestPayloadComponent(array.get(i).getAsJsonObject(), res)); 7523 } 7524 } 7525 ; 7526 Type occurrence = parseType("occurrence", json); 7527 if (occurrence != null) 7528 res.setOccurrence(occurrence); 7529 if (json.has("authoredOn")) 7530 res.setAuthoredOnElement(parseDateTime(json.get("authoredOn").getAsString())); 7531 if (json.has("_authoredOn")) 7532 parseElementProperties(getJObject(json, "_authoredOn"), res.getAuthoredOnElement()); 7533 if (json.has("requester")) 7534 res.setRequester(parseReference(getJObject(json, "requester"))); 7535 if (json.has("recipient")) { 7536 JsonArray array = json.getAsJsonArray("recipient"); 7537 for (int i = 0; i < array.size(); i++) { 7538 res.getRecipient().add(parseReference(array.get(i).getAsJsonObject())); 7539 } 7540 } 7541 ; 7542 if (json.has("sender")) 7543 res.setSender(parseReference(getJObject(json, "sender"))); 7544 if (json.has("reasonCode")) { 7545 JsonArray array = json.getAsJsonArray("reasonCode"); 7546 for (int i = 0; i < array.size(); i++) { 7547 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 7548 } 7549 } 7550 ; 7551 if (json.has("reasonReference")) { 7552 JsonArray array = json.getAsJsonArray("reasonReference"); 7553 for (int i = 0; i < array.size(); i++) { 7554 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 7555 } 7556 } 7557 ; 7558 if (json.has("note")) { 7559 JsonArray array = json.getAsJsonArray("note"); 7560 for (int i = 0; i < array.size(); i++) { 7561 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 7562 } 7563 } 7564 ; 7565 } 7566 7567 protected CommunicationRequest.CommunicationRequestPayloadComponent parseCommunicationRequestCommunicationRequestPayloadComponent( 7568 JsonObject json, CommunicationRequest owner) throws IOException, FHIRFormatError { 7569 CommunicationRequest.CommunicationRequestPayloadComponent res = new CommunicationRequest.CommunicationRequestPayloadComponent(); 7570 parseCommunicationRequestCommunicationRequestPayloadComponentProperties(json, owner, res); 7571 return res; 7572 } 7573 7574 protected void parseCommunicationRequestCommunicationRequestPayloadComponentProperties(JsonObject json, 7575 CommunicationRequest owner, CommunicationRequest.CommunicationRequestPayloadComponent res) 7576 throws IOException, FHIRFormatError { 7577 parseBackboneElementProperties(json, res); 7578 Type content = parseType("content", json); 7579 if (content != null) 7580 res.setContent(content); 7581 } 7582 7583 protected CompartmentDefinition parseCompartmentDefinition(JsonObject json) throws IOException, FHIRFormatError { 7584 CompartmentDefinition res = new CompartmentDefinition(); 7585 parseCompartmentDefinitionProperties(json, res); 7586 return res; 7587 } 7588 7589 protected void parseCompartmentDefinitionProperties(JsonObject json, CompartmentDefinition res) 7590 throws IOException, FHIRFormatError { 7591 parseDomainResourceProperties(json, res); 7592 if (json.has("url")) 7593 res.setUrlElement(parseUri(json.get("url").getAsString())); 7594 if (json.has("_url")) 7595 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 7596 if (json.has("version")) 7597 res.setVersionElement(parseString(json.get("version").getAsString())); 7598 if (json.has("_version")) 7599 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 7600 if (json.has("name")) 7601 res.setNameElement(parseString(json.get("name").getAsString())); 7602 if (json.has("_name")) 7603 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 7604 if (json.has("status")) 7605 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 7606 new Enumerations.PublicationStatusEnumFactory())); 7607 if (json.has("_status")) 7608 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 7609 if (json.has("experimental")) 7610 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 7611 if (json.has("_experimental")) 7612 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 7613 if (json.has("date")) 7614 res.setDateElement(parseDateTime(json.get("date").getAsString())); 7615 if (json.has("_date")) 7616 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 7617 if (json.has("publisher")) 7618 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 7619 if (json.has("_publisher")) 7620 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 7621 if (json.has("contact")) { 7622 JsonArray array = json.getAsJsonArray("contact"); 7623 for (int i = 0; i < array.size(); i++) { 7624 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 7625 } 7626 } 7627 ; 7628 if (json.has("description")) 7629 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 7630 if (json.has("_description")) 7631 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 7632 if (json.has("useContext")) { 7633 JsonArray array = json.getAsJsonArray("useContext"); 7634 for (int i = 0; i < array.size(); i++) { 7635 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 7636 } 7637 } 7638 ; 7639 if (json.has("purpose")) 7640 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 7641 if (json.has("_purpose")) 7642 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 7643 if (json.has("code")) 7644 res.setCodeElement(parseEnumeration(json.get("code").getAsString(), CompartmentDefinition.CompartmentType.NULL, 7645 new CompartmentDefinition.CompartmentTypeEnumFactory())); 7646 if (json.has("_code")) 7647 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 7648 if (json.has("search")) 7649 res.setSearchElement(parseBoolean(json.get("search").getAsBoolean())); 7650 if (json.has("_search")) 7651 parseElementProperties(getJObject(json, "_search"), res.getSearchElement()); 7652 if (json.has("resource")) { 7653 JsonArray array = json.getAsJsonArray("resource"); 7654 for (int i = 0; i < array.size(); i++) { 7655 res.getResource() 7656 .add(parseCompartmentDefinitionCompartmentDefinitionResourceComponent(array.get(i).getAsJsonObject(), res)); 7657 } 7658 } 7659 ; 7660 } 7661 7662 protected CompartmentDefinition.CompartmentDefinitionResourceComponent parseCompartmentDefinitionCompartmentDefinitionResourceComponent( 7663 JsonObject json, CompartmentDefinition owner) throws IOException, FHIRFormatError { 7664 CompartmentDefinition.CompartmentDefinitionResourceComponent res = new CompartmentDefinition.CompartmentDefinitionResourceComponent(); 7665 parseCompartmentDefinitionCompartmentDefinitionResourceComponentProperties(json, owner, res); 7666 return res; 7667 } 7668 7669 protected void parseCompartmentDefinitionCompartmentDefinitionResourceComponentProperties(JsonObject json, 7670 CompartmentDefinition owner, CompartmentDefinition.CompartmentDefinitionResourceComponent res) 7671 throws IOException, FHIRFormatError { 7672 parseBackboneElementProperties(json, res); 7673 if (json.has("code")) 7674 res.setCodeElement(parseCode(json.get("code").getAsString())); 7675 if (json.has("_code")) 7676 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 7677 if (json.has("param")) { 7678 JsonArray array = json.getAsJsonArray("param"); 7679 for (int i = 0; i < array.size(); i++) { 7680 if (array.get(i).isJsonNull()) { 7681 res.getParam().add(new StringType()); 7682 } else { 7683 res.getParam().add(parseString(array.get(i).getAsString())); 7684 } 7685 } 7686 } 7687 ; 7688 if (json.has("_param")) { 7689 JsonArray array = json.getAsJsonArray("_param"); 7690 for (int i = 0; i < array.size(); i++) { 7691 if (i == res.getParam().size()) 7692 res.getParam().add(parseString(null)); 7693 if (array.get(i) instanceof JsonObject) 7694 parseElementProperties(array.get(i).getAsJsonObject(), res.getParam().get(i)); 7695 } 7696 } 7697 ; 7698 if (json.has("documentation")) 7699 res.setDocumentationElement(parseString(json.get("documentation").getAsString())); 7700 if (json.has("_documentation")) 7701 parseElementProperties(getJObject(json, "_documentation"), res.getDocumentationElement()); 7702 } 7703 7704 protected Composition parseComposition(JsonObject json) throws IOException, FHIRFormatError { 7705 Composition res = new Composition(); 7706 parseCompositionProperties(json, res); 7707 return res; 7708 } 7709 7710 protected void parseCompositionProperties(JsonObject json, Composition res) throws IOException, FHIRFormatError { 7711 parseDomainResourceProperties(json, res); 7712 if (json.has("identifier")) 7713 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 7714 if (json.has("status")) 7715 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Composition.CompositionStatus.NULL, 7716 new Composition.CompositionStatusEnumFactory())); 7717 if (json.has("_status")) 7718 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 7719 if (json.has("type")) 7720 res.setType(parseCodeableConcept(getJObject(json, "type"))); 7721 if (json.has("category")) { 7722 JsonArray array = json.getAsJsonArray("category"); 7723 for (int i = 0; i < array.size(); i++) { 7724 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 7725 } 7726 } 7727 ; 7728 if (json.has("subject")) 7729 res.setSubject(parseReference(getJObject(json, "subject"))); 7730 if (json.has("encounter")) 7731 res.setEncounter(parseReference(getJObject(json, "encounter"))); 7732 if (json.has("date")) 7733 res.setDateElement(parseDateTime(json.get("date").getAsString())); 7734 if (json.has("_date")) 7735 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 7736 if (json.has("author")) { 7737 JsonArray array = json.getAsJsonArray("author"); 7738 for (int i = 0; i < array.size(); i++) { 7739 res.getAuthor().add(parseReference(array.get(i).getAsJsonObject())); 7740 } 7741 } 7742 ; 7743 if (json.has("title")) 7744 res.setTitleElement(parseString(json.get("title").getAsString())); 7745 if (json.has("_title")) 7746 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 7747 if (json.has("confidentiality")) 7748 res.setConfidentialityElement(parseEnumeration(json.get("confidentiality").getAsString(), 7749 Composition.DocumentConfidentiality.NULL, new Composition.DocumentConfidentialityEnumFactory())); 7750 if (json.has("_confidentiality")) 7751 parseElementProperties(getJObject(json, "_confidentiality"), res.getConfidentialityElement()); 7752 if (json.has("attester")) { 7753 JsonArray array = json.getAsJsonArray("attester"); 7754 for (int i = 0; i < array.size(); i++) { 7755 res.getAttester().add(parseCompositionCompositionAttesterComponent(array.get(i).getAsJsonObject(), res)); 7756 } 7757 } 7758 ; 7759 if (json.has("custodian")) 7760 res.setCustodian(parseReference(getJObject(json, "custodian"))); 7761 if (json.has("relatesTo")) { 7762 JsonArray array = json.getAsJsonArray("relatesTo"); 7763 for (int i = 0; i < array.size(); i++) { 7764 res.getRelatesTo().add(parseCompositionCompositionRelatesToComponent(array.get(i).getAsJsonObject(), res)); 7765 } 7766 } 7767 ; 7768 if (json.has("event")) { 7769 JsonArray array = json.getAsJsonArray("event"); 7770 for (int i = 0; i < array.size(); i++) { 7771 res.getEvent().add(parseCompositionCompositionEventComponent(array.get(i).getAsJsonObject(), res)); 7772 } 7773 } 7774 ; 7775 if (json.has("section")) { 7776 JsonArray array = json.getAsJsonArray("section"); 7777 for (int i = 0; i < array.size(); i++) { 7778 res.getSection().add(parseCompositionSectionComponent(array.get(i).getAsJsonObject(), res)); 7779 } 7780 } 7781 ; 7782 } 7783 7784 protected Composition.CompositionAttesterComponent parseCompositionCompositionAttesterComponent(JsonObject json, 7785 Composition owner) throws IOException, FHIRFormatError { 7786 Composition.CompositionAttesterComponent res = new Composition.CompositionAttesterComponent(); 7787 parseCompositionCompositionAttesterComponentProperties(json, owner, res); 7788 return res; 7789 } 7790 7791 protected void parseCompositionCompositionAttesterComponentProperties(JsonObject json, Composition owner, 7792 Composition.CompositionAttesterComponent res) throws IOException, FHIRFormatError { 7793 parseBackboneElementProperties(json, res); 7794 if (json.has("mode")) 7795 res.setModeElement(parseEnumeration(json.get("mode").getAsString(), Composition.CompositionAttestationMode.NULL, 7796 new Composition.CompositionAttestationModeEnumFactory())); 7797 if (json.has("_mode")) 7798 parseElementProperties(getJObject(json, "_mode"), res.getModeElement()); 7799 if (json.has("time")) 7800 res.setTimeElement(parseDateTime(json.get("time").getAsString())); 7801 if (json.has("_time")) 7802 parseElementProperties(getJObject(json, "_time"), res.getTimeElement()); 7803 if (json.has("party")) 7804 res.setParty(parseReference(getJObject(json, "party"))); 7805 } 7806 7807 protected Composition.CompositionRelatesToComponent parseCompositionCompositionRelatesToComponent(JsonObject json, 7808 Composition owner) throws IOException, FHIRFormatError { 7809 Composition.CompositionRelatesToComponent res = new Composition.CompositionRelatesToComponent(); 7810 parseCompositionCompositionRelatesToComponentProperties(json, owner, res); 7811 return res; 7812 } 7813 7814 protected void parseCompositionCompositionRelatesToComponentProperties(JsonObject json, Composition owner, 7815 Composition.CompositionRelatesToComponent res) throws IOException, FHIRFormatError { 7816 parseBackboneElementProperties(json, res); 7817 if (json.has("code")) 7818 res.setCodeElement(parseEnumeration(json.get("code").getAsString(), Composition.DocumentRelationshipType.NULL, 7819 new Composition.DocumentRelationshipTypeEnumFactory())); 7820 if (json.has("_code")) 7821 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 7822 Type target = parseType("target", json); 7823 if (target != null) 7824 res.setTarget(target); 7825 } 7826 7827 protected Composition.CompositionEventComponent parseCompositionCompositionEventComponent(JsonObject json, 7828 Composition owner) throws IOException, FHIRFormatError { 7829 Composition.CompositionEventComponent res = new Composition.CompositionEventComponent(); 7830 parseCompositionCompositionEventComponentProperties(json, owner, res); 7831 return res; 7832 } 7833 7834 protected void parseCompositionCompositionEventComponentProperties(JsonObject json, Composition owner, 7835 Composition.CompositionEventComponent res) throws IOException, FHIRFormatError { 7836 parseBackboneElementProperties(json, res); 7837 if (json.has("code")) { 7838 JsonArray array = json.getAsJsonArray("code"); 7839 for (int i = 0; i < array.size(); i++) { 7840 res.getCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 7841 } 7842 } 7843 ; 7844 if (json.has("period")) 7845 res.setPeriod(parsePeriod(getJObject(json, "period"))); 7846 if (json.has("detail")) { 7847 JsonArray array = json.getAsJsonArray("detail"); 7848 for (int i = 0; i < array.size(); i++) { 7849 res.getDetail().add(parseReference(array.get(i).getAsJsonObject())); 7850 } 7851 } 7852 ; 7853 } 7854 7855 protected Composition.SectionComponent parseCompositionSectionComponent(JsonObject json, Composition owner) 7856 throws IOException, FHIRFormatError { 7857 Composition.SectionComponent res = new Composition.SectionComponent(); 7858 parseCompositionSectionComponentProperties(json, owner, res); 7859 return res; 7860 } 7861 7862 protected void parseCompositionSectionComponentProperties(JsonObject json, Composition owner, 7863 Composition.SectionComponent res) throws IOException, FHIRFormatError { 7864 parseBackboneElementProperties(json, res); 7865 if (json.has("title")) 7866 res.setTitleElement(parseString(json.get("title").getAsString())); 7867 if (json.has("_title")) 7868 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 7869 if (json.has("code")) 7870 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 7871 if (json.has("author")) { 7872 JsonArray array = json.getAsJsonArray("author"); 7873 for (int i = 0; i < array.size(); i++) { 7874 res.getAuthor().add(parseReference(array.get(i).getAsJsonObject())); 7875 } 7876 } 7877 ; 7878 if (json.has("focus")) 7879 res.setFocus(parseReference(getJObject(json, "focus"))); 7880 if (json.has("text")) 7881 res.setText(parseNarrative(getJObject(json, "text"))); 7882 if (json.has("mode")) 7883 res.setModeElement(parseEnumeration(json.get("mode").getAsString(), Composition.SectionMode.NULL, 7884 new Composition.SectionModeEnumFactory())); 7885 if (json.has("_mode")) 7886 parseElementProperties(getJObject(json, "_mode"), res.getModeElement()); 7887 if (json.has("orderedBy")) 7888 res.setOrderedBy(parseCodeableConcept(getJObject(json, "orderedBy"))); 7889 if (json.has("entry")) { 7890 JsonArray array = json.getAsJsonArray("entry"); 7891 for (int i = 0; i < array.size(); i++) { 7892 res.getEntry().add(parseReference(array.get(i).getAsJsonObject())); 7893 } 7894 } 7895 ; 7896 if (json.has("emptyReason")) 7897 res.setEmptyReason(parseCodeableConcept(getJObject(json, "emptyReason"))); 7898 if (json.has("section")) { 7899 JsonArray array = json.getAsJsonArray("section"); 7900 for (int i = 0; i < array.size(); i++) { 7901 res.getSection().add(parseCompositionSectionComponent(array.get(i).getAsJsonObject(), owner)); 7902 } 7903 } 7904 ; 7905 } 7906 7907 protected ConceptMap parseConceptMap(JsonObject json) throws IOException, FHIRFormatError { 7908 ConceptMap res = new ConceptMap(); 7909 parseConceptMapProperties(json, res); 7910 return res; 7911 } 7912 7913 protected void parseConceptMapProperties(JsonObject json, ConceptMap res) throws IOException, FHIRFormatError { 7914 parseDomainResourceProperties(json, res); 7915 if (json.has("url")) 7916 res.setUrlElement(parseUri(json.get("url").getAsString())); 7917 if (json.has("_url")) 7918 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 7919 if (json.has("identifier")) 7920 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 7921 if (json.has("version")) 7922 res.setVersionElement(parseString(json.get("version").getAsString())); 7923 if (json.has("_version")) 7924 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 7925 if (json.has("name")) 7926 res.setNameElement(parseString(json.get("name").getAsString())); 7927 if (json.has("_name")) 7928 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 7929 if (json.has("title")) 7930 res.setTitleElement(parseString(json.get("title").getAsString())); 7931 if (json.has("_title")) 7932 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 7933 if (json.has("status")) 7934 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 7935 new Enumerations.PublicationStatusEnumFactory())); 7936 if (json.has("_status")) 7937 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 7938 if (json.has("experimental")) 7939 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 7940 if (json.has("_experimental")) 7941 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 7942 if (json.has("date")) 7943 res.setDateElement(parseDateTime(json.get("date").getAsString())); 7944 if (json.has("_date")) 7945 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 7946 if (json.has("publisher")) 7947 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 7948 if (json.has("_publisher")) 7949 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 7950 if (json.has("contact")) { 7951 JsonArray array = json.getAsJsonArray("contact"); 7952 for (int i = 0; i < array.size(); i++) { 7953 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 7954 } 7955 } 7956 ; 7957 if (json.has("description")) 7958 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 7959 if (json.has("_description")) 7960 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 7961 if (json.has("useContext")) { 7962 JsonArray array = json.getAsJsonArray("useContext"); 7963 for (int i = 0; i < array.size(); i++) { 7964 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 7965 } 7966 } 7967 ; 7968 if (json.has("jurisdiction")) { 7969 JsonArray array = json.getAsJsonArray("jurisdiction"); 7970 for (int i = 0; i < array.size(); i++) { 7971 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 7972 } 7973 } 7974 ; 7975 if (json.has("purpose")) 7976 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 7977 if (json.has("_purpose")) 7978 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 7979 if (json.has("copyright")) 7980 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 7981 if (json.has("_copyright")) 7982 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 7983 Type source = parseType("source", json); 7984 if (source != null) 7985 res.setSource(source); 7986 Type target = parseType("target", json); 7987 if (target != null) 7988 res.setTarget(target); 7989 if (json.has("group")) { 7990 JsonArray array = json.getAsJsonArray("group"); 7991 for (int i = 0; i < array.size(); i++) { 7992 res.getGroup().add(parseConceptMapConceptMapGroupComponent(array.get(i).getAsJsonObject(), res)); 7993 } 7994 } 7995 ; 7996 } 7997 7998 protected ConceptMap.ConceptMapGroupComponent parseConceptMapConceptMapGroupComponent(JsonObject json, 7999 ConceptMap owner) throws IOException, FHIRFormatError { 8000 ConceptMap.ConceptMapGroupComponent res = new ConceptMap.ConceptMapGroupComponent(); 8001 parseConceptMapConceptMapGroupComponentProperties(json, owner, res); 8002 return res; 8003 } 8004 8005 protected void parseConceptMapConceptMapGroupComponentProperties(JsonObject json, ConceptMap owner, 8006 ConceptMap.ConceptMapGroupComponent res) throws IOException, FHIRFormatError { 8007 parseBackboneElementProperties(json, res); 8008 if (json.has("source")) 8009 res.setSourceElement(parseUri(json.get("source").getAsString())); 8010 if (json.has("_source")) 8011 parseElementProperties(getJObject(json, "_source"), res.getSourceElement()); 8012 if (json.has("sourceVersion")) 8013 res.setSourceVersionElement(parseString(json.get("sourceVersion").getAsString())); 8014 if (json.has("_sourceVersion")) 8015 parseElementProperties(getJObject(json, "_sourceVersion"), res.getSourceVersionElement()); 8016 if (json.has("target")) 8017 res.setTargetElement(parseUri(json.get("target").getAsString())); 8018 if (json.has("_target")) 8019 parseElementProperties(getJObject(json, "_target"), res.getTargetElement()); 8020 if (json.has("targetVersion")) 8021 res.setTargetVersionElement(parseString(json.get("targetVersion").getAsString())); 8022 if (json.has("_targetVersion")) 8023 parseElementProperties(getJObject(json, "_targetVersion"), res.getTargetVersionElement()); 8024 if (json.has("element")) { 8025 JsonArray array = json.getAsJsonArray("element"); 8026 for (int i = 0; i < array.size(); i++) { 8027 res.getElement().add(parseConceptMapSourceElementComponent(array.get(i).getAsJsonObject(), owner)); 8028 } 8029 } 8030 ; 8031 if (json.has("unmapped")) 8032 res.setUnmapped(parseConceptMapConceptMapGroupUnmappedComponent(getJObject(json, "unmapped"), owner)); 8033 } 8034 8035 protected ConceptMap.SourceElementComponent parseConceptMapSourceElementComponent(JsonObject json, ConceptMap owner) 8036 throws IOException, FHIRFormatError { 8037 ConceptMap.SourceElementComponent res = new ConceptMap.SourceElementComponent(); 8038 parseConceptMapSourceElementComponentProperties(json, owner, res); 8039 return res; 8040 } 8041 8042 protected void parseConceptMapSourceElementComponentProperties(JsonObject json, ConceptMap owner, 8043 ConceptMap.SourceElementComponent res) throws IOException, FHIRFormatError { 8044 parseBackboneElementProperties(json, res); 8045 if (json.has("code")) 8046 res.setCodeElement(parseCode(json.get("code").getAsString())); 8047 if (json.has("_code")) 8048 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 8049 if (json.has("display")) 8050 res.setDisplayElement(parseString(json.get("display").getAsString())); 8051 if (json.has("_display")) 8052 parseElementProperties(getJObject(json, "_display"), res.getDisplayElement()); 8053 if (json.has("target")) { 8054 JsonArray array = json.getAsJsonArray("target"); 8055 for (int i = 0; i < array.size(); i++) { 8056 res.getTarget().add(parseConceptMapTargetElementComponent(array.get(i).getAsJsonObject(), owner)); 8057 } 8058 } 8059 ; 8060 } 8061 8062 protected ConceptMap.TargetElementComponent parseConceptMapTargetElementComponent(JsonObject json, ConceptMap owner) 8063 throws IOException, FHIRFormatError { 8064 ConceptMap.TargetElementComponent res = new ConceptMap.TargetElementComponent(); 8065 parseConceptMapTargetElementComponentProperties(json, owner, res); 8066 return res; 8067 } 8068 8069 protected void parseConceptMapTargetElementComponentProperties(JsonObject json, ConceptMap owner, 8070 ConceptMap.TargetElementComponent res) throws IOException, FHIRFormatError { 8071 parseBackboneElementProperties(json, res); 8072 if (json.has("code")) 8073 res.setCodeElement(parseCode(json.get("code").getAsString())); 8074 if (json.has("_code")) 8075 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 8076 if (json.has("display")) 8077 res.setDisplayElement(parseString(json.get("display").getAsString())); 8078 if (json.has("_display")) 8079 parseElementProperties(getJObject(json, "_display"), res.getDisplayElement()); 8080 if (json.has("equivalence")) 8081 res.setEquivalenceElement(parseEnumeration(json.get("equivalence").getAsString(), 8082 Enumerations.ConceptMapEquivalence.NULL, new Enumerations.ConceptMapEquivalenceEnumFactory())); 8083 if (json.has("_equivalence")) 8084 parseElementProperties(getJObject(json, "_equivalence"), res.getEquivalenceElement()); 8085 if (json.has("comment")) 8086 res.setCommentElement(parseString(json.get("comment").getAsString())); 8087 if (json.has("_comment")) 8088 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 8089 if (json.has("dependsOn")) { 8090 JsonArray array = json.getAsJsonArray("dependsOn"); 8091 for (int i = 0; i < array.size(); i++) { 8092 res.getDependsOn().add(parseConceptMapOtherElementComponent(array.get(i).getAsJsonObject(), owner)); 8093 } 8094 } 8095 ; 8096 if (json.has("product")) { 8097 JsonArray array = json.getAsJsonArray("product"); 8098 for (int i = 0; i < array.size(); i++) { 8099 res.getProduct().add(parseConceptMapOtherElementComponent(array.get(i).getAsJsonObject(), owner)); 8100 } 8101 } 8102 ; 8103 } 8104 8105 protected ConceptMap.OtherElementComponent parseConceptMapOtherElementComponent(JsonObject json, ConceptMap owner) 8106 throws IOException, FHIRFormatError { 8107 ConceptMap.OtherElementComponent res = new ConceptMap.OtherElementComponent(); 8108 parseConceptMapOtherElementComponentProperties(json, owner, res); 8109 return res; 8110 } 8111 8112 protected void parseConceptMapOtherElementComponentProperties(JsonObject json, ConceptMap owner, 8113 ConceptMap.OtherElementComponent res) throws IOException, FHIRFormatError { 8114 parseBackboneElementProperties(json, res); 8115 if (json.has("property")) 8116 res.setPropertyElement(parseUri(json.get("property").getAsString())); 8117 if (json.has("_property")) 8118 parseElementProperties(getJObject(json, "_property"), res.getPropertyElement()); 8119 if (json.has("system")) 8120 res.setSystemElement(parseCanonical(json.get("system").getAsString())); 8121 if (json.has("_system")) 8122 parseElementProperties(getJObject(json, "_system"), res.getSystemElement()); 8123 if (json.has("value")) 8124 res.setValueElement(parseString(json.get("value").getAsString())); 8125 if (json.has("_value")) 8126 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 8127 if (json.has("display")) 8128 res.setDisplayElement(parseString(json.get("display").getAsString())); 8129 if (json.has("_display")) 8130 parseElementProperties(getJObject(json, "_display"), res.getDisplayElement()); 8131 } 8132 8133 protected ConceptMap.ConceptMapGroupUnmappedComponent parseConceptMapConceptMapGroupUnmappedComponent(JsonObject json, 8134 ConceptMap owner) throws IOException, FHIRFormatError { 8135 ConceptMap.ConceptMapGroupUnmappedComponent res = new ConceptMap.ConceptMapGroupUnmappedComponent(); 8136 parseConceptMapConceptMapGroupUnmappedComponentProperties(json, owner, res); 8137 return res; 8138 } 8139 8140 protected void parseConceptMapConceptMapGroupUnmappedComponentProperties(JsonObject json, ConceptMap owner, 8141 ConceptMap.ConceptMapGroupUnmappedComponent res) throws IOException, FHIRFormatError { 8142 parseBackboneElementProperties(json, res); 8143 if (json.has("mode")) 8144 res.setModeElement(parseEnumeration(json.get("mode").getAsString(), ConceptMap.ConceptMapGroupUnmappedMode.NULL, 8145 new ConceptMap.ConceptMapGroupUnmappedModeEnumFactory())); 8146 if (json.has("_mode")) 8147 parseElementProperties(getJObject(json, "_mode"), res.getModeElement()); 8148 if (json.has("code")) 8149 res.setCodeElement(parseCode(json.get("code").getAsString())); 8150 if (json.has("_code")) 8151 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 8152 if (json.has("display")) 8153 res.setDisplayElement(parseString(json.get("display").getAsString())); 8154 if (json.has("_display")) 8155 parseElementProperties(getJObject(json, "_display"), res.getDisplayElement()); 8156 if (json.has("url")) 8157 res.setUrlElement(parseCanonical(json.get("url").getAsString())); 8158 if (json.has("_url")) 8159 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 8160 } 8161 8162 protected Condition parseCondition(JsonObject json) throws IOException, FHIRFormatError { 8163 Condition res = new Condition(); 8164 parseConditionProperties(json, res); 8165 return res; 8166 } 8167 8168 protected void parseConditionProperties(JsonObject json, Condition res) throws IOException, FHIRFormatError { 8169 parseDomainResourceProperties(json, res); 8170 if (json.has("identifier")) { 8171 JsonArray array = json.getAsJsonArray("identifier"); 8172 for (int i = 0; i < array.size(); i++) { 8173 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 8174 } 8175 } 8176 ; 8177 if (json.has("clinicalStatus")) 8178 res.setClinicalStatus(parseCodeableConcept(getJObject(json, "clinicalStatus"))); 8179 if (json.has("verificationStatus")) 8180 res.setVerificationStatus(parseCodeableConcept(getJObject(json, "verificationStatus"))); 8181 if (json.has("category")) { 8182 JsonArray array = json.getAsJsonArray("category"); 8183 for (int i = 0; i < array.size(); i++) { 8184 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 8185 } 8186 } 8187 ; 8188 if (json.has("severity")) 8189 res.setSeverity(parseCodeableConcept(getJObject(json, "severity"))); 8190 if (json.has("code")) 8191 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 8192 if (json.has("bodySite")) { 8193 JsonArray array = json.getAsJsonArray("bodySite"); 8194 for (int i = 0; i < array.size(); i++) { 8195 res.getBodySite().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 8196 } 8197 } 8198 ; 8199 if (json.has("subject")) 8200 res.setSubject(parseReference(getJObject(json, "subject"))); 8201 if (json.has("encounter")) 8202 res.setEncounter(parseReference(getJObject(json, "encounter"))); 8203 Type onset = parseType("onset", json); 8204 if (onset != null) 8205 res.setOnset(onset); 8206 Type abatement = parseType("abatement", json); 8207 if (abatement != null) 8208 res.setAbatement(abatement); 8209 if (json.has("recordedDate")) 8210 res.setRecordedDateElement(parseDateTime(json.get("recordedDate").getAsString())); 8211 if (json.has("_recordedDate")) 8212 parseElementProperties(getJObject(json, "_recordedDate"), res.getRecordedDateElement()); 8213 if (json.has("recorder")) 8214 res.setRecorder(parseReference(getJObject(json, "recorder"))); 8215 if (json.has("asserter")) 8216 res.setAsserter(parseReference(getJObject(json, "asserter"))); 8217 if (json.has("stage")) { 8218 JsonArray array = json.getAsJsonArray("stage"); 8219 for (int i = 0; i < array.size(); i++) { 8220 res.getStage().add(parseConditionConditionStageComponent(array.get(i).getAsJsonObject(), res)); 8221 } 8222 } 8223 ; 8224 if (json.has("evidence")) { 8225 JsonArray array = json.getAsJsonArray("evidence"); 8226 for (int i = 0; i < array.size(); i++) { 8227 res.getEvidence().add(parseConditionConditionEvidenceComponent(array.get(i).getAsJsonObject(), res)); 8228 } 8229 } 8230 ; 8231 if (json.has("note")) { 8232 JsonArray array = json.getAsJsonArray("note"); 8233 for (int i = 0; i < array.size(); i++) { 8234 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 8235 } 8236 } 8237 ; 8238 } 8239 8240 protected Condition.ConditionStageComponent parseConditionConditionStageComponent(JsonObject json, Condition owner) 8241 throws IOException, FHIRFormatError { 8242 Condition.ConditionStageComponent res = new Condition.ConditionStageComponent(); 8243 parseConditionConditionStageComponentProperties(json, owner, res); 8244 return res; 8245 } 8246 8247 protected void parseConditionConditionStageComponentProperties(JsonObject json, Condition owner, 8248 Condition.ConditionStageComponent res) throws IOException, FHIRFormatError { 8249 parseBackboneElementProperties(json, res); 8250 if (json.has("summary")) 8251 res.setSummary(parseCodeableConcept(getJObject(json, "summary"))); 8252 if (json.has("assessment")) { 8253 JsonArray array = json.getAsJsonArray("assessment"); 8254 for (int i = 0; i < array.size(); i++) { 8255 res.getAssessment().add(parseReference(array.get(i).getAsJsonObject())); 8256 } 8257 } 8258 ; 8259 if (json.has("type")) 8260 res.setType(parseCodeableConcept(getJObject(json, "type"))); 8261 } 8262 8263 protected Condition.ConditionEvidenceComponent parseConditionConditionEvidenceComponent(JsonObject json, 8264 Condition owner) throws IOException, FHIRFormatError { 8265 Condition.ConditionEvidenceComponent res = new Condition.ConditionEvidenceComponent(); 8266 parseConditionConditionEvidenceComponentProperties(json, owner, res); 8267 return res; 8268 } 8269 8270 protected void parseConditionConditionEvidenceComponentProperties(JsonObject json, Condition owner, 8271 Condition.ConditionEvidenceComponent res) throws IOException, FHIRFormatError { 8272 parseBackboneElementProperties(json, res); 8273 if (json.has("code")) { 8274 JsonArray array = json.getAsJsonArray("code"); 8275 for (int i = 0; i < array.size(); i++) { 8276 res.getCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 8277 } 8278 } 8279 ; 8280 if (json.has("detail")) { 8281 JsonArray array = json.getAsJsonArray("detail"); 8282 for (int i = 0; i < array.size(); i++) { 8283 res.getDetail().add(parseReference(array.get(i).getAsJsonObject())); 8284 } 8285 } 8286 ; 8287 } 8288 8289 protected Consent parseConsent(JsonObject json) throws IOException, FHIRFormatError { 8290 Consent res = new Consent(); 8291 parseConsentProperties(json, res); 8292 return res; 8293 } 8294 8295 protected void parseConsentProperties(JsonObject json, Consent res) throws IOException, FHIRFormatError { 8296 parseDomainResourceProperties(json, res); 8297 if (json.has("identifier")) { 8298 JsonArray array = json.getAsJsonArray("identifier"); 8299 for (int i = 0; i < array.size(); i++) { 8300 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 8301 } 8302 } 8303 ; 8304 if (json.has("status")) 8305 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Consent.ConsentState.NULL, 8306 new Consent.ConsentStateEnumFactory())); 8307 if (json.has("_status")) 8308 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 8309 if (json.has("scope")) 8310 res.setScope(parseCodeableConcept(getJObject(json, "scope"))); 8311 if (json.has("category")) { 8312 JsonArray array = json.getAsJsonArray("category"); 8313 for (int i = 0; i < array.size(); i++) { 8314 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 8315 } 8316 } 8317 ; 8318 if (json.has("patient")) 8319 res.setPatient(parseReference(getJObject(json, "patient"))); 8320 if (json.has("dateTime")) 8321 res.setDateTimeElement(parseDateTime(json.get("dateTime").getAsString())); 8322 if (json.has("_dateTime")) 8323 parseElementProperties(getJObject(json, "_dateTime"), res.getDateTimeElement()); 8324 if (json.has("performer")) { 8325 JsonArray array = json.getAsJsonArray("performer"); 8326 for (int i = 0; i < array.size(); i++) { 8327 res.getPerformer().add(parseReference(array.get(i).getAsJsonObject())); 8328 } 8329 } 8330 ; 8331 if (json.has("organization")) { 8332 JsonArray array = json.getAsJsonArray("organization"); 8333 for (int i = 0; i < array.size(); i++) { 8334 res.getOrganization().add(parseReference(array.get(i).getAsJsonObject())); 8335 } 8336 } 8337 ; 8338 Type source = parseType("source", json); 8339 if (source != null) 8340 res.setSource(source); 8341 if (json.has("policy")) { 8342 JsonArray array = json.getAsJsonArray("policy"); 8343 for (int i = 0; i < array.size(); i++) { 8344 res.getPolicy().add(parseConsentConsentPolicyComponent(array.get(i).getAsJsonObject(), res)); 8345 } 8346 } 8347 ; 8348 if (json.has("policyRule")) 8349 res.setPolicyRule(parseCodeableConcept(getJObject(json, "policyRule"))); 8350 if (json.has("verification")) { 8351 JsonArray array = json.getAsJsonArray("verification"); 8352 for (int i = 0; i < array.size(); i++) { 8353 res.getVerification().add(parseConsentConsentVerificationComponent(array.get(i).getAsJsonObject(), res)); 8354 } 8355 } 8356 ; 8357 if (json.has("provision")) 8358 res.setProvision(parseConsentprovisionComponent(getJObject(json, "provision"), res)); 8359 } 8360 8361 protected Consent.ConsentPolicyComponent parseConsentConsentPolicyComponent(JsonObject json, Consent owner) 8362 throws IOException, FHIRFormatError { 8363 Consent.ConsentPolicyComponent res = new Consent.ConsentPolicyComponent(); 8364 parseConsentConsentPolicyComponentProperties(json, owner, res); 8365 return res; 8366 } 8367 8368 protected void parseConsentConsentPolicyComponentProperties(JsonObject json, Consent owner, 8369 Consent.ConsentPolicyComponent res) throws IOException, FHIRFormatError { 8370 parseBackboneElementProperties(json, res); 8371 if (json.has("authority")) 8372 res.setAuthorityElement(parseUri(json.get("authority").getAsString())); 8373 if (json.has("_authority")) 8374 parseElementProperties(getJObject(json, "_authority"), res.getAuthorityElement()); 8375 if (json.has("uri")) 8376 res.setUriElement(parseUri(json.get("uri").getAsString())); 8377 if (json.has("_uri")) 8378 parseElementProperties(getJObject(json, "_uri"), res.getUriElement()); 8379 } 8380 8381 protected Consent.ConsentVerificationComponent parseConsentConsentVerificationComponent(JsonObject json, 8382 Consent owner) throws IOException, FHIRFormatError { 8383 Consent.ConsentVerificationComponent res = new Consent.ConsentVerificationComponent(); 8384 parseConsentConsentVerificationComponentProperties(json, owner, res); 8385 return res; 8386 } 8387 8388 protected void parseConsentConsentVerificationComponentProperties(JsonObject json, Consent owner, 8389 Consent.ConsentVerificationComponent res) throws IOException, FHIRFormatError { 8390 parseBackboneElementProperties(json, res); 8391 if (json.has("verified")) 8392 res.setVerifiedElement(parseBoolean(json.get("verified").getAsBoolean())); 8393 if (json.has("_verified")) 8394 parseElementProperties(getJObject(json, "_verified"), res.getVerifiedElement()); 8395 if (json.has("verifiedWith")) 8396 res.setVerifiedWith(parseReference(getJObject(json, "verifiedWith"))); 8397 if (json.has("verificationDate")) 8398 res.setVerificationDateElement(parseDateTime(json.get("verificationDate").getAsString())); 8399 if (json.has("_verificationDate")) 8400 parseElementProperties(getJObject(json, "_verificationDate"), res.getVerificationDateElement()); 8401 } 8402 8403 protected Consent.ProvisionComponent parseConsentprovisionComponent(JsonObject json, Consent owner) 8404 throws IOException, FHIRFormatError { 8405 Consent.ProvisionComponent res = new Consent.ProvisionComponent(); 8406 parseConsentprovisionComponentProperties(json, owner, res); 8407 return res; 8408 } 8409 8410 protected void parseConsentprovisionComponentProperties(JsonObject json, Consent owner, 8411 Consent.ProvisionComponent res) throws IOException, FHIRFormatError { 8412 parseBackboneElementProperties(json, res); 8413 if (json.has("type")) 8414 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), Consent.ConsentProvisionType.NULL, 8415 new Consent.ConsentProvisionTypeEnumFactory())); 8416 if (json.has("_type")) 8417 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 8418 if (json.has("period")) 8419 res.setPeriod(parsePeriod(getJObject(json, "period"))); 8420 if (json.has("actor")) { 8421 JsonArray array = json.getAsJsonArray("actor"); 8422 for (int i = 0; i < array.size(); i++) { 8423 res.getActor().add(parseConsentprovisionActorComponent(array.get(i).getAsJsonObject(), owner)); 8424 } 8425 } 8426 ; 8427 if (json.has("action")) { 8428 JsonArray array = json.getAsJsonArray("action"); 8429 for (int i = 0; i < array.size(); i++) { 8430 res.getAction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 8431 } 8432 } 8433 ; 8434 if (json.has("securityLabel")) { 8435 JsonArray array = json.getAsJsonArray("securityLabel"); 8436 for (int i = 0; i < array.size(); i++) { 8437 res.getSecurityLabel().add(parseCoding(array.get(i).getAsJsonObject())); 8438 } 8439 } 8440 ; 8441 if (json.has("purpose")) { 8442 JsonArray array = json.getAsJsonArray("purpose"); 8443 for (int i = 0; i < array.size(); i++) { 8444 res.getPurpose().add(parseCoding(array.get(i).getAsJsonObject())); 8445 } 8446 } 8447 ; 8448 if (json.has("class")) { 8449 JsonArray array = json.getAsJsonArray("class"); 8450 for (int i = 0; i < array.size(); i++) { 8451 res.getClass_().add(parseCoding(array.get(i).getAsJsonObject())); 8452 } 8453 } 8454 ; 8455 if (json.has("code")) { 8456 JsonArray array = json.getAsJsonArray("code"); 8457 for (int i = 0; i < array.size(); i++) { 8458 res.getCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 8459 } 8460 } 8461 ; 8462 if (json.has("dataPeriod")) 8463 res.setDataPeriod(parsePeriod(getJObject(json, "dataPeriod"))); 8464 if (json.has("data")) { 8465 JsonArray array = json.getAsJsonArray("data"); 8466 for (int i = 0; i < array.size(); i++) { 8467 res.getData().add(parseConsentprovisionDataComponent(array.get(i).getAsJsonObject(), owner)); 8468 } 8469 } 8470 ; 8471 if (json.has("provision")) { 8472 JsonArray array = json.getAsJsonArray("provision"); 8473 for (int i = 0; i < array.size(); i++) { 8474 res.getProvision().add(parseConsentprovisionComponent(array.get(i).getAsJsonObject(), owner)); 8475 } 8476 } 8477 ; 8478 } 8479 8480 protected Consent.provisionActorComponent parseConsentprovisionActorComponent(JsonObject json, Consent owner) 8481 throws IOException, FHIRFormatError { 8482 Consent.provisionActorComponent res = new Consent.provisionActorComponent(); 8483 parseConsentprovisionActorComponentProperties(json, owner, res); 8484 return res; 8485 } 8486 8487 protected void parseConsentprovisionActorComponentProperties(JsonObject json, Consent owner, 8488 Consent.provisionActorComponent res) throws IOException, FHIRFormatError { 8489 parseBackboneElementProperties(json, res); 8490 if (json.has("role")) 8491 res.setRole(parseCodeableConcept(getJObject(json, "role"))); 8492 if (json.has("reference")) 8493 res.setReference(parseReference(getJObject(json, "reference"))); 8494 } 8495 8496 protected Consent.provisionDataComponent parseConsentprovisionDataComponent(JsonObject json, Consent owner) 8497 throws IOException, FHIRFormatError { 8498 Consent.provisionDataComponent res = new Consent.provisionDataComponent(); 8499 parseConsentprovisionDataComponentProperties(json, owner, res); 8500 return res; 8501 } 8502 8503 protected void parseConsentprovisionDataComponentProperties(JsonObject json, Consent owner, 8504 Consent.provisionDataComponent res) throws IOException, FHIRFormatError { 8505 parseBackboneElementProperties(json, res); 8506 if (json.has("meaning")) 8507 res.setMeaningElement(parseEnumeration(json.get("meaning").getAsString(), Consent.ConsentDataMeaning.NULL, 8508 new Consent.ConsentDataMeaningEnumFactory())); 8509 if (json.has("_meaning")) 8510 parseElementProperties(getJObject(json, "_meaning"), res.getMeaningElement()); 8511 if (json.has("reference")) 8512 res.setReference(parseReference(getJObject(json, "reference"))); 8513 } 8514 8515 protected Contract parseContract(JsonObject json) throws IOException, FHIRFormatError { 8516 Contract res = new Contract(); 8517 parseContractProperties(json, res); 8518 return res; 8519 } 8520 8521 protected void parseContractProperties(JsonObject json, Contract res) throws IOException, FHIRFormatError { 8522 parseDomainResourceProperties(json, res); 8523 if (json.has("identifier")) { 8524 JsonArray array = json.getAsJsonArray("identifier"); 8525 for (int i = 0; i < array.size(); i++) { 8526 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 8527 } 8528 } 8529 ; 8530 if (json.has("url")) 8531 res.setUrlElement(parseUri(json.get("url").getAsString())); 8532 if (json.has("_url")) 8533 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 8534 if (json.has("version")) 8535 res.setVersionElement(parseString(json.get("version").getAsString())); 8536 if (json.has("_version")) 8537 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 8538 if (json.has("status")) 8539 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Contract.ContractStatus.NULL, 8540 new Contract.ContractStatusEnumFactory())); 8541 if (json.has("_status")) 8542 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 8543 if (json.has("legalState")) 8544 res.setLegalState(parseCodeableConcept(getJObject(json, "legalState"))); 8545 if (json.has("instantiatesCanonical")) 8546 res.setInstantiatesCanonical(parseReference(getJObject(json, "instantiatesCanonical"))); 8547 if (json.has("instantiatesUri")) 8548 res.setInstantiatesUriElement(parseUri(json.get("instantiatesUri").getAsString())); 8549 if (json.has("_instantiatesUri")) 8550 parseElementProperties(getJObject(json, "_instantiatesUri"), res.getInstantiatesUriElement()); 8551 if (json.has("contentDerivative")) 8552 res.setContentDerivative(parseCodeableConcept(getJObject(json, "contentDerivative"))); 8553 if (json.has("issued")) 8554 res.setIssuedElement(parseDateTime(json.get("issued").getAsString())); 8555 if (json.has("_issued")) 8556 parseElementProperties(getJObject(json, "_issued"), res.getIssuedElement()); 8557 if (json.has("applies")) 8558 res.setApplies(parsePeriod(getJObject(json, "applies"))); 8559 if (json.has("expirationType")) 8560 res.setExpirationType(parseCodeableConcept(getJObject(json, "expirationType"))); 8561 if (json.has("subject")) { 8562 JsonArray array = json.getAsJsonArray("subject"); 8563 for (int i = 0; i < array.size(); i++) { 8564 res.getSubject().add(parseReference(array.get(i).getAsJsonObject())); 8565 } 8566 } 8567 ; 8568 if (json.has("authority")) { 8569 JsonArray array = json.getAsJsonArray("authority"); 8570 for (int i = 0; i < array.size(); i++) { 8571 res.getAuthority().add(parseReference(array.get(i).getAsJsonObject())); 8572 } 8573 } 8574 ; 8575 if (json.has("domain")) { 8576 JsonArray array = json.getAsJsonArray("domain"); 8577 for (int i = 0; i < array.size(); i++) { 8578 res.getDomain().add(parseReference(array.get(i).getAsJsonObject())); 8579 } 8580 } 8581 ; 8582 if (json.has("site")) { 8583 JsonArray array = json.getAsJsonArray("site"); 8584 for (int i = 0; i < array.size(); i++) { 8585 res.getSite().add(parseReference(array.get(i).getAsJsonObject())); 8586 } 8587 } 8588 ; 8589 if (json.has("name")) 8590 res.setNameElement(parseString(json.get("name").getAsString())); 8591 if (json.has("_name")) 8592 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 8593 if (json.has("title")) 8594 res.setTitleElement(parseString(json.get("title").getAsString())); 8595 if (json.has("_title")) 8596 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 8597 if (json.has("subtitle")) 8598 res.setSubtitleElement(parseString(json.get("subtitle").getAsString())); 8599 if (json.has("_subtitle")) 8600 parseElementProperties(getJObject(json, "_subtitle"), res.getSubtitleElement()); 8601 if (json.has("alias")) { 8602 JsonArray array = json.getAsJsonArray("alias"); 8603 for (int i = 0; i < array.size(); i++) { 8604 if (array.get(i).isJsonNull()) { 8605 res.getAlias().add(new StringType()); 8606 } else { 8607 res.getAlias().add(parseString(array.get(i).getAsString())); 8608 } 8609 } 8610 } 8611 ; 8612 if (json.has("_alias")) { 8613 JsonArray array = json.getAsJsonArray("_alias"); 8614 for (int i = 0; i < array.size(); i++) { 8615 if (i == res.getAlias().size()) 8616 res.getAlias().add(parseString(null)); 8617 if (array.get(i) instanceof JsonObject) 8618 parseElementProperties(array.get(i).getAsJsonObject(), res.getAlias().get(i)); 8619 } 8620 } 8621 ; 8622 if (json.has("author")) 8623 res.setAuthor(parseReference(getJObject(json, "author"))); 8624 if (json.has("scope")) 8625 res.setScope(parseCodeableConcept(getJObject(json, "scope"))); 8626 Type topic = parseType("topic", json); 8627 if (topic != null) 8628 res.setTopic(topic); 8629 if (json.has("type")) 8630 res.setType(parseCodeableConcept(getJObject(json, "type"))); 8631 if (json.has("subType")) { 8632 JsonArray array = json.getAsJsonArray("subType"); 8633 for (int i = 0; i < array.size(); i++) { 8634 res.getSubType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 8635 } 8636 } 8637 ; 8638 if (json.has("contentDefinition")) 8639 res.setContentDefinition(parseContractContentDefinitionComponent(getJObject(json, "contentDefinition"), res)); 8640 if (json.has("term")) { 8641 JsonArray array = json.getAsJsonArray("term"); 8642 for (int i = 0; i < array.size(); i++) { 8643 res.getTerm().add(parseContractTermComponent(array.get(i).getAsJsonObject(), res)); 8644 } 8645 } 8646 ; 8647 if (json.has("supportingInfo")) { 8648 JsonArray array = json.getAsJsonArray("supportingInfo"); 8649 for (int i = 0; i < array.size(); i++) { 8650 res.getSupportingInfo().add(parseReference(array.get(i).getAsJsonObject())); 8651 } 8652 } 8653 ; 8654 if (json.has("relevantHistory")) { 8655 JsonArray array = json.getAsJsonArray("relevantHistory"); 8656 for (int i = 0; i < array.size(); i++) { 8657 res.getRelevantHistory().add(parseReference(array.get(i).getAsJsonObject())); 8658 } 8659 } 8660 ; 8661 if (json.has("signer")) { 8662 JsonArray array = json.getAsJsonArray("signer"); 8663 for (int i = 0; i < array.size(); i++) { 8664 res.getSigner().add(parseContractSignatoryComponent(array.get(i).getAsJsonObject(), res)); 8665 } 8666 } 8667 ; 8668 if (json.has("friendly")) { 8669 JsonArray array = json.getAsJsonArray("friendly"); 8670 for (int i = 0; i < array.size(); i++) { 8671 res.getFriendly().add(parseContractFriendlyLanguageComponent(array.get(i).getAsJsonObject(), res)); 8672 } 8673 } 8674 ; 8675 if (json.has("legal")) { 8676 JsonArray array = json.getAsJsonArray("legal"); 8677 for (int i = 0; i < array.size(); i++) { 8678 res.getLegal().add(parseContractLegalLanguageComponent(array.get(i).getAsJsonObject(), res)); 8679 } 8680 } 8681 ; 8682 if (json.has("rule")) { 8683 JsonArray array = json.getAsJsonArray("rule"); 8684 for (int i = 0; i < array.size(); i++) { 8685 res.getRule().add(parseContractComputableLanguageComponent(array.get(i).getAsJsonObject(), res)); 8686 } 8687 } 8688 ; 8689 Type legallyBinding = parseType("legallyBinding", json); 8690 if (legallyBinding != null) 8691 res.setLegallyBinding(legallyBinding); 8692 } 8693 8694 protected Contract.ContentDefinitionComponent parseContractContentDefinitionComponent(JsonObject json, Contract owner) 8695 throws IOException, FHIRFormatError { 8696 Contract.ContentDefinitionComponent res = new Contract.ContentDefinitionComponent(); 8697 parseContractContentDefinitionComponentProperties(json, owner, res); 8698 return res; 8699 } 8700 8701 protected void parseContractContentDefinitionComponentProperties(JsonObject json, Contract owner, 8702 Contract.ContentDefinitionComponent res) throws IOException, FHIRFormatError { 8703 parseBackboneElementProperties(json, res); 8704 if (json.has("type")) 8705 res.setType(parseCodeableConcept(getJObject(json, "type"))); 8706 if (json.has("subType")) 8707 res.setSubType(parseCodeableConcept(getJObject(json, "subType"))); 8708 if (json.has("publisher")) 8709 res.setPublisher(parseReference(getJObject(json, "publisher"))); 8710 if (json.has("publicationDate")) 8711 res.setPublicationDateElement(parseDateTime(json.get("publicationDate").getAsString())); 8712 if (json.has("_publicationDate")) 8713 parseElementProperties(getJObject(json, "_publicationDate"), res.getPublicationDateElement()); 8714 if (json.has("publicationStatus")) 8715 res.setPublicationStatusElement(parseEnumeration(json.get("publicationStatus").getAsString(), 8716 Contract.ContractPublicationStatus.NULL, new Contract.ContractPublicationStatusEnumFactory())); 8717 if (json.has("_publicationStatus")) 8718 parseElementProperties(getJObject(json, "_publicationStatus"), res.getPublicationStatusElement()); 8719 if (json.has("copyright")) 8720 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 8721 if (json.has("_copyright")) 8722 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 8723 } 8724 8725 protected Contract.TermComponent parseContractTermComponent(JsonObject json, Contract owner) 8726 throws IOException, FHIRFormatError { 8727 Contract.TermComponent res = new Contract.TermComponent(); 8728 parseContractTermComponentProperties(json, owner, res); 8729 return res; 8730 } 8731 8732 protected void parseContractTermComponentProperties(JsonObject json, Contract owner, Contract.TermComponent res) 8733 throws IOException, FHIRFormatError { 8734 parseBackboneElementProperties(json, res); 8735 if (json.has("identifier")) 8736 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 8737 if (json.has("issued")) 8738 res.setIssuedElement(parseDateTime(json.get("issued").getAsString())); 8739 if (json.has("_issued")) 8740 parseElementProperties(getJObject(json, "_issued"), res.getIssuedElement()); 8741 if (json.has("applies")) 8742 res.setApplies(parsePeriod(getJObject(json, "applies"))); 8743 Type topic = parseType("topic", json); 8744 if (topic != null) 8745 res.setTopic(topic); 8746 if (json.has("type")) 8747 res.setType(parseCodeableConcept(getJObject(json, "type"))); 8748 if (json.has("subType")) 8749 res.setSubType(parseCodeableConcept(getJObject(json, "subType"))); 8750 if (json.has("text")) 8751 res.setTextElement(parseString(json.get("text").getAsString())); 8752 if (json.has("_text")) 8753 parseElementProperties(getJObject(json, "_text"), res.getTextElement()); 8754 if (json.has("securityLabel")) { 8755 JsonArray array = json.getAsJsonArray("securityLabel"); 8756 for (int i = 0; i < array.size(); i++) { 8757 res.getSecurityLabel().add(parseContractSecurityLabelComponent(array.get(i).getAsJsonObject(), owner)); 8758 } 8759 } 8760 ; 8761 if (json.has("offer")) 8762 res.setOffer(parseContractContractOfferComponent(getJObject(json, "offer"), owner)); 8763 if (json.has("asset")) { 8764 JsonArray array = json.getAsJsonArray("asset"); 8765 for (int i = 0; i < array.size(); i++) { 8766 res.getAsset().add(parseContractContractAssetComponent(array.get(i).getAsJsonObject(), owner)); 8767 } 8768 } 8769 ; 8770 if (json.has("action")) { 8771 JsonArray array = json.getAsJsonArray("action"); 8772 for (int i = 0; i < array.size(); i++) { 8773 res.getAction().add(parseContractActionComponent(array.get(i).getAsJsonObject(), owner)); 8774 } 8775 } 8776 ; 8777 if (json.has("group")) { 8778 JsonArray array = json.getAsJsonArray("group"); 8779 for (int i = 0; i < array.size(); i++) { 8780 res.getGroup().add(parseContractTermComponent(array.get(i).getAsJsonObject(), owner)); 8781 } 8782 } 8783 ; 8784 } 8785 8786 protected Contract.SecurityLabelComponent parseContractSecurityLabelComponent(JsonObject json, Contract owner) 8787 throws IOException, FHIRFormatError { 8788 Contract.SecurityLabelComponent res = new Contract.SecurityLabelComponent(); 8789 parseContractSecurityLabelComponentProperties(json, owner, res); 8790 return res; 8791 } 8792 8793 protected void parseContractSecurityLabelComponentProperties(JsonObject json, Contract owner, 8794 Contract.SecurityLabelComponent res) throws IOException, FHIRFormatError { 8795 parseBackboneElementProperties(json, res); 8796 if (json.has("number")) { 8797 JsonArray array = json.getAsJsonArray("number"); 8798 for (int i = 0; i < array.size(); i++) { 8799 if (array.get(i).isJsonNull()) { 8800 res.getNumber().add(new UnsignedIntType()); 8801 } else { 8802 res.getNumber().add(parseUnsignedInt(array.get(i).getAsString())); 8803 } 8804 } 8805 } 8806 ; 8807 if (json.has("_number")) { 8808 JsonArray array = json.getAsJsonArray("_number"); 8809 for (int i = 0; i < array.size(); i++) { 8810 if (i == res.getNumber().size()) 8811 res.getNumber().add(parseUnsignedInt(null)); 8812 if (array.get(i) instanceof JsonObject) 8813 parseElementProperties(array.get(i).getAsJsonObject(), res.getNumber().get(i)); 8814 } 8815 } 8816 ; 8817 if (json.has("classification")) 8818 res.setClassification(parseCoding(getJObject(json, "classification"))); 8819 if (json.has("category")) { 8820 JsonArray array = json.getAsJsonArray("category"); 8821 for (int i = 0; i < array.size(); i++) { 8822 res.getCategory().add(parseCoding(array.get(i).getAsJsonObject())); 8823 } 8824 } 8825 ; 8826 if (json.has("control")) { 8827 JsonArray array = json.getAsJsonArray("control"); 8828 for (int i = 0; i < array.size(); i++) { 8829 res.getControl().add(parseCoding(array.get(i).getAsJsonObject())); 8830 } 8831 } 8832 ; 8833 } 8834 8835 protected Contract.ContractOfferComponent parseContractContractOfferComponent(JsonObject json, Contract owner) 8836 throws IOException, FHIRFormatError { 8837 Contract.ContractOfferComponent res = new Contract.ContractOfferComponent(); 8838 parseContractContractOfferComponentProperties(json, owner, res); 8839 return res; 8840 } 8841 8842 protected void parseContractContractOfferComponentProperties(JsonObject json, Contract owner, 8843 Contract.ContractOfferComponent res) throws IOException, FHIRFormatError { 8844 parseBackboneElementProperties(json, res); 8845 if (json.has("identifier")) { 8846 JsonArray array = json.getAsJsonArray("identifier"); 8847 for (int i = 0; i < array.size(); i++) { 8848 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 8849 } 8850 } 8851 ; 8852 if (json.has("party")) { 8853 JsonArray array = json.getAsJsonArray("party"); 8854 for (int i = 0; i < array.size(); i++) { 8855 res.getParty().add(parseContractContractPartyComponent(array.get(i).getAsJsonObject(), owner)); 8856 } 8857 } 8858 ; 8859 if (json.has("topic")) 8860 res.setTopic(parseReference(getJObject(json, "topic"))); 8861 if (json.has("type")) 8862 res.setType(parseCodeableConcept(getJObject(json, "type"))); 8863 if (json.has("decision")) 8864 res.setDecision(parseCodeableConcept(getJObject(json, "decision"))); 8865 if (json.has("decisionMode")) { 8866 JsonArray array = json.getAsJsonArray("decisionMode"); 8867 for (int i = 0; i < array.size(); i++) { 8868 res.getDecisionMode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 8869 } 8870 } 8871 ; 8872 if (json.has("answer")) { 8873 JsonArray array = json.getAsJsonArray("answer"); 8874 for (int i = 0; i < array.size(); i++) { 8875 res.getAnswer().add(parseContractAnswerComponent(array.get(i).getAsJsonObject(), owner)); 8876 } 8877 } 8878 ; 8879 if (json.has("text")) 8880 res.setTextElement(parseString(json.get("text").getAsString())); 8881 if (json.has("_text")) 8882 parseElementProperties(getJObject(json, "_text"), res.getTextElement()); 8883 if (json.has("linkId")) { 8884 JsonArray array = json.getAsJsonArray("linkId"); 8885 for (int i = 0; i < array.size(); i++) { 8886 if (array.get(i).isJsonNull()) { 8887 res.getLinkId().add(new StringType()); 8888 } else { 8889 res.getLinkId().add(parseString(array.get(i).getAsString())); 8890 } 8891 } 8892 } 8893 ; 8894 if (json.has("_linkId")) { 8895 JsonArray array = json.getAsJsonArray("_linkId"); 8896 for (int i = 0; i < array.size(); i++) { 8897 if (i == res.getLinkId().size()) 8898 res.getLinkId().add(parseString(null)); 8899 if (array.get(i) instanceof JsonObject) 8900 parseElementProperties(array.get(i).getAsJsonObject(), res.getLinkId().get(i)); 8901 } 8902 } 8903 ; 8904 if (json.has("securityLabelNumber")) { 8905 JsonArray array = json.getAsJsonArray("securityLabelNumber"); 8906 for (int i = 0; i < array.size(); i++) { 8907 if (array.get(i).isJsonNull()) { 8908 res.getSecurityLabelNumber().add(new UnsignedIntType()); 8909 } else { 8910 res.getSecurityLabelNumber().add(parseUnsignedInt(array.get(i).getAsString())); 8911 } 8912 } 8913 } 8914 ; 8915 if (json.has("_securityLabelNumber")) { 8916 JsonArray array = json.getAsJsonArray("_securityLabelNumber"); 8917 for (int i = 0; i < array.size(); i++) { 8918 if (i == res.getSecurityLabelNumber().size()) 8919 res.getSecurityLabelNumber().add(parseUnsignedInt(null)); 8920 if (array.get(i) instanceof JsonObject) 8921 parseElementProperties(array.get(i).getAsJsonObject(), res.getSecurityLabelNumber().get(i)); 8922 } 8923 } 8924 ; 8925 } 8926 8927 protected Contract.ContractPartyComponent parseContractContractPartyComponent(JsonObject json, Contract owner) 8928 throws IOException, FHIRFormatError { 8929 Contract.ContractPartyComponent res = new Contract.ContractPartyComponent(); 8930 parseContractContractPartyComponentProperties(json, owner, res); 8931 return res; 8932 } 8933 8934 protected void parseContractContractPartyComponentProperties(JsonObject json, Contract owner, 8935 Contract.ContractPartyComponent res) throws IOException, FHIRFormatError { 8936 parseBackboneElementProperties(json, res); 8937 if (json.has("reference")) { 8938 JsonArray array = json.getAsJsonArray("reference"); 8939 for (int i = 0; i < array.size(); i++) { 8940 res.getReference().add(parseReference(array.get(i).getAsJsonObject())); 8941 } 8942 } 8943 ; 8944 if (json.has("role")) 8945 res.setRole(parseCodeableConcept(getJObject(json, "role"))); 8946 } 8947 8948 protected Contract.AnswerComponent parseContractAnswerComponent(JsonObject json, Contract owner) 8949 throws IOException, FHIRFormatError { 8950 Contract.AnswerComponent res = new Contract.AnswerComponent(); 8951 parseContractAnswerComponentProperties(json, owner, res); 8952 return res; 8953 } 8954 8955 protected void parseContractAnswerComponentProperties(JsonObject json, Contract owner, Contract.AnswerComponent res) 8956 throws IOException, FHIRFormatError { 8957 parseBackboneElementProperties(json, res); 8958 Type value = parseType("value", json); 8959 if (value != null) 8960 res.setValue(value); 8961 } 8962 8963 protected Contract.ContractAssetComponent parseContractContractAssetComponent(JsonObject json, Contract owner) 8964 throws IOException, FHIRFormatError { 8965 Contract.ContractAssetComponent res = new Contract.ContractAssetComponent(); 8966 parseContractContractAssetComponentProperties(json, owner, res); 8967 return res; 8968 } 8969 8970 protected void parseContractContractAssetComponentProperties(JsonObject json, Contract owner, 8971 Contract.ContractAssetComponent res) throws IOException, FHIRFormatError { 8972 parseBackboneElementProperties(json, res); 8973 if (json.has("scope")) 8974 res.setScope(parseCodeableConcept(getJObject(json, "scope"))); 8975 if (json.has("type")) { 8976 JsonArray array = json.getAsJsonArray("type"); 8977 for (int i = 0; i < array.size(); i++) { 8978 res.getType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 8979 } 8980 } 8981 ; 8982 if (json.has("typeReference")) { 8983 JsonArray array = json.getAsJsonArray("typeReference"); 8984 for (int i = 0; i < array.size(); i++) { 8985 res.getTypeReference().add(parseReference(array.get(i).getAsJsonObject())); 8986 } 8987 } 8988 ; 8989 if (json.has("subtype")) { 8990 JsonArray array = json.getAsJsonArray("subtype"); 8991 for (int i = 0; i < array.size(); i++) { 8992 res.getSubtype().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 8993 } 8994 } 8995 ; 8996 if (json.has("relationship")) 8997 res.setRelationship(parseCoding(getJObject(json, "relationship"))); 8998 if (json.has("context")) { 8999 JsonArray array = json.getAsJsonArray("context"); 9000 for (int i = 0; i < array.size(); i++) { 9001 res.getContext().add(parseContractAssetContextComponent(array.get(i).getAsJsonObject(), owner)); 9002 } 9003 } 9004 ; 9005 if (json.has("condition")) 9006 res.setConditionElement(parseString(json.get("condition").getAsString())); 9007 if (json.has("_condition")) 9008 parseElementProperties(getJObject(json, "_condition"), res.getConditionElement()); 9009 if (json.has("periodType")) { 9010 JsonArray array = json.getAsJsonArray("periodType"); 9011 for (int i = 0; i < array.size(); i++) { 9012 res.getPeriodType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 9013 } 9014 } 9015 ; 9016 if (json.has("period")) { 9017 JsonArray array = json.getAsJsonArray("period"); 9018 for (int i = 0; i < array.size(); i++) { 9019 res.getPeriod().add(parsePeriod(array.get(i).getAsJsonObject())); 9020 } 9021 } 9022 ; 9023 if (json.has("usePeriod")) { 9024 JsonArray array = json.getAsJsonArray("usePeriod"); 9025 for (int i = 0; i < array.size(); i++) { 9026 res.getUsePeriod().add(parsePeriod(array.get(i).getAsJsonObject())); 9027 } 9028 } 9029 ; 9030 if (json.has("text")) 9031 res.setTextElement(parseString(json.get("text").getAsString())); 9032 if (json.has("_text")) 9033 parseElementProperties(getJObject(json, "_text"), res.getTextElement()); 9034 if (json.has("linkId")) { 9035 JsonArray array = json.getAsJsonArray("linkId"); 9036 for (int i = 0; i < array.size(); i++) { 9037 if (array.get(i).isJsonNull()) { 9038 res.getLinkId().add(new StringType()); 9039 } else { 9040 res.getLinkId().add(parseString(array.get(i).getAsString())); 9041 } 9042 } 9043 } 9044 ; 9045 if (json.has("_linkId")) { 9046 JsonArray array = json.getAsJsonArray("_linkId"); 9047 for (int i = 0; i < array.size(); i++) { 9048 if (i == res.getLinkId().size()) 9049 res.getLinkId().add(parseString(null)); 9050 if (array.get(i) instanceof JsonObject) 9051 parseElementProperties(array.get(i).getAsJsonObject(), res.getLinkId().get(i)); 9052 } 9053 } 9054 ; 9055 if (json.has("answer")) { 9056 JsonArray array = json.getAsJsonArray("answer"); 9057 for (int i = 0; i < array.size(); i++) { 9058 res.getAnswer().add(parseContractAnswerComponent(array.get(i).getAsJsonObject(), owner)); 9059 } 9060 } 9061 ; 9062 if (json.has("securityLabelNumber")) { 9063 JsonArray array = json.getAsJsonArray("securityLabelNumber"); 9064 for (int i = 0; i < array.size(); i++) { 9065 if (array.get(i).isJsonNull()) { 9066 res.getSecurityLabelNumber().add(new UnsignedIntType()); 9067 } else { 9068 res.getSecurityLabelNumber().add(parseUnsignedInt(array.get(i).getAsString())); 9069 } 9070 } 9071 } 9072 ; 9073 if (json.has("_securityLabelNumber")) { 9074 JsonArray array = json.getAsJsonArray("_securityLabelNumber"); 9075 for (int i = 0; i < array.size(); i++) { 9076 if (i == res.getSecurityLabelNumber().size()) 9077 res.getSecurityLabelNumber().add(parseUnsignedInt(null)); 9078 if (array.get(i) instanceof JsonObject) 9079 parseElementProperties(array.get(i).getAsJsonObject(), res.getSecurityLabelNumber().get(i)); 9080 } 9081 } 9082 ; 9083 if (json.has("valuedItem")) { 9084 JsonArray array = json.getAsJsonArray("valuedItem"); 9085 for (int i = 0; i < array.size(); i++) { 9086 res.getValuedItem().add(parseContractValuedItemComponent(array.get(i).getAsJsonObject(), owner)); 9087 } 9088 } 9089 ; 9090 } 9091 9092 protected Contract.AssetContextComponent parseContractAssetContextComponent(JsonObject json, Contract owner) 9093 throws IOException, FHIRFormatError { 9094 Contract.AssetContextComponent res = new Contract.AssetContextComponent(); 9095 parseContractAssetContextComponentProperties(json, owner, res); 9096 return res; 9097 } 9098 9099 protected void parseContractAssetContextComponentProperties(JsonObject json, Contract owner, 9100 Contract.AssetContextComponent res) throws IOException, FHIRFormatError { 9101 parseBackboneElementProperties(json, res); 9102 if (json.has("reference")) 9103 res.setReference(parseReference(getJObject(json, "reference"))); 9104 if (json.has("code")) { 9105 JsonArray array = json.getAsJsonArray("code"); 9106 for (int i = 0; i < array.size(); i++) { 9107 res.getCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 9108 } 9109 } 9110 ; 9111 if (json.has("text")) 9112 res.setTextElement(parseString(json.get("text").getAsString())); 9113 if (json.has("_text")) 9114 parseElementProperties(getJObject(json, "_text"), res.getTextElement()); 9115 } 9116 9117 protected Contract.ValuedItemComponent parseContractValuedItemComponent(JsonObject json, Contract owner) 9118 throws IOException, FHIRFormatError { 9119 Contract.ValuedItemComponent res = new Contract.ValuedItemComponent(); 9120 parseContractValuedItemComponentProperties(json, owner, res); 9121 return res; 9122 } 9123 9124 protected void parseContractValuedItemComponentProperties(JsonObject json, Contract owner, 9125 Contract.ValuedItemComponent res) throws IOException, FHIRFormatError { 9126 parseBackboneElementProperties(json, res); 9127 Type entity = parseType("entity", json); 9128 if (entity != null) 9129 res.setEntity(entity); 9130 if (json.has("identifier")) 9131 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 9132 if (json.has("effectiveTime")) 9133 res.setEffectiveTimeElement(parseDateTime(json.get("effectiveTime").getAsString())); 9134 if (json.has("_effectiveTime")) 9135 parseElementProperties(getJObject(json, "_effectiveTime"), res.getEffectiveTimeElement()); 9136 if (json.has("quantity")) 9137 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 9138 if (json.has("unitPrice")) 9139 res.setUnitPrice(parseMoney(getJObject(json, "unitPrice"))); 9140 if (json.has("factor")) 9141 res.setFactorElement(parseDecimal(json.get("factor").getAsBigDecimal())); 9142 if (json.has("_factor")) 9143 parseElementProperties(getJObject(json, "_factor"), res.getFactorElement()); 9144 if (json.has("points")) 9145 res.setPointsElement(parseDecimal(json.get("points").getAsBigDecimal())); 9146 if (json.has("_points")) 9147 parseElementProperties(getJObject(json, "_points"), res.getPointsElement()); 9148 if (json.has("net")) 9149 res.setNet(parseMoney(getJObject(json, "net"))); 9150 if (json.has("payment")) 9151 res.setPaymentElement(parseString(json.get("payment").getAsString())); 9152 if (json.has("_payment")) 9153 parseElementProperties(getJObject(json, "_payment"), res.getPaymentElement()); 9154 if (json.has("paymentDate")) 9155 res.setPaymentDateElement(parseDateTime(json.get("paymentDate").getAsString())); 9156 if (json.has("_paymentDate")) 9157 parseElementProperties(getJObject(json, "_paymentDate"), res.getPaymentDateElement()); 9158 if (json.has("responsible")) 9159 res.setResponsible(parseReference(getJObject(json, "responsible"))); 9160 if (json.has("recipient")) 9161 res.setRecipient(parseReference(getJObject(json, "recipient"))); 9162 if (json.has("linkId")) { 9163 JsonArray array = json.getAsJsonArray("linkId"); 9164 for (int i = 0; i < array.size(); i++) { 9165 if (array.get(i).isJsonNull()) { 9166 res.getLinkId().add(new StringType()); 9167 } else { 9168 res.getLinkId().add(parseString(array.get(i).getAsString())); 9169 } 9170 } 9171 } 9172 ; 9173 if (json.has("_linkId")) { 9174 JsonArray array = json.getAsJsonArray("_linkId"); 9175 for (int i = 0; i < array.size(); i++) { 9176 if (i == res.getLinkId().size()) 9177 res.getLinkId().add(parseString(null)); 9178 if (array.get(i) instanceof JsonObject) 9179 parseElementProperties(array.get(i).getAsJsonObject(), res.getLinkId().get(i)); 9180 } 9181 } 9182 ; 9183 if (json.has("securityLabelNumber")) { 9184 JsonArray array = json.getAsJsonArray("securityLabelNumber"); 9185 for (int i = 0; i < array.size(); i++) { 9186 if (array.get(i).isJsonNull()) { 9187 res.getSecurityLabelNumber().add(new UnsignedIntType()); 9188 } else { 9189 res.getSecurityLabelNumber().add(parseUnsignedInt(array.get(i).getAsString())); 9190 } 9191 } 9192 } 9193 ; 9194 if (json.has("_securityLabelNumber")) { 9195 JsonArray array = json.getAsJsonArray("_securityLabelNumber"); 9196 for (int i = 0; i < array.size(); i++) { 9197 if (i == res.getSecurityLabelNumber().size()) 9198 res.getSecurityLabelNumber().add(parseUnsignedInt(null)); 9199 if (array.get(i) instanceof JsonObject) 9200 parseElementProperties(array.get(i).getAsJsonObject(), res.getSecurityLabelNumber().get(i)); 9201 } 9202 } 9203 ; 9204 } 9205 9206 protected Contract.ActionComponent parseContractActionComponent(JsonObject json, Contract owner) 9207 throws IOException, FHIRFormatError { 9208 Contract.ActionComponent res = new Contract.ActionComponent(); 9209 parseContractActionComponentProperties(json, owner, res); 9210 return res; 9211 } 9212 9213 protected void parseContractActionComponentProperties(JsonObject json, Contract owner, Contract.ActionComponent res) 9214 throws IOException, FHIRFormatError { 9215 parseBackboneElementProperties(json, res); 9216 if (json.has("doNotPerform")) 9217 res.setDoNotPerformElement(parseBoolean(json.get("doNotPerform").getAsBoolean())); 9218 if (json.has("_doNotPerform")) 9219 parseElementProperties(getJObject(json, "_doNotPerform"), res.getDoNotPerformElement()); 9220 if (json.has("type")) 9221 res.setType(parseCodeableConcept(getJObject(json, "type"))); 9222 if (json.has("subject")) { 9223 JsonArray array = json.getAsJsonArray("subject"); 9224 for (int i = 0; i < array.size(); i++) { 9225 res.getSubject().add(parseContractActionSubjectComponent(array.get(i).getAsJsonObject(), owner)); 9226 } 9227 } 9228 ; 9229 if (json.has("intent")) 9230 res.setIntent(parseCodeableConcept(getJObject(json, "intent"))); 9231 if (json.has("linkId")) { 9232 JsonArray array = json.getAsJsonArray("linkId"); 9233 for (int i = 0; i < array.size(); i++) { 9234 if (array.get(i).isJsonNull()) { 9235 res.getLinkId().add(new StringType()); 9236 } else { 9237 res.getLinkId().add(parseString(array.get(i).getAsString())); 9238 } 9239 } 9240 } 9241 ; 9242 if (json.has("_linkId")) { 9243 JsonArray array = json.getAsJsonArray("_linkId"); 9244 for (int i = 0; i < array.size(); i++) { 9245 if (i == res.getLinkId().size()) 9246 res.getLinkId().add(parseString(null)); 9247 if (array.get(i) instanceof JsonObject) 9248 parseElementProperties(array.get(i).getAsJsonObject(), res.getLinkId().get(i)); 9249 } 9250 } 9251 ; 9252 if (json.has("status")) 9253 res.setStatus(parseCodeableConcept(getJObject(json, "status"))); 9254 if (json.has("context")) 9255 res.setContext(parseReference(getJObject(json, "context"))); 9256 if (json.has("contextLinkId")) { 9257 JsonArray array = json.getAsJsonArray("contextLinkId"); 9258 for (int i = 0; i < array.size(); i++) { 9259 if (array.get(i).isJsonNull()) { 9260 res.getContextLinkId().add(new StringType()); 9261 } else { 9262 res.getContextLinkId().add(parseString(array.get(i).getAsString())); 9263 } 9264 } 9265 } 9266 ; 9267 if (json.has("_contextLinkId")) { 9268 JsonArray array = json.getAsJsonArray("_contextLinkId"); 9269 for (int i = 0; i < array.size(); i++) { 9270 if (i == res.getContextLinkId().size()) 9271 res.getContextLinkId().add(parseString(null)); 9272 if (array.get(i) instanceof JsonObject) 9273 parseElementProperties(array.get(i).getAsJsonObject(), res.getContextLinkId().get(i)); 9274 } 9275 } 9276 ; 9277 Type occurrence = parseType("occurrence", json); 9278 if (occurrence != null) 9279 res.setOccurrence(occurrence); 9280 if (json.has("requester")) { 9281 JsonArray array = json.getAsJsonArray("requester"); 9282 for (int i = 0; i < array.size(); i++) { 9283 res.getRequester().add(parseReference(array.get(i).getAsJsonObject())); 9284 } 9285 } 9286 ; 9287 if (json.has("requesterLinkId")) { 9288 JsonArray array = json.getAsJsonArray("requesterLinkId"); 9289 for (int i = 0; i < array.size(); i++) { 9290 if (array.get(i).isJsonNull()) { 9291 res.getRequesterLinkId().add(new StringType()); 9292 } else { 9293 res.getRequesterLinkId().add(parseString(array.get(i).getAsString())); 9294 } 9295 } 9296 } 9297 ; 9298 if (json.has("_requesterLinkId")) { 9299 JsonArray array = json.getAsJsonArray("_requesterLinkId"); 9300 for (int i = 0; i < array.size(); i++) { 9301 if (i == res.getRequesterLinkId().size()) 9302 res.getRequesterLinkId().add(parseString(null)); 9303 if (array.get(i) instanceof JsonObject) 9304 parseElementProperties(array.get(i).getAsJsonObject(), res.getRequesterLinkId().get(i)); 9305 } 9306 } 9307 ; 9308 if (json.has("performerType")) { 9309 JsonArray array = json.getAsJsonArray("performerType"); 9310 for (int i = 0; i < array.size(); i++) { 9311 res.getPerformerType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 9312 } 9313 } 9314 ; 9315 if (json.has("performerRole")) 9316 res.setPerformerRole(parseCodeableConcept(getJObject(json, "performerRole"))); 9317 if (json.has("performer")) 9318 res.setPerformer(parseReference(getJObject(json, "performer"))); 9319 if (json.has("performerLinkId")) { 9320 JsonArray array = json.getAsJsonArray("performerLinkId"); 9321 for (int i = 0; i < array.size(); i++) { 9322 if (array.get(i).isJsonNull()) { 9323 res.getPerformerLinkId().add(new StringType()); 9324 } else { 9325 res.getPerformerLinkId().add(parseString(array.get(i).getAsString())); 9326 } 9327 } 9328 } 9329 ; 9330 if (json.has("_performerLinkId")) { 9331 JsonArray array = json.getAsJsonArray("_performerLinkId"); 9332 for (int i = 0; i < array.size(); i++) { 9333 if (i == res.getPerformerLinkId().size()) 9334 res.getPerformerLinkId().add(parseString(null)); 9335 if (array.get(i) instanceof JsonObject) 9336 parseElementProperties(array.get(i).getAsJsonObject(), res.getPerformerLinkId().get(i)); 9337 } 9338 } 9339 ; 9340 if (json.has("reasonCode")) { 9341 JsonArray array = json.getAsJsonArray("reasonCode"); 9342 for (int i = 0; i < array.size(); i++) { 9343 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 9344 } 9345 } 9346 ; 9347 if (json.has("reasonReference")) { 9348 JsonArray array = json.getAsJsonArray("reasonReference"); 9349 for (int i = 0; i < array.size(); i++) { 9350 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 9351 } 9352 } 9353 ; 9354 if (json.has("reason")) { 9355 JsonArray array = json.getAsJsonArray("reason"); 9356 for (int i = 0; i < array.size(); i++) { 9357 if (array.get(i).isJsonNull()) { 9358 res.getReason().add(new StringType()); 9359 } else { 9360 res.getReason().add(parseString(array.get(i).getAsString())); 9361 } 9362 } 9363 } 9364 ; 9365 if (json.has("_reason")) { 9366 JsonArray array = json.getAsJsonArray("_reason"); 9367 for (int i = 0; i < array.size(); i++) { 9368 if (i == res.getReason().size()) 9369 res.getReason().add(parseString(null)); 9370 if (array.get(i) instanceof JsonObject) 9371 parseElementProperties(array.get(i).getAsJsonObject(), res.getReason().get(i)); 9372 } 9373 } 9374 ; 9375 if (json.has("reasonLinkId")) { 9376 JsonArray array = json.getAsJsonArray("reasonLinkId"); 9377 for (int i = 0; i < array.size(); i++) { 9378 if (array.get(i).isJsonNull()) { 9379 res.getReasonLinkId().add(new StringType()); 9380 } else { 9381 res.getReasonLinkId().add(parseString(array.get(i).getAsString())); 9382 } 9383 } 9384 } 9385 ; 9386 if (json.has("_reasonLinkId")) { 9387 JsonArray array = json.getAsJsonArray("_reasonLinkId"); 9388 for (int i = 0; i < array.size(); i++) { 9389 if (i == res.getReasonLinkId().size()) 9390 res.getReasonLinkId().add(parseString(null)); 9391 if (array.get(i) instanceof JsonObject) 9392 parseElementProperties(array.get(i).getAsJsonObject(), res.getReasonLinkId().get(i)); 9393 } 9394 } 9395 ; 9396 if (json.has("note")) { 9397 JsonArray array = json.getAsJsonArray("note"); 9398 for (int i = 0; i < array.size(); i++) { 9399 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 9400 } 9401 } 9402 ; 9403 if (json.has("securityLabelNumber")) { 9404 JsonArray array = json.getAsJsonArray("securityLabelNumber"); 9405 for (int i = 0; i < array.size(); i++) { 9406 if (array.get(i).isJsonNull()) { 9407 res.getSecurityLabelNumber().add(new UnsignedIntType()); 9408 } else { 9409 res.getSecurityLabelNumber().add(parseUnsignedInt(array.get(i).getAsString())); 9410 } 9411 } 9412 } 9413 ; 9414 if (json.has("_securityLabelNumber")) { 9415 JsonArray array = json.getAsJsonArray("_securityLabelNumber"); 9416 for (int i = 0; i < array.size(); i++) { 9417 if (i == res.getSecurityLabelNumber().size()) 9418 res.getSecurityLabelNumber().add(parseUnsignedInt(null)); 9419 if (array.get(i) instanceof JsonObject) 9420 parseElementProperties(array.get(i).getAsJsonObject(), res.getSecurityLabelNumber().get(i)); 9421 } 9422 } 9423 ; 9424 } 9425 9426 protected Contract.ActionSubjectComponent parseContractActionSubjectComponent(JsonObject json, Contract owner) 9427 throws IOException, FHIRFormatError { 9428 Contract.ActionSubjectComponent res = new Contract.ActionSubjectComponent(); 9429 parseContractActionSubjectComponentProperties(json, owner, res); 9430 return res; 9431 } 9432 9433 protected void parseContractActionSubjectComponentProperties(JsonObject json, Contract owner, 9434 Contract.ActionSubjectComponent res) throws IOException, FHIRFormatError { 9435 parseBackboneElementProperties(json, res); 9436 if (json.has("reference")) { 9437 JsonArray array = json.getAsJsonArray("reference"); 9438 for (int i = 0; i < array.size(); i++) { 9439 res.getReference().add(parseReference(array.get(i).getAsJsonObject())); 9440 } 9441 } 9442 ; 9443 if (json.has("role")) 9444 res.setRole(parseCodeableConcept(getJObject(json, "role"))); 9445 } 9446 9447 protected Contract.SignatoryComponent parseContractSignatoryComponent(JsonObject json, Contract owner) 9448 throws IOException, FHIRFormatError { 9449 Contract.SignatoryComponent res = new Contract.SignatoryComponent(); 9450 parseContractSignatoryComponentProperties(json, owner, res); 9451 return res; 9452 } 9453 9454 protected void parseContractSignatoryComponentProperties(JsonObject json, Contract owner, 9455 Contract.SignatoryComponent res) throws IOException, FHIRFormatError { 9456 parseBackboneElementProperties(json, res); 9457 if (json.has("type")) 9458 res.setType(parseCoding(getJObject(json, "type"))); 9459 if (json.has("party")) 9460 res.setParty(parseReference(getJObject(json, "party"))); 9461 if (json.has("signature")) { 9462 JsonArray array = json.getAsJsonArray("signature"); 9463 for (int i = 0; i < array.size(); i++) { 9464 res.getSignature().add(parseSignature(array.get(i).getAsJsonObject())); 9465 } 9466 } 9467 ; 9468 } 9469 9470 protected Contract.FriendlyLanguageComponent parseContractFriendlyLanguageComponent(JsonObject json, Contract owner) 9471 throws IOException, FHIRFormatError { 9472 Contract.FriendlyLanguageComponent res = new Contract.FriendlyLanguageComponent(); 9473 parseContractFriendlyLanguageComponentProperties(json, owner, res); 9474 return res; 9475 } 9476 9477 protected void parseContractFriendlyLanguageComponentProperties(JsonObject json, Contract owner, 9478 Contract.FriendlyLanguageComponent res) throws IOException, FHIRFormatError { 9479 parseBackboneElementProperties(json, res); 9480 Type content = parseType("content", json); 9481 if (content != null) 9482 res.setContent(content); 9483 } 9484 9485 protected Contract.LegalLanguageComponent parseContractLegalLanguageComponent(JsonObject json, Contract owner) 9486 throws IOException, FHIRFormatError { 9487 Contract.LegalLanguageComponent res = new Contract.LegalLanguageComponent(); 9488 parseContractLegalLanguageComponentProperties(json, owner, res); 9489 return res; 9490 } 9491 9492 protected void parseContractLegalLanguageComponentProperties(JsonObject json, Contract owner, 9493 Contract.LegalLanguageComponent res) throws IOException, FHIRFormatError { 9494 parseBackboneElementProperties(json, res); 9495 Type content = parseType("content", json); 9496 if (content != null) 9497 res.setContent(content); 9498 } 9499 9500 protected Contract.ComputableLanguageComponent parseContractComputableLanguageComponent(JsonObject json, 9501 Contract owner) throws IOException, FHIRFormatError { 9502 Contract.ComputableLanguageComponent res = new Contract.ComputableLanguageComponent(); 9503 parseContractComputableLanguageComponentProperties(json, owner, res); 9504 return res; 9505 } 9506 9507 protected void parseContractComputableLanguageComponentProperties(JsonObject json, Contract owner, 9508 Contract.ComputableLanguageComponent res) throws IOException, FHIRFormatError { 9509 parseBackboneElementProperties(json, res); 9510 Type content = parseType("content", json); 9511 if (content != null) 9512 res.setContent(content); 9513 } 9514 9515 protected Coverage parseCoverage(JsonObject json) throws IOException, FHIRFormatError { 9516 Coverage res = new Coverage(); 9517 parseCoverageProperties(json, res); 9518 return res; 9519 } 9520 9521 protected void parseCoverageProperties(JsonObject json, Coverage res) throws IOException, FHIRFormatError { 9522 parseDomainResourceProperties(json, res); 9523 if (json.has("identifier")) { 9524 JsonArray array = json.getAsJsonArray("identifier"); 9525 for (int i = 0; i < array.size(); i++) { 9526 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 9527 } 9528 } 9529 ; 9530 if (json.has("status")) 9531 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Coverage.CoverageStatus.NULL, 9532 new Coverage.CoverageStatusEnumFactory())); 9533 if (json.has("_status")) 9534 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 9535 if (json.has("type")) 9536 res.setType(parseCodeableConcept(getJObject(json, "type"))); 9537 if (json.has("policyHolder")) 9538 res.setPolicyHolder(parseReference(getJObject(json, "policyHolder"))); 9539 if (json.has("subscriber")) 9540 res.setSubscriber(parseReference(getJObject(json, "subscriber"))); 9541 if (json.has("subscriberId")) 9542 res.setSubscriberIdElement(parseString(json.get("subscriberId").getAsString())); 9543 if (json.has("_subscriberId")) 9544 parseElementProperties(getJObject(json, "_subscriberId"), res.getSubscriberIdElement()); 9545 if (json.has("beneficiary")) 9546 res.setBeneficiary(parseReference(getJObject(json, "beneficiary"))); 9547 if (json.has("dependent")) 9548 res.setDependentElement(parseString(json.get("dependent").getAsString())); 9549 if (json.has("_dependent")) 9550 parseElementProperties(getJObject(json, "_dependent"), res.getDependentElement()); 9551 if (json.has("relationship")) 9552 res.setRelationship(parseCodeableConcept(getJObject(json, "relationship"))); 9553 if (json.has("period")) 9554 res.setPeriod(parsePeriod(getJObject(json, "period"))); 9555 if (json.has("payor")) { 9556 JsonArray array = json.getAsJsonArray("payor"); 9557 for (int i = 0; i < array.size(); i++) { 9558 res.getPayor().add(parseReference(array.get(i).getAsJsonObject())); 9559 } 9560 } 9561 ; 9562 if (json.has("class")) { 9563 JsonArray array = json.getAsJsonArray("class"); 9564 for (int i = 0; i < array.size(); i++) { 9565 res.getClass_().add(parseCoverageClassComponent(array.get(i).getAsJsonObject(), res)); 9566 } 9567 } 9568 ; 9569 if (json.has("order")) 9570 res.setOrderElement(parsePositiveInt(json.get("order").getAsString())); 9571 if (json.has("_order")) 9572 parseElementProperties(getJObject(json, "_order"), res.getOrderElement()); 9573 if (json.has("network")) 9574 res.setNetworkElement(parseString(json.get("network").getAsString())); 9575 if (json.has("_network")) 9576 parseElementProperties(getJObject(json, "_network"), res.getNetworkElement()); 9577 if (json.has("costToBeneficiary")) { 9578 JsonArray array = json.getAsJsonArray("costToBeneficiary"); 9579 for (int i = 0; i < array.size(); i++) { 9580 res.getCostToBeneficiary().add(parseCoverageCostToBeneficiaryComponent(array.get(i).getAsJsonObject(), res)); 9581 } 9582 } 9583 ; 9584 if (json.has("subrogation")) 9585 res.setSubrogationElement(parseBoolean(json.get("subrogation").getAsBoolean())); 9586 if (json.has("_subrogation")) 9587 parseElementProperties(getJObject(json, "_subrogation"), res.getSubrogationElement()); 9588 if (json.has("contract")) { 9589 JsonArray array = json.getAsJsonArray("contract"); 9590 for (int i = 0; i < array.size(); i++) { 9591 res.getContract().add(parseReference(array.get(i).getAsJsonObject())); 9592 } 9593 } 9594 ; 9595 } 9596 9597 protected Coverage.ClassComponent parseCoverageClassComponent(JsonObject json, Coverage owner) 9598 throws IOException, FHIRFormatError { 9599 Coverage.ClassComponent res = new Coverage.ClassComponent(); 9600 parseCoverageClassComponentProperties(json, owner, res); 9601 return res; 9602 } 9603 9604 protected void parseCoverageClassComponentProperties(JsonObject json, Coverage owner, Coverage.ClassComponent res) 9605 throws IOException, FHIRFormatError { 9606 parseBackboneElementProperties(json, res); 9607 if (json.has("type")) 9608 res.setType(parseCodeableConcept(getJObject(json, "type"))); 9609 if (json.has("value")) 9610 res.setValueElement(parseString(json.get("value").getAsString())); 9611 if (json.has("_value")) 9612 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 9613 if (json.has("name")) 9614 res.setNameElement(parseString(json.get("name").getAsString())); 9615 if (json.has("_name")) 9616 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 9617 } 9618 9619 protected Coverage.CostToBeneficiaryComponent parseCoverageCostToBeneficiaryComponent(JsonObject json, Coverage owner) 9620 throws IOException, FHIRFormatError { 9621 Coverage.CostToBeneficiaryComponent res = new Coverage.CostToBeneficiaryComponent(); 9622 parseCoverageCostToBeneficiaryComponentProperties(json, owner, res); 9623 return res; 9624 } 9625 9626 protected void parseCoverageCostToBeneficiaryComponentProperties(JsonObject json, Coverage owner, 9627 Coverage.CostToBeneficiaryComponent res) throws IOException, FHIRFormatError { 9628 parseBackboneElementProperties(json, res); 9629 if (json.has("type")) 9630 res.setType(parseCodeableConcept(getJObject(json, "type"))); 9631 Type value = parseType("value", json); 9632 if (value != null) 9633 res.setValue(value); 9634 if (json.has("exception")) { 9635 JsonArray array = json.getAsJsonArray("exception"); 9636 for (int i = 0; i < array.size(); i++) { 9637 res.getException().add(parseCoverageExemptionComponent(array.get(i).getAsJsonObject(), owner)); 9638 } 9639 } 9640 ; 9641 } 9642 9643 protected Coverage.ExemptionComponent parseCoverageExemptionComponent(JsonObject json, Coverage owner) 9644 throws IOException, FHIRFormatError { 9645 Coverage.ExemptionComponent res = new Coverage.ExemptionComponent(); 9646 parseCoverageExemptionComponentProperties(json, owner, res); 9647 return res; 9648 } 9649 9650 protected void parseCoverageExemptionComponentProperties(JsonObject json, Coverage owner, 9651 Coverage.ExemptionComponent res) throws IOException, FHIRFormatError { 9652 parseBackboneElementProperties(json, res); 9653 if (json.has("type")) 9654 res.setType(parseCodeableConcept(getJObject(json, "type"))); 9655 if (json.has("period")) 9656 res.setPeriod(parsePeriod(getJObject(json, "period"))); 9657 } 9658 9659 protected CoverageEligibilityRequest parseCoverageEligibilityRequest(JsonObject json) 9660 throws IOException, FHIRFormatError { 9661 CoverageEligibilityRequest res = new CoverageEligibilityRequest(); 9662 parseCoverageEligibilityRequestProperties(json, res); 9663 return res; 9664 } 9665 9666 protected void parseCoverageEligibilityRequestProperties(JsonObject json, CoverageEligibilityRequest res) 9667 throws IOException, FHIRFormatError { 9668 parseDomainResourceProperties(json, res); 9669 if (json.has("identifier")) { 9670 JsonArray array = json.getAsJsonArray("identifier"); 9671 for (int i = 0; i < array.size(); i++) { 9672 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 9673 } 9674 } 9675 ; 9676 if (json.has("status")) 9677 res.setStatusElement( 9678 parseEnumeration(json.get("status").getAsString(), CoverageEligibilityRequest.EligibilityRequestStatus.NULL, 9679 new CoverageEligibilityRequest.EligibilityRequestStatusEnumFactory())); 9680 if (json.has("_status")) 9681 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 9682 if (json.has("priority")) 9683 res.setPriority(parseCodeableConcept(getJObject(json, "priority"))); 9684 if (json.has("purpose")) { 9685 JsonArray array = json.getAsJsonArray("purpose"); 9686 for (int i = 0; i < array.size(); i++) { 9687 if (array.get(i).isJsonNull()) { 9688 res.getPurpose().add(new Enumeration<CoverageEligibilityRequest.EligibilityRequestPurpose>()); 9689 } else { 9690 res.getPurpose() 9691 .add(parseEnumeration(array.get(i).getAsString(), 9692 CoverageEligibilityRequest.EligibilityRequestPurpose.NULL, 9693 new CoverageEligibilityRequest.EligibilityRequestPurposeEnumFactory())); 9694 } 9695 } 9696 } 9697 ; 9698 if (json.has("_purpose")) { 9699 JsonArray array = json.getAsJsonArray("_purpose"); 9700 for (int i = 0; i < array.size(); i++) { 9701 if (i == res.getPurpose().size()) 9702 res.getPurpose().add(parseEnumeration(null, CoverageEligibilityRequest.EligibilityRequestPurpose.NULL, 9703 new CoverageEligibilityRequest.EligibilityRequestPurposeEnumFactory())); 9704 if (array.get(i) instanceof JsonObject) 9705 parseElementProperties(array.get(i).getAsJsonObject(), res.getPurpose().get(i)); 9706 } 9707 } 9708 ; 9709 if (json.has("patient")) 9710 res.setPatient(parseReference(getJObject(json, "patient"))); 9711 Type serviced = parseType("serviced", json); 9712 if (serviced != null) 9713 res.setServiced(serviced); 9714 if (json.has("created")) 9715 res.setCreatedElement(parseDateTime(json.get("created").getAsString())); 9716 if (json.has("_created")) 9717 parseElementProperties(getJObject(json, "_created"), res.getCreatedElement()); 9718 if (json.has("enterer")) 9719 res.setEnterer(parseReference(getJObject(json, "enterer"))); 9720 if (json.has("provider")) 9721 res.setProvider(parseReference(getJObject(json, "provider"))); 9722 if (json.has("insurer")) 9723 res.setInsurer(parseReference(getJObject(json, "insurer"))); 9724 if (json.has("facility")) 9725 res.setFacility(parseReference(getJObject(json, "facility"))); 9726 if (json.has("supportingInfo")) { 9727 JsonArray array = json.getAsJsonArray("supportingInfo"); 9728 for (int i = 0; i < array.size(); i++) { 9729 res.getSupportingInfo() 9730 .add(parseCoverageEligibilityRequestSupportingInformationComponent(array.get(i).getAsJsonObject(), res)); 9731 } 9732 } 9733 ; 9734 if (json.has("insurance")) { 9735 JsonArray array = json.getAsJsonArray("insurance"); 9736 for (int i = 0; i < array.size(); i++) { 9737 res.getInsurance().add(parseCoverageEligibilityRequestInsuranceComponent(array.get(i).getAsJsonObject(), res)); 9738 } 9739 } 9740 ; 9741 if (json.has("item")) { 9742 JsonArray array = json.getAsJsonArray("item"); 9743 for (int i = 0; i < array.size(); i++) { 9744 res.getItem().add(parseCoverageEligibilityRequestDetailsComponent(array.get(i).getAsJsonObject(), res)); 9745 } 9746 } 9747 ; 9748 } 9749 9750 protected CoverageEligibilityRequest.SupportingInformationComponent parseCoverageEligibilityRequestSupportingInformationComponent( 9751 JsonObject json, CoverageEligibilityRequest owner) throws IOException, FHIRFormatError { 9752 CoverageEligibilityRequest.SupportingInformationComponent res = new CoverageEligibilityRequest.SupportingInformationComponent(); 9753 parseCoverageEligibilityRequestSupportingInformationComponentProperties(json, owner, res); 9754 return res; 9755 } 9756 9757 protected void parseCoverageEligibilityRequestSupportingInformationComponentProperties(JsonObject json, 9758 CoverageEligibilityRequest owner, CoverageEligibilityRequest.SupportingInformationComponent res) 9759 throws IOException, FHIRFormatError { 9760 parseBackboneElementProperties(json, res); 9761 if (json.has("sequence")) 9762 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 9763 if (json.has("_sequence")) 9764 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 9765 if (json.has("information")) 9766 res.setInformation(parseReference(getJObject(json, "information"))); 9767 if (json.has("appliesToAll")) 9768 res.setAppliesToAllElement(parseBoolean(json.get("appliesToAll").getAsBoolean())); 9769 if (json.has("_appliesToAll")) 9770 parseElementProperties(getJObject(json, "_appliesToAll"), res.getAppliesToAllElement()); 9771 } 9772 9773 protected CoverageEligibilityRequest.InsuranceComponent parseCoverageEligibilityRequestInsuranceComponent( 9774 JsonObject json, CoverageEligibilityRequest owner) throws IOException, FHIRFormatError { 9775 CoverageEligibilityRequest.InsuranceComponent res = new CoverageEligibilityRequest.InsuranceComponent(); 9776 parseCoverageEligibilityRequestInsuranceComponentProperties(json, owner, res); 9777 return res; 9778 } 9779 9780 protected void parseCoverageEligibilityRequestInsuranceComponentProperties(JsonObject json, 9781 CoverageEligibilityRequest owner, CoverageEligibilityRequest.InsuranceComponent res) 9782 throws IOException, FHIRFormatError { 9783 parseBackboneElementProperties(json, res); 9784 if (json.has("focal")) 9785 res.setFocalElement(parseBoolean(json.get("focal").getAsBoolean())); 9786 if (json.has("_focal")) 9787 parseElementProperties(getJObject(json, "_focal"), res.getFocalElement()); 9788 if (json.has("coverage")) 9789 res.setCoverage(parseReference(getJObject(json, "coverage"))); 9790 if (json.has("businessArrangement")) 9791 res.setBusinessArrangementElement(parseString(json.get("businessArrangement").getAsString())); 9792 if (json.has("_businessArrangement")) 9793 parseElementProperties(getJObject(json, "_businessArrangement"), res.getBusinessArrangementElement()); 9794 } 9795 9796 protected CoverageEligibilityRequest.DetailsComponent parseCoverageEligibilityRequestDetailsComponent(JsonObject json, 9797 CoverageEligibilityRequest owner) throws IOException, FHIRFormatError { 9798 CoverageEligibilityRequest.DetailsComponent res = new CoverageEligibilityRequest.DetailsComponent(); 9799 parseCoverageEligibilityRequestDetailsComponentProperties(json, owner, res); 9800 return res; 9801 } 9802 9803 protected void parseCoverageEligibilityRequestDetailsComponentProperties(JsonObject json, 9804 CoverageEligibilityRequest owner, CoverageEligibilityRequest.DetailsComponent res) 9805 throws IOException, FHIRFormatError { 9806 parseBackboneElementProperties(json, res); 9807 if (json.has("supportingInfoSequence")) { 9808 JsonArray array = json.getAsJsonArray("supportingInfoSequence"); 9809 for (int i = 0; i < array.size(); i++) { 9810 if (array.get(i).isJsonNull()) { 9811 res.getSupportingInfoSequence().add(new PositiveIntType()); 9812 } else { 9813 res.getSupportingInfoSequence().add(parsePositiveInt(array.get(i).getAsString())); 9814 } 9815 } 9816 } 9817 ; 9818 if (json.has("_supportingInfoSequence")) { 9819 JsonArray array = json.getAsJsonArray("_supportingInfoSequence"); 9820 for (int i = 0; i < array.size(); i++) { 9821 if (i == res.getSupportingInfoSequence().size()) 9822 res.getSupportingInfoSequence().add(parsePositiveInt(null)); 9823 if (array.get(i) instanceof JsonObject) 9824 parseElementProperties(array.get(i).getAsJsonObject(), res.getSupportingInfoSequence().get(i)); 9825 } 9826 } 9827 ; 9828 if (json.has("category")) 9829 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 9830 if (json.has("productOrService")) 9831 res.setProductOrService(parseCodeableConcept(getJObject(json, "productOrService"))); 9832 if (json.has("modifier")) { 9833 JsonArray array = json.getAsJsonArray("modifier"); 9834 for (int i = 0; i < array.size(); i++) { 9835 res.getModifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 9836 } 9837 } 9838 ; 9839 if (json.has("provider")) 9840 res.setProvider(parseReference(getJObject(json, "provider"))); 9841 if (json.has("quantity")) 9842 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 9843 if (json.has("unitPrice")) 9844 res.setUnitPrice(parseMoney(getJObject(json, "unitPrice"))); 9845 if (json.has("facility")) 9846 res.setFacility(parseReference(getJObject(json, "facility"))); 9847 if (json.has("diagnosis")) { 9848 JsonArray array = json.getAsJsonArray("diagnosis"); 9849 for (int i = 0; i < array.size(); i++) { 9850 res.getDiagnosis() 9851 .add(parseCoverageEligibilityRequestDiagnosisComponent(array.get(i).getAsJsonObject(), owner)); 9852 } 9853 } 9854 ; 9855 if (json.has("detail")) { 9856 JsonArray array = json.getAsJsonArray("detail"); 9857 for (int i = 0; i < array.size(); i++) { 9858 res.getDetail().add(parseReference(array.get(i).getAsJsonObject())); 9859 } 9860 } 9861 ; 9862 } 9863 9864 protected CoverageEligibilityRequest.DiagnosisComponent parseCoverageEligibilityRequestDiagnosisComponent( 9865 JsonObject json, CoverageEligibilityRequest owner) throws IOException, FHIRFormatError { 9866 CoverageEligibilityRequest.DiagnosisComponent res = new CoverageEligibilityRequest.DiagnosisComponent(); 9867 parseCoverageEligibilityRequestDiagnosisComponentProperties(json, owner, res); 9868 return res; 9869 } 9870 9871 protected void parseCoverageEligibilityRequestDiagnosisComponentProperties(JsonObject json, 9872 CoverageEligibilityRequest owner, CoverageEligibilityRequest.DiagnosisComponent res) 9873 throws IOException, FHIRFormatError { 9874 parseBackboneElementProperties(json, res); 9875 Type diagnosis = parseType("diagnosis", json); 9876 if (diagnosis != null) 9877 res.setDiagnosis(diagnosis); 9878 } 9879 9880 protected CoverageEligibilityResponse parseCoverageEligibilityResponse(JsonObject json) 9881 throws IOException, FHIRFormatError { 9882 CoverageEligibilityResponse res = new CoverageEligibilityResponse(); 9883 parseCoverageEligibilityResponseProperties(json, res); 9884 return res; 9885 } 9886 9887 protected void parseCoverageEligibilityResponseProperties(JsonObject json, CoverageEligibilityResponse res) 9888 throws IOException, FHIRFormatError { 9889 parseDomainResourceProperties(json, res); 9890 if (json.has("identifier")) { 9891 JsonArray array = json.getAsJsonArray("identifier"); 9892 for (int i = 0; i < array.size(); i++) { 9893 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 9894 } 9895 } 9896 ; 9897 if (json.has("status")) 9898 res.setStatusElement( 9899 parseEnumeration(json.get("status").getAsString(), CoverageEligibilityResponse.EligibilityResponseStatus.NULL, 9900 new CoverageEligibilityResponse.EligibilityResponseStatusEnumFactory())); 9901 if (json.has("_status")) 9902 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 9903 if (json.has("purpose")) { 9904 JsonArray array = json.getAsJsonArray("purpose"); 9905 for (int i = 0; i < array.size(); i++) { 9906 if (array.get(i).isJsonNull()) { 9907 res.getPurpose().add(new Enumeration<CoverageEligibilityResponse.EligibilityResponsePurpose>()); 9908 } else { 9909 res.getPurpose() 9910 .add(parseEnumeration(array.get(i).getAsString(), 9911 CoverageEligibilityResponse.EligibilityResponsePurpose.NULL, 9912 new CoverageEligibilityResponse.EligibilityResponsePurposeEnumFactory())); 9913 } 9914 } 9915 } 9916 ; 9917 if (json.has("_purpose")) { 9918 JsonArray array = json.getAsJsonArray("_purpose"); 9919 for (int i = 0; i < array.size(); i++) { 9920 if (i == res.getPurpose().size()) 9921 res.getPurpose().add(parseEnumeration(null, CoverageEligibilityResponse.EligibilityResponsePurpose.NULL, 9922 new CoverageEligibilityResponse.EligibilityResponsePurposeEnumFactory())); 9923 if (array.get(i) instanceof JsonObject) 9924 parseElementProperties(array.get(i).getAsJsonObject(), res.getPurpose().get(i)); 9925 } 9926 } 9927 ; 9928 if (json.has("patient")) 9929 res.setPatient(parseReference(getJObject(json, "patient"))); 9930 Type serviced = parseType("serviced", json); 9931 if (serviced != null) 9932 res.setServiced(serviced); 9933 if (json.has("created")) 9934 res.setCreatedElement(parseDateTime(json.get("created").getAsString())); 9935 if (json.has("_created")) 9936 parseElementProperties(getJObject(json, "_created"), res.getCreatedElement()); 9937 if (json.has("requestor")) 9938 res.setRequestor(parseReference(getJObject(json, "requestor"))); 9939 if (json.has("request")) 9940 res.setRequest(parseReference(getJObject(json, "request"))); 9941 if (json.has("outcome")) 9942 res.setOutcomeElement(parseEnumeration(json.get("outcome").getAsString(), Enumerations.RemittanceOutcome.NULL, 9943 new Enumerations.RemittanceOutcomeEnumFactory())); 9944 if (json.has("_outcome")) 9945 parseElementProperties(getJObject(json, "_outcome"), res.getOutcomeElement()); 9946 if (json.has("disposition")) 9947 res.setDispositionElement(parseString(json.get("disposition").getAsString())); 9948 if (json.has("_disposition")) 9949 parseElementProperties(getJObject(json, "_disposition"), res.getDispositionElement()); 9950 if (json.has("insurer")) 9951 res.setInsurer(parseReference(getJObject(json, "insurer"))); 9952 if (json.has("insurance")) { 9953 JsonArray array = json.getAsJsonArray("insurance"); 9954 for (int i = 0; i < array.size(); i++) { 9955 res.getInsurance().add(parseCoverageEligibilityResponseInsuranceComponent(array.get(i).getAsJsonObject(), res)); 9956 } 9957 } 9958 ; 9959 if (json.has("preAuthRef")) 9960 res.setPreAuthRefElement(parseString(json.get("preAuthRef").getAsString())); 9961 if (json.has("_preAuthRef")) 9962 parseElementProperties(getJObject(json, "_preAuthRef"), res.getPreAuthRefElement()); 9963 if (json.has("form")) 9964 res.setForm(parseCodeableConcept(getJObject(json, "form"))); 9965 if (json.has("error")) { 9966 JsonArray array = json.getAsJsonArray("error"); 9967 for (int i = 0; i < array.size(); i++) { 9968 res.getError().add(parseCoverageEligibilityResponseErrorsComponent(array.get(i).getAsJsonObject(), res)); 9969 } 9970 } 9971 ; 9972 } 9973 9974 protected CoverageEligibilityResponse.InsuranceComponent parseCoverageEligibilityResponseInsuranceComponent( 9975 JsonObject json, CoverageEligibilityResponse owner) throws IOException, FHIRFormatError { 9976 CoverageEligibilityResponse.InsuranceComponent res = new CoverageEligibilityResponse.InsuranceComponent(); 9977 parseCoverageEligibilityResponseInsuranceComponentProperties(json, owner, res); 9978 return res; 9979 } 9980 9981 protected void parseCoverageEligibilityResponseInsuranceComponentProperties(JsonObject json, 9982 CoverageEligibilityResponse owner, CoverageEligibilityResponse.InsuranceComponent res) 9983 throws IOException, FHIRFormatError { 9984 parseBackboneElementProperties(json, res); 9985 if (json.has("coverage")) 9986 res.setCoverage(parseReference(getJObject(json, "coverage"))); 9987 if (json.has("inforce")) 9988 res.setInforceElement(parseBoolean(json.get("inforce").getAsBoolean())); 9989 if (json.has("_inforce")) 9990 parseElementProperties(getJObject(json, "_inforce"), res.getInforceElement()); 9991 if (json.has("benefitPeriod")) 9992 res.setBenefitPeriod(parsePeriod(getJObject(json, "benefitPeriod"))); 9993 if (json.has("item")) { 9994 JsonArray array = json.getAsJsonArray("item"); 9995 for (int i = 0; i < array.size(); i++) { 9996 res.getItem().add(parseCoverageEligibilityResponseItemsComponent(array.get(i).getAsJsonObject(), owner)); 9997 } 9998 } 9999 ; 10000 } 10001 10002 protected CoverageEligibilityResponse.ItemsComponent parseCoverageEligibilityResponseItemsComponent(JsonObject json, 10003 CoverageEligibilityResponse owner) throws IOException, FHIRFormatError { 10004 CoverageEligibilityResponse.ItemsComponent res = new CoverageEligibilityResponse.ItemsComponent(); 10005 parseCoverageEligibilityResponseItemsComponentProperties(json, owner, res); 10006 return res; 10007 } 10008 10009 protected void parseCoverageEligibilityResponseItemsComponentProperties(JsonObject json, 10010 CoverageEligibilityResponse owner, CoverageEligibilityResponse.ItemsComponent res) 10011 throws IOException, FHIRFormatError { 10012 parseBackboneElementProperties(json, res); 10013 if (json.has("category")) 10014 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 10015 if (json.has("productOrService")) 10016 res.setProductOrService(parseCodeableConcept(getJObject(json, "productOrService"))); 10017 if (json.has("modifier")) { 10018 JsonArray array = json.getAsJsonArray("modifier"); 10019 for (int i = 0; i < array.size(); i++) { 10020 res.getModifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 10021 } 10022 } 10023 ; 10024 if (json.has("provider")) 10025 res.setProvider(parseReference(getJObject(json, "provider"))); 10026 if (json.has("excluded")) 10027 res.setExcludedElement(parseBoolean(json.get("excluded").getAsBoolean())); 10028 if (json.has("_excluded")) 10029 parseElementProperties(getJObject(json, "_excluded"), res.getExcludedElement()); 10030 if (json.has("name")) 10031 res.setNameElement(parseString(json.get("name").getAsString())); 10032 if (json.has("_name")) 10033 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 10034 if (json.has("description")) 10035 res.setDescriptionElement(parseString(json.get("description").getAsString())); 10036 if (json.has("_description")) 10037 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 10038 if (json.has("network")) 10039 res.setNetwork(parseCodeableConcept(getJObject(json, "network"))); 10040 if (json.has("unit")) 10041 res.setUnit(parseCodeableConcept(getJObject(json, "unit"))); 10042 if (json.has("term")) 10043 res.setTerm(parseCodeableConcept(getJObject(json, "term"))); 10044 if (json.has("benefit")) { 10045 JsonArray array = json.getAsJsonArray("benefit"); 10046 for (int i = 0; i < array.size(); i++) { 10047 res.getBenefit().add(parseCoverageEligibilityResponseBenefitComponent(array.get(i).getAsJsonObject(), owner)); 10048 } 10049 } 10050 ; 10051 if (json.has("authorizationRequired")) 10052 res.setAuthorizationRequiredElement(parseBoolean(json.get("authorizationRequired").getAsBoolean())); 10053 if (json.has("_authorizationRequired")) 10054 parseElementProperties(getJObject(json, "_authorizationRequired"), res.getAuthorizationRequiredElement()); 10055 if (json.has("authorizationSupporting")) { 10056 JsonArray array = json.getAsJsonArray("authorizationSupporting"); 10057 for (int i = 0; i < array.size(); i++) { 10058 res.getAuthorizationSupporting().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 10059 } 10060 } 10061 ; 10062 if (json.has("authorizationUrl")) 10063 res.setAuthorizationUrlElement(parseUri(json.get("authorizationUrl").getAsString())); 10064 if (json.has("_authorizationUrl")) 10065 parseElementProperties(getJObject(json, "_authorizationUrl"), res.getAuthorizationUrlElement()); 10066 } 10067 10068 protected CoverageEligibilityResponse.BenefitComponent parseCoverageEligibilityResponseBenefitComponent( 10069 JsonObject json, CoverageEligibilityResponse owner) throws IOException, FHIRFormatError { 10070 CoverageEligibilityResponse.BenefitComponent res = new CoverageEligibilityResponse.BenefitComponent(); 10071 parseCoverageEligibilityResponseBenefitComponentProperties(json, owner, res); 10072 return res; 10073 } 10074 10075 protected void parseCoverageEligibilityResponseBenefitComponentProperties(JsonObject json, 10076 CoverageEligibilityResponse owner, CoverageEligibilityResponse.BenefitComponent res) 10077 throws IOException, FHIRFormatError { 10078 parseBackboneElementProperties(json, res); 10079 if (json.has("type")) 10080 res.setType(parseCodeableConcept(getJObject(json, "type"))); 10081 Type allowed = parseType("allowed", json); 10082 if (allowed != null) 10083 res.setAllowed(allowed); 10084 Type used = parseType("used", json); 10085 if (used != null) 10086 res.setUsed(used); 10087 } 10088 10089 protected CoverageEligibilityResponse.ErrorsComponent parseCoverageEligibilityResponseErrorsComponent(JsonObject json, 10090 CoverageEligibilityResponse owner) throws IOException, FHIRFormatError { 10091 CoverageEligibilityResponse.ErrorsComponent res = new CoverageEligibilityResponse.ErrorsComponent(); 10092 parseCoverageEligibilityResponseErrorsComponentProperties(json, owner, res); 10093 return res; 10094 } 10095 10096 protected void parseCoverageEligibilityResponseErrorsComponentProperties(JsonObject json, 10097 CoverageEligibilityResponse owner, CoverageEligibilityResponse.ErrorsComponent res) 10098 throws IOException, FHIRFormatError { 10099 parseBackboneElementProperties(json, res); 10100 if (json.has("code")) 10101 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 10102 } 10103 10104 protected DetectedIssue parseDetectedIssue(JsonObject json) throws IOException, FHIRFormatError { 10105 DetectedIssue res = new DetectedIssue(); 10106 parseDetectedIssueProperties(json, res); 10107 return res; 10108 } 10109 10110 protected void parseDetectedIssueProperties(JsonObject json, DetectedIssue res) throws IOException, FHIRFormatError { 10111 parseDomainResourceProperties(json, res); 10112 if (json.has("identifier")) { 10113 JsonArray array = json.getAsJsonArray("identifier"); 10114 for (int i = 0; i < array.size(); i++) { 10115 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 10116 } 10117 } 10118 ; 10119 if (json.has("status")) 10120 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), DetectedIssue.DetectedIssueStatus.NULL, 10121 new DetectedIssue.DetectedIssueStatusEnumFactory())); 10122 if (json.has("_status")) 10123 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 10124 if (json.has("code")) 10125 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 10126 if (json.has("severity")) 10127 res.setSeverityElement(parseEnumeration(json.get("severity").getAsString(), 10128 DetectedIssue.DetectedIssueSeverity.NULL, new DetectedIssue.DetectedIssueSeverityEnumFactory())); 10129 if (json.has("_severity")) 10130 parseElementProperties(getJObject(json, "_severity"), res.getSeverityElement()); 10131 if (json.has("patient")) 10132 res.setPatient(parseReference(getJObject(json, "patient"))); 10133 Type identified = parseType("identified", json); 10134 if (identified != null) 10135 res.setIdentified(identified); 10136 if (json.has("author")) 10137 res.setAuthor(parseReference(getJObject(json, "author"))); 10138 if (json.has("implicated")) { 10139 JsonArray array = json.getAsJsonArray("implicated"); 10140 for (int i = 0; i < array.size(); i++) { 10141 res.getImplicated().add(parseReference(array.get(i).getAsJsonObject())); 10142 } 10143 } 10144 ; 10145 if (json.has("evidence")) { 10146 JsonArray array = json.getAsJsonArray("evidence"); 10147 for (int i = 0; i < array.size(); i++) { 10148 res.getEvidence().add(parseDetectedIssueDetectedIssueEvidenceComponent(array.get(i).getAsJsonObject(), res)); 10149 } 10150 } 10151 ; 10152 if (json.has("detail")) 10153 res.setDetailElement(parseString(json.get("detail").getAsString())); 10154 if (json.has("_detail")) 10155 parseElementProperties(getJObject(json, "_detail"), res.getDetailElement()); 10156 if (json.has("reference")) 10157 res.setReferenceElement(parseUri(json.get("reference").getAsString())); 10158 if (json.has("_reference")) 10159 parseElementProperties(getJObject(json, "_reference"), res.getReferenceElement()); 10160 if (json.has("mitigation")) { 10161 JsonArray array = json.getAsJsonArray("mitigation"); 10162 for (int i = 0; i < array.size(); i++) { 10163 res.getMitigation() 10164 .add(parseDetectedIssueDetectedIssueMitigationComponent(array.get(i).getAsJsonObject(), res)); 10165 } 10166 } 10167 ; 10168 } 10169 10170 protected DetectedIssue.DetectedIssueEvidenceComponent parseDetectedIssueDetectedIssueEvidenceComponent( 10171 JsonObject json, DetectedIssue owner) throws IOException, FHIRFormatError { 10172 DetectedIssue.DetectedIssueEvidenceComponent res = new DetectedIssue.DetectedIssueEvidenceComponent(); 10173 parseDetectedIssueDetectedIssueEvidenceComponentProperties(json, owner, res); 10174 return res; 10175 } 10176 10177 protected void parseDetectedIssueDetectedIssueEvidenceComponentProperties(JsonObject json, DetectedIssue owner, 10178 DetectedIssue.DetectedIssueEvidenceComponent res) throws IOException, FHIRFormatError { 10179 parseBackboneElementProperties(json, res); 10180 if (json.has("code")) { 10181 JsonArray array = json.getAsJsonArray("code"); 10182 for (int i = 0; i < array.size(); i++) { 10183 res.getCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 10184 } 10185 } 10186 ; 10187 if (json.has("detail")) { 10188 JsonArray array = json.getAsJsonArray("detail"); 10189 for (int i = 0; i < array.size(); i++) { 10190 res.getDetail().add(parseReference(array.get(i).getAsJsonObject())); 10191 } 10192 } 10193 ; 10194 } 10195 10196 protected DetectedIssue.DetectedIssueMitigationComponent parseDetectedIssueDetectedIssueMitigationComponent( 10197 JsonObject json, DetectedIssue owner) throws IOException, FHIRFormatError { 10198 DetectedIssue.DetectedIssueMitigationComponent res = new DetectedIssue.DetectedIssueMitigationComponent(); 10199 parseDetectedIssueDetectedIssueMitigationComponentProperties(json, owner, res); 10200 return res; 10201 } 10202 10203 protected void parseDetectedIssueDetectedIssueMitigationComponentProperties(JsonObject json, DetectedIssue owner, 10204 DetectedIssue.DetectedIssueMitigationComponent res) throws IOException, FHIRFormatError { 10205 parseBackboneElementProperties(json, res); 10206 if (json.has("action")) 10207 res.setAction(parseCodeableConcept(getJObject(json, "action"))); 10208 if (json.has("date")) 10209 res.setDateElement(parseDateTime(json.get("date").getAsString())); 10210 if (json.has("_date")) 10211 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 10212 if (json.has("author")) 10213 res.setAuthor(parseReference(getJObject(json, "author"))); 10214 } 10215 10216 protected Device parseDevice(JsonObject json) throws IOException, FHIRFormatError { 10217 Device res = new Device(); 10218 parseDeviceProperties(json, res); 10219 return res; 10220 } 10221 10222 protected void parseDeviceProperties(JsonObject json, Device res) throws IOException, FHIRFormatError { 10223 parseDomainResourceProperties(json, res); 10224 if (json.has("identifier")) { 10225 JsonArray array = json.getAsJsonArray("identifier"); 10226 for (int i = 0; i < array.size(); i++) { 10227 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 10228 } 10229 } 10230 ; 10231 if (json.has("definition")) 10232 res.setDefinition(parseReference(getJObject(json, "definition"))); 10233 if (json.has("udiCarrier")) { 10234 JsonArray array = json.getAsJsonArray("udiCarrier"); 10235 for (int i = 0; i < array.size(); i++) { 10236 res.getUdiCarrier().add(parseDeviceDeviceUdiCarrierComponent(array.get(i).getAsJsonObject(), res)); 10237 } 10238 } 10239 ; 10240 if (json.has("status")) 10241 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Device.FHIRDeviceStatus.NULL, 10242 new Device.FHIRDeviceStatusEnumFactory())); 10243 if (json.has("_status")) 10244 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 10245 if (json.has("statusReason")) { 10246 JsonArray array = json.getAsJsonArray("statusReason"); 10247 for (int i = 0; i < array.size(); i++) { 10248 res.getStatusReason().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 10249 } 10250 } 10251 ; 10252 if (json.has("distinctIdentifier")) 10253 res.setDistinctIdentifierElement(parseString(json.get("distinctIdentifier").getAsString())); 10254 if (json.has("_distinctIdentifier")) 10255 parseElementProperties(getJObject(json, "_distinctIdentifier"), res.getDistinctIdentifierElement()); 10256 if (json.has("manufacturer")) 10257 res.setManufacturerElement(parseString(json.get("manufacturer").getAsString())); 10258 if (json.has("_manufacturer")) 10259 parseElementProperties(getJObject(json, "_manufacturer"), res.getManufacturerElement()); 10260 if (json.has("manufactureDate")) 10261 res.setManufactureDateElement(parseDateTime(json.get("manufactureDate").getAsString())); 10262 if (json.has("_manufactureDate")) 10263 parseElementProperties(getJObject(json, "_manufactureDate"), res.getManufactureDateElement()); 10264 if (json.has("expirationDate")) 10265 res.setExpirationDateElement(parseDateTime(json.get("expirationDate").getAsString())); 10266 if (json.has("_expirationDate")) 10267 parseElementProperties(getJObject(json, "_expirationDate"), res.getExpirationDateElement()); 10268 if (json.has("lotNumber")) 10269 res.setLotNumberElement(parseString(json.get("lotNumber").getAsString())); 10270 if (json.has("_lotNumber")) 10271 parseElementProperties(getJObject(json, "_lotNumber"), res.getLotNumberElement()); 10272 if (json.has("serialNumber")) 10273 res.setSerialNumberElement(parseString(json.get("serialNumber").getAsString())); 10274 if (json.has("_serialNumber")) 10275 parseElementProperties(getJObject(json, "_serialNumber"), res.getSerialNumberElement()); 10276 if (json.has("deviceName")) { 10277 JsonArray array = json.getAsJsonArray("deviceName"); 10278 for (int i = 0; i < array.size(); i++) { 10279 res.getDeviceName().add(parseDeviceDeviceDeviceNameComponent(array.get(i).getAsJsonObject(), res)); 10280 } 10281 } 10282 ; 10283 if (json.has("modelNumber")) 10284 res.setModelNumberElement(parseString(json.get("modelNumber").getAsString())); 10285 if (json.has("_modelNumber")) 10286 parseElementProperties(getJObject(json, "_modelNumber"), res.getModelNumberElement()); 10287 if (json.has("partNumber")) 10288 res.setPartNumberElement(parseString(json.get("partNumber").getAsString())); 10289 if (json.has("_partNumber")) 10290 parseElementProperties(getJObject(json, "_partNumber"), res.getPartNumberElement()); 10291 if (json.has("type")) 10292 res.setType(parseCodeableConcept(getJObject(json, "type"))); 10293 if (json.has("specialization")) { 10294 JsonArray array = json.getAsJsonArray("specialization"); 10295 for (int i = 0; i < array.size(); i++) { 10296 res.getSpecialization().add(parseDeviceDeviceSpecializationComponent(array.get(i).getAsJsonObject(), res)); 10297 } 10298 } 10299 ; 10300 if (json.has("version")) { 10301 JsonArray array = json.getAsJsonArray("version"); 10302 for (int i = 0; i < array.size(); i++) { 10303 res.getVersion().add(parseDeviceDeviceVersionComponent(array.get(i).getAsJsonObject(), res)); 10304 } 10305 } 10306 ; 10307 if (json.has("property")) { 10308 JsonArray array = json.getAsJsonArray("property"); 10309 for (int i = 0; i < array.size(); i++) { 10310 res.getProperty().add(parseDeviceDevicePropertyComponent(array.get(i).getAsJsonObject(), res)); 10311 } 10312 } 10313 ; 10314 if (json.has("patient")) 10315 res.setPatient(parseReference(getJObject(json, "patient"))); 10316 if (json.has("owner")) 10317 res.setOwner(parseReference(getJObject(json, "owner"))); 10318 if (json.has("contact")) { 10319 JsonArray array = json.getAsJsonArray("contact"); 10320 for (int i = 0; i < array.size(); i++) { 10321 res.getContact().add(parseContactPoint(array.get(i).getAsJsonObject())); 10322 } 10323 } 10324 ; 10325 if (json.has("location")) 10326 res.setLocation(parseReference(getJObject(json, "location"))); 10327 if (json.has("url")) 10328 res.setUrlElement(parseUri(json.get("url").getAsString())); 10329 if (json.has("_url")) 10330 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 10331 if (json.has("note")) { 10332 JsonArray array = json.getAsJsonArray("note"); 10333 for (int i = 0; i < array.size(); i++) { 10334 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 10335 } 10336 } 10337 ; 10338 if (json.has("safety")) { 10339 JsonArray array = json.getAsJsonArray("safety"); 10340 for (int i = 0; i < array.size(); i++) { 10341 res.getSafety().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 10342 } 10343 } 10344 ; 10345 if (json.has("parent")) 10346 res.setParent(parseReference(getJObject(json, "parent"))); 10347 } 10348 10349 protected Device.DeviceUdiCarrierComponent parseDeviceDeviceUdiCarrierComponent(JsonObject json, Device owner) 10350 throws IOException, FHIRFormatError { 10351 Device.DeviceUdiCarrierComponent res = new Device.DeviceUdiCarrierComponent(); 10352 parseDeviceDeviceUdiCarrierComponentProperties(json, owner, res); 10353 return res; 10354 } 10355 10356 protected void parseDeviceDeviceUdiCarrierComponentProperties(JsonObject json, Device owner, 10357 Device.DeviceUdiCarrierComponent res) throws IOException, FHIRFormatError { 10358 parseBackboneElementProperties(json, res); 10359 if (json.has("deviceIdentifier")) 10360 res.setDeviceIdentifierElement(parseString(json.get("deviceIdentifier").getAsString())); 10361 if (json.has("_deviceIdentifier")) 10362 parseElementProperties(getJObject(json, "_deviceIdentifier"), res.getDeviceIdentifierElement()); 10363 if (json.has("issuer")) 10364 res.setIssuerElement(parseUri(json.get("issuer").getAsString())); 10365 if (json.has("_issuer")) 10366 parseElementProperties(getJObject(json, "_issuer"), res.getIssuerElement()); 10367 if (json.has("jurisdiction")) 10368 res.setJurisdictionElement(parseUri(json.get("jurisdiction").getAsString())); 10369 if (json.has("_jurisdiction")) 10370 parseElementProperties(getJObject(json, "_jurisdiction"), res.getJurisdictionElement()); 10371 if (json.has("carrierAIDC")) 10372 res.setCarrierAIDCElement(parseBase64Binary(json.get("carrierAIDC").getAsString())); 10373 if (json.has("_carrierAIDC")) 10374 parseElementProperties(getJObject(json, "_carrierAIDC"), res.getCarrierAIDCElement()); 10375 if (json.has("carrierHRF")) 10376 res.setCarrierHRFElement(parseString(json.get("carrierHRF").getAsString())); 10377 if (json.has("_carrierHRF")) 10378 parseElementProperties(getJObject(json, "_carrierHRF"), res.getCarrierHRFElement()); 10379 if (json.has("entryType")) 10380 res.setEntryTypeElement(parseEnumeration(json.get("entryType").getAsString(), Device.UDIEntryType.NULL, 10381 new Device.UDIEntryTypeEnumFactory())); 10382 if (json.has("_entryType")) 10383 parseElementProperties(getJObject(json, "_entryType"), res.getEntryTypeElement()); 10384 } 10385 10386 protected Device.DeviceDeviceNameComponent parseDeviceDeviceDeviceNameComponent(JsonObject json, Device owner) 10387 throws IOException, FHIRFormatError { 10388 Device.DeviceDeviceNameComponent res = new Device.DeviceDeviceNameComponent(); 10389 parseDeviceDeviceDeviceNameComponentProperties(json, owner, res); 10390 return res; 10391 } 10392 10393 protected void parseDeviceDeviceDeviceNameComponentProperties(JsonObject json, Device owner, 10394 Device.DeviceDeviceNameComponent res) throws IOException, FHIRFormatError { 10395 parseBackboneElementProperties(json, res); 10396 if (json.has("name")) 10397 res.setNameElement(parseString(json.get("name").getAsString())); 10398 if (json.has("_name")) 10399 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 10400 if (json.has("type")) 10401 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), Device.DeviceNameType.NULL, 10402 new Device.DeviceNameTypeEnumFactory())); 10403 if (json.has("_type")) 10404 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 10405 } 10406 10407 protected Device.DeviceSpecializationComponent parseDeviceDeviceSpecializationComponent(JsonObject json, Device owner) 10408 throws IOException, FHIRFormatError { 10409 Device.DeviceSpecializationComponent res = new Device.DeviceSpecializationComponent(); 10410 parseDeviceDeviceSpecializationComponentProperties(json, owner, res); 10411 return res; 10412 } 10413 10414 protected void parseDeviceDeviceSpecializationComponentProperties(JsonObject json, Device owner, 10415 Device.DeviceSpecializationComponent res) throws IOException, FHIRFormatError { 10416 parseBackboneElementProperties(json, res); 10417 if (json.has("systemType")) 10418 res.setSystemType(parseCodeableConcept(getJObject(json, "systemType"))); 10419 if (json.has("version")) 10420 res.setVersionElement(parseString(json.get("version").getAsString())); 10421 if (json.has("_version")) 10422 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 10423 } 10424 10425 protected Device.DeviceVersionComponent parseDeviceDeviceVersionComponent(JsonObject json, Device owner) 10426 throws IOException, FHIRFormatError { 10427 Device.DeviceVersionComponent res = new Device.DeviceVersionComponent(); 10428 parseDeviceDeviceVersionComponentProperties(json, owner, res); 10429 return res; 10430 } 10431 10432 protected void parseDeviceDeviceVersionComponentProperties(JsonObject json, Device owner, 10433 Device.DeviceVersionComponent res) throws IOException, FHIRFormatError { 10434 parseBackboneElementProperties(json, res); 10435 if (json.has("type")) 10436 res.setType(parseCodeableConcept(getJObject(json, "type"))); 10437 if (json.has("component")) 10438 res.setComponent(parseIdentifier(getJObject(json, "component"))); 10439 if (json.has("value")) 10440 res.setValueElement(parseString(json.get("value").getAsString())); 10441 if (json.has("_value")) 10442 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 10443 } 10444 10445 protected Device.DevicePropertyComponent parseDeviceDevicePropertyComponent(JsonObject json, Device owner) 10446 throws IOException, FHIRFormatError { 10447 Device.DevicePropertyComponent res = new Device.DevicePropertyComponent(); 10448 parseDeviceDevicePropertyComponentProperties(json, owner, res); 10449 return res; 10450 } 10451 10452 protected void parseDeviceDevicePropertyComponentProperties(JsonObject json, Device owner, 10453 Device.DevicePropertyComponent res) throws IOException, FHIRFormatError { 10454 parseBackboneElementProperties(json, res); 10455 if (json.has("type")) 10456 res.setType(parseCodeableConcept(getJObject(json, "type"))); 10457 if (json.has("valueQuantity")) { 10458 JsonArray array = json.getAsJsonArray("valueQuantity"); 10459 for (int i = 0; i < array.size(); i++) { 10460 res.getValueQuantity().add(parseQuantity(array.get(i).getAsJsonObject())); 10461 } 10462 } 10463 ; 10464 if (json.has("valueCode")) { 10465 JsonArray array = json.getAsJsonArray("valueCode"); 10466 for (int i = 0; i < array.size(); i++) { 10467 res.getValueCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 10468 } 10469 } 10470 ; 10471 } 10472 10473 protected DeviceDefinition parseDeviceDefinition(JsonObject json) throws IOException, FHIRFormatError { 10474 DeviceDefinition res = new DeviceDefinition(); 10475 parseDeviceDefinitionProperties(json, res); 10476 return res; 10477 } 10478 10479 protected void parseDeviceDefinitionProperties(JsonObject json, DeviceDefinition res) 10480 throws IOException, FHIRFormatError { 10481 parseDomainResourceProperties(json, res); 10482 if (json.has("identifier")) { 10483 JsonArray array = json.getAsJsonArray("identifier"); 10484 for (int i = 0; i < array.size(); i++) { 10485 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 10486 } 10487 } 10488 ; 10489 if (json.has("udiDeviceIdentifier")) { 10490 JsonArray array = json.getAsJsonArray("udiDeviceIdentifier"); 10491 for (int i = 0; i < array.size(); i++) { 10492 res.getUdiDeviceIdentifier().add( 10493 parseDeviceDefinitionDeviceDefinitionUdiDeviceIdentifierComponent(array.get(i).getAsJsonObject(), res)); 10494 } 10495 } 10496 ; 10497 Type manufacturer = parseType("manufacturer", json); 10498 if (manufacturer != null) 10499 res.setManufacturer(manufacturer); 10500 if (json.has("deviceName")) { 10501 JsonArray array = json.getAsJsonArray("deviceName"); 10502 for (int i = 0; i < array.size(); i++) { 10503 res.getDeviceName() 10504 .add(parseDeviceDefinitionDeviceDefinitionDeviceNameComponent(array.get(i).getAsJsonObject(), res)); 10505 } 10506 } 10507 ; 10508 if (json.has("modelNumber")) 10509 res.setModelNumberElement(parseString(json.get("modelNumber").getAsString())); 10510 if (json.has("_modelNumber")) 10511 parseElementProperties(getJObject(json, "_modelNumber"), res.getModelNumberElement()); 10512 if (json.has("type")) 10513 res.setType(parseCodeableConcept(getJObject(json, "type"))); 10514 if (json.has("specialization")) { 10515 JsonArray array = json.getAsJsonArray("specialization"); 10516 for (int i = 0; i < array.size(); i++) { 10517 res.getSpecialization() 10518 .add(parseDeviceDefinitionDeviceDefinitionSpecializationComponent(array.get(i).getAsJsonObject(), res)); 10519 } 10520 } 10521 ; 10522 if (json.has("version")) { 10523 JsonArray array = json.getAsJsonArray("version"); 10524 for (int i = 0; i < array.size(); i++) { 10525 if (array.get(i).isJsonNull()) { 10526 res.getVersion().add(new StringType()); 10527 } else { 10528 res.getVersion().add(parseString(array.get(i).getAsString())); 10529 } 10530 } 10531 } 10532 ; 10533 if (json.has("_version")) { 10534 JsonArray array = json.getAsJsonArray("_version"); 10535 for (int i = 0; i < array.size(); i++) { 10536 if (i == res.getVersion().size()) 10537 res.getVersion().add(parseString(null)); 10538 if (array.get(i) instanceof JsonObject) 10539 parseElementProperties(array.get(i).getAsJsonObject(), res.getVersion().get(i)); 10540 } 10541 } 10542 ; 10543 if (json.has("safety")) { 10544 JsonArray array = json.getAsJsonArray("safety"); 10545 for (int i = 0; i < array.size(); i++) { 10546 res.getSafety().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 10547 } 10548 } 10549 ; 10550 if (json.has("shelfLifeStorage")) { 10551 JsonArray array = json.getAsJsonArray("shelfLifeStorage"); 10552 for (int i = 0; i < array.size(); i++) { 10553 res.getShelfLifeStorage().add(parseProductShelfLife(array.get(i).getAsJsonObject())); 10554 } 10555 } 10556 ; 10557 if (json.has("physicalCharacteristics")) 10558 res.setPhysicalCharacteristics(parseProdCharacteristic(getJObject(json, "physicalCharacteristics"))); 10559 if (json.has("languageCode")) { 10560 JsonArray array = json.getAsJsonArray("languageCode"); 10561 for (int i = 0; i < array.size(); i++) { 10562 res.getLanguageCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 10563 } 10564 } 10565 ; 10566 if (json.has("capability")) { 10567 JsonArray array = json.getAsJsonArray("capability"); 10568 for (int i = 0; i < array.size(); i++) { 10569 res.getCapability() 10570 .add(parseDeviceDefinitionDeviceDefinitionCapabilityComponent(array.get(i).getAsJsonObject(), res)); 10571 } 10572 } 10573 ; 10574 if (json.has("property")) { 10575 JsonArray array = json.getAsJsonArray("property"); 10576 for (int i = 0; i < array.size(); i++) { 10577 res.getProperty() 10578 .add(parseDeviceDefinitionDeviceDefinitionPropertyComponent(array.get(i).getAsJsonObject(), res)); 10579 } 10580 } 10581 ; 10582 if (json.has("owner")) 10583 res.setOwner(parseReference(getJObject(json, "owner"))); 10584 if (json.has("contact")) { 10585 JsonArray array = json.getAsJsonArray("contact"); 10586 for (int i = 0; i < array.size(); i++) { 10587 res.getContact().add(parseContactPoint(array.get(i).getAsJsonObject())); 10588 } 10589 } 10590 ; 10591 if (json.has("url")) 10592 res.setUrlElement(parseUri(json.get("url").getAsString())); 10593 if (json.has("_url")) 10594 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 10595 if (json.has("onlineInformation")) 10596 res.setOnlineInformationElement(parseUri(json.get("onlineInformation").getAsString())); 10597 if (json.has("_onlineInformation")) 10598 parseElementProperties(getJObject(json, "_onlineInformation"), res.getOnlineInformationElement()); 10599 if (json.has("note")) { 10600 JsonArray array = json.getAsJsonArray("note"); 10601 for (int i = 0; i < array.size(); i++) { 10602 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 10603 } 10604 } 10605 ; 10606 if (json.has("quantity")) 10607 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 10608 if (json.has("parentDevice")) 10609 res.setParentDevice(parseReference(getJObject(json, "parentDevice"))); 10610 if (json.has("material")) { 10611 JsonArray array = json.getAsJsonArray("material"); 10612 for (int i = 0; i < array.size(); i++) { 10613 res.getMaterial() 10614 .add(parseDeviceDefinitionDeviceDefinitionMaterialComponent(array.get(i).getAsJsonObject(), res)); 10615 } 10616 } 10617 ; 10618 } 10619 10620 protected DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent parseDeviceDefinitionDeviceDefinitionUdiDeviceIdentifierComponent( 10621 JsonObject json, DeviceDefinition owner) throws IOException, FHIRFormatError { 10622 DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent res = new DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent(); 10623 parseDeviceDefinitionDeviceDefinitionUdiDeviceIdentifierComponentProperties(json, owner, res); 10624 return res; 10625 } 10626 10627 protected void parseDeviceDefinitionDeviceDefinitionUdiDeviceIdentifierComponentProperties(JsonObject json, 10628 DeviceDefinition owner, DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent res) 10629 throws IOException, FHIRFormatError { 10630 parseBackboneElementProperties(json, res); 10631 if (json.has("deviceIdentifier")) 10632 res.setDeviceIdentifierElement(parseString(json.get("deviceIdentifier").getAsString())); 10633 if (json.has("_deviceIdentifier")) 10634 parseElementProperties(getJObject(json, "_deviceIdentifier"), res.getDeviceIdentifierElement()); 10635 if (json.has("issuer")) 10636 res.setIssuerElement(parseUri(json.get("issuer").getAsString())); 10637 if (json.has("_issuer")) 10638 parseElementProperties(getJObject(json, "_issuer"), res.getIssuerElement()); 10639 if (json.has("jurisdiction")) 10640 res.setJurisdictionElement(parseUri(json.get("jurisdiction").getAsString())); 10641 if (json.has("_jurisdiction")) 10642 parseElementProperties(getJObject(json, "_jurisdiction"), res.getJurisdictionElement()); 10643 } 10644 10645 protected DeviceDefinition.DeviceDefinitionDeviceNameComponent parseDeviceDefinitionDeviceDefinitionDeviceNameComponent( 10646 JsonObject json, DeviceDefinition owner) throws IOException, FHIRFormatError { 10647 DeviceDefinition.DeviceDefinitionDeviceNameComponent res = new DeviceDefinition.DeviceDefinitionDeviceNameComponent(); 10648 parseDeviceDefinitionDeviceDefinitionDeviceNameComponentProperties(json, owner, res); 10649 return res; 10650 } 10651 10652 protected void parseDeviceDefinitionDeviceDefinitionDeviceNameComponentProperties(JsonObject json, 10653 DeviceDefinition owner, DeviceDefinition.DeviceDefinitionDeviceNameComponent res) 10654 throws IOException, FHIRFormatError { 10655 parseBackboneElementProperties(json, res); 10656 if (json.has("name")) 10657 res.setNameElement(parseString(json.get("name").getAsString())); 10658 if (json.has("_name")) 10659 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 10660 if (json.has("type")) 10661 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), DeviceDefinition.DeviceNameType.NULL, 10662 new DeviceDefinition.DeviceNameTypeEnumFactory())); 10663 if (json.has("_type")) 10664 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 10665 } 10666 10667 protected DeviceDefinition.DeviceDefinitionSpecializationComponent parseDeviceDefinitionDeviceDefinitionSpecializationComponent( 10668 JsonObject json, DeviceDefinition owner) throws IOException, FHIRFormatError { 10669 DeviceDefinition.DeviceDefinitionSpecializationComponent res = new DeviceDefinition.DeviceDefinitionSpecializationComponent(); 10670 parseDeviceDefinitionDeviceDefinitionSpecializationComponentProperties(json, owner, res); 10671 return res; 10672 } 10673 10674 protected void parseDeviceDefinitionDeviceDefinitionSpecializationComponentProperties(JsonObject json, 10675 DeviceDefinition owner, DeviceDefinition.DeviceDefinitionSpecializationComponent res) 10676 throws IOException, FHIRFormatError { 10677 parseBackboneElementProperties(json, res); 10678 if (json.has("systemType")) 10679 res.setSystemTypeElement(parseString(json.get("systemType").getAsString())); 10680 if (json.has("_systemType")) 10681 parseElementProperties(getJObject(json, "_systemType"), res.getSystemTypeElement()); 10682 if (json.has("version")) 10683 res.setVersionElement(parseString(json.get("version").getAsString())); 10684 if (json.has("_version")) 10685 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 10686 } 10687 10688 protected DeviceDefinition.DeviceDefinitionCapabilityComponent parseDeviceDefinitionDeviceDefinitionCapabilityComponent( 10689 JsonObject json, DeviceDefinition owner) throws IOException, FHIRFormatError { 10690 DeviceDefinition.DeviceDefinitionCapabilityComponent res = new DeviceDefinition.DeviceDefinitionCapabilityComponent(); 10691 parseDeviceDefinitionDeviceDefinitionCapabilityComponentProperties(json, owner, res); 10692 return res; 10693 } 10694 10695 protected void parseDeviceDefinitionDeviceDefinitionCapabilityComponentProperties(JsonObject json, 10696 DeviceDefinition owner, DeviceDefinition.DeviceDefinitionCapabilityComponent res) 10697 throws IOException, FHIRFormatError { 10698 parseBackboneElementProperties(json, res); 10699 if (json.has("type")) 10700 res.setType(parseCodeableConcept(getJObject(json, "type"))); 10701 if (json.has("description")) { 10702 JsonArray array = json.getAsJsonArray("description"); 10703 for (int i = 0; i < array.size(); i++) { 10704 res.getDescription().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 10705 } 10706 } 10707 ; 10708 } 10709 10710 protected DeviceDefinition.DeviceDefinitionPropertyComponent parseDeviceDefinitionDeviceDefinitionPropertyComponent( 10711 JsonObject json, DeviceDefinition owner) throws IOException, FHIRFormatError { 10712 DeviceDefinition.DeviceDefinitionPropertyComponent res = new DeviceDefinition.DeviceDefinitionPropertyComponent(); 10713 parseDeviceDefinitionDeviceDefinitionPropertyComponentProperties(json, owner, res); 10714 return res; 10715 } 10716 10717 protected void parseDeviceDefinitionDeviceDefinitionPropertyComponentProperties(JsonObject json, 10718 DeviceDefinition owner, DeviceDefinition.DeviceDefinitionPropertyComponent res) 10719 throws IOException, FHIRFormatError { 10720 parseBackboneElementProperties(json, res); 10721 if (json.has("type")) 10722 res.setType(parseCodeableConcept(getJObject(json, "type"))); 10723 if (json.has("valueQuantity")) { 10724 JsonArray array = json.getAsJsonArray("valueQuantity"); 10725 for (int i = 0; i < array.size(); i++) { 10726 res.getValueQuantity().add(parseQuantity(array.get(i).getAsJsonObject())); 10727 } 10728 } 10729 ; 10730 if (json.has("valueCode")) { 10731 JsonArray array = json.getAsJsonArray("valueCode"); 10732 for (int i = 0; i < array.size(); i++) { 10733 res.getValueCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 10734 } 10735 } 10736 ; 10737 } 10738 10739 protected DeviceDefinition.DeviceDefinitionMaterialComponent parseDeviceDefinitionDeviceDefinitionMaterialComponent( 10740 JsonObject json, DeviceDefinition owner) throws IOException, FHIRFormatError { 10741 DeviceDefinition.DeviceDefinitionMaterialComponent res = new DeviceDefinition.DeviceDefinitionMaterialComponent(); 10742 parseDeviceDefinitionDeviceDefinitionMaterialComponentProperties(json, owner, res); 10743 return res; 10744 } 10745 10746 protected void parseDeviceDefinitionDeviceDefinitionMaterialComponentProperties(JsonObject json, 10747 DeviceDefinition owner, DeviceDefinition.DeviceDefinitionMaterialComponent res) 10748 throws IOException, FHIRFormatError { 10749 parseBackboneElementProperties(json, res); 10750 if (json.has("substance")) 10751 res.setSubstance(parseCodeableConcept(getJObject(json, "substance"))); 10752 if (json.has("alternate")) 10753 res.setAlternateElement(parseBoolean(json.get("alternate").getAsBoolean())); 10754 if (json.has("_alternate")) 10755 parseElementProperties(getJObject(json, "_alternate"), res.getAlternateElement()); 10756 if (json.has("allergenicIndicator")) 10757 res.setAllergenicIndicatorElement(parseBoolean(json.get("allergenicIndicator").getAsBoolean())); 10758 if (json.has("_allergenicIndicator")) 10759 parseElementProperties(getJObject(json, "_allergenicIndicator"), res.getAllergenicIndicatorElement()); 10760 } 10761 10762 protected DeviceMetric parseDeviceMetric(JsonObject json) throws IOException, FHIRFormatError { 10763 DeviceMetric res = new DeviceMetric(); 10764 parseDeviceMetricProperties(json, res); 10765 return res; 10766 } 10767 10768 protected void parseDeviceMetricProperties(JsonObject json, DeviceMetric res) throws IOException, FHIRFormatError { 10769 parseDomainResourceProperties(json, res); 10770 if (json.has("identifier")) { 10771 JsonArray array = json.getAsJsonArray("identifier"); 10772 for (int i = 0; i < array.size(); i++) { 10773 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 10774 } 10775 } 10776 ; 10777 if (json.has("type")) 10778 res.setType(parseCodeableConcept(getJObject(json, "type"))); 10779 if (json.has("unit")) 10780 res.setUnit(parseCodeableConcept(getJObject(json, "unit"))); 10781 if (json.has("source")) 10782 res.setSource(parseReference(getJObject(json, "source"))); 10783 if (json.has("parent")) 10784 res.setParent(parseReference(getJObject(json, "parent"))); 10785 if (json.has("operationalStatus")) 10786 res.setOperationalStatusElement( 10787 parseEnumeration(json.get("operationalStatus").getAsString(), DeviceMetric.DeviceMetricOperationalStatus.NULL, 10788 new DeviceMetric.DeviceMetricOperationalStatusEnumFactory())); 10789 if (json.has("_operationalStatus")) 10790 parseElementProperties(getJObject(json, "_operationalStatus"), res.getOperationalStatusElement()); 10791 if (json.has("color")) 10792 res.setColorElement(parseEnumeration(json.get("color").getAsString(), DeviceMetric.DeviceMetricColor.NULL, 10793 new DeviceMetric.DeviceMetricColorEnumFactory())); 10794 if (json.has("_color")) 10795 parseElementProperties(getJObject(json, "_color"), res.getColorElement()); 10796 if (json.has("category")) 10797 res.setCategoryElement(parseEnumeration(json.get("category").getAsString(), 10798 DeviceMetric.DeviceMetricCategory.NULL, new DeviceMetric.DeviceMetricCategoryEnumFactory())); 10799 if (json.has("_category")) 10800 parseElementProperties(getJObject(json, "_category"), res.getCategoryElement()); 10801 if (json.has("measurementPeriod")) 10802 res.setMeasurementPeriod(parseTiming(getJObject(json, "measurementPeriod"))); 10803 if (json.has("calibration")) { 10804 JsonArray array = json.getAsJsonArray("calibration"); 10805 for (int i = 0; i < array.size(); i++) { 10806 res.getCalibration() 10807 .add(parseDeviceMetricDeviceMetricCalibrationComponent(array.get(i).getAsJsonObject(), res)); 10808 } 10809 } 10810 ; 10811 } 10812 10813 protected DeviceMetric.DeviceMetricCalibrationComponent parseDeviceMetricDeviceMetricCalibrationComponent( 10814 JsonObject json, DeviceMetric owner) throws IOException, FHIRFormatError { 10815 DeviceMetric.DeviceMetricCalibrationComponent res = new DeviceMetric.DeviceMetricCalibrationComponent(); 10816 parseDeviceMetricDeviceMetricCalibrationComponentProperties(json, owner, res); 10817 return res; 10818 } 10819 10820 protected void parseDeviceMetricDeviceMetricCalibrationComponentProperties(JsonObject json, DeviceMetric owner, 10821 DeviceMetric.DeviceMetricCalibrationComponent res) throws IOException, FHIRFormatError { 10822 parseBackboneElementProperties(json, res); 10823 if (json.has("type")) 10824 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), DeviceMetric.DeviceMetricCalibrationType.NULL, 10825 new DeviceMetric.DeviceMetricCalibrationTypeEnumFactory())); 10826 if (json.has("_type")) 10827 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 10828 if (json.has("state")) 10829 res.setStateElement(parseEnumeration(json.get("state").getAsString(), 10830 DeviceMetric.DeviceMetricCalibrationState.NULL, new DeviceMetric.DeviceMetricCalibrationStateEnumFactory())); 10831 if (json.has("_state")) 10832 parseElementProperties(getJObject(json, "_state"), res.getStateElement()); 10833 if (json.has("time")) 10834 res.setTimeElement(parseInstant(json.get("time").getAsString())); 10835 if (json.has("_time")) 10836 parseElementProperties(getJObject(json, "_time"), res.getTimeElement()); 10837 } 10838 10839 protected DeviceRequest parseDeviceRequest(JsonObject json) throws IOException, FHIRFormatError { 10840 DeviceRequest res = new DeviceRequest(); 10841 parseDeviceRequestProperties(json, res); 10842 return res; 10843 } 10844 10845 protected void parseDeviceRequestProperties(JsonObject json, DeviceRequest res) throws IOException, FHIRFormatError { 10846 parseDomainResourceProperties(json, res); 10847 if (json.has("identifier")) { 10848 JsonArray array = json.getAsJsonArray("identifier"); 10849 for (int i = 0; i < array.size(); i++) { 10850 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 10851 } 10852 } 10853 ; 10854 if (json.has("instantiatesCanonical")) { 10855 JsonArray array = json.getAsJsonArray("instantiatesCanonical"); 10856 for (int i = 0; i < array.size(); i++) { 10857 if (array.get(i).isJsonNull()) { 10858 res.getInstantiatesCanonical().add(new CanonicalType()); 10859 } else { 10860 res.getInstantiatesCanonical().add(parseCanonical(array.get(i).getAsString())); 10861 } 10862 } 10863 } 10864 ; 10865 if (json.has("_instantiatesCanonical")) { 10866 JsonArray array = json.getAsJsonArray("_instantiatesCanonical"); 10867 for (int i = 0; i < array.size(); i++) { 10868 if (i == res.getInstantiatesCanonical().size()) 10869 res.getInstantiatesCanonical().add(parseCanonical(null)); 10870 if (array.get(i) instanceof JsonObject) 10871 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesCanonical().get(i)); 10872 } 10873 } 10874 ; 10875 if (json.has("instantiatesUri")) { 10876 JsonArray array = json.getAsJsonArray("instantiatesUri"); 10877 for (int i = 0; i < array.size(); i++) { 10878 if (array.get(i).isJsonNull()) { 10879 res.getInstantiatesUri().add(new UriType()); 10880 } else { 10881 res.getInstantiatesUri().add(parseUri(array.get(i).getAsString())); 10882 } 10883 } 10884 } 10885 ; 10886 if (json.has("_instantiatesUri")) { 10887 JsonArray array = json.getAsJsonArray("_instantiatesUri"); 10888 for (int i = 0; i < array.size(); i++) { 10889 if (i == res.getInstantiatesUri().size()) 10890 res.getInstantiatesUri().add(parseUri(null)); 10891 if (array.get(i) instanceof JsonObject) 10892 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesUri().get(i)); 10893 } 10894 } 10895 ; 10896 if (json.has("basedOn")) { 10897 JsonArray array = json.getAsJsonArray("basedOn"); 10898 for (int i = 0; i < array.size(); i++) { 10899 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 10900 } 10901 } 10902 ; 10903 if (json.has("priorRequest")) { 10904 JsonArray array = json.getAsJsonArray("priorRequest"); 10905 for (int i = 0; i < array.size(); i++) { 10906 res.getPriorRequest().add(parseReference(array.get(i).getAsJsonObject())); 10907 } 10908 } 10909 ; 10910 if (json.has("groupIdentifier")) 10911 res.setGroupIdentifier(parseIdentifier(getJObject(json, "groupIdentifier"))); 10912 if (json.has("status")) 10913 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), DeviceRequest.DeviceRequestStatus.NULL, 10914 new DeviceRequest.DeviceRequestStatusEnumFactory())); 10915 if (json.has("_status")) 10916 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 10917 if (json.has("intent")) 10918 res.setIntentElement(parseEnumeration(json.get("intent").getAsString(), DeviceRequest.RequestIntent.NULL, 10919 new DeviceRequest.RequestIntentEnumFactory())); 10920 if (json.has("_intent")) 10921 parseElementProperties(getJObject(json, "_intent"), res.getIntentElement()); 10922 if (json.has("priority")) 10923 res.setPriorityElement(parseEnumeration(json.get("priority").getAsString(), DeviceRequest.RequestPriority.NULL, 10924 new DeviceRequest.RequestPriorityEnumFactory())); 10925 if (json.has("_priority")) 10926 parseElementProperties(getJObject(json, "_priority"), res.getPriorityElement()); 10927 Type code = parseType("code", json); 10928 if (code != null) 10929 res.setCode(code); 10930 if (json.has("parameter")) { 10931 JsonArray array = json.getAsJsonArray("parameter"); 10932 for (int i = 0; i < array.size(); i++) { 10933 res.getParameter().add(parseDeviceRequestDeviceRequestParameterComponent(array.get(i).getAsJsonObject(), res)); 10934 } 10935 } 10936 ; 10937 if (json.has("subject")) 10938 res.setSubject(parseReference(getJObject(json, "subject"))); 10939 if (json.has("encounter")) 10940 res.setEncounter(parseReference(getJObject(json, "encounter"))); 10941 Type occurrence = parseType("occurrence", json); 10942 if (occurrence != null) 10943 res.setOccurrence(occurrence); 10944 if (json.has("authoredOn")) 10945 res.setAuthoredOnElement(parseDateTime(json.get("authoredOn").getAsString())); 10946 if (json.has("_authoredOn")) 10947 parseElementProperties(getJObject(json, "_authoredOn"), res.getAuthoredOnElement()); 10948 if (json.has("requester")) 10949 res.setRequester(parseReference(getJObject(json, "requester"))); 10950 if (json.has("performerType")) 10951 res.setPerformerType(parseCodeableConcept(getJObject(json, "performerType"))); 10952 if (json.has("performer")) 10953 res.setPerformer(parseReference(getJObject(json, "performer"))); 10954 if (json.has("reasonCode")) { 10955 JsonArray array = json.getAsJsonArray("reasonCode"); 10956 for (int i = 0; i < array.size(); i++) { 10957 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 10958 } 10959 } 10960 ; 10961 if (json.has("reasonReference")) { 10962 JsonArray array = json.getAsJsonArray("reasonReference"); 10963 for (int i = 0; i < array.size(); i++) { 10964 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 10965 } 10966 } 10967 ; 10968 if (json.has("insurance")) { 10969 JsonArray array = json.getAsJsonArray("insurance"); 10970 for (int i = 0; i < array.size(); i++) { 10971 res.getInsurance().add(parseReference(array.get(i).getAsJsonObject())); 10972 } 10973 } 10974 ; 10975 if (json.has("supportingInfo")) { 10976 JsonArray array = json.getAsJsonArray("supportingInfo"); 10977 for (int i = 0; i < array.size(); i++) { 10978 res.getSupportingInfo().add(parseReference(array.get(i).getAsJsonObject())); 10979 } 10980 } 10981 ; 10982 if (json.has("note")) { 10983 JsonArray array = json.getAsJsonArray("note"); 10984 for (int i = 0; i < array.size(); i++) { 10985 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 10986 } 10987 } 10988 ; 10989 if (json.has("relevantHistory")) { 10990 JsonArray array = json.getAsJsonArray("relevantHistory"); 10991 for (int i = 0; i < array.size(); i++) { 10992 res.getRelevantHistory().add(parseReference(array.get(i).getAsJsonObject())); 10993 } 10994 } 10995 ; 10996 } 10997 10998 protected DeviceRequest.DeviceRequestParameterComponent parseDeviceRequestDeviceRequestParameterComponent( 10999 JsonObject json, DeviceRequest owner) throws IOException, FHIRFormatError { 11000 DeviceRequest.DeviceRequestParameterComponent res = new DeviceRequest.DeviceRequestParameterComponent(); 11001 parseDeviceRequestDeviceRequestParameterComponentProperties(json, owner, res); 11002 return res; 11003 } 11004 11005 protected void parseDeviceRequestDeviceRequestParameterComponentProperties(JsonObject json, DeviceRequest owner, 11006 DeviceRequest.DeviceRequestParameterComponent res) throws IOException, FHIRFormatError { 11007 parseBackboneElementProperties(json, res); 11008 if (json.has("code")) 11009 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 11010 Type value = parseType("value", json); 11011 if (value != null) 11012 res.setValue(value); 11013 } 11014 11015 protected DeviceUseStatement parseDeviceUseStatement(JsonObject json) throws IOException, FHIRFormatError { 11016 DeviceUseStatement res = new DeviceUseStatement(); 11017 parseDeviceUseStatementProperties(json, res); 11018 return res; 11019 } 11020 11021 protected void parseDeviceUseStatementProperties(JsonObject json, DeviceUseStatement res) 11022 throws IOException, FHIRFormatError { 11023 parseDomainResourceProperties(json, res); 11024 if (json.has("identifier")) { 11025 JsonArray array = json.getAsJsonArray("identifier"); 11026 for (int i = 0; i < array.size(); i++) { 11027 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 11028 } 11029 } 11030 ; 11031 if (json.has("basedOn")) { 11032 JsonArray array = json.getAsJsonArray("basedOn"); 11033 for (int i = 0; i < array.size(); i++) { 11034 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 11035 } 11036 } 11037 ; 11038 if (json.has("status")) 11039 res.setStatusElement( 11040 parseEnumeration(json.get("status").getAsString(), DeviceUseStatement.DeviceUseStatementStatus.NULL, 11041 new DeviceUseStatement.DeviceUseStatementStatusEnumFactory())); 11042 if (json.has("_status")) 11043 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 11044 if (json.has("subject")) 11045 res.setSubject(parseReference(getJObject(json, "subject"))); 11046 if (json.has("derivedFrom")) { 11047 JsonArray array = json.getAsJsonArray("derivedFrom"); 11048 for (int i = 0; i < array.size(); i++) { 11049 res.getDerivedFrom().add(parseReference(array.get(i).getAsJsonObject())); 11050 } 11051 } 11052 ; 11053 Type timing = parseType("timing", json); 11054 if (timing != null) 11055 res.setTiming(timing); 11056 if (json.has("recordedOn")) 11057 res.setRecordedOnElement(parseDateTime(json.get("recordedOn").getAsString())); 11058 if (json.has("_recordedOn")) 11059 parseElementProperties(getJObject(json, "_recordedOn"), res.getRecordedOnElement()); 11060 if (json.has("source")) 11061 res.setSource(parseReference(getJObject(json, "source"))); 11062 if (json.has("device")) 11063 res.setDevice(parseReference(getJObject(json, "device"))); 11064 if (json.has("reasonCode")) { 11065 JsonArray array = json.getAsJsonArray("reasonCode"); 11066 for (int i = 0; i < array.size(); i++) { 11067 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 11068 } 11069 } 11070 ; 11071 if (json.has("reasonReference")) { 11072 JsonArray array = json.getAsJsonArray("reasonReference"); 11073 for (int i = 0; i < array.size(); i++) { 11074 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 11075 } 11076 } 11077 ; 11078 if (json.has("bodySite")) 11079 res.setBodySite(parseCodeableConcept(getJObject(json, "bodySite"))); 11080 if (json.has("note")) { 11081 JsonArray array = json.getAsJsonArray("note"); 11082 for (int i = 0; i < array.size(); i++) { 11083 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 11084 } 11085 } 11086 ; 11087 } 11088 11089 protected DiagnosticReport parseDiagnosticReport(JsonObject json) throws IOException, FHIRFormatError { 11090 DiagnosticReport res = new DiagnosticReport(); 11091 parseDiagnosticReportProperties(json, res); 11092 return res; 11093 } 11094 11095 protected void parseDiagnosticReportProperties(JsonObject json, DiagnosticReport res) 11096 throws IOException, FHIRFormatError { 11097 parseDomainResourceProperties(json, res); 11098 if (json.has("identifier")) { 11099 JsonArray array = json.getAsJsonArray("identifier"); 11100 for (int i = 0; i < array.size(); i++) { 11101 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 11102 } 11103 } 11104 ; 11105 if (json.has("basedOn")) { 11106 JsonArray array = json.getAsJsonArray("basedOn"); 11107 for (int i = 0; i < array.size(); i++) { 11108 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 11109 } 11110 } 11111 ; 11112 if (json.has("status")) 11113 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), 11114 DiagnosticReport.DiagnosticReportStatus.NULL, new DiagnosticReport.DiagnosticReportStatusEnumFactory())); 11115 if (json.has("_status")) 11116 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 11117 if (json.has("category")) { 11118 JsonArray array = json.getAsJsonArray("category"); 11119 for (int i = 0; i < array.size(); i++) { 11120 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 11121 } 11122 } 11123 ; 11124 if (json.has("code")) 11125 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 11126 if (json.has("subject")) 11127 res.setSubject(parseReference(getJObject(json, "subject"))); 11128 if (json.has("encounter")) 11129 res.setEncounter(parseReference(getJObject(json, "encounter"))); 11130 Type effective = parseType("effective", json); 11131 if (effective != null) 11132 res.setEffective(effective); 11133 if (json.has("issued")) 11134 res.setIssuedElement(parseInstant(json.get("issued").getAsString())); 11135 if (json.has("_issued")) 11136 parseElementProperties(getJObject(json, "_issued"), res.getIssuedElement()); 11137 if (json.has("performer")) { 11138 JsonArray array = json.getAsJsonArray("performer"); 11139 for (int i = 0; i < array.size(); i++) { 11140 res.getPerformer().add(parseReference(array.get(i).getAsJsonObject())); 11141 } 11142 } 11143 ; 11144 if (json.has("resultsInterpreter")) { 11145 JsonArray array = json.getAsJsonArray("resultsInterpreter"); 11146 for (int i = 0; i < array.size(); i++) { 11147 res.getResultsInterpreter().add(parseReference(array.get(i).getAsJsonObject())); 11148 } 11149 } 11150 ; 11151 if (json.has("specimen")) { 11152 JsonArray array = json.getAsJsonArray("specimen"); 11153 for (int i = 0; i < array.size(); i++) { 11154 res.getSpecimen().add(parseReference(array.get(i).getAsJsonObject())); 11155 } 11156 } 11157 ; 11158 if (json.has("result")) { 11159 JsonArray array = json.getAsJsonArray("result"); 11160 for (int i = 0; i < array.size(); i++) { 11161 res.getResult().add(parseReference(array.get(i).getAsJsonObject())); 11162 } 11163 } 11164 ; 11165 if (json.has("imagingStudy")) { 11166 JsonArray array = json.getAsJsonArray("imagingStudy"); 11167 for (int i = 0; i < array.size(); i++) { 11168 res.getImagingStudy().add(parseReference(array.get(i).getAsJsonObject())); 11169 } 11170 } 11171 ; 11172 if (json.has("media")) { 11173 JsonArray array = json.getAsJsonArray("media"); 11174 for (int i = 0; i < array.size(); i++) { 11175 res.getMedia().add(parseDiagnosticReportDiagnosticReportMediaComponent(array.get(i).getAsJsonObject(), res)); 11176 } 11177 } 11178 ; 11179 if (json.has("conclusion")) 11180 res.setConclusionElement(parseString(json.get("conclusion").getAsString())); 11181 if (json.has("_conclusion")) 11182 parseElementProperties(getJObject(json, "_conclusion"), res.getConclusionElement()); 11183 if (json.has("conclusionCode")) { 11184 JsonArray array = json.getAsJsonArray("conclusionCode"); 11185 for (int i = 0; i < array.size(); i++) { 11186 res.getConclusionCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 11187 } 11188 } 11189 ; 11190 if (json.has("presentedForm")) { 11191 JsonArray array = json.getAsJsonArray("presentedForm"); 11192 for (int i = 0; i < array.size(); i++) { 11193 res.getPresentedForm().add(parseAttachment(array.get(i).getAsJsonObject())); 11194 } 11195 } 11196 ; 11197 } 11198 11199 protected DiagnosticReport.DiagnosticReportMediaComponent parseDiagnosticReportDiagnosticReportMediaComponent( 11200 JsonObject json, DiagnosticReport owner) throws IOException, FHIRFormatError { 11201 DiagnosticReport.DiagnosticReportMediaComponent res = new DiagnosticReport.DiagnosticReportMediaComponent(); 11202 parseDiagnosticReportDiagnosticReportMediaComponentProperties(json, owner, res); 11203 return res; 11204 } 11205 11206 protected void parseDiagnosticReportDiagnosticReportMediaComponentProperties(JsonObject json, DiagnosticReport owner, 11207 DiagnosticReport.DiagnosticReportMediaComponent res) throws IOException, FHIRFormatError { 11208 parseBackboneElementProperties(json, res); 11209 if (json.has("comment")) 11210 res.setCommentElement(parseString(json.get("comment").getAsString())); 11211 if (json.has("_comment")) 11212 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 11213 if (json.has("link")) 11214 res.setLink(parseReference(getJObject(json, "link"))); 11215 } 11216 11217 protected DocumentManifest parseDocumentManifest(JsonObject json) throws IOException, FHIRFormatError { 11218 DocumentManifest res = new DocumentManifest(); 11219 parseDocumentManifestProperties(json, res); 11220 return res; 11221 } 11222 11223 protected void parseDocumentManifestProperties(JsonObject json, DocumentManifest res) 11224 throws IOException, FHIRFormatError { 11225 parseDomainResourceProperties(json, res); 11226 if (json.has("masterIdentifier")) 11227 res.setMasterIdentifier(parseIdentifier(getJObject(json, "masterIdentifier"))); 11228 if (json.has("identifier")) { 11229 JsonArray array = json.getAsJsonArray("identifier"); 11230 for (int i = 0; i < array.size(); i++) { 11231 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 11232 } 11233 } 11234 ; 11235 if (json.has("status")) 11236 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.DocumentReferenceStatus.NULL, 11237 new Enumerations.DocumentReferenceStatusEnumFactory())); 11238 if (json.has("_status")) 11239 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 11240 if (json.has("type")) 11241 res.setType(parseCodeableConcept(getJObject(json, "type"))); 11242 if (json.has("subject")) 11243 res.setSubject(parseReference(getJObject(json, "subject"))); 11244 if (json.has("created")) 11245 res.setCreatedElement(parseDateTime(json.get("created").getAsString())); 11246 if (json.has("_created")) 11247 parseElementProperties(getJObject(json, "_created"), res.getCreatedElement()); 11248 if (json.has("author")) { 11249 JsonArray array = json.getAsJsonArray("author"); 11250 for (int i = 0; i < array.size(); i++) { 11251 res.getAuthor().add(parseReference(array.get(i).getAsJsonObject())); 11252 } 11253 } 11254 ; 11255 if (json.has("recipient")) { 11256 JsonArray array = json.getAsJsonArray("recipient"); 11257 for (int i = 0; i < array.size(); i++) { 11258 res.getRecipient().add(parseReference(array.get(i).getAsJsonObject())); 11259 } 11260 } 11261 ; 11262 if (json.has("source")) 11263 res.setSourceElement(parseUri(json.get("source").getAsString())); 11264 if (json.has("_source")) 11265 parseElementProperties(getJObject(json, "_source"), res.getSourceElement()); 11266 if (json.has("description")) 11267 res.setDescriptionElement(parseString(json.get("description").getAsString())); 11268 if (json.has("_description")) 11269 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 11270 if (json.has("content")) { 11271 JsonArray array = json.getAsJsonArray("content"); 11272 for (int i = 0; i < array.size(); i++) { 11273 res.getContent().add(parseReference(array.get(i).getAsJsonObject())); 11274 } 11275 } 11276 ; 11277 if (json.has("related")) { 11278 JsonArray array = json.getAsJsonArray("related"); 11279 for (int i = 0; i < array.size(); i++) { 11280 res.getRelated() 11281 .add(parseDocumentManifestDocumentManifestRelatedComponent(array.get(i).getAsJsonObject(), res)); 11282 } 11283 } 11284 ; 11285 } 11286 11287 protected DocumentManifest.DocumentManifestRelatedComponent parseDocumentManifestDocumentManifestRelatedComponent( 11288 JsonObject json, DocumentManifest owner) throws IOException, FHIRFormatError { 11289 DocumentManifest.DocumentManifestRelatedComponent res = new DocumentManifest.DocumentManifestRelatedComponent(); 11290 parseDocumentManifestDocumentManifestRelatedComponentProperties(json, owner, res); 11291 return res; 11292 } 11293 11294 protected void parseDocumentManifestDocumentManifestRelatedComponentProperties(JsonObject json, 11295 DocumentManifest owner, DocumentManifest.DocumentManifestRelatedComponent res) 11296 throws IOException, FHIRFormatError { 11297 parseBackboneElementProperties(json, res); 11298 if (json.has("identifier")) 11299 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 11300 if (json.has("ref")) 11301 res.setRef(parseReference(getJObject(json, "ref"))); 11302 } 11303 11304 protected DocumentReference parseDocumentReference(JsonObject json) throws IOException, FHIRFormatError { 11305 DocumentReference res = new DocumentReference(); 11306 parseDocumentReferenceProperties(json, res); 11307 return res; 11308 } 11309 11310 protected void parseDocumentReferenceProperties(JsonObject json, DocumentReference res) 11311 throws IOException, FHIRFormatError { 11312 parseDomainResourceProperties(json, res); 11313 if (json.has("masterIdentifier")) 11314 res.setMasterIdentifier(parseIdentifier(getJObject(json, "masterIdentifier"))); 11315 if (json.has("identifier")) { 11316 JsonArray array = json.getAsJsonArray("identifier"); 11317 for (int i = 0; i < array.size(); i++) { 11318 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 11319 } 11320 } 11321 ; 11322 if (json.has("status")) 11323 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.DocumentReferenceStatus.NULL, 11324 new Enumerations.DocumentReferenceStatusEnumFactory())); 11325 if (json.has("_status")) 11326 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 11327 if (json.has("docStatus")) 11328 res.setDocStatusElement(parseEnumeration(json.get("docStatus").getAsString(), 11329 DocumentReference.ReferredDocumentStatus.NULL, new DocumentReference.ReferredDocumentStatusEnumFactory())); 11330 if (json.has("_docStatus")) 11331 parseElementProperties(getJObject(json, "_docStatus"), res.getDocStatusElement()); 11332 if (json.has("type")) 11333 res.setType(parseCodeableConcept(getJObject(json, "type"))); 11334 if (json.has("category")) { 11335 JsonArray array = json.getAsJsonArray("category"); 11336 for (int i = 0; i < array.size(); i++) { 11337 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 11338 } 11339 } 11340 ; 11341 if (json.has("subject")) 11342 res.setSubject(parseReference(getJObject(json, "subject"))); 11343 if (json.has("date")) 11344 res.setDateElement(parseInstant(json.get("date").getAsString())); 11345 if (json.has("_date")) 11346 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 11347 if (json.has("author")) { 11348 JsonArray array = json.getAsJsonArray("author"); 11349 for (int i = 0; i < array.size(); i++) { 11350 res.getAuthor().add(parseReference(array.get(i).getAsJsonObject())); 11351 } 11352 } 11353 ; 11354 if (json.has("authenticator")) 11355 res.setAuthenticator(parseReference(getJObject(json, "authenticator"))); 11356 if (json.has("custodian")) 11357 res.setCustodian(parseReference(getJObject(json, "custodian"))); 11358 if (json.has("relatesTo")) { 11359 JsonArray array = json.getAsJsonArray("relatesTo"); 11360 for (int i = 0; i < array.size(); i++) { 11361 res.getRelatesTo() 11362 .add(parseDocumentReferenceDocumentReferenceRelatesToComponent(array.get(i).getAsJsonObject(), res)); 11363 } 11364 } 11365 ; 11366 if (json.has("description")) 11367 res.setDescriptionElement(parseString(json.get("description").getAsString())); 11368 if (json.has("_description")) 11369 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 11370 if (json.has("securityLabel")) { 11371 JsonArray array = json.getAsJsonArray("securityLabel"); 11372 for (int i = 0; i < array.size(); i++) { 11373 res.getSecurityLabel().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 11374 } 11375 } 11376 ; 11377 if (json.has("content")) { 11378 JsonArray array = json.getAsJsonArray("content"); 11379 for (int i = 0; i < array.size(); i++) { 11380 res.getContent() 11381 .add(parseDocumentReferenceDocumentReferenceContentComponent(array.get(i).getAsJsonObject(), res)); 11382 } 11383 } 11384 ; 11385 if (json.has("context")) 11386 res.setContext(parseDocumentReferenceDocumentReferenceContextComponent(getJObject(json, "context"), res)); 11387 } 11388 11389 protected DocumentReference.DocumentReferenceRelatesToComponent parseDocumentReferenceDocumentReferenceRelatesToComponent( 11390 JsonObject json, DocumentReference owner) throws IOException, FHIRFormatError { 11391 DocumentReference.DocumentReferenceRelatesToComponent res = new DocumentReference.DocumentReferenceRelatesToComponent(); 11392 parseDocumentReferenceDocumentReferenceRelatesToComponentProperties(json, owner, res); 11393 return res; 11394 } 11395 11396 protected void parseDocumentReferenceDocumentReferenceRelatesToComponentProperties(JsonObject json, 11397 DocumentReference owner, DocumentReference.DocumentReferenceRelatesToComponent res) 11398 throws IOException, FHIRFormatError { 11399 parseBackboneElementProperties(json, res); 11400 if (json.has("code")) 11401 res.setCodeElement( 11402 parseEnumeration(json.get("code").getAsString(), DocumentReference.DocumentRelationshipType.NULL, 11403 new DocumentReference.DocumentRelationshipTypeEnumFactory())); 11404 if (json.has("_code")) 11405 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 11406 if (json.has("target")) 11407 res.setTarget(parseReference(getJObject(json, "target"))); 11408 } 11409 11410 protected DocumentReference.DocumentReferenceContentComponent parseDocumentReferenceDocumentReferenceContentComponent( 11411 JsonObject json, DocumentReference owner) throws IOException, FHIRFormatError { 11412 DocumentReference.DocumentReferenceContentComponent res = new DocumentReference.DocumentReferenceContentComponent(); 11413 parseDocumentReferenceDocumentReferenceContentComponentProperties(json, owner, res); 11414 return res; 11415 } 11416 11417 protected void parseDocumentReferenceDocumentReferenceContentComponentProperties(JsonObject json, 11418 DocumentReference owner, DocumentReference.DocumentReferenceContentComponent res) 11419 throws IOException, FHIRFormatError { 11420 parseBackboneElementProperties(json, res); 11421 if (json.has("attachment")) 11422 res.setAttachment(parseAttachment(getJObject(json, "attachment"))); 11423 if (json.has("format")) 11424 res.setFormat(parseCoding(getJObject(json, "format"))); 11425 } 11426 11427 protected DocumentReference.DocumentReferenceContextComponent parseDocumentReferenceDocumentReferenceContextComponent( 11428 JsonObject json, DocumentReference owner) throws IOException, FHIRFormatError { 11429 DocumentReference.DocumentReferenceContextComponent res = new DocumentReference.DocumentReferenceContextComponent(); 11430 parseDocumentReferenceDocumentReferenceContextComponentProperties(json, owner, res); 11431 return res; 11432 } 11433 11434 protected void parseDocumentReferenceDocumentReferenceContextComponentProperties(JsonObject json, 11435 DocumentReference owner, DocumentReference.DocumentReferenceContextComponent res) 11436 throws IOException, FHIRFormatError { 11437 parseBackboneElementProperties(json, res); 11438 if (json.has("encounter")) { 11439 JsonArray array = json.getAsJsonArray("encounter"); 11440 for (int i = 0; i < array.size(); i++) { 11441 res.getEncounter().add(parseReference(array.get(i).getAsJsonObject())); 11442 } 11443 } 11444 ; 11445 if (json.has("event")) { 11446 JsonArray array = json.getAsJsonArray("event"); 11447 for (int i = 0; i < array.size(); i++) { 11448 res.getEvent().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 11449 } 11450 } 11451 ; 11452 if (json.has("period")) 11453 res.setPeriod(parsePeriod(getJObject(json, "period"))); 11454 if (json.has("facilityType")) 11455 res.setFacilityType(parseCodeableConcept(getJObject(json, "facilityType"))); 11456 if (json.has("practiceSetting")) 11457 res.setPracticeSetting(parseCodeableConcept(getJObject(json, "practiceSetting"))); 11458 if (json.has("sourcePatientInfo")) 11459 res.setSourcePatientInfo(parseReference(getJObject(json, "sourcePatientInfo"))); 11460 if (json.has("related")) { 11461 JsonArray array = json.getAsJsonArray("related"); 11462 for (int i = 0; i < array.size(); i++) { 11463 res.getRelated().add(parseReference(array.get(i).getAsJsonObject())); 11464 } 11465 } 11466 ; 11467 } 11468 11469 protected EffectEvidenceSynthesis parseEffectEvidenceSynthesis(JsonObject json) throws IOException, FHIRFormatError { 11470 EffectEvidenceSynthesis res = new EffectEvidenceSynthesis(); 11471 parseEffectEvidenceSynthesisProperties(json, res); 11472 return res; 11473 } 11474 11475 protected void parseEffectEvidenceSynthesisProperties(JsonObject json, EffectEvidenceSynthesis res) 11476 throws IOException, FHIRFormatError { 11477 parseDomainResourceProperties(json, res); 11478 if (json.has("url")) 11479 res.setUrlElement(parseUri(json.get("url").getAsString())); 11480 if (json.has("_url")) 11481 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 11482 if (json.has("identifier")) { 11483 JsonArray array = json.getAsJsonArray("identifier"); 11484 for (int i = 0; i < array.size(); i++) { 11485 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 11486 } 11487 } 11488 ; 11489 if (json.has("version")) 11490 res.setVersionElement(parseString(json.get("version").getAsString())); 11491 if (json.has("_version")) 11492 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 11493 if (json.has("name")) 11494 res.setNameElement(parseString(json.get("name").getAsString())); 11495 if (json.has("_name")) 11496 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 11497 if (json.has("title")) 11498 res.setTitleElement(parseString(json.get("title").getAsString())); 11499 if (json.has("_title")) 11500 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 11501 if (json.has("status")) 11502 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 11503 new Enumerations.PublicationStatusEnumFactory())); 11504 if (json.has("_status")) 11505 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 11506 if (json.has("date")) 11507 res.setDateElement(parseDateTime(json.get("date").getAsString())); 11508 if (json.has("_date")) 11509 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 11510 if (json.has("publisher")) 11511 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 11512 if (json.has("_publisher")) 11513 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 11514 if (json.has("contact")) { 11515 JsonArray array = json.getAsJsonArray("contact"); 11516 for (int i = 0; i < array.size(); i++) { 11517 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 11518 } 11519 } 11520 ; 11521 if (json.has("description")) 11522 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 11523 if (json.has("_description")) 11524 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 11525 if (json.has("note")) { 11526 JsonArray array = json.getAsJsonArray("note"); 11527 for (int i = 0; i < array.size(); i++) { 11528 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 11529 } 11530 } 11531 ; 11532 if (json.has("useContext")) { 11533 JsonArray array = json.getAsJsonArray("useContext"); 11534 for (int i = 0; i < array.size(); i++) { 11535 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 11536 } 11537 } 11538 ; 11539 if (json.has("jurisdiction")) { 11540 JsonArray array = json.getAsJsonArray("jurisdiction"); 11541 for (int i = 0; i < array.size(); i++) { 11542 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 11543 } 11544 } 11545 ; 11546 if (json.has("copyright")) 11547 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 11548 if (json.has("_copyright")) 11549 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 11550 if (json.has("approvalDate")) 11551 res.setApprovalDateElement(parseDate(json.get("approvalDate").getAsString())); 11552 if (json.has("_approvalDate")) 11553 parseElementProperties(getJObject(json, "_approvalDate"), res.getApprovalDateElement()); 11554 if (json.has("lastReviewDate")) 11555 res.setLastReviewDateElement(parseDate(json.get("lastReviewDate").getAsString())); 11556 if (json.has("_lastReviewDate")) 11557 parseElementProperties(getJObject(json, "_lastReviewDate"), res.getLastReviewDateElement()); 11558 if (json.has("effectivePeriod")) 11559 res.setEffectivePeriod(parsePeriod(getJObject(json, "effectivePeriod"))); 11560 if (json.has("topic")) { 11561 JsonArray array = json.getAsJsonArray("topic"); 11562 for (int i = 0; i < array.size(); i++) { 11563 res.getTopic().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 11564 } 11565 } 11566 ; 11567 if (json.has("author")) { 11568 JsonArray array = json.getAsJsonArray("author"); 11569 for (int i = 0; i < array.size(); i++) { 11570 res.getAuthor().add(parseContactDetail(array.get(i).getAsJsonObject())); 11571 } 11572 } 11573 ; 11574 if (json.has("editor")) { 11575 JsonArray array = json.getAsJsonArray("editor"); 11576 for (int i = 0; i < array.size(); i++) { 11577 res.getEditor().add(parseContactDetail(array.get(i).getAsJsonObject())); 11578 } 11579 } 11580 ; 11581 if (json.has("reviewer")) { 11582 JsonArray array = json.getAsJsonArray("reviewer"); 11583 for (int i = 0; i < array.size(); i++) { 11584 res.getReviewer().add(parseContactDetail(array.get(i).getAsJsonObject())); 11585 } 11586 } 11587 ; 11588 if (json.has("endorser")) { 11589 JsonArray array = json.getAsJsonArray("endorser"); 11590 for (int i = 0; i < array.size(); i++) { 11591 res.getEndorser().add(parseContactDetail(array.get(i).getAsJsonObject())); 11592 } 11593 } 11594 ; 11595 if (json.has("relatedArtifact")) { 11596 JsonArray array = json.getAsJsonArray("relatedArtifact"); 11597 for (int i = 0; i < array.size(); i++) { 11598 res.getRelatedArtifact().add(parseRelatedArtifact(array.get(i).getAsJsonObject())); 11599 } 11600 } 11601 ; 11602 if (json.has("synthesisType")) 11603 res.setSynthesisType(parseCodeableConcept(getJObject(json, "synthesisType"))); 11604 if (json.has("studyType")) 11605 res.setStudyType(parseCodeableConcept(getJObject(json, "studyType"))); 11606 if (json.has("population")) 11607 res.setPopulation(parseReference(getJObject(json, "population"))); 11608 if (json.has("exposure")) 11609 res.setExposure(parseReference(getJObject(json, "exposure"))); 11610 if (json.has("exposureAlternative")) 11611 res.setExposureAlternative(parseReference(getJObject(json, "exposureAlternative"))); 11612 if (json.has("outcome")) 11613 res.setOutcome(parseReference(getJObject(json, "outcome"))); 11614 if (json.has("sampleSize")) 11615 res.setSampleSize( 11616 parseEffectEvidenceSynthesisEffectEvidenceSynthesisSampleSizeComponent(getJObject(json, "sampleSize"), res)); 11617 if (json.has("resultsByExposure")) { 11618 JsonArray array = json.getAsJsonArray("resultsByExposure"); 11619 for (int i = 0; i < array.size(); i++) { 11620 res.getResultsByExposure().add(parseEffectEvidenceSynthesisEffectEvidenceSynthesisResultsByExposureComponent( 11621 array.get(i).getAsJsonObject(), res)); 11622 } 11623 } 11624 ; 11625 if (json.has("effectEstimate")) { 11626 JsonArray array = json.getAsJsonArray("effectEstimate"); 11627 for (int i = 0; i < array.size(); i++) { 11628 res.getEffectEstimate().add(parseEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimateComponent( 11629 array.get(i).getAsJsonObject(), res)); 11630 } 11631 } 11632 ; 11633 if (json.has("certainty")) { 11634 JsonArray array = json.getAsJsonArray("certainty"); 11635 for (int i = 0; i < array.size(); i++) { 11636 res.getCertainty().add( 11637 parseEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyComponent(array.get(i).getAsJsonObject(), res)); 11638 } 11639 } 11640 ; 11641 } 11642 11643 protected EffectEvidenceSynthesis.EffectEvidenceSynthesisSampleSizeComponent parseEffectEvidenceSynthesisEffectEvidenceSynthesisSampleSizeComponent( 11644 JsonObject json, EffectEvidenceSynthesis owner) throws IOException, FHIRFormatError { 11645 EffectEvidenceSynthesis.EffectEvidenceSynthesisSampleSizeComponent res = new EffectEvidenceSynthesis.EffectEvidenceSynthesisSampleSizeComponent(); 11646 parseEffectEvidenceSynthesisEffectEvidenceSynthesisSampleSizeComponentProperties(json, owner, res); 11647 return res; 11648 } 11649 11650 protected void parseEffectEvidenceSynthesisEffectEvidenceSynthesisSampleSizeComponentProperties(JsonObject json, 11651 EffectEvidenceSynthesis owner, EffectEvidenceSynthesis.EffectEvidenceSynthesisSampleSizeComponent res) 11652 throws IOException, FHIRFormatError { 11653 parseBackboneElementProperties(json, res); 11654 if (json.has("description")) 11655 res.setDescriptionElement(parseString(json.get("description").getAsString())); 11656 if (json.has("_description")) 11657 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 11658 if (json.has("numberOfStudies")) 11659 res.setNumberOfStudiesElement(parseInteger(json.get("numberOfStudies").getAsLong())); 11660 if (json.has("_numberOfStudies")) 11661 parseElementProperties(getJObject(json, "_numberOfStudies"), res.getNumberOfStudiesElement()); 11662 if (json.has("numberOfParticipants")) 11663 res.setNumberOfParticipantsElement(parseInteger(json.get("numberOfParticipants").getAsLong())); 11664 if (json.has("_numberOfParticipants")) 11665 parseElementProperties(getJObject(json, "_numberOfParticipants"), res.getNumberOfParticipantsElement()); 11666 } 11667 11668 protected EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent parseEffectEvidenceSynthesisEffectEvidenceSynthesisResultsByExposureComponent( 11669 JsonObject json, EffectEvidenceSynthesis owner) throws IOException, FHIRFormatError { 11670 EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent res = new EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent(); 11671 parseEffectEvidenceSynthesisEffectEvidenceSynthesisResultsByExposureComponentProperties(json, owner, res); 11672 return res; 11673 } 11674 11675 protected void parseEffectEvidenceSynthesisEffectEvidenceSynthesisResultsByExposureComponentProperties( 11676 JsonObject json, EffectEvidenceSynthesis owner, 11677 EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent res) 11678 throws IOException, FHIRFormatError { 11679 parseBackboneElementProperties(json, res); 11680 if (json.has("description")) 11681 res.setDescriptionElement(parseString(json.get("description").getAsString())); 11682 if (json.has("_description")) 11683 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 11684 if (json.has("exposureState")) 11685 res.setExposureStateElement(parseEnumeration(json.get("exposureState").getAsString(), 11686 EffectEvidenceSynthesis.ExposureState.NULL, new EffectEvidenceSynthesis.ExposureStateEnumFactory())); 11687 if (json.has("_exposureState")) 11688 parseElementProperties(getJObject(json, "_exposureState"), res.getExposureStateElement()); 11689 if (json.has("variantState")) 11690 res.setVariantState(parseCodeableConcept(getJObject(json, "variantState"))); 11691 if (json.has("riskEvidenceSynthesis")) 11692 res.setRiskEvidenceSynthesis(parseReference(getJObject(json, "riskEvidenceSynthesis"))); 11693 } 11694 11695 protected EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent parseEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimateComponent( 11696 JsonObject json, EffectEvidenceSynthesis owner) throws IOException, FHIRFormatError { 11697 EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent res = new EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent(); 11698 parseEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimateComponentProperties(json, owner, res); 11699 return res; 11700 } 11701 11702 protected void parseEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimateComponentProperties(JsonObject json, 11703 EffectEvidenceSynthesis owner, EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent res) 11704 throws IOException, FHIRFormatError { 11705 parseBackboneElementProperties(json, res); 11706 if (json.has("description")) 11707 res.setDescriptionElement(parseString(json.get("description").getAsString())); 11708 if (json.has("_description")) 11709 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 11710 if (json.has("type")) 11711 res.setType(parseCodeableConcept(getJObject(json, "type"))); 11712 if (json.has("variantState")) 11713 res.setVariantState(parseCodeableConcept(getJObject(json, "variantState"))); 11714 if (json.has("value")) 11715 res.setValueElement(parseDecimal(json.get("value").getAsBigDecimal())); 11716 if (json.has("_value")) 11717 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 11718 if (json.has("unitOfMeasure")) 11719 res.setUnitOfMeasure(parseCodeableConcept(getJObject(json, "unitOfMeasure"))); 11720 if (json.has("precisionEstimate")) { 11721 JsonArray array = json.getAsJsonArray("precisionEstimate"); 11722 for (int i = 0; i < array.size(); i++) { 11723 res.getPrecisionEstimate() 11724 .add(parseEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent( 11725 array.get(i).getAsJsonObject(), owner)); 11726 } 11727 } 11728 ; 11729 } 11730 11731 protected EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent parseEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent( 11732 JsonObject json, EffectEvidenceSynthesis owner) throws IOException, FHIRFormatError { 11733 EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent res = new EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent(); 11734 parseEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponentProperties(json, owner, 11735 res); 11736 return res; 11737 } 11738 11739 protected void parseEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponentProperties( 11740 JsonObject json, EffectEvidenceSynthesis owner, 11741 EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent res) 11742 throws IOException, FHIRFormatError { 11743 parseBackboneElementProperties(json, res); 11744 if (json.has("type")) 11745 res.setType(parseCodeableConcept(getJObject(json, "type"))); 11746 if (json.has("level")) 11747 res.setLevelElement(parseDecimal(json.get("level").getAsBigDecimal())); 11748 if (json.has("_level")) 11749 parseElementProperties(getJObject(json, "_level"), res.getLevelElement()); 11750 if (json.has("from")) 11751 res.setFromElement(parseDecimal(json.get("from").getAsBigDecimal())); 11752 if (json.has("_from")) 11753 parseElementProperties(getJObject(json, "_from"), res.getFromElement()); 11754 if (json.has("to")) 11755 res.setToElement(parseDecimal(json.get("to").getAsBigDecimal())); 11756 if (json.has("_to")) 11757 parseElementProperties(getJObject(json, "_to"), res.getToElement()); 11758 } 11759 11760 protected EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent parseEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyComponent( 11761 JsonObject json, EffectEvidenceSynthesis owner) throws IOException, FHIRFormatError { 11762 EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent res = new EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent(); 11763 parseEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyComponentProperties(json, owner, res); 11764 return res; 11765 } 11766 11767 protected void parseEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyComponentProperties(JsonObject json, 11768 EffectEvidenceSynthesis owner, EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent res) 11769 throws IOException, FHIRFormatError { 11770 parseBackboneElementProperties(json, res); 11771 if (json.has("rating")) { 11772 JsonArray array = json.getAsJsonArray("rating"); 11773 for (int i = 0; i < array.size(); i++) { 11774 res.getRating().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 11775 } 11776 } 11777 ; 11778 if (json.has("note")) { 11779 JsonArray array = json.getAsJsonArray("note"); 11780 for (int i = 0; i < array.size(); i++) { 11781 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 11782 } 11783 } 11784 ; 11785 if (json.has("certaintySubcomponent")) { 11786 JsonArray array = json.getAsJsonArray("certaintySubcomponent"); 11787 for (int i = 0; i < array.size(); i++) { 11788 res.getCertaintySubcomponent() 11789 .add(parseEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent( 11790 array.get(i).getAsJsonObject(), owner)); 11791 } 11792 } 11793 ; 11794 } 11795 11796 protected EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent parseEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent( 11797 JsonObject json, EffectEvidenceSynthesis owner) throws IOException, FHIRFormatError { 11798 EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent res = new EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent(); 11799 parseEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyCertaintySubcomponentComponentProperties(json, owner, 11800 res); 11801 return res; 11802 } 11803 11804 protected void parseEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyCertaintySubcomponentComponentProperties( 11805 JsonObject json, EffectEvidenceSynthesis owner, 11806 EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent res) 11807 throws IOException, FHIRFormatError { 11808 parseBackboneElementProperties(json, res); 11809 if (json.has("type")) 11810 res.setType(parseCodeableConcept(getJObject(json, "type"))); 11811 if (json.has("rating")) { 11812 JsonArray array = json.getAsJsonArray("rating"); 11813 for (int i = 0; i < array.size(); i++) { 11814 res.getRating().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 11815 } 11816 } 11817 ; 11818 if (json.has("note")) { 11819 JsonArray array = json.getAsJsonArray("note"); 11820 for (int i = 0; i < array.size(); i++) { 11821 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 11822 } 11823 } 11824 ; 11825 } 11826 11827 protected Encounter parseEncounter(JsonObject json) throws IOException, FHIRFormatError { 11828 Encounter res = new Encounter(); 11829 parseEncounterProperties(json, res); 11830 return res; 11831 } 11832 11833 protected void parseEncounterProperties(JsonObject json, Encounter res) throws IOException, FHIRFormatError { 11834 parseDomainResourceProperties(json, res); 11835 if (json.has("identifier")) { 11836 JsonArray array = json.getAsJsonArray("identifier"); 11837 for (int i = 0; i < array.size(); i++) { 11838 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 11839 } 11840 } 11841 ; 11842 if (json.has("status")) 11843 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Encounter.EncounterStatus.NULL, 11844 new Encounter.EncounterStatusEnumFactory())); 11845 if (json.has("_status")) 11846 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 11847 if (json.has("statusHistory")) { 11848 JsonArray array = json.getAsJsonArray("statusHistory"); 11849 for (int i = 0; i < array.size(); i++) { 11850 res.getStatusHistory().add(parseEncounterStatusHistoryComponent(array.get(i).getAsJsonObject(), res)); 11851 } 11852 } 11853 ; 11854 if (json.has("class")) 11855 res.setClass_(parseCoding(getJObject(json, "class"))); 11856 if (json.has("classHistory")) { 11857 JsonArray array = json.getAsJsonArray("classHistory"); 11858 for (int i = 0; i < array.size(); i++) { 11859 res.getClassHistory().add(parseEncounterClassHistoryComponent(array.get(i).getAsJsonObject(), res)); 11860 } 11861 } 11862 ; 11863 if (json.has("type")) { 11864 JsonArray array = json.getAsJsonArray("type"); 11865 for (int i = 0; i < array.size(); i++) { 11866 res.getType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 11867 } 11868 } 11869 ; 11870 if (json.has("serviceType")) 11871 res.setServiceType(parseCodeableConcept(getJObject(json, "serviceType"))); 11872 if (json.has("priority")) 11873 res.setPriority(parseCodeableConcept(getJObject(json, "priority"))); 11874 if (json.has("subject")) 11875 res.setSubject(parseReference(getJObject(json, "subject"))); 11876 if (json.has("episodeOfCare")) { 11877 JsonArray array = json.getAsJsonArray("episodeOfCare"); 11878 for (int i = 0; i < array.size(); i++) { 11879 res.getEpisodeOfCare().add(parseReference(array.get(i).getAsJsonObject())); 11880 } 11881 } 11882 ; 11883 if (json.has("basedOn")) { 11884 JsonArray array = json.getAsJsonArray("basedOn"); 11885 for (int i = 0; i < array.size(); i++) { 11886 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 11887 } 11888 } 11889 ; 11890 if (json.has("participant")) { 11891 JsonArray array = json.getAsJsonArray("participant"); 11892 for (int i = 0; i < array.size(); i++) { 11893 res.getParticipant().add(parseEncounterEncounterParticipantComponent(array.get(i).getAsJsonObject(), res)); 11894 } 11895 } 11896 ; 11897 if (json.has("appointment")) { 11898 JsonArray array = json.getAsJsonArray("appointment"); 11899 for (int i = 0; i < array.size(); i++) { 11900 res.getAppointment().add(parseReference(array.get(i).getAsJsonObject())); 11901 } 11902 } 11903 ; 11904 if (json.has("period")) 11905 res.setPeriod(parsePeriod(getJObject(json, "period"))); 11906 if (json.has("length")) 11907 res.setLength(parseDuration(getJObject(json, "length"))); 11908 if (json.has("reasonCode")) { 11909 JsonArray array = json.getAsJsonArray("reasonCode"); 11910 for (int i = 0; i < array.size(); i++) { 11911 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 11912 } 11913 } 11914 ; 11915 if (json.has("reasonReference")) { 11916 JsonArray array = json.getAsJsonArray("reasonReference"); 11917 for (int i = 0; i < array.size(); i++) { 11918 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 11919 } 11920 } 11921 ; 11922 if (json.has("diagnosis")) { 11923 JsonArray array = json.getAsJsonArray("diagnosis"); 11924 for (int i = 0; i < array.size(); i++) { 11925 res.getDiagnosis().add(parseEncounterDiagnosisComponent(array.get(i).getAsJsonObject(), res)); 11926 } 11927 } 11928 ; 11929 if (json.has("account")) { 11930 JsonArray array = json.getAsJsonArray("account"); 11931 for (int i = 0; i < array.size(); i++) { 11932 res.getAccount().add(parseReference(array.get(i).getAsJsonObject())); 11933 } 11934 } 11935 ; 11936 if (json.has("hospitalization")) 11937 res.setHospitalization(parseEncounterEncounterHospitalizationComponent(getJObject(json, "hospitalization"), res)); 11938 if (json.has("location")) { 11939 JsonArray array = json.getAsJsonArray("location"); 11940 for (int i = 0; i < array.size(); i++) { 11941 res.getLocation().add(parseEncounterEncounterLocationComponent(array.get(i).getAsJsonObject(), res)); 11942 } 11943 } 11944 ; 11945 if (json.has("serviceProvider")) 11946 res.setServiceProvider(parseReference(getJObject(json, "serviceProvider"))); 11947 if (json.has("partOf")) 11948 res.setPartOf(parseReference(getJObject(json, "partOf"))); 11949 } 11950 11951 protected Encounter.StatusHistoryComponent parseEncounterStatusHistoryComponent(JsonObject json, Encounter owner) 11952 throws IOException, FHIRFormatError { 11953 Encounter.StatusHistoryComponent res = new Encounter.StatusHistoryComponent(); 11954 parseEncounterStatusHistoryComponentProperties(json, owner, res); 11955 return res; 11956 } 11957 11958 protected void parseEncounterStatusHistoryComponentProperties(JsonObject json, Encounter owner, 11959 Encounter.StatusHistoryComponent res) throws IOException, FHIRFormatError { 11960 parseBackboneElementProperties(json, res); 11961 if (json.has("status")) 11962 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Encounter.EncounterStatus.NULL, 11963 new Encounter.EncounterStatusEnumFactory())); 11964 if (json.has("_status")) 11965 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 11966 if (json.has("period")) 11967 res.setPeriod(parsePeriod(getJObject(json, "period"))); 11968 } 11969 11970 protected Encounter.ClassHistoryComponent parseEncounterClassHistoryComponent(JsonObject json, Encounter owner) 11971 throws IOException, FHIRFormatError { 11972 Encounter.ClassHistoryComponent res = new Encounter.ClassHistoryComponent(); 11973 parseEncounterClassHistoryComponentProperties(json, owner, res); 11974 return res; 11975 } 11976 11977 protected void parseEncounterClassHistoryComponentProperties(JsonObject json, Encounter owner, 11978 Encounter.ClassHistoryComponent res) throws IOException, FHIRFormatError { 11979 parseBackboneElementProperties(json, res); 11980 if (json.has("class")) 11981 res.setClass_(parseCoding(getJObject(json, "class"))); 11982 if (json.has("period")) 11983 res.setPeriod(parsePeriod(getJObject(json, "period"))); 11984 } 11985 11986 protected Encounter.EncounterParticipantComponent parseEncounterEncounterParticipantComponent(JsonObject json, 11987 Encounter owner) throws IOException, FHIRFormatError { 11988 Encounter.EncounterParticipantComponent res = new Encounter.EncounterParticipantComponent(); 11989 parseEncounterEncounterParticipantComponentProperties(json, owner, res); 11990 return res; 11991 } 11992 11993 protected void parseEncounterEncounterParticipantComponentProperties(JsonObject json, Encounter owner, 11994 Encounter.EncounterParticipantComponent res) throws IOException, FHIRFormatError { 11995 parseBackboneElementProperties(json, res); 11996 if (json.has("type")) { 11997 JsonArray array = json.getAsJsonArray("type"); 11998 for (int i = 0; i < array.size(); i++) { 11999 res.getType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 12000 } 12001 } 12002 ; 12003 if (json.has("period")) 12004 res.setPeriod(parsePeriod(getJObject(json, "period"))); 12005 if (json.has("individual")) 12006 res.setIndividual(parseReference(getJObject(json, "individual"))); 12007 } 12008 12009 protected Encounter.DiagnosisComponent parseEncounterDiagnosisComponent(JsonObject json, Encounter owner) 12010 throws IOException, FHIRFormatError { 12011 Encounter.DiagnosisComponent res = new Encounter.DiagnosisComponent(); 12012 parseEncounterDiagnosisComponentProperties(json, owner, res); 12013 return res; 12014 } 12015 12016 protected void parseEncounterDiagnosisComponentProperties(JsonObject json, Encounter owner, 12017 Encounter.DiagnosisComponent res) throws IOException, FHIRFormatError { 12018 parseBackboneElementProperties(json, res); 12019 if (json.has("condition")) 12020 res.setCondition(parseReference(getJObject(json, "condition"))); 12021 if (json.has("use")) 12022 res.setUse(parseCodeableConcept(getJObject(json, "use"))); 12023 if (json.has("rank")) 12024 res.setRankElement(parsePositiveInt(json.get("rank").getAsString())); 12025 if (json.has("_rank")) 12026 parseElementProperties(getJObject(json, "_rank"), res.getRankElement()); 12027 } 12028 12029 protected Encounter.EncounterHospitalizationComponent parseEncounterEncounterHospitalizationComponent(JsonObject json, 12030 Encounter owner) throws IOException, FHIRFormatError { 12031 Encounter.EncounterHospitalizationComponent res = new Encounter.EncounterHospitalizationComponent(); 12032 parseEncounterEncounterHospitalizationComponentProperties(json, owner, res); 12033 return res; 12034 } 12035 12036 protected void parseEncounterEncounterHospitalizationComponentProperties(JsonObject json, Encounter owner, 12037 Encounter.EncounterHospitalizationComponent res) throws IOException, FHIRFormatError { 12038 parseBackboneElementProperties(json, res); 12039 if (json.has("preAdmissionIdentifier")) 12040 res.setPreAdmissionIdentifier(parseIdentifier(getJObject(json, "preAdmissionIdentifier"))); 12041 if (json.has("origin")) 12042 res.setOrigin(parseReference(getJObject(json, "origin"))); 12043 if (json.has("admitSource")) 12044 res.setAdmitSource(parseCodeableConcept(getJObject(json, "admitSource"))); 12045 if (json.has("reAdmission")) 12046 res.setReAdmission(parseCodeableConcept(getJObject(json, "reAdmission"))); 12047 if (json.has("dietPreference")) { 12048 JsonArray array = json.getAsJsonArray("dietPreference"); 12049 for (int i = 0; i < array.size(); i++) { 12050 res.getDietPreference().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 12051 } 12052 } 12053 ; 12054 if (json.has("specialCourtesy")) { 12055 JsonArray array = json.getAsJsonArray("specialCourtesy"); 12056 for (int i = 0; i < array.size(); i++) { 12057 res.getSpecialCourtesy().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 12058 } 12059 } 12060 ; 12061 if (json.has("specialArrangement")) { 12062 JsonArray array = json.getAsJsonArray("specialArrangement"); 12063 for (int i = 0; i < array.size(); i++) { 12064 res.getSpecialArrangement().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 12065 } 12066 } 12067 ; 12068 if (json.has("destination")) 12069 res.setDestination(parseReference(getJObject(json, "destination"))); 12070 if (json.has("dischargeDisposition")) 12071 res.setDischargeDisposition(parseCodeableConcept(getJObject(json, "dischargeDisposition"))); 12072 } 12073 12074 protected Encounter.EncounterLocationComponent parseEncounterEncounterLocationComponent(JsonObject json, 12075 Encounter owner) throws IOException, FHIRFormatError { 12076 Encounter.EncounterLocationComponent res = new Encounter.EncounterLocationComponent(); 12077 parseEncounterEncounterLocationComponentProperties(json, owner, res); 12078 return res; 12079 } 12080 12081 protected void parseEncounterEncounterLocationComponentProperties(JsonObject json, Encounter owner, 12082 Encounter.EncounterLocationComponent res) throws IOException, FHIRFormatError { 12083 parseBackboneElementProperties(json, res); 12084 if (json.has("location")) 12085 res.setLocation(parseReference(getJObject(json, "location"))); 12086 if (json.has("status")) 12087 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Encounter.EncounterLocationStatus.NULL, 12088 new Encounter.EncounterLocationStatusEnumFactory())); 12089 if (json.has("_status")) 12090 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 12091 if (json.has("physicalType")) 12092 res.setPhysicalType(parseCodeableConcept(getJObject(json, "physicalType"))); 12093 if (json.has("period")) 12094 res.setPeriod(parsePeriod(getJObject(json, "period"))); 12095 } 12096 12097 protected Endpoint parseEndpoint(JsonObject json) throws IOException, FHIRFormatError { 12098 Endpoint res = new Endpoint(); 12099 parseEndpointProperties(json, res); 12100 return res; 12101 } 12102 12103 protected void parseEndpointProperties(JsonObject json, Endpoint res) throws IOException, FHIRFormatError { 12104 parseDomainResourceProperties(json, res); 12105 if (json.has("identifier")) { 12106 JsonArray array = json.getAsJsonArray("identifier"); 12107 for (int i = 0; i < array.size(); i++) { 12108 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 12109 } 12110 } 12111 ; 12112 if (json.has("status")) 12113 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Endpoint.EndpointStatus.NULL, 12114 new Endpoint.EndpointStatusEnumFactory())); 12115 if (json.has("_status")) 12116 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 12117 if (json.has("connectionType")) 12118 res.setConnectionType(parseCoding(getJObject(json, "connectionType"))); 12119 if (json.has("name")) 12120 res.setNameElement(parseString(json.get("name").getAsString())); 12121 if (json.has("_name")) 12122 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 12123 if (json.has("managingOrganization")) 12124 res.setManagingOrganization(parseReference(getJObject(json, "managingOrganization"))); 12125 if (json.has("contact")) { 12126 JsonArray array = json.getAsJsonArray("contact"); 12127 for (int i = 0; i < array.size(); i++) { 12128 res.getContact().add(parseContactPoint(array.get(i).getAsJsonObject())); 12129 } 12130 } 12131 ; 12132 if (json.has("period")) 12133 res.setPeriod(parsePeriod(getJObject(json, "period"))); 12134 if (json.has("payloadType")) { 12135 JsonArray array = json.getAsJsonArray("payloadType"); 12136 for (int i = 0; i < array.size(); i++) { 12137 res.getPayloadType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 12138 } 12139 } 12140 ; 12141 if (json.has("payloadMimeType")) { 12142 JsonArray array = json.getAsJsonArray("payloadMimeType"); 12143 for (int i = 0; i < array.size(); i++) { 12144 if (array.get(i).isJsonNull()) { 12145 res.getPayloadMimeType().add(new CodeType()); 12146 } else { 12147 res.getPayloadMimeType().add(parseCode(array.get(i).getAsString())); 12148 } 12149 } 12150 } 12151 ; 12152 if (json.has("_payloadMimeType")) { 12153 JsonArray array = json.getAsJsonArray("_payloadMimeType"); 12154 for (int i = 0; i < array.size(); i++) { 12155 if (i == res.getPayloadMimeType().size()) 12156 res.getPayloadMimeType().add(parseCode(null)); 12157 if (array.get(i) instanceof JsonObject) 12158 parseElementProperties(array.get(i).getAsJsonObject(), res.getPayloadMimeType().get(i)); 12159 } 12160 } 12161 ; 12162 if (json.has("address")) 12163 res.setAddressElement(parseUrl(json.get("address").getAsString())); 12164 if (json.has("_address")) 12165 parseElementProperties(getJObject(json, "_address"), res.getAddressElement()); 12166 if (json.has("header")) { 12167 JsonArray array = json.getAsJsonArray("header"); 12168 for (int i = 0; i < array.size(); i++) { 12169 if (array.get(i).isJsonNull()) { 12170 res.getHeader().add(new StringType()); 12171 } else { 12172 res.getHeader().add(parseString(array.get(i).getAsString())); 12173 } 12174 } 12175 } 12176 ; 12177 if (json.has("_header")) { 12178 JsonArray array = json.getAsJsonArray("_header"); 12179 for (int i = 0; i < array.size(); i++) { 12180 if (i == res.getHeader().size()) 12181 res.getHeader().add(parseString(null)); 12182 if (array.get(i) instanceof JsonObject) 12183 parseElementProperties(array.get(i).getAsJsonObject(), res.getHeader().get(i)); 12184 } 12185 } 12186 ; 12187 } 12188 12189 protected EnrollmentRequest parseEnrollmentRequest(JsonObject json) throws IOException, FHIRFormatError { 12190 EnrollmentRequest res = new EnrollmentRequest(); 12191 parseEnrollmentRequestProperties(json, res); 12192 return res; 12193 } 12194 12195 protected void parseEnrollmentRequestProperties(JsonObject json, EnrollmentRequest res) 12196 throws IOException, FHIRFormatError { 12197 parseDomainResourceProperties(json, res); 12198 if (json.has("identifier")) { 12199 JsonArray array = json.getAsJsonArray("identifier"); 12200 for (int i = 0; i < array.size(); i++) { 12201 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 12202 } 12203 } 12204 ; 12205 if (json.has("status")) 12206 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), 12207 EnrollmentRequest.EnrollmentRequestStatus.NULL, new EnrollmentRequest.EnrollmentRequestStatusEnumFactory())); 12208 if (json.has("_status")) 12209 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 12210 if (json.has("created")) 12211 res.setCreatedElement(parseDateTime(json.get("created").getAsString())); 12212 if (json.has("_created")) 12213 parseElementProperties(getJObject(json, "_created"), res.getCreatedElement()); 12214 if (json.has("insurer")) 12215 res.setInsurer(parseReference(getJObject(json, "insurer"))); 12216 if (json.has("provider")) 12217 res.setProvider(parseReference(getJObject(json, "provider"))); 12218 if (json.has("candidate")) 12219 res.setCandidate(parseReference(getJObject(json, "candidate"))); 12220 if (json.has("coverage")) 12221 res.setCoverage(parseReference(getJObject(json, "coverage"))); 12222 } 12223 12224 protected EnrollmentResponse parseEnrollmentResponse(JsonObject json) throws IOException, FHIRFormatError { 12225 EnrollmentResponse res = new EnrollmentResponse(); 12226 parseEnrollmentResponseProperties(json, res); 12227 return res; 12228 } 12229 12230 protected void parseEnrollmentResponseProperties(JsonObject json, EnrollmentResponse res) 12231 throws IOException, FHIRFormatError { 12232 parseDomainResourceProperties(json, res); 12233 if (json.has("identifier")) { 12234 JsonArray array = json.getAsJsonArray("identifier"); 12235 for (int i = 0; i < array.size(); i++) { 12236 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 12237 } 12238 } 12239 ; 12240 if (json.has("status")) 12241 res.setStatusElement( 12242 parseEnumeration(json.get("status").getAsString(), EnrollmentResponse.EnrollmentResponseStatus.NULL, 12243 new EnrollmentResponse.EnrollmentResponseStatusEnumFactory())); 12244 if (json.has("_status")) 12245 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 12246 if (json.has("request")) 12247 res.setRequest(parseReference(getJObject(json, "request"))); 12248 if (json.has("outcome")) 12249 res.setOutcomeElement(parseEnumeration(json.get("outcome").getAsString(), Enumerations.RemittanceOutcome.NULL, 12250 new Enumerations.RemittanceOutcomeEnumFactory())); 12251 if (json.has("_outcome")) 12252 parseElementProperties(getJObject(json, "_outcome"), res.getOutcomeElement()); 12253 if (json.has("disposition")) 12254 res.setDispositionElement(parseString(json.get("disposition").getAsString())); 12255 if (json.has("_disposition")) 12256 parseElementProperties(getJObject(json, "_disposition"), res.getDispositionElement()); 12257 if (json.has("created")) 12258 res.setCreatedElement(parseDateTime(json.get("created").getAsString())); 12259 if (json.has("_created")) 12260 parseElementProperties(getJObject(json, "_created"), res.getCreatedElement()); 12261 if (json.has("organization")) 12262 res.setOrganization(parseReference(getJObject(json, "organization"))); 12263 if (json.has("requestProvider")) 12264 res.setRequestProvider(parseReference(getJObject(json, "requestProvider"))); 12265 } 12266 12267 protected EpisodeOfCare parseEpisodeOfCare(JsonObject json) throws IOException, FHIRFormatError { 12268 EpisodeOfCare res = new EpisodeOfCare(); 12269 parseEpisodeOfCareProperties(json, res); 12270 return res; 12271 } 12272 12273 protected void parseEpisodeOfCareProperties(JsonObject json, EpisodeOfCare res) throws IOException, FHIRFormatError { 12274 parseDomainResourceProperties(json, res); 12275 if (json.has("identifier")) { 12276 JsonArray array = json.getAsJsonArray("identifier"); 12277 for (int i = 0; i < array.size(); i++) { 12278 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 12279 } 12280 } 12281 ; 12282 if (json.has("status")) 12283 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), EpisodeOfCare.EpisodeOfCareStatus.NULL, 12284 new EpisodeOfCare.EpisodeOfCareStatusEnumFactory())); 12285 if (json.has("_status")) 12286 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 12287 if (json.has("statusHistory")) { 12288 JsonArray array = json.getAsJsonArray("statusHistory"); 12289 for (int i = 0; i < array.size(); i++) { 12290 res.getStatusHistory() 12291 .add(parseEpisodeOfCareEpisodeOfCareStatusHistoryComponent(array.get(i).getAsJsonObject(), res)); 12292 } 12293 } 12294 ; 12295 if (json.has("type")) { 12296 JsonArray array = json.getAsJsonArray("type"); 12297 for (int i = 0; i < array.size(); i++) { 12298 res.getType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 12299 } 12300 } 12301 ; 12302 if (json.has("diagnosis")) { 12303 JsonArray array = json.getAsJsonArray("diagnosis"); 12304 for (int i = 0; i < array.size(); i++) { 12305 res.getDiagnosis().add(parseEpisodeOfCareDiagnosisComponent(array.get(i).getAsJsonObject(), res)); 12306 } 12307 } 12308 ; 12309 if (json.has("patient")) 12310 res.setPatient(parseReference(getJObject(json, "patient"))); 12311 if (json.has("managingOrganization")) 12312 res.setManagingOrganization(parseReference(getJObject(json, "managingOrganization"))); 12313 if (json.has("period")) 12314 res.setPeriod(parsePeriod(getJObject(json, "period"))); 12315 if (json.has("referralRequest")) { 12316 JsonArray array = json.getAsJsonArray("referralRequest"); 12317 for (int i = 0; i < array.size(); i++) { 12318 res.getReferralRequest().add(parseReference(array.get(i).getAsJsonObject())); 12319 } 12320 } 12321 ; 12322 if (json.has("careManager")) 12323 res.setCareManager(parseReference(getJObject(json, "careManager"))); 12324 if (json.has("team")) { 12325 JsonArray array = json.getAsJsonArray("team"); 12326 for (int i = 0; i < array.size(); i++) { 12327 res.getTeam().add(parseReference(array.get(i).getAsJsonObject())); 12328 } 12329 } 12330 ; 12331 if (json.has("account")) { 12332 JsonArray array = json.getAsJsonArray("account"); 12333 for (int i = 0; i < array.size(); i++) { 12334 res.getAccount().add(parseReference(array.get(i).getAsJsonObject())); 12335 } 12336 } 12337 ; 12338 } 12339 12340 protected EpisodeOfCare.EpisodeOfCareStatusHistoryComponent parseEpisodeOfCareEpisodeOfCareStatusHistoryComponent( 12341 JsonObject json, EpisodeOfCare owner) throws IOException, FHIRFormatError { 12342 EpisodeOfCare.EpisodeOfCareStatusHistoryComponent res = new EpisodeOfCare.EpisodeOfCareStatusHistoryComponent(); 12343 parseEpisodeOfCareEpisodeOfCareStatusHistoryComponentProperties(json, owner, res); 12344 return res; 12345 } 12346 12347 protected void parseEpisodeOfCareEpisodeOfCareStatusHistoryComponentProperties(JsonObject json, EpisodeOfCare owner, 12348 EpisodeOfCare.EpisodeOfCareStatusHistoryComponent res) throws IOException, FHIRFormatError { 12349 parseBackboneElementProperties(json, res); 12350 if (json.has("status")) 12351 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), EpisodeOfCare.EpisodeOfCareStatus.NULL, 12352 new EpisodeOfCare.EpisodeOfCareStatusEnumFactory())); 12353 if (json.has("_status")) 12354 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 12355 if (json.has("period")) 12356 res.setPeriod(parsePeriod(getJObject(json, "period"))); 12357 } 12358 12359 protected EpisodeOfCare.DiagnosisComponent parseEpisodeOfCareDiagnosisComponent(JsonObject json, EpisodeOfCare owner) 12360 throws IOException, FHIRFormatError { 12361 EpisodeOfCare.DiagnosisComponent res = new EpisodeOfCare.DiagnosisComponent(); 12362 parseEpisodeOfCareDiagnosisComponentProperties(json, owner, res); 12363 return res; 12364 } 12365 12366 protected void parseEpisodeOfCareDiagnosisComponentProperties(JsonObject json, EpisodeOfCare owner, 12367 EpisodeOfCare.DiagnosisComponent res) throws IOException, FHIRFormatError { 12368 parseBackboneElementProperties(json, res); 12369 if (json.has("condition")) 12370 res.setCondition(parseReference(getJObject(json, "condition"))); 12371 if (json.has("role")) 12372 res.setRole(parseCodeableConcept(getJObject(json, "role"))); 12373 if (json.has("rank")) 12374 res.setRankElement(parsePositiveInt(json.get("rank").getAsString())); 12375 if (json.has("_rank")) 12376 parseElementProperties(getJObject(json, "_rank"), res.getRankElement()); 12377 } 12378 12379 protected EventDefinition parseEventDefinition(JsonObject json) throws IOException, FHIRFormatError { 12380 EventDefinition res = new EventDefinition(); 12381 parseEventDefinitionProperties(json, res); 12382 return res; 12383 } 12384 12385 protected void parseEventDefinitionProperties(JsonObject json, EventDefinition res) 12386 throws IOException, FHIRFormatError { 12387 parseDomainResourceProperties(json, res); 12388 if (json.has("url")) 12389 res.setUrlElement(parseUri(json.get("url").getAsString())); 12390 if (json.has("_url")) 12391 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 12392 if (json.has("identifier")) { 12393 JsonArray array = json.getAsJsonArray("identifier"); 12394 for (int i = 0; i < array.size(); i++) { 12395 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 12396 } 12397 } 12398 ; 12399 if (json.has("version")) 12400 res.setVersionElement(parseString(json.get("version").getAsString())); 12401 if (json.has("_version")) 12402 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 12403 if (json.has("name")) 12404 res.setNameElement(parseString(json.get("name").getAsString())); 12405 if (json.has("_name")) 12406 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 12407 if (json.has("title")) 12408 res.setTitleElement(parseString(json.get("title").getAsString())); 12409 if (json.has("_title")) 12410 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 12411 if (json.has("subtitle")) 12412 res.setSubtitleElement(parseString(json.get("subtitle").getAsString())); 12413 if (json.has("_subtitle")) 12414 parseElementProperties(getJObject(json, "_subtitle"), res.getSubtitleElement()); 12415 if (json.has("status")) 12416 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 12417 new Enumerations.PublicationStatusEnumFactory())); 12418 if (json.has("_status")) 12419 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 12420 if (json.has("experimental")) 12421 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 12422 if (json.has("_experimental")) 12423 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 12424 Type subject = parseType("subject", json); 12425 if (subject != null) 12426 res.setSubject(subject); 12427 if (json.has("date")) 12428 res.setDateElement(parseDateTime(json.get("date").getAsString())); 12429 if (json.has("_date")) 12430 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 12431 if (json.has("publisher")) 12432 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 12433 if (json.has("_publisher")) 12434 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 12435 if (json.has("contact")) { 12436 JsonArray array = json.getAsJsonArray("contact"); 12437 for (int i = 0; i < array.size(); i++) { 12438 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 12439 } 12440 } 12441 ; 12442 if (json.has("description")) 12443 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 12444 if (json.has("_description")) 12445 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 12446 if (json.has("useContext")) { 12447 JsonArray array = json.getAsJsonArray("useContext"); 12448 for (int i = 0; i < array.size(); i++) { 12449 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 12450 } 12451 } 12452 ; 12453 if (json.has("jurisdiction")) { 12454 JsonArray array = json.getAsJsonArray("jurisdiction"); 12455 for (int i = 0; i < array.size(); i++) { 12456 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 12457 } 12458 } 12459 ; 12460 if (json.has("purpose")) 12461 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 12462 if (json.has("_purpose")) 12463 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 12464 if (json.has("usage")) 12465 res.setUsageElement(parseString(json.get("usage").getAsString())); 12466 if (json.has("_usage")) 12467 parseElementProperties(getJObject(json, "_usage"), res.getUsageElement()); 12468 if (json.has("copyright")) 12469 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 12470 if (json.has("_copyright")) 12471 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 12472 if (json.has("approvalDate")) 12473 res.setApprovalDateElement(parseDate(json.get("approvalDate").getAsString())); 12474 if (json.has("_approvalDate")) 12475 parseElementProperties(getJObject(json, "_approvalDate"), res.getApprovalDateElement()); 12476 if (json.has("lastReviewDate")) 12477 res.setLastReviewDateElement(parseDate(json.get("lastReviewDate").getAsString())); 12478 if (json.has("_lastReviewDate")) 12479 parseElementProperties(getJObject(json, "_lastReviewDate"), res.getLastReviewDateElement()); 12480 if (json.has("effectivePeriod")) 12481 res.setEffectivePeriod(parsePeriod(getJObject(json, "effectivePeriod"))); 12482 if (json.has("topic")) { 12483 JsonArray array = json.getAsJsonArray("topic"); 12484 for (int i = 0; i < array.size(); i++) { 12485 res.getTopic().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 12486 } 12487 } 12488 ; 12489 if (json.has("author")) { 12490 JsonArray array = json.getAsJsonArray("author"); 12491 for (int i = 0; i < array.size(); i++) { 12492 res.getAuthor().add(parseContactDetail(array.get(i).getAsJsonObject())); 12493 } 12494 } 12495 ; 12496 if (json.has("editor")) { 12497 JsonArray array = json.getAsJsonArray("editor"); 12498 for (int i = 0; i < array.size(); i++) { 12499 res.getEditor().add(parseContactDetail(array.get(i).getAsJsonObject())); 12500 } 12501 } 12502 ; 12503 if (json.has("reviewer")) { 12504 JsonArray array = json.getAsJsonArray("reviewer"); 12505 for (int i = 0; i < array.size(); i++) { 12506 res.getReviewer().add(parseContactDetail(array.get(i).getAsJsonObject())); 12507 } 12508 } 12509 ; 12510 if (json.has("endorser")) { 12511 JsonArray array = json.getAsJsonArray("endorser"); 12512 for (int i = 0; i < array.size(); i++) { 12513 res.getEndorser().add(parseContactDetail(array.get(i).getAsJsonObject())); 12514 } 12515 } 12516 ; 12517 if (json.has("relatedArtifact")) { 12518 JsonArray array = json.getAsJsonArray("relatedArtifact"); 12519 for (int i = 0; i < array.size(); i++) { 12520 res.getRelatedArtifact().add(parseRelatedArtifact(array.get(i).getAsJsonObject())); 12521 } 12522 } 12523 ; 12524 if (json.has("trigger")) { 12525 JsonArray array = json.getAsJsonArray("trigger"); 12526 for (int i = 0; i < array.size(); i++) { 12527 res.getTrigger().add(parseTriggerDefinition(array.get(i).getAsJsonObject())); 12528 } 12529 } 12530 ; 12531 } 12532 12533 protected Evidence parseEvidence(JsonObject json) throws IOException, FHIRFormatError { 12534 Evidence res = new Evidence(); 12535 parseEvidenceProperties(json, res); 12536 return res; 12537 } 12538 12539 protected void parseEvidenceProperties(JsonObject json, Evidence res) throws IOException, FHIRFormatError { 12540 parseDomainResourceProperties(json, res); 12541 if (json.has("url")) 12542 res.setUrlElement(parseUri(json.get("url").getAsString())); 12543 if (json.has("_url")) 12544 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 12545 if (json.has("identifier")) { 12546 JsonArray array = json.getAsJsonArray("identifier"); 12547 for (int i = 0; i < array.size(); i++) { 12548 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 12549 } 12550 } 12551 ; 12552 if (json.has("version")) 12553 res.setVersionElement(parseString(json.get("version").getAsString())); 12554 if (json.has("_version")) 12555 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 12556 if (json.has("name")) 12557 res.setNameElement(parseString(json.get("name").getAsString())); 12558 if (json.has("_name")) 12559 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 12560 if (json.has("title")) 12561 res.setTitleElement(parseString(json.get("title").getAsString())); 12562 if (json.has("_title")) 12563 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 12564 if (json.has("shortTitle")) 12565 res.setShortTitleElement(parseString(json.get("shortTitle").getAsString())); 12566 if (json.has("_shortTitle")) 12567 parseElementProperties(getJObject(json, "_shortTitle"), res.getShortTitleElement()); 12568 if (json.has("subtitle")) 12569 res.setSubtitleElement(parseString(json.get("subtitle").getAsString())); 12570 if (json.has("_subtitle")) 12571 parseElementProperties(getJObject(json, "_subtitle"), res.getSubtitleElement()); 12572 if (json.has("status")) 12573 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 12574 new Enumerations.PublicationStatusEnumFactory())); 12575 if (json.has("_status")) 12576 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 12577 if (json.has("date")) 12578 res.setDateElement(parseDateTime(json.get("date").getAsString())); 12579 if (json.has("_date")) 12580 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 12581 if (json.has("publisher")) 12582 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 12583 if (json.has("_publisher")) 12584 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 12585 if (json.has("contact")) { 12586 JsonArray array = json.getAsJsonArray("contact"); 12587 for (int i = 0; i < array.size(); i++) { 12588 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 12589 } 12590 } 12591 ; 12592 if (json.has("description")) 12593 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 12594 if (json.has("_description")) 12595 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 12596 if (json.has("note")) { 12597 JsonArray array = json.getAsJsonArray("note"); 12598 for (int i = 0; i < array.size(); i++) { 12599 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 12600 } 12601 } 12602 ; 12603 if (json.has("useContext")) { 12604 JsonArray array = json.getAsJsonArray("useContext"); 12605 for (int i = 0; i < array.size(); i++) { 12606 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 12607 } 12608 } 12609 ; 12610 if (json.has("jurisdiction")) { 12611 JsonArray array = json.getAsJsonArray("jurisdiction"); 12612 for (int i = 0; i < array.size(); i++) { 12613 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 12614 } 12615 } 12616 ; 12617 if (json.has("copyright")) 12618 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 12619 if (json.has("_copyright")) 12620 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 12621 if (json.has("approvalDate")) 12622 res.setApprovalDateElement(parseDate(json.get("approvalDate").getAsString())); 12623 if (json.has("_approvalDate")) 12624 parseElementProperties(getJObject(json, "_approvalDate"), res.getApprovalDateElement()); 12625 if (json.has("lastReviewDate")) 12626 res.setLastReviewDateElement(parseDate(json.get("lastReviewDate").getAsString())); 12627 if (json.has("_lastReviewDate")) 12628 parseElementProperties(getJObject(json, "_lastReviewDate"), res.getLastReviewDateElement()); 12629 if (json.has("effectivePeriod")) 12630 res.setEffectivePeriod(parsePeriod(getJObject(json, "effectivePeriod"))); 12631 if (json.has("topic")) { 12632 JsonArray array = json.getAsJsonArray("topic"); 12633 for (int i = 0; i < array.size(); i++) { 12634 res.getTopic().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 12635 } 12636 } 12637 ; 12638 if (json.has("author")) { 12639 JsonArray array = json.getAsJsonArray("author"); 12640 for (int i = 0; i < array.size(); i++) { 12641 res.getAuthor().add(parseContactDetail(array.get(i).getAsJsonObject())); 12642 } 12643 } 12644 ; 12645 if (json.has("editor")) { 12646 JsonArray array = json.getAsJsonArray("editor"); 12647 for (int i = 0; i < array.size(); i++) { 12648 res.getEditor().add(parseContactDetail(array.get(i).getAsJsonObject())); 12649 } 12650 } 12651 ; 12652 if (json.has("reviewer")) { 12653 JsonArray array = json.getAsJsonArray("reviewer"); 12654 for (int i = 0; i < array.size(); i++) { 12655 res.getReviewer().add(parseContactDetail(array.get(i).getAsJsonObject())); 12656 } 12657 } 12658 ; 12659 if (json.has("endorser")) { 12660 JsonArray array = json.getAsJsonArray("endorser"); 12661 for (int i = 0; i < array.size(); i++) { 12662 res.getEndorser().add(parseContactDetail(array.get(i).getAsJsonObject())); 12663 } 12664 } 12665 ; 12666 if (json.has("relatedArtifact")) { 12667 JsonArray array = json.getAsJsonArray("relatedArtifact"); 12668 for (int i = 0; i < array.size(); i++) { 12669 res.getRelatedArtifact().add(parseRelatedArtifact(array.get(i).getAsJsonObject())); 12670 } 12671 } 12672 ; 12673 if (json.has("exposureBackground")) 12674 res.setExposureBackground(parseReference(getJObject(json, "exposureBackground"))); 12675 if (json.has("exposureVariant")) { 12676 JsonArray array = json.getAsJsonArray("exposureVariant"); 12677 for (int i = 0; i < array.size(); i++) { 12678 res.getExposureVariant().add(parseReference(array.get(i).getAsJsonObject())); 12679 } 12680 } 12681 ; 12682 if (json.has("outcome")) { 12683 JsonArray array = json.getAsJsonArray("outcome"); 12684 for (int i = 0; i < array.size(); i++) { 12685 res.getOutcome().add(parseReference(array.get(i).getAsJsonObject())); 12686 } 12687 } 12688 ; 12689 } 12690 12691 protected EvidenceVariable parseEvidenceVariable(JsonObject json) throws IOException, FHIRFormatError { 12692 EvidenceVariable res = new EvidenceVariable(); 12693 parseEvidenceVariableProperties(json, res); 12694 return res; 12695 } 12696 12697 protected void parseEvidenceVariableProperties(JsonObject json, EvidenceVariable res) 12698 throws IOException, FHIRFormatError { 12699 parseDomainResourceProperties(json, res); 12700 if (json.has("url")) 12701 res.setUrlElement(parseUri(json.get("url").getAsString())); 12702 if (json.has("_url")) 12703 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 12704 if (json.has("identifier")) { 12705 JsonArray array = json.getAsJsonArray("identifier"); 12706 for (int i = 0; i < array.size(); i++) { 12707 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 12708 } 12709 } 12710 ; 12711 if (json.has("version")) 12712 res.setVersionElement(parseString(json.get("version").getAsString())); 12713 if (json.has("_version")) 12714 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 12715 if (json.has("name")) 12716 res.setNameElement(parseString(json.get("name").getAsString())); 12717 if (json.has("_name")) 12718 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 12719 if (json.has("title")) 12720 res.setTitleElement(parseString(json.get("title").getAsString())); 12721 if (json.has("_title")) 12722 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 12723 if (json.has("shortTitle")) 12724 res.setShortTitleElement(parseString(json.get("shortTitle").getAsString())); 12725 if (json.has("_shortTitle")) 12726 parseElementProperties(getJObject(json, "_shortTitle"), res.getShortTitleElement()); 12727 if (json.has("subtitle")) 12728 res.setSubtitleElement(parseString(json.get("subtitle").getAsString())); 12729 if (json.has("_subtitle")) 12730 parseElementProperties(getJObject(json, "_subtitle"), res.getSubtitleElement()); 12731 if (json.has("status")) 12732 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 12733 new Enumerations.PublicationStatusEnumFactory())); 12734 if (json.has("_status")) 12735 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 12736 if (json.has("date")) 12737 res.setDateElement(parseDateTime(json.get("date").getAsString())); 12738 if (json.has("_date")) 12739 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 12740 if (json.has("publisher")) 12741 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 12742 if (json.has("_publisher")) 12743 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 12744 if (json.has("contact")) { 12745 JsonArray array = json.getAsJsonArray("contact"); 12746 for (int i = 0; i < array.size(); i++) { 12747 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 12748 } 12749 } 12750 ; 12751 if (json.has("description")) 12752 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 12753 if (json.has("_description")) 12754 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 12755 if (json.has("note")) { 12756 JsonArray array = json.getAsJsonArray("note"); 12757 for (int i = 0; i < array.size(); i++) { 12758 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 12759 } 12760 } 12761 ; 12762 if (json.has("useContext")) { 12763 JsonArray array = json.getAsJsonArray("useContext"); 12764 for (int i = 0; i < array.size(); i++) { 12765 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 12766 } 12767 } 12768 ; 12769 if (json.has("jurisdiction")) { 12770 JsonArray array = json.getAsJsonArray("jurisdiction"); 12771 for (int i = 0; i < array.size(); i++) { 12772 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 12773 } 12774 } 12775 ; 12776 if (json.has("copyright")) 12777 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 12778 if (json.has("_copyright")) 12779 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 12780 if (json.has("approvalDate")) 12781 res.setApprovalDateElement(parseDate(json.get("approvalDate").getAsString())); 12782 if (json.has("_approvalDate")) 12783 parseElementProperties(getJObject(json, "_approvalDate"), res.getApprovalDateElement()); 12784 if (json.has("lastReviewDate")) 12785 res.setLastReviewDateElement(parseDate(json.get("lastReviewDate").getAsString())); 12786 if (json.has("_lastReviewDate")) 12787 parseElementProperties(getJObject(json, "_lastReviewDate"), res.getLastReviewDateElement()); 12788 if (json.has("effectivePeriod")) 12789 res.setEffectivePeriod(parsePeriod(getJObject(json, "effectivePeriod"))); 12790 if (json.has("topic")) { 12791 JsonArray array = json.getAsJsonArray("topic"); 12792 for (int i = 0; i < array.size(); i++) { 12793 res.getTopic().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 12794 } 12795 } 12796 ; 12797 if (json.has("author")) { 12798 JsonArray array = json.getAsJsonArray("author"); 12799 for (int i = 0; i < array.size(); i++) { 12800 res.getAuthor().add(parseContactDetail(array.get(i).getAsJsonObject())); 12801 } 12802 } 12803 ; 12804 if (json.has("editor")) { 12805 JsonArray array = json.getAsJsonArray("editor"); 12806 for (int i = 0; i < array.size(); i++) { 12807 res.getEditor().add(parseContactDetail(array.get(i).getAsJsonObject())); 12808 } 12809 } 12810 ; 12811 if (json.has("reviewer")) { 12812 JsonArray array = json.getAsJsonArray("reviewer"); 12813 for (int i = 0; i < array.size(); i++) { 12814 res.getReviewer().add(parseContactDetail(array.get(i).getAsJsonObject())); 12815 } 12816 } 12817 ; 12818 if (json.has("endorser")) { 12819 JsonArray array = json.getAsJsonArray("endorser"); 12820 for (int i = 0; i < array.size(); i++) { 12821 res.getEndorser().add(parseContactDetail(array.get(i).getAsJsonObject())); 12822 } 12823 } 12824 ; 12825 if (json.has("relatedArtifact")) { 12826 JsonArray array = json.getAsJsonArray("relatedArtifact"); 12827 for (int i = 0; i < array.size(); i++) { 12828 res.getRelatedArtifact().add(parseRelatedArtifact(array.get(i).getAsJsonObject())); 12829 } 12830 } 12831 ; 12832 if (json.has("type")) 12833 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), EvidenceVariable.EvidenceVariableType.NULL, 12834 new EvidenceVariable.EvidenceVariableTypeEnumFactory())); 12835 if (json.has("_type")) 12836 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 12837 if (json.has("characteristic")) { 12838 JsonArray array = json.getAsJsonArray("characteristic"); 12839 for (int i = 0; i < array.size(); i++) { 12840 res.getCharacteristic() 12841 .add(parseEvidenceVariableEvidenceVariableCharacteristicComponent(array.get(i).getAsJsonObject(), res)); 12842 } 12843 } 12844 ; 12845 } 12846 12847 protected EvidenceVariable.EvidenceVariableCharacteristicComponent parseEvidenceVariableEvidenceVariableCharacteristicComponent( 12848 JsonObject json, EvidenceVariable owner) throws IOException, FHIRFormatError { 12849 EvidenceVariable.EvidenceVariableCharacteristicComponent res = new EvidenceVariable.EvidenceVariableCharacteristicComponent(); 12850 parseEvidenceVariableEvidenceVariableCharacteristicComponentProperties(json, owner, res); 12851 return res; 12852 } 12853 12854 protected void parseEvidenceVariableEvidenceVariableCharacteristicComponentProperties(JsonObject json, 12855 EvidenceVariable owner, EvidenceVariable.EvidenceVariableCharacteristicComponent res) 12856 throws IOException, FHIRFormatError { 12857 parseBackboneElementProperties(json, res); 12858 if (json.has("description")) 12859 res.setDescriptionElement(parseString(json.get("description").getAsString())); 12860 if (json.has("_description")) 12861 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 12862 Type definition = parseType("definition", json); 12863 if (definition != null) 12864 res.setDefinition(definition); 12865 if (json.has("usageContext")) { 12866 JsonArray array = json.getAsJsonArray("usageContext"); 12867 for (int i = 0; i < array.size(); i++) { 12868 res.getUsageContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 12869 } 12870 } 12871 ; 12872 if (json.has("exclude")) 12873 res.setExcludeElement(parseBoolean(json.get("exclude").getAsBoolean())); 12874 if (json.has("_exclude")) 12875 parseElementProperties(getJObject(json, "_exclude"), res.getExcludeElement()); 12876 Type participantEffective = parseType("participantEffective", json); 12877 if (participantEffective != null) 12878 res.setParticipantEffective(participantEffective); 12879 if (json.has("timeFromStart")) 12880 res.setTimeFromStart(parseDuration(getJObject(json, "timeFromStart"))); 12881 if (json.has("groupMeasure")) 12882 res.setGroupMeasureElement(parseEnumeration(json.get("groupMeasure").getAsString(), 12883 EvidenceVariable.GroupMeasure.NULL, new EvidenceVariable.GroupMeasureEnumFactory())); 12884 if (json.has("_groupMeasure")) 12885 parseElementProperties(getJObject(json, "_groupMeasure"), res.getGroupMeasureElement()); 12886 } 12887 12888 protected ExampleScenario parseExampleScenario(JsonObject json) throws IOException, FHIRFormatError { 12889 ExampleScenario res = new ExampleScenario(); 12890 parseExampleScenarioProperties(json, res); 12891 return res; 12892 } 12893 12894 protected void parseExampleScenarioProperties(JsonObject json, ExampleScenario res) 12895 throws IOException, FHIRFormatError { 12896 parseDomainResourceProperties(json, res); 12897 if (json.has("url")) 12898 res.setUrlElement(parseUri(json.get("url").getAsString())); 12899 if (json.has("_url")) 12900 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 12901 if (json.has("identifier")) { 12902 JsonArray array = json.getAsJsonArray("identifier"); 12903 for (int i = 0; i < array.size(); i++) { 12904 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 12905 } 12906 } 12907 ; 12908 if (json.has("version")) 12909 res.setVersionElement(parseString(json.get("version").getAsString())); 12910 if (json.has("_version")) 12911 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 12912 if (json.has("name")) 12913 res.setNameElement(parseString(json.get("name").getAsString())); 12914 if (json.has("_name")) 12915 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 12916 if (json.has("status")) 12917 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 12918 new Enumerations.PublicationStatusEnumFactory())); 12919 if (json.has("_status")) 12920 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 12921 if (json.has("experimental")) 12922 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 12923 if (json.has("_experimental")) 12924 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 12925 if (json.has("date")) 12926 res.setDateElement(parseDateTime(json.get("date").getAsString())); 12927 if (json.has("_date")) 12928 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 12929 if (json.has("publisher")) 12930 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 12931 if (json.has("_publisher")) 12932 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 12933 if (json.has("contact")) { 12934 JsonArray array = json.getAsJsonArray("contact"); 12935 for (int i = 0; i < array.size(); i++) { 12936 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 12937 } 12938 } 12939 ; 12940 if (json.has("useContext")) { 12941 JsonArray array = json.getAsJsonArray("useContext"); 12942 for (int i = 0; i < array.size(); i++) { 12943 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 12944 } 12945 } 12946 ; 12947 if (json.has("jurisdiction")) { 12948 JsonArray array = json.getAsJsonArray("jurisdiction"); 12949 for (int i = 0; i < array.size(); i++) { 12950 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 12951 } 12952 } 12953 ; 12954 if (json.has("copyright")) 12955 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 12956 if (json.has("_copyright")) 12957 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 12958 if (json.has("purpose")) 12959 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 12960 if (json.has("_purpose")) 12961 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 12962 if (json.has("actor")) { 12963 JsonArray array = json.getAsJsonArray("actor"); 12964 for (int i = 0; i < array.size(); i++) { 12965 res.getActor().add(parseExampleScenarioExampleScenarioActorComponent(array.get(i).getAsJsonObject(), res)); 12966 } 12967 } 12968 ; 12969 if (json.has("instance")) { 12970 JsonArray array = json.getAsJsonArray("instance"); 12971 for (int i = 0; i < array.size(); i++) { 12972 res.getInstance() 12973 .add(parseExampleScenarioExampleScenarioInstanceComponent(array.get(i).getAsJsonObject(), res)); 12974 } 12975 } 12976 ; 12977 if (json.has("process")) { 12978 JsonArray array = json.getAsJsonArray("process"); 12979 for (int i = 0; i < array.size(); i++) { 12980 res.getProcess().add(parseExampleScenarioExampleScenarioProcessComponent(array.get(i).getAsJsonObject(), res)); 12981 } 12982 } 12983 ; 12984 if (json.has("workflow")) { 12985 JsonArray array = json.getAsJsonArray("workflow"); 12986 for (int i = 0; i < array.size(); i++) { 12987 if (array.get(i).isJsonNull()) { 12988 res.getWorkflow().add(new CanonicalType()); 12989 } else { 12990 res.getWorkflow().add(parseCanonical(array.get(i).getAsString())); 12991 } 12992 } 12993 } 12994 ; 12995 if (json.has("_workflow")) { 12996 JsonArray array = json.getAsJsonArray("_workflow"); 12997 for (int i = 0; i < array.size(); i++) { 12998 if (i == res.getWorkflow().size()) 12999 res.getWorkflow().add(parseCanonical(null)); 13000 if (array.get(i) instanceof JsonObject) 13001 parseElementProperties(array.get(i).getAsJsonObject(), res.getWorkflow().get(i)); 13002 } 13003 } 13004 ; 13005 } 13006 13007 protected ExampleScenario.ExampleScenarioActorComponent parseExampleScenarioExampleScenarioActorComponent( 13008 JsonObject json, ExampleScenario owner) throws IOException, FHIRFormatError { 13009 ExampleScenario.ExampleScenarioActorComponent res = new ExampleScenario.ExampleScenarioActorComponent(); 13010 parseExampleScenarioExampleScenarioActorComponentProperties(json, owner, res); 13011 return res; 13012 } 13013 13014 protected void parseExampleScenarioExampleScenarioActorComponentProperties(JsonObject json, ExampleScenario owner, 13015 ExampleScenario.ExampleScenarioActorComponent res) throws IOException, FHIRFormatError { 13016 parseBackboneElementProperties(json, res); 13017 if (json.has("actorId")) 13018 res.setActorIdElement(parseString(json.get("actorId").getAsString())); 13019 if (json.has("_actorId")) 13020 parseElementProperties(getJObject(json, "_actorId"), res.getActorIdElement()); 13021 if (json.has("type")) 13022 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), ExampleScenario.ExampleScenarioActorType.NULL, 13023 new ExampleScenario.ExampleScenarioActorTypeEnumFactory())); 13024 if (json.has("_type")) 13025 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 13026 if (json.has("name")) 13027 res.setNameElement(parseString(json.get("name").getAsString())); 13028 if (json.has("_name")) 13029 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 13030 if (json.has("description")) 13031 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 13032 if (json.has("_description")) 13033 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 13034 } 13035 13036 protected ExampleScenario.ExampleScenarioInstanceComponent parseExampleScenarioExampleScenarioInstanceComponent( 13037 JsonObject json, ExampleScenario owner) throws IOException, FHIRFormatError { 13038 ExampleScenario.ExampleScenarioInstanceComponent res = new ExampleScenario.ExampleScenarioInstanceComponent(); 13039 parseExampleScenarioExampleScenarioInstanceComponentProperties(json, owner, res); 13040 return res; 13041 } 13042 13043 protected void parseExampleScenarioExampleScenarioInstanceComponentProperties(JsonObject json, ExampleScenario owner, 13044 ExampleScenario.ExampleScenarioInstanceComponent res) throws IOException, FHIRFormatError { 13045 parseBackboneElementProperties(json, res); 13046 if (json.has("resourceId")) 13047 res.setResourceIdElement(parseString(json.get("resourceId").getAsString())); 13048 if (json.has("_resourceId")) 13049 parseElementProperties(getJObject(json, "_resourceId"), res.getResourceIdElement()); 13050 if (json.has("resourceType")) 13051 res.setResourceTypeElement(parseEnumeration(json.get("resourceType").getAsString(), 13052 ExampleScenario.FHIRResourceType.NULL, new ExampleScenario.FHIRResourceTypeEnumFactory())); 13053 if (json.has("_resourceType")) 13054 parseElementProperties(getJObject(json, "_resourceType"), res.getResourceTypeElement()); 13055 if (json.has("name")) 13056 res.setNameElement(parseString(json.get("name").getAsString())); 13057 if (json.has("_name")) 13058 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 13059 if (json.has("description")) 13060 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 13061 if (json.has("_description")) 13062 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 13063 if (json.has("version")) { 13064 JsonArray array = json.getAsJsonArray("version"); 13065 for (int i = 0; i < array.size(); i++) { 13066 res.getVersion() 13067 .add(parseExampleScenarioExampleScenarioInstanceVersionComponent(array.get(i).getAsJsonObject(), owner)); 13068 } 13069 } 13070 ; 13071 if (json.has("containedInstance")) { 13072 JsonArray array = json.getAsJsonArray("containedInstance"); 13073 for (int i = 0; i < array.size(); i++) { 13074 res.getContainedInstance().add(parseExampleScenarioExampleScenarioInstanceContainedInstanceComponent( 13075 array.get(i).getAsJsonObject(), owner)); 13076 } 13077 } 13078 ; 13079 } 13080 13081 protected ExampleScenario.ExampleScenarioInstanceVersionComponent parseExampleScenarioExampleScenarioInstanceVersionComponent( 13082 JsonObject json, ExampleScenario owner) throws IOException, FHIRFormatError { 13083 ExampleScenario.ExampleScenarioInstanceVersionComponent res = new ExampleScenario.ExampleScenarioInstanceVersionComponent(); 13084 parseExampleScenarioExampleScenarioInstanceVersionComponentProperties(json, owner, res); 13085 return res; 13086 } 13087 13088 protected void parseExampleScenarioExampleScenarioInstanceVersionComponentProperties(JsonObject json, 13089 ExampleScenario owner, ExampleScenario.ExampleScenarioInstanceVersionComponent res) 13090 throws IOException, FHIRFormatError { 13091 parseBackboneElementProperties(json, res); 13092 if (json.has("versionId")) 13093 res.setVersionIdElement(parseString(json.get("versionId").getAsString())); 13094 if (json.has("_versionId")) 13095 parseElementProperties(getJObject(json, "_versionId"), res.getVersionIdElement()); 13096 if (json.has("description")) 13097 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 13098 if (json.has("_description")) 13099 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 13100 } 13101 13102 protected ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent parseExampleScenarioExampleScenarioInstanceContainedInstanceComponent( 13103 JsonObject json, ExampleScenario owner) throws IOException, FHIRFormatError { 13104 ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent res = new ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent(); 13105 parseExampleScenarioExampleScenarioInstanceContainedInstanceComponentProperties(json, owner, res); 13106 return res; 13107 } 13108 13109 protected void parseExampleScenarioExampleScenarioInstanceContainedInstanceComponentProperties(JsonObject json, 13110 ExampleScenario owner, ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent res) 13111 throws IOException, FHIRFormatError { 13112 parseBackboneElementProperties(json, res); 13113 if (json.has("resourceId")) 13114 res.setResourceIdElement(parseString(json.get("resourceId").getAsString())); 13115 if (json.has("_resourceId")) 13116 parseElementProperties(getJObject(json, "_resourceId"), res.getResourceIdElement()); 13117 if (json.has("versionId")) 13118 res.setVersionIdElement(parseString(json.get("versionId").getAsString())); 13119 if (json.has("_versionId")) 13120 parseElementProperties(getJObject(json, "_versionId"), res.getVersionIdElement()); 13121 } 13122 13123 protected ExampleScenario.ExampleScenarioProcessComponent parseExampleScenarioExampleScenarioProcessComponent( 13124 JsonObject json, ExampleScenario owner) throws IOException, FHIRFormatError { 13125 ExampleScenario.ExampleScenarioProcessComponent res = new ExampleScenario.ExampleScenarioProcessComponent(); 13126 parseExampleScenarioExampleScenarioProcessComponentProperties(json, owner, res); 13127 return res; 13128 } 13129 13130 protected void parseExampleScenarioExampleScenarioProcessComponentProperties(JsonObject json, ExampleScenario owner, 13131 ExampleScenario.ExampleScenarioProcessComponent res) throws IOException, FHIRFormatError { 13132 parseBackboneElementProperties(json, res); 13133 if (json.has("title")) 13134 res.setTitleElement(parseString(json.get("title").getAsString())); 13135 if (json.has("_title")) 13136 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 13137 if (json.has("description")) 13138 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 13139 if (json.has("_description")) 13140 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 13141 if (json.has("preConditions")) 13142 res.setPreConditionsElement(parseMarkdown(json.get("preConditions").getAsString())); 13143 if (json.has("_preConditions")) 13144 parseElementProperties(getJObject(json, "_preConditions"), res.getPreConditionsElement()); 13145 if (json.has("postConditions")) 13146 res.setPostConditionsElement(parseMarkdown(json.get("postConditions").getAsString())); 13147 if (json.has("_postConditions")) 13148 parseElementProperties(getJObject(json, "_postConditions"), res.getPostConditionsElement()); 13149 if (json.has("step")) { 13150 JsonArray array = json.getAsJsonArray("step"); 13151 for (int i = 0; i < array.size(); i++) { 13152 res.getStep() 13153 .add(parseExampleScenarioExampleScenarioProcessStepComponent(array.get(i).getAsJsonObject(), owner)); 13154 } 13155 } 13156 ; 13157 } 13158 13159 protected ExampleScenario.ExampleScenarioProcessStepComponent parseExampleScenarioExampleScenarioProcessStepComponent( 13160 JsonObject json, ExampleScenario owner) throws IOException, FHIRFormatError { 13161 ExampleScenario.ExampleScenarioProcessStepComponent res = new ExampleScenario.ExampleScenarioProcessStepComponent(); 13162 parseExampleScenarioExampleScenarioProcessStepComponentProperties(json, owner, res); 13163 return res; 13164 } 13165 13166 protected void parseExampleScenarioExampleScenarioProcessStepComponentProperties(JsonObject json, 13167 ExampleScenario owner, ExampleScenario.ExampleScenarioProcessStepComponent res) 13168 throws IOException, FHIRFormatError { 13169 parseBackboneElementProperties(json, res); 13170 if (json.has("process")) { 13171 JsonArray array = json.getAsJsonArray("process"); 13172 for (int i = 0; i < array.size(); i++) { 13173 res.getProcess() 13174 .add(parseExampleScenarioExampleScenarioProcessComponent(array.get(i).getAsJsonObject(), owner)); 13175 } 13176 } 13177 ; 13178 if (json.has("pause")) 13179 res.setPauseElement(parseBoolean(json.get("pause").getAsBoolean())); 13180 if (json.has("_pause")) 13181 parseElementProperties(getJObject(json, "_pause"), res.getPauseElement()); 13182 if (json.has("operation")) 13183 res.setOperation( 13184 parseExampleScenarioExampleScenarioProcessStepOperationComponent(getJObject(json, "operation"), owner)); 13185 if (json.has("alternative")) { 13186 JsonArray array = json.getAsJsonArray("alternative"); 13187 for (int i = 0; i < array.size(); i++) { 13188 res.getAlternative().add( 13189 parseExampleScenarioExampleScenarioProcessStepAlternativeComponent(array.get(i).getAsJsonObject(), owner)); 13190 } 13191 } 13192 ; 13193 } 13194 13195 protected ExampleScenario.ExampleScenarioProcessStepOperationComponent parseExampleScenarioExampleScenarioProcessStepOperationComponent( 13196 JsonObject json, ExampleScenario owner) throws IOException, FHIRFormatError { 13197 ExampleScenario.ExampleScenarioProcessStepOperationComponent res = new ExampleScenario.ExampleScenarioProcessStepOperationComponent(); 13198 parseExampleScenarioExampleScenarioProcessStepOperationComponentProperties(json, owner, res); 13199 return res; 13200 } 13201 13202 protected void parseExampleScenarioExampleScenarioProcessStepOperationComponentProperties(JsonObject json, 13203 ExampleScenario owner, ExampleScenario.ExampleScenarioProcessStepOperationComponent res) 13204 throws IOException, FHIRFormatError { 13205 parseBackboneElementProperties(json, res); 13206 if (json.has("number")) 13207 res.setNumberElement(parseString(json.get("number").getAsString())); 13208 if (json.has("_number")) 13209 parseElementProperties(getJObject(json, "_number"), res.getNumberElement()); 13210 if (json.has("type")) 13211 res.setTypeElement(parseString(json.get("type").getAsString())); 13212 if (json.has("_type")) 13213 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 13214 if (json.has("name")) 13215 res.setNameElement(parseString(json.get("name").getAsString())); 13216 if (json.has("_name")) 13217 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 13218 if (json.has("initiator")) 13219 res.setInitiatorElement(parseString(json.get("initiator").getAsString())); 13220 if (json.has("_initiator")) 13221 parseElementProperties(getJObject(json, "_initiator"), res.getInitiatorElement()); 13222 if (json.has("receiver")) 13223 res.setReceiverElement(parseString(json.get("receiver").getAsString())); 13224 if (json.has("_receiver")) 13225 parseElementProperties(getJObject(json, "_receiver"), res.getReceiverElement()); 13226 if (json.has("description")) 13227 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 13228 if (json.has("_description")) 13229 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 13230 if (json.has("initiatorActive")) 13231 res.setInitiatorActiveElement(parseBoolean(json.get("initiatorActive").getAsBoolean())); 13232 if (json.has("_initiatorActive")) 13233 parseElementProperties(getJObject(json, "_initiatorActive"), res.getInitiatorActiveElement()); 13234 if (json.has("receiverActive")) 13235 res.setReceiverActiveElement(parseBoolean(json.get("receiverActive").getAsBoolean())); 13236 if (json.has("_receiverActive")) 13237 parseElementProperties(getJObject(json, "_receiverActive"), res.getReceiverActiveElement()); 13238 if (json.has("request")) 13239 res.setRequest( 13240 parseExampleScenarioExampleScenarioInstanceContainedInstanceComponent(getJObject(json, "request"), owner)); 13241 if (json.has("response")) 13242 res.setResponse( 13243 parseExampleScenarioExampleScenarioInstanceContainedInstanceComponent(getJObject(json, "response"), owner)); 13244 } 13245 13246 protected ExampleScenario.ExampleScenarioProcessStepAlternativeComponent parseExampleScenarioExampleScenarioProcessStepAlternativeComponent( 13247 JsonObject json, ExampleScenario owner) throws IOException, FHIRFormatError { 13248 ExampleScenario.ExampleScenarioProcessStepAlternativeComponent res = new ExampleScenario.ExampleScenarioProcessStepAlternativeComponent(); 13249 parseExampleScenarioExampleScenarioProcessStepAlternativeComponentProperties(json, owner, res); 13250 return res; 13251 } 13252 13253 protected void parseExampleScenarioExampleScenarioProcessStepAlternativeComponentProperties(JsonObject json, 13254 ExampleScenario owner, ExampleScenario.ExampleScenarioProcessStepAlternativeComponent res) 13255 throws IOException, FHIRFormatError { 13256 parseBackboneElementProperties(json, res); 13257 if (json.has("title")) 13258 res.setTitleElement(parseString(json.get("title").getAsString())); 13259 if (json.has("_title")) 13260 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 13261 if (json.has("description")) 13262 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 13263 if (json.has("_description")) 13264 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 13265 if (json.has("step")) { 13266 JsonArray array = json.getAsJsonArray("step"); 13267 for (int i = 0; i < array.size(); i++) { 13268 res.getStep() 13269 .add(parseExampleScenarioExampleScenarioProcessStepComponent(array.get(i).getAsJsonObject(), owner)); 13270 } 13271 } 13272 ; 13273 } 13274 13275 protected ExplanationOfBenefit parseExplanationOfBenefit(JsonObject json) throws IOException, FHIRFormatError { 13276 ExplanationOfBenefit res = new ExplanationOfBenefit(); 13277 parseExplanationOfBenefitProperties(json, res); 13278 return res; 13279 } 13280 13281 protected void parseExplanationOfBenefitProperties(JsonObject json, ExplanationOfBenefit res) 13282 throws IOException, FHIRFormatError { 13283 parseDomainResourceProperties(json, res); 13284 if (json.has("identifier")) { 13285 JsonArray array = json.getAsJsonArray("identifier"); 13286 for (int i = 0; i < array.size(); i++) { 13287 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 13288 } 13289 } 13290 ; 13291 if (json.has("status")) 13292 res.setStatusElement( 13293 parseEnumeration(json.get("status").getAsString(), ExplanationOfBenefit.ExplanationOfBenefitStatus.NULL, 13294 new ExplanationOfBenefit.ExplanationOfBenefitStatusEnumFactory())); 13295 if (json.has("_status")) 13296 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 13297 if (json.has("type")) 13298 res.setType(parseCodeableConcept(getJObject(json, "type"))); 13299 if (json.has("subType")) 13300 res.setSubType(parseCodeableConcept(getJObject(json, "subType"))); 13301 if (json.has("use")) 13302 res.setUseElement(parseEnumeration(json.get("use").getAsString(), ExplanationOfBenefit.Use.NULL, 13303 new ExplanationOfBenefit.UseEnumFactory())); 13304 if (json.has("_use")) 13305 parseElementProperties(getJObject(json, "_use"), res.getUseElement()); 13306 if (json.has("patient")) 13307 res.setPatient(parseReference(getJObject(json, "patient"))); 13308 if (json.has("billablePeriod")) 13309 res.setBillablePeriod(parsePeriod(getJObject(json, "billablePeriod"))); 13310 if (json.has("created")) 13311 res.setCreatedElement(parseDateTime(json.get("created").getAsString())); 13312 if (json.has("_created")) 13313 parseElementProperties(getJObject(json, "_created"), res.getCreatedElement()); 13314 if (json.has("enterer")) 13315 res.setEnterer(parseReference(getJObject(json, "enterer"))); 13316 if (json.has("insurer")) 13317 res.setInsurer(parseReference(getJObject(json, "insurer"))); 13318 if (json.has("provider")) 13319 res.setProvider(parseReference(getJObject(json, "provider"))); 13320 if (json.has("priority")) 13321 res.setPriority(parseCodeableConcept(getJObject(json, "priority"))); 13322 if (json.has("fundsReserveRequested")) 13323 res.setFundsReserveRequested(parseCodeableConcept(getJObject(json, "fundsReserveRequested"))); 13324 if (json.has("fundsReserve")) 13325 res.setFundsReserve(parseCodeableConcept(getJObject(json, "fundsReserve"))); 13326 if (json.has("related")) { 13327 JsonArray array = json.getAsJsonArray("related"); 13328 for (int i = 0; i < array.size(); i++) { 13329 res.getRelated().add(parseExplanationOfBenefitRelatedClaimComponent(array.get(i).getAsJsonObject(), res)); 13330 } 13331 } 13332 ; 13333 if (json.has("prescription")) 13334 res.setPrescription(parseReference(getJObject(json, "prescription"))); 13335 if (json.has("originalPrescription")) 13336 res.setOriginalPrescription(parseReference(getJObject(json, "originalPrescription"))); 13337 if (json.has("payee")) 13338 res.setPayee(parseExplanationOfBenefitPayeeComponent(getJObject(json, "payee"), res)); 13339 if (json.has("referral")) 13340 res.setReferral(parseReference(getJObject(json, "referral"))); 13341 if (json.has("facility")) 13342 res.setFacility(parseReference(getJObject(json, "facility"))); 13343 if (json.has("claim")) 13344 res.setClaim(parseReference(getJObject(json, "claim"))); 13345 if (json.has("claimResponse")) 13346 res.setClaimResponse(parseReference(getJObject(json, "claimResponse"))); 13347 if (json.has("outcome")) 13348 res.setOutcomeElement(parseEnumeration(json.get("outcome").getAsString(), 13349 ExplanationOfBenefit.RemittanceOutcome.NULL, new ExplanationOfBenefit.RemittanceOutcomeEnumFactory())); 13350 if (json.has("_outcome")) 13351 parseElementProperties(getJObject(json, "_outcome"), res.getOutcomeElement()); 13352 if (json.has("disposition")) 13353 res.setDispositionElement(parseString(json.get("disposition").getAsString())); 13354 if (json.has("_disposition")) 13355 parseElementProperties(getJObject(json, "_disposition"), res.getDispositionElement()); 13356 if (json.has("preAuthRef")) { 13357 JsonArray array = json.getAsJsonArray("preAuthRef"); 13358 for (int i = 0; i < array.size(); i++) { 13359 if (array.get(i).isJsonNull()) { 13360 res.getPreAuthRef().add(new StringType()); 13361 } else { 13362 res.getPreAuthRef().add(parseString(array.get(i).getAsString())); 13363 } 13364 } 13365 } 13366 ; 13367 if (json.has("_preAuthRef")) { 13368 JsonArray array = json.getAsJsonArray("_preAuthRef"); 13369 for (int i = 0; i < array.size(); i++) { 13370 if (i == res.getPreAuthRef().size()) 13371 res.getPreAuthRef().add(parseString(null)); 13372 if (array.get(i) instanceof JsonObject) 13373 parseElementProperties(array.get(i).getAsJsonObject(), res.getPreAuthRef().get(i)); 13374 } 13375 } 13376 ; 13377 if (json.has("preAuthRefPeriod")) { 13378 JsonArray array = json.getAsJsonArray("preAuthRefPeriod"); 13379 for (int i = 0; i < array.size(); i++) { 13380 res.getPreAuthRefPeriod().add(parsePeriod(array.get(i).getAsJsonObject())); 13381 } 13382 } 13383 ; 13384 if (json.has("careTeam")) { 13385 JsonArray array = json.getAsJsonArray("careTeam"); 13386 for (int i = 0; i < array.size(); i++) { 13387 res.getCareTeam().add(parseExplanationOfBenefitCareTeamComponent(array.get(i).getAsJsonObject(), res)); 13388 } 13389 } 13390 ; 13391 if (json.has("supportingInfo")) { 13392 JsonArray array = json.getAsJsonArray("supportingInfo"); 13393 for (int i = 0; i < array.size(); i++) { 13394 res.getSupportingInfo() 13395 .add(parseExplanationOfBenefitSupportingInformationComponent(array.get(i).getAsJsonObject(), res)); 13396 } 13397 } 13398 ; 13399 if (json.has("diagnosis")) { 13400 JsonArray array = json.getAsJsonArray("diagnosis"); 13401 for (int i = 0; i < array.size(); i++) { 13402 res.getDiagnosis().add(parseExplanationOfBenefitDiagnosisComponent(array.get(i).getAsJsonObject(), res)); 13403 } 13404 } 13405 ; 13406 if (json.has("procedure")) { 13407 JsonArray array = json.getAsJsonArray("procedure"); 13408 for (int i = 0; i < array.size(); i++) { 13409 res.getProcedure().add(parseExplanationOfBenefitProcedureComponent(array.get(i).getAsJsonObject(), res)); 13410 } 13411 } 13412 ; 13413 if (json.has("precedence")) 13414 res.setPrecedenceElement(parsePositiveInt(json.get("precedence").getAsString())); 13415 if (json.has("_precedence")) 13416 parseElementProperties(getJObject(json, "_precedence"), res.getPrecedenceElement()); 13417 if (json.has("insurance")) { 13418 JsonArray array = json.getAsJsonArray("insurance"); 13419 for (int i = 0; i < array.size(); i++) { 13420 res.getInsurance().add(parseExplanationOfBenefitInsuranceComponent(array.get(i).getAsJsonObject(), res)); 13421 } 13422 } 13423 ; 13424 if (json.has("accident")) 13425 res.setAccident(parseExplanationOfBenefitAccidentComponent(getJObject(json, "accident"), res)); 13426 if (json.has("item")) { 13427 JsonArray array = json.getAsJsonArray("item"); 13428 for (int i = 0; i < array.size(); i++) { 13429 res.getItem().add(parseExplanationOfBenefitItemComponent(array.get(i).getAsJsonObject(), res)); 13430 } 13431 } 13432 ; 13433 if (json.has("addItem")) { 13434 JsonArray array = json.getAsJsonArray("addItem"); 13435 for (int i = 0; i < array.size(); i++) { 13436 res.getAddItem().add(parseExplanationOfBenefitAddedItemComponent(array.get(i).getAsJsonObject(), res)); 13437 } 13438 } 13439 ; 13440 if (json.has("adjudication")) { 13441 JsonArray array = json.getAsJsonArray("adjudication"); 13442 for (int i = 0; i < array.size(); i++) { 13443 res.getAdjudication().add(parseExplanationOfBenefitAdjudicationComponent(array.get(i).getAsJsonObject(), res)); 13444 } 13445 } 13446 ; 13447 if (json.has("total")) { 13448 JsonArray array = json.getAsJsonArray("total"); 13449 for (int i = 0; i < array.size(); i++) { 13450 res.getTotal().add(parseExplanationOfBenefitTotalComponent(array.get(i).getAsJsonObject(), res)); 13451 } 13452 } 13453 ; 13454 if (json.has("payment")) 13455 res.setPayment(parseExplanationOfBenefitPaymentComponent(getJObject(json, "payment"), res)); 13456 if (json.has("formCode")) 13457 res.setFormCode(parseCodeableConcept(getJObject(json, "formCode"))); 13458 if (json.has("form")) 13459 res.setForm(parseAttachment(getJObject(json, "form"))); 13460 if (json.has("processNote")) { 13461 JsonArray array = json.getAsJsonArray("processNote"); 13462 for (int i = 0; i < array.size(); i++) { 13463 res.getProcessNote().add(parseExplanationOfBenefitNoteComponent(array.get(i).getAsJsonObject(), res)); 13464 } 13465 } 13466 ; 13467 if (json.has("benefitPeriod")) 13468 res.setBenefitPeriod(parsePeriod(getJObject(json, "benefitPeriod"))); 13469 if (json.has("benefitBalance")) { 13470 JsonArray array = json.getAsJsonArray("benefitBalance"); 13471 for (int i = 0; i < array.size(); i++) { 13472 res.getBenefitBalance() 13473 .add(parseExplanationOfBenefitBenefitBalanceComponent(array.get(i).getAsJsonObject(), res)); 13474 } 13475 } 13476 ; 13477 } 13478 13479 protected ExplanationOfBenefit.RelatedClaimComponent parseExplanationOfBenefitRelatedClaimComponent(JsonObject json, 13480 ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 13481 ExplanationOfBenefit.RelatedClaimComponent res = new ExplanationOfBenefit.RelatedClaimComponent(); 13482 parseExplanationOfBenefitRelatedClaimComponentProperties(json, owner, res); 13483 return res; 13484 } 13485 13486 protected void parseExplanationOfBenefitRelatedClaimComponentProperties(JsonObject json, ExplanationOfBenefit owner, 13487 ExplanationOfBenefit.RelatedClaimComponent res) throws IOException, FHIRFormatError { 13488 parseBackboneElementProperties(json, res); 13489 if (json.has("claim")) 13490 res.setClaim(parseReference(getJObject(json, "claim"))); 13491 if (json.has("relationship")) 13492 res.setRelationship(parseCodeableConcept(getJObject(json, "relationship"))); 13493 if (json.has("reference")) 13494 res.setReference(parseIdentifier(getJObject(json, "reference"))); 13495 } 13496 13497 protected ExplanationOfBenefit.PayeeComponent parseExplanationOfBenefitPayeeComponent(JsonObject json, 13498 ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 13499 ExplanationOfBenefit.PayeeComponent res = new ExplanationOfBenefit.PayeeComponent(); 13500 parseExplanationOfBenefitPayeeComponentProperties(json, owner, res); 13501 return res; 13502 } 13503 13504 protected void parseExplanationOfBenefitPayeeComponentProperties(JsonObject json, ExplanationOfBenefit owner, 13505 ExplanationOfBenefit.PayeeComponent res) throws IOException, FHIRFormatError { 13506 parseBackboneElementProperties(json, res); 13507 if (json.has("type")) 13508 res.setType(parseCodeableConcept(getJObject(json, "type"))); 13509 if (json.has("party")) 13510 res.setParty(parseReference(getJObject(json, "party"))); 13511 } 13512 13513 protected ExplanationOfBenefit.CareTeamComponent parseExplanationOfBenefitCareTeamComponent(JsonObject json, 13514 ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 13515 ExplanationOfBenefit.CareTeamComponent res = new ExplanationOfBenefit.CareTeamComponent(); 13516 parseExplanationOfBenefitCareTeamComponentProperties(json, owner, res); 13517 return res; 13518 } 13519 13520 protected void parseExplanationOfBenefitCareTeamComponentProperties(JsonObject json, ExplanationOfBenefit owner, 13521 ExplanationOfBenefit.CareTeamComponent res) throws IOException, FHIRFormatError { 13522 parseBackboneElementProperties(json, res); 13523 if (json.has("sequence")) 13524 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 13525 if (json.has("_sequence")) 13526 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 13527 if (json.has("provider")) 13528 res.setProvider(parseReference(getJObject(json, "provider"))); 13529 if (json.has("responsible")) 13530 res.setResponsibleElement(parseBoolean(json.get("responsible").getAsBoolean())); 13531 if (json.has("_responsible")) 13532 parseElementProperties(getJObject(json, "_responsible"), res.getResponsibleElement()); 13533 if (json.has("role")) 13534 res.setRole(parseCodeableConcept(getJObject(json, "role"))); 13535 if (json.has("qualification")) 13536 res.setQualification(parseCodeableConcept(getJObject(json, "qualification"))); 13537 } 13538 13539 protected ExplanationOfBenefit.SupportingInformationComponent parseExplanationOfBenefitSupportingInformationComponent( 13540 JsonObject json, ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 13541 ExplanationOfBenefit.SupportingInformationComponent res = new ExplanationOfBenefit.SupportingInformationComponent(); 13542 parseExplanationOfBenefitSupportingInformationComponentProperties(json, owner, res); 13543 return res; 13544 } 13545 13546 protected void parseExplanationOfBenefitSupportingInformationComponentProperties(JsonObject json, 13547 ExplanationOfBenefit owner, ExplanationOfBenefit.SupportingInformationComponent res) 13548 throws IOException, FHIRFormatError { 13549 parseBackboneElementProperties(json, res); 13550 if (json.has("sequence")) 13551 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 13552 if (json.has("_sequence")) 13553 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 13554 if (json.has("category")) 13555 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 13556 if (json.has("code")) 13557 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 13558 Type timing = parseType("timing", json); 13559 if (timing != null) 13560 res.setTiming(timing); 13561 Type value = parseType("value", json); 13562 if (value != null) 13563 res.setValue(value); 13564 if (json.has("reason")) 13565 res.setReason(parseCoding(getJObject(json, "reason"))); 13566 } 13567 13568 protected ExplanationOfBenefit.DiagnosisComponent parseExplanationOfBenefitDiagnosisComponent(JsonObject json, 13569 ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 13570 ExplanationOfBenefit.DiagnosisComponent res = new ExplanationOfBenefit.DiagnosisComponent(); 13571 parseExplanationOfBenefitDiagnosisComponentProperties(json, owner, res); 13572 return res; 13573 } 13574 13575 protected void parseExplanationOfBenefitDiagnosisComponentProperties(JsonObject json, ExplanationOfBenefit owner, 13576 ExplanationOfBenefit.DiagnosisComponent res) throws IOException, FHIRFormatError { 13577 parseBackboneElementProperties(json, res); 13578 if (json.has("sequence")) 13579 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 13580 if (json.has("_sequence")) 13581 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 13582 Type diagnosis = parseType("diagnosis", json); 13583 if (diagnosis != null) 13584 res.setDiagnosis(diagnosis); 13585 if (json.has("type")) { 13586 JsonArray array = json.getAsJsonArray("type"); 13587 for (int i = 0; i < array.size(); i++) { 13588 res.getType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 13589 } 13590 } 13591 ; 13592 if (json.has("onAdmission")) 13593 res.setOnAdmission(parseCodeableConcept(getJObject(json, "onAdmission"))); 13594 if (json.has("packageCode")) 13595 res.setPackageCode(parseCodeableConcept(getJObject(json, "packageCode"))); 13596 } 13597 13598 protected ExplanationOfBenefit.ProcedureComponent parseExplanationOfBenefitProcedureComponent(JsonObject json, 13599 ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 13600 ExplanationOfBenefit.ProcedureComponent res = new ExplanationOfBenefit.ProcedureComponent(); 13601 parseExplanationOfBenefitProcedureComponentProperties(json, owner, res); 13602 return res; 13603 } 13604 13605 protected void parseExplanationOfBenefitProcedureComponentProperties(JsonObject json, ExplanationOfBenefit owner, 13606 ExplanationOfBenefit.ProcedureComponent res) throws IOException, FHIRFormatError { 13607 parseBackboneElementProperties(json, res); 13608 if (json.has("sequence")) 13609 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 13610 if (json.has("_sequence")) 13611 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 13612 if (json.has("type")) { 13613 JsonArray array = json.getAsJsonArray("type"); 13614 for (int i = 0; i < array.size(); i++) { 13615 res.getType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 13616 } 13617 } 13618 ; 13619 if (json.has("date")) 13620 res.setDateElement(parseDateTime(json.get("date").getAsString())); 13621 if (json.has("_date")) 13622 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 13623 Type procedure = parseType("procedure", json); 13624 if (procedure != null) 13625 res.setProcedure(procedure); 13626 if (json.has("udi")) { 13627 JsonArray array = json.getAsJsonArray("udi"); 13628 for (int i = 0; i < array.size(); i++) { 13629 res.getUdi().add(parseReference(array.get(i).getAsJsonObject())); 13630 } 13631 } 13632 ; 13633 } 13634 13635 protected ExplanationOfBenefit.InsuranceComponent parseExplanationOfBenefitInsuranceComponent(JsonObject json, 13636 ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 13637 ExplanationOfBenefit.InsuranceComponent res = new ExplanationOfBenefit.InsuranceComponent(); 13638 parseExplanationOfBenefitInsuranceComponentProperties(json, owner, res); 13639 return res; 13640 } 13641 13642 protected void parseExplanationOfBenefitInsuranceComponentProperties(JsonObject json, ExplanationOfBenefit owner, 13643 ExplanationOfBenefit.InsuranceComponent res) throws IOException, FHIRFormatError { 13644 parseBackboneElementProperties(json, res); 13645 if (json.has("focal")) 13646 res.setFocalElement(parseBoolean(json.get("focal").getAsBoolean())); 13647 if (json.has("_focal")) 13648 parseElementProperties(getJObject(json, "_focal"), res.getFocalElement()); 13649 if (json.has("coverage")) 13650 res.setCoverage(parseReference(getJObject(json, "coverage"))); 13651 if (json.has("preAuthRef")) { 13652 JsonArray array = json.getAsJsonArray("preAuthRef"); 13653 for (int i = 0; i < array.size(); i++) { 13654 if (array.get(i).isJsonNull()) { 13655 res.getPreAuthRef().add(new StringType()); 13656 } else { 13657 res.getPreAuthRef().add(parseString(array.get(i).getAsString())); 13658 } 13659 } 13660 } 13661 ; 13662 if (json.has("_preAuthRef")) { 13663 JsonArray array = json.getAsJsonArray("_preAuthRef"); 13664 for (int i = 0; i < array.size(); i++) { 13665 if (i == res.getPreAuthRef().size()) 13666 res.getPreAuthRef().add(parseString(null)); 13667 if (array.get(i) instanceof JsonObject) 13668 parseElementProperties(array.get(i).getAsJsonObject(), res.getPreAuthRef().get(i)); 13669 } 13670 } 13671 ; 13672 } 13673 13674 protected ExplanationOfBenefit.AccidentComponent parseExplanationOfBenefitAccidentComponent(JsonObject json, 13675 ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 13676 ExplanationOfBenefit.AccidentComponent res = new ExplanationOfBenefit.AccidentComponent(); 13677 parseExplanationOfBenefitAccidentComponentProperties(json, owner, res); 13678 return res; 13679 } 13680 13681 protected void parseExplanationOfBenefitAccidentComponentProperties(JsonObject json, ExplanationOfBenefit owner, 13682 ExplanationOfBenefit.AccidentComponent res) throws IOException, FHIRFormatError { 13683 parseBackboneElementProperties(json, res); 13684 if (json.has("date")) 13685 res.setDateElement(parseDate(json.get("date").getAsString())); 13686 if (json.has("_date")) 13687 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 13688 if (json.has("type")) 13689 res.setType(parseCodeableConcept(getJObject(json, "type"))); 13690 Type location = parseType("location", json); 13691 if (location != null) 13692 res.setLocation(location); 13693 } 13694 13695 protected ExplanationOfBenefit.ItemComponent parseExplanationOfBenefitItemComponent(JsonObject json, 13696 ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 13697 ExplanationOfBenefit.ItemComponent res = new ExplanationOfBenefit.ItemComponent(); 13698 parseExplanationOfBenefitItemComponentProperties(json, owner, res); 13699 return res; 13700 } 13701 13702 protected void parseExplanationOfBenefitItemComponentProperties(JsonObject json, ExplanationOfBenefit owner, 13703 ExplanationOfBenefit.ItemComponent res) throws IOException, FHIRFormatError { 13704 parseBackboneElementProperties(json, res); 13705 if (json.has("sequence")) 13706 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 13707 if (json.has("_sequence")) 13708 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 13709 if (json.has("careTeamSequence")) { 13710 JsonArray array = json.getAsJsonArray("careTeamSequence"); 13711 for (int i = 0; i < array.size(); i++) { 13712 if (array.get(i).isJsonNull()) { 13713 res.getCareTeamSequence().add(new PositiveIntType()); 13714 } else { 13715 res.getCareTeamSequence().add(parsePositiveInt(array.get(i).getAsString())); 13716 } 13717 } 13718 } 13719 ; 13720 if (json.has("_careTeamSequence")) { 13721 JsonArray array = json.getAsJsonArray("_careTeamSequence"); 13722 for (int i = 0; i < array.size(); i++) { 13723 if (i == res.getCareTeamSequence().size()) 13724 res.getCareTeamSequence().add(parsePositiveInt(null)); 13725 if (array.get(i) instanceof JsonObject) 13726 parseElementProperties(array.get(i).getAsJsonObject(), res.getCareTeamSequence().get(i)); 13727 } 13728 } 13729 ; 13730 if (json.has("diagnosisSequence")) { 13731 JsonArray array = json.getAsJsonArray("diagnosisSequence"); 13732 for (int i = 0; i < array.size(); i++) { 13733 if (array.get(i).isJsonNull()) { 13734 res.getDiagnosisSequence().add(new PositiveIntType()); 13735 } else { 13736 res.getDiagnosisSequence().add(parsePositiveInt(array.get(i).getAsString())); 13737 } 13738 } 13739 } 13740 ; 13741 if (json.has("_diagnosisSequence")) { 13742 JsonArray array = json.getAsJsonArray("_diagnosisSequence"); 13743 for (int i = 0; i < array.size(); i++) { 13744 if (i == res.getDiagnosisSequence().size()) 13745 res.getDiagnosisSequence().add(parsePositiveInt(null)); 13746 if (array.get(i) instanceof JsonObject) 13747 parseElementProperties(array.get(i).getAsJsonObject(), res.getDiagnosisSequence().get(i)); 13748 } 13749 } 13750 ; 13751 if (json.has("procedureSequence")) { 13752 JsonArray array = json.getAsJsonArray("procedureSequence"); 13753 for (int i = 0; i < array.size(); i++) { 13754 if (array.get(i).isJsonNull()) { 13755 res.getProcedureSequence().add(new PositiveIntType()); 13756 } else { 13757 res.getProcedureSequence().add(parsePositiveInt(array.get(i).getAsString())); 13758 } 13759 } 13760 } 13761 ; 13762 if (json.has("_procedureSequence")) { 13763 JsonArray array = json.getAsJsonArray("_procedureSequence"); 13764 for (int i = 0; i < array.size(); i++) { 13765 if (i == res.getProcedureSequence().size()) 13766 res.getProcedureSequence().add(parsePositiveInt(null)); 13767 if (array.get(i) instanceof JsonObject) 13768 parseElementProperties(array.get(i).getAsJsonObject(), res.getProcedureSequence().get(i)); 13769 } 13770 } 13771 ; 13772 if (json.has("informationSequence")) { 13773 JsonArray array = json.getAsJsonArray("informationSequence"); 13774 for (int i = 0; i < array.size(); i++) { 13775 if (array.get(i).isJsonNull()) { 13776 res.getInformationSequence().add(new PositiveIntType()); 13777 } else { 13778 res.getInformationSequence().add(parsePositiveInt(array.get(i).getAsString())); 13779 } 13780 } 13781 } 13782 ; 13783 if (json.has("_informationSequence")) { 13784 JsonArray array = json.getAsJsonArray("_informationSequence"); 13785 for (int i = 0; i < array.size(); i++) { 13786 if (i == res.getInformationSequence().size()) 13787 res.getInformationSequence().add(parsePositiveInt(null)); 13788 if (array.get(i) instanceof JsonObject) 13789 parseElementProperties(array.get(i).getAsJsonObject(), res.getInformationSequence().get(i)); 13790 } 13791 } 13792 ; 13793 if (json.has("revenue")) 13794 res.setRevenue(parseCodeableConcept(getJObject(json, "revenue"))); 13795 if (json.has("category")) 13796 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 13797 if (json.has("productOrService")) 13798 res.setProductOrService(parseCodeableConcept(getJObject(json, "productOrService"))); 13799 if (json.has("modifier")) { 13800 JsonArray array = json.getAsJsonArray("modifier"); 13801 for (int i = 0; i < array.size(); i++) { 13802 res.getModifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 13803 } 13804 } 13805 ; 13806 if (json.has("programCode")) { 13807 JsonArray array = json.getAsJsonArray("programCode"); 13808 for (int i = 0; i < array.size(); i++) { 13809 res.getProgramCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 13810 } 13811 } 13812 ; 13813 Type serviced = parseType("serviced", json); 13814 if (serviced != null) 13815 res.setServiced(serviced); 13816 Type location = parseType("location", json); 13817 if (location != null) 13818 res.setLocation(location); 13819 if (json.has("quantity")) 13820 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 13821 if (json.has("unitPrice")) 13822 res.setUnitPrice(parseMoney(getJObject(json, "unitPrice"))); 13823 if (json.has("factor")) 13824 res.setFactorElement(parseDecimal(json.get("factor").getAsBigDecimal())); 13825 if (json.has("_factor")) 13826 parseElementProperties(getJObject(json, "_factor"), res.getFactorElement()); 13827 if (json.has("net")) 13828 res.setNet(parseMoney(getJObject(json, "net"))); 13829 if (json.has("udi")) { 13830 JsonArray array = json.getAsJsonArray("udi"); 13831 for (int i = 0; i < array.size(); i++) { 13832 res.getUdi().add(parseReference(array.get(i).getAsJsonObject())); 13833 } 13834 } 13835 ; 13836 if (json.has("bodySite")) 13837 res.setBodySite(parseCodeableConcept(getJObject(json, "bodySite"))); 13838 if (json.has("subSite")) { 13839 JsonArray array = json.getAsJsonArray("subSite"); 13840 for (int i = 0; i < array.size(); i++) { 13841 res.getSubSite().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 13842 } 13843 } 13844 ; 13845 if (json.has("encounter")) { 13846 JsonArray array = json.getAsJsonArray("encounter"); 13847 for (int i = 0; i < array.size(); i++) { 13848 res.getEncounter().add(parseReference(array.get(i).getAsJsonObject())); 13849 } 13850 } 13851 ; 13852 if (json.has("noteNumber")) { 13853 JsonArray array = json.getAsJsonArray("noteNumber"); 13854 for (int i = 0; i < array.size(); i++) { 13855 if (array.get(i).isJsonNull()) { 13856 res.getNoteNumber().add(new PositiveIntType()); 13857 } else { 13858 res.getNoteNumber().add(parsePositiveInt(array.get(i).getAsString())); 13859 } 13860 } 13861 } 13862 ; 13863 if (json.has("_noteNumber")) { 13864 JsonArray array = json.getAsJsonArray("_noteNumber"); 13865 for (int i = 0; i < array.size(); i++) { 13866 if (i == res.getNoteNumber().size()) 13867 res.getNoteNumber().add(parsePositiveInt(null)); 13868 if (array.get(i) instanceof JsonObject) 13869 parseElementProperties(array.get(i).getAsJsonObject(), res.getNoteNumber().get(i)); 13870 } 13871 } 13872 ; 13873 if (json.has("adjudication")) { 13874 JsonArray array = json.getAsJsonArray("adjudication"); 13875 for (int i = 0; i < array.size(); i++) { 13876 res.getAdjudication() 13877 .add(parseExplanationOfBenefitAdjudicationComponent(array.get(i).getAsJsonObject(), owner)); 13878 } 13879 } 13880 ; 13881 if (json.has("detail")) { 13882 JsonArray array = json.getAsJsonArray("detail"); 13883 for (int i = 0; i < array.size(); i++) { 13884 res.getDetail().add(parseExplanationOfBenefitDetailComponent(array.get(i).getAsJsonObject(), owner)); 13885 } 13886 } 13887 ; 13888 } 13889 13890 protected ExplanationOfBenefit.AdjudicationComponent parseExplanationOfBenefitAdjudicationComponent(JsonObject json, 13891 ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 13892 ExplanationOfBenefit.AdjudicationComponent res = new ExplanationOfBenefit.AdjudicationComponent(); 13893 parseExplanationOfBenefitAdjudicationComponentProperties(json, owner, res); 13894 return res; 13895 } 13896 13897 protected void parseExplanationOfBenefitAdjudicationComponentProperties(JsonObject json, ExplanationOfBenefit owner, 13898 ExplanationOfBenefit.AdjudicationComponent res) throws IOException, FHIRFormatError { 13899 parseBackboneElementProperties(json, res); 13900 if (json.has("category")) 13901 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 13902 if (json.has("reason")) 13903 res.setReason(parseCodeableConcept(getJObject(json, "reason"))); 13904 if (json.has("amount")) 13905 res.setAmount(parseMoney(getJObject(json, "amount"))); 13906 if (json.has("value")) 13907 res.setValueElement(parseDecimal(json.get("value").getAsBigDecimal())); 13908 if (json.has("_value")) 13909 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 13910 } 13911 13912 protected ExplanationOfBenefit.DetailComponent parseExplanationOfBenefitDetailComponent(JsonObject json, 13913 ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 13914 ExplanationOfBenefit.DetailComponent res = new ExplanationOfBenefit.DetailComponent(); 13915 parseExplanationOfBenefitDetailComponentProperties(json, owner, res); 13916 return res; 13917 } 13918 13919 protected void parseExplanationOfBenefitDetailComponentProperties(JsonObject json, ExplanationOfBenefit owner, 13920 ExplanationOfBenefit.DetailComponent res) throws IOException, FHIRFormatError { 13921 parseBackboneElementProperties(json, res); 13922 if (json.has("sequence")) 13923 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 13924 if (json.has("_sequence")) 13925 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 13926 if (json.has("revenue")) 13927 res.setRevenue(parseCodeableConcept(getJObject(json, "revenue"))); 13928 if (json.has("category")) 13929 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 13930 if (json.has("productOrService")) 13931 res.setProductOrService(parseCodeableConcept(getJObject(json, "productOrService"))); 13932 if (json.has("modifier")) { 13933 JsonArray array = json.getAsJsonArray("modifier"); 13934 for (int i = 0; i < array.size(); i++) { 13935 res.getModifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 13936 } 13937 } 13938 ; 13939 if (json.has("programCode")) { 13940 JsonArray array = json.getAsJsonArray("programCode"); 13941 for (int i = 0; i < array.size(); i++) { 13942 res.getProgramCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 13943 } 13944 } 13945 ; 13946 if (json.has("quantity")) 13947 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 13948 if (json.has("unitPrice")) 13949 res.setUnitPrice(parseMoney(getJObject(json, "unitPrice"))); 13950 if (json.has("factor")) 13951 res.setFactorElement(parseDecimal(json.get("factor").getAsBigDecimal())); 13952 if (json.has("_factor")) 13953 parseElementProperties(getJObject(json, "_factor"), res.getFactorElement()); 13954 if (json.has("net")) 13955 res.setNet(parseMoney(getJObject(json, "net"))); 13956 if (json.has("udi")) { 13957 JsonArray array = json.getAsJsonArray("udi"); 13958 for (int i = 0; i < array.size(); i++) { 13959 res.getUdi().add(parseReference(array.get(i).getAsJsonObject())); 13960 } 13961 } 13962 ; 13963 if (json.has("noteNumber")) { 13964 JsonArray array = json.getAsJsonArray("noteNumber"); 13965 for (int i = 0; i < array.size(); i++) { 13966 if (array.get(i).isJsonNull()) { 13967 res.getNoteNumber().add(new PositiveIntType()); 13968 } else { 13969 res.getNoteNumber().add(parsePositiveInt(array.get(i).getAsString())); 13970 } 13971 } 13972 } 13973 ; 13974 if (json.has("_noteNumber")) { 13975 JsonArray array = json.getAsJsonArray("_noteNumber"); 13976 for (int i = 0; i < array.size(); i++) { 13977 if (i == res.getNoteNumber().size()) 13978 res.getNoteNumber().add(parsePositiveInt(null)); 13979 if (array.get(i) instanceof JsonObject) 13980 parseElementProperties(array.get(i).getAsJsonObject(), res.getNoteNumber().get(i)); 13981 } 13982 } 13983 ; 13984 if (json.has("adjudication")) { 13985 JsonArray array = json.getAsJsonArray("adjudication"); 13986 for (int i = 0; i < array.size(); i++) { 13987 res.getAdjudication() 13988 .add(parseExplanationOfBenefitAdjudicationComponent(array.get(i).getAsJsonObject(), owner)); 13989 } 13990 } 13991 ; 13992 if (json.has("subDetail")) { 13993 JsonArray array = json.getAsJsonArray("subDetail"); 13994 for (int i = 0; i < array.size(); i++) { 13995 res.getSubDetail().add(parseExplanationOfBenefitSubDetailComponent(array.get(i).getAsJsonObject(), owner)); 13996 } 13997 } 13998 ; 13999 } 14000 14001 protected ExplanationOfBenefit.SubDetailComponent parseExplanationOfBenefitSubDetailComponent(JsonObject json, 14002 ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 14003 ExplanationOfBenefit.SubDetailComponent res = new ExplanationOfBenefit.SubDetailComponent(); 14004 parseExplanationOfBenefitSubDetailComponentProperties(json, owner, res); 14005 return res; 14006 } 14007 14008 protected void parseExplanationOfBenefitSubDetailComponentProperties(JsonObject json, ExplanationOfBenefit owner, 14009 ExplanationOfBenefit.SubDetailComponent res) throws IOException, FHIRFormatError { 14010 parseBackboneElementProperties(json, res); 14011 if (json.has("sequence")) 14012 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 14013 if (json.has("_sequence")) 14014 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 14015 if (json.has("revenue")) 14016 res.setRevenue(parseCodeableConcept(getJObject(json, "revenue"))); 14017 if (json.has("category")) 14018 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 14019 if (json.has("productOrService")) 14020 res.setProductOrService(parseCodeableConcept(getJObject(json, "productOrService"))); 14021 if (json.has("modifier")) { 14022 JsonArray array = json.getAsJsonArray("modifier"); 14023 for (int i = 0; i < array.size(); i++) { 14024 res.getModifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 14025 } 14026 } 14027 ; 14028 if (json.has("programCode")) { 14029 JsonArray array = json.getAsJsonArray("programCode"); 14030 for (int i = 0; i < array.size(); i++) { 14031 res.getProgramCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 14032 } 14033 } 14034 ; 14035 if (json.has("quantity")) 14036 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 14037 if (json.has("unitPrice")) 14038 res.setUnitPrice(parseMoney(getJObject(json, "unitPrice"))); 14039 if (json.has("factor")) 14040 res.setFactorElement(parseDecimal(json.get("factor").getAsBigDecimal())); 14041 if (json.has("_factor")) 14042 parseElementProperties(getJObject(json, "_factor"), res.getFactorElement()); 14043 if (json.has("net")) 14044 res.setNet(parseMoney(getJObject(json, "net"))); 14045 if (json.has("udi")) { 14046 JsonArray array = json.getAsJsonArray("udi"); 14047 for (int i = 0; i < array.size(); i++) { 14048 res.getUdi().add(parseReference(array.get(i).getAsJsonObject())); 14049 } 14050 } 14051 ; 14052 if (json.has("noteNumber")) { 14053 JsonArray array = json.getAsJsonArray("noteNumber"); 14054 for (int i = 0; i < array.size(); i++) { 14055 if (array.get(i).isJsonNull()) { 14056 res.getNoteNumber().add(new PositiveIntType()); 14057 } else { 14058 res.getNoteNumber().add(parsePositiveInt(array.get(i).getAsString())); 14059 } 14060 } 14061 } 14062 ; 14063 if (json.has("_noteNumber")) { 14064 JsonArray array = json.getAsJsonArray("_noteNumber"); 14065 for (int i = 0; i < array.size(); i++) { 14066 if (i == res.getNoteNumber().size()) 14067 res.getNoteNumber().add(parsePositiveInt(null)); 14068 if (array.get(i) instanceof JsonObject) 14069 parseElementProperties(array.get(i).getAsJsonObject(), res.getNoteNumber().get(i)); 14070 } 14071 } 14072 ; 14073 if (json.has("adjudication")) { 14074 JsonArray array = json.getAsJsonArray("adjudication"); 14075 for (int i = 0; i < array.size(); i++) { 14076 res.getAdjudication() 14077 .add(parseExplanationOfBenefitAdjudicationComponent(array.get(i).getAsJsonObject(), owner)); 14078 } 14079 } 14080 ; 14081 } 14082 14083 protected ExplanationOfBenefit.AddedItemComponent parseExplanationOfBenefitAddedItemComponent(JsonObject json, 14084 ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 14085 ExplanationOfBenefit.AddedItemComponent res = new ExplanationOfBenefit.AddedItemComponent(); 14086 parseExplanationOfBenefitAddedItemComponentProperties(json, owner, res); 14087 return res; 14088 } 14089 14090 protected void parseExplanationOfBenefitAddedItemComponentProperties(JsonObject json, ExplanationOfBenefit owner, 14091 ExplanationOfBenefit.AddedItemComponent res) throws IOException, FHIRFormatError { 14092 parseBackboneElementProperties(json, res); 14093 if (json.has("itemSequence")) { 14094 JsonArray array = json.getAsJsonArray("itemSequence"); 14095 for (int i = 0; i < array.size(); i++) { 14096 if (array.get(i).isJsonNull()) { 14097 res.getItemSequence().add(new PositiveIntType()); 14098 } else { 14099 res.getItemSequence().add(parsePositiveInt(array.get(i).getAsString())); 14100 } 14101 } 14102 } 14103 ; 14104 if (json.has("_itemSequence")) { 14105 JsonArray array = json.getAsJsonArray("_itemSequence"); 14106 for (int i = 0; i < array.size(); i++) { 14107 if (i == res.getItemSequence().size()) 14108 res.getItemSequence().add(parsePositiveInt(null)); 14109 if (array.get(i) instanceof JsonObject) 14110 parseElementProperties(array.get(i).getAsJsonObject(), res.getItemSequence().get(i)); 14111 } 14112 } 14113 ; 14114 if (json.has("detailSequence")) { 14115 JsonArray array = json.getAsJsonArray("detailSequence"); 14116 for (int i = 0; i < array.size(); i++) { 14117 if (array.get(i).isJsonNull()) { 14118 res.getDetailSequence().add(new PositiveIntType()); 14119 } else { 14120 res.getDetailSequence().add(parsePositiveInt(array.get(i).getAsString())); 14121 } 14122 } 14123 } 14124 ; 14125 if (json.has("_detailSequence")) { 14126 JsonArray array = json.getAsJsonArray("_detailSequence"); 14127 for (int i = 0; i < array.size(); i++) { 14128 if (i == res.getDetailSequence().size()) 14129 res.getDetailSequence().add(parsePositiveInt(null)); 14130 if (array.get(i) instanceof JsonObject) 14131 parseElementProperties(array.get(i).getAsJsonObject(), res.getDetailSequence().get(i)); 14132 } 14133 } 14134 ; 14135 if (json.has("subDetailSequence")) { 14136 JsonArray array = json.getAsJsonArray("subDetailSequence"); 14137 for (int i = 0; i < array.size(); i++) { 14138 if (array.get(i).isJsonNull()) { 14139 res.getSubDetailSequence().add(new PositiveIntType()); 14140 } else { 14141 res.getSubDetailSequence().add(parsePositiveInt(array.get(i).getAsString())); 14142 } 14143 } 14144 } 14145 ; 14146 if (json.has("_subDetailSequence")) { 14147 JsonArray array = json.getAsJsonArray("_subDetailSequence"); 14148 for (int i = 0; i < array.size(); i++) { 14149 if (i == res.getSubDetailSequence().size()) 14150 res.getSubDetailSequence().add(parsePositiveInt(null)); 14151 if (array.get(i) instanceof JsonObject) 14152 parseElementProperties(array.get(i).getAsJsonObject(), res.getSubDetailSequence().get(i)); 14153 } 14154 } 14155 ; 14156 if (json.has("provider")) { 14157 JsonArray array = json.getAsJsonArray("provider"); 14158 for (int i = 0; i < array.size(); i++) { 14159 res.getProvider().add(parseReference(array.get(i).getAsJsonObject())); 14160 } 14161 } 14162 ; 14163 if (json.has("productOrService")) 14164 res.setProductOrService(parseCodeableConcept(getJObject(json, "productOrService"))); 14165 if (json.has("modifier")) { 14166 JsonArray array = json.getAsJsonArray("modifier"); 14167 for (int i = 0; i < array.size(); i++) { 14168 res.getModifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 14169 } 14170 } 14171 ; 14172 if (json.has("programCode")) { 14173 JsonArray array = json.getAsJsonArray("programCode"); 14174 for (int i = 0; i < array.size(); i++) { 14175 res.getProgramCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 14176 } 14177 } 14178 ; 14179 Type serviced = parseType("serviced", json); 14180 if (serviced != null) 14181 res.setServiced(serviced); 14182 Type location = parseType("location", json); 14183 if (location != null) 14184 res.setLocation(location); 14185 if (json.has("quantity")) 14186 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 14187 if (json.has("unitPrice")) 14188 res.setUnitPrice(parseMoney(getJObject(json, "unitPrice"))); 14189 if (json.has("factor")) 14190 res.setFactorElement(parseDecimal(json.get("factor").getAsBigDecimal())); 14191 if (json.has("_factor")) 14192 parseElementProperties(getJObject(json, "_factor"), res.getFactorElement()); 14193 if (json.has("net")) 14194 res.setNet(parseMoney(getJObject(json, "net"))); 14195 if (json.has("bodySite")) 14196 res.setBodySite(parseCodeableConcept(getJObject(json, "bodySite"))); 14197 if (json.has("subSite")) { 14198 JsonArray array = json.getAsJsonArray("subSite"); 14199 for (int i = 0; i < array.size(); i++) { 14200 res.getSubSite().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 14201 } 14202 } 14203 ; 14204 if (json.has("noteNumber")) { 14205 JsonArray array = json.getAsJsonArray("noteNumber"); 14206 for (int i = 0; i < array.size(); i++) { 14207 if (array.get(i).isJsonNull()) { 14208 res.getNoteNumber().add(new PositiveIntType()); 14209 } else { 14210 res.getNoteNumber().add(parsePositiveInt(array.get(i).getAsString())); 14211 } 14212 } 14213 } 14214 ; 14215 if (json.has("_noteNumber")) { 14216 JsonArray array = json.getAsJsonArray("_noteNumber"); 14217 for (int i = 0; i < array.size(); i++) { 14218 if (i == res.getNoteNumber().size()) 14219 res.getNoteNumber().add(parsePositiveInt(null)); 14220 if (array.get(i) instanceof JsonObject) 14221 parseElementProperties(array.get(i).getAsJsonObject(), res.getNoteNumber().get(i)); 14222 } 14223 } 14224 ; 14225 if (json.has("adjudication")) { 14226 JsonArray array = json.getAsJsonArray("adjudication"); 14227 for (int i = 0; i < array.size(); i++) { 14228 res.getAdjudication() 14229 .add(parseExplanationOfBenefitAdjudicationComponent(array.get(i).getAsJsonObject(), owner)); 14230 } 14231 } 14232 ; 14233 if (json.has("detail")) { 14234 JsonArray array = json.getAsJsonArray("detail"); 14235 for (int i = 0; i < array.size(); i++) { 14236 res.getDetail().add(parseExplanationOfBenefitAddedItemDetailComponent(array.get(i).getAsJsonObject(), owner)); 14237 } 14238 } 14239 ; 14240 } 14241 14242 protected ExplanationOfBenefit.AddedItemDetailComponent parseExplanationOfBenefitAddedItemDetailComponent( 14243 JsonObject json, ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 14244 ExplanationOfBenefit.AddedItemDetailComponent res = new ExplanationOfBenefit.AddedItemDetailComponent(); 14245 parseExplanationOfBenefitAddedItemDetailComponentProperties(json, owner, res); 14246 return res; 14247 } 14248 14249 protected void parseExplanationOfBenefitAddedItemDetailComponentProperties(JsonObject json, 14250 ExplanationOfBenefit owner, ExplanationOfBenefit.AddedItemDetailComponent res) 14251 throws IOException, FHIRFormatError { 14252 parseBackboneElementProperties(json, res); 14253 if (json.has("productOrService")) 14254 res.setProductOrService(parseCodeableConcept(getJObject(json, "productOrService"))); 14255 if (json.has("modifier")) { 14256 JsonArray array = json.getAsJsonArray("modifier"); 14257 for (int i = 0; i < array.size(); i++) { 14258 res.getModifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 14259 } 14260 } 14261 ; 14262 if (json.has("quantity")) 14263 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 14264 if (json.has("unitPrice")) 14265 res.setUnitPrice(parseMoney(getJObject(json, "unitPrice"))); 14266 if (json.has("factor")) 14267 res.setFactorElement(parseDecimal(json.get("factor").getAsBigDecimal())); 14268 if (json.has("_factor")) 14269 parseElementProperties(getJObject(json, "_factor"), res.getFactorElement()); 14270 if (json.has("net")) 14271 res.setNet(parseMoney(getJObject(json, "net"))); 14272 if (json.has("noteNumber")) { 14273 JsonArray array = json.getAsJsonArray("noteNumber"); 14274 for (int i = 0; i < array.size(); i++) { 14275 if (array.get(i).isJsonNull()) { 14276 res.getNoteNumber().add(new PositiveIntType()); 14277 } else { 14278 res.getNoteNumber().add(parsePositiveInt(array.get(i).getAsString())); 14279 } 14280 } 14281 } 14282 ; 14283 if (json.has("_noteNumber")) { 14284 JsonArray array = json.getAsJsonArray("_noteNumber"); 14285 for (int i = 0; i < array.size(); i++) { 14286 if (i == res.getNoteNumber().size()) 14287 res.getNoteNumber().add(parsePositiveInt(null)); 14288 if (array.get(i) instanceof JsonObject) 14289 parseElementProperties(array.get(i).getAsJsonObject(), res.getNoteNumber().get(i)); 14290 } 14291 } 14292 ; 14293 if (json.has("adjudication")) { 14294 JsonArray array = json.getAsJsonArray("adjudication"); 14295 for (int i = 0; i < array.size(); i++) { 14296 res.getAdjudication() 14297 .add(parseExplanationOfBenefitAdjudicationComponent(array.get(i).getAsJsonObject(), owner)); 14298 } 14299 } 14300 ; 14301 if (json.has("subDetail")) { 14302 JsonArray array = json.getAsJsonArray("subDetail"); 14303 for (int i = 0; i < array.size(); i++) { 14304 res.getSubDetail() 14305 .add(parseExplanationOfBenefitAddedItemDetailSubDetailComponent(array.get(i).getAsJsonObject(), owner)); 14306 } 14307 } 14308 ; 14309 } 14310 14311 protected ExplanationOfBenefit.AddedItemDetailSubDetailComponent parseExplanationOfBenefitAddedItemDetailSubDetailComponent( 14312 JsonObject json, ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 14313 ExplanationOfBenefit.AddedItemDetailSubDetailComponent res = new ExplanationOfBenefit.AddedItemDetailSubDetailComponent(); 14314 parseExplanationOfBenefitAddedItemDetailSubDetailComponentProperties(json, owner, res); 14315 return res; 14316 } 14317 14318 protected void parseExplanationOfBenefitAddedItemDetailSubDetailComponentProperties(JsonObject json, 14319 ExplanationOfBenefit owner, ExplanationOfBenefit.AddedItemDetailSubDetailComponent res) 14320 throws IOException, FHIRFormatError { 14321 parseBackboneElementProperties(json, res); 14322 if (json.has("productOrService")) 14323 res.setProductOrService(parseCodeableConcept(getJObject(json, "productOrService"))); 14324 if (json.has("modifier")) { 14325 JsonArray array = json.getAsJsonArray("modifier"); 14326 for (int i = 0; i < array.size(); i++) { 14327 res.getModifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 14328 } 14329 } 14330 ; 14331 if (json.has("quantity")) 14332 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 14333 if (json.has("unitPrice")) 14334 res.setUnitPrice(parseMoney(getJObject(json, "unitPrice"))); 14335 if (json.has("factor")) 14336 res.setFactorElement(parseDecimal(json.get("factor").getAsBigDecimal())); 14337 if (json.has("_factor")) 14338 parseElementProperties(getJObject(json, "_factor"), res.getFactorElement()); 14339 if (json.has("net")) 14340 res.setNet(parseMoney(getJObject(json, "net"))); 14341 if (json.has("noteNumber")) { 14342 JsonArray array = json.getAsJsonArray("noteNumber"); 14343 for (int i = 0; i < array.size(); i++) { 14344 if (array.get(i).isJsonNull()) { 14345 res.getNoteNumber().add(new PositiveIntType()); 14346 } else { 14347 res.getNoteNumber().add(parsePositiveInt(array.get(i).getAsString())); 14348 } 14349 } 14350 } 14351 ; 14352 if (json.has("_noteNumber")) { 14353 JsonArray array = json.getAsJsonArray("_noteNumber"); 14354 for (int i = 0; i < array.size(); i++) { 14355 if (i == res.getNoteNumber().size()) 14356 res.getNoteNumber().add(parsePositiveInt(null)); 14357 if (array.get(i) instanceof JsonObject) 14358 parseElementProperties(array.get(i).getAsJsonObject(), res.getNoteNumber().get(i)); 14359 } 14360 } 14361 ; 14362 if (json.has("adjudication")) { 14363 JsonArray array = json.getAsJsonArray("adjudication"); 14364 for (int i = 0; i < array.size(); i++) { 14365 res.getAdjudication() 14366 .add(parseExplanationOfBenefitAdjudicationComponent(array.get(i).getAsJsonObject(), owner)); 14367 } 14368 } 14369 ; 14370 } 14371 14372 protected ExplanationOfBenefit.TotalComponent parseExplanationOfBenefitTotalComponent(JsonObject json, 14373 ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 14374 ExplanationOfBenefit.TotalComponent res = new ExplanationOfBenefit.TotalComponent(); 14375 parseExplanationOfBenefitTotalComponentProperties(json, owner, res); 14376 return res; 14377 } 14378 14379 protected void parseExplanationOfBenefitTotalComponentProperties(JsonObject json, ExplanationOfBenefit owner, 14380 ExplanationOfBenefit.TotalComponent res) throws IOException, FHIRFormatError { 14381 parseBackboneElementProperties(json, res); 14382 if (json.has("category")) 14383 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 14384 if (json.has("amount")) 14385 res.setAmount(parseMoney(getJObject(json, "amount"))); 14386 } 14387 14388 protected ExplanationOfBenefit.PaymentComponent parseExplanationOfBenefitPaymentComponent(JsonObject json, 14389 ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 14390 ExplanationOfBenefit.PaymentComponent res = new ExplanationOfBenefit.PaymentComponent(); 14391 parseExplanationOfBenefitPaymentComponentProperties(json, owner, res); 14392 return res; 14393 } 14394 14395 protected void parseExplanationOfBenefitPaymentComponentProperties(JsonObject json, ExplanationOfBenefit owner, 14396 ExplanationOfBenefit.PaymentComponent res) throws IOException, FHIRFormatError { 14397 parseBackboneElementProperties(json, res); 14398 if (json.has("type")) 14399 res.setType(parseCodeableConcept(getJObject(json, "type"))); 14400 if (json.has("adjustment")) 14401 res.setAdjustment(parseMoney(getJObject(json, "adjustment"))); 14402 if (json.has("adjustmentReason")) 14403 res.setAdjustmentReason(parseCodeableConcept(getJObject(json, "adjustmentReason"))); 14404 if (json.has("date")) 14405 res.setDateElement(parseDate(json.get("date").getAsString())); 14406 if (json.has("_date")) 14407 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 14408 if (json.has("amount")) 14409 res.setAmount(parseMoney(getJObject(json, "amount"))); 14410 if (json.has("identifier")) 14411 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 14412 } 14413 14414 protected ExplanationOfBenefit.NoteComponent parseExplanationOfBenefitNoteComponent(JsonObject json, 14415 ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 14416 ExplanationOfBenefit.NoteComponent res = new ExplanationOfBenefit.NoteComponent(); 14417 parseExplanationOfBenefitNoteComponentProperties(json, owner, res); 14418 return res; 14419 } 14420 14421 protected void parseExplanationOfBenefitNoteComponentProperties(JsonObject json, ExplanationOfBenefit owner, 14422 ExplanationOfBenefit.NoteComponent res) throws IOException, FHIRFormatError { 14423 parseBackboneElementProperties(json, res); 14424 if (json.has("number")) 14425 res.setNumberElement(parsePositiveInt(json.get("number").getAsString())); 14426 if (json.has("_number")) 14427 parseElementProperties(getJObject(json, "_number"), res.getNumberElement()); 14428 if (json.has("type")) 14429 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), Enumerations.NoteType.NULL, 14430 new Enumerations.NoteTypeEnumFactory())); 14431 if (json.has("_type")) 14432 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 14433 if (json.has("text")) 14434 res.setTextElement(parseString(json.get("text").getAsString())); 14435 if (json.has("_text")) 14436 parseElementProperties(getJObject(json, "_text"), res.getTextElement()); 14437 if (json.has("language")) 14438 res.setLanguage(parseCodeableConcept(getJObject(json, "language"))); 14439 } 14440 14441 protected ExplanationOfBenefit.BenefitBalanceComponent parseExplanationOfBenefitBenefitBalanceComponent( 14442 JsonObject json, ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 14443 ExplanationOfBenefit.BenefitBalanceComponent res = new ExplanationOfBenefit.BenefitBalanceComponent(); 14444 parseExplanationOfBenefitBenefitBalanceComponentProperties(json, owner, res); 14445 return res; 14446 } 14447 14448 protected void parseExplanationOfBenefitBenefitBalanceComponentProperties(JsonObject json, ExplanationOfBenefit owner, 14449 ExplanationOfBenefit.BenefitBalanceComponent res) throws IOException, FHIRFormatError { 14450 parseBackboneElementProperties(json, res); 14451 if (json.has("category")) 14452 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 14453 if (json.has("excluded")) 14454 res.setExcludedElement(parseBoolean(json.get("excluded").getAsBoolean())); 14455 if (json.has("_excluded")) 14456 parseElementProperties(getJObject(json, "_excluded"), res.getExcludedElement()); 14457 if (json.has("name")) 14458 res.setNameElement(parseString(json.get("name").getAsString())); 14459 if (json.has("_name")) 14460 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 14461 if (json.has("description")) 14462 res.setDescriptionElement(parseString(json.get("description").getAsString())); 14463 if (json.has("_description")) 14464 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 14465 if (json.has("network")) 14466 res.setNetwork(parseCodeableConcept(getJObject(json, "network"))); 14467 if (json.has("unit")) 14468 res.setUnit(parseCodeableConcept(getJObject(json, "unit"))); 14469 if (json.has("term")) 14470 res.setTerm(parseCodeableConcept(getJObject(json, "term"))); 14471 if (json.has("financial")) { 14472 JsonArray array = json.getAsJsonArray("financial"); 14473 for (int i = 0; i < array.size(); i++) { 14474 res.getFinancial().add(parseExplanationOfBenefitBenefitComponent(array.get(i).getAsJsonObject(), owner)); 14475 } 14476 } 14477 ; 14478 } 14479 14480 protected ExplanationOfBenefit.BenefitComponent parseExplanationOfBenefitBenefitComponent(JsonObject json, 14481 ExplanationOfBenefit owner) throws IOException, FHIRFormatError { 14482 ExplanationOfBenefit.BenefitComponent res = new ExplanationOfBenefit.BenefitComponent(); 14483 parseExplanationOfBenefitBenefitComponentProperties(json, owner, res); 14484 return res; 14485 } 14486 14487 protected void parseExplanationOfBenefitBenefitComponentProperties(JsonObject json, ExplanationOfBenefit owner, 14488 ExplanationOfBenefit.BenefitComponent res) throws IOException, FHIRFormatError { 14489 parseBackboneElementProperties(json, res); 14490 if (json.has("type")) 14491 res.setType(parseCodeableConcept(getJObject(json, "type"))); 14492 Type allowed = parseType("allowed", json); 14493 if (allowed != null) 14494 res.setAllowed(allowed); 14495 Type used = parseType("used", json); 14496 if (used != null) 14497 res.setUsed(used); 14498 } 14499 14500 protected FamilyMemberHistory parseFamilyMemberHistory(JsonObject json) throws IOException, FHIRFormatError { 14501 FamilyMemberHistory res = new FamilyMemberHistory(); 14502 parseFamilyMemberHistoryProperties(json, res); 14503 return res; 14504 } 14505 14506 protected void parseFamilyMemberHistoryProperties(JsonObject json, FamilyMemberHistory res) 14507 throws IOException, FHIRFormatError { 14508 parseDomainResourceProperties(json, res); 14509 if (json.has("identifier")) { 14510 JsonArray array = json.getAsJsonArray("identifier"); 14511 for (int i = 0; i < array.size(); i++) { 14512 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 14513 } 14514 } 14515 ; 14516 if (json.has("instantiatesCanonical")) { 14517 JsonArray array = json.getAsJsonArray("instantiatesCanonical"); 14518 for (int i = 0; i < array.size(); i++) { 14519 if (array.get(i).isJsonNull()) { 14520 res.getInstantiatesCanonical().add(new CanonicalType()); 14521 } else { 14522 res.getInstantiatesCanonical().add(parseCanonical(array.get(i).getAsString())); 14523 } 14524 } 14525 } 14526 ; 14527 if (json.has("_instantiatesCanonical")) { 14528 JsonArray array = json.getAsJsonArray("_instantiatesCanonical"); 14529 for (int i = 0; i < array.size(); i++) { 14530 if (i == res.getInstantiatesCanonical().size()) 14531 res.getInstantiatesCanonical().add(parseCanonical(null)); 14532 if (array.get(i) instanceof JsonObject) 14533 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesCanonical().get(i)); 14534 } 14535 } 14536 ; 14537 if (json.has("instantiatesUri")) { 14538 JsonArray array = json.getAsJsonArray("instantiatesUri"); 14539 for (int i = 0; i < array.size(); i++) { 14540 if (array.get(i).isJsonNull()) { 14541 res.getInstantiatesUri().add(new UriType()); 14542 } else { 14543 res.getInstantiatesUri().add(parseUri(array.get(i).getAsString())); 14544 } 14545 } 14546 } 14547 ; 14548 if (json.has("_instantiatesUri")) { 14549 JsonArray array = json.getAsJsonArray("_instantiatesUri"); 14550 for (int i = 0; i < array.size(); i++) { 14551 if (i == res.getInstantiatesUri().size()) 14552 res.getInstantiatesUri().add(parseUri(null)); 14553 if (array.get(i) instanceof JsonObject) 14554 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesUri().get(i)); 14555 } 14556 } 14557 ; 14558 if (json.has("status")) 14559 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), 14560 FamilyMemberHistory.FamilyHistoryStatus.NULL, new FamilyMemberHistory.FamilyHistoryStatusEnumFactory())); 14561 if (json.has("_status")) 14562 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 14563 if (json.has("dataAbsentReason")) 14564 res.setDataAbsentReason(parseCodeableConcept(getJObject(json, "dataAbsentReason"))); 14565 if (json.has("patient")) 14566 res.setPatient(parseReference(getJObject(json, "patient"))); 14567 if (json.has("date")) 14568 res.setDateElement(parseDateTime(json.get("date").getAsString())); 14569 if (json.has("_date")) 14570 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 14571 if (json.has("name")) 14572 res.setNameElement(parseString(json.get("name").getAsString())); 14573 if (json.has("_name")) 14574 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 14575 if (json.has("relationship")) 14576 res.setRelationship(parseCodeableConcept(getJObject(json, "relationship"))); 14577 if (json.has("sex")) 14578 res.setSex(parseCodeableConcept(getJObject(json, "sex"))); 14579 Type born = parseType("born", json); 14580 if (born != null) 14581 res.setBorn(born); 14582 Type age = parseType("age", json); 14583 if (age != null) 14584 res.setAge(age); 14585 if (json.has("estimatedAge")) 14586 res.setEstimatedAgeElement(parseBoolean(json.get("estimatedAge").getAsBoolean())); 14587 if (json.has("_estimatedAge")) 14588 parseElementProperties(getJObject(json, "_estimatedAge"), res.getEstimatedAgeElement()); 14589 Type deceased = parseType("deceased", json); 14590 if (deceased != null) 14591 res.setDeceased(deceased); 14592 if (json.has("reasonCode")) { 14593 JsonArray array = json.getAsJsonArray("reasonCode"); 14594 for (int i = 0; i < array.size(); i++) { 14595 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 14596 } 14597 } 14598 ; 14599 if (json.has("reasonReference")) { 14600 JsonArray array = json.getAsJsonArray("reasonReference"); 14601 for (int i = 0; i < array.size(); i++) { 14602 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 14603 } 14604 } 14605 ; 14606 if (json.has("note")) { 14607 JsonArray array = json.getAsJsonArray("note"); 14608 for (int i = 0; i < array.size(); i++) { 14609 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 14610 } 14611 } 14612 ; 14613 if (json.has("condition")) { 14614 JsonArray array = json.getAsJsonArray("condition"); 14615 for (int i = 0; i < array.size(); i++) { 14616 res.getCondition() 14617 .add(parseFamilyMemberHistoryFamilyMemberHistoryConditionComponent(array.get(i).getAsJsonObject(), res)); 14618 } 14619 } 14620 ; 14621 } 14622 14623 protected FamilyMemberHistory.FamilyMemberHistoryConditionComponent parseFamilyMemberHistoryFamilyMemberHistoryConditionComponent( 14624 JsonObject json, FamilyMemberHistory owner) throws IOException, FHIRFormatError { 14625 FamilyMemberHistory.FamilyMemberHistoryConditionComponent res = new FamilyMemberHistory.FamilyMemberHistoryConditionComponent(); 14626 parseFamilyMemberHistoryFamilyMemberHistoryConditionComponentProperties(json, owner, res); 14627 return res; 14628 } 14629 14630 protected void parseFamilyMemberHistoryFamilyMemberHistoryConditionComponentProperties(JsonObject json, 14631 FamilyMemberHistory owner, FamilyMemberHistory.FamilyMemberHistoryConditionComponent res) 14632 throws IOException, FHIRFormatError { 14633 parseBackboneElementProperties(json, res); 14634 if (json.has("code")) 14635 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 14636 if (json.has("outcome")) 14637 res.setOutcome(parseCodeableConcept(getJObject(json, "outcome"))); 14638 if (json.has("contributedToDeath")) 14639 res.setContributedToDeathElement(parseBoolean(json.get("contributedToDeath").getAsBoolean())); 14640 if (json.has("_contributedToDeath")) 14641 parseElementProperties(getJObject(json, "_contributedToDeath"), res.getContributedToDeathElement()); 14642 Type onset = parseType("onset", json); 14643 if (onset != null) 14644 res.setOnset(onset); 14645 if (json.has("note")) { 14646 JsonArray array = json.getAsJsonArray("note"); 14647 for (int i = 0; i < array.size(); i++) { 14648 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 14649 } 14650 } 14651 ; 14652 } 14653 14654 protected Flag parseFlag(JsonObject json) throws IOException, FHIRFormatError { 14655 Flag res = new Flag(); 14656 parseFlagProperties(json, res); 14657 return res; 14658 } 14659 14660 protected void parseFlagProperties(JsonObject json, Flag res) throws IOException, FHIRFormatError { 14661 parseDomainResourceProperties(json, res); 14662 if (json.has("identifier")) { 14663 JsonArray array = json.getAsJsonArray("identifier"); 14664 for (int i = 0; i < array.size(); i++) { 14665 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 14666 } 14667 } 14668 ; 14669 if (json.has("status")) 14670 res.setStatusElement( 14671 parseEnumeration(json.get("status").getAsString(), Flag.FlagStatus.NULL, new Flag.FlagStatusEnumFactory())); 14672 if (json.has("_status")) 14673 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 14674 if (json.has("category")) { 14675 JsonArray array = json.getAsJsonArray("category"); 14676 for (int i = 0; i < array.size(); i++) { 14677 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 14678 } 14679 } 14680 ; 14681 if (json.has("code")) 14682 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 14683 if (json.has("subject")) 14684 res.setSubject(parseReference(getJObject(json, "subject"))); 14685 if (json.has("period")) 14686 res.setPeriod(parsePeriod(getJObject(json, "period"))); 14687 if (json.has("encounter")) 14688 res.setEncounter(parseReference(getJObject(json, "encounter"))); 14689 if (json.has("author")) 14690 res.setAuthor(parseReference(getJObject(json, "author"))); 14691 } 14692 14693 protected Goal parseGoal(JsonObject json) throws IOException, FHIRFormatError { 14694 Goal res = new Goal(); 14695 parseGoalProperties(json, res); 14696 return res; 14697 } 14698 14699 protected void parseGoalProperties(JsonObject json, Goal res) throws IOException, FHIRFormatError { 14700 parseDomainResourceProperties(json, res); 14701 if (json.has("identifier")) { 14702 JsonArray array = json.getAsJsonArray("identifier"); 14703 for (int i = 0; i < array.size(); i++) { 14704 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 14705 } 14706 } 14707 ; 14708 if (json.has("lifecycleStatus")) 14709 res.setLifecycleStatusElement(parseEnumeration(json.get("lifecycleStatus").getAsString(), 14710 Goal.GoalLifecycleStatus.NULL, new Goal.GoalLifecycleStatusEnumFactory())); 14711 if (json.has("_lifecycleStatus")) 14712 parseElementProperties(getJObject(json, "_lifecycleStatus"), res.getLifecycleStatusElement()); 14713 if (json.has("achievementStatus")) 14714 res.setAchievementStatus(parseCodeableConcept(getJObject(json, "achievementStatus"))); 14715 if (json.has("category")) { 14716 JsonArray array = json.getAsJsonArray("category"); 14717 for (int i = 0; i < array.size(); i++) { 14718 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 14719 } 14720 } 14721 ; 14722 if (json.has("priority")) 14723 res.setPriority(parseCodeableConcept(getJObject(json, "priority"))); 14724 if (json.has("description")) 14725 res.setDescription(parseCodeableConcept(getJObject(json, "description"))); 14726 if (json.has("subject")) 14727 res.setSubject(parseReference(getJObject(json, "subject"))); 14728 Type start = parseType("start", json); 14729 if (start != null) 14730 res.setStart(start); 14731 if (json.has("target")) { 14732 JsonArray array = json.getAsJsonArray("target"); 14733 for (int i = 0; i < array.size(); i++) { 14734 res.getTarget().add(parseGoalGoalTargetComponent(array.get(i).getAsJsonObject(), res)); 14735 } 14736 } 14737 ; 14738 if (json.has("statusDate")) 14739 res.setStatusDateElement(parseDate(json.get("statusDate").getAsString())); 14740 if (json.has("_statusDate")) 14741 parseElementProperties(getJObject(json, "_statusDate"), res.getStatusDateElement()); 14742 if (json.has("statusReason")) 14743 res.setStatusReasonElement(parseString(json.get("statusReason").getAsString())); 14744 if (json.has("_statusReason")) 14745 parseElementProperties(getJObject(json, "_statusReason"), res.getStatusReasonElement()); 14746 if (json.has("expressedBy")) 14747 res.setExpressedBy(parseReference(getJObject(json, "expressedBy"))); 14748 if (json.has("addresses")) { 14749 JsonArray array = json.getAsJsonArray("addresses"); 14750 for (int i = 0; i < array.size(); i++) { 14751 res.getAddresses().add(parseReference(array.get(i).getAsJsonObject())); 14752 } 14753 } 14754 ; 14755 if (json.has("note")) { 14756 JsonArray array = json.getAsJsonArray("note"); 14757 for (int i = 0; i < array.size(); i++) { 14758 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 14759 } 14760 } 14761 ; 14762 if (json.has("outcomeCode")) { 14763 JsonArray array = json.getAsJsonArray("outcomeCode"); 14764 for (int i = 0; i < array.size(); i++) { 14765 res.getOutcomeCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 14766 } 14767 } 14768 ; 14769 if (json.has("outcomeReference")) { 14770 JsonArray array = json.getAsJsonArray("outcomeReference"); 14771 for (int i = 0; i < array.size(); i++) { 14772 res.getOutcomeReference().add(parseReference(array.get(i).getAsJsonObject())); 14773 } 14774 } 14775 ; 14776 } 14777 14778 protected Goal.GoalTargetComponent parseGoalGoalTargetComponent(JsonObject json, Goal owner) 14779 throws IOException, FHIRFormatError { 14780 Goal.GoalTargetComponent res = new Goal.GoalTargetComponent(); 14781 parseGoalGoalTargetComponentProperties(json, owner, res); 14782 return res; 14783 } 14784 14785 protected void parseGoalGoalTargetComponentProperties(JsonObject json, Goal owner, Goal.GoalTargetComponent res) 14786 throws IOException, FHIRFormatError { 14787 parseBackboneElementProperties(json, res); 14788 if (json.has("measure")) 14789 res.setMeasure(parseCodeableConcept(getJObject(json, "measure"))); 14790 Type detail = parseType("detail", json); 14791 if (detail != null) 14792 res.setDetail(detail); 14793 Type due = parseType("due", json); 14794 if (due != null) 14795 res.setDue(due); 14796 } 14797 14798 protected GraphDefinition parseGraphDefinition(JsonObject json) throws IOException, FHIRFormatError { 14799 GraphDefinition res = new GraphDefinition(); 14800 parseGraphDefinitionProperties(json, res); 14801 return res; 14802 } 14803 14804 protected void parseGraphDefinitionProperties(JsonObject json, GraphDefinition res) 14805 throws IOException, FHIRFormatError { 14806 parseDomainResourceProperties(json, res); 14807 if (json.has("url")) 14808 res.setUrlElement(parseUri(json.get("url").getAsString())); 14809 if (json.has("_url")) 14810 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 14811 if (json.has("version")) 14812 res.setVersionElement(parseString(json.get("version").getAsString())); 14813 if (json.has("_version")) 14814 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 14815 if (json.has("name")) 14816 res.setNameElement(parseString(json.get("name").getAsString())); 14817 if (json.has("_name")) 14818 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 14819 if (json.has("status")) 14820 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 14821 new Enumerations.PublicationStatusEnumFactory())); 14822 if (json.has("_status")) 14823 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 14824 if (json.has("experimental")) 14825 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 14826 if (json.has("_experimental")) 14827 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 14828 if (json.has("date")) 14829 res.setDateElement(parseDateTime(json.get("date").getAsString())); 14830 if (json.has("_date")) 14831 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 14832 if (json.has("publisher")) 14833 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 14834 if (json.has("_publisher")) 14835 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 14836 if (json.has("contact")) { 14837 JsonArray array = json.getAsJsonArray("contact"); 14838 for (int i = 0; i < array.size(); i++) { 14839 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 14840 } 14841 } 14842 ; 14843 if (json.has("description")) 14844 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 14845 if (json.has("_description")) 14846 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 14847 if (json.has("useContext")) { 14848 JsonArray array = json.getAsJsonArray("useContext"); 14849 for (int i = 0; i < array.size(); i++) { 14850 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 14851 } 14852 } 14853 ; 14854 if (json.has("jurisdiction")) { 14855 JsonArray array = json.getAsJsonArray("jurisdiction"); 14856 for (int i = 0; i < array.size(); i++) { 14857 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 14858 } 14859 } 14860 ; 14861 if (json.has("purpose")) 14862 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 14863 if (json.has("_purpose")) 14864 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 14865 if (json.has("start")) 14866 res.setStartElement(parseCode(json.get("start").getAsString())); 14867 if (json.has("_start")) 14868 parseElementProperties(getJObject(json, "_start"), res.getStartElement()); 14869 if (json.has("profile")) 14870 res.setProfileElement(parseCanonical(json.get("profile").getAsString())); 14871 if (json.has("_profile")) 14872 parseElementProperties(getJObject(json, "_profile"), res.getProfileElement()); 14873 if (json.has("link")) { 14874 JsonArray array = json.getAsJsonArray("link"); 14875 for (int i = 0; i < array.size(); i++) { 14876 res.getLink().add(parseGraphDefinitionGraphDefinitionLinkComponent(array.get(i).getAsJsonObject(), res)); 14877 } 14878 } 14879 ; 14880 } 14881 14882 protected GraphDefinition.GraphDefinitionLinkComponent parseGraphDefinitionGraphDefinitionLinkComponent( 14883 JsonObject json, GraphDefinition owner) throws IOException, FHIRFormatError { 14884 GraphDefinition.GraphDefinitionLinkComponent res = new GraphDefinition.GraphDefinitionLinkComponent(); 14885 parseGraphDefinitionGraphDefinitionLinkComponentProperties(json, owner, res); 14886 return res; 14887 } 14888 14889 protected void parseGraphDefinitionGraphDefinitionLinkComponentProperties(JsonObject json, GraphDefinition owner, 14890 GraphDefinition.GraphDefinitionLinkComponent res) throws IOException, FHIRFormatError { 14891 parseBackboneElementProperties(json, res); 14892 if (json.has("path")) 14893 res.setPathElement(parseString(json.get("path").getAsString())); 14894 if (json.has("_path")) 14895 parseElementProperties(getJObject(json, "_path"), res.getPathElement()); 14896 if (json.has("sliceName")) 14897 res.setSliceNameElement(parseString(json.get("sliceName").getAsString())); 14898 if (json.has("_sliceName")) 14899 parseElementProperties(getJObject(json, "_sliceName"), res.getSliceNameElement()); 14900 if (json.has("min")) 14901 res.setMinElement(parseInteger(json.get("min").getAsLong())); 14902 if (json.has("_min")) 14903 parseElementProperties(getJObject(json, "_min"), res.getMinElement()); 14904 if (json.has("max")) 14905 res.setMaxElement(parseString(json.get("max").getAsString())); 14906 if (json.has("_max")) 14907 parseElementProperties(getJObject(json, "_max"), res.getMaxElement()); 14908 if (json.has("description")) 14909 res.setDescriptionElement(parseString(json.get("description").getAsString())); 14910 if (json.has("_description")) 14911 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 14912 if (json.has("target")) { 14913 JsonArray array = json.getAsJsonArray("target"); 14914 for (int i = 0; i < array.size(); i++) { 14915 res.getTarget() 14916 .add(parseGraphDefinitionGraphDefinitionLinkTargetComponent(array.get(i).getAsJsonObject(), owner)); 14917 } 14918 } 14919 ; 14920 } 14921 14922 protected GraphDefinition.GraphDefinitionLinkTargetComponent parseGraphDefinitionGraphDefinitionLinkTargetComponent( 14923 JsonObject json, GraphDefinition owner) throws IOException, FHIRFormatError { 14924 GraphDefinition.GraphDefinitionLinkTargetComponent res = new GraphDefinition.GraphDefinitionLinkTargetComponent(); 14925 parseGraphDefinitionGraphDefinitionLinkTargetComponentProperties(json, owner, res); 14926 return res; 14927 } 14928 14929 protected void parseGraphDefinitionGraphDefinitionLinkTargetComponentProperties(JsonObject json, 14930 GraphDefinition owner, GraphDefinition.GraphDefinitionLinkTargetComponent res) 14931 throws IOException, FHIRFormatError { 14932 parseBackboneElementProperties(json, res); 14933 if (json.has("type")) 14934 res.setTypeElement(parseCode(json.get("type").getAsString())); 14935 if (json.has("_type")) 14936 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 14937 if (json.has("params")) 14938 res.setParamsElement(parseString(json.get("params").getAsString())); 14939 if (json.has("_params")) 14940 parseElementProperties(getJObject(json, "_params"), res.getParamsElement()); 14941 if (json.has("profile")) 14942 res.setProfileElement(parseCanonical(json.get("profile").getAsString())); 14943 if (json.has("_profile")) 14944 parseElementProperties(getJObject(json, "_profile"), res.getProfileElement()); 14945 if (json.has("compartment")) { 14946 JsonArray array = json.getAsJsonArray("compartment"); 14947 for (int i = 0; i < array.size(); i++) { 14948 res.getCompartment().add( 14949 parseGraphDefinitionGraphDefinitionLinkTargetCompartmentComponent(array.get(i).getAsJsonObject(), owner)); 14950 } 14951 } 14952 ; 14953 if (json.has("link")) { 14954 JsonArray array = json.getAsJsonArray("link"); 14955 for (int i = 0; i < array.size(); i++) { 14956 res.getLink().add(parseGraphDefinitionGraphDefinitionLinkComponent(array.get(i).getAsJsonObject(), owner)); 14957 } 14958 } 14959 ; 14960 } 14961 14962 protected GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent parseGraphDefinitionGraphDefinitionLinkTargetCompartmentComponent( 14963 JsonObject json, GraphDefinition owner) throws IOException, FHIRFormatError { 14964 GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent res = new GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent(); 14965 parseGraphDefinitionGraphDefinitionLinkTargetCompartmentComponentProperties(json, owner, res); 14966 return res; 14967 } 14968 14969 protected void parseGraphDefinitionGraphDefinitionLinkTargetCompartmentComponentProperties(JsonObject json, 14970 GraphDefinition owner, GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent res) 14971 throws IOException, FHIRFormatError { 14972 parseBackboneElementProperties(json, res); 14973 if (json.has("use")) 14974 res.setUseElement(parseEnumeration(json.get("use").getAsString(), GraphDefinition.GraphCompartmentUse.NULL, 14975 new GraphDefinition.GraphCompartmentUseEnumFactory())); 14976 if (json.has("_use")) 14977 parseElementProperties(getJObject(json, "_use"), res.getUseElement()); 14978 if (json.has("code")) 14979 res.setCodeElement(parseEnumeration(json.get("code").getAsString(), GraphDefinition.CompartmentCode.NULL, 14980 new GraphDefinition.CompartmentCodeEnumFactory())); 14981 if (json.has("_code")) 14982 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 14983 if (json.has("rule")) 14984 res.setRuleElement(parseEnumeration(json.get("rule").getAsString(), GraphDefinition.GraphCompartmentRule.NULL, 14985 new GraphDefinition.GraphCompartmentRuleEnumFactory())); 14986 if (json.has("_rule")) 14987 parseElementProperties(getJObject(json, "_rule"), res.getRuleElement()); 14988 if (json.has("expression")) 14989 res.setExpressionElement(parseString(json.get("expression").getAsString())); 14990 if (json.has("_expression")) 14991 parseElementProperties(getJObject(json, "_expression"), res.getExpressionElement()); 14992 if (json.has("description")) 14993 res.setDescriptionElement(parseString(json.get("description").getAsString())); 14994 if (json.has("_description")) 14995 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 14996 } 14997 14998 protected Group parseGroup(JsonObject json) throws IOException, FHIRFormatError { 14999 Group res = new Group(); 15000 parseGroupProperties(json, res); 15001 return res; 15002 } 15003 15004 protected void parseGroupProperties(JsonObject json, Group res) throws IOException, FHIRFormatError { 15005 parseDomainResourceProperties(json, res); 15006 if (json.has("identifier")) { 15007 JsonArray array = json.getAsJsonArray("identifier"); 15008 for (int i = 0; i < array.size(); i++) { 15009 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 15010 } 15011 } 15012 ; 15013 if (json.has("active")) 15014 res.setActiveElement(parseBoolean(json.get("active").getAsBoolean())); 15015 if (json.has("_active")) 15016 parseElementProperties(getJObject(json, "_active"), res.getActiveElement()); 15017 if (json.has("type")) 15018 res.setTypeElement( 15019 parseEnumeration(json.get("type").getAsString(), Group.GroupType.NULL, new Group.GroupTypeEnumFactory())); 15020 if (json.has("_type")) 15021 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 15022 if (json.has("actual")) 15023 res.setActualElement(parseBoolean(json.get("actual").getAsBoolean())); 15024 if (json.has("_actual")) 15025 parseElementProperties(getJObject(json, "_actual"), res.getActualElement()); 15026 if (json.has("code")) 15027 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 15028 if (json.has("name")) 15029 res.setNameElement(parseString(json.get("name").getAsString())); 15030 if (json.has("_name")) 15031 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 15032 if (json.has("quantity")) 15033 res.setQuantityElement(parseUnsignedInt(json.get("quantity").getAsString())); 15034 if (json.has("_quantity")) 15035 parseElementProperties(getJObject(json, "_quantity"), res.getQuantityElement()); 15036 if (json.has("managingEntity")) 15037 res.setManagingEntity(parseReference(getJObject(json, "managingEntity"))); 15038 if (json.has("characteristic")) { 15039 JsonArray array = json.getAsJsonArray("characteristic"); 15040 for (int i = 0; i < array.size(); i++) { 15041 res.getCharacteristic().add(parseGroupGroupCharacteristicComponent(array.get(i).getAsJsonObject(), res)); 15042 } 15043 } 15044 ; 15045 if (json.has("member")) { 15046 JsonArray array = json.getAsJsonArray("member"); 15047 for (int i = 0; i < array.size(); i++) { 15048 res.getMember().add(parseGroupGroupMemberComponent(array.get(i).getAsJsonObject(), res)); 15049 } 15050 } 15051 ; 15052 } 15053 15054 protected Group.GroupCharacteristicComponent parseGroupGroupCharacteristicComponent(JsonObject json, Group owner) 15055 throws IOException, FHIRFormatError { 15056 Group.GroupCharacteristicComponent res = new Group.GroupCharacteristicComponent(); 15057 parseGroupGroupCharacteristicComponentProperties(json, owner, res); 15058 return res; 15059 } 15060 15061 protected void parseGroupGroupCharacteristicComponentProperties(JsonObject json, Group owner, 15062 Group.GroupCharacteristicComponent res) throws IOException, FHIRFormatError { 15063 parseBackboneElementProperties(json, res); 15064 if (json.has("code")) 15065 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 15066 Type value = parseType("value", json); 15067 if (value != null) 15068 res.setValue(value); 15069 if (json.has("exclude")) 15070 res.setExcludeElement(parseBoolean(json.get("exclude").getAsBoolean())); 15071 if (json.has("_exclude")) 15072 parseElementProperties(getJObject(json, "_exclude"), res.getExcludeElement()); 15073 if (json.has("period")) 15074 res.setPeriod(parsePeriod(getJObject(json, "period"))); 15075 } 15076 15077 protected Group.GroupMemberComponent parseGroupGroupMemberComponent(JsonObject json, Group owner) 15078 throws IOException, FHIRFormatError { 15079 Group.GroupMemberComponent res = new Group.GroupMemberComponent(); 15080 parseGroupGroupMemberComponentProperties(json, owner, res); 15081 return res; 15082 } 15083 15084 protected void parseGroupGroupMemberComponentProperties(JsonObject json, Group owner, Group.GroupMemberComponent res) 15085 throws IOException, FHIRFormatError { 15086 parseBackboneElementProperties(json, res); 15087 if (json.has("entity")) 15088 res.setEntity(parseReference(getJObject(json, "entity"))); 15089 if (json.has("period")) 15090 res.setPeriod(parsePeriod(getJObject(json, "period"))); 15091 if (json.has("inactive")) 15092 res.setInactiveElement(parseBoolean(json.get("inactive").getAsBoolean())); 15093 if (json.has("_inactive")) 15094 parseElementProperties(getJObject(json, "_inactive"), res.getInactiveElement()); 15095 } 15096 15097 protected GuidanceResponse parseGuidanceResponse(JsonObject json) throws IOException, FHIRFormatError { 15098 GuidanceResponse res = new GuidanceResponse(); 15099 parseGuidanceResponseProperties(json, res); 15100 return res; 15101 } 15102 15103 protected void parseGuidanceResponseProperties(JsonObject json, GuidanceResponse res) 15104 throws IOException, FHIRFormatError { 15105 parseDomainResourceProperties(json, res); 15106 if (json.has("requestIdentifier")) 15107 res.setRequestIdentifier(parseIdentifier(getJObject(json, "requestIdentifier"))); 15108 if (json.has("identifier")) { 15109 JsonArray array = json.getAsJsonArray("identifier"); 15110 for (int i = 0; i < array.size(); i++) { 15111 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 15112 } 15113 } 15114 ; 15115 Type module = parseType("module", json); 15116 if (module != null) 15117 res.setModule(module); 15118 if (json.has("status")) 15119 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), 15120 GuidanceResponse.GuidanceResponseStatus.NULL, new GuidanceResponse.GuidanceResponseStatusEnumFactory())); 15121 if (json.has("_status")) 15122 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 15123 if (json.has("subject")) 15124 res.setSubject(parseReference(getJObject(json, "subject"))); 15125 if (json.has("encounter")) 15126 res.setEncounter(parseReference(getJObject(json, "encounter"))); 15127 if (json.has("occurrenceDateTime")) 15128 res.setOccurrenceDateTimeElement(parseDateTime(json.get("occurrenceDateTime").getAsString())); 15129 if (json.has("_occurrenceDateTime")) 15130 parseElementProperties(getJObject(json, "_occurrenceDateTime"), res.getOccurrenceDateTimeElement()); 15131 if (json.has("performer")) 15132 res.setPerformer(parseReference(getJObject(json, "performer"))); 15133 if (json.has("reasonCode")) { 15134 JsonArray array = json.getAsJsonArray("reasonCode"); 15135 for (int i = 0; i < array.size(); i++) { 15136 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15137 } 15138 } 15139 ; 15140 if (json.has("reasonReference")) { 15141 JsonArray array = json.getAsJsonArray("reasonReference"); 15142 for (int i = 0; i < array.size(); i++) { 15143 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 15144 } 15145 } 15146 ; 15147 if (json.has("note")) { 15148 JsonArray array = json.getAsJsonArray("note"); 15149 for (int i = 0; i < array.size(); i++) { 15150 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 15151 } 15152 } 15153 ; 15154 if (json.has("evaluationMessage")) { 15155 JsonArray array = json.getAsJsonArray("evaluationMessage"); 15156 for (int i = 0; i < array.size(); i++) { 15157 res.getEvaluationMessage().add(parseReference(array.get(i).getAsJsonObject())); 15158 } 15159 } 15160 ; 15161 if (json.has("outputParameters")) 15162 res.setOutputParameters(parseReference(getJObject(json, "outputParameters"))); 15163 if (json.has("result")) 15164 res.setResult(parseReference(getJObject(json, "result"))); 15165 if (json.has("dataRequirement")) { 15166 JsonArray array = json.getAsJsonArray("dataRequirement"); 15167 for (int i = 0; i < array.size(); i++) { 15168 res.getDataRequirement().add(parseDataRequirement(array.get(i).getAsJsonObject())); 15169 } 15170 } 15171 ; 15172 } 15173 15174 protected HealthcareService parseHealthcareService(JsonObject json) throws IOException, FHIRFormatError { 15175 HealthcareService res = new HealthcareService(); 15176 parseHealthcareServiceProperties(json, res); 15177 return res; 15178 } 15179 15180 protected void parseHealthcareServiceProperties(JsonObject json, HealthcareService res) 15181 throws IOException, FHIRFormatError { 15182 parseDomainResourceProperties(json, res); 15183 if (json.has("identifier")) { 15184 JsonArray array = json.getAsJsonArray("identifier"); 15185 for (int i = 0; i < array.size(); i++) { 15186 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 15187 } 15188 } 15189 ; 15190 if (json.has("active")) 15191 res.setActiveElement(parseBoolean(json.get("active").getAsBoolean())); 15192 if (json.has("_active")) 15193 parseElementProperties(getJObject(json, "_active"), res.getActiveElement()); 15194 if (json.has("providedBy")) 15195 res.setProvidedBy(parseReference(getJObject(json, "providedBy"))); 15196 if (json.has("category")) { 15197 JsonArray array = json.getAsJsonArray("category"); 15198 for (int i = 0; i < array.size(); i++) { 15199 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15200 } 15201 } 15202 ; 15203 if (json.has("type")) { 15204 JsonArray array = json.getAsJsonArray("type"); 15205 for (int i = 0; i < array.size(); i++) { 15206 res.getType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15207 } 15208 } 15209 ; 15210 if (json.has("specialty")) { 15211 JsonArray array = json.getAsJsonArray("specialty"); 15212 for (int i = 0; i < array.size(); i++) { 15213 res.getSpecialty().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15214 } 15215 } 15216 ; 15217 if (json.has("location")) { 15218 JsonArray array = json.getAsJsonArray("location"); 15219 for (int i = 0; i < array.size(); i++) { 15220 res.getLocation().add(parseReference(array.get(i).getAsJsonObject())); 15221 } 15222 } 15223 ; 15224 if (json.has("name")) 15225 res.setNameElement(parseString(json.get("name").getAsString())); 15226 if (json.has("_name")) 15227 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 15228 if (json.has("comment")) 15229 res.setCommentElement(parseString(json.get("comment").getAsString())); 15230 if (json.has("_comment")) 15231 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 15232 if (json.has("extraDetails")) 15233 res.setExtraDetailsElement(parseMarkdown(json.get("extraDetails").getAsString())); 15234 if (json.has("_extraDetails")) 15235 parseElementProperties(getJObject(json, "_extraDetails"), res.getExtraDetailsElement()); 15236 if (json.has("photo")) 15237 res.setPhoto(parseAttachment(getJObject(json, "photo"))); 15238 if (json.has("telecom")) { 15239 JsonArray array = json.getAsJsonArray("telecom"); 15240 for (int i = 0; i < array.size(); i++) { 15241 res.getTelecom().add(parseContactPoint(array.get(i).getAsJsonObject())); 15242 } 15243 } 15244 ; 15245 if (json.has("coverageArea")) { 15246 JsonArray array = json.getAsJsonArray("coverageArea"); 15247 for (int i = 0; i < array.size(); i++) { 15248 res.getCoverageArea().add(parseReference(array.get(i).getAsJsonObject())); 15249 } 15250 } 15251 ; 15252 if (json.has("serviceProvisionCode")) { 15253 JsonArray array = json.getAsJsonArray("serviceProvisionCode"); 15254 for (int i = 0; i < array.size(); i++) { 15255 res.getServiceProvisionCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15256 } 15257 } 15258 ; 15259 if (json.has("eligibility")) { 15260 JsonArray array = json.getAsJsonArray("eligibility"); 15261 for (int i = 0; i < array.size(); i++) { 15262 res.getEligibility() 15263 .add(parseHealthcareServiceHealthcareServiceEligibilityComponent(array.get(i).getAsJsonObject(), res)); 15264 } 15265 } 15266 ; 15267 if (json.has("program")) { 15268 JsonArray array = json.getAsJsonArray("program"); 15269 for (int i = 0; i < array.size(); i++) { 15270 res.getProgram().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15271 } 15272 } 15273 ; 15274 if (json.has("characteristic")) { 15275 JsonArray array = json.getAsJsonArray("characteristic"); 15276 for (int i = 0; i < array.size(); i++) { 15277 res.getCharacteristic().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15278 } 15279 } 15280 ; 15281 if (json.has("communication")) { 15282 JsonArray array = json.getAsJsonArray("communication"); 15283 for (int i = 0; i < array.size(); i++) { 15284 res.getCommunication().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15285 } 15286 } 15287 ; 15288 if (json.has("referralMethod")) { 15289 JsonArray array = json.getAsJsonArray("referralMethod"); 15290 for (int i = 0; i < array.size(); i++) { 15291 res.getReferralMethod().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15292 } 15293 } 15294 ; 15295 if (json.has("appointmentRequired")) 15296 res.setAppointmentRequiredElement(parseBoolean(json.get("appointmentRequired").getAsBoolean())); 15297 if (json.has("_appointmentRequired")) 15298 parseElementProperties(getJObject(json, "_appointmentRequired"), res.getAppointmentRequiredElement()); 15299 if (json.has("availableTime")) { 15300 JsonArray array = json.getAsJsonArray("availableTime"); 15301 for (int i = 0; i < array.size(); i++) { 15302 res.getAvailableTime() 15303 .add(parseHealthcareServiceHealthcareServiceAvailableTimeComponent(array.get(i).getAsJsonObject(), res)); 15304 } 15305 } 15306 ; 15307 if (json.has("notAvailable")) { 15308 JsonArray array = json.getAsJsonArray("notAvailable"); 15309 for (int i = 0; i < array.size(); i++) { 15310 res.getNotAvailable() 15311 .add(parseHealthcareServiceHealthcareServiceNotAvailableComponent(array.get(i).getAsJsonObject(), res)); 15312 } 15313 } 15314 ; 15315 if (json.has("availabilityExceptions")) 15316 res.setAvailabilityExceptionsElement(parseString(json.get("availabilityExceptions").getAsString())); 15317 if (json.has("_availabilityExceptions")) 15318 parseElementProperties(getJObject(json, "_availabilityExceptions"), res.getAvailabilityExceptionsElement()); 15319 if (json.has("endpoint")) { 15320 JsonArray array = json.getAsJsonArray("endpoint"); 15321 for (int i = 0; i < array.size(); i++) { 15322 res.getEndpoint().add(parseReference(array.get(i).getAsJsonObject())); 15323 } 15324 } 15325 ; 15326 } 15327 15328 protected HealthcareService.HealthcareServiceEligibilityComponent parseHealthcareServiceHealthcareServiceEligibilityComponent( 15329 JsonObject json, HealthcareService owner) throws IOException, FHIRFormatError { 15330 HealthcareService.HealthcareServiceEligibilityComponent res = new HealthcareService.HealthcareServiceEligibilityComponent(); 15331 parseHealthcareServiceHealthcareServiceEligibilityComponentProperties(json, owner, res); 15332 return res; 15333 } 15334 15335 protected void parseHealthcareServiceHealthcareServiceEligibilityComponentProperties(JsonObject json, 15336 HealthcareService owner, HealthcareService.HealthcareServiceEligibilityComponent res) 15337 throws IOException, FHIRFormatError { 15338 parseBackboneElementProperties(json, res); 15339 if (json.has("code")) 15340 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 15341 if (json.has("comment")) 15342 res.setCommentElement(parseMarkdown(json.get("comment").getAsString())); 15343 if (json.has("_comment")) 15344 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 15345 } 15346 15347 protected HealthcareService.HealthcareServiceAvailableTimeComponent parseHealthcareServiceHealthcareServiceAvailableTimeComponent( 15348 JsonObject json, HealthcareService owner) throws IOException, FHIRFormatError { 15349 HealthcareService.HealthcareServiceAvailableTimeComponent res = new HealthcareService.HealthcareServiceAvailableTimeComponent(); 15350 parseHealthcareServiceHealthcareServiceAvailableTimeComponentProperties(json, owner, res); 15351 return res; 15352 } 15353 15354 protected void parseHealthcareServiceHealthcareServiceAvailableTimeComponentProperties(JsonObject json, 15355 HealthcareService owner, HealthcareService.HealthcareServiceAvailableTimeComponent res) 15356 throws IOException, FHIRFormatError { 15357 parseBackboneElementProperties(json, res); 15358 if (json.has("daysOfWeek")) { 15359 JsonArray array = json.getAsJsonArray("daysOfWeek"); 15360 for (int i = 0; i < array.size(); i++) { 15361 if (array.get(i).isJsonNull()) { 15362 res.getDaysOfWeek().add(new Enumeration<HealthcareService.DaysOfWeek>()); 15363 } else { 15364 res.getDaysOfWeek().add(parseEnumeration(array.get(i).getAsString(), HealthcareService.DaysOfWeek.NULL, 15365 new HealthcareService.DaysOfWeekEnumFactory())); 15366 } 15367 } 15368 } 15369 ; 15370 if (json.has("_daysOfWeek")) { 15371 JsonArray array = json.getAsJsonArray("_daysOfWeek"); 15372 for (int i = 0; i < array.size(); i++) { 15373 if (i == res.getDaysOfWeek().size()) 15374 res.getDaysOfWeek().add( 15375 parseEnumeration(null, HealthcareService.DaysOfWeek.NULL, new HealthcareService.DaysOfWeekEnumFactory())); 15376 if (array.get(i) instanceof JsonObject) 15377 parseElementProperties(array.get(i).getAsJsonObject(), res.getDaysOfWeek().get(i)); 15378 } 15379 } 15380 ; 15381 if (json.has("allDay")) 15382 res.setAllDayElement(parseBoolean(json.get("allDay").getAsBoolean())); 15383 if (json.has("_allDay")) 15384 parseElementProperties(getJObject(json, "_allDay"), res.getAllDayElement()); 15385 if (json.has("availableStartTime")) 15386 res.setAvailableStartTimeElement(parseTime(json.get("availableStartTime").getAsString())); 15387 if (json.has("_availableStartTime")) 15388 parseElementProperties(getJObject(json, "_availableStartTime"), res.getAvailableStartTimeElement()); 15389 if (json.has("availableEndTime")) 15390 res.setAvailableEndTimeElement(parseTime(json.get("availableEndTime").getAsString())); 15391 if (json.has("_availableEndTime")) 15392 parseElementProperties(getJObject(json, "_availableEndTime"), res.getAvailableEndTimeElement()); 15393 } 15394 15395 protected HealthcareService.HealthcareServiceNotAvailableComponent parseHealthcareServiceHealthcareServiceNotAvailableComponent( 15396 JsonObject json, HealthcareService owner) throws IOException, FHIRFormatError { 15397 HealthcareService.HealthcareServiceNotAvailableComponent res = new HealthcareService.HealthcareServiceNotAvailableComponent(); 15398 parseHealthcareServiceHealthcareServiceNotAvailableComponentProperties(json, owner, res); 15399 return res; 15400 } 15401 15402 protected void parseHealthcareServiceHealthcareServiceNotAvailableComponentProperties(JsonObject json, 15403 HealthcareService owner, HealthcareService.HealthcareServiceNotAvailableComponent res) 15404 throws IOException, FHIRFormatError { 15405 parseBackboneElementProperties(json, res); 15406 if (json.has("description")) 15407 res.setDescriptionElement(parseString(json.get("description").getAsString())); 15408 if (json.has("_description")) 15409 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 15410 if (json.has("during")) 15411 res.setDuring(parsePeriod(getJObject(json, "during"))); 15412 } 15413 15414 protected ImagingStudy parseImagingStudy(JsonObject json) throws IOException, FHIRFormatError { 15415 ImagingStudy res = new ImagingStudy(); 15416 parseImagingStudyProperties(json, res); 15417 return res; 15418 } 15419 15420 protected void parseImagingStudyProperties(JsonObject json, ImagingStudy res) throws IOException, FHIRFormatError { 15421 parseDomainResourceProperties(json, res); 15422 if (json.has("identifier")) { 15423 JsonArray array = json.getAsJsonArray("identifier"); 15424 for (int i = 0; i < array.size(); i++) { 15425 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 15426 } 15427 } 15428 ; 15429 if (json.has("status")) 15430 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), ImagingStudy.ImagingStudyStatus.NULL, 15431 new ImagingStudy.ImagingStudyStatusEnumFactory())); 15432 if (json.has("_status")) 15433 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 15434 if (json.has("modality")) { 15435 JsonArray array = json.getAsJsonArray("modality"); 15436 for (int i = 0; i < array.size(); i++) { 15437 res.getModality().add(parseCoding(array.get(i).getAsJsonObject())); 15438 } 15439 } 15440 ; 15441 if (json.has("subject")) 15442 res.setSubject(parseReference(getJObject(json, "subject"))); 15443 if (json.has("encounter")) 15444 res.setEncounter(parseReference(getJObject(json, "encounter"))); 15445 if (json.has("started")) 15446 res.setStartedElement(parseDateTime(json.get("started").getAsString())); 15447 if (json.has("_started")) 15448 parseElementProperties(getJObject(json, "_started"), res.getStartedElement()); 15449 if (json.has("basedOn")) { 15450 JsonArray array = json.getAsJsonArray("basedOn"); 15451 for (int i = 0; i < array.size(); i++) { 15452 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 15453 } 15454 } 15455 ; 15456 if (json.has("referrer")) 15457 res.setReferrer(parseReference(getJObject(json, "referrer"))); 15458 if (json.has("interpreter")) { 15459 JsonArray array = json.getAsJsonArray("interpreter"); 15460 for (int i = 0; i < array.size(); i++) { 15461 res.getInterpreter().add(parseReference(array.get(i).getAsJsonObject())); 15462 } 15463 } 15464 ; 15465 if (json.has("endpoint")) { 15466 JsonArray array = json.getAsJsonArray("endpoint"); 15467 for (int i = 0; i < array.size(); i++) { 15468 res.getEndpoint().add(parseReference(array.get(i).getAsJsonObject())); 15469 } 15470 } 15471 ; 15472 if (json.has("numberOfSeries")) 15473 res.setNumberOfSeriesElement(parseUnsignedInt(json.get("numberOfSeries").getAsString())); 15474 if (json.has("_numberOfSeries")) 15475 parseElementProperties(getJObject(json, "_numberOfSeries"), res.getNumberOfSeriesElement()); 15476 if (json.has("numberOfInstances")) 15477 res.setNumberOfInstancesElement(parseUnsignedInt(json.get("numberOfInstances").getAsString())); 15478 if (json.has("_numberOfInstances")) 15479 parseElementProperties(getJObject(json, "_numberOfInstances"), res.getNumberOfInstancesElement()); 15480 if (json.has("procedureReference")) 15481 res.setProcedureReference(parseReference(getJObject(json, "procedureReference"))); 15482 if (json.has("procedureCode")) { 15483 JsonArray array = json.getAsJsonArray("procedureCode"); 15484 for (int i = 0; i < array.size(); i++) { 15485 res.getProcedureCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15486 } 15487 } 15488 ; 15489 if (json.has("location")) 15490 res.setLocation(parseReference(getJObject(json, "location"))); 15491 if (json.has("reasonCode")) { 15492 JsonArray array = json.getAsJsonArray("reasonCode"); 15493 for (int i = 0; i < array.size(); i++) { 15494 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15495 } 15496 } 15497 ; 15498 if (json.has("reasonReference")) { 15499 JsonArray array = json.getAsJsonArray("reasonReference"); 15500 for (int i = 0; i < array.size(); i++) { 15501 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 15502 } 15503 } 15504 ; 15505 if (json.has("note")) { 15506 JsonArray array = json.getAsJsonArray("note"); 15507 for (int i = 0; i < array.size(); i++) { 15508 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 15509 } 15510 } 15511 ; 15512 if (json.has("description")) 15513 res.setDescriptionElement(parseString(json.get("description").getAsString())); 15514 if (json.has("_description")) 15515 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 15516 if (json.has("series")) { 15517 JsonArray array = json.getAsJsonArray("series"); 15518 for (int i = 0; i < array.size(); i++) { 15519 res.getSeries().add(parseImagingStudyImagingStudySeriesComponent(array.get(i).getAsJsonObject(), res)); 15520 } 15521 } 15522 ; 15523 } 15524 15525 protected ImagingStudy.ImagingStudySeriesComponent parseImagingStudyImagingStudySeriesComponent(JsonObject json, 15526 ImagingStudy owner) throws IOException, FHIRFormatError { 15527 ImagingStudy.ImagingStudySeriesComponent res = new ImagingStudy.ImagingStudySeriesComponent(); 15528 parseImagingStudyImagingStudySeriesComponentProperties(json, owner, res); 15529 return res; 15530 } 15531 15532 protected void parseImagingStudyImagingStudySeriesComponentProperties(JsonObject json, ImagingStudy owner, 15533 ImagingStudy.ImagingStudySeriesComponent res) throws IOException, FHIRFormatError { 15534 parseBackboneElementProperties(json, res); 15535 if (json.has("uid")) 15536 res.setUidElement(parseId(json.get("uid").getAsString())); 15537 if (json.has("_uid")) 15538 parseElementProperties(getJObject(json, "_uid"), res.getUidElement()); 15539 if (json.has("number")) 15540 res.setNumberElement(parseUnsignedInt(json.get("number").getAsString())); 15541 if (json.has("_number")) 15542 parseElementProperties(getJObject(json, "_number"), res.getNumberElement()); 15543 if (json.has("modality")) 15544 res.setModality(parseCoding(getJObject(json, "modality"))); 15545 if (json.has("description")) 15546 res.setDescriptionElement(parseString(json.get("description").getAsString())); 15547 if (json.has("_description")) 15548 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 15549 if (json.has("numberOfInstances")) 15550 res.setNumberOfInstancesElement(parseUnsignedInt(json.get("numberOfInstances").getAsString())); 15551 if (json.has("_numberOfInstances")) 15552 parseElementProperties(getJObject(json, "_numberOfInstances"), res.getNumberOfInstancesElement()); 15553 if (json.has("endpoint")) { 15554 JsonArray array = json.getAsJsonArray("endpoint"); 15555 for (int i = 0; i < array.size(); i++) { 15556 res.getEndpoint().add(parseReference(array.get(i).getAsJsonObject())); 15557 } 15558 } 15559 ; 15560 if (json.has("bodySite")) 15561 res.setBodySite(parseCoding(getJObject(json, "bodySite"))); 15562 if (json.has("laterality")) 15563 res.setLaterality(parseCoding(getJObject(json, "laterality"))); 15564 if (json.has("specimen")) { 15565 JsonArray array = json.getAsJsonArray("specimen"); 15566 for (int i = 0; i < array.size(); i++) { 15567 res.getSpecimen().add(parseReference(array.get(i).getAsJsonObject())); 15568 } 15569 } 15570 ; 15571 if (json.has("started")) 15572 res.setStartedElement(parseDateTime(json.get("started").getAsString())); 15573 if (json.has("_started")) 15574 parseElementProperties(getJObject(json, "_started"), res.getStartedElement()); 15575 if (json.has("performer")) { 15576 JsonArray array = json.getAsJsonArray("performer"); 15577 for (int i = 0; i < array.size(); i++) { 15578 res.getPerformer() 15579 .add(parseImagingStudyImagingStudySeriesPerformerComponent(array.get(i).getAsJsonObject(), owner)); 15580 } 15581 } 15582 ; 15583 if (json.has("instance")) { 15584 JsonArray array = json.getAsJsonArray("instance"); 15585 for (int i = 0; i < array.size(); i++) { 15586 res.getInstance() 15587 .add(parseImagingStudyImagingStudySeriesInstanceComponent(array.get(i).getAsJsonObject(), owner)); 15588 } 15589 } 15590 ; 15591 } 15592 15593 protected ImagingStudy.ImagingStudySeriesPerformerComponent parseImagingStudyImagingStudySeriesPerformerComponent( 15594 JsonObject json, ImagingStudy owner) throws IOException, FHIRFormatError { 15595 ImagingStudy.ImagingStudySeriesPerformerComponent res = new ImagingStudy.ImagingStudySeriesPerformerComponent(); 15596 parseImagingStudyImagingStudySeriesPerformerComponentProperties(json, owner, res); 15597 return res; 15598 } 15599 15600 protected void parseImagingStudyImagingStudySeriesPerformerComponentProperties(JsonObject json, ImagingStudy owner, 15601 ImagingStudy.ImagingStudySeriesPerformerComponent res) throws IOException, FHIRFormatError { 15602 parseBackboneElementProperties(json, res); 15603 if (json.has("function")) 15604 res.setFunction(parseCodeableConcept(getJObject(json, "function"))); 15605 if (json.has("actor")) 15606 res.setActor(parseReference(getJObject(json, "actor"))); 15607 } 15608 15609 protected ImagingStudy.ImagingStudySeriesInstanceComponent parseImagingStudyImagingStudySeriesInstanceComponent( 15610 JsonObject json, ImagingStudy owner) throws IOException, FHIRFormatError { 15611 ImagingStudy.ImagingStudySeriesInstanceComponent res = new ImagingStudy.ImagingStudySeriesInstanceComponent(); 15612 parseImagingStudyImagingStudySeriesInstanceComponentProperties(json, owner, res); 15613 return res; 15614 } 15615 15616 protected void parseImagingStudyImagingStudySeriesInstanceComponentProperties(JsonObject json, ImagingStudy owner, 15617 ImagingStudy.ImagingStudySeriesInstanceComponent res) throws IOException, FHIRFormatError { 15618 parseBackboneElementProperties(json, res); 15619 if (json.has("uid")) 15620 res.setUidElement(parseId(json.get("uid").getAsString())); 15621 if (json.has("_uid")) 15622 parseElementProperties(getJObject(json, "_uid"), res.getUidElement()); 15623 if (json.has("sopClass")) 15624 res.setSopClass(parseCoding(getJObject(json, "sopClass"))); 15625 if (json.has("number")) 15626 res.setNumberElement(parseUnsignedInt(json.get("number").getAsString())); 15627 if (json.has("_number")) 15628 parseElementProperties(getJObject(json, "_number"), res.getNumberElement()); 15629 if (json.has("title")) 15630 res.setTitleElement(parseString(json.get("title").getAsString())); 15631 if (json.has("_title")) 15632 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 15633 } 15634 15635 protected Immunization parseImmunization(JsonObject json) throws IOException, FHIRFormatError { 15636 Immunization res = new Immunization(); 15637 parseImmunizationProperties(json, res); 15638 return res; 15639 } 15640 15641 protected void parseImmunizationProperties(JsonObject json, Immunization res) throws IOException, FHIRFormatError { 15642 parseDomainResourceProperties(json, res); 15643 if (json.has("identifier")) { 15644 JsonArray array = json.getAsJsonArray("identifier"); 15645 for (int i = 0; i < array.size(); i++) { 15646 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 15647 } 15648 } 15649 ; 15650 if (json.has("status")) 15651 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Immunization.ImmunizationStatus.NULL, 15652 new Immunization.ImmunizationStatusEnumFactory())); 15653 if (json.has("_status")) 15654 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 15655 if (json.has("statusReason")) 15656 res.setStatusReason(parseCodeableConcept(getJObject(json, "statusReason"))); 15657 if (json.has("vaccineCode")) 15658 res.setVaccineCode(parseCodeableConcept(getJObject(json, "vaccineCode"))); 15659 if (json.has("patient")) 15660 res.setPatient(parseReference(getJObject(json, "patient"))); 15661 if (json.has("encounter")) 15662 res.setEncounter(parseReference(getJObject(json, "encounter"))); 15663 Type occurrence = parseType("occurrence", json); 15664 if (occurrence != null) 15665 res.setOccurrence(occurrence); 15666 if (json.has("recorded")) 15667 res.setRecordedElement(parseDateTime(json.get("recorded").getAsString())); 15668 if (json.has("_recorded")) 15669 parseElementProperties(getJObject(json, "_recorded"), res.getRecordedElement()); 15670 if (json.has("primarySource")) 15671 res.setPrimarySourceElement(parseBoolean(json.get("primarySource").getAsBoolean())); 15672 if (json.has("_primarySource")) 15673 parseElementProperties(getJObject(json, "_primarySource"), res.getPrimarySourceElement()); 15674 if (json.has("reportOrigin")) 15675 res.setReportOrigin(parseCodeableConcept(getJObject(json, "reportOrigin"))); 15676 if (json.has("location")) 15677 res.setLocation(parseReference(getJObject(json, "location"))); 15678 if (json.has("manufacturer")) 15679 res.setManufacturer(parseReference(getJObject(json, "manufacturer"))); 15680 if (json.has("lotNumber")) 15681 res.setLotNumberElement(parseString(json.get("lotNumber").getAsString())); 15682 if (json.has("_lotNumber")) 15683 parseElementProperties(getJObject(json, "_lotNumber"), res.getLotNumberElement()); 15684 if (json.has("expirationDate")) 15685 res.setExpirationDateElement(parseDate(json.get("expirationDate").getAsString())); 15686 if (json.has("_expirationDate")) 15687 parseElementProperties(getJObject(json, "_expirationDate"), res.getExpirationDateElement()); 15688 if (json.has("site")) 15689 res.setSite(parseCodeableConcept(getJObject(json, "site"))); 15690 if (json.has("route")) 15691 res.setRoute(parseCodeableConcept(getJObject(json, "route"))); 15692 if (json.has("doseQuantity")) 15693 res.setDoseQuantity(parseQuantity(getJObject(json, "doseQuantity"))); 15694 if (json.has("performer")) { 15695 JsonArray array = json.getAsJsonArray("performer"); 15696 for (int i = 0; i < array.size(); i++) { 15697 res.getPerformer().add(parseImmunizationImmunizationPerformerComponent(array.get(i).getAsJsonObject(), res)); 15698 } 15699 } 15700 ; 15701 if (json.has("note")) { 15702 JsonArray array = json.getAsJsonArray("note"); 15703 for (int i = 0; i < array.size(); i++) { 15704 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 15705 } 15706 } 15707 ; 15708 if (json.has("reasonCode")) { 15709 JsonArray array = json.getAsJsonArray("reasonCode"); 15710 for (int i = 0; i < array.size(); i++) { 15711 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15712 } 15713 } 15714 ; 15715 if (json.has("reasonReference")) { 15716 JsonArray array = json.getAsJsonArray("reasonReference"); 15717 for (int i = 0; i < array.size(); i++) { 15718 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 15719 } 15720 } 15721 ; 15722 if (json.has("isSubpotent")) 15723 res.setIsSubpotentElement(parseBoolean(json.get("isSubpotent").getAsBoolean())); 15724 if (json.has("_isSubpotent")) 15725 parseElementProperties(getJObject(json, "_isSubpotent"), res.getIsSubpotentElement()); 15726 if (json.has("subpotentReason")) { 15727 JsonArray array = json.getAsJsonArray("subpotentReason"); 15728 for (int i = 0; i < array.size(); i++) { 15729 res.getSubpotentReason().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15730 } 15731 } 15732 ; 15733 if (json.has("education")) { 15734 JsonArray array = json.getAsJsonArray("education"); 15735 for (int i = 0; i < array.size(); i++) { 15736 res.getEducation().add(parseImmunizationImmunizationEducationComponent(array.get(i).getAsJsonObject(), res)); 15737 } 15738 } 15739 ; 15740 if (json.has("programEligibility")) { 15741 JsonArray array = json.getAsJsonArray("programEligibility"); 15742 for (int i = 0; i < array.size(); i++) { 15743 res.getProgramEligibility().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15744 } 15745 } 15746 ; 15747 if (json.has("fundingSource")) 15748 res.setFundingSource(parseCodeableConcept(getJObject(json, "fundingSource"))); 15749 if (json.has("reaction")) { 15750 JsonArray array = json.getAsJsonArray("reaction"); 15751 for (int i = 0; i < array.size(); i++) { 15752 res.getReaction().add(parseImmunizationImmunizationReactionComponent(array.get(i).getAsJsonObject(), res)); 15753 } 15754 } 15755 ; 15756 if (json.has("protocolApplied")) { 15757 JsonArray array = json.getAsJsonArray("protocolApplied"); 15758 for (int i = 0; i < array.size(); i++) { 15759 res.getProtocolApplied() 15760 .add(parseImmunizationImmunizationProtocolAppliedComponent(array.get(i).getAsJsonObject(), res)); 15761 } 15762 } 15763 ; 15764 } 15765 15766 protected Immunization.ImmunizationPerformerComponent parseImmunizationImmunizationPerformerComponent(JsonObject json, 15767 Immunization owner) throws IOException, FHIRFormatError { 15768 Immunization.ImmunizationPerformerComponent res = new Immunization.ImmunizationPerformerComponent(); 15769 parseImmunizationImmunizationPerformerComponentProperties(json, owner, res); 15770 return res; 15771 } 15772 15773 protected void parseImmunizationImmunizationPerformerComponentProperties(JsonObject json, Immunization owner, 15774 Immunization.ImmunizationPerformerComponent res) throws IOException, FHIRFormatError { 15775 parseBackboneElementProperties(json, res); 15776 if (json.has("function")) 15777 res.setFunction(parseCodeableConcept(getJObject(json, "function"))); 15778 if (json.has("actor")) 15779 res.setActor(parseReference(getJObject(json, "actor"))); 15780 } 15781 15782 protected Immunization.ImmunizationEducationComponent parseImmunizationImmunizationEducationComponent(JsonObject json, 15783 Immunization owner) throws IOException, FHIRFormatError { 15784 Immunization.ImmunizationEducationComponent res = new Immunization.ImmunizationEducationComponent(); 15785 parseImmunizationImmunizationEducationComponentProperties(json, owner, res); 15786 return res; 15787 } 15788 15789 protected void parseImmunizationImmunizationEducationComponentProperties(JsonObject json, Immunization owner, 15790 Immunization.ImmunizationEducationComponent res) throws IOException, FHIRFormatError { 15791 parseBackboneElementProperties(json, res); 15792 if (json.has("documentType")) 15793 res.setDocumentTypeElement(parseString(json.get("documentType").getAsString())); 15794 if (json.has("_documentType")) 15795 parseElementProperties(getJObject(json, "_documentType"), res.getDocumentTypeElement()); 15796 if (json.has("reference")) 15797 res.setReferenceElement(parseUri(json.get("reference").getAsString())); 15798 if (json.has("_reference")) 15799 parseElementProperties(getJObject(json, "_reference"), res.getReferenceElement()); 15800 if (json.has("publicationDate")) 15801 res.setPublicationDateElement(parseDateTime(json.get("publicationDate").getAsString())); 15802 if (json.has("_publicationDate")) 15803 parseElementProperties(getJObject(json, "_publicationDate"), res.getPublicationDateElement()); 15804 if (json.has("presentationDate")) 15805 res.setPresentationDateElement(parseDateTime(json.get("presentationDate").getAsString())); 15806 if (json.has("_presentationDate")) 15807 parseElementProperties(getJObject(json, "_presentationDate"), res.getPresentationDateElement()); 15808 } 15809 15810 protected Immunization.ImmunizationReactionComponent parseImmunizationImmunizationReactionComponent(JsonObject json, 15811 Immunization owner) throws IOException, FHIRFormatError { 15812 Immunization.ImmunizationReactionComponent res = new Immunization.ImmunizationReactionComponent(); 15813 parseImmunizationImmunizationReactionComponentProperties(json, owner, res); 15814 return res; 15815 } 15816 15817 protected void parseImmunizationImmunizationReactionComponentProperties(JsonObject json, Immunization owner, 15818 Immunization.ImmunizationReactionComponent res) throws IOException, FHIRFormatError { 15819 parseBackboneElementProperties(json, res); 15820 if (json.has("date")) 15821 res.setDateElement(parseDateTime(json.get("date").getAsString())); 15822 if (json.has("_date")) 15823 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 15824 if (json.has("detail")) 15825 res.setDetail(parseReference(getJObject(json, "detail"))); 15826 if (json.has("reported")) 15827 res.setReportedElement(parseBoolean(json.get("reported").getAsBoolean())); 15828 if (json.has("_reported")) 15829 parseElementProperties(getJObject(json, "_reported"), res.getReportedElement()); 15830 } 15831 15832 protected Immunization.ImmunizationProtocolAppliedComponent parseImmunizationImmunizationProtocolAppliedComponent( 15833 JsonObject json, Immunization owner) throws IOException, FHIRFormatError { 15834 Immunization.ImmunizationProtocolAppliedComponent res = new Immunization.ImmunizationProtocolAppliedComponent(); 15835 parseImmunizationImmunizationProtocolAppliedComponentProperties(json, owner, res); 15836 return res; 15837 } 15838 15839 protected void parseImmunizationImmunizationProtocolAppliedComponentProperties(JsonObject json, Immunization owner, 15840 Immunization.ImmunizationProtocolAppliedComponent res) throws IOException, FHIRFormatError { 15841 parseBackboneElementProperties(json, res); 15842 if (json.has("series")) 15843 res.setSeriesElement(parseString(json.get("series").getAsString())); 15844 if (json.has("_series")) 15845 parseElementProperties(getJObject(json, "_series"), res.getSeriesElement()); 15846 if (json.has("authority")) 15847 res.setAuthority(parseReference(getJObject(json, "authority"))); 15848 if (json.has("targetDisease")) { 15849 JsonArray array = json.getAsJsonArray("targetDisease"); 15850 for (int i = 0; i < array.size(); i++) { 15851 res.getTargetDisease().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15852 } 15853 } 15854 ; 15855 Type doseNumber = parseType("doseNumber", json); 15856 if (doseNumber != null) 15857 res.setDoseNumber(doseNumber); 15858 Type seriesDoses = parseType("seriesDoses", json); 15859 if (seriesDoses != null) 15860 res.setSeriesDoses(seriesDoses); 15861 } 15862 15863 protected ImmunizationEvaluation parseImmunizationEvaluation(JsonObject json) throws IOException, FHIRFormatError { 15864 ImmunizationEvaluation res = new ImmunizationEvaluation(); 15865 parseImmunizationEvaluationProperties(json, res); 15866 return res; 15867 } 15868 15869 protected void parseImmunizationEvaluationProperties(JsonObject json, ImmunizationEvaluation res) 15870 throws IOException, FHIRFormatError { 15871 parseDomainResourceProperties(json, res); 15872 if (json.has("identifier")) { 15873 JsonArray array = json.getAsJsonArray("identifier"); 15874 for (int i = 0; i < array.size(); i++) { 15875 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 15876 } 15877 } 15878 ; 15879 if (json.has("status")) 15880 res.setStatusElement( 15881 parseEnumeration(json.get("status").getAsString(), ImmunizationEvaluation.ImmunizationEvaluationStatus.NULL, 15882 new ImmunizationEvaluation.ImmunizationEvaluationStatusEnumFactory())); 15883 if (json.has("_status")) 15884 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 15885 if (json.has("patient")) 15886 res.setPatient(parseReference(getJObject(json, "patient"))); 15887 if (json.has("date")) 15888 res.setDateElement(parseDateTime(json.get("date").getAsString())); 15889 if (json.has("_date")) 15890 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 15891 if (json.has("authority")) 15892 res.setAuthority(parseReference(getJObject(json, "authority"))); 15893 if (json.has("targetDisease")) 15894 res.setTargetDisease(parseCodeableConcept(getJObject(json, "targetDisease"))); 15895 if (json.has("immunizationEvent")) 15896 res.setImmunizationEvent(parseReference(getJObject(json, "immunizationEvent"))); 15897 if (json.has("doseStatus")) 15898 res.setDoseStatus(parseCodeableConcept(getJObject(json, "doseStatus"))); 15899 if (json.has("doseStatusReason")) { 15900 JsonArray array = json.getAsJsonArray("doseStatusReason"); 15901 for (int i = 0; i < array.size(); i++) { 15902 res.getDoseStatusReason().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15903 } 15904 } 15905 ; 15906 if (json.has("description")) 15907 res.setDescriptionElement(parseString(json.get("description").getAsString())); 15908 if (json.has("_description")) 15909 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 15910 if (json.has("series")) 15911 res.setSeriesElement(parseString(json.get("series").getAsString())); 15912 if (json.has("_series")) 15913 parseElementProperties(getJObject(json, "_series"), res.getSeriesElement()); 15914 Type doseNumber = parseType("doseNumber", json); 15915 if (doseNumber != null) 15916 res.setDoseNumber(doseNumber); 15917 Type seriesDoses = parseType("seriesDoses", json); 15918 if (seriesDoses != null) 15919 res.setSeriesDoses(seriesDoses); 15920 } 15921 15922 protected ImmunizationRecommendation parseImmunizationRecommendation(JsonObject json) 15923 throws IOException, FHIRFormatError { 15924 ImmunizationRecommendation res = new ImmunizationRecommendation(); 15925 parseImmunizationRecommendationProperties(json, res); 15926 return res; 15927 } 15928 15929 protected void parseImmunizationRecommendationProperties(JsonObject json, ImmunizationRecommendation res) 15930 throws IOException, FHIRFormatError { 15931 parseDomainResourceProperties(json, res); 15932 if (json.has("identifier")) { 15933 JsonArray array = json.getAsJsonArray("identifier"); 15934 for (int i = 0; i < array.size(); i++) { 15935 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 15936 } 15937 } 15938 ; 15939 if (json.has("patient")) 15940 res.setPatient(parseReference(getJObject(json, "patient"))); 15941 if (json.has("date")) 15942 res.setDateElement(parseDateTime(json.get("date").getAsString())); 15943 if (json.has("_date")) 15944 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 15945 if (json.has("authority")) 15946 res.setAuthority(parseReference(getJObject(json, "authority"))); 15947 if (json.has("recommendation")) { 15948 JsonArray array = json.getAsJsonArray("recommendation"); 15949 for (int i = 0; i < array.size(); i++) { 15950 res.getRecommendation().add(parseImmunizationRecommendationImmunizationRecommendationRecommendationComponent( 15951 array.get(i).getAsJsonObject(), res)); 15952 } 15953 } 15954 ; 15955 } 15956 15957 protected ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent parseImmunizationRecommendationImmunizationRecommendationRecommendationComponent( 15958 JsonObject json, ImmunizationRecommendation owner) throws IOException, FHIRFormatError { 15959 ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent res = new ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent(); 15960 parseImmunizationRecommendationImmunizationRecommendationRecommendationComponentProperties(json, owner, res); 15961 return res; 15962 } 15963 15964 protected void parseImmunizationRecommendationImmunizationRecommendationRecommendationComponentProperties( 15965 JsonObject json, ImmunizationRecommendation owner, 15966 ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent res) 15967 throws IOException, FHIRFormatError { 15968 parseBackboneElementProperties(json, res); 15969 if (json.has("vaccineCode")) { 15970 JsonArray array = json.getAsJsonArray("vaccineCode"); 15971 for (int i = 0; i < array.size(); i++) { 15972 res.getVaccineCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15973 } 15974 } 15975 ; 15976 if (json.has("targetDisease")) 15977 res.setTargetDisease(parseCodeableConcept(getJObject(json, "targetDisease"))); 15978 if (json.has("contraindicatedVaccineCode")) { 15979 JsonArray array = json.getAsJsonArray("contraindicatedVaccineCode"); 15980 for (int i = 0; i < array.size(); i++) { 15981 res.getContraindicatedVaccineCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15982 } 15983 } 15984 ; 15985 if (json.has("forecastStatus")) 15986 res.setForecastStatus(parseCodeableConcept(getJObject(json, "forecastStatus"))); 15987 if (json.has("forecastReason")) { 15988 JsonArray array = json.getAsJsonArray("forecastReason"); 15989 for (int i = 0; i < array.size(); i++) { 15990 res.getForecastReason().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 15991 } 15992 } 15993 ; 15994 if (json.has("dateCriterion")) { 15995 JsonArray array = json.getAsJsonArray("dateCriterion"); 15996 for (int i = 0; i < array.size(); i++) { 15997 res.getDateCriterion() 15998 .add(parseImmunizationRecommendationImmunizationRecommendationRecommendationDateCriterionComponent( 15999 array.get(i).getAsJsonObject(), owner)); 16000 } 16001 } 16002 ; 16003 if (json.has("description")) 16004 res.setDescriptionElement(parseString(json.get("description").getAsString())); 16005 if (json.has("_description")) 16006 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 16007 if (json.has("series")) 16008 res.setSeriesElement(parseString(json.get("series").getAsString())); 16009 if (json.has("_series")) 16010 parseElementProperties(getJObject(json, "_series"), res.getSeriesElement()); 16011 Type doseNumber = parseType("doseNumber", json); 16012 if (doseNumber != null) 16013 res.setDoseNumber(doseNumber); 16014 Type seriesDoses = parseType("seriesDoses", json); 16015 if (seriesDoses != null) 16016 res.setSeriesDoses(seriesDoses); 16017 if (json.has("supportingImmunization")) { 16018 JsonArray array = json.getAsJsonArray("supportingImmunization"); 16019 for (int i = 0; i < array.size(); i++) { 16020 res.getSupportingImmunization().add(parseReference(array.get(i).getAsJsonObject())); 16021 } 16022 } 16023 ; 16024 if (json.has("supportingPatientInformation")) { 16025 JsonArray array = json.getAsJsonArray("supportingPatientInformation"); 16026 for (int i = 0; i < array.size(); i++) { 16027 res.getSupportingPatientInformation().add(parseReference(array.get(i).getAsJsonObject())); 16028 } 16029 } 16030 ; 16031 } 16032 16033 protected ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent parseImmunizationRecommendationImmunizationRecommendationRecommendationDateCriterionComponent( 16034 JsonObject json, ImmunizationRecommendation owner) throws IOException, FHIRFormatError { 16035 ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent res = new ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent(); 16036 parseImmunizationRecommendationImmunizationRecommendationRecommendationDateCriterionComponentProperties(json, owner, 16037 res); 16038 return res; 16039 } 16040 16041 protected void parseImmunizationRecommendationImmunizationRecommendationRecommendationDateCriterionComponentProperties( 16042 JsonObject json, ImmunizationRecommendation owner, 16043 ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent res) 16044 throws IOException, FHIRFormatError { 16045 parseBackboneElementProperties(json, res); 16046 if (json.has("code")) 16047 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 16048 if (json.has("value")) 16049 res.setValueElement(parseDateTime(json.get("value").getAsString())); 16050 if (json.has("_value")) 16051 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 16052 } 16053 16054 protected ImplementationGuide parseImplementationGuide(JsonObject json) throws IOException, FHIRFormatError { 16055 ImplementationGuide res = new ImplementationGuide(); 16056 parseImplementationGuideProperties(json, res); 16057 return res; 16058 } 16059 16060 protected void parseImplementationGuideProperties(JsonObject json, ImplementationGuide res) 16061 throws IOException, FHIRFormatError { 16062 parseDomainResourceProperties(json, res); 16063 if (json.has("url")) 16064 res.setUrlElement(parseUri(json.get("url").getAsString())); 16065 if (json.has("_url")) 16066 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 16067 if (json.has("version")) 16068 res.setVersionElement(parseString(json.get("version").getAsString())); 16069 if (json.has("_version")) 16070 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 16071 if (json.has("name")) 16072 res.setNameElement(parseString(json.get("name").getAsString())); 16073 if (json.has("_name")) 16074 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 16075 if (json.has("title")) 16076 res.setTitleElement(parseString(json.get("title").getAsString())); 16077 if (json.has("_title")) 16078 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 16079 if (json.has("status")) 16080 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 16081 new Enumerations.PublicationStatusEnumFactory())); 16082 if (json.has("_status")) 16083 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 16084 if (json.has("experimental")) 16085 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 16086 if (json.has("_experimental")) 16087 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 16088 if (json.has("date")) 16089 res.setDateElement(parseDateTime(json.get("date").getAsString())); 16090 if (json.has("_date")) 16091 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 16092 if (json.has("publisher")) 16093 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 16094 if (json.has("_publisher")) 16095 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 16096 if (json.has("contact")) { 16097 JsonArray array = json.getAsJsonArray("contact"); 16098 for (int i = 0; i < array.size(); i++) { 16099 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 16100 } 16101 } 16102 ; 16103 if (json.has("description")) 16104 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 16105 if (json.has("_description")) 16106 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 16107 if (json.has("useContext")) { 16108 JsonArray array = json.getAsJsonArray("useContext"); 16109 for (int i = 0; i < array.size(); i++) { 16110 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 16111 } 16112 } 16113 ; 16114 if (json.has("jurisdiction")) { 16115 JsonArray array = json.getAsJsonArray("jurisdiction"); 16116 for (int i = 0; i < array.size(); i++) { 16117 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 16118 } 16119 } 16120 ; 16121 if (json.has("copyright")) 16122 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 16123 if (json.has("_copyright")) 16124 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 16125 if (json.has("packageId")) 16126 res.setPackageIdElement(parseId(json.get("packageId").getAsString())); 16127 if (json.has("_packageId")) 16128 parseElementProperties(getJObject(json, "_packageId"), res.getPackageIdElement()); 16129 if (json.has("license")) 16130 res.setLicenseElement(parseEnumeration(json.get("license").getAsString(), ImplementationGuide.SPDXLicense.NULL, 16131 new ImplementationGuide.SPDXLicenseEnumFactory())); 16132 if (json.has("_license")) 16133 parseElementProperties(getJObject(json, "_license"), res.getLicenseElement()); 16134 if (json.has("fhirVersion")) { 16135 JsonArray array = json.getAsJsonArray("fhirVersion"); 16136 for (int i = 0; i < array.size(); i++) { 16137 if (array.get(i).isJsonNull()) { 16138 res.getFhirVersion().add(new Enumeration<Enumerations.FHIRVersion>()); 16139 } else { 16140 res.getFhirVersion().add(parseEnumeration(array.get(i).getAsString(), Enumerations.FHIRVersion.NULL, 16141 new Enumerations.FHIRVersionEnumFactory())); 16142 } 16143 } 16144 } 16145 ; 16146 if (json.has("_fhirVersion")) { 16147 JsonArray array = json.getAsJsonArray("_fhirVersion"); 16148 for (int i = 0; i < array.size(); i++) { 16149 if (i == res.getFhirVersion().size()) 16150 res.getFhirVersion() 16151 .add(parseEnumeration(null, Enumerations.FHIRVersion.NULL, new Enumerations.FHIRVersionEnumFactory())); 16152 if (array.get(i) instanceof JsonObject) 16153 parseElementProperties(array.get(i).getAsJsonObject(), res.getFhirVersion().get(i)); 16154 } 16155 } 16156 ; 16157 if (json.has("dependsOn")) { 16158 JsonArray array = json.getAsJsonArray("dependsOn"); 16159 for (int i = 0; i < array.size(); i++) { 16160 res.getDependsOn() 16161 .add(parseImplementationGuideImplementationGuideDependsOnComponent(array.get(i).getAsJsonObject(), res)); 16162 } 16163 } 16164 ; 16165 if (json.has("global")) { 16166 JsonArray array = json.getAsJsonArray("global"); 16167 for (int i = 0; i < array.size(); i++) { 16168 res.getGlobal() 16169 .add(parseImplementationGuideImplementationGuideGlobalComponent(array.get(i).getAsJsonObject(), res)); 16170 } 16171 } 16172 ; 16173 if (json.has("definition")) 16174 res.setDefinition( 16175 parseImplementationGuideImplementationGuideDefinitionComponent(getJObject(json, "definition"), res)); 16176 if (json.has("manifest")) 16177 res.setManifest(parseImplementationGuideImplementationGuideManifestComponent(getJObject(json, "manifest"), res)); 16178 } 16179 16180 protected ImplementationGuide.ImplementationGuideDependsOnComponent parseImplementationGuideImplementationGuideDependsOnComponent( 16181 JsonObject json, ImplementationGuide owner) throws IOException, FHIRFormatError { 16182 ImplementationGuide.ImplementationGuideDependsOnComponent res = new ImplementationGuide.ImplementationGuideDependsOnComponent(); 16183 parseImplementationGuideImplementationGuideDependsOnComponentProperties(json, owner, res); 16184 return res; 16185 } 16186 16187 protected void parseImplementationGuideImplementationGuideDependsOnComponentProperties(JsonObject json, 16188 ImplementationGuide owner, ImplementationGuide.ImplementationGuideDependsOnComponent res) 16189 throws IOException, FHIRFormatError { 16190 parseBackboneElementProperties(json, res); 16191 if (json.has("uri")) 16192 res.setUriElement(parseCanonical(json.get("uri").getAsString())); 16193 if (json.has("_uri")) 16194 parseElementProperties(getJObject(json, "_uri"), res.getUriElement()); 16195 if (json.has("packageId")) 16196 res.setPackageIdElement(parseId(json.get("packageId").getAsString())); 16197 if (json.has("_packageId")) 16198 parseElementProperties(getJObject(json, "_packageId"), res.getPackageIdElement()); 16199 if (json.has("version")) 16200 res.setVersionElement(parseString(json.get("version").getAsString())); 16201 if (json.has("_version")) 16202 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 16203 } 16204 16205 protected ImplementationGuide.ImplementationGuideGlobalComponent parseImplementationGuideImplementationGuideGlobalComponent( 16206 JsonObject json, ImplementationGuide owner) throws IOException, FHIRFormatError { 16207 ImplementationGuide.ImplementationGuideGlobalComponent res = new ImplementationGuide.ImplementationGuideGlobalComponent(); 16208 parseImplementationGuideImplementationGuideGlobalComponentProperties(json, owner, res); 16209 return res; 16210 } 16211 16212 protected void parseImplementationGuideImplementationGuideGlobalComponentProperties(JsonObject json, 16213 ImplementationGuide owner, ImplementationGuide.ImplementationGuideGlobalComponent res) 16214 throws IOException, FHIRFormatError { 16215 parseBackboneElementProperties(json, res); 16216 if (json.has("type")) 16217 res.setTypeElement(parseCode(json.get("type").getAsString())); 16218 if (json.has("_type")) 16219 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 16220 if (json.has("profile")) 16221 res.setProfileElement(parseCanonical(json.get("profile").getAsString())); 16222 if (json.has("_profile")) 16223 parseElementProperties(getJObject(json, "_profile"), res.getProfileElement()); 16224 } 16225 16226 protected ImplementationGuide.ImplementationGuideDefinitionComponent parseImplementationGuideImplementationGuideDefinitionComponent( 16227 JsonObject json, ImplementationGuide owner) throws IOException, FHIRFormatError { 16228 ImplementationGuide.ImplementationGuideDefinitionComponent res = new ImplementationGuide.ImplementationGuideDefinitionComponent(); 16229 parseImplementationGuideImplementationGuideDefinitionComponentProperties(json, owner, res); 16230 return res; 16231 } 16232 16233 protected void parseImplementationGuideImplementationGuideDefinitionComponentProperties(JsonObject json, 16234 ImplementationGuide owner, ImplementationGuide.ImplementationGuideDefinitionComponent res) 16235 throws IOException, FHIRFormatError { 16236 parseBackboneElementProperties(json, res); 16237 if (json.has("grouping")) { 16238 JsonArray array = json.getAsJsonArray("grouping"); 16239 for (int i = 0; i < array.size(); i++) { 16240 res.getGrouping().add(parseImplementationGuideImplementationGuideDefinitionGroupingComponent( 16241 array.get(i).getAsJsonObject(), owner)); 16242 } 16243 } 16244 ; 16245 if (json.has("resource")) { 16246 JsonArray array = json.getAsJsonArray("resource"); 16247 for (int i = 0; i < array.size(); i++) { 16248 res.getResource().add(parseImplementationGuideImplementationGuideDefinitionResourceComponent( 16249 array.get(i).getAsJsonObject(), owner)); 16250 } 16251 } 16252 ; 16253 if (json.has("page")) 16254 res.setPage(parseImplementationGuideImplementationGuideDefinitionPageComponent(getJObject(json, "page"), owner)); 16255 if (json.has("parameter")) { 16256 JsonArray array = json.getAsJsonArray("parameter"); 16257 for (int i = 0; i < array.size(); i++) { 16258 res.getParameter().add(parseImplementationGuideImplementationGuideDefinitionParameterComponent( 16259 array.get(i).getAsJsonObject(), owner)); 16260 } 16261 } 16262 ; 16263 if (json.has("template")) { 16264 JsonArray array = json.getAsJsonArray("template"); 16265 for (int i = 0; i < array.size(); i++) { 16266 res.getTemplate().add(parseImplementationGuideImplementationGuideDefinitionTemplateComponent( 16267 array.get(i).getAsJsonObject(), owner)); 16268 } 16269 } 16270 ; 16271 } 16272 16273 protected ImplementationGuide.ImplementationGuideDefinitionGroupingComponent parseImplementationGuideImplementationGuideDefinitionGroupingComponent( 16274 JsonObject json, ImplementationGuide owner) throws IOException, FHIRFormatError { 16275 ImplementationGuide.ImplementationGuideDefinitionGroupingComponent res = new ImplementationGuide.ImplementationGuideDefinitionGroupingComponent(); 16276 parseImplementationGuideImplementationGuideDefinitionGroupingComponentProperties(json, owner, res); 16277 return res; 16278 } 16279 16280 protected void parseImplementationGuideImplementationGuideDefinitionGroupingComponentProperties(JsonObject json, 16281 ImplementationGuide owner, ImplementationGuide.ImplementationGuideDefinitionGroupingComponent res) 16282 throws IOException, FHIRFormatError { 16283 parseBackboneElementProperties(json, res); 16284 if (json.has("name")) 16285 res.setNameElement(parseString(json.get("name").getAsString())); 16286 if (json.has("_name")) 16287 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 16288 if (json.has("description")) 16289 res.setDescriptionElement(parseString(json.get("description").getAsString())); 16290 if (json.has("_description")) 16291 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 16292 } 16293 16294 protected ImplementationGuide.ImplementationGuideDefinitionResourceComponent parseImplementationGuideImplementationGuideDefinitionResourceComponent( 16295 JsonObject json, ImplementationGuide owner) throws IOException, FHIRFormatError { 16296 ImplementationGuide.ImplementationGuideDefinitionResourceComponent res = new ImplementationGuide.ImplementationGuideDefinitionResourceComponent(); 16297 parseImplementationGuideImplementationGuideDefinitionResourceComponentProperties(json, owner, res); 16298 return res; 16299 } 16300 16301 protected void parseImplementationGuideImplementationGuideDefinitionResourceComponentProperties(JsonObject json, 16302 ImplementationGuide owner, ImplementationGuide.ImplementationGuideDefinitionResourceComponent res) 16303 throws IOException, FHIRFormatError { 16304 parseBackboneElementProperties(json, res); 16305 if (json.has("reference")) 16306 res.setReference(parseReference(getJObject(json, "reference"))); 16307 if (json.has("fhirVersion")) { 16308 JsonArray array = json.getAsJsonArray("fhirVersion"); 16309 for (int i = 0; i < array.size(); i++) { 16310 if (array.get(i).isJsonNull()) { 16311 res.getFhirVersion().add(new Enumeration<Enumerations.FHIRVersion>()); 16312 } else { 16313 res.getFhirVersion().add(parseEnumeration(array.get(i).getAsString(), Enumerations.FHIRVersion.NULL, 16314 new Enumerations.FHIRVersionEnumFactory())); 16315 } 16316 } 16317 } 16318 ; 16319 if (json.has("_fhirVersion")) { 16320 JsonArray array = json.getAsJsonArray("_fhirVersion"); 16321 for (int i = 0; i < array.size(); i++) { 16322 if (i == res.getFhirVersion().size()) 16323 res.getFhirVersion() 16324 .add(parseEnumeration(null, Enumerations.FHIRVersion.NULL, new Enumerations.FHIRVersionEnumFactory())); 16325 if (array.get(i) instanceof JsonObject) 16326 parseElementProperties(array.get(i).getAsJsonObject(), res.getFhirVersion().get(i)); 16327 } 16328 } 16329 ; 16330 if (json.has("name")) 16331 res.setNameElement(parseString(json.get("name").getAsString())); 16332 if (json.has("_name")) 16333 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 16334 if (json.has("description")) 16335 res.setDescriptionElement(parseString(json.get("description").getAsString())); 16336 if (json.has("_description")) 16337 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 16338 Type example = parseType("example", json); 16339 if (example != null) 16340 res.setExample(example); 16341 if (json.has("groupingId")) 16342 res.setGroupingIdElement(parseId(json.get("groupingId").getAsString())); 16343 if (json.has("_groupingId")) 16344 parseElementProperties(getJObject(json, "_groupingId"), res.getGroupingIdElement()); 16345 } 16346 16347 protected ImplementationGuide.ImplementationGuideDefinitionPageComponent parseImplementationGuideImplementationGuideDefinitionPageComponent( 16348 JsonObject json, ImplementationGuide owner) throws IOException, FHIRFormatError { 16349 ImplementationGuide.ImplementationGuideDefinitionPageComponent res = new ImplementationGuide.ImplementationGuideDefinitionPageComponent(); 16350 parseImplementationGuideImplementationGuideDefinitionPageComponentProperties(json, owner, res); 16351 return res; 16352 } 16353 16354 protected void parseImplementationGuideImplementationGuideDefinitionPageComponentProperties(JsonObject json, 16355 ImplementationGuide owner, ImplementationGuide.ImplementationGuideDefinitionPageComponent res) 16356 throws IOException, FHIRFormatError { 16357 parseBackboneElementProperties(json, res); 16358 Type name = parseType("name", json); 16359 if (name != null) 16360 res.setName(name); 16361 if (json.has("title")) 16362 res.setTitleElement(parseString(json.get("title").getAsString())); 16363 if (json.has("_title")) 16364 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 16365 if (json.has("generation")) 16366 res.setGenerationElement(parseEnumeration(json.get("generation").getAsString(), 16367 ImplementationGuide.GuidePageGeneration.NULL, new ImplementationGuide.GuidePageGenerationEnumFactory())); 16368 if (json.has("_generation")) 16369 parseElementProperties(getJObject(json, "_generation"), res.getGenerationElement()); 16370 if (json.has("page")) { 16371 JsonArray array = json.getAsJsonArray("page"); 16372 for (int i = 0; i < array.size(); i++) { 16373 res.getPage().add( 16374 parseImplementationGuideImplementationGuideDefinitionPageComponent(array.get(i).getAsJsonObject(), owner)); 16375 } 16376 } 16377 ; 16378 } 16379 16380 protected ImplementationGuide.ImplementationGuideDefinitionParameterComponent parseImplementationGuideImplementationGuideDefinitionParameterComponent( 16381 JsonObject json, ImplementationGuide owner) throws IOException, FHIRFormatError { 16382 ImplementationGuide.ImplementationGuideDefinitionParameterComponent res = new ImplementationGuide.ImplementationGuideDefinitionParameterComponent(); 16383 parseImplementationGuideImplementationGuideDefinitionParameterComponentProperties(json, owner, res); 16384 return res; 16385 } 16386 16387 protected void parseImplementationGuideImplementationGuideDefinitionParameterComponentProperties(JsonObject json, 16388 ImplementationGuide owner, ImplementationGuide.ImplementationGuideDefinitionParameterComponent res) 16389 throws IOException, FHIRFormatError { 16390 parseBackboneElementProperties(json, res); 16391 if (json.has("code")) 16392 res.setCodeElement(parseString(json.get("code").getAsString())); 16393 if (json.has("_code")) 16394 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 16395 if (json.has("value")) 16396 res.setValueElement(parseString(json.get("value").getAsString())); 16397 if (json.has("_value")) 16398 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 16399 } 16400 16401 protected ImplementationGuide.ImplementationGuideDefinitionTemplateComponent parseImplementationGuideImplementationGuideDefinitionTemplateComponent( 16402 JsonObject json, ImplementationGuide owner) throws IOException, FHIRFormatError { 16403 ImplementationGuide.ImplementationGuideDefinitionTemplateComponent res = new ImplementationGuide.ImplementationGuideDefinitionTemplateComponent(); 16404 parseImplementationGuideImplementationGuideDefinitionTemplateComponentProperties(json, owner, res); 16405 return res; 16406 } 16407 16408 protected void parseImplementationGuideImplementationGuideDefinitionTemplateComponentProperties(JsonObject json, 16409 ImplementationGuide owner, ImplementationGuide.ImplementationGuideDefinitionTemplateComponent res) 16410 throws IOException, FHIRFormatError { 16411 parseBackboneElementProperties(json, res); 16412 if (json.has("code")) 16413 res.setCodeElement(parseCode(json.get("code").getAsString())); 16414 if (json.has("_code")) 16415 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 16416 if (json.has("source")) 16417 res.setSourceElement(parseString(json.get("source").getAsString())); 16418 if (json.has("_source")) 16419 parseElementProperties(getJObject(json, "_source"), res.getSourceElement()); 16420 if (json.has("scope")) 16421 res.setScopeElement(parseString(json.get("scope").getAsString())); 16422 if (json.has("_scope")) 16423 parseElementProperties(getJObject(json, "_scope"), res.getScopeElement()); 16424 } 16425 16426 protected ImplementationGuide.ImplementationGuideManifestComponent parseImplementationGuideImplementationGuideManifestComponent( 16427 JsonObject json, ImplementationGuide owner) throws IOException, FHIRFormatError { 16428 ImplementationGuide.ImplementationGuideManifestComponent res = new ImplementationGuide.ImplementationGuideManifestComponent(); 16429 parseImplementationGuideImplementationGuideManifestComponentProperties(json, owner, res); 16430 return res; 16431 } 16432 16433 protected void parseImplementationGuideImplementationGuideManifestComponentProperties(JsonObject json, 16434 ImplementationGuide owner, ImplementationGuide.ImplementationGuideManifestComponent res) 16435 throws IOException, FHIRFormatError { 16436 parseBackboneElementProperties(json, res); 16437 if (json.has("rendering")) 16438 res.setRenderingElement(parseUrl(json.get("rendering").getAsString())); 16439 if (json.has("_rendering")) 16440 parseElementProperties(getJObject(json, "_rendering"), res.getRenderingElement()); 16441 if (json.has("resource")) { 16442 JsonArray array = json.getAsJsonArray("resource"); 16443 for (int i = 0; i < array.size(); i++) { 16444 res.getResource().add(parseImplementationGuideManifestResourceComponent(array.get(i).getAsJsonObject(), owner)); 16445 } 16446 } 16447 ; 16448 if (json.has("page")) { 16449 JsonArray array = json.getAsJsonArray("page"); 16450 for (int i = 0; i < array.size(); i++) { 16451 res.getPage().add(parseImplementationGuideManifestPageComponent(array.get(i).getAsJsonObject(), owner)); 16452 } 16453 } 16454 ; 16455 if (json.has("image")) { 16456 JsonArray array = json.getAsJsonArray("image"); 16457 for (int i = 0; i < array.size(); i++) { 16458 if (array.get(i).isJsonNull()) { 16459 res.getImage().add(new StringType()); 16460 } else { 16461 res.getImage().add(parseString(array.get(i).getAsString())); 16462 } 16463 } 16464 } 16465 ; 16466 if (json.has("_image")) { 16467 JsonArray array = json.getAsJsonArray("_image"); 16468 for (int i = 0; i < array.size(); i++) { 16469 if (i == res.getImage().size()) 16470 res.getImage().add(parseString(null)); 16471 if (array.get(i) instanceof JsonObject) 16472 parseElementProperties(array.get(i).getAsJsonObject(), res.getImage().get(i)); 16473 } 16474 } 16475 ; 16476 if (json.has("other")) { 16477 JsonArray array = json.getAsJsonArray("other"); 16478 for (int i = 0; i < array.size(); i++) { 16479 if (array.get(i).isJsonNull()) { 16480 res.getOther().add(new StringType()); 16481 } else { 16482 res.getOther().add(parseString(array.get(i).getAsString())); 16483 } 16484 } 16485 } 16486 ; 16487 if (json.has("_other")) { 16488 JsonArray array = json.getAsJsonArray("_other"); 16489 for (int i = 0; i < array.size(); i++) { 16490 if (i == res.getOther().size()) 16491 res.getOther().add(parseString(null)); 16492 if (array.get(i) instanceof JsonObject) 16493 parseElementProperties(array.get(i).getAsJsonObject(), res.getOther().get(i)); 16494 } 16495 } 16496 ; 16497 } 16498 16499 protected ImplementationGuide.ManifestResourceComponent parseImplementationGuideManifestResourceComponent( 16500 JsonObject json, ImplementationGuide owner) throws IOException, FHIRFormatError { 16501 ImplementationGuide.ManifestResourceComponent res = new ImplementationGuide.ManifestResourceComponent(); 16502 parseImplementationGuideManifestResourceComponentProperties(json, owner, res); 16503 return res; 16504 } 16505 16506 protected void parseImplementationGuideManifestResourceComponentProperties(JsonObject json, ImplementationGuide owner, 16507 ImplementationGuide.ManifestResourceComponent res) throws IOException, FHIRFormatError { 16508 parseBackboneElementProperties(json, res); 16509 if (json.has("reference")) 16510 res.setReference(parseReference(getJObject(json, "reference"))); 16511 Type example = parseType("example", json); 16512 if (example != null) 16513 res.setExample(example); 16514 if (json.has("relativePath")) 16515 res.setRelativePathElement(parseUrl(json.get("relativePath").getAsString())); 16516 if (json.has("_relativePath")) 16517 parseElementProperties(getJObject(json, "_relativePath"), res.getRelativePathElement()); 16518 } 16519 16520 protected ImplementationGuide.ManifestPageComponent parseImplementationGuideManifestPageComponent(JsonObject json, 16521 ImplementationGuide owner) throws IOException, FHIRFormatError { 16522 ImplementationGuide.ManifestPageComponent res = new ImplementationGuide.ManifestPageComponent(); 16523 parseImplementationGuideManifestPageComponentProperties(json, owner, res); 16524 return res; 16525 } 16526 16527 protected void parseImplementationGuideManifestPageComponentProperties(JsonObject json, ImplementationGuide owner, 16528 ImplementationGuide.ManifestPageComponent res) throws IOException, FHIRFormatError { 16529 parseBackboneElementProperties(json, res); 16530 if (json.has("name")) 16531 res.setNameElement(parseString(json.get("name").getAsString())); 16532 if (json.has("_name")) 16533 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 16534 if (json.has("title")) 16535 res.setTitleElement(parseString(json.get("title").getAsString())); 16536 if (json.has("_title")) 16537 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 16538 if (json.has("anchor")) { 16539 JsonArray array = json.getAsJsonArray("anchor"); 16540 for (int i = 0; i < array.size(); i++) { 16541 if (array.get(i).isJsonNull()) { 16542 res.getAnchor().add(new StringType()); 16543 } else { 16544 res.getAnchor().add(parseString(array.get(i).getAsString())); 16545 } 16546 } 16547 } 16548 ; 16549 if (json.has("_anchor")) { 16550 JsonArray array = json.getAsJsonArray("_anchor"); 16551 for (int i = 0; i < array.size(); i++) { 16552 if (i == res.getAnchor().size()) 16553 res.getAnchor().add(parseString(null)); 16554 if (array.get(i) instanceof JsonObject) 16555 parseElementProperties(array.get(i).getAsJsonObject(), res.getAnchor().get(i)); 16556 } 16557 } 16558 ; 16559 } 16560 16561 protected InsurancePlan parseInsurancePlan(JsonObject json) throws IOException, FHIRFormatError { 16562 InsurancePlan res = new InsurancePlan(); 16563 parseInsurancePlanProperties(json, res); 16564 return res; 16565 } 16566 16567 protected void parseInsurancePlanProperties(JsonObject json, InsurancePlan res) throws IOException, FHIRFormatError { 16568 parseDomainResourceProperties(json, res); 16569 if (json.has("identifier")) { 16570 JsonArray array = json.getAsJsonArray("identifier"); 16571 for (int i = 0; i < array.size(); i++) { 16572 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 16573 } 16574 } 16575 ; 16576 if (json.has("status")) 16577 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 16578 new Enumerations.PublicationStatusEnumFactory())); 16579 if (json.has("_status")) 16580 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 16581 if (json.has("type")) { 16582 JsonArray array = json.getAsJsonArray("type"); 16583 for (int i = 0; i < array.size(); i++) { 16584 res.getType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 16585 } 16586 } 16587 ; 16588 if (json.has("name")) 16589 res.setNameElement(parseString(json.get("name").getAsString())); 16590 if (json.has("_name")) 16591 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 16592 if (json.has("alias")) { 16593 JsonArray array = json.getAsJsonArray("alias"); 16594 for (int i = 0; i < array.size(); i++) { 16595 if (array.get(i).isJsonNull()) { 16596 res.getAlias().add(new StringType()); 16597 } else { 16598 res.getAlias().add(parseString(array.get(i).getAsString())); 16599 } 16600 } 16601 } 16602 ; 16603 if (json.has("_alias")) { 16604 JsonArray array = json.getAsJsonArray("_alias"); 16605 for (int i = 0; i < array.size(); i++) { 16606 if (i == res.getAlias().size()) 16607 res.getAlias().add(parseString(null)); 16608 if (array.get(i) instanceof JsonObject) 16609 parseElementProperties(array.get(i).getAsJsonObject(), res.getAlias().get(i)); 16610 } 16611 } 16612 ; 16613 if (json.has("period")) 16614 res.setPeriod(parsePeriod(getJObject(json, "period"))); 16615 if (json.has("ownedBy")) 16616 res.setOwnedBy(parseReference(getJObject(json, "ownedBy"))); 16617 if (json.has("administeredBy")) 16618 res.setAdministeredBy(parseReference(getJObject(json, "administeredBy"))); 16619 if (json.has("coverageArea")) { 16620 JsonArray array = json.getAsJsonArray("coverageArea"); 16621 for (int i = 0; i < array.size(); i++) { 16622 res.getCoverageArea().add(parseReference(array.get(i).getAsJsonObject())); 16623 } 16624 } 16625 ; 16626 if (json.has("contact")) { 16627 JsonArray array = json.getAsJsonArray("contact"); 16628 for (int i = 0; i < array.size(); i++) { 16629 res.getContact().add(parseInsurancePlanInsurancePlanContactComponent(array.get(i).getAsJsonObject(), res)); 16630 } 16631 } 16632 ; 16633 if (json.has("endpoint")) { 16634 JsonArray array = json.getAsJsonArray("endpoint"); 16635 for (int i = 0; i < array.size(); i++) { 16636 res.getEndpoint().add(parseReference(array.get(i).getAsJsonObject())); 16637 } 16638 } 16639 ; 16640 if (json.has("network")) { 16641 JsonArray array = json.getAsJsonArray("network"); 16642 for (int i = 0; i < array.size(); i++) { 16643 res.getNetwork().add(parseReference(array.get(i).getAsJsonObject())); 16644 } 16645 } 16646 ; 16647 if (json.has("coverage")) { 16648 JsonArray array = json.getAsJsonArray("coverage"); 16649 for (int i = 0; i < array.size(); i++) { 16650 res.getCoverage().add(parseInsurancePlanInsurancePlanCoverageComponent(array.get(i).getAsJsonObject(), res)); 16651 } 16652 } 16653 ; 16654 if (json.has("plan")) { 16655 JsonArray array = json.getAsJsonArray("plan"); 16656 for (int i = 0; i < array.size(); i++) { 16657 res.getPlan().add(parseInsurancePlanInsurancePlanPlanComponent(array.get(i).getAsJsonObject(), res)); 16658 } 16659 } 16660 ; 16661 } 16662 16663 protected InsurancePlan.InsurancePlanContactComponent parseInsurancePlanInsurancePlanContactComponent(JsonObject json, 16664 InsurancePlan owner) throws IOException, FHIRFormatError { 16665 InsurancePlan.InsurancePlanContactComponent res = new InsurancePlan.InsurancePlanContactComponent(); 16666 parseInsurancePlanInsurancePlanContactComponentProperties(json, owner, res); 16667 return res; 16668 } 16669 16670 protected void parseInsurancePlanInsurancePlanContactComponentProperties(JsonObject json, InsurancePlan owner, 16671 InsurancePlan.InsurancePlanContactComponent res) throws IOException, FHIRFormatError { 16672 parseBackboneElementProperties(json, res); 16673 if (json.has("purpose")) 16674 res.setPurpose(parseCodeableConcept(getJObject(json, "purpose"))); 16675 if (json.has("name")) 16676 res.setName(parseHumanName(getJObject(json, "name"))); 16677 if (json.has("telecom")) { 16678 JsonArray array = json.getAsJsonArray("telecom"); 16679 for (int i = 0; i < array.size(); i++) { 16680 res.getTelecom().add(parseContactPoint(array.get(i).getAsJsonObject())); 16681 } 16682 } 16683 ; 16684 if (json.has("address")) 16685 res.setAddress(parseAddress(getJObject(json, "address"))); 16686 } 16687 16688 protected InsurancePlan.InsurancePlanCoverageComponent parseInsurancePlanInsurancePlanCoverageComponent( 16689 JsonObject json, InsurancePlan owner) throws IOException, FHIRFormatError { 16690 InsurancePlan.InsurancePlanCoverageComponent res = new InsurancePlan.InsurancePlanCoverageComponent(); 16691 parseInsurancePlanInsurancePlanCoverageComponentProperties(json, owner, res); 16692 return res; 16693 } 16694 16695 protected void parseInsurancePlanInsurancePlanCoverageComponentProperties(JsonObject json, InsurancePlan owner, 16696 InsurancePlan.InsurancePlanCoverageComponent res) throws IOException, FHIRFormatError { 16697 parseBackboneElementProperties(json, res); 16698 if (json.has("type")) 16699 res.setType(parseCodeableConcept(getJObject(json, "type"))); 16700 if (json.has("network")) { 16701 JsonArray array = json.getAsJsonArray("network"); 16702 for (int i = 0; i < array.size(); i++) { 16703 res.getNetwork().add(parseReference(array.get(i).getAsJsonObject())); 16704 } 16705 } 16706 ; 16707 if (json.has("benefit")) { 16708 JsonArray array = json.getAsJsonArray("benefit"); 16709 for (int i = 0; i < array.size(); i++) { 16710 res.getBenefit().add(parseInsurancePlanCoverageBenefitComponent(array.get(i).getAsJsonObject(), owner)); 16711 } 16712 } 16713 ; 16714 } 16715 16716 protected InsurancePlan.CoverageBenefitComponent parseInsurancePlanCoverageBenefitComponent(JsonObject json, 16717 InsurancePlan owner) throws IOException, FHIRFormatError { 16718 InsurancePlan.CoverageBenefitComponent res = new InsurancePlan.CoverageBenefitComponent(); 16719 parseInsurancePlanCoverageBenefitComponentProperties(json, owner, res); 16720 return res; 16721 } 16722 16723 protected void parseInsurancePlanCoverageBenefitComponentProperties(JsonObject json, InsurancePlan owner, 16724 InsurancePlan.CoverageBenefitComponent res) throws IOException, FHIRFormatError { 16725 parseBackboneElementProperties(json, res); 16726 if (json.has("type")) 16727 res.setType(parseCodeableConcept(getJObject(json, "type"))); 16728 if (json.has("requirement")) 16729 res.setRequirementElement(parseString(json.get("requirement").getAsString())); 16730 if (json.has("_requirement")) 16731 parseElementProperties(getJObject(json, "_requirement"), res.getRequirementElement()); 16732 if (json.has("limit")) { 16733 JsonArray array = json.getAsJsonArray("limit"); 16734 for (int i = 0; i < array.size(); i++) { 16735 res.getLimit().add(parseInsurancePlanCoverageBenefitLimitComponent(array.get(i).getAsJsonObject(), owner)); 16736 } 16737 } 16738 ; 16739 } 16740 16741 protected InsurancePlan.CoverageBenefitLimitComponent parseInsurancePlanCoverageBenefitLimitComponent(JsonObject json, 16742 InsurancePlan owner) throws IOException, FHIRFormatError { 16743 InsurancePlan.CoverageBenefitLimitComponent res = new InsurancePlan.CoverageBenefitLimitComponent(); 16744 parseInsurancePlanCoverageBenefitLimitComponentProperties(json, owner, res); 16745 return res; 16746 } 16747 16748 protected void parseInsurancePlanCoverageBenefitLimitComponentProperties(JsonObject json, InsurancePlan owner, 16749 InsurancePlan.CoverageBenefitLimitComponent res) throws IOException, FHIRFormatError { 16750 parseBackboneElementProperties(json, res); 16751 if (json.has("value")) 16752 res.setValue(parseQuantity(getJObject(json, "value"))); 16753 if (json.has("code")) 16754 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 16755 } 16756 16757 protected InsurancePlan.InsurancePlanPlanComponent parseInsurancePlanInsurancePlanPlanComponent(JsonObject json, 16758 InsurancePlan owner) throws IOException, FHIRFormatError { 16759 InsurancePlan.InsurancePlanPlanComponent res = new InsurancePlan.InsurancePlanPlanComponent(); 16760 parseInsurancePlanInsurancePlanPlanComponentProperties(json, owner, res); 16761 return res; 16762 } 16763 16764 protected void parseInsurancePlanInsurancePlanPlanComponentProperties(JsonObject json, InsurancePlan owner, 16765 InsurancePlan.InsurancePlanPlanComponent res) throws IOException, FHIRFormatError { 16766 parseBackboneElementProperties(json, res); 16767 if (json.has("identifier")) { 16768 JsonArray array = json.getAsJsonArray("identifier"); 16769 for (int i = 0; i < array.size(); i++) { 16770 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 16771 } 16772 } 16773 ; 16774 if (json.has("type")) 16775 res.setType(parseCodeableConcept(getJObject(json, "type"))); 16776 if (json.has("coverageArea")) { 16777 JsonArray array = json.getAsJsonArray("coverageArea"); 16778 for (int i = 0; i < array.size(); i++) { 16779 res.getCoverageArea().add(parseReference(array.get(i).getAsJsonObject())); 16780 } 16781 } 16782 ; 16783 if (json.has("network")) { 16784 JsonArray array = json.getAsJsonArray("network"); 16785 for (int i = 0; i < array.size(); i++) { 16786 res.getNetwork().add(parseReference(array.get(i).getAsJsonObject())); 16787 } 16788 } 16789 ; 16790 if (json.has("generalCost")) { 16791 JsonArray array = json.getAsJsonArray("generalCost"); 16792 for (int i = 0; i < array.size(); i++) { 16793 res.getGeneralCost() 16794 .add(parseInsurancePlanInsurancePlanPlanGeneralCostComponent(array.get(i).getAsJsonObject(), owner)); 16795 } 16796 } 16797 ; 16798 if (json.has("specificCost")) { 16799 JsonArray array = json.getAsJsonArray("specificCost"); 16800 for (int i = 0; i < array.size(); i++) { 16801 res.getSpecificCost() 16802 .add(parseInsurancePlanInsurancePlanPlanSpecificCostComponent(array.get(i).getAsJsonObject(), owner)); 16803 } 16804 } 16805 ; 16806 } 16807 16808 protected InsurancePlan.InsurancePlanPlanGeneralCostComponent parseInsurancePlanInsurancePlanPlanGeneralCostComponent( 16809 JsonObject json, InsurancePlan owner) throws IOException, FHIRFormatError { 16810 InsurancePlan.InsurancePlanPlanGeneralCostComponent res = new InsurancePlan.InsurancePlanPlanGeneralCostComponent(); 16811 parseInsurancePlanInsurancePlanPlanGeneralCostComponentProperties(json, owner, res); 16812 return res; 16813 } 16814 16815 protected void parseInsurancePlanInsurancePlanPlanGeneralCostComponentProperties(JsonObject json, InsurancePlan owner, 16816 InsurancePlan.InsurancePlanPlanGeneralCostComponent res) throws IOException, FHIRFormatError { 16817 parseBackboneElementProperties(json, res); 16818 if (json.has("type")) 16819 res.setType(parseCodeableConcept(getJObject(json, "type"))); 16820 if (json.has("groupSize")) 16821 res.setGroupSizeElement(parsePositiveInt(json.get("groupSize").getAsString())); 16822 if (json.has("_groupSize")) 16823 parseElementProperties(getJObject(json, "_groupSize"), res.getGroupSizeElement()); 16824 if (json.has("cost")) 16825 res.setCost(parseMoney(getJObject(json, "cost"))); 16826 if (json.has("comment")) 16827 res.setCommentElement(parseString(json.get("comment").getAsString())); 16828 if (json.has("_comment")) 16829 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 16830 } 16831 16832 protected InsurancePlan.InsurancePlanPlanSpecificCostComponent parseInsurancePlanInsurancePlanPlanSpecificCostComponent( 16833 JsonObject json, InsurancePlan owner) throws IOException, FHIRFormatError { 16834 InsurancePlan.InsurancePlanPlanSpecificCostComponent res = new InsurancePlan.InsurancePlanPlanSpecificCostComponent(); 16835 parseInsurancePlanInsurancePlanPlanSpecificCostComponentProperties(json, owner, res); 16836 return res; 16837 } 16838 16839 protected void parseInsurancePlanInsurancePlanPlanSpecificCostComponentProperties(JsonObject json, 16840 InsurancePlan owner, InsurancePlan.InsurancePlanPlanSpecificCostComponent res) 16841 throws IOException, FHIRFormatError { 16842 parseBackboneElementProperties(json, res); 16843 if (json.has("category")) 16844 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 16845 if (json.has("benefit")) { 16846 JsonArray array = json.getAsJsonArray("benefit"); 16847 for (int i = 0; i < array.size(); i++) { 16848 res.getBenefit().add(parseInsurancePlanPlanBenefitComponent(array.get(i).getAsJsonObject(), owner)); 16849 } 16850 } 16851 ; 16852 } 16853 16854 protected InsurancePlan.PlanBenefitComponent parseInsurancePlanPlanBenefitComponent(JsonObject json, 16855 InsurancePlan owner) throws IOException, FHIRFormatError { 16856 InsurancePlan.PlanBenefitComponent res = new InsurancePlan.PlanBenefitComponent(); 16857 parseInsurancePlanPlanBenefitComponentProperties(json, owner, res); 16858 return res; 16859 } 16860 16861 protected void parseInsurancePlanPlanBenefitComponentProperties(JsonObject json, InsurancePlan owner, 16862 InsurancePlan.PlanBenefitComponent res) throws IOException, FHIRFormatError { 16863 parseBackboneElementProperties(json, res); 16864 if (json.has("type")) 16865 res.setType(parseCodeableConcept(getJObject(json, "type"))); 16866 if (json.has("cost")) { 16867 JsonArray array = json.getAsJsonArray("cost"); 16868 for (int i = 0; i < array.size(); i++) { 16869 res.getCost().add(parseInsurancePlanPlanBenefitCostComponent(array.get(i).getAsJsonObject(), owner)); 16870 } 16871 } 16872 ; 16873 } 16874 16875 protected InsurancePlan.PlanBenefitCostComponent parseInsurancePlanPlanBenefitCostComponent(JsonObject json, 16876 InsurancePlan owner) throws IOException, FHIRFormatError { 16877 InsurancePlan.PlanBenefitCostComponent res = new InsurancePlan.PlanBenefitCostComponent(); 16878 parseInsurancePlanPlanBenefitCostComponentProperties(json, owner, res); 16879 return res; 16880 } 16881 16882 protected void parseInsurancePlanPlanBenefitCostComponentProperties(JsonObject json, InsurancePlan owner, 16883 InsurancePlan.PlanBenefitCostComponent res) throws IOException, FHIRFormatError { 16884 parseBackboneElementProperties(json, res); 16885 if (json.has("type")) 16886 res.setType(parseCodeableConcept(getJObject(json, "type"))); 16887 if (json.has("applicability")) 16888 res.setApplicability(parseCodeableConcept(getJObject(json, "applicability"))); 16889 if (json.has("qualifiers")) { 16890 JsonArray array = json.getAsJsonArray("qualifiers"); 16891 for (int i = 0; i < array.size(); i++) { 16892 res.getQualifiers().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 16893 } 16894 } 16895 ; 16896 if (json.has("value")) 16897 res.setValue(parseQuantity(getJObject(json, "value"))); 16898 } 16899 16900 protected Invoice parseInvoice(JsonObject json) throws IOException, FHIRFormatError { 16901 Invoice res = new Invoice(); 16902 parseInvoiceProperties(json, res); 16903 return res; 16904 } 16905 16906 protected void parseInvoiceProperties(JsonObject json, Invoice res) throws IOException, FHIRFormatError { 16907 parseDomainResourceProperties(json, res); 16908 if (json.has("identifier")) { 16909 JsonArray array = json.getAsJsonArray("identifier"); 16910 for (int i = 0; i < array.size(); i++) { 16911 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 16912 } 16913 } 16914 ; 16915 if (json.has("status")) 16916 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Invoice.InvoiceStatus.NULL, 16917 new Invoice.InvoiceStatusEnumFactory())); 16918 if (json.has("_status")) 16919 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 16920 if (json.has("cancelledReason")) 16921 res.setCancelledReasonElement(parseString(json.get("cancelledReason").getAsString())); 16922 if (json.has("_cancelledReason")) 16923 parseElementProperties(getJObject(json, "_cancelledReason"), res.getCancelledReasonElement()); 16924 if (json.has("type")) 16925 res.setType(parseCodeableConcept(getJObject(json, "type"))); 16926 if (json.has("subject")) 16927 res.setSubject(parseReference(getJObject(json, "subject"))); 16928 if (json.has("recipient")) 16929 res.setRecipient(parseReference(getJObject(json, "recipient"))); 16930 if (json.has("date")) 16931 res.setDateElement(parseDateTime(json.get("date").getAsString())); 16932 if (json.has("_date")) 16933 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 16934 if (json.has("participant")) { 16935 JsonArray array = json.getAsJsonArray("participant"); 16936 for (int i = 0; i < array.size(); i++) { 16937 res.getParticipant().add(parseInvoiceInvoiceParticipantComponent(array.get(i).getAsJsonObject(), res)); 16938 } 16939 } 16940 ; 16941 if (json.has("issuer")) 16942 res.setIssuer(parseReference(getJObject(json, "issuer"))); 16943 if (json.has("account")) 16944 res.setAccount(parseReference(getJObject(json, "account"))); 16945 if (json.has("lineItem")) { 16946 JsonArray array = json.getAsJsonArray("lineItem"); 16947 for (int i = 0; i < array.size(); i++) { 16948 res.getLineItem().add(parseInvoiceInvoiceLineItemComponent(array.get(i).getAsJsonObject(), res)); 16949 } 16950 } 16951 ; 16952 if (json.has("totalPriceComponent")) { 16953 JsonArray array = json.getAsJsonArray("totalPriceComponent"); 16954 for (int i = 0; i < array.size(); i++) { 16955 res.getTotalPriceComponent() 16956 .add(parseInvoiceInvoiceLineItemPriceComponentComponent(array.get(i).getAsJsonObject(), res)); 16957 } 16958 } 16959 ; 16960 if (json.has("totalNet")) 16961 res.setTotalNet(parseMoney(getJObject(json, "totalNet"))); 16962 if (json.has("totalGross")) 16963 res.setTotalGross(parseMoney(getJObject(json, "totalGross"))); 16964 if (json.has("paymentTerms")) 16965 res.setPaymentTermsElement(parseMarkdown(json.get("paymentTerms").getAsString())); 16966 if (json.has("_paymentTerms")) 16967 parseElementProperties(getJObject(json, "_paymentTerms"), res.getPaymentTermsElement()); 16968 if (json.has("note")) { 16969 JsonArray array = json.getAsJsonArray("note"); 16970 for (int i = 0; i < array.size(); i++) { 16971 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 16972 } 16973 } 16974 ; 16975 } 16976 16977 protected Invoice.InvoiceParticipantComponent parseInvoiceInvoiceParticipantComponent(JsonObject json, Invoice owner) 16978 throws IOException, FHIRFormatError { 16979 Invoice.InvoiceParticipantComponent res = new Invoice.InvoiceParticipantComponent(); 16980 parseInvoiceInvoiceParticipantComponentProperties(json, owner, res); 16981 return res; 16982 } 16983 16984 protected void parseInvoiceInvoiceParticipantComponentProperties(JsonObject json, Invoice owner, 16985 Invoice.InvoiceParticipantComponent res) throws IOException, FHIRFormatError { 16986 parseBackboneElementProperties(json, res); 16987 if (json.has("role")) 16988 res.setRole(parseCodeableConcept(getJObject(json, "role"))); 16989 if (json.has("actor")) 16990 res.setActor(parseReference(getJObject(json, "actor"))); 16991 } 16992 16993 protected Invoice.InvoiceLineItemComponent parseInvoiceInvoiceLineItemComponent(JsonObject json, Invoice owner) 16994 throws IOException, FHIRFormatError { 16995 Invoice.InvoiceLineItemComponent res = new Invoice.InvoiceLineItemComponent(); 16996 parseInvoiceInvoiceLineItemComponentProperties(json, owner, res); 16997 return res; 16998 } 16999 17000 protected void parseInvoiceInvoiceLineItemComponentProperties(JsonObject json, Invoice owner, 17001 Invoice.InvoiceLineItemComponent res) throws IOException, FHIRFormatError { 17002 parseBackboneElementProperties(json, res); 17003 if (json.has("sequence")) 17004 res.setSequenceElement(parsePositiveInt(json.get("sequence").getAsString())); 17005 if (json.has("_sequence")) 17006 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 17007 Type chargeItem = parseType("chargeItem", json); 17008 if (chargeItem != null) 17009 res.setChargeItem(chargeItem); 17010 if (json.has("priceComponent")) { 17011 JsonArray array = json.getAsJsonArray("priceComponent"); 17012 for (int i = 0; i < array.size(); i++) { 17013 res.getPriceComponent() 17014 .add(parseInvoiceInvoiceLineItemPriceComponentComponent(array.get(i).getAsJsonObject(), owner)); 17015 } 17016 } 17017 ; 17018 } 17019 17020 protected Invoice.InvoiceLineItemPriceComponentComponent parseInvoiceInvoiceLineItemPriceComponentComponent( 17021 JsonObject json, Invoice owner) throws IOException, FHIRFormatError { 17022 Invoice.InvoiceLineItemPriceComponentComponent res = new Invoice.InvoiceLineItemPriceComponentComponent(); 17023 parseInvoiceInvoiceLineItemPriceComponentComponentProperties(json, owner, res); 17024 return res; 17025 } 17026 17027 protected void parseInvoiceInvoiceLineItemPriceComponentComponentProperties(JsonObject json, Invoice owner, 17028 Invoice.InvoiceLineItemPriceComponentComponent res) throws IOException, FHIRFormatError { 17029 parseBackboneElementProperties(json, res); 17030 if (json.has("type")) 17031 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), Invoice.InvoicePriceComponentType.NULL, 17032 new Invoice.InvoicePriceComponentTypeEnumFactory())); 17033 if (json.has("_type")) 17034 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 17035 if (json.has("code")) 17036 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 17037 if (json.has("factor")) 17038 res.setFactorElement(parseDecimal(json.get("factor").getAsBigDecimal())); 17039 if (json.has("_factor")) 17040 parseElementProperties(getJObject(json, "_factor"), res.getFactorElement()); 17041 if (json.has("amount")) 17042 res.setAmount(parseMoney(getJObject(json, "amount"))); 17043 } 17044 17045 protected Library parseLibrary(JsonObject json) throws IOException, FHIRFormatError { 17046 Library res = new Library(); 17047 parseLibraryProperties(json, res); 17048 return res; 17049 } 17050 17051 protected void parseLibraryProperties(JsonObject json, Library res) throws IOException, FHIRFormatError { 17052 parseDomainResourceProperties(json, res); 17053 if (json.has("url")) 17054 res.setUrlElement(parseUri(json.get("url").getAsString())); 17055 if (json.has("_url")) 17056 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 17057 if (json.has("identifier")) { 17058 JsonArray array = json.getAsJsonArray("identifier"); 17059 for (int i = 0; i < array.size(); i++) { 17060 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 17061 } 17062 } 17063 ; 17064 if (json.has("version")) 17065 res.setVersionElement(parseString(json.get("version").getAsString())); 17066 if (json.has("_version")) 17067 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 17068 if (json.has("name")) 17069 res.setNameElement(parseString(json.get("name").getAsString())); 17070 if (json.has("_name")) 17071 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 17072 if (json.has("title")) 17073 res.setTitleElement(parseString(json.get("title").getAsString())); 17074 if (json.has("_title")) 17075 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 17076 if (json.has("subtitle")) 17077 res.setSubtitleElement(parseString(json.get("subtitle").getAsString())); 17078 if (json.has("_subtitle")) 17079 parseElementProperties(getJObject(json, "_subtitle"), res.getSubtitleElement()); 17080 if (json.has("status")) 17081 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 17082 new Enumerations.PublicationStatusEnumFactory())); 17083 if (json.has("_status")) 17084 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 17085 if (json.has("experimental")) 17086 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 17087 if (json.has("_experimental")) 17088 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 17089 if (json.has("type")) 17090 res.setType(parseCodeableConcept(getJObject(json, "type"))); 17091 Type subject = parseType("subject", json); 17092 if (subject != null) 17093 res.setSubject(subject); 17094 if (json.has("date")) 17095 res.setDateElement(parseDateTime(json.get("date").getAsString())); 17096 if (json.has("_date")) 17097 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 17098 if (json.has("publisher")) 17099 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 17100 if (json.has("_publisher")) 17101 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 17102 if (json.has("contact")) { 17103 JsonArray array = json.getAsJsonArray("contact"); 17104 for (int i = 0; i < array.size(); i++) { 17105 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 17106 } 17107 } 17108 ; 17109 if (json.has("description")) 17110 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 17111 if (json.has("_description")) 17112 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 17113 if (json.has("useContext")) { 17114 JsonArray array = json.getAsJsonArray("useContext"); 17115 for (int i = 0; i < array.size(); i++) { 17116 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 17117 } 17118 } 17119 ; 17120 if (json.has("jurisdiction")) { 17121 JsonArray array = json.getAsJsonArray("jurisdiction"); 17122 for (int i = 0; i < array.size(); i++) { 17123 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 17124 } 17125 } 17126 ; 17127 if (json.has("purpose")) 17128 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 17129 if (json.has("_purpose")) 17130 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 17131 if (json.has("usage")) 17132 res.setUsageElement(parseString(json.get("usage").getAsString())); 17133 if (json.has("_usage")) 17134 parseElementProperties(getJObject(json, "_usage"), res.getUsageElement()); 17135 if (json.has("copyright")) 17136 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 17137 if (json.has("_copyright")) 17138 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 17139 if (json.has("approvalDate")) 17140 res.setApprovalDateElement(parseDate(json.get("approvalDate").getAsString())); 17141 if (json.has("_approvalDate")) 17142 parseElementProperties(getJObject(json, "_approvalDate"), res.getApprovalDateElement()); 17143 if (json.has("lastReviewDate")) 17144 res.setLastReviewDateElement(parseDate(json.get("lastReviewDate").getAsString())); 17145 if (json.has("_lastReviewDate")) 17146 parseElementProperties(getJObject(json, "_lastReviewDate"), res.getLastReviewDateElement()); 17147 if (json.has("effectivePeriod")) 17148 res.setEffectivePeriod(parsePeriod(getJObject(json, "effectivePeriod"))); 17149 if (json.has("topic")) { 17150 JsonArray array = json.getAsJsonArray("topic"); 17151 for (int i = 0; i < array.size(); i++) { 17152 res.getTopic().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 17153 } 17154 } 17155 ; 17156 if (json.has("author")) { 17157 JsonArray array = json.getAsJsonArray("author"); 17158 for (int i = 0; i < array.size(); i++) { 17159 res.getAuthor().add(parseContactDetail(array.get(i).getAsJsonObject())); 17160 } 17161 } 17162 ; 17163 if (json.has("editor")) { 17164 JsonArray array = json.getAsJsonArray("editor"); 17165 for (int i = 0; i < array.size(); i++) { 17166 res.getEditor().add(parseContactDetail(array.get(i).getAsJsonObject())); 17167 } 17168 } 17169 ; 17170 if (json.has("reviewer")) { 17171 JsonArray array = json.getAsJsonArray("reviewer"); 17172 for (int i = 0; i < array.size(); i++) { 17173 res.getReviewer().add(parseContactDetail(array.get(i).getAsJsonObject())); 17174 } 17175 } 17176 ; 17177 if (json.has("endorser")) { 17178 JsonArray array = json.getAsJsonArray("endorser"); 17179 for (int i = 0; i < array.size(); i++) { 17180 res.getEndorser().add(parseContactDetail(array.get(i).getAsJsonObject())); 17181 } 17182 } 17183 ; 17184 if (json.has("relatedArtifact")) { 17185 JsonArray array = json.getAsJsonArray("relatedArtifact"); 17186 for (int i = 0; i < array.size(); i++) { 17187 res.getRelatedArtifact().add(parseRelatedArtifact(array.get(i).getAsJsonObject())); 17188 } 17189 } 17190 ; 17191 if (json.has("parameter")) { 17192 JsonArray array = json.getAsJsonArray("parameter"); 17193 for (int i = 0; i < array.size(); i++) { 17194 res.getParameter().add(parseParameterDefinition(array.get(i).getAsJsonObject())); 17195 } 17196 } 17197 ; 17198 if (json.has("dataRequirement")) { 17199 JsonArray array = json.getAsJsonArray("dataRequirement"); 17200 for (int i = 0; i < array.size(); i++) { 17201 res.getDataRequirement().add(parseDataRequirement(array.get(i).getAsJsonObject())); 17202 } 17203 } 17204 ; 17205 if (json.has("content")) { 17206 JsonArray array = json.getAsJsonArray("content"); 17207 for (int i = 0; i < array.size(); i++) { 17208 res.getContent().add(parseAttachment(array.get(i).getAsJsonObject())); 17209 } 17210 } 17211 ; 17212 } 17213 17214 protected Linkage parseLinkage(JsonObject json) throws IOException, FHIRFormatError { 17215 Linkage res = new Linkage(); 17216 parseLinkageProperties(json, res); 17217 return res; 17218 } 17219 17220 protected void parseLinkageProperties(JsonObject json, Linkage res) throws IOException, FHIRFormatError { 17221 parseDomainResourceProperties(json, res); 17222 if (json.has("active")) 17223 res.setActiveElement(parseBoolean(json.get("active").getAsBoolean())); 17224 if (json.has("_active")) 17225 parseElementProperties(getJObject(json, "_active"), res.getActiveElement()); 17226 if (json.has("author")) 17227 res.setAuthor(parseReference(getJObject(json, "author"))); 17228 if (json.has("item")) { 17229 JsonArray array = json.getAsJsonArray("item"); 17230 for (int i = 0; i < array.size(); i++) { 17231 res.getItem().add(parseLinkageLinkageItemComponent(array.get(i).getAsJsonObject(), res)); 17232 } 17233 } 17234 ; 17235 } 17236 17237 protected Linkage.LinkageItemComponent parseLinkageLinkageItemComponent(JsonObject json, Linkage owner) 17238 throws IOException, FHIRFormatError { 17239 Linkage.LinkageItemComponent res = new Linkage.LinkageItemComponent(); 17240 parseLinkageLinkageItemComponentProperties(json, owner, res); 17241 return res; 17242 } 17243 17244 protected void parseLinkageLinkageItemComponentProperties(JsonObject json, Linkage owner, 17245 Linkage.LinkageItemComponent res) throws IOException, FHIRFormatError { 17246 parseBackboneElementProperties(json, res); 17247 if (json.has("type")) 17248 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), Linkage.LinkageType.NULL, 17249 new Linkage.LinkageTypeEnumFactory())); 17250 if (json.has("_type")) 17251 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 17252 if (json.has("resource")) 17253 res.setResource(parseReference(getJObject(json, "resource"))); 17254 } 17255 17256 protected ListResource parseListResource(JsonObject json) throws IOException, FHIRFormatError { 17257 ListResource res = new ListResource(); 17258 parseListResourceProperties(json, res); 17259 return res; 17260 } 17261 17262 protected void parseListResourceProperties(JsonObject json, ListResource res) throws IOException, FHIRFormatError { 17263 parseDomainResourceProperties(json, res); 17264 if (json.has("identifier")) { 17265 JsonArray array = json.getAsJsonArray("identifier"); 17266 for (int i = 0; i < array.size(); i++) { 17267 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 17268 } 17269 } 17270 ; 17271 if (json.has("status")) 17272 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), ListResource.ListStatus.NULL, 17273 new ListResource.ListStatusEnumFactory())); 17274 if (json.has("_status")) 17275 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 17276 if (json.has("mode")) 17277 res.setModeElement(parseEnumeration(json.get("mode").getAsString(), ListResource.ListMode.NULL, 17278 new ListResource.ListModeEnumFactory())); 17279 if (json.has("_mode")) 17280 parseElementProperties(getJObject(json, "_mode"), res.getModeElement()); 17281 if (json.has("title")) 17282 res.setTitleElement(parseString(json.get("title").getAsString())); 17283 if (json.has("_title")) 17284 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 17285 if (json.has("code")) 17286 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 17287 if (json.has("subject")) 17288 res.setSubject(parseReference(getJObject(json, "subject"))); 17289 if (json.has("encounter")) 17290 res.setEncounter(parseReference(getJObject(json, "encounter"))); 17291 if (json.has("date")) 17292 res.setDateElement(parseDateTime(json.get("date").getAsString())); 17293 if (json.has("_date")) 17294 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 17295 if (json.has("source")) 17296 res.setSource(parseReference(getJObject(json, "source"))); 17297 if (json.has("orderedBy")) 17298 res.setOrderedBy(parseCodeableConcept(getJObject(json, "orderedBy"))); 17299 if (json.has("note")) { 17300 JsonArray array = json.getAsJsonArray("note"); 17301 for (int i = 0; i < array.size(); i++) { 17302 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 17303 } 17304 } 17305 ; 17306 if (json.has("entry")) { 17307 JsonArray array = json.getAsJsonArray("entry"); 17308 for (int i = 0; i < array.size(); i++) { 17309 res.getEntry().add(parseListResourceListEntryComponent(array.get(i).getAsJsonObject(), res)); 17310 } 17311 } 17312 ; 17313 if (json.has("emptyReason")) 17314 res.setEmptyReason(parseCodeableConcept(getJObject(json, "emptyReason"))); 17315 } 17316 17317 protected ListResource.ListEntryComponent parseListResourceListEntryComponent(JsonObject json, ListResource owner) 17318 throws IOException, FHIRFormatError { 17319 ListResource.ListEntryComponent res = new ListResource.ListEntryComponent(); 17320 parseListResourceListEntryComponentProperties(json, owner, res); 17321 return res; 17322 } 17323 17324 protected void parseListResourceListEntryComponentProperties(JsonObject json, ListResource owner, 17325 ListResource.ListEntryComponent res) throws IOException, FHIRFormatError { 17326 parseBackboneElementProperties(json, res); 17327 if (json.has("flag")) 17328 res.setFlag(parseCodeableConcept(getJObject(json, "flag"))); 17329 if (json.has("deleted")) 17330 res.setDeletedElement(parseBoolean(json.get("deleted").getAsBoolean())); 17331 if (json.has("_deleted")) 17332 parseElementProperties(getJObject(json, "_deleted"), res.getDeletedElement()); 17333 if (json.has("date")) 17334 res.setDateElement(parseDateTime(json.get("date").getAsString())); 17335 if (json.has("_date")) 17336 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 17337 if (json.has("item")) 17338 res.setItem(parseReference(getJObject(json, "item"))); 17339 } 17340 17341 protected Location parseLocation(JsonObject json) throws IOException, FHIRFormatError { 17342 Location res = new Location(); 17343 parseLocationProperties(json, res); 17344 return res; 17345 } 17346 17347 protected void parseLocationProperties(JsonObject json, Location res) throws IOException, FHIRFormatError { 17348 parseDomainResourceProperties(json, res); 17349 if (json.has("identifier")) { 17350 JsonArray array = json.getAsJsonArray("identifier"); 17351 for (int i = 0; i < array.size(); i++) { 17352 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 17353 } 17354 } 17355 ; 17356 if (json.has("status")) 17357 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Location.LocationStatus.NULL, 17358 new Location.LocationStatusEnumFactory())); 17359 if (json.has("_status")) 17360 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 17361 if (json.has("operationalStatus")) 17362 res.setOperationalStatus(parseCoding(getJObject(json, "operationalStatus"))); 17363 if (json.has("name")) 17364 res.setNameElement(parseString(json.get("name").getAsString())); 17365 if (json.has("_name")) 17366 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 17367 if (json.has("alias")) { 17368 JsonArray array = json.getAsJsonArray("alias"); 17369 for (int i = 0; i < array.size(); i++) { 17370 if (array.get(i).isJsonNull()) { 17371 res.getAlias().add(new StringType()); 17372 } else { 17373 res.getAlias().add(parseString(array.get(i).getAsString())); 17374 } 17375 } 17376 } 17377 ; 17378 if (json.has("_alias")) { 17379 JsonArray array = json.getAsJsonArray("_alias"); 17380 for (int i = 0; i < array.size(); i++) { 17381 if (i == res.getAlias().size()) 17382 res.getAlias().add(parseString(null)); 17383 if (array.get(i) instanceof JsonObject) 17384 parseElementProperties(array.get(i).getAsJsonObject(), res.getAlias().get(i)); 17385 } 17386 } 17387 ; 17388 if (json.has("description")) 17389 res.setDescriptionElement(parseString(json.get("description").getAsString())); 17390 if (json.has("_description")) 17391 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 17392 if (json.has("mode")) 17393 res.setModeElement(parseEnumeration(json.get("mode").getAsString(), Location.LocationMode.NULL, 17394 new Location.LocationModeEnumFactory())); 17395 if (json.has("_mode")) 17396 parseElementProperties(getJObject(json, "_mode"), res.getModeElement()); 17397 if (json.has("type")) { 17398 JsonArray array = json.getAsJsonArray("type"); 17399 for (int i = 0; i < array.size(); i++) { 17400 res.getType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 17401 } 17402 } 17403 ; 17404 if (json.has("telecom")) { 17405 JsonArray array = json.getAsJsonArray("telecom"); 17406 for (int i = 0; i < array.size(); i++) { 17407 res.getTelecom().add(parseContactPoint(array.get(i).getAsJsonObject())); 17408 } 17409 } 17410 ; 17411 if (json.has("address")) 17412 res.setAddress(parseAddress(getJObject(json, "address"))); 17413 if (json.has("physicalType")) 17414 res.setPhysicalType(parseCodeableConcept(getJObject(json, "physicalType"))); 17415 if (json.has("position")) 17416 res.setPosition(parseLocationLocationPositionComponent(getJObject(json, "position"), res)); 17417 if (json.has("managingOrganization")) 17418 res.setManagingOrganization(parseReference(getJObject(json, "managingOrganization"))); 17419 if (json.has("partOf")) 17420 res.setPartOf(parseReference(getJObject(json, "partOf"))); 17421 if (json.has("hoursOfOperation")) { 17422 JsonArray array = json.getAsJsonArray("hoursOfOperation"); 17423 for (int i = 0; i < array.size(); i++) { 17424 res.getHoursOfOperation() 17425 .add(parseLocationLocationHoursOfOperationComponent(array.get(i).getAsJsonObject(), res)); 17426 } 17427 } 17428 ; 17429 if (json.has("availabilityExceptions")) 17430 res.setAvailabilityExceptionsElement(parseString(json.get("availabilityExceptions").getAsString())); 17431 if (json.has("_availabilityExceptions")) 17432 parseElementProperties(getJObject(json, "_availabilityExceptions"), res.getAvailabilityExceptionsElement()); 17433 if (json.has("endpoint")) { 17434 JsonArray array = json.getAsJsonArray("endpoint"); 17435 for (int i = 0; i < array.size(); i++) { 17436 res.getEndpoint().add(parseReference(array.get(i).getAsJsonObject())); 17437 } 17438 } 17439 ; 17440 } 17441 17442 protected Location.LocationPositionComponent parseLocationLocationPositionComponent(JsonObject json, Location owner) 17443 throws IOException, FHIRFormatError { 17444 Location.LocationPositionComponent res = new Location.LocationPositionComponent(); 17445 parseLocationLocationPositionComponentProperties(json, owner, res); 17446 return res; 17447 } 17448 17449 protected void parseLocationLocationPositionComponentProperties(JsonObject json, Location owner, 17450 Location.LocationPositionComponent res) throws IOException, FHIRFormatError { 17451 parseBackboneElementProperties(json, res); 17452 if (json.has("longitude")) 17453 res.setLongitudeElement(parseDecimal(json.get("longitude").getAsBigDecimal())); 17454 if (json.has("_longitude")) 17455 parseElementProperties(getJObject(json, "_longitude"), res.getLongitudeElement()); 17456 if (json.has("latitude")) 17457 res.setLatitudeElement(parseDecimal(json.get("latitude").getAsBigDecimal())); 17458 if (json.has("_latitude")) 17459 parseElementProperties(getJObject(json, "_latitude"), res.getLatitudeElement()); 17460 if (json.has("altitude")) 17461 res.setAltitudeElement(parseDecimal(json.get("altitude").getAsBigDecimal())); 17462 if (json.has("_altitude")) 17463 parseElementProperties(getJObject(json, "_altitude"), res.getAltitudeElement()); 17464 } 17465 17466 protected Location.LocationHoursOfOperationComponent parseLocationLocationHoursOfOperationComponent(JsonObject json, 17467 Location owner) throws IOException, FHIRFormatError { 17468 Location.LocationHoursOfOperationComponent res = new Location.LocationHoursOfOperationComponent(); 17469 parseLocationLocationHoursOfOperationComponentProperties(json, owner, res); 17470 return res; 17471 } 17472 17473 protected void parseLocationLocationHoursOfOperationComponentProperties(JsonObject json, Location owner, 17474 Location.LocationHoursOfOperationComponent res) throws IOException, FHIRFormatError { 17475 parseBackboneElementProperties(json, res); 17476 if (json.has("daysOfWeek")) { 17477 JsonArray array = json.getAsJsonArray("daysOfWeek"); 17478 for (int i = 0; i < array.size(); i++) { 17479 if (array.get(i).isJsonNull()) { 17480 res.getDaysOfWeek().add(new Enumeration<Location.DaysOfWeek>()); 17481 } else { 17482 res.getDaysOfWeek().add(parseEnumeration(array.get(i).getAsString(), Location.DaysOfWeek.NULL, 17483 new Location.DaysOfWeekEnumFactory())); 17484 } 17485 } 17486 } 17487 ; 17488 if (json.has("_daysOfWeek")) { 17489 JsonArray array = json.getAsJsonArray("_daysOfWeek"); 17490 for (int i = 0; i < array.size(); i++) { 17491 if (i == res.getDaysOfWeek().size()) 17492 res.getDaysOfWeek() 17493 .add(parseEnumeration(null, Location.DaysOfWeek.NULL, new Location.DaysOfWeekEnumFactory())); 17494 if (array.get(i) instanceof JsonObject) 17495 parseElementProperties(array.get(i).getAsJsonObject(), res.getDaysOfWeek().get(i)); 17496 } 17497 } 17498 ; 17499 if (json.has("allDay")) 17500 res.setAllDayElement(parseBoolean(json.get("allDay").getAsBoolean())); 17501 if (json.has("_allDay")) 17502 parseElementProperties(getJObject(json, "_allDay"), res.getAllDayElement()); 17503 if (json.has("openingTime")) 17504 res.setOpeningTimeElement(parseTime(json.get("openingTime").getAsString())); 17505 if (json.has("_openingTime")) 17506 parseElementProperties(getJObject(json, "_openingTime"), res.getOpeningTimeElement()); 17507 if (json.has("closingTime")) 17508 res.setClosingTimeElement(parseTime(json.get("closingTime").getAsString())); 17509 if (json.has("_closingTime")) 17510 parseElementProperties(getJObject(json, "_closingTime"), res.getClosingTimeElement()); 17511 } 17512 17513 protected Measure parseMeasure(JsonObject json) throws IOException, FHIRFormatError { 17514 Measure res = new Measure(); 17515 parseMeasureProperties(json, res); 17516 return res; 17517 } 17518 17519 protected void parseMeasureProperties(JsonObject json, Measure res) throws IOException, FHIRFormatError { 17520 parseDomainResourceProperties(json, res); 17521 if (json.has("url")) 17522 res.setUrlElement(parseUri(json.get("url").getAsString())); 17523 if (json.has("_url")) 17524 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 17525 if (json.has("identifier")) { 17526 JsonArray array = json.getAsJsonArray("identifier"); 17527 for (int i = 0; i < array.size(); i++) { 17528 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 17529 } 17530 } 17531 ; 17532 if (json.has("version")) 17533 res.setVersionElement(parseString(json.get("version").getAsString())); 17534 if (json.has("_version")) 17535 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 17536 if (json.has("name")) 17537 res.setNameElement(parseString(json.get("name").getAsString())); 17538 if (json.has("_name")) 17539 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 17540 if (json.has("title")) 17541 res.setTitleElement(parseString(json.get("title").getAsString())); 17542 if (json.has("_title")) 17543 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 17544 if (json.has("subtitle")) 17545 res.setSubtitleElement(parseString(json.get("subtitle").getAsString())); 17546 if (json.has("_subtitle")) 17547 parseElementProperties(getJObject(json, "_subtitle"), res.getSubtitleElement()); 17548 if (json.has("status")) 17549 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 17550 new Enumerations.PublicationStatusEnumFactory())); 17551 if (json.has("_status")) 17552 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 17553 if (json.has("experimental")) 17554 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 17555 if (json.has("_experimental")) 17556 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 17557 Type subject = parseType("subject", json); 17558 if (subject != null) 17559 res.setSubject(subject); 17560 if (json.has("date")) 17561 res.setDateElement(parseDateTime(json.get("date").getAsString())); 17562 if (json.has("_date")) 17563 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 17564 if (json.has("publisher")) 17565 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 17566 if (json.has("_publisher")) 17567 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 17568 if (json.has("contact")) { 17569 JsonArray array = json.getAsJsonArray("contact"); 17570 for (int i = 0; i < array.size(); i++) { 17571 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 17572 } 17573 } 17574 ; 17575 if (json.has("description")) 17576 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 17577 if (json.has("_description")) 17578 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 17579 if (json.has("useContext")) { 17580 JsonArray array = json.getAsJsonArray("useContext"); 17581 for (int i = 0; i < array.size(); i++) { 17582 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 17583 } 17584 } 17585 ; 17586 if (json.has("jurisdiction")) { 17587 JsonArray array = json.getAsJsonArray("jurisdiction"); 17588 for (int i = 0; i < array.size(); i++) { 17589 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 17590 } 17591 } 17592 ; 17593 if (json.has("purpose")) 17594 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 17595 if (json.has("_purpose")) 17596 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 17597 if (json.has("usage")) 17598 res.setUsageElement(parseString(json.get("usage").getAsString())); 17599 if (json.has("_usage")) 17600 parseElementProperties(getJObject(json, "_usage"), res.getUsageElement()); 17601 if (json.has("copyright")) 17602 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 17603 if (json.has("_copyright")) 17604 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 17605 if (json.has("approvalDate")) 17606 res.setApprovalDateElement(parseDate(json.get("approvalDate").getAsString())); 17607 if (json.has("_approvalDate")) 17608 parseElementProperties(getJObject(json, "_approvalDate"), res.getApprovalDateElement()); 17609 if (json.has("lastReviewDate")) 17610 res.setLastReviewDateElement(parseDate(json.get("lastReviewDate").getAsString())); 17611 if (json.has("_lastReviewDate")) 17612 parseElementProperties(getJObject(json, "_lastReviewDate"), res.getLastReviewDateElement()); 17613 if (json.has("effectivePeriod")) 17614 res.setEffectivePeriod(parsePeriod(getJObject(json, "effectivePeriod"))); 17615 if (json.has("topic")) { 17616 JsonArray array = json.getAsJsonArray("topic"); 17617 for (int i = 0; i < array.size(); i++) { 17618 res.getTopic().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 17619 } 17620 } 17621 ; 17622 if (json.has("author")) { 17623 JsonArray array = json.getAsJsonArray("author"); 17624 for (int i = 0; i < array.size(); i++) { 17625 res.getAuthor().add(parseContactDetail(array.get(i).getAsJsonObject())); 17626 } 17627 } 17628 ; 17629 if (json.has("editor")) { 17630 JsonArray array = json.getAsJsonArray("editor"); 17631 for (int i = 0; i < array.size(); i++) { 17632 res.getEditor().add(parseContactDetail(array.get(i).getAsJsonObject())); 17633 } 17634 } 17635 ; 17636 if (json.has("reviewer")) { 17637 JsonArray array = json.getAsJsonArray("reviewer"); 17638 for (int i = 0; i < array.size(); i++) { 17639 res.getReviewer().add(parseContactDetail(array.get(i).getAsJsonObject())); 17640 } 17641 } 17642 ; 17643 if (json.has("endorser")) { 17644 JsonArray array = json.getAsJsonArray("endorser"); 17645 for (int i = 0; i < array.size(); i++) { 17646 res.getEndorser().add(parseContactDetail(array.get(i).getAsJsonObject())); 17647 } 17648 } 17649 ; 17650 if (json.has("relatedArtifact")) { 17651 JsonArray array = json.getAsJsonArray("relatedArtifact"); 17652 for (int i = 0; i < array.size(); i++) { 17653 res.getRelatedArtifact().add(parseRelatedArtifact(array.get(i).getAsJsonObject())); 17654 } 17655 } 17656 ; 17657 if (json.has("library")) { 17658 JsonArray array = json.getAsJsonArray("library"); 17659 for (int i = 0; i < array.size(); i++) { 17660 if (array.get(i).isJsonNull()) { 17661 res.getLibrary().add(new CanonicalType()); 17662 } else { 17663 res.getLibrary().add(parseCanonical(array.get(i).getAsString())); 17664 } 17665 } 17666 } 17667 ; 17668 if (json.has("_library")) { 17669 JsonArray array = json.getAsJsonArray("_library"); 17670 for (int i = 0; i < array.size(); i++) { 17671 if (i == res.getLibrary().size()) 17672 res.getLibrary().add(parseCanonical(null)); 17673 if (array.get(i) instanceof JsonObject) 17674 parseElementProperties(array.get(i).getAsJsonObject(), res.getLibrary().get(i)); 17675 } 17676 } 17677 ; 17678 if (json.has("disclaimer")) 17679 res.setDisclaimerElement(parseMarkdown(json.get("disclaimer").getAsString())); 17680 if (json.has("_disclaimer")) 17681 parseElementProperties(getJObject(json, "_disclaimer"), res.getDisclaimerElement()); 17682 if (json.has("scoring")) 17683 res.setScoring(parseCodeableConcept(getJObject(json, "scoring"))); 17684 if (json.has("compositeScoring")) 17685 res.setCompositeScoring(parseCodeableConcept(getJObject(json, "compositeScoring"))); 17686 if (json.has("type")) { 17687 JsonArray array = json.getAsJsonArray("type"); 17688 for (int i = 0; i < array.size(); i++) { 17689 res.getType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 17690 } 17691 } 17692 ; 17693 if (json.has("riskAdjustment")) 17694 res.setRiskAdjustmentElement(parseString(json.get("riskAdjustment").getAsString())); 17695 if (json.has("_riskAdjustment")) 17696 parseElementProperties(getJObject(json, "_riskAdjustment"), res.getRiskAdjustmentElement()); 17697 if (json.has("rateAggregation")) 17698 res.setRateAggregationElement(parseString(json.get("rateAggregation").getAsString())); 17699 if (json.has("_rateAggregation")) 17700 parseElementProperties(getJObject(json, "_rateAggregation"), res.getRateAggregationElement()); 17701 if (json.has("rationale")) 17702 res.setRationaleElement(parseMarkdown(json.get("rationale").getAsString())); 17703 if (json.has("_rationale")) 17704 parseElementProperties(getJObject(json, "_rationale"), res.getRationaleElement()); 17705 if (json.has("clinicalRecommendationStatement")) 17706 res.setClinicalRecommendationStatementElement( 17707 parseMarkdown(json.get("clinicalRecommendationStatement").getAsString())); 17708 if (json.has("_clinicalRecommendationStatement")) 17709 parseElementProperties(getJObject(json, "_clinicalRecommendationStatement"), 17710 res.getClinicalRecommendationStatementElement()); 17711 if (json.has("improvementNotation")) 17712 res.setImprovementNotation(parseCodeableConcept(getJObject(json, "improvementNotation"))); 17713 if (json.has("definition")) { 17714 JsonArray array = json.getAsJsonArray("definition"); 17715 for (int i = 0; i < array.size(); i++) { 17716 if (array.get(i).isJsonNull()) { 17717 res.getDefinition().add(new MarkdownType()); 17718 } else { 17719 res.getDefinition().add(parseMarkdown(array.get(i).getAsString())); 17720 } 17721 } 17722 } 17723 ; 17724 if (json.has("_definition")) { 17725 JsonArray array = json.getAsJsonArray("_definition"); 17726 for (int i = 0; i < array.size(); i++) { 17727 if (i == res.getDefinition().size()) 17728 res.getDefinition().add(parseMarkdown(null)); 17729 if (array.get(i) instanceof JsonObject) 17730 parseElementProperties(array.get(i).getAsJsonObject(), res.getDefinition().get(i)); 17731 } 17732 } 17733 ; 17734 if (json.has("guidance")) 17735 res.setGuidanceElement(parseMarkdown(json.get("guidance").getAsString())); 17736 if (json.has("_guidance")) 17737 parseElementProperties(getJObject(json, "_guidance"), res.getGuidanceElement()); 17738 if (json.has("group")) { 17739 JsonArray array = json.getAsJsonArray("group"); 17740 for (int i = 0; i < array.size(); i++) { 17741 res.getGroup().add(parseMeasureMeasureGroupComponent(array.get(i).getAsJsonObject(), res)); 17742 } 17743 } 17744 ; 17745 if (json.has("supplementalData")) { 17746 JsonArray array = json.getAsJsonArray("supplementalData"); 17747 for (int i = 0; i < array.size(); i++) { 17748 res.getSupplementalData() 17749 .add(parseMeasureMeasureSupplementalDataComponent(array.get(i).getAsJsonObject(), res)); 17750 } 17751 } 17752 ; 17753 } 17754 17755 protected Measure.MeasureGroupComponent parseMeasureMeasureGroupComponent(JsonObject json, Measure owner) 17756 throws IOException, FHIRFormatError { 17757 Measure.MeasureGroupComponent res = new Measure.MeasureGroupComponent(); 17758 parseMeasureMeasureGroupComponentProperties(json, owner, res); 17759 return res; 17760 } 17761 17762 protected void parseMeasureMeasureGroupComponentProperties(JsonObject json, Measure owner, 17763 Measure.MeasureGroupComponent res) throws IOException, FHIRFormatError { 17764 parseBackboneElementProperties(json, res); 17765 if (json.has("code")) 17766 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 17767 if (json.has("description")) 17768 res.setDescriptionElement(parseString(json.get("description").getAsString())); 17769 if (json.has("_description")) 17770 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 17771 if (json.has("population")) { 17772 JsonArray array = json.getAsJsonArray("population"); 17773 for (int i = 0; i < array.size(); i++) { 17774 res.getPopulation().add(parseMeasureMeasureGroupPopulationComponent(array.get(i).getAsJsonObject(), owner)); 17775 } 17776 } 17777 ; 17778 if (json.has("stratifier")) { 17779 JsonArray array = json.getAsJsonArray("stratifier"); 17780 for (int i = 0; i < array.size(); i++) { 17781 res.getStratifier().add(parseMeasureMeasureGroupStratifierComponent(array.get(i).getAsJsonObject(), owner)); 17782 } 17783 } 17784 ; 17785 } 17786 17787 protected Measure.MeasureGroupPopulationComponent parseMeasureMeasureGroupPopulationComponent(JsonObject json, 17788 Measure owner) throws IOException, FHIRFormatError { 17789 Measure.MeasureGroupPopulationComponent res = new Measure.MeasureGroupPopulationComponent(); 17790 parseMeasureMeasureGroupPopulationComponentProperties(json, owner, res); 17791 return res; 17792 } 17793 17794 protected void parseMeasureMeasureGroupPopulationComponentProperties(JsonObject json, Measure owner, 17795 Measure.MeasureGroupPopulationComponent res) throws IOException, FHIRFormatError { 17796 parseBackboneElementProperties(json, res); 17797 if (json.has("code")) 17798 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 17799 if (json.has("description")) 17800 res.setDescriptionElement(parseString(json.get("description").getAsString())); 17801 if (json.has("_description")) 17802 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 17803 if (json.has("criteria")) 17804 res.setCriteria(parseExpression(getJObject(json, "criteria"))); 17805 } 17806 17807 protected Measure.MeasureGroupStratifierComponent parseMeasureMeasureGroupStratifierComponent(JsonObject json, 17808 Measure owner) throws IOException, FHIRFormatError { 17809 Measure.MeasureGroupStratifierComponent res = new Measure.MeasureGroupStratifierComponent(); 17810 parseMeasureMeasureGroupStratifierComponentProperties(json, owner, res); 17811 return res; 17812 } 17813 17814 protected void parseMeasureMeasureGroupStratifierComponentProperties(JsonObject json, Measure owner, 17815 Measure.MeasureGroupStratifierComponent res) throws IOException, FHIRFormatError { 17816 parseBackboneElementProperties(json, res); 17817 if (json.has("code")) 17818 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 17819 if (json.has("description")) 17820 res.setDescriptionElement(parseString(json.get("description").getAsString())); 17821 if (json.has("_description")) 17822 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 17823 if (json.has("criteria")) 17824 res.setCriteria(parseExpression(getJObject(json, "criteria"))); 17825 if (json.has("component")) { 17826 JsonArray array = json.getAsJsonArray("component"); 17827 for (int i = 0; i < array.size(); i++) { 17828 res.getComponent() 17829 .add(parseMeasureMeasureGroupStratifierComponentComponent(array.get(i).getAsJsonObject(), owner)); 17830 } 17831 } 17832 ; 17833 } 17834 17835 protected Measure.MeasureGroupStratifierComponentComponent parseMeasureMeasureGroupStratifierComponentComponent( 17836 JsonObject json, Measure owner) throws IOException, FHIRFormatError { 17837 Measure.MeasureGroupStratifierComponentComponent res = new Measure.MeasureGroupStratifierComponentComponent(); 17838 parseMeasureMeasureGroupStratifierComponentComponentProperties(json, owner, res); 17839 return res; 17840 } 17841 17842 protected void parseMeasureMeasureGroupStratifierComponentComponentProperties(JsonObject json, Measure owner, 17843 Measure.MeasureGroupStratifierComponentComponent res) throws IOException, FHIRFormatError { 17844 parseBackboneElementProperties(json, res); 17845 if (json.has("code")) 17846 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 17847 if (json.has("description")) 17848 res.setDescriptionElement(parseString(json.get("description").getAsString())); 17849 if (json.has("_description")) 17850 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 17851 if (json.has("criteria")) 17852 res.setCriteria(parseExpression(getJObject(json, "criteria"))); 17853 } 17854 17855 protected Measure.MeasureSupplementalDataComponent parseMeasureMeasureSupplementalDataComponent(JsonObject json, 17856 Measure owner) throws IOException, FHIRFormatError { 17857 Measure.MeasureSupplementalDataComponent res = new Measure.MeasureSupplementalDataComponent(); 17858 parseMeasureMeasureSupplementalDataComponentProperties(json, owner, res); 17859 return res; 17860 } 17861 17862 protected void parseMeasureMeasureSupplementalDataComponentProperties(JsonObject json, Measure owner, 17863 Measure.MeasureSupplementalDataComponent res) throws IOException, FHIRFormatError { 17864 parseBackboneElementProperties(json, res); 17865 if (json.has("code")) 17866 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 17867 if (json.has("usage")) { 17868 JsonArray array = json.getAsJsonArray("usage"); 17869 for (int i = 0; i < array.size(); i++) { 17870 res.getUsage().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 17871 } 17872 } 17873 ; 17874 if (json.has("description")) 17875 res.setDescriptionElement(parseString(json.get("description").getAsString())); 17876 if (json.has("_description")) 17877 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 17878 if (json.has("criteria")) 17879 res.setCriteria(parseExpression(getJObject(json, "criteria"))); 17880 } 17881 17882 protected MeasureReport parseMeasureReport(JsonObject json) throws IOException, FHIRFormatError { 17883 MeasureReport res = new MeasureReport(); 17884 parseMeasureReportProperties(json, res); 17885 return res; 17886 } 17887 17888 protected void parseMeasureReportProperties(JsonObject json, MeasureReport res) throws IOException, FHIRFormatError { 17889 parseDomainResourceProperties(json, res); 17890 if (json.has("identifier")) { 17891 JsonArray array = json.getAsJsonArray("identifier"); 17892 for (int i = 0; i < array.size(); i++) { 17893 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 17894 } 17895 } 17896 ; 17897 if (json.has("status")) 17898 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), MeasureReport.MeasureReportStatus.NULL, 17899 new MeasureReport.MeasureReportStatusEnumFactory())); 17900 if (json.has("_status")) 17901 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 17902 if (json.has("type")) 17903 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), MeasureReport.MeasureReportType.NULL, 17904 new MeasureReport.MeasureReportTypeEnumFactory())); 17905 if (json.has("_type")) 17906 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 17907 if (json.has("measure")) 17908 res.setMeasureElement(parseCanonical(json.get("measure").getAsString())); 17909 if (json.has("_measure")) 17910 parseElementProperties(getJObject(json, "_measure"), res.getMeasureElement()); 17911 if (json.has("subject")) 17912 res.setSubject(parseReference(getJObject(json, "subject"))); 17913 if (json.has("date")) 17914 res.setDateElement(parseDateTime(json.get("date").getAsString())); 17915 if (json.has("_date")) 17916 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 17917 if (json.has("reporter")) 17918 res.setReporter(parseReference(getJObject(json, "reporter"))); 17919 if (json.has("period")) 17920 res.setPeriod(parsePeriod(getJObject(json, "period"))); 17921 if (json.has("improvementNotation")) 17922 res.setImprovementNotation(parseCodeableConcept(getJObject(json, "improvementNotation"))); 17923 if (json.has("group")) { 17924 JsonArray array = json.getAsJsonArray("group"); 17925 for (int i = 0; i < array.size(); i++) { 17926 res.getGroup().add(parseMeasureReportMeasureReportGroupComponent(array.get(i).getAsJsonObject(), res)); 17927 } 17928 } 17929 ; 17930 if (json.has("evaluatedResource")) { 17931 JsonArray array = json.getAsJsonArray("evaluatedResource"); 17932 for (int i = 0; i < array.size(); i++) { 17933 res.getEvaluatedResource().add(parseReference(array.get(i).getAsJsonObject())); 17934 } 17935 } 17936 ; 17937 } 17938 17939 protected MeasureReport.MeasureReportGroupComponent parseMeasureReportMeasureReportGroupComponent(JsonObject json, 17940 MeasureReport owner) throws IOException, FHIRFormatError { 17941 MeasureReport.MeasureReportGroupComponent res = new MeasureReport.MeasureReportGroupComponent(); 17942 parseMeasureReportMeasureReportGroupComponentProperties(json, owner, res); 17943 return res; 17944 } 17945 17946 protected void parseMeasureReportMeasureReportGroupComponentProperties(JsonObject json, MeasureReport owner, 17947 MeasureReport.MeasureReportGroupComponent res) throws IOException, FHIRFormatError { 17948 parseBackboneElementProperties(json, res); 17949 if (json.has("code")) 17950 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 17951 if (json.has("population")) { 17952 JsonArray array = json.getAsJsonArray("population"); 17953 for (int i = 0; i < array.size(); i++) { 17954 res.getPopulation() 17955 .add(parseMeasureReportMeasureReportGroupPopulationComponent(array.get(i).getAsJsonObject(), owner)); 17956 } 17957 } 17958 ; 17959 if (json.has("measureScore")) 17960 res.setMeasureScore(parseQuantity(getJObject(json, "measureScore"))); 17961 if (json.has("stratifier")) { 17962 JsonArray array = json.getAsJsonArray("stratifier"); 17963 for (int i = 0; i < array.size(); i++) { 17964 res.getStratifier() 17965 .add(parseMeasureReportMeasureReportGroupStratifierComponent(array.get(i).getAsJsonObject(), owner)); 17966 } 17967 } 17968 ; 17969 } 17970 17971 protected MeasureReport.MeasureReportGroupPopulationComponent parseMeasureReportMeasureReportGroupPopulationComponent( 17972 JsonObject json, MeasureReport owner) throws IOException, FHIRFormatError { 17973 MeasureReport.MeasureReportGroupPopulationComponent res = new MeasureReport.MeasureReportGroupPopulationComponent(); 17974 parseMeasureReportMeasureReportGroupPopulationComponentProperties(json, owner, res); 17975 return res; 17976 } 17977 17978 protected void parseMeasureReportMeasureReportGroupPopulationComponentProperties(JsonObject json, MeasureReport owner, 17979 MeasureReport.MeasureReportGroupPopulationComponent res) throws IOException, FHIRFormatError { 17980 parseBackboneElementProperties(json, res); 17981 if (json.has("code")) 17982 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 17983 if (json.has("count")) 17984 res.setCountElement(parseInteger(json.get("count").getAsLong())); 17985 if (json.has("_count")) 17986 parseElementProperties(getJObject(json, "_count"), res.getCountElement()); 17987 if (json.has("subjectResults")) 17988 res.setSubjectResults(parseReference(getJObject(json, "subjectResults"))); 17989 } 17990 17991 protected MeasureReport.MeasureReportGroupStratifierComponent parseMeasureReportMeasureReportGroupStratifierComponent( 17992 JsonObject json, MeasureReport owner) throws IOException, FHIRFormatError { 17993 MeasureReport.MeasureReportGroupStratifierComponent res = new MeasureReport.MeasureReportGroupStratifierComponent(); 17994 parseMeasureReportMeasureReportGroupStratifierComponentProperties(json, owner, res); 17995 return res; 17996 } 17997 17998 protected void parseMeasureReportMeasureReportGroupStratifierComponentProperties(JsonObject json, MeasureReport owner, 17999 MeasureReport.MeasureReportGroupStratifierComponent res) throws IOException, FHIRFormatError { 18000 parseBackboneElementProperties(json, res); 18001 if (json.has("code")) { 18002 JsonArray array = json.getAsJsonArray("code"); 18003 for (int i = 0; i < array.size(); i++) { 18004 res.getCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 18005 } 18006 } 18007 ; 18008 if (json.has("stratum")) { 18009 JsonArray array = json.getAsJsonArray("stratum"); 18010 for (int i = 0; i < array.size(); i++) { 18011 res.getStratum().add(parseMeasureReportStratifierGroupComponent(array.get(i).getAsJsonObject(), owner)); 18012 } 18013 } 18014 ; 18015 } 18016 18017 protected MeasureReport.StratifierGroupComponent parseMeasureReportStratifierGroupComponent(JsonObject json, 18018 MeasureReport owner) throws IOException, FHIRFormatError { 18019 MeasureReport.StratifierGroupComponent res = new MeasureReport.StratifierGroupComponent(); 18020 parseMeasureReportStratifierGroupComponentProperties(json, owner, res); 18021 return res; 18022 } 18023 18024 protected void parseMeasureReportStratifierGroupComponentProperties(JsonObject json, MeasureReport owner, 18025 MeasureReport.StratifierGroupComponent res) throws IOException, FHIRFormatError { 18026 parseBackboneElementProperties(json, res); 18027 if (json.has("value")) 18028 res.setValue(parseCodeableConcept(getJObject(json, "value"))); 18029 if (json.has("component")) { 18030 JsonArray array = json.getAsJsonArray("component"); 18031 for (int i = 0; i < array.size(); i++) { 18032 res.getComponent() 18033 .add(parseMeasureReportStratifierGroupComponentComponent(array.get(i).getAsJsonObject(), owner)); 18034 } 18035 } 18036 ; 18037 if (json.has("population")) { 18038 JsonArray array = json.getAsJsonArray("population"); 18039 for (int i = 0; i < array.size(); i++) { 18040 res.getPopulation() 18041 .add(parseMeasureReportStratifierGroupPopulationComponent(array.get(i).getAsJsonObject(), owner)); 18042 } 18043 } 18044 ; 18045 if (json.has("measureScore")) 18046 res.setMeasureScore(parseQuantity(getJObject(json, "measureScore"))); 18047 } 18048 18049 protected MeasureReport.StratifierGroupComponentComponent parseMeasureReportStratifierGroupComponentComponent( 18050 JsonObject json, MeasureReport owner) throws IOException, FHIRFormatError { 18051 MeasureReport.StratifierGroupComponentComponent res = new MeasureReport.StratifierGroupComponentComponent(); 18052 parseMeasureReportStratifierGroupComponentComponentProperties(json, owner, res); 18053 return res; 18054 } 18055 18056 protected void parseMeasureReportStratifierGroupComponentComponentProperties(JsonObject json, MeasureReport owner, 18057 MeasureReport.StratifierGroupComponentComponent res) throws IOException, FHIRFormatError { 18058 parseBackboneElementProperties(json, res); 18059 if (json.has("code")) 18060 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 18061 if (json.has("value")) 18062 res.setValue(parseCodeableConcept(getJObject(json, "value"))); 18063 } 18064 18065 protected MeasureReport.StratifierGroupPopulationComponent parseMeasureReportStratifierGroupPopulationComponent( 18066 JsonObject json, MeasureReport owner) throws IOException, FHIRFormatError { 18067 MeasureReport.StratifierGroupPopulationComponent res = new MeasureReport.StratifierGroupPopulationComponent(); 18068 parseMeasureReportStratifierGroupPopulationComponentProperties(json, owner, res); 18069 return res; 18070 } 18071 18072 protected void parseMeasureReportStratifierGroupPopulationComponentProperties(JsonObject json, MeasureReport owner, 18073 MeasureReport.StratifierGroupPopulationComponent res) throws IOException, FHIRFormatError { 18074 parseBackboneElementProperties(json, res); 18075 if (json.has("code")) 18076 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 18077 if (json.has("count")) 18078 res.setCountElement(parseInteger(json.get("count").getAsLong())); 18079 if (json.has("_count")) 18080 parseElementProperties(getJObject(json, "_count"), res.getCountElement()); 18081 if (json.has("subjectResults")) 18082 res.setSubjectResults(parseReference(getJObject(json, "subjectResults"))); 18083 } 18084 18085 protected Media parseMedia(JsonObject json) throws IOException, FHIRFormatError { 18086 Media res = new Media(); 18087 parseMediaProperties(json, res); 18088 return res; 18089 } 18090 18091 protected void parseMediaProperties(JsonObject json, Media res) throws IOException, FHIRFormatError { 18092 parseDomainResourceProperties(json, res); 18093 if (json.has("identifier")) { 18094 JsonArray array = json.getAsJsonArray("identifier"); 18095 for (int i = 0; i < array.size(); i++) { 18096 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 18097 } 18098 } 18099 ; 18100 if (json.has("basedOn")) { 18101 JsonArray array = json.getAsJsonArray("basedOn"); 18102 for (int i = 0; i < array.size(); i++) { 18103 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 18104 } 18105 } 18106 ; 18107 if (json.has("partOf")) { 18108 JsonArray array = json.getAsJsonArray("partOf"); 18109 for (int i = 0; i < array.size(); i++) { 18110 res.getPartOf().add(parseReference(array.get(i).getAsJsonObject())); 18111 } 18112 } 18113 ; 18114 if (json.has("status")) 18115 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Media.MediaStatus.NULL, 18116 new Media.MediaStatusEnumFactory())); 18117 if (json.has("_status")) 18118 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 18119 if (json.has("type")) 18120 res.setType(parseCodeableConcept(getJObject(json, "type"))); 18121 if (json.has("modality")) 18122 res.setModality(parseCodeableConcept(getJObject(json, "modality"))); 18123 if (json.has("view")) 18124 res.setView(parseCodeableConcept(getJObject(json, "view"))); 18125 if (json.has("subject")) 18126 res.setSubject(parseReference(getJObject(json, "subject"))); 18127 if (json.has("encounter")) 18128 res.setEncounter(parseReference(getJObject(json, "encounter"))); 18129 Type created = parseType("created", json); 18130 if (created != null) 18131 res.setCreated(created); 18132 if (json.has("issued")) 18133 res.setIssuedElement(parseInstant(json.get("issued").getAsString())); 18134 if (json.has("_issued")) 18135 parseElementProperties(getJObject(json, "_issued"), res.getIssuedElement()); 18136 if (json.has("operator")) 18137 res.setOperator(parseReference(getJObject(json, "operator"))); 18138 if (json.has("reasonCode")) { 18139 JsonArray array = json.getAsJsonArray("reasonCode"); 18140 for (int i = 0; i < array.size(); i++) { 18141 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 18142 } 18143 } 18144 ; 18145 if (json.has("bodySite")) 18146 res.setBodySite(parseCodeableConcept(getJObject(json, "bodySite"))); 18147 if (json.has("deviceName")) 18148 res.setDeviceNameElement(parseString(json.get("deviceName").getAsString())); 18149 if (json.has("_deviceName")) 18150 parseElementProperties(getJObject(json, "_deviceName"), res.getDeviceNameElement()); 18151 if (json.has("device")) 18152 res.setDevice(parseReference(getJObject(json, "device"))); 18153 if (json.has("height")) 18154 res.setHeightElement(parsePositiveInt(json.get("height").getAsString())); 18155 if (json.has("_height")) 18156 parseElementProperties(getJObject(json, "_height"), res.getHeightElement()); 18157 if (json.has("width")) 18158 res.setWidthElement(parsePositiveInt(json.get("width").getAsString())); 18159 if (json.has("_width")) 18160 parseElementProperties(getJObject(json, "_width"), res.getWidthElement()); 18161 if (json.has("frames")) 18162 res.setFramesElement(parsePositiveInt(json.get("frames").getAsString())); 18163 if (json.has("_frames")) 18164 parseElementProperties(getJObject(json, "_frames"), res.getFramesElement()); 18165 if (json.has("duration")) 18166 res.setDurationElement(parseDecimal(json.get("duration").getAsBigDecimal())); 18167 if (json.has("_duration")) 18168 parseElementProperties(getJObject(json, "_duration"), res.getDurationElement()); 18169 if (json.has("content")) 18170 res.setContent(parseAttachment(getJObject(json, "content"))); 18171 if (json.has("note")) { 18172 JsonArray array = json.getAsJsonArray("note"); 18173 for (int i = 0; i < array.size(); i++) { 18174 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 18175 } 18176 } 18177 ; 18178 } 18179 18180 protected Medication parseMedication(JsonObject json) throws IOException, FHIRFormatError { 18181 Medication res = new Medication(); 18182 parseMedicationProperties(json, res); 18183 return res; 18184 } 18185 18186 protected void parseMedicationProperties(JsonObject json, Medication res) throws IOException, FHIRFormatError { 18187 parseDomainResourceProperties(json, res); 18188 if (json.has("identifier")) { 18189 JsonArray array = json.getAsJsonArray("identifier"); 18190 for (int i = 0; i < array.size(); i++) { 18191 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 18192 } 18193 } 18194 ; 18195 if (json.has("code")) 18196 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 18197 if (json.has("status")) 18198 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Medication.MedicationStatus.NULL, 18199 new Medication.MedicationStatusEnumFactory())); 18200 if (json.has("_status")) 18201 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 18202 if (json.has("manufacturer")) 18203 res.setManufacturer(parseReference(getJObject(json, "manufacturer"))); 18204 if (json.has("form")) 18205 res.setForm(parseCodeableConcept(getJObject(json, "form"))); 18206 if (json.has("amount")) 18207 res.setAmount(parseRatio(getJObject(json, "amount"))); 18208 if (json.has("ingredient")) { 18209 JsonArray array = json.getAsJsonArray("ingredient"); 18210 for (int i = 0; i < array.size(); i++) { 18211 res.getIngredient().add(parseMedicationMedicationIngredientComponent(array.get(i).getAsJsonObject(), res)); 18212 } 18213 } 18214 ; 18215 if (json.has("batch")) 18216 res.setBatch(parseMedicationMedicationBatchComponent(getJObject(json, "batch"), res)); 18217 } 18218 18219 protected Medication.MedicationIngredientComponent parseMedicationMedicationIngredientComponent(JsonObject json, 18220 Medication owner) throws IOException, FHIRFormatError { 18221 Medication.MedicationIngredientComponent res = new Medication.MedicationIngredientComponent(); 18222 parseMedicationMedicationIngredientComponentProperties(json, owner, res); 18223 return res; 18224 } 18225 18226 protected void parseMedicationMedicationIngredientComponentProperties(JsonObject json, Medication owner, 18227 Medication.MedicationIngredientComponent res) throws IOException, FHIRFormatError { 18228 parseBackboneElementProperties(json, res); 18229 Type item = parseType("item", json); 18230 if (item != null) 18231 res.setItem(item); 18232 if (json.has("isActive")) 18233 res.setIsActiveElement(parseBoolean(json.get("isActive").getAsBoolean())); 18234 if (json.has("_isActive")) 18235 parseElementProperties(getJObject(json, "_isActive"), res.getIsActiveElement()); 18236 if (json.has("strength")) 18237 res.setStrength(parseRatio(getJObject(json, "strength"))); 18238 } 18239 18240 protected Medication.MedicationBatchComponent parseMedicationMedicationBatchComponent(JsonObject json, 18241 Medication owner) throws IOException, FHIRFormatError { 18242 Medication.MedicationBatchComponent res = new Medication.MedicationBatchComponent(); 18243 parseMedicationMedicationBatchComponentProperties(json, owner, res); 18244 return res; 18245 } 18246 18247 protected void parseMedicationMedicationBatchComponentProperties(JsonObject json, Medication owner, 18248 Medication.MedicationBatchComponent res) throws IOException, FHIRFormatError { 18249 parseBackboneElementProperties(json, res); 18250 if (json.has("lotNumber")) 18251 res.setLotNumberElement(parseString(json.get("lotNumber").getAsString())); 18252 if (json.has("_lotNumber")) 18253 parseElementProperties(getJObject(json, "_lotNumber"), res.getLotNumberElement()); 18254 if (json.has("expirationDate")) 18255 res.setExpirationDateElement(parseDateTime(json.get("expirationDate").getAsString())); 18256 if (json.has("_expirationDate")) 18257 parseElementProperties(getJObject(json, "_expirationDate"), res.getExpirationDateElement()); 18258 } 18259 18260 protected MedicationAdministration parseMedicationAdministration(JsonObject json) 18261 throws IOException, FHIRFormatError { 18262 MedicationAdministration res = new MedicationAdministration(); 18263 parseMedicationAdministrationProperties(json, res); 18264 return res; 18265 } 18266 18267 protected void parseMedicationAdministrationProperties(JsonObject json, MedicationAdministration res) 18268 throws IOException, FHIRFormatError { 18269 parseDomainResourceProperties(json, res); 18270 if (json.has("identifier")) { 18271 JsonArray array = json.getAsJsonArray("identifier"); 18272 for (int i = 0; i < array.size(); i++) { 18273 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 18274 } 18275 } 18276 ; 18277 if (json.has("instantiates")) { 18278 JsonArray array = json.getAsJsonArray("instantiates"); 18279 for (int i = 0; i < array.size(); i++) { 18280 if (array.get(i).isJsonNull()) { 18281 res.getInstantiates().add(new UriType()); 18282 } else { 18283 res.getInstantiates().add(parseUri(array.get(i).getAsString())); 18284 } 18285 } 18286 } 18287 ; 18288 if (json.has("_instantiates")) { 18289 JsonArray array = json.getAsJsonArray("_instantiates"); 18290 for (int i = 0; i < array.size(); i++) { 18291 if (i == res.getInstantiates().size()) 18292 res.getInstantiates().add(parseUri(null)); 18293 if (array.get(i) instanceof JsonObject) 18294 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiates().get(i)); 18295 } 18296 } 18297 ; 18298 if (json.has("partOf")) { 18299 JsonArray array = json.getAsJsonArray("partOf"); 18300 for (int i = 0; i < array.size(); i++) { 18301 res.getPartOf().add(parseReference(array.get(i).getAsJsonObject())); 18302 } 18303 } 18304 ; 18305 if (json.has("status")) 18306 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), 18307 MedicationAdministration.MedicationAdministrationStatus.NULL, 18308 new MedicationAdministration.MedicationAdministrationStatusEnumFactory())); 18309 if (json.has("_status")) 18310 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 18311 if (json.has("statusReason")) { 18312 JsonArray array = json.getAsJsonArray("statusReason"); 18313 for (int i = 0; i < array.size(); i++) { 18314 res.getStatusReason().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 18315 } 18316 } 18317 ; 18318 if (json.has("category")) 18319 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 18320 Type medication = parseType("medication", json); 18321 if (medication != null) 18322 res.setMedication(medication); 18323 if (json.has("subject")) 18324 res.setSubject(parseReference(getJObject(json, "subject"))); 18325 if (json.has("context")) 18326 res.setContext(parseReference(getJObject(json, "context"))); 18327 if (json.has("supportingInformation")) { 18328 JsonArray array = json.getAsJsonArray("supportingInformation"); 18329 for (int i = 0; i < array.size(); i++) { 18330 res.getSupportingInformation().add(parseReference(array.get(i).getAsJsonObject())); 18331 } 18332 } 18333 ; 18334 Type effective = parseType("effective", json); 18335 if (effective != null) 18336 res.setEffective(effective); 18337 if (json.has("performer")) { 18338 JsonArray array = json.getAsJsonArray("performer"); 18339 for (int i = 0; i < array.size(); i++) { 18340 res.getPerformer().add(parseMedicationAdministrationMedicationAdministrationPerformerComponent( 18341 array.get(i).getAsJsonObject(), res)); 18342 } 18343 } 18344 ; 18345 if (json.has("reasonCode")) { 18346 JsonArray array = json.getAsJsonArray("reasonCode"); 18347 for (int i = 0; i < array.size(); i++) { 18348 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 18349 } 18350 } 18351 ; 18352 if (json.has("reasonReference")) { 18353 JsonArray array = json.getAsJsonArray("reasonReference"); 18354 for (int i = 0; i < array.size(); i++) { 18355 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 18356 } 18357 } 18358 ; 18359 if (json.has("request")) 18360 res.setRequest(parseReference(getJObject(json, "request"))); 18361 if (json.has("device")) { 18362 JsonArray array = json.getAsJsonArray("device"); 18363 for (int i = 0; i < array.size(); i++) { 18364 res.getDevice().add(parseReference(array.get(i).getAsJsonObject())); 18365 } 18366 } 18367 ; 18368 if (json.has("note")) { 18369 JsonArray array = json.getAsJsonArray("note"); 18370 for (int i = 0; i < array.size(); i++) { 18371 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 18372 } 18373 } 18374 ; 18375 if (json.has("dosage")) 18376 res.setDosage( 18377 parseMedicationAdministrationMedicationAdministrationDosageComponent(getJObject(json, "dosage"), res)); 18378 if (json.has("eventHistory")) { 18379 JsonArray array = json.getAsJsonArray("eventHistory"); 18380 for (int i = 0; i < array.size(); i++) { 18381 res.getEventHistory().add(parseReference(array.get(i).getAsJsonObject())); 18382 } 18383 } 18384 ; 18385 } 18386 18387 protected MedicationAdministration.MedicationAdministrationPerformerComponent parseMedicationAdministrationMedicationAdministrationPerformerComponent( 18388 JsonObject json, MedicationAdministration owner) throws IOException, FHIRFormatError { 18389 MedicationAdministration.MedicationAdministrationPerformerComponent res = new MedicationAdministration.MedicationAdministrationPerformerComponent(); 18390 parseMedicationAdministrationMedicationAdministrationPerformerComponentProperties(json, owner, res); 18391 return res; 18392 } 18393 18394 protected void parseMedicationAdministrationMedicationAdministrationPerformerComponentProperties(JsonObject json, 18395 MedicationAdministration owner, MedicationAdministration.MedicationAdministrationPerformerComponent res) 18396 throws IOException, FHIRFormatError { 18397 parseBackboneElementProperties(json, res); 18398 if (json.has("function")) 18399 res.setFunction(parseCodeableConcept(getJObject(json, "function"))); 18400 if (json.has("actor")) 18401 res.setActor(parseReference(getJObject(json, "actor"))); 18402 } 18403 18404 protected MedicationAdministration.MedicationAdministrationDosageComponent parseMedicationAdministrationMedicationAdministrationDosageComponent( 18405 JsonObject json, MedicationAdministration owner) throws IOException, FHIRFormatError { 18406 MedicationAdministration.MedicationAdministrationDosageComponent res = new MedicationAdministration.MedicationAdministrationDosageComponent(); 18407 parseMedicationAdministrationMedicationAdministrationDosageComponentProperties(json, owner, res); 18408 return res; 18409 } 18410 18411 protected void parseMedicationAdministrationMedicationAdministrationDosageComponentProperties(JsonObject json, 18412 MedicationAdministration owner, MedicationAdministration.MedicationAdministrationDosageComponent res) 18413 throws IOException, FHIRFormatError { 18414 parseBackboneElementProperties(json, res); 18415 if (json.has("text")) 18416 res.setTextElement(parseString(json.get("text").getAsString())); 18417 if (json.has("_text")) 18418 parseElementProperties(getJObject(json, "_text"), res.getTextElement()); 18419 if (json.has("site")) 18420 res.setSite(parseCodeableConcept(getJObject(json, "site"))); 18421 if (json.has("route")) 18422 res.setRoute(parseCodeableConcept(getJObject(json, "route"))); 18423 if (json.has("method")) 18424 res.setMethod(parseCodeableConcept(getJObject(json, "method"))); 18425 if (json.has("dose")) 18426 res.setDose(parseQuantity(getJObject(json, "dose"))); 18427 Type rate = parseType("rate", json); 18428 if (rate != null) 18429 res.setRate(rate); 18430 } 18431 18432 protected MedicationDispense parseMedicationDispense(JsonObject json) throws IOException, FHIRFormatError { 18433 MedicationDispense res = new MedicationDispense(); 18434 parseMedicationDispenseProperties(json, res); 18435 return res; 18436 } 18437 18438 protected void parseMedicationDispenseProperties(JsonObject json, MedicationDispense res) 18439 throws IOException, FHIRFormatError { 18440 parseDomainResourceProperties(json, res); 18441 if (json.has("identifier")) { 18442 JsonArray array = json.getAsJsonArray("identifier"); 18443 for (int i = 0; i < array.size(); i++) { 18444 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 18445 } 18446 } 18447 ; 18448 if (json.has("partOf")) { 18449 JsonArray array = json.getAsJsonArray("partOf"); 18450 for (int i = 0; i < array.size(); i++) { 18451 res.getPartOf().add(parseReference(array.get(i).getAsJsonObject())); 18452 } 18453 } 18454 ; 18455 if (json.has("status")) 18456 res.setStatusElement( 18457 parseEnumeration(json.get("status").getAsString(), MedicationDispense.MedicationDispenseStatus.NULL, 18458 new MedicationDispense.MedicationDispenseStatusEnumFactory())); 18459 if (json.has("_status")) 18460 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 18461 Type statusReason = parseType("statusReason", json); 18462 if (statusReason != null) 18463 res.setStatusReason(statusReason); 18464 if (json.has("category")) 18465 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 18466 Type medication = parseType("medication", json); 18467 if (medication != null) 18468 res.setMedication(medication); 18469 if (json.has("subject")) 18470 res.setSubject(parseReference(getJObject(json, "subject"))); 18471 if (json.has("context")) 18472 res.setContext(parseReference(getJObject(json, "context"))); 18473 if (json.has("supportingInformation")) { 18474 JsonArray array = json.getAsJsonArray("supportingInformation"); 18475 for (int i = 0; i < array.size(); i++) { 18476 res.getSupportingInformation().add(parseReference(array.get(i).getAsJsonObject())); 18477 } 18478 } 18479 ; 18480 if (json.has("performer")) { 18481 JsonArray array = json.getAsJsonArray("performer"); 18482 for (int i = 0; i < array.size(); i++) { 18483 res.getPerformer() 18484 .add(parseMedicationDispenseMedicationDispensePerformerComponent(array.get(i).getAsJsonObject(), res)); 18485 } 18486 } 18487 ; 18488 if (json.has("location")) 18489 res.setLocation(parseReference(getJObject(json, "location"))); 18490 if (json.has("authorizingPrescription")) { 18491 JsonArray array = json.getAsJsonArray("authorizingPrescription"); 18492 for (int i = 0; i < array.size(); i++) { 18493 res.getAuthorizingPrescription().add(parseReference(array.get(i).getAsJsonObject())); 18494 } 18495 } 18496 ; 18497 if (json.has("type")) 18498 res.setType(parseCodeableConcept(getJObject(json, "type"))); 18499 if (json.has("quantity")) 18500 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 18501 if (json.has("daysSupply")) 18502 res.setDaysSupply(parseQuantity(getJObject(json, "daysSupply"))); 18503 if (json.has("whenPrepared")) 18504 res.setWhenPreparedElement(parseDateTime(json.get("whenPrepared").getAsString())); 18505 if (json.has("_whenPrepared")) 18506 parseElementProperties(getJObject(json, "_whenPrepared"), res.getWhenPreparedElement()); 18507 if (json.has("whenHandedOver")) 18508 res.setWhenHandedOverElement(parseDateTime(json.get("whenHandedOver").getAsString())); 18509 if (json.has("_whenHandedOver")) 18510 parseElementProperties(getJObject(json, "_whenHandedOver"), res.getWhenHandedOverElement()); 18511 if (json.has("destination")) 18512 res.setDestination(parseReference(getJObject(json, "destination"))); 18513 if (json.has("receiver")) { 18514 JsonArray array = json.getAsJsonArray("receiver"); 18515 for (int i = 0; i < array.size(); i++) { 18516 res.getReceiver().add(parseReference(array.get(i).getAsJsonObject())); 18517 } 18518 } 18519 ; 18520 if (json.has("note")) { 18521 JsonArray array = json.getAsJsonArray("note"); 18522 for (int i = 0; i < array.size(); i++) { 18523 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 18524 } 18525 } 18526 ; 18527 if (json.has("dosageInstruction")) { 18528 JsonArray array = json.getAsJsonArray("dosageInstruction"); 18529 for (int i = 0; i < array.size(); i++) { 18530 res.getDosageInstruction().add(parseDosage(array.get(i).getAsJsonObject())); 18531 } 18532 } 18533 ; 18534 if (json.has("substitution")) 18535 res.setSubstitution( 18536 parseMedicationDispenseMedicationDispenseSubstitutionComponent(getJObject(json, "substitution"), res)); 18537 if (json.has("detectedIssue")) { 18538 JsonArray array = json.getAsJsonArray("detectedIssue"); 18539 for (int i = 0; i < array.size(); i++) { 18540 res.getDetectedIssue().add(parseReference(array.get(i).getAsJsonObject())); 18541 } 18542 } 18543 ; 18544 if (json.has("eventHistory")) { 18545 JsonArray array = json.getAsJsonArray("eventHistory"); 18546 for (int i = 0; i < array.size(); i++) { 18547 res.getEventHistory().add(parseReference(array.get(i).getAsJsonObject())); 18548 } 18549 } 18550 ; 18551 } 18552 18553 protected MedicationDispense.MedicationDispensePerformerComponent parseMedicationDispenseMedicationDispensePerformerComponent( 18554 JsonObject json, MedicationDispense owner) throws IOException, FHIRFormatError { 18555 MedicationDispense.MedicationDispensePerformerComponent res = new MedicationDispense.MedicationDispensePerformerComponent(); 18556 parseMedicationDispenseMedicationDispensePerformerComponentProperties(json, owner, res); 18557 return res; 18558 } 18559 18560 protected void parseMedicationDispenseMedicationDispensePerformerComponentProperties(JsonObject json, 18561 MedicationDispense owner, MedicationDispense.MedicationDispensePerformerComponent res) 18562 throws IOException, FHIRFormatError { 18563 parseBackboneElementProperties(json, res); 18564 if (json.has("function")) 18565 res.setFunction(parseCodeableConcept(getJObject(json, "function"))); 18566 if (json.has("actor")) 18567 res.setActor(parseReference(getJObject(json, "actor"))); 18568 } 18569 18570 protected MedicationDispense.MedicationDispenseSubstitutionComponent parseMedicationDispenseMedicationDispenseSubstitutionComponent( 18571 JsonObject json, MedicationDispense owner) throws IOException, FHIRFormatError { 18572 MedicationDispense.MedicationDispenseSubstitutionComponent res = new MedicationDispense.MedicationDispenseSubstitutionComponent(); 18573 parseMedicationDispenseMedicationDispenseSubstitutionComponentProperties(json, owner, res); 18574 return res; 18575 } 18576 18577 protected void parseMedicationDispenseMedicationDispenseSubstitutionComponentProperties(JsonObject json, 18578 MedicationDispense owner, MedicationDispense.MedicationDispenseSubstitutionComponent res) 18579 throws IOException, FHIRFormatError { 18580 parseBackboneElementProperties(json, res); 18581 if (json.has("wasSubstituted")) 18582 res.setWasSubstitutedElement(parseBoolean(json.get("wasSubstituted").getAsBoolean())); 18583 if (json.has("_wasSubstituted")) 18584 parseElementProperties(getJObject(json, "_wasSubstituted"), res.getWasSubstitutedElement()); 18585 if (json.has("type")) 18586 res.setType(parseCodeableConcept(getJObject(json, "type"))); 18587 if (json.has("reason")) { 18588 JsonArray array = json.getAsJsonArray("reason"); 18589 for (int i = 0; i < array.size(); i++) { 18590 res.getReason().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 18591 } 18592 } 18593 ; 18594 if (json.has("responsibleParty")) { 18595 JsonArray array = json.getAsJsonArray("responsibleParty"); 18596 for (int i = 0; i < array.size(); i++) { 18597 res.getResponsibleParty().add(parseReference(array.get(i).getAsJsonObject())); 18598 } 18599 } 18600 ; 18601 } 18602 18603 protected MedicationKnowledge parseMedicationKnowledge(JsonObject json) throws IOException, FHIRFormatError { 18604 MedicationKnowledge res = new MedicationKnowledge(); 18605 parseMedicationKnowledgeProperties(json, res); 18606 return res; 18607 } 18608 18609 protected void parseMedicationKnowledgeProperties(JsonObject json, MedicationKnowledge res) 18610 throws IOException, FHIRFormatError { 18611 parseDomainResourceProperties(json, res); 18612 if (json.has("code")) 18613 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 18614 if (json.has("status")) 18615 res.setStatusElement( 18616 parseEnumeration(json.get("status").getAsString(), MedicationKnowledge.MedicationKnowledgeStatus.NULL, 18617 new MedicationKnowledge.MedicationKnowledgeStatusEnumFactory())); 18618 if (json.has("_status")) 18619 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 18620 if (json.has("manufacturer")) 18621 res.setManufacturer(parseReference(getJObject(json, "manufacturer"))); 18622 if (json.has("doseForm")) 18623 res.setDoseForm(parseCodeableConcept(getJObject(json, "doseForm"))); 18624 if (json.has("amount")) 18625 res.setAmount(parseQuantity(getJObject(json, "amount"))); 18626 if (json.has("synonym")) { 18627 JsonArray array = json.getAsJsonArray("synonym"); 18628 for (int i = 0; i < array.size(); i++) { 18629 if (array.get(i).isJsonNull()) { 18630 res.getSynonym().add(new StringType()); 18631 } else { 18632 res.getSynonym().add(parseString(array.get(i).getAsString())); 18633 } 18634 } 18635 } 18636 ; 18637 if (json.has("_synonym")) { 18638 JsonArray array = json.getAsJsonArray("_synonym"); 18639 for (int i = 0; i < array.size(); i++) { 18640 if (i == res.getSynonym().size()) 18641 res.getSynonym().add(parseString(null)); 18642 if (array.get(i) instanceof JsonObject) 18643 parseElementProperties(array.get(i).getAsJsonObject(), res.getSynonym().get(i)); 18644 } 18645 } 18646 ; 18647 if (json.has("relatedMedicationKnowledge")) { 18648 JsonArray array = json.getAsJsonArray("relatedMedicationKnowledge"); 18649 for (int i = 0; i < array.size(); i++) { 18650 res.getRelatedMedicationKnowledge() 18651 .add(parseMedicationKnowledgeMedicationKnowledgeRelatedMedicationKnowledgeComponent( 18652 array.get(i).getAsJsonObject(), res)); 18653 } 18654 } 18655 ; 18656 if (json.has("associatedMedication")) { 18657 JsonArray array = json.getAsJsonArray("associatedMedication"); 18658 for (int i = 0; i < array.size(); i++) { 18659 res.getAssociatedMedication().add(parseReference(array.get(i).getAsJsonObject())); 18660 } 18661 } 18662 ; 18663 if (json.has("productType")) { 18664 JsonArray array = json.getAsJsonArray("productType"); 18665 for (int i = 0; i < array.size(); i++) { 18666 res.getProductType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 18667 } 18668 } 18669 ; 18670 if (json.has("monograph")) { 18671 JsonArray array = json.getAsJsonArray("monograph"); 18672 for (int i = 0; i < array.size(); i++) { 18673 res.getMonograph() 18674 .add(parseMedicationKnowledgeMedicationKnowledgeMonographComponent(array.get(i).getAsJsonObject(), res)); 18675 } 18676 } 18677 ; 18678 if (json.has("ingredient")) { 18679 JsonArray array = json.getAsJsonArray("ingredient"); 18680 for (int i = 0; i < array.size(); i++) { 18681 res.getIngredient() 18682 .add(parseMedicationKnowledgeMedicationKnowledgeIngredientComponent(array.get(i).getAsJsonObject(), res)); 18683 } 18684 } 18685 ; 18686 if (json.has("preparationInstruction")) 18687 res.setPreparationInstructionElement(parseMarkdown(json.get("preparationInstruction").getAsString())); 18688 if (json.has("_preparationInstruction")) 18689 parseElementProperties(getJObject(json, "_preparationInstruction"), res.getPreparationInstructionElement()); 18690 if (json.has("intendedRoute")) { 18691 JsonArray array = json.getAsJsonArray("intendedRoute"); 18692 for (int i = 0; i < array.size(); i++) { 18693 res.getIntendedRoute().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 18694 } 18695 } 18696 ; 18697 if (json.has("cost")) { 18698 JsonArray array = json.getAsJsonArray("cost"); 18699 for (int i = 0; i < array.size(); i++) { 18700 res.getCost() 18701 .add(parseMedicationKnowledgeMedicationKnowledgeCostComponent(array.get(i).getAsJsonObject(), res)); 18702 } 18703 } 18704 ; 18705 if (json.has("monitoringProgram")) { 18706 JsonArray array = json.getAsJsonArray("monitoringProgram"); 18707 for (int i = 0; i < array.size(); i++) { 18708 res.getMonitoringProgram().add( 18709 parseMedicationKnowledgeMedicationKnowledgeMonitoringProgramComponent(array.get(i).getAsJsonObject(), res)); 18710 } 18711 } 18712 ; 18713 if (json.has("administrationGuidelines")) { 18714 JsonArray array = json.getAsJsonArray("administrationGuidelines"); 18715 for (int i = 0; i < array.size(); i++) { 18716 res.getAdministrationGuidelines().add( 18717 parseMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesComponent(array.get(i).getAsJsonObject(), 18718 res)); 18719 } 18720 } 18721 ; 18722 if (json.has("medicineClassification")) { 18723 JsonArray array = json.getAsJsonArray("medicineClassification"); 18724 for (int i = 0; i < array.size(); i++) { 18725 res.getMedicineClassification().add(parseMedicationKnowledgeMedicationKnowledgeMedicineClassificationComponent( 18726 array.get(i).getAsJsonObject(), res)); 18727 } 18728 } 18729 ; 18730 if (json.has("packaging")) 18731 res.setPackaging( 18732 parseMedicationKnowledgeMedicationKnowledgePackagingComponent(getJObject(json, "packaging"), res)); 18733 if (json.has("drugCharacteristic")) { 18734 JsonArray array = json.getAsJsonArray("drugCharacteristic"); 18735 for (int i = 0; i < array.size(); i++) { 18736 res.getDrugCharacteristic().add(parseMedicationKnowledgeMedicationKnowledgeDrugCharacteristicComponent( 18737 array.get(i).getAsJsonObject(), res)); 18738 } 18739 } 18740 ; 18741 if (json.has("contraindication")) { 18742 JsonArray array = json.getAsJsonArray("contraindication"); 18743 for (int i = 0; i < array.size(); i++) { 18744 res.getContraindication().add(parseReference(array.get(i).getAsJsonObject())); 18745 } 18746 } 18747 ; 18748 if (json.has("regulatory")) { 18749 JsonArray array = json.getAsJsonArray("regulatory"); 18750 for (int i = 0; i < array.size(); i++) { 18751 res.getRegulatory() 18752 .add(parseMedicationKnowledgeMedicationKnowledgeRegulatoryComponent(array.get(i).getAsJsonObject(), res)); 18753 } 18754 } 18755 ; 18756 if (json.has("kinetics")) { 18757 JsonArray array = json.getAsJsonArray("kinetics"); 18758 for (int i = 0; i < array.size(); i++) { 18759 res.getKinetics() 18760 .add(parseMedicationKnowledgeMedicationKnowledgeKineticsComponent(array.get(i).getAsJsonObject(), res)); 18761 } 18762 } 18763 ; 18764 } 18765 18766 protected MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent parseMedicationKnowledgeMedicationKnowledgeRelatedMedicationKnowledgeComponent( 18767 JsonObject json, MedicationKnowledge owner) throws IOException, FHIRFormatError { 18768 MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent res = new MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent(); 18769 parseMedicationKnowledgeMedicationKnowledgeRelatedMedicationKnowledgeComponentProperties(json, owner, res); 18770 return res; 18771 } 18772 18773 protected void parseMedicationKnowledgeMedicationKnowledgeRelatedMedicationKnowledgeComponentProperties( 18774 JsonObject json, MedicationKnowledge owner, 18775 MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent res) 18776 throws IOException, FHIRFormatError { 18777 parseBackboneElementProperties(json, res); 18778 if (json.has("type")) 18779 res.setType(parseCodeableConcept(getJObject(json, "type"))); 18780 if (json.has("reference")) { 18781 JsonArray array = json.getAsJsonArray("reference"); 18782 for (int i = 0; i < array.size(); i++) { 18783 res.getReference().add(parseReference(array.get(i).getAsJsonObject())); 18784 } 18785 } 18786 ; 18787 } 18788 18789 protected MedicationKnowledge.MedicationKnowledgeMonographComponent parseMedicationKnowledgeMedicationKnowledgeMonographComponent( 18790 JsonObject json, MedicationKnowledge owner) throws IOException, FHIRFormatError { 18791 MedicationKnowledge.MedicationKnowledgeMonographComponent res = new MedicationKnowledge.MedicationKnowledgeMonographComponent(); 18792 parseMedicationKnowledgeMedicationKnowledgeMonographComponentProperties(json, owner, res); 18793 return res; 18794 } 18795 18796 protected void parseMedicationKnowledgeMedicationKnowledgeMonographComponentProperties(JsonObject json, 18797 MedicationKnowledge owner, MedicationKnowledge.MedicationKnowledgeMonographComponent res) 18798 throws IOException, FHIRFormatError { 18799 parseBackboneElementProperties(json, res); 18800 if (json.has("type")) 18801 res.setType(parseCodeableConcept(getJObject(json, "type"))); 18802 if (json.has("source")) 18803 res.setSource(parseReference(getJObject(json, "source"))); 18804 } 18805 18806 protected MedicationKnowledge.MedicationKnowledgeIngredientComponent parseMedicationKnowledgeMedicationKnowledgeIngredientComponent( 18807 JsonObject json, MedicationKnowledge owner) throws IOException, FHIRFormatError { 18808 MedicationKnowledge.MedicationKnowledgeIngredientComponent res = new MedicationKnowledge.MedicationKnowledgeIngredientComponent(); 18809 parseMedicationKnowledgeMedicationKnowledgeIngredientComponentProperties(json, owner, res); 18810 return res; 18811 } 18812 18813 protected void parseMedicationKnowledgeMedicationKnowledgeIngredientComponentProperties(JsonObject json, 18814 MedicationKnowledge owner, MedicationKnowledge.MedicationKnowledgeIngredientComponent res) 18815 throws IOException, FHIRFormatError { 18816 parseBackboneElementProperties(json, res); 18817 Type item = parseType("item", json); 18818 if (item != null) 18819 res.setItem(item); 18820 if (json.has("isActive")) 18821 res.setIsActiveElement(parseBoolean(json.get("isActive").getAsBoolean())); 18822 if (json.has("_isActive")) 18823 parseElementProperties(getJObject(json, "_isActive"), res.getIsActiveElement()); 18824 if (json.has("strength")) 18825 res.setStrength(parseRatio(getJObject(json, "strength"))); 18826 } 18827 18828 protected MedicationKnowledge.MedicationKnowledgeCostComponent parseMedicationKnowledgeMedicationKnowledgeCostComponent( 18829 JsonObject json, MedicationKnowledge owner) throws IOException, FHIRFormatError { 18830 MedicationKnowledge.MedicationKnowledgeCostComponent res = new MedicationKnowledge.MedicationKnowledgeCostComponent(); 18831 parseMedicationKnowledgeMedicationKnowledgeCostComponentProperties(json, owner, res); 18832 return res; 18833 } 18834 18835 protected void parseMedicationKnowledgeMedicationKnowledgeCostComponentProperties(JsonObject json, 18836 MedicationKnowledge owner, MedicationKnowledge.MedicationKnowledgeCostComponent res) 18837 throws IOException, FHIRFormatError { 18838 parseBackboneElementProperties(json, res); 18839 if (json.has("type")) 18840 res.setType(parseCodeableConcept(getJObject(json, "type"))); 18841 if (json.has("source")) 18842 res.setSourceElement(parseString(json.get("source").getAsString())); 18843 if (json.has("_source")) 18844 parseElementProperties(getJObject(json, "_source"), res.getSourceElement()); 18845 if (json.has("cost")) 18846 res.setCost(parseMoney(getJObject(json, "cost"))); 18847 } 18848 18849 protected MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent parseMedicationKnowledgeMedicationKnowledgeMonitoringProgramComponent( 18850 JsonObject json, MedicationKnowledge owner) throws IOException, FHIRFormatError { 18851 MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent res = new MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent(); 18852 parseMedicationKnowledgeMedicationKnowledgeMonitoringProgramComponentProperties(json, owner, res); 18853 return res; 18854 } 18855 18856 protected void parseMedicationKnowledgeMedicationKnowledgeMonitoringProgramComponentProperties(JsonObject json, 18857 MedicationKnowledge owner, MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent res) 18858 throws IOException, FHIRFormatError { 18859 parseBackboneElementProperties(json, res); 18860 if (json.has("type")) 18861 res.setType(parseCodeableConcept(getJObject(json, "type"))); 18862 if (json.has("name")) 18863 res.setNameElement(parseString(json.get("name").getAsString())); 18864 if (json.has("_name")) 18865 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 18866 } 18867 18868 protected MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent parseMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesComponent( 18869 JsonObject json, MedicationKnowledge owner) throws IOException, FHIRFormatError { 18870 MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent res = new MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent(); 18871 parseMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesComponentProperties(json, owner, res); 18872 return res; 18873 } 18874 18875 protected void parseMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesComponentProperties(JsonObject json, 18876 MedicationKnowledge owner, MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent res) 18877 throws IOException, FHIRFormatError { 18878 parseBackboneElementProperties(json, res); 18879 if (json.has("dosage")) { 18880 JsonArray array = json.getAsJsonArray("dosage"); 18881 for (int i = 0; i < array.size(); i++) { 18882 res.getDosage().add(parseMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesDosageComponent( 18883 array.get(i).getAsJsonObject(), owner)); 18884 } 18885 } 18886 ; 18887 Type indication = parseType("indication", json); 18888 if (indication != null) 18889 res.setIndication(indication); 18890 if (json.has("patientCharacteristics")) { 18891 JsonArray array = json.getAsJsonArray("patientCharacteristics"); 18892 for (int i = 0; i < array.size(); i++) { 18893 res.getPatientCharacteristics() 18894 .add(parseMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent( 18895 array.get(i).getAsJsonObject(), owner)); 18896 } 18897 } 18898 ; 18899 } 18900 18901 protected MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent parseMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesDosageComponent( 18902 JsonObject json, MedicationKnowledge owner) throws IOException, FHIRFormatError { 18903 MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent res = new MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent(); 18904 parseMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesDosageComponentProperties(json, owner, res); 18905 return res; 18906 } 18907 18908 protected void parseMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesDosageComponentProperties( 18909 JsonObject json, MedicationKnowledge owner, 18910 MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent res) 18911 throws IOException, FHIRFormatError { 18912 parseBackboneElementProperties(json, res); 18913 if (json.has("type")) 18914 res.setType(parseCodeableConcept(getJObject(json, "type"))); 18915 if (json.has("dosage")) { 18916 JsonArray array = json.getAsJsonArray("dosage"); 18917 for (int i = 0; i < array.size(); i++) { 18918 res.getDosage().add(parseDosage(array.get(i).getAsJsonObject())); 18919 } 18920 } 18921 ; 18922 } 18923 18924 protected MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent parseMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent( 18925 JsonObject json, MedicationKnowledge owner) throws IOException, FHIRFormatError { 18926 MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent res = new MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(); 18927 parseMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponentProperties(json, 18928 owner, res); 18929 return res; 18930 } 18931 18932 protected void parseMedicationKnowledgeMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponentProperties( 18933 JsonObject json, MedicationKnowledge owner, 18934 MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent res) 18935 throws IOException, FHIRFormatError { 18936 parseBackboneElementProperties(json, res); 18937 Type characteristic = parseType("characteristic", json); 18938 if (characteristic != null) 18939 res.setCharacteristic(characteristic); 18940 if (json.has("value")) { 18941 JsonArray array = json.getAsJsonArray("value"); 18942 for (int i = 0; i < array.size(); i++) { 18943 if (array.get(i).isJsonNull()) { 18944 res.getValue().add(new StringType()); 18945 } else { 18946 res.getValue().add(parseString(array.get(i).getAsString())); 18947 } 18948 } 18949 } 18950 ; 18951 if (json.has("_value")) { 18952 JsonArray array = json.getAsJsonArray("_value"); 18953 for (int i = 0; i < array.size(); i++) { 18954 if (i == res.getValue().size()) 18955 res.getValue().add(parseString(null)); 18956 if (array.get(i) instanceof JsonObject) 18957 parseElementProperties(array.get(i).getAsJsonObject(), res.getValue().get(i)); 18958 } 18959 } 18960 ; 18961 } 18962 18963 protected MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent parseMedicationKnowledgeMedicationKnowledgeMedicineClassificationComponent( 18964 JsonObject json, MedicationKnowledge owner) throws IOException, FHIRFormatError { 18965 MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent res = new MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent(); 18966 parseMedicationKnowledgeMedicationKnowledgeMedicineClassificationComponentProperties(json, owner, res); 18967 return res; 18968 } 18969 18970 protected void parseMedicationKnowledgeMedicationKnowledgeMedicineClassificationComponentProperties(JsonObject json, 18971 MedicationKnowledge owner, MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent res) 18972 throws IOException, FHIRFormatError { 18973 parseBackboneElementProperties(json, res); 18974 if (json.has("type")) 18975 res.setType(parseCodeableConcept(getJObject(json, "type"))); 18976 if (json.has("classification")) { 18977 JsonArray array = json.getAsJsonArray("classification"); 18978 for (int i = 0; i < array.size(); i++) { 18979 res.getClassification().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 18980 } 18981 } 18982 ; 18983 } 18984 18985 protected MedicationKnowledge.MedicationKnowledgePackagingComponent parseMedicationKnowledgeMedicationKnowledgePackagingComponent( 18986 JsonObject json, MedicationKnowledge owner) throws IOException, FHIRFormatError { 18987 MedicationKnowledge.MedicationKnowledgePackagingComponent res = new MedicationKnowledge.MedicationKnowledgePackagingComponent(); 18988 parseMedicationKnowledgeMedicationKnowledgePackagingComponentProperties(json, owner, res); 18989 return res; 18990 } 18991 18992 protected void parseMedicationKnowledgeMedicationKnowledgePackagingComponentProperties(JsonObject json, 18993 MedicationKnowledge owner, MedicationKnowledge.MedicationKnowledgePackagingComponent res) 18994 throws IOException, FHIRFormatError { 18995 parseBackboneElementProperties(json, res); 18996 if (json.has("type")) 18997 res.setType(parseCodeableConcept(getJObject(json, "type"))); 18998 if (json.has("quantity")) 18999 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 19000 } 19001 19002 protected MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent parseMedicationKnowledgeMedicationKnowledgeDrugCharacteristicComponent( 19003 JsonObject json, MedicationKnowledge owner) throws IOException, FHIRFormatError { 19004 MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent res = new MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent(); 19005 parseMedicationKnowledgeMedicationKnowledgeDrugCharacteristicComponentProperties(json, owner, res); 19006 return res; 19007 } 19008 19009 protected void parseMedicationKnowledgeMedicationKnowledgeDrugCharacteristicComponentProperties(JsonObject json, 19010 MedicationKnowledge owner, MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent res) 19011 throws IOException, FHIRFormatError { 19012 parseBackboneElementProperties(json, res); 19013 if (json.has("type")) 19014 res.setType(parseCodeableConcept(getJObject(json, "type"))); 19015 Type value = parseType("value", json); 19016 if (value != null) 19017 res.setValue(value); 19018 } 19019 19020 protected MedicationKnowledge.MedicationKnowledgeRegulatoryComponent parseMedicationKnowledgeMedicationKnowledgeRegulatoryComponent( 19021 JsonObject json, MedicationKnowledge owner) throws IOException, FHIRFormatError { 19022 MedicationKnowledge.MedicationKnowledgeRegulatoryComponent res = new MedicationKnowledge.MedicationKnowledgeRegulatoryComponent(); 19023 parseMedicationKnowledgeMedicationKnowledgeRegulatoryComponentProperties(json, owner, res); 19024 return res; 19025 } 19026 19027 protected void parseMedicationKnowledgeMedicationKnowledgeRegulatoryComponentProperties(JsonObject json, 19028 MedicationKnowledge owner, MedicationKnowledge.MedicationKnowledgeRegulatoryComponent res) 19029 throws IOException, FHIRFormatError { 19030 parseBackboneElementProperties(json, res); 19031 if (json.has("regulatoryAuthority")) 19032 res.setRegulatoryAuthority(parseReference(getJObject(json, "regulatoryAuthority"))); 19033 if (json.has("substitution")) { 19034 JsonArray array = json.getAsJsonArray("substitution"); 19035 for (int i = 0; i < array.size(); i++) { 19036 res.getSubstitution().add(parseMedicationKnowledgeMedicationKnowledgeRegulatorySubstitutionComponent( 19037 array.get(i).getAsJsonObject(), owner)); 19038 } 19039 } 19040 ; 19041 if (json.has("schedule")) { 19042 JsonArray array = json.getAsJsonArray("schedule"); 19043 for (int i = 0; i < array.size(); i++) { 19044 res.getSchedule().add(parseMedicationKnowledgeMedicationKnowledgeRegulatoryScheduleComponent( 19045 array.get(i).getAsJsonObject(), owner)); 19046 } 19047 } 19048 ; 19049 if (json.has("maxDispense")) 19050 res.setMaxDispense(parseMedicationKnowledgeMedicationKnowledgeRegulatoryMaxDispenseComponent( 19051 getJObject(json, "maxDispense"), owner)); 19052 } 19053 19054 protected MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent parseMedicationKnowledgeMedicationKnowledgeRegulatorySubstitutionComponent( 19055 JsonObject json, MedicationKnowledge owner) throws IOException, FHIRFormatError { 19056 MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent res = new MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent(); 19057 parseMedicationKnowledgeMedicationKnowledgeRegulatorySubstitutionComponentProperties(json, owner, res); 19058 return res; 19059 } 19060 19061 protected void parseMedicationKnowledgeMedicationKnowledgeRegulatorySubstitutionComponentProperties(JsonObject json, 19062 MedicationKnowledge owner, MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent res) 19063 throws IOException, FHIRFormatError { 19064 parseBackboneElementProperties(json, res); 19065 if (json.has("type")) 19066 res.setType(parseCodeableConcept(getJObject(json, "type"))); 19067 if (json.has("allowed")) 19068 res.setAllowedElement(parseBoolean(json.get("allowed").getAsBoolean())); 19069 if (json.has("_allowed")) 19070 parseElementProperties(getJObject(json, "_allowed"), res.getAllowedElement()); 19071 } 19072 19073 protected MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent parseMedicationKnowledgeMedicationKnowledgeRegulatoryScheduleComponent( 19074 JsonObject json, MedicationKnowledge owner) throws IOException, FHIRFormatError { 19075 MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent res = new MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent(); 19076 parseMedicationKnowledgeMedicationKnowledgeRegulatoryScheduleComponentProperties(json, owner, res); 19077 return res; 19078 } 19079 19080 protected void parseMedicationKnowledgeMedicationKnowledgeRegulatoryScheduleComponentProperties(JsonObject json, 19081 MedicationKnowledge owner, MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent res) 19082 throws IOException, FHIRFormatError { 19083 parseBackboneElementProperties(json, res); 19084 if (json.has("schedule")) 19085 res.setSchedule(parseCodeableConcept(getJObject(json, "schedule"))); 19086 } 19087 19088 protected MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent parseMedicationKnowledgeMedicationKnowledgeRegulatoryMaxDispenseComponent( 19089 JsonObject json, MedicationKnowledge owner) throws IOException, FHIRFormatError { 19090 MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent res = new MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent(); 19091 parseMedicationKnowledgeMedicationKnowledgeRegulatoryMaxDispenseComponentProperties(json, owner, res); 19092 return res; 19093 } 19094 19095 protected void parseMedicationKnowledgeMedicationKnowledgeRegulatoryMaxDispenseComponentProperties(JsonObject json, 19096 MedicationKnowledge owner, MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent res) 19097 throws IOException, FHIRFormatError { 19098 parseBackboneElementProperties(json, res); 19099 if (json.has("quantity")) 19100 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 19101 if (json.has("period")) 19102 res.setPeriod(parseDuration(getJObject(json, "period"))); 19103 } 19104 19105 protected MedicationKnowledge.MedicationKnowledgeKineticsComponent parseMedicationKnowledgeMedicationKnowledgeKineticsComponent( 19106 JsonObject json, MedicationKnowledge owner) throws IOException, FHIRFormatError { 19107 MedicationKnowledge.MedicationKnowledgeKineticsComponent res = new MedicationKnowledge.MedicationKnowledgeKineticsComponent(); 19108 parseMedicationKnowledgeMedicationKnowledgeKineticsComponentProperties(json, owner, res); 19109 return res; 19110 } 19111 19112 protected void parseMedicationKnowledgeMedicationKnowledgeKineticsComponentProperties(JsonObject json, 19113 MedicationKnowledge owner, MedicationKnowledge.MedicationKnowledgeKineticsComponent res) 19114 throws IOException, FHIRFormatError { 19115 parseBackboneElementProperties(json, res); 19116 if (json.has("areaUnderCurve")) { 19117 JsonArray array = json.getAsJsonArray("areaUnderCurve"); 19118 for (int i = 0; i < array.size(); i++) { 19119 res.getAreaUnderCurve().add(parseQuantity(array.get(i).getAsJsonObject())); 19120 } 19121 } 19122 ; 19123 if (json.has("lethalDose50")) { 19124 JsonArray array = json.getAsJsonArray("lethalDose50"); 19125 for (int i = 0; i < array.size(); i++) { 19126 res.getLethalDose50().add(parseQuantity(array.get(i).getAsJsonObject())); 19127 } 19128 } 19129 ; 19130 if (json.has("halfLifePeriod")) 19131 res.setHalfLifePeriod(parseDuration(getJObject(json, "halfLifePeriod"))); 19132 } 19133 19134 protected MedicationRequest parseMedicationRequest(JsonObject json) throws IOException, FHIRFormatError { 19135 MedicationRequest res = new MedicationRequest(); 19136 parseMedicationRequestProperties(json, res); 19137 return res; 19138 } 19139 19140 protected void parseMedicationRequestProperties(JsonObject json, MedicationRequest res) 19141 throws IOException, FHIRFormatError { 19142 parseDomainResourceProperties(json, res); 19143 if (json.has("identifier")) { 19144 JsonArray array = json.getAsJsonArray("identifier"); 19145 for (int i = 0; i < array.size(); i++) { 19146 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 19147 } 19148 } 19149 ; 19150 if (json.has("status")) 19151 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), 19152 MedicationRequest.MedicationRequestStatus.NULL, new MedicationRequest.MedicationRequestStatusEnumFactory())); 19153 if (json.has("_status")) 19154 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 19155 if (json.has("statusReason")) 19156 res.setStatusReason(parseCodeableConcept(getJObject(json, "statusReason"))); 19157 if (json.has("intent")) 19158 res.setIntentElement(parseEnumeration(json.get("intent").getAsString(), 19159 MedicationRequest.MedicationRequestIntent.NULL, new MedicationRequest.MedicationRequestIntentEnumFactory())); 19160 if (json.has("_intent")) 19161 parseElementProperties(getJObject(json, "_intent"), res.getIntentElement()); 19162 if (json.has("category")) { 19163 JsonArray array = json.getAsJsonArray("category"); 19164 for (int i = 0; i < array.size(); i++) { 19165 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 19166 } 19167 } 19168 ; 19169 if (json.has("priority")) 19170 res.setPriorityElement( 19171 parseEnumeration(json.get("priority").getAsString(), MedicationRequest.MedicationRequestPriority.NULL, 19172 new MedicationRequest.MedicationRequestPriorityEnumFactory())); 19173 if (json.has("_priority")) 19174 parseElementProperties(getJObject(json, "_priority"), res.getPriorityElement()); 19175 if (json.has("doNotPerform")) 19176 res.setDoNotPerformElement(parseBoolean(json.get("doNotPerform").getAsBoolean())); 19177 if (json.has("_doNotPerform")) 19178 parseElementProperties(getJObject(json, "_doNotPerform"), res.getDoNotPerformElement()); 19179 Type reported = parseType("reported", json); 19180 if (reported != null) 19181 res.setReported(reported); 19182 Type medication = parseType("medication", json); 19183 if (medication != null) 19184 res.setMedication(medication); 19185 if (json.has("subject")) 19186 res.setSubject(parseReference(getJObject(json, "subject"))); 19187 if (json.has("encounter")) 19188 res.setEncounter(parseReference(getJObject(json, "encounter"))); 19189 if (json.has("supportingInformation")) { 19190 JsonArray array = json.getAsJsonArray("supportingInformation"); 19191 for (int i = 0; i < array.size(); i++) { 19192 res.getSupportingInformation().add(parseReference(array.get(i).getAsJsonObject())); 19193 } 19194 } 19195 ; 19196 if (json.has("authoredOn")) 19197 res.setAuthoredOnElement(parseDateTime(json.get("authoredOn").getAsString())); 19198 if (json.has("_authoredOn")) 19199 parseElementProperties(getJObject(json, "_authoredOn"), res.getAuthoredOnElement()); 19200 if (json.has("requester")) 19201 res.setRequester(parseReference(getJObject(json, "requester"))); 19202 if (json.has("performer")) 19203 res.setPerformer(parseReference(getJObject(json, "performer"))); 19204 if (json.has("performerType")) 19205 res.setPerformerType(parseCodeableConcept(getJObject(json, "performerType"))); 19206 if (json.has("recorder")) 19207 res.setRecorder(parseReference(getJObject(json, "recorder"))); 19208 if (json.has("reasonCode")) { 19209 JsonArray array = json.getAsJsonArray("reasonCode"); 19210 for (int i = 0; i < array.size(); i++) { 19211 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 19212 } 19213 } 19214 ; 19215 if (json.has("reasonReference")) { 19216 JsonArray array = json.getAsJsonArray("reasonReference"); 19217 for (int i = 0; i < array.size(); i++) { 19218 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 19219 } 19220 } 19221 ; 19222 if (json.has("instantiatesCanonical")) { 19223 JsonArray array = json.getAsJsonArray("instantiatesCanonical"); 19224 for (int i = 0; i < array.size(); i++) { 19225 if (array.get(i).isJsonNull()) { 19226 res.getInstantiatesCanonical().add(new CanonicalType()); 19227 } else { 19228 res.getInstantiatesCanonical().add(parseCanonical(array.get(i).getAsString())); 19229 } 19230 } 19231 } 19232 ; 19233 if (json.has("_instantiatesCanonical")) { 19234 JsonArray array = json.getAsJsonArray("_instantiatesCanonical"); 19235 for (int i = 0; i < array.size(); i++) { 19236 if (i == res.getInstantiatesCanonical().size()) 19237 res.getInstantiatesCanonical().add(parseCanonical(null)); 19238 if (array.get(i) instanceof JsonObject) 19239 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesCanonical().get(i)); 19240 } 19241 } 19242 ; 19243 if (json.has("instantiatesUri")) { 19244 JsonArray array = json.getAsJsonArray("instantiatesUri"); 19245 for (int i = 0; i < array.size(); i++) { 19246 if (array.get(i).isJsonNull()) { 19247 res.getInstantiatesUri().add(new UriType()); 19248 } else { 19249 res.getInstantiatesUri().add(parseUri(array.get(i).getAsString())); 19250 } 19251 } 19252 } 19253 ; 19254 if (json.has("_instantiatesUri")) { 19255 JsonArray array = json.getAsJsonArray("_instantiatesUri"); 19256 for (int i = 0; i < array.size(); i++) { 19257 if (i == res.getInstantiatesUri().size()) 19258 res.getInstantiatesUri().add(parseUri(null)); 19259 if (array.get(i) instanceof JsonObject) 19260 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesUri().get(i)); 19261 } 19262 } 19263 ; 19264 if (json.has("basedOn")) { 19265 JsonArray array = json.getAsJsonArray("basedOn"); 19266 for (int i = 0; i < array.size(); i++) { 19267 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 19268 } 19269 } 19270 ; 19271 if (json.has("groupIdentifier")) 19272 res.setGroupIdentifier(parseIdentifier(getJObject(json, "groupIdentifier"))); 19273 if (json.has("courseOfTherapyType")) 19274 res.setCourseOfTherapyType(parseCodeableConcept(getJObject(json, "courseOfTherapyType"))); 19275 if (json.has("insurance")) { 19276 JsonArray array = json.getAsJsonArray("insurance"); 19277 for (int i = 0; i < array.size(); i++) { 19278 res.getInsurance().add(parseReference(array.get(i).getAsJsonObject())); 19279 } 19280 } 19281 ; 19282 if (json.has("note")) { 19283 JsonArray array = json.getAsJsonArray("note"); 19284 for (int i = 0; i < array.size(); i++) { 19285 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 19286 } 19287 } 19288 ; 19289 if (json.has("dosageInstruction")) { 19290 JsonArray array = json.getAsJsonArray("dosageInstruction"); 19291 for (int i = 0; i < array.size(); i++) { 19292 res.getDosageInstruction().add(parseDosage(array.get(i).getAsJsonObject())); 19293 } 19294 } 19295 ; 19296 if (json.has("dispenseRequest")) 19297 res.setDispenseRequest( 19298 parseMedicationRequestMedicationRequestDispenseRequestComponent(getJObject(json, "dispenseRequest"), res)); 19299 if (json.has("substitution")) 19300 res.setSubstitution( 19301 parseMedicationRequestMedicationRequestSubstitutionComponent(getJObject(json, "substitution"), res)); 19302 if (json.has("priorPrescription")) 19303 res.setPriorPrescription(parseReference(getJObject(json, "priorPrescription"))); 19304 if (json.has("detectedIssue")) { 19305 JsonArray array = json.getAsJsonArray("detectedIssue"); 19306 for (int i = 0; i < array.size(); i++) { 19307 res.getDetectedIssue().add(parseReference(array.get(i).getAsJsonObject())); 19308 } 19309 } 19310 ; 19311 if (json.has("eventHistory")) { 19312 JsonArray array = json.getAsJsonArray("eventHistory"); 19313 for (int i = 0; i < array.size(); i++) { 19314 res.getEventHistory().add(parseReference(array.get(i).getAsJsonObject())); 19315 } 19316 } 19317 ; 19318 } 19319 19320 protected MedicationRequest.MedicationRequestDispenseRequestComponent parseMedicationRequestMedicationRequestDispenseRequestComponent( 19321 JsonObject json, MedicationRequest owner) throws IOException, FHIRFormatError { 19322 MedicationRequest.MedicationRequestDispenseRequestComponent res = new MedicationRequest.MedicationRequestDispenseRequestComponent(); 19323 parseMedicationRequestMedicationRequestDispenseRequestComponentProperties(json, owner, res); 19324 return res; 19325 } 19326 19327 protected void parseMedicationRequestMedicationRequestDispenseRequestComponentProperties(JsonObject json, 19328 MedicationRequest owner, MedicationRequest.MedicationRequestDispenseRequestComponent res) 19329 throws IOException, FHIRFormatError { 19330 parseBackboneElementProperties(json, res); 19331 if (json.has("initialFill")) 19332 res.setInitialFill(parseMedicationRequestMedicationRequestDispenseRequestInitialFillComponent( 19333 getJObject(json, "initialFill"), owner)); 19334 if (json.has("dispenseInterval")) 19335 res.setDispenseInterval(parseDuration(getJObject(json, "dispenseInterval"))); 19336 if (json.has("validityPeriod")) 19337 res.setValidityPeriod(parsePeriod(getJObject(json, "validityPeriod"))); 19338 if (json.has("numberOfRepeatsAllowed")) 19339 res.setNumberOfRepeatsAllowedElement(parseUnsignedInt(json.get("numberOfRepeatsAllowed").getAsString())); 19340 if (json.has("_numberOfRepeatsAllowed")) 19341 parseElementProperties(getJObject(json, "_numberOfRepeatsAllowed"), res.getNumberOfRepeatsAllowedElement()); 19342 if (json.has("quantity")) 19343 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 19344 if (json.has("expectedSupplyDuration")) 19345 res.setExpectedSupplyDuration(parseDuration(getJObject(json, "expectedSupplyDuration"))); 19346 if (json.has("performer")) 19347 res.setPerformer(parseReference(getJObject(json, "performer"))); 19348 } 19349 19350 protected MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent parseMedicationRequestMedicationRequestDispenseRequestInitialFillComponent( 19351 JsonObject json, MedicationRequest owner) throws IOException, FHIRFormatError { 19352 MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent res = new MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent(); 19353 parseMedicationRequestMedicationRequestDispenseRequestInitialFillComponentProperties(json, owner, res); 19354 return res; 19355 } 19356 19357 protected void parseMedicationRequestMedicationRequestDispenseRequestInitialFillComponentProperties(JsonObject json, 19358 MedicationRequest owner, MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent res) 19359 throws IOException, FHIRFormatError { 19360 parseBackboneElementProperties(json, res); 19361 if (json.has("quantity")) 19362 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 19363 if (json.has("duration")) 19364 res.setDuration(parseDuration(getJObject(json, "duration"))); 19365 } 19366 19367 protected MedicationRequest.MedicationRequestSubstitutionComponent parseMedicationRequestMedicationRequestSubstitutionComponent( 19368 JsonObject json, MedicationRequest owner) throws IOException, FHIRFormatError { 19369 MedicationRequest.MedicationRequestSubstitutionComponent res = new MedicationRequest.MedicationRequestSubstitutionComponent(); 19370 parseMedicationRequestMedicationRequestSubstitutionComponentProperties(json, owner, res); 19371 return res; 19372 } 19373 19374 protected void parseMedicationRequestMedicationRequestSubstitutionComponentProperties(JsonObject json, 19375 MedicationRequest owner, MedicationRequest.MedicationRequestSubstitutionComponent res) 19376 throws IOException, FHIRFormatError { 19377 parseBackboneElementProperties(json, res); 19378 Type allowed = parseType("allowed", json); 19379 if (allowed != null) 19380 res.setAllowed(allowed); 19381 if (json.has("reason")) 19382 res.setReason(parseCodeableConcept(getJObject(json, "reason"))); 19383 } 19384 19385 protected MedicationStatement parseMedicationStatement(JsonObject json) throws IOException, FHIRFormatError { 19386 MedicationStatement res = new MedicationStatement(); 19387 parseMedicationStatementProperties(json, res); 19388 return res; 19389 } 19390 19391 protected void parseMedicationStatementProperties(JsonObject json, MedicationStatement res) 19392 throws IOException, FHIRFormatError { 19393 parseDomainResourceProperties(json, res); 19394 if (json.has("identifier")) { 19395 JsonArray array = json.getAsJsonArray("identifier"); 19396 for (int i = 0; i < array.size(); i++) { 19397 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 19398 } 19399 } 19400 ; 19401 if (json.has("basedOn")) { 19402 JsonArray array = json.getAsJsonArray("basedOn"); 19403 for (int i = 0; i < array.size(); i++) { 19404 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 19405 } 19406 } 19407 ; 19408 if (json.has("partOf")) { 19409 JsonArray array = json.getAsJsonArray("partOf"); 19410 for (int i = 0; i < array.size(); i++) { 19411 res.getPartOf().add(parseReference(array.get(i).getAsJsonObject())); 19412 } 19413 } 19414 ; 19415 if (json.has("status")) 19416 res.setStatusElement( 19417 parseEnumeration(json.get("status").getAsString(), MedicationStatement.MedicationStatementStatus.NULL, 19418 new MedicationStatement.MedicationStatementStatusEnumFactory())); 19419 if (json.has("_status")) 19420 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 19421 if (json.has("statusReason")) { 19422 JsonArray array = json.getAsJsonArray("statusReason"); 19423 for (int i = 0; i < array.size(); i++) { 19424 res.getStatusReason().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 19425 } 19426 } 19427 ; 19428 if (json.has("category")) 19429 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 19430 Type medication = parseType("medication", json); 19431 if (medication != null) 19432 res.setMedication(medication); 19433 if (json.has("subject")) 19434 res.setSubject(parseReference(getJObject(json, "subject"))); 19435 if (json.has("context")) 19436 res.setContext(parseReference(getJObject(json, "context"))); 19437 Type effective = parseType("effective", json); 19438 if (effective != null) 19439 res.setEffective(effective); 19440 if (json.has("dateAsserted")) 19441 res.setDateAssertedElement(parseDateTime(json.get("dateAsserted").getAsString())); 19442 if (json.has("_dateAsserted")) 19443 parseElementProperties(getJObject(json, "_dateAsserted"), res.getDateAssertedElement()); 19444 if (json.has("informationSource")) 19445 res.setInformationSource(parseReference(getJObject(json, "informationSource"))); 19446 if (json.has("derivedFrom")) { 19447 JsonArray array = json.getAsJsonArray("derivedFrom"); 19448 for (int i = 0; i < array.size(); i++) { 19449 res.getDerivedFrom().add(parseReference(array.get(i).getAsJsonObject())); 19450 } 19451 } 19452 ; 19453 if (json.has("reasonCode")) { 19454 JsonArray array = json.getAsJsonArray("reasonCode"); 19455 for (int i = 0; i < array.size(); i++) { 19456 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 19457 } 19458 } 19459 ; 19460 if (json.has("reasonReference")) { 19461 JsonArray array = json.getAsJsonArray("reasonReference"); 19462 for (int i = 0; i < array.size(); i++) { 19463 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 19464 } 19465 } 19466 ; 19467 if (json.has("note")) { 19468 JsonArray array = json.getAsJsonArray("note"); 19469 for (int i = 0; i < array.size(); i++) { 19470 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 19471 } 19472 } 19473 ; 19474 if (json.has("dosage")) { 19475 JsonArray array = json.getAsJsonArray("dosage"); 19476 for (int i = 0; i < array.size(); i++) { 19477 res.getDosage().add(parseDosage(array.get(i).getAsJsonObject())); 19478 } 19479 } 19480 ; 19481 } 19482 19483 protected MedicinalProduct parseMedicinalProduct(JsonObject json) throws IOException, FHIRFormatError { 19484 MedicinalProduct res = new MedicinalProduct(); 19485 parseMedicinalProductProperties(json, res); 19486 return res; 19487 } 19488 19489 protected void parseMedicinalProductProperties(JsonObject json, MedicinalProduct res) 19490 throws IOException, FHIRFormatError { 19491 parseDomainResourceProperties(json, res); 19492 if (json.has("identifier")) { 19493 JsonArray array = json.getAsJsonArray("identifier"); 19494 for (int i = 0; i < array.size(); i++) { 19495 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 19496 } 19497 } 19498 ; 19499 if (json.has("type")) 19500 res.setType(parseCodeableConcept(getJObject(json, "type"))); 19501 if (json.has("domain")) 19502 res.setDomain(parseCoding(getJObject(json, "domain"))); 19503 if (json.has("combinedPharmaceuticalDoseForm")) 19504 res.setCombinedPharmaceuticalDoseForm(parseCodeableConcept(getJObject(json, "combinedPharmaceuticalDoseForm"))); 19505 if (json.has("legalStatusOfSupply")) 19506 res.setLegalStatusOfSupply(parseCodeableConcept(getJObject(json, "legalStatusOfSupply"))); 19507 if (json.has("additionalMonitoringIndicator")) 19508 res.setAdditionalMonitoringIndicator(parseCodeableConcept(getJObject(json, "additionalMonitoringIndicator"))); 19509 if (json.has("specialMeasures")) { 19510 JsonArray array = json.getAsJsonArray("specialMeasures"); 19511 for (int i = 0; i < array.size(); i++) { 19512 if (array.get(i).isJsonNull()) { 19513 res.getSpecialMeasures().add(new StringType()); 19514 } else { 19515 res.getSpecialMeasures().add(parseString(array.get(i).getAsString())); 19516 } 19517 } 19518 } 19519 ; 19520 if (json.has("_specialMeasures")) { 19521 JsonArray array = json.getAsJsonArray("_specialMeasures"); 19522 for (int i = 0; i < array.size(); i++) { 19523 if (i == res.getSpecialMeasures().size()) 19524 res.getSpecialMeasures().add(parseString(null)); 19525 if (array.get(i) instanceof JsonObject) 19526 parseElementProperties(array.get(i).getAsJsonObject(), res.getSpecialMeasures().get(i)); 19527 } 19528 } 19529 ; 19530 if (json.has("paediatricUseIndicator")) 19531 res.setPaediatricUseIndicator(parseCodeableConcept(getJObject(json, "paediatricUseIndicator"))); 19532 if (json.has("productClassification")) { 19533 JsonArray array = json.getAsJsonArray("productClassification"); 19534 for (int i = 0; i < array.size(); i++) { 19535 res.getProductClassification().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 19536 } 19537 } 19538 ; 19539 if (json.has("marketingStatus")) { 19540 JsonArray array = json.getAsJsonArray("marketingStatus"); 19541 for (int i = 0; i < array.size(); i++) { 19542 res.getMarketingStatus().add(parseMarketingStatus(array.get(i).getAsJsonObject())); 19543 } 19544 } 19545 ; 19546 if (json.has("pharmaceuticalProduct")) { 19547 JsonArray array = json.getAsJsonArray("pharmaceuticalProduct"); 19548 for (int i = 0; i < array.size(); i++) { 19549 res.getPharmaceuticalProduct().add(parseReference(array.get(i).getAsJsonObject())); 19550 } 19551 } 19552 ; 19553 if (json.has("packagedMedicinalProduct")) { 19554 JsonArray array = json.getAsJsonArray("packagedMedicinalProduct"); 19555 for (int i = 0; i < array.size(); i++) { 19556 res.getPackagedMedicinalProduct().add(parseReference(array.get(i).getAsJsonObject())); 19557 } 19558 } 19559 ; 19560 if (json.has("attachedDocument")) { 19561 JsonArray array = json.getAsJsonArray("attachedDocument"); 19562 for (int i = 0; i < array.size(); i++) { 19563 res.getAttachedDocument().add(parseReference(array.get(i).getAsJsonObject())); 19564 } 19565 } 19566 ; 19567 if (json.has("masterFile")) { 19568 JsonArray array = json.getAsJsonArray("masterFile"); 19569 for (int i = 0; i < array.size(); i++) { 19570 res.getMasterFile().add(parseReference(array.get(i).getAsJsonObject())); 19571 } 19572 } 19573 ; 19574 if (json.has("contact")) { 19575 JsonArray array = json.getAsJsonArray("contact"); 19576 for (int i = 0; i < array.size(); i++) { 19577 res.getContact().add(parseReference(array.get(i).getAsJsonObject())); 19578 } 19579 } 19580 ; 19581 if (json.has("clinicalTrial")) { 19582 JsonArray array = json.getAsJsonArray("clinicalTrial"); 19583 for (int i = 0; i < array.size(); i++) { 19584 res.getClinicalTrial().add(parseReference(array.get(i).getAsJsonObject())); 19585 } 19586 } 19587 ; 19588 if (json.has("name")) { 19589 JsonArray array = json.getAsJsonArray("name"); 19590 for (int i = 0; i < array.size(); i++) { 19591 res.getName().add(parseMedicinalProductMedicinalProductNameComponent(array.get(i).getAsJsonObject(), res)); 19592 } 19593 } 19594 ; 19595 if (json.has("crossReference")) { 19596 JsonArray array = json.getAsJsonArray("crossReference"); 19597 for (int i = 0; i < array.size(); i++) { 19598 res.getCrossReference().add(parseIdentifier(array.get(i).getAsJsonObject())); 19599 } 19600 } 19601 ; 19602 if (json.has("manufacturingBusinessOperation")) { 19603 JsonArray array = json.getAsJsonArray("manufacturingBusinessOperation"); 19604 for (int i = 0; i < array.size(); i++) { 19605 res.getManufacturingBusinessOperation().add( 19606 parseMedicinalProductMedicinalProductManufacturingBusinessOperationComponent(array.get(i).getAsJsonObject(), 19607 res)); 19608 } 19609 } 19610 ; 19611 if (json.has("specialDesignation")) { 19612 JsonArray array = json.getAsJsonArray("specialDesignation"); 19613 for (int i = 0; i < array.size(); i++) { 19614 res.getSpecialDesignation() 19615 .add(parseMedicinalProductMedicinalProductSpecialDesignationComponent(array.get(i).getAsJsonObject(), res)); 19616 } 19617 } 19618 ; 19619 } 19620 19621 protected MedicinalProduct.MedicinalProductNameComponent parseMedicinalProductMedicinalProductNameComponent( 19622 JsonObject json, MedicinalProduct owner) throws IOException, FHIRFormatError { 19623 MedicinalProduct.MedicinalProductNameComponent res = new MedicinalProduct.MedicinalProductNameComponent(); 19624 parseMedicinalProductMedicinalProductNameComponentProperties(json, owner, res); 19625 return res; 19626 } 19627 19628 protected void parseMedicinalProductMedicinalProductNameComponentProperties(JsonObject json, MedicinalProduct owner, 19629 MedicinalProduct.MedicinalProductNameComponent res) throws IOException, FHIRFormatError { 19630 parseBackboneElementProperties(json, res); 19631 if (json.has("productName")) 19632 res.setProductNameElement(parseString(json.get("productName").getAsString())); 19633 if (json.has("_productName")) 19634 parseElementProperties(getJObject(json, "_productName"), res.getProductNameElement()); 19635 if (json.has("namePart")) { 19636 JsonArray array = json.getAsJsonArray("namePart"); 19637 for (int i = 0; i < array.size(); i++) { 19638 res.getNamePart() 19639 .add(parseMedicinalProductMedicinalProductNameNamePartComponent(array.get(i).getAsJsonObject(), owner)); 19640 } 19641 } 19642 ; 19643 if (json.has("countryLanguage")) { 19644 JsonArray array = json.getAsJsonArray("countryLanguage"); 19645 for (int i = 0; i < array.size(); i++) { 19646 res.getCountryLanguage().add( 19647 parseMedicinalProductMedicinalProductNameCountryLanguageComponent(array.get(i).getAsJsonObject(), owner)); 19648 } 19649 } 19650 ; 19651 } 19652 19653 protected MedicinalProduct.MedicinalProductNameNamePartComponent parseMedicinalProductMedicinalProductNameNamePartComponent( 19654 JsonObject json, MedicinalProduct owner) throws IOException, FHIRFormatError { 19655 MedicinalProduct.MedicinalProductNameNamePartComponent res = new MedicinalProduct.MedicinalProductNameNamePartComponent(); 19656 parseMedicinalProductMedicinalProductNameNamePartComponentProperties(json, owner, res); 19657 return res; 19658 } 19659 19660 protected void parseMedicinalProductMedicinalProductNameNamePartComponentProperties(JsonObject json, 19661 MedicinalProduct owner, MedicinalProduct.MedicinalProductNameNamePartComponent res) 19662 throws IOException, FHIRFormatError { 19663 parseBackboneElementProperties(json, res); 19664 if (json.has("part")) 19665 res.setPartElement(parseString(json.get("part").getAsString())); 19666 if (json.has("_part")) 19667 parseElementProperties(getJObject(json, "_part"), res.getPartElement()); 19668 if (json.has("type")) 19669 res.setType(parseCoding(getJObject(json, "type"))); 19670 } 19671 19672 protected MedicinalProduct.MedicinalProductNameCountryLanguageComponent parseMedicinalProductMedicinalProductNameCountryLanguageComponent( 19673 JsonObject json, MedicinalProduct owner) throws IOException, FHIRFormatError { 19674 MedicinalProduct.MedicinalProductNameCountryLanguageComponent res = new MedicinalProduct.MedicinalProductNameCountryLanguageComponent(); 19675 parseMedicinalProductMedicinalProductNameCountryLanguageComponentProperties(json, owner, res); 19676 return res; 19677 } 19678 19679 protected void parseMedicinalProductMedicinalProductNameCountryLanguageComponentProperties(JsonObject json, 19680 MedicinalProduct owner, MedicinalProduct.MedicinalProductNameCountryLanguageComponent res) 19681 throws IOException, FHIRFormatError { 19682 parseBackboneElementProperties(json, res); 19683 if (json.has("country")) 19684 res.setCountry(parseCodeableConcept(getJObject(json, "country"))); 19685 if (json.has("jurisdiction")) 19686 res.setJurisdiction(parseCodeableConcept(getJObject(json, "jurisdiction"))); 19687 if (json.has("language")) 19688 res.setLanguage(parseCodeableConcept(getJObject(json, "language"))); 19689 } 19690 19691 protected MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent parseMedicinalProductMedicinalProductManufacturingBusinessOperationComponent( 19692 JsonObject json, MedicinalProduct owner) throws IOException, FHIRFormatError { 19693 MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent res = new MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent(); 19694 parseMedicinalProductMedicinalProductManufacturingBusinessOperationComponentProperties(json, owner, res); 19695 return res; 19696 } 19697 19698 protected void parseMedicinalProductMedicinalProductManufacturingBusinessOperationComponentProperties(JsonObject json, 19699 MedicinalProduct owner, MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent res) 19700 throws IOException, FHIRFormatError { 19701 parseBackboneElementProperties(json, res); 19702 if (json.has("operationType")) 19703 res.setOperationType(parseCodeableConcept(getJObject(json, "operationType"))); 19704 if (json.has("authorisationReferenceNumber")) 19705 res.setAuthorisationReferenceNumber(parseIdentifier(getJObject(json, "authorisationReferenceNumber"))); 19706 if (json.has("effectiveDate")) 19707 res.setEffectiveDateElement(parseDateTime(json.get("effectiveDate").getAsString())); 19708 if (json.has("_effectiveDate")) 19709 parseElementProperties(getJObject(json, "_effectiveDate"), res.getEffectiveDateElement()); 19710 if (json.has("confidentialityIndicator")) 19711 res.setConfidentialityIndicator(parseCodeableConcept(getJObject(json, "confidentialityIndicator"))); 19712 if (json.has("manufacturer")) { 19713 JsonArray array = json.getAsJsonArray("manufacturer"); 19714 for (int i = 0; i < array.size(); i++) { 19715 res.getManufacturer().add(parseReference(array.get(i).getAsJsonObject())); 19716 } 19717 } 19718 ; 19719 if (json.has("regulator")) 19720 res.setRegulator(parseReference(getJObject(json, "regulator"))); 19721 } 19722 19723 protected MedicinalProduct.MedicinalProductSpecialDesignationComponent parseMedicinalProductMedicinalProductSpecialDesignationComponent( 19724 JsonObject json, MedicinalProduct owner) throws IOException, FHIRFormatError { 19725 MedicinalProduct.MedicinalProductSpecialDesignationComponent res = new MedicinalProduct.MedicinalProductSpecialDesignationComponent(); 19726 parseMedicinalProductMedicinalProductSpecialDesignationComponentProperties(json, owner, res); 19727 return res; 19728 } 19729 19730 protected void parseMedicinalProductMedicinalProductSpecialDesignationComponentProperties(JsonObject json, 19731 MedicinalProduct owner, MedicinalProduct.MedicinalProductSpecialDesignationComponent res) 19732 throws IOException, FHIRFormatError { 19733 parseBackboneElementProperties(json, res); 19734 if (json.has("identifier")) { 19735 JsonArray array = json.getAsJsonArray("identifier"); 19736 for (int i = 0; i < array.size(); i++) { 19737 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 19738 } 19739 } 19740 ; 19741 if (json.has("type")) 19742 res.setType(parseCodeableConcept(getJObject(json, "type"))); 19743 if (json.has("intendedUse")) 19744 res.setIntendedUse(parseCodeableConcept(getJObject(json, "intendedUse"))); 19745 Type indication = parseType("indication", json); 19746 if (indication != null) 19747 res.setIndication(indication); 19748 if (json.has("status")) 19749 res.setStatus(parseCodeableConcept(getJObject(json, "status"))); 19750 if (json.has("date")) 19751 res.setDateElement(parseDateTime(json.get("date").getAsString())); 19752 if (json.has("_date")) 19753 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 19754 if (json.has("species")) 19755 res.setSpecies(parseCodeableConcept(getJObject(json, "species"))); 19756 } 19757 19758 protected MedicinalProductAuthorization parseMedicinalProductAuthorization(JsonObject json) 19759 throws IOException, FHIRFormatError { 19760 MedicinalProductAuthorization res = new MedicinalProductAuthorization(); 19761 parseMedicinalProductAuthorizationProperties(json, res); 19762 return res; 19763 } 19764 19765 protected void parseMedicinalProductAuthorizationProperties(JsonObject json, MedicinalProductAuthorization res) 19766 throws IOException, FHIRFormatError { 19767 parseDomainResourceProperties(json, res); 19768 if (json.has("identifier")) { 19769 JsonArray array = json.getAsJsonArray("identifier"); 19770 for (int i = 0; i < array.size(); i++) { 19771 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 19772 } 19773 } 19774 ; 19775 if (json.has("subject")) 19776 res.setSubject(parseReference(getJObject(json, "subject"))); 19777 if (json.has("country")) { 19778 JsonArray array = json.getAsJsonArray("country"); 19779 for (int i = 0; i < array.size(); i++) { 19780 res.getCountry().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 19781 } 19782 } 19783 ; 19784 if (json.has("jurisdiction")) { 19785 JsonArray array = json.getAsJsonArray("jurisdiction"); 19786 for (int i = 0; i < array.size(); i++) { 19787 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 19788 } 19789 } 19790 ; 19791 if (json.has("status")) 19792 res.setStatus(parseCodeableConcept(getJObject(json, "status"))); 19793 if (json.has("statusDate")) 19794 res.setStatusDateElement(parseDateTime(json.get("statusDate").getAsString())); 19795 if (json.has("_statusDate")) 19796 parseElementProperties(getJObject(json, "_statusDate"), res.getStatusDateElement()); 19797 if (json.has("restoreDate")) 19798 res.setRestoreDateElement(parseDateTime(json.get("restoreDate").getAsString())); 19799 if (json.has("_restoreDate")) 19800 parseElementProperties(getJObject(json, "_restoreDate"), res.getRestoreDateElement()); 19801 if (json.has("validityPeriod")) 19802 res.setValidityPeriod(parsePeriod(getJObject(json, "validityPeriod"))); 19803 if (json.has("dataExclusivityPeriod")) 19804 res.setDataExclusivityPeriod(parsePeriod(getJObject(json, "dataExclusivityPeriod"))); 19805 if (json.has("dateOfFirstAuthorization")) 19806 res.setDateOfFirstAuthorizationElement(parseDateTime(json.get("dateOfFirstAuthorization").getAsString())); 19807 if (json.has("_dateOfFirstAuthorization")) 19808 parseElementProperties(getJObject(json, "_dateOfFirstAuthorization"), res.getDateOfFirstAuthorizationElement()); 19809 if (json.has("internationalBirthDate")) 19810 res.setInternationalBirthDateElement(parseDateTime(json.get("internationalBirthDate").getAsString())); 19811 if (json.has("_internationalBirthDate")) 19812 parseElementProperties(getJObject(json, "_internationalBirthDate"), res.getInternationalBirthDateElement()); 19813 if (json.has("legalBasis")) 19814 res.setLegalBasis(parseCodeableConcept(getJObject(json, "legalBasis"))); 19815 if (json.has("jurisdictionalAuthorization")) { 19816 JsonArray array = json.getAsJsonArray("jurisdictionalAuthorization"); 19817 for (int i = 0; i < array.size(); i++) { 19818 res.getJurisdictionalAuthorization() 19819 .add(parseMedicinalProductAuthorizationMedicinalProductAuthorizationJurisdictionalAuthorizationComponent( 19820 array.get(i).getAsJsonObject(), res)); 19821 } 19822 } 19823 ; 19824 if (json.has("holder")) 19825 res.setHolder(parseReference(getJObject(json, "holder"))); 19826 if (json.has("regulator")) 19827 res.setRegulator(parseReference(getJObject(json, "regulator"))); 19828 if (json.has("procedure")) 19829 res.setProcedure(parseMedicinalProductAuthorizationMedicinalProductAuthorizationProcedureComponent( 19830 getJObject(json, "procedure"), res)); 19831 } 19832 19833 protected MedicinalProductAuthorization.MedicinalProductAuthorizationJurisdictionalAuthorizationComponent parseMedicinalProductAuthorizationMedicinalProductAuthorizationJurisdictionalAuthorizationComponent( 19834 JsonObject json, MedicinalProductAuthorization owner) throws IOException, FHIRFormatError { 19835 MedicinalProductAuthorization.MedicinalProductAuthorizationJurisdictionalAuthorizationComponent res = new MedicinalProductAuthorization.MedicinalProductAuthorizationJurisdictionalAuthorizationComponent(); 19836 parseMedicinalProductAuthorizationMedicinalProductAuthorizationJurisdictionalAuthorizationComponentProperties(json, 19837 owner, res); 19838 return res; 19839 } 19840 19841 protected void parseMedicinalProductAuthorizationMedicinalProductAuthorizationJurisdictionalAuthorizationComponentProperties( 19842 JsonObject json, MedicinalProductAuthorization owner, 19843 MedicinalProductAuthorization.MedicinalProductAuthorizationJurisdictionalAuthorizationComponent res) 19844 throws IOException, FHIRFormatError { 19845 parseBackboneElementProperties(json, res); 19846 if (json.has("identifier")) { 19847 JsonArray array = json.getAsJsonArray("identifier"); 19848 for (int i = 0; i < array.size(); i++) { 19849 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 19850 } 19851 } 19852 ; 19853 if (json.has("country")) 19854 res.setCountry(parseCodeableConcept(getJObject(json, "country"))); 19855 if (json.has("jurisdiction")) { 19856 JsonArray array = json.getAsJsonArray("jurisdiction"); 19857 for (int i = 0; i < array.size(); i++) { 19858 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 19859 } 19860 } 19861 ; 19862 if (json.has("legalStatusOfSupply")) 19863 res.setLegalStatusOfSupply(parseCodeableConcept(getJObject(json, "legalStatusOfSupply"))); 19864 if (json.has("validityPeriod")) 19865 res.setValidityPeriod(parsePeriod(getJObject(json, "validityPeriod"))); 19866 } 19867 19868 protected MedicinalProductAuthorization.MedicinalProductAuthorizationProcedureComponent parseMedicinalProductAuthorizationMedicinalProductAuthorizationProcedureComponent( 19869 JsonObject json, MedicinalProductAuthorization owner) throws IOException, FHIRFormatError { 19870 MedicinalProductAuthorization.MedicinalProductAuthorizationProcedureComponent res = new MedicinalProductAuthorization.MedicinalProductAuthorizationProcedureComponent(); 19871 parseMedicinalProductAuthorizationMedicinalProductAuthorizationProcedureComponentProperties(json, owner, res); 19872 return res; 19873 } 19874 19875 protected void parseMedicinalProductAuthorizationMedicinalProductAuthorizationProcedureComponentProperties( 19876 JsonObject json, MedicinalProductAuthorization owner, 19877 MedicinalProductAuthorization.MedicinalProductAuthorizationProcedureComponent res) 19878 throws IOException, FHIRFormatError { 19879 parseBackboneElementProperties(json, res); 19880 if (json.has("identifier")) 19881 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 19882 if (json.has("type")) 19883 res.setType(parseCodeableConcept(getJObject(json, "type"))); 19884 Type date = parseType("date", json); 19885 if (date != null) 19886 res.setDate(date); 19887 if (json.has("application")) { 19888 JsonArray array = json.getAsJsonArray("application"); 19889 for (int i = 0; i < array.size(); i++) { 19890 res.getApplication().add(parseMedicinalProductAuthorizationMedicinalProductAuthorizationProcedureComponent( 19891 array.get(i).getAsJsonObject(), owner)); 19892 } 19893 } 19894 ; 19895 } 19896 19897 protected MedicinalProductContraindication parseMedicinalProductContraindication(JsonObject json) 19898 throws IOException, FHIRFormatError { 19899 MedicinalProductContraindication res = new MedicinalProductContraindication(); 19900 parseMedicinalProductContraindicationProperties(json, res); 19901 return res; 19902 } 19903 19904 protected void parseMedicinalProductContraindicationProperties(JsonObject json, MedicinalProductContraindication res) 19905 throws IOException, FHIRFormatError { 19906 parseDomainResourceProperties(json, res); 19907 if (json.has("subject")) { 19908 JsonArray array = json.getAsJsonArray("subject"); 19909 for (int i = 0; i < array.size(); i++) { 19910 res.getSubject().add(parseReference(array.get(i).getAsJsonObject())); 19911 } 19912 } 19913 ; 19914 if (json.has("disease")) 19915 res.setDisease(parseCodeableConcept(getJObject(json, "disease"))); 19916 if (json.has("diseaseStatus")) 19917 res.setDiseaseStatus(parseCodeableConcept(getJObject(json, "diseaseStatus"))); 19918 if (json.has("comorbidity")) { 19919 JsonArray array = json.getAsJsonArray("comorbidity"); 19920 for (int i = 0; i < array.size(); i++) { 19921 res.getComorbidity().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 19922 } 19923 } 19924 ; 19925 if (json.has("therapeuticIndication")) { 19926 JsonArray array = json.getAsJsonArray("therapeuticIndication"); 19927 for (int i = 0; i < array.size(); i++) { 19928 res.getTherapeuticIndication().add(parseReference(array.get(i).getAsJsonObject())); 19929 } 19930 } 19931 ; 19932 if (json.has("otherTherapy")) { 19933 JsonArray array = json.getAsJsonArray("otherTherapy"); 19934 for (int i = 0; i < array.size(); i++) { 19935 res.getOtherTherapy() 19936 .add(parseMedicinalProductContraindicationMedicinalProductContraindicationOtherTherapyComponent( 19937 array.get(i).getAsJsonObject(), res)); 19938 } 19939 } 19940 ; 19941 if (json.has("population")) { 19942 JsonArray array = json.getAsJsonArray("population"); 19943 for (int i = 0; i < array.size(); i++) { 19944 res.getPopulation().add(parsePopulation(array.get(i).getAsJsonObject())); 19945 } 19946 } 19947 ; 19948 } 19949 19950 protected MedicinalProductContraindication.MedicinalProductContraindicationOtherTherapyComponent parseMedicinalProductContraindicationMedicinalProductContraindicationOtherTherapyComponent( 19951 JsonObject json, MedicinalProductContraindication owner) throws IOException, FHIRFormatError { 19952 MedicinalProductContraindication.MedicinalProductContraindicationOtherTherapyComponent res = new MedicinalProductContraindication.MedicinalProductContraindicationOtherTherapyComponent(); 19953 parseMedicinalProductContraindicationMedicinalProductContraindicationOtherTherapyComponentProperties(json, owner, 19954 res); 19955 return res; 19956 } 19957 19958 protected void parseMedicinalProductContraindicationMedicinalProductContraindicationOtherTherapyComponentProperties( 19959 JsonObject json, MedicinalProductContraindication owner, 19960 MedicinalProductContraindication.MedicinalProductContraindicationOtherTherapyComponent res) 19961 throws IOException, FHIRFormatError { 19962 parseBackboneElementProperties(json, res); 19963 if (json.has("therapyRelationshipType")) 19964 res.setTherapyRelationshipType(parseCodeableConcept(getJObject(json, "therapyRelationshipType"))); 19965 Type medication = parseType("medication", json); 19966 if (medication != null) 19967 res.setMedication(medication); 19968 } 19969 19970 protected MedicinalProductIndication parseMedicinalProductIndication(JsonObject json) 19971 throws IOException, FHIRFormatError { 19972 MedicinalProductIndication res = new MedicinalProductIndication(); 19973 parseMedicinalProductIndicationProperties(json, res); 19974 return res; 19975 } 19976 19977 protected void parseMedicinalProductIndicationProperties(JsonObject json, MedicinalProductIndication res) 19978 throws IOException, FHIRFormatError { 19979 parseDomainResourceProperties(json, res); 19980 if (json.has("subject")) { 19981 JsonArray array = json.getAsJsonArray("subject"); 19982 for (int i = 0; i < array.size(); i++) { 19983 res.getSubject().add(parseReference(array.get(i).getAsJsonObject())); 19984 } 19985 } 19986 ; 19987 if (json.has("diseaseSymptomProcedure")) 19988 res.setDiseaseSymptomProcedure(parseCodeableConcept(getJObject(json, "diseaseSymptomProcedure"))); 19989 if (json.has("diseaseStatus")) 19990 res.setDiseaseStatus(parseCodeableConcept(getJObject(json, "diseaseStatus"))); 19991 if (json.has("comorbidity")) { 19992 JsonArray array = json.getAsJsonArray("comorbidity"); 19993 for (int i = 0; i < array.size(); i++) { 19994 res.getComorbidity().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 19995 } 19996 } 19997 ; 19998 if (json.has("intendedEffect")) 19999 res.setIntendedEffect(parseCodeableConcept(getJObject(json, "intendedEffect"))); 20000 if (json.has("duration")) 20001 res.setDuration(parseQuantity(getJObject(json, "duration"))); 20002 if (json.has("otherTherapy")) { 20003 JsonArray array = json.getAsJsonArray("otherTherapy"); 20004 for (int i = 0; i < array.size(); i++) { 20005 res.getOtherTherapy().add(parseMedicinalProductIndicationMedicinalProductIndicationOtherTherapyComponent( 20006 array.get(i).getAsJsonObject(), res)); 20007 } 20008 } 20009 ; 20010 if (json.has("undesirableEffect")) { 20011 JsonArray array = json.getAsJsonArray("undesirableEffect"); 20012 for (int i = 0; i < array.size(); i++) { 20013 res.getUndesirableEffect().add(parseReference(array.get(i).getAsJsonObject())); 20014 } 20015 } 20016 ; 20017 if (json.has("population")) { 20018 JsonArray array = json.getAsJsonArray("population"); 20019 for (int i = 0; i < array.size(); i++) { 20020 res.getPopulation().add(parsePopulation(array.get(i).getAsJsonObject())); 20021 } 20022 } 20023 ; 20024 } 20025 20026 protected MedicinalProductIndication.MedicinalProductIndicationOtherTherapyComponent parseMedicinalProductIndicationMedicinalProductIndicationOtherTherapyComponent( 20027 JsonObject json, MedicinalProductIndication owner) throws IOException, FHIRFormatError { 20028 MedicinalProductIndication.MedicinalProductIndicationOtherTherapyComponent res = new MedicinalProductIndication.MedicinalProductIndicationOtherTherapyComponent(); 20029 parseMedicinalProductIndicationMedicinalProductIndicationOtherTherapyComponentProperties(json, owner, res); 20030 return res; 20031 } 20032 20033 protected void parseMedicinalProductIndicationMedicinalProductIndicationOtherTherapyComponentProperties( 20034 JsonObject json, MedicinalProductIndication owner, 20035 MedicinalProductIndication.MedicinalProductIndicationOtherTherapyComponent res) 20036 throws IOException, FHIRFormatError { 20037 parseBackboneElementProperties(json, res); 20038 if (json.has("therapyRelationshipType")) 20039 res.setTherapyRelationshipType(parseCodeableConcept(getJObject(json, "therapyRelationshipType"))); 20040 Type medication = parseType("medication", json); 20041 if (medication != null) 20042 res.setMedication(medication); 20043 } 20044 20045 protected MedicinalProductIngredient parseMedicinalProductIngredient(JsonObject json) 20046 throws IOException, FHIRFormatError { 20047 MedicinalProductIngredient res = new MedicinalProductIngredient(); 20048 parseMedicinalProductIngredientProperties(json, res); 20049 return res; 20050 } 20051 20052 protected void parseMedicinalProductIngredientProperties(JsonObject json, MedicinalProductIngredient res) 20053 throws IOException, FHIRFormatError { 20054 parseDomainResourceProperties(json, res); 20055 if (json.has("identifier")) 20056 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 20057 if (json.has("role")) 20058 res.setRole(parseCodeableConcept(getJObject(json, "role"))); 20059 if (json.has("allergenicIndicator")) 20060 res.setAllergenicIndicatorElement(parseBoolean(json.get("allergenicIndicator").getAsBoolean())); 20061 if (json.has("_allergenicIndicator")) 20062 parseElementProperties(getJObject(json, "_allergenicIndicator"), res.getAllergenicIndicatorElement()); 20063 if (json.has("manufacturer")) { 20064 JsonArray array = json.getAsJsonArray("manufacturer"); 20065 for (int i = 0; i < array.size(); i++) { 20066 res.getManufacturer().add(parseReference(array.get(i).getAsJsonObject())); 20067 } 20068 } 20069 ; 20070 if (json.has("specifiedSubstance")) { 20071 JsonArray array = json.getAsJsonArray("specifiedSubstance"); 20072 for (int i = 0; i < array.size(); i++) { 20073 res.getSpecifiedSubstance() 20074 .add(parseMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceComponent( 20075 array.get(i).getAsJsonObject(), res)); 20076 } 20077 } 20078 ; 20079 if (json.has("substance")) 20080 res.setSubstance(parseMedicinalProductIngredientMedicinalProductIngredientSubstanceComponent( 20081 getJObject(json, "substance"), res)); 20082 } 20083 20084 protected MedicinalProductIngredient.MedicinalProductIngredientSpecifiedSubstanceComponent parseMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceComponent( 20085 JsonObject json, MedicinalProductIngredient owner) throws IOException, FHIRFormatError { 20086 MedicinalProductIngredient.MedicinalProductIngredientSpecifiedSubstanceComponent res = new MedicinalProductIngredient.MedicinalProductIngredientSpecifiedSubstanceComponent(); 20087 parseMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceComponentProperties(json, owner, res); 20088 return res; 20089 } 20090 20091 protected void parseMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceComponentProperties( 20092 JsonObject json, MedicinalProductIngredient owner, 20093 MedicinalProductIngredient.MedicinalProductIngredientSpecifiedSubstanceComponent res) 20094 throws IOException, FHIRFormatError { 20095 parseBackboneElementProperties(json, res); 20096 if (json.has("code")) 20097 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 20098 if (json.has("group")) 20099 res.setGroup(parseCodeableConcept(getJObject(json, "group"))); 20100 if (json.has("confidentiality")) 20101 res.setConfidentiality(parseCodeableConcept(getJObject(json, "confidentiality"))); 20102 if (json.has("strength")) { 20103 JsonArray array = json.getAsJsonArray("strength"); 20104 for (int i = 0; i < array.size(); i++) { 20105 res.getStrength() 20106 .add(parseMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceStrengthComponent( 20107 array.get(i).getAsJsonObject(), owner)); 20108 } 20109 } 20110 ; 20111 } 20112 20113 protected MedicinalProductIngredient.MedicinalProductIngredientSpecifiedSubstanceStrengthComponent parseMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceStrengthComponent( 20114 JsonObject json, MedicinalProductIngredient owner) throws IOException, FHIRFormatError { 20115 MedicinalProductIngredient.MedicinalProductIngredientSpecifiedSubstanceStrengthComponent res = new MedicinalProductIngredient.MedicinalProductIngredientSpecifiedSubstanceStrengthComponent(); 20116 parseMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceStrengthComponentProperties(json, owner, 20117 res); 20118 return res; 20119 } 20120 20121 protected void parseMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceStrengthComponentProperties( 20122 JsonObject json, MedicinalProductIngredient owner, 20123 MedicinalProductIngredient.MedicinalProductIngredientSpecifiedSubstanceStrengthComponent res) 20124 throws IOException, FHIRFormatError { 20125 parseBackboneElementProperties(json, res); 20126 if (json.has("presentation")) 20127 res.setPresentation(parseRatio(getJObject(json, "presentation"))); 20128 if (json.has("presentationLowLimit")) 20129 res.setPresentationLowLimit(parseRatio(getJObject(json, "presentationLowLimit"))); 20130 if (json.has("concentration")) 20131 res.setConcentration(parseRatio(getJObject(json, "concentration"))); 20132 if (json.has("concentrationLowLimit")) 20133 res.setConcentrationLowLimit(parseRatio(getJObject(json, "concentrationLowLimit"))); 20134 if (json.has("measurementPoint")) 20135 res.setMeasurementPointElement(parseString(json.get("measurementPoint").getAsString())); 20136 if (json.has("_measurementPoint")) 20137 parseElementProperties(getJObject(json, "_measurementPoint"), res.getMeasurementPointElement()); 20138 if (json.has("country")) { 20139 JsonArray array = json.getAsJsonArray("country"); 20140 for (int i = 0; i < array.size(); i++) { 20141 res.getCountry().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 20142 } 20143 } 20144 ; 20145 if (json.has("referenceStrength")) { 20146 JsonArray array = json.getAsJsonArray("referenceStrength"); 20147 for (int i = 0; i < array.size(); i++) { 20148 res.getReferenceStrength().add( 20149 parseMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent( 20150 array.get(i).getAsJsonObject(), owner)); 20151 } 20152 } 20153 ; 20154 } 20155 20156 protected MedicinalProductIngredient.MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent parseMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent( 20157 JsonObject json, MedicinalProductIngredient owner) throws IOException, FHIRFormatError { 20158 MedicinalProductIngredient.MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent res = new MedicinalProductIngredient.MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent(); 20159 parseMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponentProperties( 20160 json, owner, res); 20161 return res; 20162 } 20163 20164 protected void parseMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponentProperties( 20165 JsonObject json, MedicinalProductIngredient owner, 20166 MedicinalProductIngredient.MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent res) 20167 throws IOException, FHIRFormatError { 20168 parseBackboneElementProperties(json, res); 20169 if (json.has("substance")) 20170 res.setSubstance(parseCodeableConcept(getJObject(json, "substance"))); 20171 if (json.has("strength")) 20172 res.setStrength(parseRatio(getJObject(json, "strength"))); 20173 if (json.has("strengthLowLimit")) 20174 res.setStrengthLowLimit(parseRatio(getJObject(json, "strengthLowLimit"))); 20175 if (json.has("measurementPoint")) 20176 res.setMeasurementPointElement(parseString(json.get("measurementPoint").getAsString())); 20177 if (json.has("_measurementPoint")) 20178 parseElementProperties(getJObject(json, "_measurementPoint"), res.getMeasurementPointElement()); 20179 if (json.has("country")) { 20180 JsonArray array = json.getAsJsonArray("country"); 20181 for (int i = 0; i < array.size(); i++) { 20182 res.getCountry().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 20183 } 20184 } 20185 ; 20186 } 20187 20188 protected MedicinalProductIngredient.MedicinalProductIngredientSubstanceComponent parseMedicinalProductIngredientMedicinalProductIngredientSubstanceComponent( 20189 JsonObject json, MedicinalProductIngredient owner) throws IOException, FHIRFormatError { 20190 MedicinalProductIngredient.MedicinalProductIngredientSubstanceComponent res = new MedicinalProductIngredient.MedicinalProductIngredientSubstanceComponent(); 20191 parseMedicinalProductIngredientMedicinalProductIngredientSubstanceComponentProperties(json, owner, res); 20192 return res; 20193 } 20194 20195 protected void parseMedicinalProductIngredientMedicinalProductIngredientSubstanceComponentProperties(JsonObject json, 20196 MedicinalProductIngredient owner, MedicinalProductIngredient.MedicinalProductIngredientSubstanceComponent res) 20197 throws IOException, FHIRFormatError { 20198 parseBackboneElementProperties(json, res); 20199 if (json.has("code")) 20200 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 20201 if (json.has("strength")) { 20202 JsonArray array = json.getAsJsonArray("strength"); 20203 for (int i = 0; i < array.size(); i++) { 20204 res.getStrength() 20205 .add(parseMedicinalProductIngredientMedicinalProductIngredientSpecifiedSubstanceStrengthComponent( 20206 array.get(i).getAsJsonObject(), owner)); 20207 } 20208 } 20209 ; 20210 } 20211 20212 protected MedicinalProductInteraction parseMedicinalProductInteraction(JsonObject json) 20213 throws IOException, FHIRFormatError { 20214 MedicinalProductInteraction res = new MedicinalProductInteraction(); 20215 parseMedicinalProductInteractionProperties(json, res); 20216 return res; 20217 } 20218 20219 protected void parseMedicinalProductInteractionProperties(JsonObject json, MedicinalProductInteraction res) 20220 throws IOException, FHIRFormatError { 20221 parseDomainResourceProperties(json, res); 20222 if (json.has("subject")) { 20223 JsonArray array = json.getAsJsonArray("subject"); 20224 for (int i = 0; i < array.size(); i++) { 20225 res.getSubject().add(parseReference(array.get(i).getAsJsonObject())); 20226 } 20227 } 20228 ; 20229 if (json.has("description")) 20230 res.setDescriptionElement(parseString(json.get("description").getAsString())); 20231 if (json.has("_description")) 20232 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 20233 if (json.has("interactant")) { 20234 JsonArray array = json.getAsJsonArray("interactant"); 20235 for (int i = 0; i < array.size(); i++) { 20236 res.getInteractant().add(parseMedicinalProductInteractionMedicinalProductInteractionInteractantComponent( 20237 array.get(i).getAsJsonObject(), res)); 20238 } 20239 } 20240 ; 20241 if (json.has("type")) 20242 res.setType(parseCodeableConcept(getJObject(json, "type"))); 20243 if (json.has("effect")) 20244 res.setEffect(parseCodeableConcept(getJObject(json, "effect"))); 20245 if (json.has("incidence")) 20246 res.setIncidence(parseCodeableConcept(getJObject(json, "incidence"))); 20247 if (json.has("management")) 20248 res.setManagement(parseCodeableConcept(getJObject(json, "management"))); 20249 } 20250 20251 protected MedicinalProductInteraction.MedicinalProductInteractionInteractantComponent parseMedicinalProductInteractionMedicinalProductInteractionInteractantComponent( 20252 JsonObject json, MedicinalProductInteraction owner) throws IOException, FHIRFormatError { 20253 MedicinalProductInteraction.MedicinalProductInteractionInteractantComponent res = new MedicinalProductInteraction.MedicinalProductInteractionInteractantComponent(); 20254 parseMedicinalProductInteractionMedicinalProductInteractionInteractantComponentProperties(json, owner, res); 20255 return res; 20256 } 20257 20258 protected void parseMedicinalProductInteractionMedicinalProductInteractionInteractantComponentProperties( 20259 JsonObject json, MedicinalProductInteraction owner, 20260 MedicinalProductInteraction.MedicinalProductInteractionInteractantComponent res) 20261 throws IOException, FHIRFormatError { 20262 parseBackboneElementProperties(json, res); 20263 Type item = parseType("item", json); 20264 if (item != null) 20265 res.setItem(item); 20266 } 20267 20268 protected MedicinalProductManufactured parseMedicinalProductManufactured(JsonObject json) 20269 throws IOException, FHIRFormatError { 20270 MedicinalProductManufactured res = new MedicinalProductManufactured(); 20271 parseMedicinalProductManufacturedProperties(json, res); 20272 return res; 20273 } 20274 20275 protected void parseMedicinalProductManufacturedProperties(JsonObject json, MedicinalProductManufactured res) 20276 throws IOException, FHIRFormatError { 20277 parseDomainResourceProperties(json, res); 20278 if (json.has("manufacturedDoseForm")) 20279 res.setManufacturedDoseForm(parseCodeableConcept(getJObject(json, "manufacturedDoseForm"))); 20280 if (json.has("unitOfPresentation")) 20281 res.setUnitOfPresentation(parseCodeableConcept(getJObject(json, "unitOfPresentation"))); 20282 if (json.has("quantity")) 20283 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 20284 if (json.has("manufacturer")) { 20285 JsonArray array = json.getAsJsonArray("manufacturer"); 20286 for (int i = 0; i < array.size(); i++) { 20287 res.getManufacturer().add(parseReference(array.get(i).getAsJsonObject())); 20288 } 20289 } 20290 ; 20291 if (json.has("ingredient")) { 20292 JsonArray array = json.getAsJsonArray("ingredient"); 20293 for (int i = 0; i < array.size(); i++) { 20294 res.getIngredient().add(parseReference(array.get(i).getAsJsonObject())); 20295 } 20296 } 20297 ; 20298 if (json.has("physicalCharacteristics")) 20299 res.setPhysicalCharacteristics(parseProdCharacteristic(getJObject(json, "physicalCharacteristics"))); 20300 if (json.has("otherCharacteristics")) { 20301 JsonArray array = json.getAsJsonArray("otherCharacteristics"); 20302 for (int i = 0; i < array.size(); i++) { 20303 res.getOtherCharacteristics().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 20304 } 20305 } 20306 ; 20307 } 20308 20309 protected MedicinalProductPackaged parseMedicinalProductPackaged(JsonObject json) 20310 throws IOException, FHIRFormatError { 20311 MedicinalProductPackaged res = new MedicinalProductPackaged(); 20312 parseMedicinalProductPackagedProperties(json, res); 20313 return res; 20314 } 20315 20316 protected void parseMedicinalProductPackagedProperties(JsonObject json, MedicinalProductPackaged res) 20317 throws IOException, FHIRFormatError { 20318 parseDomainResourceProperties(json, res); 20319 if (json.has("identifier")) { 20320 JsonArray array = json.getAsJsonArray("identifier"); 20321 for (int i = 0; i < array.size(); i++) { 20322 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 20323 } 20324 } 20325 ; 20326 if (json.has("subject")) { 20327 JsonArray array = json.getAsJsonArray("subject"); 20328 for (int i = 0; i < array.size(); i++) { 20329 res.getSubject().add(parseReference(array.get(i).getAsJsonObject())); 20330 } 20331 } 20332 ; 20333 if (json.has("description")) 20334 res.setDescriptionElement(parseString(json.get("description").getAsString())); 20335 if (json.has("_description")) 20336 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 20337 if (json.has("legalStatusOfSupply")) 20338 res.setLegalStatusOfSupply(parseCodeableConcept(getJObject(json, "legalStatusOfSupply"))); 20339 if (json.has("marketingStatus")) { 20340 JsonArray array = json.getAsJsonArray("marketingStatus"); 20341 for (int i = 0; i < array.size(); i++) { 20342 res.getMarketingStatus().add(parseMarketingStatus(array.get(i).getAsJsonObject())); 20343 } 20344 } 20345 ; 20346 if (json.has("marketingAuthorization")) 20347 res.setMarketingAuthorization(parseReference(getJObject(json, "marketingAuthorization"))); 20348 if (json.has("manufacturer")) { 20349 JsonArray array = json.getAsJsonArray("manufacturer"); 20350 for (int i = 0; i < array.size(); i++) { 20351 res.getManufacturer().add(parseReference(array.get(i).getAsJsonObject())); 20352 } 20353 } 20354 ; 20355 if (json.has("batchIdentifier")) { 20356 JsonArray array = json.getAsJsonArray("batchIdentifier"); 20357 for (int i = 0; i < array.size(); i++) { 20358 res.getBatchIdentifier().add(parseMedicinalProductPackagedMedicinalProductPackagedBatchIdentifierComponent( 20359 array.get(i).getAsJsonObject(), res)); 20360 } 20361 } 20362 ; 20363 if (json.has("packageItem")) { 20364 JsonArray array = json.getAsJsonArray("packageItem"); 20365 for (int i = 0; i < array.size(); i++) { 20366 res.getPackageItem().add(parseMedicinalProductPackagedMedicinalProductPackagedPackageItemComponent( 20367 array.get(i).getAsJsonObject(), res)); 20368 } 20369 } 20370 ; 20371 } 20372 20373 protected MedicinalProductPackaged.MedicinalProductPackagedBatchIdentifierComponent parseMedicinalProductPackagedMedicinalProductPackagedBatchIdentifierComponent( 20374 JsonObject json, MedicinalProductPackaged owner) throws IOException, FHIRFormatError { 20375 MedicinalProductPackaged.MedicinalProductPackagedBatchIdentifierComponent res = new MedicinalProductPackaged.MedicinalProductPackagedBatchIdentifierComponent(); 20376 parseMedicinalProductPackagedMedicinalProductPackagedBatchIdentifierComponentProperties(json, owner, res); 20377 return res; 20378 } 20379 20380 protected void parseMedicinalProductPackagedMedicinalProductPackagedBatchIdentifierComponentProperties( 20381 JsonObject json, MedicinalProductPackaged owner, 20382 MedicinalProductPackaged.MedicinalProductPackagedBatchIdentifierComponent res) 20383 throws IOException, FHIRFormatError { 20384 parseBackboneElementProperties(json, res); 20385 if (json.has("outerPackaging")) 20386 res.setOuterPackaging(parseIdentifier(getJObject(json, "outerPackaging"))); 20387 if (json.has("immediatePackaging")) 20388 res.setImmediatePackaging(parseIdentifier(getJObject(json, "immediatePackaging"))); 20389 } 20390 20391 protected MedicinalProductPackaged.MedicinalProductPackagedPackageItemComponent parseMedicinalProductPackagedMedicinalProductPackagedPackageItemComponent( 20392 JsonObject json, MedicinalProductPackaged owner) throws IOException, FHIRFormatError { 20393 MedicinalProductPackaged.MedicinalProductPackagedPackageItemComponent res = new MedicinalProductPackaged.MedicinalProductPackagedPackageItemComponent(); 20394 parseMedicinalProductPackagedMedicinalProductPackagedPackageItemComponentProperties(json, owner, res); 20395 return res; 20396 } 20397 20398 protected void parseMedicinalProductPackagedMedicinalProductPackagedPackageItemComponentProperties(JsonObject json, 20399 MedicinalProductPackaged owner, MedicinalProductPackaged.MedicinalProductPackagedPackageItemComponent res) 20400 throws IOException, FHIRFormatError { 20401 parseBackboneElementProperties(json, res); 20402 if (json.has("identifier")) { 20403 JsonArray array = json.getAsJsonArray("identifier"); 20404 for (int i = 0; i < array.size(); i++) { 20405 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 20406 } 20407 } 20408 ; 20409 if (json.has("type")) 20410 res.setType(parseCodeableConcept(getJObject(json, "type"))); 20411 if (json.has("quantity")) 20412 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 20413 if (json.has("material")) { 20414 JsonArray array = json.getAsJsonArray("material"); 20415 for (int i = 0; i < array.size(); i++) { 20416 res.getMaterial().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 20417 } 20418 } 20419 ; 20420 if (json.has("alternateMaterial")) { 20421 JsonArray array = json.getAsJsonArray("alternateMaterial"); 20422 for (int i = 0; i < array.size(); i++) { 20423 res.getAlternateMaterial().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 20424 } 20425 } 20426 ; 20427 if (json.has("device")) { 20428 JsonArray array = json.getAsJsonArray("device"); 20429 for (int i = 0; i < array.size(); i++) { 20430 res.getDevice().add(parseReference(array.get(i).getAsJsonObject())); 20431 } 20432 } 20433 ; 20434 if (json.has("manufacturedItem")) { 20435 JsonArray array = json.getAsJsonArray("manufacturedItem"); 20436 for (int i = 0; i < array.size(); i++) { 20437 res.getManufacturedItem().add(parseReference(array.get(i).getAsJsonObject())); 20438 } 20439 } 20440 ; 20441 if (json.has("packageItem")) { 20442 JsonArray array = json.getAsJsonArray("packageItem"); 20443 for (int i = 0; i < array.size(); i++) { 20444 res.getPackageItem().add(parseMedicinalProductPackagedMedicinalProductPackagedPackageItemComponent( 20445 array.get(i).getAsJsonObject(), owner)); 20446 } 20447 } 20448 ; 20449 if (json.has("physicalCharacteristics")) 20450 res.setPhysicalCharacteristics(parseProdCharacteristic(getJObject(json, "physicalCharacteristics"))); 20451 if (json.has("otherCharacteristics")) { 20452 JsonArray array = json.getAsJsonArray("otherCharacteristics"); 20453 for (int i = 0; i < array.size(); i++) { 20454 res.getOtherCharacteristics().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 20455 } 20456 } 20457 ; 20458 if (json.has("shelfLifeStorage")) { 20459 JsonArray array = json.getAsJsonArray("shelfLifeStorage"); 20460 for (int i = 0; i < array.size(); i++) { 20461 res.getShelfLifeStorage().add(parseProductShelfLife(array.get(i).getAsJsonObject())); 20462 } 20463 } 20464 ; 20465 if (json.has("manufacturer")) { 20466 JsonArray array = json.getAsJsonArray("manufacturer"); 20467 for (int i = 0; i < array.size(); i++) { 20468 res.getManufacturer().add(parseReference(array.get(i).getAsJsonObject())); 20469 } 20470 } 20471 ; 20472 } 20473 20474 protected MedicinalProductPharmaceutical parseMedicinalProductPharmaceutical(JsonObject json) 20475 throws IOException, FHIRFormatError { 20476 MedicinalProductPharmaceutical res = new MedicinalProductPharmaceutical(); 20477 parseMedicinalProductPharmaceuticalProperties(json, res); 20478 return res; 20479 } 20480 20481 protected void parseMedicinalProductPharmaceuticalProperties(JsonObject json, MedicinalProductPharmaceutical res) 20482 throws IOException, FHIRFormatError { 20483 parseDomainResourceProperties(json, res); 20484 if (json.has("identifier")) { 20485 JsonArray array = json.getAsJsonArray("identifier"); 20486 for (int i = 0; i < array.size(); i++) { 20487 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 20488 } 20489 } 20490 ; 20491 if (json.has("administrableDoseForm")) 20492 res.setAdministrableDoseForm(parseCodeableConcept(getJObject(json, "administrableDoseForm"))); 20493 if (json.has("unitOfPresentation")) 20494 res.setUnitOfPresentation(parseCodeableConcept(getJObject(json, "unitOfPresentation"))); 20495 if (json.has("ingredient")) { 20496 JsonArray array = json.getAsJsonArray("ingredient"); 20497 for (int i = 0; i < array.size(); i++) { 20498 res.getIngredient().add(parseReference(array.get(i).getAsJsonObject())); 20499 } 20500 } 20501 ; 20502 if (json.has("device")) { 20503 JsonArray array = json.getAsJsonArray("device"); 20504 for (int i = 0; i < array.size(); i++) { 20505 res.getDevice().add(parseReference(array.get(i).getAsJsonObject())); 20506 } 20507 } 20508 ; 20509 if (json.has("characteristics")) { 20510 JsonArray array = json.getAsJsonArray("characteristics"); 20511 for (int i = 0; i < array.size(); i++) { 20512 res.getCharacteristics() 20513 .add(parseMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalCharacteristicsComponent( 20514 array.get(i).getAsJsonObject(), res)); 20515 } 20516 } 20517 ; 20518 if (json.has("routeOfAdministration")) { 20519 JsonArray array = json.getAsJsonArray("routeOfAdministration"); 20520 for (int i = 0; i < array.size(); i++) { 20521 res.getRouteOfAdministration() 20522 .add(parseMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationComponent( 20523 array.get(i).getAsJsonObject(), res)); 20524 } 20525 } 20526 ; 20527 } 20528 20529 protected MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalCharacteristicsComponent parseMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalCharacteristicsComponent( 20530 JsonObject json, MedicinalProductPharmaceutical owner) throws IOException, FHIRFormatError { 20531 MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalCharacteristicsComponent res = new MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalCharacteristicsComponent(); 20532 parseMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalCharacteristicsComponentProperties(json, owner, 20533 res); 20534 return res; 20535 } 20536 20537 protected void parseMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalCharacteristicsComponentProperties( 20538 JsonObject json, MedicinalProductPharmaceutical owner, 20539 MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalCharacteristicsComponent res) 20540 throws IOException, FHIRFormatError { 20541 parseBackboneElementProperties(json, res); 20542 if (json.has("code")) 20543 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 20544 if (json.has("status")) 20545 res.setStatus(parseCodeableConcept(getJObject(json, "status"))); 20546 } 20547 20548 protected MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalRouteOfAdministrationComponent parseMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationComponent( 20549 JsonObject json, MedicinalProductPharmaceutical owner) throws IOException, FHIRFormatError { 20550 MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalRouteOfAdministrationComponent res = new MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalRouteOfAdministrationComponent(); 20551 parseMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationComponentProperties(json, 20552 owner, res); 20553 return res; 20554 } 20555 20556 protected void parseMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationComponentProperties( 20557 JsonObject json, MedicinalProductPharmaceutical owner, 20558 MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalRouteOfAdministrationComponent res) 20559 throws IOException, FHIRFormatError { 20560 parseBackboneElementProperties(json, res); 20561 if (json.has("code")) 20562 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 20563 if (json.has("firstDose")) 20564 res.setFirstDose(parseQuantity(getJObject(json, "firstDose"))); 20565 if (json.has("maxSingleDose")) 20566 res.setMaxSingleDose(parseQuantity(getJObject(json, "maxSingleDose"))); 20567 if (json.has("maxDosePerDay")) 20568 res.setMaxDosePerDay(parseQuantity(getJObject(json, "maxDosePerDay"))); 20569 if (json.has("maxDosePerTreatmentPeriod")) 20570 res.setMaxDosePerTreatmentPeriod(parseRatio(getJObject(json, "maxDosePerTreatmentPeriod"))); 20571 if (json.has("maxTreatmentPeriod")) 20572 res.setMaxTreatmentPeriod(parseDuration(getJObject(json, "maxTreatmentPeriod"))); 20573 if (json.has("targetSpecies")) { 20574 JsonArray array = json.getAsJsonArray("targetSpecies"); 20575 for (int i = 0; i < array.size(); i++) { 20576 res.getTargetSpecies().add( 20577 parseMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesComponent( 20578 array.get(i).getAsJsonObject(), owner)); 20579 } 20580 } 20581 ; 20582 } 20583 20584 protected MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesComponent parseMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesComponent( 20585 JsonObject json, MedicinalProductPharmaceutical owner) throws IOException, FHIRFormatError { 20586 MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesComponent res = new MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesComponent(); 20587 parseMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesComponentProperties( 20588 json, owner, res); 20589 return res; 20590 } 20591 20592 protected void parseMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesComponentProperties( 20593 JsonObject json, MedicinalProductPharmaceutical owner, 20594 MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesComponent res) 20595 throws IOException, FHIRFormatError { 20596 parseBackboneElementProperties(json, res); 20597 if (json.has("code")) 20598 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 20599 if (json.has("withdrawalPeriod")) { 20600 JsonArray array = json.getAsJsonArray("withdrawalPeriod"); 20601 for (int i = 0; i < array.size(); i++) { 20602 res.getWithdrawalPeriod().add( 20603 parseMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent( 20604 array.get(i).getAsJsonObject(), owner)); 20605 } 20606 } 20607 ; 20608 } 20609 20610 protected MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent parseMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent( 20611 JsonObject json, MedicinalProductPharmaceutical owner) throws IOException, FHIRFormatError { 20612 MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent res = new MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent(); 20613 parseMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponentProperties( 20614 json, owner, res); 20615 return res; 20616 } 20617 20618 protected void parseMedicinalProductPharmaceuticalMedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponentProperties( 20619 JsonObject json, MedicinalProductPharmaceutical owner, 20620 MedicinalProductPharmaceutical.MedicinalProductPharmaceuticalRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent res) 20621 throws IOException, FHIRFormatError { 20622 parseBackboneElementProperties(json, res); 20623 if (json.has("tissue")) 20624 res.setTissue(parseCodeableConcept(getJObject(json, "tissue"))); 20625 if (json.has("value")) 20626 res.setValue(parseQuantity(getJObject(json, "value"))); 20627 if (json.has("supportingInformation")) 20628 res.setSupportingInformationElement(parseString(json.get("supportingInformation").getAsString())); 20629 if (json.has("_supportingInformation")) 20630 parseElementProperties(getJObject(json, "_supportingInformation"), res.getSupportingInformationElement()); 20631 } 20632 20633 protected MedicinalProductUndesirableEffect parseMedicinalProductUndesirableEffect(JsonObject json) 20634 throws IOException, FHIRFormatError { 20635 MedicinalProductUndesirableEffect res = new MedicinalProductUndesirableEffect(); 20636 parseMedicinalProductUndesirableEffectProperties(json, res); 20637 return res; 20638 } 20639 20640 protected void parseMedicinalProductUndesirableEffectProperties(JsonObject json, 20641 MedicinalProductUndesirableEffect res) throws IOException, FHIRFormatError { 20642 parseDomainResourceProperties(json, res); 20643 if (json.has("subject")) { 20644 JsonArray array = json.getAsJsonArray("subject"); 20645 for (int i = 0; i < array.size(); i++) { 20646 res.getSubject().add(parseReference(array.get(i).getAsJsonObject())); 20647 } 20648 } 20649 ; 20650 if (json.has("symptomConditionEffect")) 20651 res.setSymptomConditionEffect(parseCodeableConcept(getJObject(json, "symptomConditionEffect"))); 20652 if (json.has("classification")) 20653 res.setClassification(parseCodeableConcept(getJObject(json, "classification"))); 20654 if (json.has("frequencyOfOccurrence")) 20655 res.setFrequencyOfOccurrence(parseCodeableConcept(getJObject(json, "frequencyOfOccurrence"))); 20656 if (json.has("population")) { 20657 JsonArray array = json.getAsJsonArray("population"); 20658 for (int i = 0; i < array.size(); i++) { 20659 res.getPopulation().add(parsePopulation(array.get(i).getAsJsonObject())); 20660 } 20661 } 20662 ; 20663 } 20664 20665 protected MessageDefinition parseMessageDefinition(JsonObject json) throws IOException, FHIRFormatError { 20666 MessageDefinition res = new MessageDefinition(); 20667 parseMessageDefinitionProperties(json, res); 20668 return res; 20669 } 20670 20671 protected void parseMessageDefinitionProperties(JsonObject json, MessageDefinition res) 20672 throws IOException, FHIRFormatError { 20673 parseDomainResourceProperties(json, res); 20674 if (json.has("url")) 20675 res.setUrlElement(parseUri(json.get("url").getAsString())); 20676 if (json.has("_url")) 20677 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 20678 if (json.has("identifier")) { 20679 JsonArray array = json.getAsJsonArray("identifier"); 20680 for (int i = 0; i < array.size(); i++) { 20681 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 20682 } 20683 } 20684 ; 20685 if (json.has("version")) 20686 res.setVersionElement(parseString(json.get("version").getAsString())); 20687 if (json.has("_version")) 20688 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 20689 if (json.has("name")) 20690 res.setNameElement(parseString(json.get("name").getAsString())); 20691 if (json.has("_name")) 20692 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 20693 if (json.has("title")) 20694 res.setTitleElement(parseString(json.get("title").getAsString())); 20695 if (json.has("_title")) 20696 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 20697 if (json.has("replaces")) { 20698 JsonArray array = json.getAsJsonArray("replaces"); 20699 for (int i = 0; i < array.size(); i++) { 20700 if (array.get(i).isJsonNull()) { 20701 res.getReplaces().add(new CanonicalType()); 20702 } else { 20703 res.getReplaces().add(parseCanonical(array.get(i).getAsString())); 20704 } 20705 } 20706 } 20707 ; 20708 if (json.has("_replaces")) { 20709 JsonArray array = json.getAsJsonArray("_replaces"); 20710 for (int i = 0; i < array.size(); i++) { 20711 if (i == res.getReplaces().size()) 20712 res.getReplaces().add(parseCanonical(null)); 20713 if (array.get(i) instanceof JsonObject) 20714 parseElementProperties(array.get(i).getAsJsonObject(), res.getReplaces().get(i)); 20715 } 20716 } 20717 ; 20718 if (json.has("status")) 20719 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 20720 new Enumerations.PublicationStatusEnumFactory())); 20721 if (json.has("_status")) 20722 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 20723 if (json.has("experimental")) 20724 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 20725 if (json.has("_experimental")) 20726 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 20727 if (json.has("date")) 20728 res.setDateElement(parseDateTime(json.get("date").getAsString())); 20729 if (json.has("_date")) 20730 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 20731 if (json.has("publisher")) 20732 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 20733 if (json.has("_publisher")) 20734 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 20735 if (json.has("contact")) { 20736 JsonArray array = json.getAsJsonArray("contact"); 20737 for (int i = 0; i < array.size(); i++) { 20738 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 20739 } 20740 } 20741 ; 20742 if (json.has("description")) 20743 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 20744 if (json.has("_description")) 20745 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 20746 if (json.has("useContext")) { 20747 JsonArray array = json.getAsJsonArray("useContext"); 20748 for (int i = 0; i < array.size(); i++) { 20749 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 20750 } 20751 } 20752 ; 20753 if (json.has("jurisdiction")) { 20754 JsonArray array = json.getAsJsonArray("jurisdiction"); 20755 for (int i = 0; i < array.size(); i++) { 20756 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 20757 } 20758 } 20759 ; 20760 if (json.has("purpose")) 20761 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 20762 if (json.has("_purpose")) 20763 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 20764 if (json.has("copyright")) 20765 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 20766 if (json.has("_copyright")) 20767 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 20768 if (json.has("base")) 20769 res.setBaseElement(parseCanonical(json.get("base").getAsString())); 20770 if (json.has("_base")) 20771 parseElementProperties(getJObject(json, "_base"), res.getBaseElement()); 20772 if (json.has("parent")) { 20773 JsonArray array = json.getAsJsonArray("parent"); 20774 for (int i = 0; i < array.size(); i++) { 20775 if (array.get(i).isJsonNull()) { 20776 res.getParent().add(new CanonicalType()); 20777 } else { 20778 res.getParent().add(parseCanonical(array.get(i).getAsString())); 20779 } 20780 } 20781 } 20782 ; 20783 if (json.has("_parent")) { 20784 JsonArray array = json.getAsJsonArray("_parent"); 20785 for (int i = 0; i < array.size(); i++) { 20786 if (i == res.getParent().size()) 20787 res.getParent().add(parseCanonical(null)); 20788 if (array.get(i) instanceof JsonObject) 20789 parseElementProperties(array.get(i).getAsJsonObject(), res.getParent().get(i)); 20790 } 20791 } 20792 ; 20793 Type event = parseType("event", json); 20794 if (event != null) 20795 res.setEvent(event); 20796 if (json.has("category")) 20797 res.setCategoryElement( 20798 parseEnumeration(json.get("category").getAsString(), MessageDefinition.MessageSignificanceCategory.NULL, 20799 new MessageDefinition.MessageSignificanceCategoryEnumFactory())); 20800 if (json.has("_category")) 20801 parseElementProperties(getJObject(json, "_category"), res.getCategoryElement()); 20802 if (json.has("focus")) { 20803 JsonArray array = json.getAsJsonArray("focus"); 20804 for (int i = 0; i < array.size(); i++) { 20805 res.getFocus().add(parseMessageDefinitionMessageDefinitionFocusComponent(array.get(i).getAsJsonObject(), res)); 20806 } 20807 } 20808 ; 20809 if (json.has("responseRequired")) 20810 res.setResponseRequiredElement(parseEnumeration(json.get("responseRequired").getAsString(), 20811 MessageDefinition.MessageheaderResponseRequest.NULL, 20812 new MessageDefinition.MessageheaderResponseRequestEnumFactory())); 20813 if (json.has("_responseRequired")) 20814 parseElementProperties(getJObject(json, "_responseRequired"), res.getResponseRequiredElement()); 20815 if (json.has("allowedResponse")) { 20816 JsonArray array = json.getAsJsonArray("allowedResponse"); 20817 for (int i = 0; i < array.size(); i++) { 20818 res.getAllowedResponse() 20819 .add(parseMessageDefinitionMessageDefinitionAllowedResponseComponent(array.get(i).getAsJsonObject(), res)); 20820 } 20821 } 20822 ; 20823 if (json.has("graph")) { 20824 JsonArray array = json.getAsJsonArray("graph"); 20825 for (int i = 0; i < array.size(); i++) { 20826 if (array.get(i).isJsonNull()) { 20827 res.getGraph().add(new CanonicalType()); 20828 } else { 20829 res.getGraph().add(parseCanonical(array.get(i).getAsString())); 20830 } 20831 } 20832 } 20833 ; 20834 if (json.has("_graph")) { 20835 JsonArray array = json.getAsJsonArray("_graph"); 20836 for (int i = 0; i < array.size(); i++) { 20837 if (i == res.getGraph().size()) 20838 res.getGraph().add(parseCanonical(null)); 20839 if (array.get(i) instanceof JsonObject) 20840 parseElementProperties(array.get(i).getAsJsonObject(), res.getGraph().get(i)); 20841 } 20842 } 20843 ; 20844 } 20845 20846 protected MessageDefinition.MessageDefinitionFocusComponent parseMessageDefinitionMessageDefinitionFocusComponent( 20847 JsonObject json, MessageDefinition owner) throws IOException, FHIRFormatError { 20848 MessageDefinition.MessageDefinitionFocusComponent res = new MessageDefinition.MessageDefinitionFocusComponent(); 20849 parseMessageDefinitionMessageDefinitionFocusComponentProperties(json, owner, res); 20850 return res; 20851 } 20852 20853 protected void parseMessageDefinitionMessageDefinitionFocusComponentProperties(JsonObject json, 20854 MessageDefinition owner, MessageDefinition.MessageDefinitionFocusComponent res) 20855 throws IOException, FHIRFormatError { 20856 parseBackboneElementProperties(json, res); 20857 if (json.has("code")) 20858 res.setCodeElement(parseCode(json.get("code").getAsString())); 20859 if (json.has("_code")) 20860 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 20861 if (json.has("profile")) 20862 res.setProfileElement(parseCanonical(json.get("profile").getAsString())); 20863 if (json.has("_profile")) 20864 parseElementProperties(getJObject(json, "_profile"), res.getProfileElement()); 20865 if (json.has("min")) 20866 res.setMinElement(parseUnsignedInt(json.get("min").getAsString())); 20867 if (json.has("_min")) 20868 parseElementProperties(getJObject(json, "_min"), res.getMinElement()); 20869 if (json.has("max")) 20870 res.setMaxElement(parseString(json.get("max").getAsString())); 20871 if (json.has("_max")) 20872 parseElementProperties(getJObject(json, "_max"), res.getMaxElement()); 20873 } 20874 20875 protected MessageDefinition.MessageDefinitionAllowedResponseComponent parseMessageDefinitionMessageDefinitionAllowedResponseComponent( 20876 JsonObject json, MessageDefinition owner) throws IOException, FHIRFormatError { 20877 MessageDefinition.MessageDefinitionAllowedResponseComponent res = new MessageDefinition.MessageDefinitionAllowedResponseComponent(); 20878 parseMessageDefinitionMessageDefinitionAllowedResponseComponentProperties(json, owner, res); 20879 return res; 20880 } 20881 20882 protected void parseMessageDefinitionMessageDefinitionAllowedResponseComponentProperties(JsonObject json, 20883 MessageDefinition owner, MessageDefinition.MessageDefinitionAllowedResponseComponent res) 20884 throws IOException, FHIRFormatError { 20885 parseBackboneElementProperties(json, res); 20886 if (json.has("message")) 20887 res.setMessageElement(parseCanonical(json.get("message").getAsString())); 20888 if (json.has("_message")) 20889 parseElementProperties(getJObject(json, "_message"), res.getMessageElement()); 20890 if (json.has("situation")) 20891 res.setSituationElement(parseMarkdown(json.get("situation").getAsString())); 20892 if (json.has("_situation")) 20893 parseElementProperties(getJObject(json, "_situation"), res.getSituationElement()); 20894 } 20895 20896 protected MessageHeader parseMessageHeader(JsonObject json) throws IOException, FHIRFormatError { 20897 MessageHeader res = new MessageHeader(); 20898 parseMessageHeaderProperties(json, res); 20899 return res; 20900 } 20901 20902 protected void parseMessageHeaderProperties(JsonObject json, MessageHeader res) throws IOException, FHIRFormatError { 20903 parseDomainResourceProperties(json, res); 20904 Type event = parseType("event", json); 20905 if (event != null) 20906 res.setEvent(event); 20907 if (json.has("destination")) { 20908 JsonArray array = json.getAsJsonArray("destination"); 20909 for (int i = 0; i < array.size(); i++) { 20910 res.getDestination().add(parseMessageHeaderMessageDestinationComponent(array.get(i).getAsJsonObject(), res)); 20911 } 20912 } 20913 ; 20914 if (json.has("sender")) 20915 res.setSender(parseReference(getJObject(json, "sender"))); 20916 if (json.has("enterer")) 20917 res.setEnterer(parseReference(getJObject(json, "enterer"))); 20918 if (json.has("author")) 20919 res.setAuthor(parseReference(getJObject(json, "author"))); 20920 if (json.has("source")) 20921 res.setSource(parseMessageHeaderMessageSourceComponent(getJObject(json, "source"), res)); 20922 if (json.has("responsible")) 20923 res.setResponsible(parseReference(getJObject(json, "responsible"))); 20924 if (json.has("reason")) 20925 res.setReason(parseCodeableConcept(getJObject(json, "reason"))); 20926 if (json.has("response")) 20927 res.setResponse(parseMessageHeaderMessageHeaderResponseComponent(getJObject(json, "response"), res)); 20928 if (json.has("focus")) { 20929 JsonArray array = json.getAsJsonArray("focus"); 20930 for (int i = 0; i < array.size(); i++) { 20931 res.getFocus().add(parseReference(array.get(i).getAsJsonObject())); 20932 } 20933 } 20934 ; 20935 if (json.has("definition")) 20936 res.setDefinitionElement(parseCanonical(json.get("definition").getAsString())); 20937 if (json.has("_definition")) 20938 parseElementProperties(getJObject(json, "_definition"), res.getDefinitionElement()); 20939 } 20940 20941 protected MessageHeader.MessageDestinationComponent parseMessageHeaderMessageDestinationComponent(JsonObject json, 20942 MessageHeader owner) throws IOException, FHIRFormatError { 20943 MessageHeader.MessageDestinationComponent res = new MessageHeader.MessageDestinationComponent(); 20944 parseMessageHeaderMessageDestinationComponentProperties(json, owner, res); 20945 return res; 20946 } 20947 20948 protected void parseMessageHeaderMessageDestinationComponentProperties(JsonObject json, MessageHeader owner, 20949 MessageHeader.MessageDestinationComponent res) throws IOException, FHIRFormatError { 20950 parseBackboneElementProperties(json, res); 20951 if (json.has("name")) 20952 res.setNameElement(parseString(json.get("name").getAsString())); 20953 if (json.has("_name")) 20954 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 20955 if (json.has("target")) 20956 res.setTarget(parseReference(getJObject(json, "target"))); 20957 if (json.has("endpoint")) 20958 res.setEndpointElement(parseUrl(json.get("endpoint").getAsString())); 20959 if (json.has("_endpoint")) 20960 parseElementProperties(getJObject(json, "_endpoint"), res.getEndpointElement()); 20961 if (json.has("receiver")) 20962 res.setReceiver(parseReference(getJObject(json, "receiver"))); 20963 } 20964 20965 protected MessageHeader.MessageSourceComponent parseMessageHeaderMessageSourceComponent(JsonObject json, 20966 MessageHeader owner) throws IOException, FHIRFormatError { 20967 MessageHeader.MessageSourceComponent res = new MessageHeader.MessageSourceComponent(); 20968 parseMessageHeaderMessageSourceComponentProperties(json, owner, res); 20969 return res; 20970 } 20971 20972 protected void parseMessageHeaderMessageSourceComponentProperties(JsonObject json, MessageHeader owner, 20973 MessageHeader.MessageSourceComponent res) throws IOException, FHIRFormatError { 20974 parseBackboneElementProperties(json, res); 20975 if (json.has("name")) 20976 res.setNameElement(parseString(json.get("name").getAsString())); 20977 if (json.has("_name")) 20978 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 20979 if (json.has("software")) 20980 res.setSoftwareElement(parseString(json.get("software").getAsString())); 20981 if (json.has("_software")) 20982 parseElementProperties(getJObject(json, "_software"), res.getSoftwareElement()); 20983 if (json.has("version")) 20984 res.setVersionElement(parseString(json.get("version").getAsString())); 20985 if (json.has("_version")) 20986 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 20987 if (json.has("contact")) 20988 res.setContact(parseContactPoint(getJObject(json, "contact"))); 20989 if (json.has("endpoint")) 20990 res.setEndpointElement(parseUrl(json.get("endpoint").getAsString())); 20991 if (json.has("_endpoint")) 20992 parseElementProperties(getJObject(json, "_endpoint"), res.getEndpointElement()); 20993 } 20994 20995 protected MessageHeader.MessageHeaderResponseComponent parseMessageHeaderMessageHeaderResponseComponent( 20996 JsonObject json, MessageHeader owner) throws IOException, FHIRFormatError { 20997 MessageHeader.MessageHeaderResponseComponent res = new MessageHeader.MessageHeaderResponseComponent(); 20998 parseMessageHeaderMessageHeaderResponseComponentProperties(json, owner, res); 20999 return res; 21000 } 21001 21002 protected void parseMessageHeaderMessageHeaderResponseComponentProperties(JsonObject json, MessageHeader owner, 21003 MessageHeader.MessageHeaderResponseComponent res) throws IOException, FHIRFormatError { 21004 parseBackboneElementProperties(json, res); 21005 if (json.has("identifier")) 21006 res.setIdentifierElement(parseId(json.get("identifier").getAsString())); 21007 if (json.has("_identifier")) 21008 parseElementProperties(getJObject(json, "_identifier"), res.getIdentifierElement()); 21009 if (json.has("code")) 21010 res.setCodeElement(parseEnumeration(json.get("code").getAsString(), MessageHeader.ResponseType.NULL, 21011 new MessageHeader.ResponseTypeEnumFactory())); 21012 if (json.has("_code")) 21013 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 21014 if (json.has("details")) 21015 res.setDetails(parseReference(getJObject(json, "details"))); 21016 } 21017 21018 protected MolecularSequence parseMolecularSequence(JsonObject json) throws IOException, FHIRFormatError { 21019 MolecularSequence res = new MolecularSequence(); 21020 parseMolecularSequenceProperties(json, res); 21021 return res; 21022 } 21023 21024 protected void parseMolecularSequenceProperties(JsonObject json, MolecularSequence res) 21025 throws IOException, FHIRFormatError { 21026 parseDomainResourceProperties(json, res); 21027 if (json.has("identifier")) { 21028 JsonArray array = json.getAsJsonArray("identifier"); 21029 for (int i = 0; i < array.size(); i++) { 21030 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 21031 } 21032 } 21033 ; 21034 if (json.has("type")) 21035 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), MolecularSequence.SequenceType.NULL, 21036 new MolecularSequence.SequenceTypeEnumFactory())); 21037 if (json.has("_type")) 21038 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 21039 if (json.has("coordinateSystem")) 21040 res.setCoordinateSystemElement(parseInteger(json.get("coordinateSystem").getAsLong())); 21041 if (json.has("_coordinateSystem")) 21042 parseElementProperties(getJObject(json, "_coordinateSystem"), res.getCoordinateSystemElement()); 21043 if (json.has("patient")) 21044 res.setPatient(parseReference(getJObject(json, "patient"))); 21045 if (json.has("specimen")) 21046 res.setSpecimen(parseReference(getJObject(json, "specimen"))); 21047 if (json.has("device")) 21048 res.setDevice(parseReference(getJObject(json, "device"))); 21049 if (json.has("performer")) 21050 res.setPerformer(parseReference(getJObject(json, "performer"))); 21051 if (json.has("quantity")) 21052 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 21053 if (json.has("referenceSeq")) 21054 res.setReferenceSeq( 21055 parseMolecularSequenceMolecularSequenceReferenceSeqComponent(getJObject(json, "referenceSeq"), res)); 21056 if (json.has("variant")) { 21057 JsonArray array = json.getAsJsonArray("variant"); 21058 for (int i = 0; i < array.size(); i++) { 21059 res.getVariant() 21060 .add(parseMolecularSequenceMolecularSequenceVariantComponent(array.get(i).getAsJsonObject(), res)); 21061 } 21062 } 21063 ; 21064 if (json.has("observedSeq")) 21065 res.setObservedSeqElement(parseString(json.get("observedSeq").getAsString())); 21066 if (json.has("_observedSeq")) 21067 parseElementProperties(getJObject(json, "_observedSeq"), res.getObservedSeqElement()); 21068 if (json.has("quality")) { 21069 JsonArray array = json.getAsJsonArray("quality"); 21070 for (int i = 0; i < array.size(); i++) { 21071 res.getQuality() 21072 .add(parseMolecularSequenceMolecularSequenceQualityComponent(array.get(i).getAsJsonObject(), res)); 21073 } 21074 } 21075 ; 21076 if (json.has("readCoverage")) 21077 res.setReadCoverageElement(parseInteger(json.get("readCoverage").getAsLong())); 21078 if (json.has("_readCoverage")) 21079 parseElementProperties(getJObject(json, "_readCoverage"), res.getReadCoverageElement()); 21080 if (json.has("repository")) { 21081 JsonArray array = json.getAsJsonArray("repository"); 21082 for (int i = 0; i < array.size(); i++) { 21083 res.getRepository() 21084 .add(parseMolecularSequenceMolecularSequenceRepositoryComponent(array.get(i).getAsJsonObject(), res)); 21085 } 21086 } 21087 ; 21088 if (json.has("pointer")) { 21089 JsonArray array = json.getAsJsonArray("pointer"); 21090 for (int i = 0; i < array.size(); i++) { 21091 res.getPointer().add(parseReference(array.get(i).getAsJsonObject())); 21092 } 21093 } 21094 ; 21095 if (json.has("structureVariant")) { 21096 JsonArray array = json.getAsJsonArray("structureVariant"); 21097 for (int i = 0; i < array.size(); i++) { 21098 res.getStructureVariant() 21099 .add(parseMolecularSequenceMolecularSequenceStructureVariantComponent(array.get(i).getAsJsonObject(), res)); 21100 } 21101 } 21102 ; 21103 } 21104 21105 protected MolecularSequence.MolecularSequenceReferenceSeqComponent parseMolecularSequenceMolecularSequenceReferenceSeqComponent( 21106 JsonObject json, MolecularSequence owner) throws IOException, FHIRFormatError { 21107 MolecularSequence.MolecularSequenceReferenceSeqComponent res = new MolecularSequence.MolecularSequenceReferenceSeqComponent(); 21108 parseMolecularSequenceMolecularSequenceReferenceSeqComponentProperties(json, owner, res); 21109 return res; 21110 } 21111 21112 protected void parseMolecularSequenceMolecularSequenceReferenceSeqComponentProperties(JsonObject json, 21113 MolecularSequence owner, MolecularSequence.MolecularSequenceReferenceSeqComponent res) 21114 throws IOException, FHIRFormatError { 21115 parseBackboneElementProperties(json, res); 21116 if (json.has("chromosome")) 21117 res.setChromosome(parseCodeableConcept(getJObject(json, "chromosome"))); 21118 if (json.has("genomeBuild")) 21119 res.setGenomeBuildElement(parseString(json.get("genomeBuild").getAsString())); 21120 if (json.has("_genomeBuild")) 21121 parseElementProperties(getJObject(json, "_genomeBuild"), res.getGenomeBuildElement()); 21122 if (json.has("orientation")) 21123 res.setOrientationElement(parseEnumeration(json.get("orientation").getAsString(), 21124 MolecularSequence.OrientationType.NULL, new MolecularSequence.OrientationTypeEnumFactory())); 21125 if (json.has("_orientation")) 21126 parseElementProperties(getJObject(json, "_orientation"), res.getOrientationElement()); 21127 if (json.has("referenceSeqId")) 21128 res.setReferenceSeqId(parseCodeableConcept(getJObject(json, "referenceSeqId"))); 21129 if (json.has("referenceSeqPointer")) 21130 res.setReferenceSeqPointer(parseReference(getJObject(json, "referenceSeqPointer"))); 21131 if (json.has("referenceSeqString")) 21132 res.setReferenceSeqStringElement(parseString(json.get("referenceSeqString").getAsString())); 21133 if (json.has("_referenceSeqString")) 21134 parseElementProperties(getJObject(json, "_referenceSeqString"), res.getReferenceSeqStringElement()); 21135 if (json.has("strand")) 21136 res.setStrandElement(parseEnumeration(json.get("strand").getAsString(), MolecularSequence.StrandType.NULL, 21137 new MolecularSequence.StrandTypeEnumFactory())); 21138 if (json.has("_strand")) 21139 parseElementProperties(getJObject(json, "_strand"), res.getStrandElement()); 21140 if (json.has("windowStart")) 21141 res.setWindowStartElement(parseInteger(json.get("windowStart").getAsLong())); 21142 if (json.has("_windowStart")) 21143 parseElementProperties(getJObject(json, "_windowStart"), res.getWindowStartElement()); 21144 if (json.has("windowEnd")) 21145 res.setWindowEndElement(parseInteger(json.get("windowEnd").getAsLong())); 21146 if (json.has("_windowEnd")) 21147 parseElementProperties(getJObject(json, "_windowEnd"), res.getWindowEndElement()); 21148 } 21149 21150 protected MolecularSequence.MolecularSequenceVariantComponent parseMolecularSequenceMolecularSequenceVariantComponent( 21151 JsonObject json, MolecularSequence owner) throws IOException, FHIRFormatError { 21152 MolecularSequence.MolecularSequenceVariantComponent res = new MolecularSequence.MolecularSequenceVariantComponent(); 21153 parseMolecularSequenceMolecularSequenceVariantComponentProperties(json, owner, res); 21154 return res; 21155 } 21156 21157 protected void parseMolecularSequenceMolecularSequenceVariantComponentProperties(JsonObject json, 21158 MolecularSequence owner, MolecularSequence.MolecularSequenceVariantComponent res) 21159 throws IOException, FHIRFormatError { 21160 parseBackboneElementProperties(json, res); 21161 if (json.has("start")) 21162 res.setStartElement(parseInteger(json.get("start").getAsLong())); 21163 if (json.has("_start")) 21164 parseElementProperties(getJObject(json, "_start"), res.getStartElement()); 21165 if (json.has("end")) 21166 res.setEndElement(parseInteger(json.get("end").getAsLong())); 21167 if (json.has("_end")) 21168 parseElementProperties(getJObject(json, "_end"), res.getEndElement()); 21169 if (json.has("observedAllele")) 21170 res.setObservedAlleleElement(parseString(json.get("observedAllele").getAsString())); 21171 if (json.has("_observedAllele")) 21172 parseElementProperties(getJObject(json, "_observedAllele"), res.getObservedAlleleElement()); 21173 if (json.has("referenceAllele")) 21174 res.setReferenceAlleleElement(parseString(json.get("referenceAllele").getAsString())); 21175 if (json.has("_referenceAllele")) 21176 parseElementProperties(getJObject(json, "_referenceAllele"), res.getReferenceAlleleElement()); 21177 if (json.has("cigar")) 21178 res.setCigarElement(parseString(json.get("cigar").getAsString())); 21179 if (json.has("_cigar")) 21180 parseElementProperties(getJObject(json, "_cigar"), res.getCigarElement()); 21181 if (json.has("variantPointer")) 21182 res.setVariantPointer(parseReference(getJObject(json, "variantPointer"))); 21183 } 21184 21185 protected MolecularSequence.MolecularSequenceQualityComponent parseMolecularSequenceMolecularSequenceQualityComponent( 21186 JsonObject json, MolecularSequence owner) throws IOException, FHIRFormatError { 21187 MolecularSequence.MolecularSequenceQualityComponent res = new MolecularSequence.MolecularSequenceQualityComponent(); 21188 parseMolecularSequenceMolecularSequenceQualityComponentProperties(json, owner, res); 21189 return res; 21190 } 21191 21192 protected void parseMolecularSequenceMolecularSequenceQualityComponentProperties(JsonObject json, 21193 MolecularSequence owner, MolecularSequence.MolecularSequenceQualityComponent res) 21194 throws IOException, FHIRFormatError { 21195 parseBackboneElementProperties(json, res); 21196 if (json.has("type")) 21197 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), MolecularSequence.QualityType.NULL, 21198 new MolecularSequence.QualityTypeEnumFactory())); 21199 if (json.has("_type")) 21200 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 21201 if (json.has("standardSequence")) 21202 res.setStandardSequence(parseCodeableConcept(getJObject(json, "standardSequence"))); 21203 if (json.has("start")) 21204 res.setStartElement(parseInteger(json.get("start").getAsLong())); 21205 if (json.has("_start")) 21206 parseElementProperties(getJObject(json, "_start"), res.getStartElement()); 21207 if (json.has("end")) 21208 res.setEndElement(parseInteger(json.get("end").getAsLong())); 21209 if (json.has("_end")) 21210 parseElementProperties(getJObject(json, "_end"), res.getEndElement()); 21211 if (json.has("score")) 21212 res.setScore(parseQuantity(getJObject(json, "score"))); 21213 if (json.has("method")) 21214 res.setMethod(parseCodeableConcept(getJObject(json, "method"))); 21215 if (json.has("truthTP")) 21216 res.setTruthTPElement(parseDecimal(json.get("truthTP").getAsBigDecimal())); 21217 if (json.has("_truthTP")) 21218 parseElementProperties(getJObject(json, "_truthTP"), res.getTruthTPElement()); 21219 if (json.has("queryTP")) 21220 res.setQueryTPElement(parseDecimal(json.get("queryTP").getAsBigDecimal())); 21221 if (json.has("_queryTP")) 21222 parseElementProperties(getJObject(json, "_queryTP"), res.getQueryTPElement()); 21223 if (json.has("truthFN")) 21224 res.setTruthFNElement(parseDecimal(json.get("truthFN").getAsBigDecimal())); 21225 if (json.has("_truthFN")) 21226 parseElementProperties(getJObject(json, "_truthFN"), res.getTruthFNElement()); 21227 if (json.has("queryFP")) 21228 res.setQueryFPElement(parseDecimal(json.get("queryFP").getAsBigDecimal())); 21229 if (json.has("_queryFP")) 21230 parseElementProperties(getJObject(json, "_queryFP"), res.getQueryFPElement()); 21231 if (json.has("gtFP")) 21232 res.setGtFPElement(parseDecimal(json.get("gtFP").getAsBigDecimal())); 21233 if (json.has("_gtFP")) 21234 parseElementProperties(getJObject(json, "_gtFP"), res.getGtFPElement()); 21235 if (json.has("precision")) 21236 res.setPrecisionElement(parseDecimal(json.get("precision").getAsBigDecimal())); 21237 if (json.has("_precision")) 21238 parseElementProperties(getJObject(json, "_precision"), res.getPrecisionElement()); 21239 if (json.has("recall")) 21240 res.setRecallElement(parseDecimal(json.get("recall").getAsBigDecimal())); 21241 if (json.has("_recall")) 21242 parseElementProperties(getJObject(json, "_recall"), res.getRecallElement()); 21243 if (json.has("fScore")) 21244 res.setFScoreElement(parseDecimal(json.get("fScore").getAsBigDecimal())); 21245 if (json.has("_fScore")) 21246 parseElementProperties(getJObject(json, "_fScore"), res.getFScoreElement()); 21247 if (json.has("roc")) 21248 res.setRoc(parseMolecularSequenceMolecularSequenceQualityRocComponent(getJObject(json, "roc"), owner)); 21249 } 21250 21251 protected MolecularSequence.MolecularSequenceQualityRocComponent parseMolecularSequenceMolecularSequenceQualityRocComponent( 21252 JsonObject json, MolecularSequence owner) throws IOException, FHIRFormatError { 21253 MolecularSequence.MolecularSequenceQualityRocComponent res = new MolecularSequence.MolecularSequenceQualityRocComponent(); 21254 parseMolecularSequenceMolecularSequenceQualityRocComponentProperties(json, owner, res); 21255 return res; 21256 } 21257 21258 protected void parseMolecularSequenceMolecularSequenceQualityRocComponentProperties(JsonObject json, 21259 MolecularSequence owner, MolecularSequence.MolecularSequenceQualityRocComponent res) 21260 throws IOException, FHIRFormatError { 21261 parseBackboneElementProperties(json, res); 21262 if (json.has("score")) { 21263 JsonArray array = json.getAsJsonArray("score"); 21264 for (int i = 0; i < array.size(); i++) { 21265 if (array.get(i).isJsonNull()) { 21266 res.getScore().add(new IntegerType()); 21267 } else { 21268 res.getScore().add(parseInteger(array.get(i).getAsLong())); 21269 } 21270 } 21271 } 21272 ; 21273 if (json.has("_score")) { 21274 JsonArray array = json.getAsJsonArray("_score"); 21275 for (int i = 0; i < array.size(); i++) { 21276 if (i == res.getScore().size()) 21277 res.getScore().add(parseInteger(null)); 21278 if (array.get(i) instanceof JsonObject) 21279 parseElementProperties(array.get(i).getAsJsonObject(), res.getScore().get(i)); 21280 } 21281 } 21282 ; 21283 if (json.has("numTP")) { 21284 JsonArray array = json.getAsJsonArray("numTP"); 21285 for (int i = 0; i < array.size(); i++) { 21286 if (array.get(i).isJsonNull()) { 21287 res.getNumTP().add(new IntegerType()); 21288 } else { 21289 res.getNumTP().add(parseInteger(array.get(i).getAsLong())); 21290 } 21291 } 21292 } 21293 ; 21294 if (json.has("_numTP")) { 21295 JsonArray array = json.getAsJsonArray("_numTP"); 21296 for (int i = 0; i < array.size(); i++) { 21297 if (i == res.getNumTP().size()) 21298 res.getNumTP().add(parseInteger(null)); 21299 if (array.get(i) instanceof JsonObject) 21300 parseElementProperties(array.get(i).getAsJsonObject(), res.getNumTP().get(i)); 21301 } 21302 } 21303 ; 21304 if (json.has("numFP")) { 21305 JsonArray array = json.getAsJsonArray("numFP"); 21306 for (int i = 0; i < array.size(); i++) { 21307 if (array.get(i).isJsonNull()) { 21308 res.getNumFP().add(new IntegerType()); 21309 } else { 21310 res.getNumFP().add(parseInteger(array.get(i).getAsLong())); 21311 } 21312 } 21313 } 21314 ; 21315 if (json.has("_numFP")) { 21316 JsonArray array = json.getAsJsonArray("_numFP"); 21317 for (int i = 0; i < array.size(); i++) { 21318 if (i == res.getNumFP().size()) 21319 res.getNumFP().add(parseInteger(null)); 21320 if (array.get(i) instanceof JsonObject) 21321 parseElementProperties(array.get(i).getAsJsonObject(), res.getNumFP().get(i)); 21322 } 21323 } 21324 ; 21325 if (json.has("numFN")) { 21326 JsonArray array = json.getAsJsonArray("numFN"); 21327 for (int i = 0; i < array.size(); i++) { 21328 if (array.get(i).isJsonNull()) { 21329 res.getNumFN().add(new IntegerType()); 21330 } else { 21331 res.getNumFN().add(parseInteger(array.get(i).getAsLong())); 21332 } 21333 } 21334 } 21335 ; 21336 if (json.has("_numFN")) { 21337 JsonArray array = json.getAsJsonArray("_numFN"); 21338 for (int i = 0; i < array.size(); i++) { 21339 if (i == res.getNumFN().size()) 21340 res.getNumFN().add(parseInteger(null)); 21341 if (array.get(i) instanceof JsonObject) 21342 parseElementProperties(array.get(i).getAsJsonObject(), res.getNumFN().get(i)); 21343 } 21344 } 21345 ; 21346 if (json.has("precision")) { 21347 JsonArray array = json.getAsJsonArray("precision"); 21348 for (int i = 0; i < array.size(); i++) { 21349 if (array.get(i).isJsonNull()) { 21350 res.getPrecision().add(new DecimalType()); 21351 } else { 21352 res.getPrecision().add(parseDecimal(array.get(i).getAsBigDecimal())); 21353 } 21354 } 21355 } 21356 ; 21357 if (json.has("_precision")) { 21358 JsonArray array = json.getAsJsonArray("_precision"); 21359 for (int i = 0; i < array.size(); i++) { 21360 if (i == res.getPrecision().size()) 21361 res.getPrecision().add(parseDecimal(null)); 21362 if (array.get(i) instanceof JsonObject) 21363 parseElementProperties(array.get(i).getAsJsonObject(), res.getPrecision().get(i)); 21364 } 21365 } 21366 ; 21367 if (json.has("sensitivity")) { 21368 JsonArray array = json.getAsJsonArray("sensitivity"); 21369 for (int i = 0; i < array.size(); i++) { 21370 if (array.get(i).isJsonNull()) { 21371 res.getSensitivity().add(new DecimalType()); 21372 } else { 21373 res.getSensitivity().add(parseDecimal(array.get(i).getAsBigDecimal())); 21374 } 21375 } 21376 } 21377 ; 21378 if (json.has("_sensitivity")) { 21379 JsonArray array = json.getAsJsonArray("_sensitivity"); 21380 for (int i = 0; i < array.size(); i++) { 21381 if (i == res.getSensitivity().size()) 21382 res.getSensitivity().add(parseDecimal(null)); 21383 if (array.get(i) instanceof JsonObject) 21384 parseElementProperties(array.get(i).getAsJsonObject(), res.getSensitivity().get(i)); 21385 } 21386 } 21387 ; 21388 if (json.has("fMeasure")) { 21389 JsonArray array = json.getAsJsonArray("fMeasure"); 21390 for (int i = 0; i < array.size(); i++) { 21391 if (array.get(i).isJsonNull()) { 21392 res.getFMeasure().add(new DecimalType()); 21393 } else { 21394 res.getFMeasure().add(parseDecimal(array.get(i).getAsBigDecimal())); 21395 } 21396 } 21397 } 21398 ; 21399 if (json.has("_fMeasure")) { 21400 JsonArray array = json.getAsJsonArray("_fMeasure"); 21401 for (int i = 0; i < array.size(); i++) { 21402 if (i == res.getFMeasure().size()) 21403 res.getFMeasure().add(parseDecimal(null)); 21404 if (array.get(i) instanceof JsonObject) 21405 parseElementProperties(array.get(i).getAsJsonObject(), res.getFMeasure().get(i)); 21406 } 21407 } 21408 ; 21409 } 21410 21411 protected MolecularSequence.MolecularSequenceRepositoryComponent parseMolecularSequenceMolecularSequenceRepositoryComponent( 21412 JsonObject json, MolecularSequence owner) throws IOException, FHIRFormatError { 21413 MolecularSequence.MolecularSequenceRepositoryComponent res = new MolecularSequence.MolecularSequenceRepositoryComponent(); 21414 parseMolecularSequenceMolecularSequenceRepositoryComponentProperties(json, owner, res); 21415 return res; 21416 } 21417 21418 protected void parseMolecularSequenceMolecularSequenceRepositoryComponentProperties(JsonObject json, 21419 MolecularSequence owner, MolecularSequence.MolecularSequenceRepositoryComponent res) 21420 throws IOException, FHIRFormatError { 21421 parseBackboneElementProperties(json, res); 21422 if (json.has("type")) 21423 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), MolecularSequence.RepositoryType.NULL, 21424 new MolecularSequence.RepositoryTypeEnumFactory())); 21425 if (json.has("_type")) 21426 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 21427 if (json.has("url")) 21428 res.setUrlElement(parseUri(json.get("url").getAsString())); 21429 if (json.has("_url")) 21430 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 21431 if (json.has("name")) 21432 res.setNameElement(parseString(json.get("name").getAsString())); 21433 if (json.has("_name")) 21434 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 21435 if (json.has("datasetId")) 21436 res.setDatasetIdElement(parseString(json.get("datasetId").getAsString())); 21437 if (json.has("_datasetId")) 21438 parseElementProperties(getJObject(json, "_datasetId"), res.getDatasetIdElement()); 21439 if (json.has("variantsetId")) 21440 res.setVariantsetIdElement(parseString(json.get("variantsetId").getAsString())); 21441 if (json.has("_variantsetId")) 21442 parseElementProperties(getJObject(json, "_variantsetId"), res.getVariantsetIdElement()); 21443 if (json.has("readsetId")) 21444 res.setReadsetIdElement(parseString(json.get("readsetId").getAsString())); 21445 if (json.has("_readsetId")) 21446 parseElementProperties(getJObject(json, "_readsetId"), res.getReadsetIdElement()); 21447 } 21448 21449 protected MolecularSequence.MolecularSequenceStructureVariantComponent parseMolecularSequenceMolecularSequenceStructureVariantComponent( 21450 JsonObject json, MolecularSequence owner) throws IOException, FHIRFormatError { 21451 MolecularSequence.MolecularSequenceStructureVariantComponent res = new MolecularSequence.MolecularSequenceStructureVariantComponent(); 21452 parseMolecularSequenceMolecularSequenceStructureVariantComponentProperties(json, owner, res); 21453 return res; 21454 } 21455 21456 protected void parseMolecularSequenceMolecularSequenceStructureVariantComponentProperties(JsonObject json, 21457 MolecularSequence owner, MolecularSequence.MolecularSequenceStructureVariantComponent res) 21458 throws IOException, FHIRFormatError { 21459 parseBackboneElementProperties(json, res); 21460 if (json.has("variantType")) 21461 res.setVariantType(parseCodeableConcept(getJObject(json, "variantType"))); 21462 if (json.has("exact")) 21463 res.setExactElement(parseBoolean(json.get("exact").getAsBoolean())); 21464 if (json.has("_exact")) 21465 parseElementProperties(getJObject(json, "_exact"), res.getExactElement()); 21466 if (json.has("length")) 21467 res.setLengthElement(parseInteger(json.get("length").getAsLong())); 21468 if (json.has("_length")) 21469 parseElementProperties(getJObject(json, "_length"), res.getLengthElement()); 21470 if (json.has("outer")) 21471 res.setOuter( 21472 parseMolecularSequenceMolecularSequenceStructureVariantOuterComponent(getJObject(json, "outer"), owner)); 21473 if (json.has("inner")) 21474 res.setInner( 21475 parseMolecularSequenceMolecularSequenceStructureVariantInnerComponent(getJObject(json, "inner"), owner)); 21476 } 21477 21478 protected MolecularSequence.MolecularSequenceStructureVariantOuterComponent parseMolecularSequenceMolecularSequenceStructureVariantOuterComponent( 21479 JsonObject json, MolecularSequence owner) throws IOException, FHIRFormatError { 21480 MolecularSequence.MolecularSequenceStructureVariantOuterComponent res = new MolecularSequence.MolecularSequenceStructureVariantOuterComponent(); 21481 parseMolecularSequenceMolecularSequenceStructureVariantOuterComponentProperties(json, owner, res); 21482 return res; 21483 } 21484 21485 protected void parseMolecularSequenceMolecularSequenceStructureVariantOuterComponentProperties(JsonObject json, 21486 MolecularSequence owner, MolecularSequence.MolecularSequenceStructureVariantOuterComponent res) 21487 throws IOException, FHIRFormatError { 21488 parseBackboneElementProperties(json, res); 21489 if (json.has("start")) 21490 res.setStartElement(parseInteger(json.get("start").getAsLong())); 21491 if (json.has("_start")) 21492 parseElementProperties(getJObject(json, "_start"), res.getStartElement()); 21493 if (json.has("end")) 21494 res.setEndElement(parseInteger(json.get("end").getAsLong())); 21495 if (json.has("_end")) 21496 parseElementProperties(getJObject(json, "_end"), res.getEndElement()); 21497 } 21498 21499 protected MolecularSequence.MolecularSequenceStructureVariantInnerComponent parseMolecularSequenceMolecularSequenceStructureVariantInnerComponent( 21500 JsonObject json, MolecularSequence owner) throws IOException, FHIRFormatError { 21501 MolecularSequence.MolecularSequenceStructureVariantInnerComponent res = new MolecularSequence.MolecularSequenceStructureVariantInnerComponent(); 21502 parseMolecularSequenceMolecularSequenceStructureVariantInnerComponentProperties(json, owner, res); 21503 return res; 21504 } 21505 21506 protected void parseMolecularSequenceMolecularSequenceStructureVariantInnerComponentProperties(JsonObject json, 21507 MolecularSequence owner, MolecularSequence.MolecularSequenceStructureVariantInnerComponent res) 21508 throws IOException, FHIRFormatError { 21509 parseBackboneElementProperties(json, res); 21510 if (json.has("start")) 21511 res.setStartElement(parseInteger(json.get("start").getAsLong())); 21512 if (json.has("_start")) 21513 parseElementProperties(getJObject(json, "_start"), res.getStartElement()); 21514 if (json.has("end")) 21515 res.setEndElement(parseInteger(json.get("end").getAsLong())); 21516 if (json.has("_end")) 21517 parseElementProperties(getJObject(json, "_end"), res.getEndElement()); 21518 } 21519 21520 protected NamingSystem parseNamingSystem(JsonObject json) throws IOException, FHIRFormatError { 21521 NamingSystem res = new NamingSystem(); 21522 parseNamingSystemProperties(json, res); 21523 return res; 21524 } 21525 21526 protected void parseNamingSystemProperties(JsonObject json, NamingSystem res) throws IOException, FHIRFormatError { 21527 parseDomainResourceProperties(json, res); 21528 if (json.has("name")) 21529 res.setNameElement(parseString(json.get("name").getAsString())); 21530 if (json.has("_name")) 21531 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 21532 if (json.has("status")) 21533 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 21534 new Enumerations.PublicationStatusEnumFactory())); 21535 if (json.has("_status")) 21536 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 21537 if (json.has("kind")) 21538 res.setKindElement(parseEnumeration(json.get("kind").getAsString(), NamingSystem.NamingSystemType.NULL, 21539 new NamingSystem.NamingSystemTypeEnumFactory())); 21540 if (json.has("_kind")) 21541 parseElementProperties(getJObject(json, "_kind"), res.getKindElement()); 21542 if (json.has("date")) 21543 res.setDateElement(parseDateTime(json.get("date").getAsString())); 21544 if (json.has("_date")) 21545 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 21546 if (json.has("publisher")) 21547 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 21548 if (json.has("_publisher")) 21549 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 21550 if (json.has("contact")) { 21551 JsonArray array = json.getAsJsonArray("contact"); 21552 for (int i = 0; i < array.size(); i++) { 21553 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 21554 } 21555 } 21556 ; 21557 if (json.has("responsible")) 21558 res.setResponsibleElement(parseString(json.get("responsible").getAsString())); 21559 if (json.has("_responsible")) 21560 parseElementProperties(getJObject(json, "_responsible"), res.getResponsibleElement()); 21561 if (json.has("type")) 21562 res.setType(parseCodeableConcept(getJObject(json, "type"))); 21563 if (json.has("description")) 21564 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 21565 if (json.has("_description")) 21566 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 21567 if (json.has("useContext")) { 21568 JsonArray array = json.getAsJsonArray("useContext"); 21569 for (int i = 0; i < array.size(); i++) { 21570 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 21571 } 21572 } 21573 ; 21574 if (json.has("jurisdiction")) { 21575 JsonArray array = json.getAsJsonArray("jurisdiction"); 21576 for (int i = 0; i < array.size(); i++) { 21577 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 21578 } 21579 } 21580 ; 21581 if (json.has("usage")) 21582 res.setUsageElement(parseString(json.get("usage").getAsString())); 21583 if (json.has("_usage")) 21584 parseElementProperties(getJObject(json, "_usage"), res.getUsageElement()); 21585 if (json.has("uniqueId")) { 21586 JsonArray array = json.getAsJsonArray("uniqueId"); 21587 for (int i = 0; i < array.size(); i++) { 21588 res.getUniqueId().add(parseNamingSystemNamingSystemUniqueIdComponent(array.get(i).getAsJsonObject(), res)); 21589 } 21590 } 21591 ; 21592 } 21593 21594 protected NamingSystem.NamingSystemUniqueIdComponent parseNamingSystemNamingSystemUniqueIdComponent(JsonObject json, 21595 NamingSystem owner) throws IOException, FHIRFormatError { 21596 NamingSystem.NamingSystemUniqueIdComponent res = new NamingSystem.NamingSystemUniqueIdComponent(); 21597 parseNamingSystemNamingSystemUniqueIdComponentProperties(json, owner, res); 21598 return res; 21599 } 21600 21601 protected void parseNamingSystemNamingSystemUniqueIdComponentProperties(JsonObject json, NamingSystem owner, 21602 NamingSystem.NamingSystemUniqueIdComponent res) throws IOException, FHIRFormatError { 21603 parseBackboneElementProperties(json, res); 21604 if (json.has("type")) 21605 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), NamingSystem.NamingSystemIdentifierType.NULL, 21606 new NamingSystem.NamingSystemIdentifierTypeEnumFactory())); 21607 if (json.has("_type")) 21608 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 21609 if (json.has("value")) 21610 res.setValueElement(parseString(json.get("value").getAsString())); 21611 if (json.has("_value")) 21612 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 21613 if (json.has("preferred")) 21614 res.setPreferredElement(parseBoolean(json.get("preferred").getAsBoolean())); 21615 if (json.has("_preferred")) 21616 parseElementProperties(getJObject(json, "_preferred"), res.getPreferredElement()); 21617 if (json.has("comment")) 21618 res.setCommentElement(parseString(json.get("comment").getAsString())); 21619 if (json.has("_comment")) 21620 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 21621 if (json.has("period")) 21622 res.setPeriod(parsePeriod(getJObject(json, "period"))); 21623 } 21624 21625 protected NutritionOrder parseNutritionOrder(JsonObject json) throws IOException, FHIRFormatError { 21626 NutritionOrder res = new NutritionOrder(); 21627 parseNutritionOrderProperties(json, res); 21628 return res; 21629 } 21630 21631 protected void parseNutritionOrderProperties(JsonObject json, NutritionOrder res) 21632 throws IOException, FHIRFormatError { 21633 parseDomainResourceProperties(json, res); 21634 if (json.has("identifier")) { 21635 JsonArray array = json.getAsJsonArray("identifier"); 21636 for (int i = 0; i < array.size(); i++) { 21637 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 21638 } 21639 } 21640 ; 21641 if (json.has("instantiatesCanonical")) { 21642 JsonArray array = json.getAsJsonArray("instantiatesCanonical"); 21643 for (int i = 0; i < array.size(); i++) { 21644 if (array.get(i).isJsonNull()) { 21645 res.getInstantiatesCanonical().add(new CanonicalType()); 21646 } else { 21647 res.getInstantiatesCanonical().add(parseCanonical(array.get(i).getAsString())); 21648 } 21649 } 21650 } 21651 ; 21652 if (json.has("_instantiatesCanonical")) { 21653 JsonArray array = json.getAsJsonArray("_instantiatesCanonical"); 21654 for (int i = 0; i < array.size(); i++) { 21655 if (i == res.getInstantiatesCanonical().size()) 21656 res.getInstantiatesCanonical().add(parseCanonical(null)); 21657 if (array.get(i) instanceof JsonObject) 21658 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesCanonical().get(i)); 21659 } 21660 } 21661 ; 21662 if (json.has("instantiatesUri")) { 21663 JsonArray array = json.getAsJsonArray("instantiatesUri"); 21664 for (int i = 0; i < array.size(); i++) { 21665 if (array.get(i).isJsonNull()) { 21666 res.getInstantiatesUri().add(new UriType()); 21667 } else { 21668 res.getInstantiatesUri().add(parseUri(array.get(i).getAsString())); 21669 } 21670 } 21671 } 21672 ; 21673 if (json.has("_instantiatesUri")) { 21674 JsonArray array = json.getAsJsonArray("_instantiatesUri"); 21675 for (int i = 0; i < array.size(); i++) { 21676 if (i == res.getInstantiatesUri().size()) 21677 res.getInstantiatesUri().add(parseUri(null)); 21678 if (array.get(i) instanceof JsonObject) 21679 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesUri().get(i)); 21680 } 21681 } 21682 ; 21683 if (json.has("instantiates")) { 21684 JsonArray array = json.getAsJsonArray("instantiates"); 21685 for (int i = 0; i < array.size(); i++) { 21686 if (array.get(i).isJsonNull()) { 21687 res.getInstantiates().add(new UriType()); 21688 } else { 21689 res.getInstantiates().add(parseUri(array.get(i).getAsString())); 21690 } 21691 } 21692 } 21693 ; 21694 if (json.has("_instantiates")) { 21695 JsonArray array = json.getAsJsonArray("_instantiates"); 21696 for (int i = 0; i < array.size(); i++) { 21697 if (i == res.getInstantiates().size()) 21698 res.getInstantiates().add(parseUri(null)); 21699 if (array.get(i) instanceof JsonObject) 21700 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiates().get(i)); 21701 } 21702 } 21703 ; 21704 if (json.has("status")) 21705 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), NutritionOrder.NutritionOrderStatus.NULL, 21706 new NutritionOrder.NutritionOrderStatusEnumFactory())); 21707 if (json.has("_status")) 21708 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 21709 if (json.has("intent")) 21710 res.setIntentElement(parseEnumeration(json.get("intent").getAsString(), NutritionOrder.NutritiionOrderIntent.NULL, 21711 new NutritionOrder.NutritiionOrderIntentEnumFactory())); 21712 if (json.has("_intent")) 21713 parseElementProperties(getJObject(json, "_intent"), res.getIntentElement()); 21714 if (json.has("patient")) 21715 res.setPatient(parseReference(getJObject(json, "patient"))); 21716 if (json.has("encounter")) 21717 res.setEncounter(parseReference(getJObject(json, "encounter"))); 21718 if (json.has("dateTime")) 21719 res.setDateTimeElement(parseDateTime(json.get("dateTime").getAsString())); 21720 if (json.has("_dateTime")) 21721 parseElementProperties(getJObject(json, "_dateTime"), res.getDateTimeElement()); 21722 if (json.has("orderer")) 21723 res.setOrderer(parseReference(getJObject(json, "orderer"))); 21724 if (json.has("allergyIntolerance")) { 21725 JsonArray array = json.getAsJsonArray("allergyIntolerance"); 21726 for (int i = 0; i < array.size(); i++) { 21727 res.getAllergyIntolerance().add(parseReference(array.get(i).getAsJsonObject())); 21728 } 21729 } 21730 ; 21731 if (json.has("foodPreferenceModifier")) { 21732 JsonArray array = json.getAsJsonArray("foodPreferenceModifier"); 21733 for (int i = 0; i < array.size(); i++) { 21734 res.getFoodPreferenceModifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 21735 } 21736 } 21737 ; 21738 if (json.has("excludeFoodModifier")) { 21739 JsonArray array = json.getAsJsonArray("excludeFoodModifier"); 21740 for (int i = 0; i < array.size(); i++) { 21741 res.getExcludeFoodModifier().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 21742 } 21743 } 21744 ; 21745 if (json.has("oralDiet")) 21746 res.setOralDiet(parseNutritionOrderNutritionOrderOralDietComponent(getJObject(json, "oralDiet"), res)); 21747 if (json.has("supplement")) { 21748 JsonArray array = json.getAsJsonArray("supplement"); 21749 for (int i = 0; i < array.size(); i++) { 21750 res.getSupplement() 21751 .add(parseNutritionOrderNutritionOrderSupplementComponent(array.get(i).getAsJsonObject(), res)); 21752 } 21753 } 21754 ; 21755 if (json.has("enteralFormula")) 21756 res.setEnteralFormula( 21757 parseNutritionOrderNutritionOrderEnteralFormulaComponent(getJObject(json, "enteralFormula"), res)); 21758 if (json.has("note")) { 21759 JsonArray array = json.getAsJsonArray("note"); 21760 for (int i = 0; i < array.size(); i++) { 21761 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 21762 } 21763 } 21764 ; 21765 } 21766 21767 protected NutritionOrder.NutritionOrderOralDietComponent parseNutritionOrderNutritionOrderOralDietComponent( 21768 JsonObject json, NutritionOrder owner) throws IOException, FHIRFormatError { 21769 NutritionOrder.NutritionOrderOralDietComponent res = new NutritionOrder.NutritionOrderOralDietComponent(); 21770 parseNutritionOrderNutritionOrderOralDietComponentProperties(json, owner, res); 21771 return res; 21772 } 21773 21774 protected void parseNutritionOrderNutritionOrderOralDietComponentProperties(JsonObject json, NutritionOrder owner, 21775 NutritionOrder.NutritionOrderOralDietComponent res) throws IOException, FHIRFormatError { 21776 parseBackboneElementProperties(json, res); 21777 if (json.has("type")) { 21778 JsonArray array = json.getAsJsonArray("type"); 21779 for (int i = 0; i < array.size(); i++) { 21780 res.getType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 21781 } 21782 } 21783 ; 21784 if (json.has("schedule")) { 21785 JsonArray array = json.getAsJsonArray("schedule"); 21786 for (int i = 0; i < array.size(); i++) { 21787 res.getSchedule().add(parseTiming(array.get(i).getAsJsonObject())); 21788 } 21789 } 21790 ; 21791 if (json.has("nutrient")) { 21792 JsonArray array = json.getAsJsonArray("nutrient"); 21793 for (int i = 0; i < array.size(); i++) { 21794 res.getNutrient() 21795 .add(parseNutritionOrderNutritionOrderOralDietNutrientComponent(array.get(i).getAsJsonObject(), owner)); 21796 } 21797 } 21798 ; 21799 if (json.has("texture")) { 21800 JsonArray array = json.getAsJsonArray("texture"); 21801 for (int i = 0; i < array.size(); i++) { 21802 res.getTexture() 21803 .add(parseNutritionOrderNutritionOrderOralDietTextureComponent(array.get(i).getAsJsonObject(), owner)); 21804 } 21805 } 21806 ; 21807 if (json.has("fluidConsistencyType")) { 21808 JsonArray array = json.getAsJsonArray("fluidConsistencyType"); 21809 for (int i = 0; i < array.size(); i++) { 21810 res.getFluidConsistencyType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 21811 } 21812 } 21813 ; 21814 if (json.has("instruction")) 21815 res.setInstructionElement(parseString(json.get("instruction").getAsString())); 21816 if (json.has("_instruction")) 21817 parseElementProperties(getJObject(json, "_instruction"), res.getInstructionElement()); 21818 } 21819 21820 protected NutritionOrder.NutritionOrderOralDietNutrientComponent parseNutritionOrderNutritionOrderOralDietNutrientComponent( 21821 JsonObject json, NutritionOrder owner) throws IOException, FHIRFormatError { 21822 NutritionOrder.NutritionOrderOralDietNutrientComponent res = new NutritionOrder.NutritionOrderOralDietNutrientComponent(); 21823 parseNutritionOrderNutritionOrderOralDietNutrientComponentProperties(json, owner, res); 21824 return res; 21825 } 21826 21827 protected void parseNutritionOrderNutritionOrderOralDietNutrientComponentProperties(JsonObject json, 21828 NutritionOrder owner, NutritionOrder.NutritionOrderOralDietNutrientComponent res) 21829 throws IOException, FHIRFormatError { 21830 parseBackboneElementProperties(json, res); 21831 if (json.has("modifier")) 21832 res.setModifier(parseCodeableConcept(getJObject(json, "modifier"))); 21833 if (json.has("amount")) 21834 res.setAmount(parseQuantity(getJObject(json, "amount"))); 21835 } 21836 21837 protected NutritionOrder.NutritionOrderOralDietTextureComponent parseNutritionOrderNutritionOrderOralDietTextureComponent( 21838 JsonObject json, NutritionOrder owner) throws IOException, FHIRFormatError { 21839 NutritionOrder.NutritionOrderOralDietTextureComponent res = new NutritionOrder.NutritionOrderOralDietTextureComponent(); 21840 parseNutritionOrderNutritionOrderOralDietTextureComponentProperties(json, owner, res); 21841 return res; 21842 } 21843 21844 protected void parseNutritionOrderNutritionOrderOralDietTextureComponentProperties(JsonObject json, 21845 NutritionOrder owner, NutritionOrder.NutritionOrderOralDietTextureComponent res) 21846 throws IOException, FHIRFormatError { 21847 parseBackboneElementProperties(json, res); 21848 if (json.has("modifier")) 21849 res.setModifier(parseCodeableConcept(getJObject(json, "modifier"))); 21850 if (json.has("foodType")) 21851 res.setFoodType(parseCodeableConcept(getJObject(json, "foodType"))); 21852 } 21853 21854 protected NutritionOrder.NutritionOrderSupplementComponent parseNutritionOrderNutritionOrderSupplementComponent( 21855 JsonObject json, NutritionOrder owner) throws IOException, FHIRFormatError { 21856 NutritionOrder.NutritionOrderSupplementComponent res = new NutritionOrder.NutritionOrderSupplementComponent(); 21857 parseNutritionOrderNutritionOrderSupplementComponentProperties(json, owner, res); 21858 return res; 21859 } 21860 21861 protected void parseNutritionOrderNutritionOrderSupplementComponentProperties(JsonObject json, NutritionOrder owner, 21862 NutritionOrder.NutritionOrderSupplementComponent res) throws IOException, FHIRFormatError { 21863 parseBackboneElementProperties(json, res); 21864 if (json.has("type")) 21865 res.setType(parseCodeableConcept(getJObject(json, "type"))); 21866 if (json.has("productName")) 21867 res.setProductNameElement(parseString(json.get("productName").getAsString())); 21868 if (json.has("_productName")) 21869 parseElementProperties(getJObject(json, "_productName"), res.getProductNameElement()); 21870 if (json.has("schedule")) { 21871 JsonArray array = json.getAsJsonArray("schedule"); 21872 for (int i = 0; i < array.size(); i++) { 21873 res.getSchedule().add(parseTiming(array.get(i).getAsJsonObject())); 21874 } 21875 } 21876 ; 21877 if (json.has("quantity")) 21878 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 21879 if (json.has("instruction")) 21880 res.setInstructionElement(parseString(json.get("instruction").getAsString())); 21881 if (json.has("_instruction")) 21882 parseElementProperties(getJObject(json, "_instruction"), res.getInstructionElement()); 21883 } 21884 21885 protected NutritionOrder.NutritionOrderEnteralFormulaComponent parseNutritionOrderNutritionOrderEnteralFormulaComponent( 21886 JsonObject json, NutritionOrder owner) throws IOException, FHIRFormatError { 21887 NutritionOrder.NutritionOrderEnteralFormulaComponent res = new NutritionOrder.NutritionOrderEnteralFormulaComponent(); 21888 parseNutritionOrderNutritionOrderEnteralFormulaComponentProperties(json, owner, res); 21889 return res; 21890 } 21891 21892 protected void parseNutritionOrderNutritionOrderEnteralFormulaComponentProperties(JsonObject json, 21893 NutritionOrder owner, NutritionOrder.NutritionOrderEnteralFormulaComponent res) 21894 throws IOException, FHIRFormatError { 21895 parseBackboneElementProperties(json, res); 21896 if (json.has("baseFormulaType")) 21897 res.setBaseFormulaType(parseCodeableConcept(getJObject(json, "baseFormulaType"))); 21898 if (json.has("baseFormulaProductName")) 21899 res.setBaseFormulaProductNameElement(parseString(json.get("baseFormulaProductName").getAsString())); 21900 if (json.has("_baseFormulaProductName")) 21901 parseElementProperties(getJObject(json, "_baseFormulaProductName"), res.getBaseFormulaProductNameElement()); 21902 if (json.has("additiveType")) 21903 res.setAdditiveType(parseCodeableConcept(getJObject(json, "additiveType"))); 21904 if (json.has("additiveProductName")) 21905 res.setAdditiveProductNameElement(parseString(json.get("additiveProductName").getAsString())); 21906 if (json.has("_additiveProductName")) 21907 parseElementProperties(getJObject(json, "_additiveProductName"), res.getAdditiveProductNameElement()); 21908 if (json.has("caloricDensity")) 21909 res.setCaloricDensity(parseQuantity(getJObject(json, "caloricDensity"))); 21910 if (json.has("routeofAdministration")) 21911 res.setRouteofAdministration(parseCodeableConcept(getJObject(json, "routeofAdministration"))); 21912 if (json.has("administration")) { 21913 JsonArray array = json.getAsJsonArray("administration"); 21914 for (int i = 0; i < array.size(); i++) { 21915 res.getAdministration().add(parseNutritionOrderNutritionOrderEnteralFormulaAdministrationComponent( 21916 array.get(i).getAsJsonObject(), owner)); 21917 } 21918 } 21919 ; 21920 if (json.has("maxVolumeToDeliver")) 21921 res.setMaxVolumeToDeliver(parseQuantity(getJObject(json, "maxVolumeToDeliver"))); 21922 if (json.has("administrationInstruction")) 21923 res.setAdministrationInstructionElement(parseString(json.get("administrationInstruction").getAsString())); 21924 if (json.has("_administrationInstruction")) 21925 parseElementProperties(getJObject(json, "_administrationInstruction"), res.getAdministrationInstructionElement()); 21926 } 21927 21928 protected NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent parseNutritionOrderNutritionOrderEnteralFormulaAdministrationComponent( 21929 JsonObject json, NutritionOrder owner) throws IOException, FHIRFormatError { 21930 NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent res = new NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent(); 21931 parseNutritionOrderNutritionOrderEnteralFormulaAdministrationComponentProperties(json, owner, res); 21932 return res; 21933 } 21934 21935 protected void parseNutritionOrderNutritionOrderEnteralFormulaAdministrationComponentProperties(JsonObject json, 21936 NutritionOrder owner, NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent res) 21937 throws IOException, FHIRFormatError { 21938 parseBackboneElementProperties(json, res); 21939 if (json.has("schedule")) 21940 res.setSchedule(parseTiming(getJObject(json, "schedule"))); 21941 if (json.has("quantity")) 21942 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 21943 Type rate = parseType("rate", json); 21944 if (rate != null) 21945 res.setRate(rate); 21946 } 21947 21948 protected Observation parseObservation(JsonObject json) throws IOException, FHIRFormatError { 21949 Observation res = new Observation(); 21950 parseObservationProperties(json, res); 21951 return res; 21952 } 21953 21954 protected void parseObservationProperties(JsonObject json, Observation res) throws IOException, FHIRFormatError { 21955 parseDomainResourceProperties(json, res); 21956 if (json.has("identifier")) { 21957 JsonArray array = json.getAsJsonArray("identifier"); 21958 for (int i = 0; i < array.size(); i++) { 21959 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 21960 } 21961 } 21962 ; 21963 if (json.has("basedOn")) { 21964 JsonArray array = json.getAsJsonArray("basedOn"); 21965 for (int i = 0; i < array.size(); i++) { 21966 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 21967 } 21968 } 21969 ; 21970 if (json.has("partOf")) { 21971 JsonArray array = json.getAsJsonArray("partOf"); 21972 for (int i = 0; i < array.size(); i++) { 21973 res.getPartOf().add(parseReference(array.get(i).getAsJsonObject())); 21974 } 21975 } 21976 ; 21977 if (json.has("status")) 21978 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Observation.ObservationStatus.NULL, 21979 new Observation.ObservationStatusEnumFactory())); 21980 if (json.has("_status")) 21981 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 21982 if (json.has("category")) { 21983 JsonArray array = json.getAsJsonArray("category"); 21984 for (int i = 0; i < array.size(); i++) { 21985 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 21986 } 21987 } 21988 ; 21989 if (json.has("code")) 21990 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 21991 if (json.has("subject")) 21992 res.setSubject(parseReference(getJObject(json, "subject"))); 21993 if (json.has("focus")) { 21994 JsonArray array = json.getAsJsonArray("focus"); 21995 for (int i = 0; i < array.size(); i++) { 21996 res.getFocus().add(parseReference(array.get(i).getAsJsonObject())); 21997 } 21998 } 21999 ; 22000 if (json.has("encounter")) 22001 res.setEncounter(parseReference(getJObject(json, "encounter"))); 22002 Type effective = parseType("effective", json); 22003 if (effective != null) 22004 res.setEffective(effective); 22005 if (json.has("issued")) 22006 res.setIssuedElement(parseInstant(json.get("issued").getAsString())); 22007 if (json.has("_issued")) 22008 parseElementProperties(getJObject(json, "_issued"), res.getIssuedElement()); 22009 if (json.has("performer")) { 22010 JsonArray array = json.getAsJsonArray("performer"); 22011 for (int i = 0; i < array.size(); i++) { 22012 res.getPerformer().add(parseReference(array.get(i).getAsJsonObject())); 22013 } 22014 } 22015 ; 22016 Type value = parseType("value", json); 22017 if (value != null) 22018 res.setValue(value); 22019 if (json.has("dataAbsentReason")) 22020 res.setDataAbsentReason(parseCodeableConcept(getJObject(json, "dataAbsentReason"))); 22021 if (json.has("interpretation")) { 22022 JsonArray array = json.getAsJsonArray("interpretation"); 22023 for (int i = 0; i < array.size(); i++) { 22024 res.getInterpretation().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 22025 } 22026 } 22027 ; 22028 if (json.has("note")) { 22029 JsonArray array = json.getAsJsonArray("note"); 22030 for (int i = 0; i < array.size(); i++) { 22031 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 22032 } 22033 } 22034 ; 22035 if (json.has("bodySite")) 22036 res.setBodySite(parseCodeableConcept(getJObject(json, "bodySite"))); 22037 if (json.has("method")) 22038 res.setMethod(parseCodeableConcept(getJObject(json, "method"))); 22039 if (json.has("specimen")) 22040 res.setSpecimen(parseReference(getJObject(json, "specimen"))); 22041 if (json.has("device")) 22042 res.setDevice(parseReference(getJObject(json, "device"))); 22043 if (json.has("referenceRange")) { 22044 JsonArray array = json.getAsJsonArray("referenceRange"); 22045 for (int i = 0; i < array.size(); i++) { 22046 res.getReferenceRange() 22047 .add(parseObservationObservationReferenceRangeComponent(array.get(i).getAsJsonObject(), res)); 22048 } 22049 } 22050 ; 22051 if (json.has("hasMember")) { 22052 JsonArray array = json.getAsJsonArray("hasMember"); 22053 for (int i = 0; i < array.size(); i++) { 22054 res.getHasMember().add(parseReference(array.get(i).getAsJsonObject())); 22055 } 22056 } 22057 ; 22058 if (json.has("derivedFrom")) { 22059 JsonArray array = json.getAsJsonArray("derivedFrom"); 22060 for (int i = 0; i < array.size(); i++) { 22061 res.getDerivedFrom().add(parseReference(array.get(i).getAsJsonObject())); 22062 } 22063 } 22064 ; 22065 if (json.has("component")) { 22066 JsonArray array = json.getAsJsonArray("component"); 22067 for (int i = 0; i < array.size(); i++) { 22068 res.getComponent().add(parseObservationObservationComponentComponent(array.get(i).getAsJsonObject(), res)); 22069 } 22070 } 22071 ; 22072 } 22073 22074 protected Observation.ObservationReferenceRangeComponent parseObservationObservationReferenceRangeComponent( 22075 JsonObject json, Observation owner) throws IOException, FHIRFormatError { 22076 Observation.ObservationReferenceRangeComponent res = new Observation.ObservationReferenceRangeComponent(); 22077 parseObservationObservationReferenceRangeComponentProperties(json, owner, res); 22078 return res; 22079 } 22080 22081 protected void parseObservationObservationReferenceRangeComponentProperties(JsonObject json, Observation owner, 22082 Observation.ObservationReferenceRangeComponent res) throws IOException, FHIRFormatError { 22083 parseBackboneElementProperties(json, res); 22084 if (json.has("low")) 22085 res.setLow(parseQuantity(getJObject(json, "low"))); 22086 if (json.has("high")) 22087 res.setHigh(parseQuantity(getJObject(json, "high"))); 22088 if (json.has("type")) 22089 res.setType(parseCodeableConcept(getJObject(json, "type"))); 22090 if (json.has("appliesTo")) { 22091 JsonArray array = json.getAsJsonArray("appliesTo"); 22092 for (int i = 0; i < array.size(); i++) { 22093 res.getAppliesTo().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 22094 } 22095 } 22096 ; 22097 if (json.has("age")) 22098 res.setAge(parseRange(getJObject(json, "age"))); 22099 if (json.has("text")) 22100 res.setTextElement(parseString(json.get("text").getAsString())); 22101 if (json.has("_text")) 22102 parseElementProperties(getJObject(json, "_text"), res.getTextElement()); 22103 } 22104 22105 protected Observation.ObservationComponentComponent parseObservationObservationComponentComponent(JsonObject json, 22106 Observation owner) throws IOException, FHIRFormatError { 22107 Observation.ObservationComponentComponent res = new Observation.ObservationComponentComponent(); 22108 parseObservationObservationComponentComponentProperties(json, owner, res); 22109 return res; 22110 } 22111 22112 protected void parseObservationObservationComponentComponentProperties(JsonObject json, Observation owner, 22113 Observation.ObservationComponentComponent res) throws IOException, FHIRFormatError { 22114 parseBackboneElementProperties(json, res); 22115 if (json.has("code")) 22116 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 22117 Type value = parseType("value", json); 22118 if (value != null) 22119 res.setValue(value); 22120 if (json.has("dataAbsentReason")) 22121 res.setDataAbsentReason(parseCodeableConcept(getJObject(json, "dataAbsentReason"))); 22122 if (json.has("interpretation")) { 22123 JsonArray array = json.getAsJsonArray("interpretation"); 22124 for (int i = 0; i < array.size(); i++) { 22125 res.getInterpretation().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 22126 } 22127 } 22128 ; 22129 if (json.has("referenceRange")) { 22130 JsonArray array = json.getAsJsonArray("referenceRange"); 22131 for (int i = 0; i < array.size(); i++) { 22132 res.getReferenceRange() 22133 .add(parseObservationObservationReferenceRangeComponent(array.get(i).getAsJsonObject(), owner)); 22134 } 22135 } 22136 ; 22137 } 22138 22139 protected ObservationDefinition parseObservationDefinition(JsonObject json) throws IOException, FHIRFormatError { 22140 ObservationDefinition res = new ObservationDefinition(); 22141 parseObservationDefinitionProperties(json, res); 22142 return res; 22143 } 22144 22145 protected void parseObservationDefinitionProperties(JsonObject json, ObservationDefinition res) 22146 throws IOException, FHIRFormatError { 22147 parseDomainResourceProperties(json, res); 22148 if (json.has("category")) { 22149 JsonArray array = json.getAsJsonArray("category"); 22150 for (int i = 0; i < array.size(); i++) { 22151 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 22152 } 22153 } 22154 ; 22155 if (json.has("code")) 22156 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 22157 if (json.has("identifier")) { 22158 JsonArray array = json.getAsJsonArray("identifier"); 22159 for (int i = 0; i < array.size(); i++) { 22160 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 22161 } 22162 } 22163 ; 22164 if (json.has("permittedDataType")) { 22165 JsonArray array = json.getAsJsonArray("permittedDataType"); 22166 for (int i = 0; i < array.size(); i++) { 22167 if (array.get(i).isJsonNull()) { 22168 res.getPermittedDataType().add(new Enumeration<ObservationDefinition.ObservationDataType>()); 22169 } else { 22170 res.getPermittedDataType() 22171 .add(parseEnumeration(array.get(i).getAsString(), ObservationDefinition.ObservationDataType.NULL, 22172 new ObservationDefinition.ObservationDataTypeEnumFactory())); 22173 } 22174 } 22175 } 22176 ; 22177 if (json.has("_permittedDataType")) { 22178 JsonArray array = json.getAsJsonArray("_permittedDataType"); 22179 for (int i = 0; i < array.size(); i++) { 22180 if (i == res.getPermittedDataType().size()) 22181 res.getPermittedDataType().add(parseEnumeration(null, ObservationDefinition.ObservationDataType.NULL, 22182 new ObservationDefinition.ObservationDataTypeEnumFactory())); 22183 if (array.get(i) instanceof JsonObject) 22184 parseElementProperties(array.get(i).getAsJsonObject(), res.getPermittedDataType().get(i)); 22185 } 22186 } 22187 ; 22188 if (json.has("multipleResultsAllowed")) 22189 res.setMultipleResultsAllowedElement(parseBoolean(json.get("multipleResultsAllowed").getAsBoolean())); 22190 if (json.has("_multipleResultsAllowed")) 22191 parseElementProperties(getJObject(json, "_multipleResultsAllowed"), res.getMultipleResultsAllowedElement()); 22192 if (json.has("method")) 22193 res.setMethod(parseCodeableConcept(getJObject(json, "method"))); 22194 if (json.has("preferredReportName")) 22195 res.setPreferredReportNameElement(parseString(json.get("preferredReportName").getAsString())); 22196 if (json.has("_preferredReportName")) 22197 parseElementProperties(getJObject(json, "_preferredReportName"), res.getPreferredReportNameElement()); 22198 if (json.has("quantitativeDetails")) 22199 res.setQuantitativeDetails(parseObservationDefinitionObservationDefinitionQuantitativeDetailsComponent( 22200 getJObject(json, "quantitativeDetails"), res)); 22201 if (json.has("qualifiedInterval")) { 22202 JsonArray array = json.getAsJsonArray("qualifiedInterval"); 22203 for (int i = 0; i < array.size(); i++) { 22204 res.getQualifiedInterval().add(parseObservationDefinitionObservationDefinitionQualifiedIntervalComponent( 22205 array.get(i).getAsJsonObject(), res)); 22206 } 22207 } 22208 ; 22209 if (json.has("validCodedValueSet")) 22210 res.setValidCodedValueSet(parseReference(getJObject(json, "validCodedValueSet"))); 22211 if (json.has("normalCodedValueSet")) 22212 res.setNormalCodedValueSet(parseReference(getJObject(json, "normalCodedValueSet"))); 22213 if (json.has("abnormalCodedValueSet")) 22214 res.setAbnormalCodedValueSet(parseReference(getJObject(json, "abnormalCodedValueSet"))); 22215 if (json.has("criticalCodedValueSet")) 22216 res.setCriticalCodedValueSet(parseReference(getJObject(json, "criticalCodedValueSet"))); 22217 } 22218 22219 protected ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent parseObservationDefinitionObservationDefinitionQuantitativeDetailsComponent( 22220 JsonObject json, ObservationDefinition owner) throws IOException, FHIRFormatError { 22221 ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent res = new ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent(); 22222 parseObservationDefinitionObservationDefinitionQuantitativeDetailsComponentProperties(json, owner, res); 22223 return res; 22224 } 22225 22226 protected void parseObservationDefinitionObservationDefinitionQuantitativeDetailsComponentProperties(JsonObject json, 22227 ObservationDefinition owner, ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent res) 22228 throws IOException, FHIRFormatError { 22229 parseBackboneElementProperties(json, res); 22230 if (json.has("customaryUnit")) 22231 res.setCustomaryUnit(parseCodeableConcept(getJObject(json, "customaryUnit"))); 22232 if (json.has("unit")) 22233 res.setUnit(parseCodeableConcept(getJObject(json, "unit"))); 22234 if (json.has("conversionFactor")) 22235 res.setConversionFactorElement(parseDecimal(json.get("conversionFactor").getAsBigDecimal())); 22236 if (json.has("_conversionFactor")) 22237 parseElementProperties(getJObject(json, "_conversionFactor"), res.getConversionFactorElement()); 22238 if (json.has("decimalPrecision")) 22239 res.setDecimalPrecisionElement(parseInteger(json.get("decimalPrecision").getAsLong())); 22240 if (json.has("_decimalPrecision")) 22241 parseElementProperties(getJObject(json, "_decimalPrecision"), res.getDecimalPrecisionElement()); 22242 } 22243 22244 protected ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent parseObservationDefinitionObservationDefinitionQualifiedIntervalComponent( 22245 JsonObject json, ObservationDefinition owner) throws IOException, FHIRFormatError { 22246 ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent res = new ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent(); 22247 parseObservationDefinitionObservationDefinitionQualifiedIntervalComponentProperties(json, owner, res); 22248 return res; 22249 } 22250 22251 protected void parseObservationDefinitionObservationDefinitionQualifiedIntervalComponentProperties(JsonObject json, 22252 ObservationDefinition owner, ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent res) 22253 throws IOException, FHIRFormatError { 22254 parseBackboneElementProperties(json, res); 22255 if (json.has("category")) 22256 res.setCategoryElement( 22257 parseEnumeration(json.get("category").getAsString(), ObservationDefinition.ObservationRangeCategory.NULL, 22258 new ObservationDefinition.ObservationRangeCategoryEnumFactory())); 22259 if (json.has("_category")) 22260 parseElementProperties(getJObject(json, "_category"), res.getCategoryElement()); 22261 if (json.has("range")) 22262 res.setRange(parseRange(getJObject(json, "range"))); 22263 if (json.has("context")) 22264 res.setContext(parseCodeableConcept(getJObject(json, "context"))); 22265 if (json.has("appliesTo")) { 22266 JsonArray array = json.getAsJsonArray("appliesTo"); 22267 for (int i = 0; i < array.size(); i++) { 22268 res.getAppliesTo().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 22269 } 22270 } 22271 ; 22272 if (json.has("gender")) 22273 res.setGenderElement(parseEnumeration(json.get("gender").getAsString(), Enumerations.AdministrativeGender.NULL, 22274 new Enumerations.AdministrativeGenderEnumFactory())); 22275 if (json.has("_gender")) 22276 parseElementProperties(getJObject(json, "_gender"), res.getGenderElement()); 22277 if (json.has("age")) 22278 res.setAge(parseRange(getJObject(json, "age"))); 22279 if (json.has("gestationalAge")) 22280 res.setGestationalAge(parseRange(getJObject(json, "gestationalAge"))); 22281 if (json.has("condition")) 22282 res.setConditionElement(parseString(json.get("condition").getAsString())); 22283 if (json.has("_condition")) 22284 parseElementProperties(getJObject(json, "_condition"), res.getConditionElement()); 22285 } 22286 22287 protected OperationDefinition parseOperationDefinition(JsonObject json) throws IOException, FHIRFormatError { 22288 OperationDefinition res = new OperationDefinition(); 22289 parseOperationDefinitionProperties(json, res); 22290 return res; 22291 } 22292 22293 protected void parseOperationDefinitionProperties(JsonObject json, OperationDefinition res) 22294 throws IOException, FHIRFormatError { 22295 parseDomainResourceProperties(json, res); 22296 if (json.has("url")) 22297 res.setUrlElement(parseUri(json.get("url").getAsString())); 22298 if (json.has("_url")) 22299 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 22300 if (json.has("version")) 22301 res.setVersionElement(parseString(json.get("version").getAsString())); 22302 if (json.has("_version")) 22303 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 22304 if (json.has("name")) 22305 res.setNameElement(parseString(json.get("name").getAsString())); 22306 if (json.has("_name")) 22307 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 22308 if (json.has("title")) 22309 res.setTitleElement(parseString(json.get("title").getAsString())); 22310 if (json.has("_title")) 22311 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 22312 if (json.has("status")) 22313 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 22314 new Enumerations.PublicationStatusEnumFactory())); 22315 if (json.has("_status")) 22316 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 22317 if (json.has("kind")) 22318 res.setKindElement(parseEnumeration(json.get("kind").getAsString(), OperationDefinition.OperationKind.NULL, 22319 new OperationDefinition.OperationKindEnumFactory())); 22320 if (json.has("_kind")) 22321 parseElementProperties(getJObject(json, "_kind"), res.getKindElement()); 22322 if (json.has("experimental")) 22323 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 22324 if (json.has("_experimental")) 22325 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 22326 if (json.has("date")) 22327 res.setDateElement(parseDateTime(json.get("date").getAsString())); 22328 if (json.has("_date")) 22329 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 22330 if (json.has("publisher")) 22331 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 22332 if (json.has("_publisher")) 22333 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 22334 if (json.has("contact")) { 22335 JsonArray array = json.getAsJsonArray("contact"); 22336 for (int i = 0; i < array.size(); i++) { 22337 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 22338 } 22339 } 22340 ; 22341 if (json.has("description")) 22342 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 22343 if (json.has("_description")) 22344 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 22345 if (json.has("useContext")) { 22346 JsonArray array = json.getAsJsonArray("useContext"); 22347 for (int i = 0; i < array.size(); i++) { 22348 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 22349 } 22350 } 22351 ; 22352 if (json.has("jurisdiction")) { 22353 JsonArray array = json.getAsJsonArray("jurisdiction"); 22354 for (int i = 0; i < array.size(); i++) { 22355 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 22356 } 22357 } 22358 ; 22359 if (json.has("purpose")) 22360 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 22361 if (json.has("_purpose")) 22362 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 22363 if (json.has("affectsState")) 22364 res.setAffectsStateElement(parseBoolean(json.get("affectsState").getAsBoolean())); 22365 if (json.has("_affectsState")) 22366 parseElementProperties(getJObject(json, "_affectsState"), res.getAffectsStateElement()); 22367 if (json.has("code")) 22368 res.setCodeElement(parseCode(json.get("code").getAsString())); 22369 if (json.has("_code")) 22370 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 22371 if (json.has("comment")) 22372 res.setCommentElement(parseMarkdown(json.get("comment").getAsString())); 22373 if (json.has("_comment")) 22374 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 22375 if (json.has("base")) 22376 res.setBaseElement(parseCanonical(json.get("base").getAsString())); 22377 if (json.has("_base")) 22378 parseElementProperties(getJObject(json, "_base"), res.getBaseElement()); 22379 if (json.has("resource")) { 22380 JsonArray array = json.getAsJsonArray("resource"); 22381 for (int i = 0; i < array.size(); i++) { 22382 if (array.get(i).isJsonNull()) { 22383 res.getResource().add(new CodeType()); 22384 } else { 22385 res.getResource().add(parseCode(array.get(i).getAsString())); 22386 } 22387 } 22388 } 22389 ; 22390 if (json.has("_resource")) { 22391 JsonArray array = json.getAsJsonArray("_resource"); 22392 for (int i = 0; i < array.size(); i++) { 22393 if (i == res.getResource().size()) 22394 res.getResource().add(parseCode(null)); 22395 if (array.get(i) instanceof JsonObject) 22396 parseElementProperties(array.get(i).getAsJsonObject(), res.getResource().get(i)); 22397 } 22398 } 22399 ; 22400 if (json.has("system")) 22401 res.setSystemElement(parseBoolean(json.get("system").getAsBoolean())); 22402 if (json.has("_system")) 22403 parseElementProperties(getJObject(json, "_system"), res.getSystemElement()); 22404 if (json.has("type")) 22405 res.setTypeElement(parseBoolean(json.get("type").getAsBoolean())); 22406 if (json.has("_type")) 22407 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 22408 if (json.has("instance")) 22409 res.setInstanceElement(parseBoolean(json.get("instance").getAsBoolean())); 22410 if (json.has("_instance")) 22411 parseElementProperties(getJObject(json, "_instance"), res.getInstanceElement()); 22412 if (json.has("inputProfile")) 22413 res.setInputProfileElement(parseCanonical(json.get("inputProfile").getAsString())); 22414 if (json.has("_inputProfile")) 22415 parseElementProperties(getJObject(json, "_inputProfile"), res.getInputProfileElement()); 22416 if (json.has("outputProfile")) 22417 res.setOutputProfileElement(parseCanonical(json.get("outputProfile").getAsString())); 22418 if (json.has("_outputProfile")) 22419 parseElementProperties(getJObject(json, "_outputProfile"), res.getOutputProfileElement()); 22420 if (json.has("parameter")) { 22421 JsonArray array = json.getAsJsonArray("parameter"); 22422 for (int i = 0; i < array.size(); i++) { 22423 res.getParameter() 22424 .add(parseOperationDefinitionOperationDefinitionParameterComponent(array.get(i).getAsJsonObject(), res)); 22425 } 22426 } 22427 ; 22428 if (json.has("overload")) { 22429 JsonArray array = json.getAsJsonArray("overload"); 22430 for (int i = 0; i < array.size(); i++) { 22431 res.getOverload() 22432 .add(parseOperationDefinitionOperationDefinitionOverloadComponent(array.get(i).getAsJsonObject(), res)); 22433 } 22434 } 22435 ; 22436 } 22437 22438 protected OperationDefinition.OperationDefinitionParameterComponent parseOperationDefinitionOperationDefinitionParameterComponent( 22439 JsonObject json, OperationDefinition owner) throws IOException, FHIRFormatError { 22440 OperationDefinition.OperationDefinitionParameterComponent res = new OperationDefinition.OperationDefinitionParameterComponent(); 22441 parseOperationDefinitionOperationDefinitionParameterComponentProperties(json, owner, res); 22442 return res; 22443 } 22444 22445 protected void parseOperationDefinitionOperationDefinitionParameterComponentProperties(JsonObject json, 22446 OperationDefinition owner, OperationDefinition.OperationDefinitionParameterComponent res) 22447 throws IOException, FHIRFormatError { 22448 parseBackboneElementProperties(json, res); 22449 if (json.has("name")) 22450 res.setNameElement(parseCode(json.get("name").getAsString())); 22451 if (json.has("_name")) 22452 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 22453 if (json.has("use")) 22454 res.setUseElement(parseEnumeration(json.get("use").getAsString(), OperationDefinition.OperationParameterUse.NULL, 22455 new OperationDefinition.OperationParameterUseEnumFactory())); 22456 if (json.has("_use")) 22457 parseElementProperties(getJObject(json, "_use"), res.getUseElement()); 22458 if (json.has("min")) 22459 res.setMinElement(parseInteger(json.get("min").getAsLong())); 22460 if (json.has("_min")) 22461 parseElementProperties(getJObject(json, "_min"), res.getMinElement()); 22462 if (json.has("max")) 22463 res.setMaxElement(parseString(json.get("max").getAsString())); 22464 if (json.has("_max")) 22465 parseElementProperties(getJObject(json, "_max"), res.getMaxElement()); 22466 if (json.has("documentation")) 22467 res.setDocumentationElement(parseString(json.get("documentation").getAsString())); 22468 if (json.has("_documentation")) 22469 parseElementProperties(getJObject(json, "_documentation"), res.getDocumentationElement()); 22470 if (json.has("type")) 22471 res.setTypeElement(parseCode(json.get("type").getAsString())); 22472 if (json.has("_type")) 22473 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 22474 if (json.has("targetProfile")) { 22475 JsonArray array = json.getAsJsonArray("targetProfile"); 22476 for (int i = 0; i < array.size(); i++) { 22477 if (array.get(i).isJsonNull()) { 22478 res.getTargetProfile().add(new CanonicalType()); 22479 } else { 22480 res.getTargetProfile().add(parseCanonical(array.get(i).getAsString())); 22481 } 22482 } 22483 } 22484 ; 22485 if (json.has("_targetProfile")) { 22486 JsonArray array = json.getAsJsonArray("_targetProfile"); 22487 for (int i = 0; i < array.size(); i++) { 22488 if (i == res.getTargetProfile().size()) 22489 res.getTargetProfile().add(parseCanonical(null)); 22490 if (array.get(i) instanceof JsonObject) 22491 parseElementProperties(array.get(i).getAsJsonObject(), res.getTargetProfile().get(i)); 22492 } 22493 } 22494 ; 22495 if (json.has("searchType")) 22496 res.setSearchTypeElement(parseEnumeration(json.get("searchType").getAsString(), Enumerations.SearchParamType.NULL, 22497 new Enumerations.SearchParamTypeEnumFactory())); 22498 if (json.has("_searchType")) 22499 parseElementProperties(getJObject(json, "_searchType"), res.getSearchTypeElement()); 22500 if (json.has("binding")) 22501 res.setBinding( 22502 parseOperationDefinitionOperationDefinitionParameterBindingComponent(getJObject(json, "binding"), owner)); 22503 if (json.has("referencedFrom")) { 22504 JsonArray array = json.getAsJsonArray("referencedFrom"); 22505 for (int i = 0; i < array.size(); i++) { 22506 res.getReferencedFrom().add(parseOperationDefinitionOperationDefinitionParameterReferencedFromComponent( 22507 array.get(i).getAsJsonObject(), owner)); 22508 } 22509 } 22510 ; 22511 if (json.has("part")) { 22512 JsonArray array = json.getAsJsonArray("part"); 22513 for (int i = 0; i < array.size(); i++) { 22514 res.getPart() 22515 .add(parseOperationDefinitionOperationDefinitionParameterComponent(array.get(i).getAsJsonObject(), owner)); 22516 } 22517 } 22518 ; 22519 } 22520 22521 protected OperationDefinition.OperationDefinitionParameterBindingComponent parseOperationDefinitionOperationDefinitionParameterBindingComponent( 22522 JsonObject json, OperationDefinition owner) throws IOException, FHIRFormatError { 22523 OperationDefinition.OperationDefinitionParameterBindingComponent res = new OperationDefinition.OperationDefinitionParameterBindingComponent(); 22524 parseOperationDefinitionOperationDefinitionParameterBindingComponentProperties(json, owner, res); 22525 return res; 22526 } 22527 22528 protected void parseOperationDefinitionOperationDefinitionParameterBindingComponentProperties(JsonObject json, 22529 OperationDefinition owner, OperationDefinition.OperationDefinitionParameterBindingComponent res) 22530 throws IOException, FHIRFormatError { 22531 parseBackboneElementProperties(json, res); 22532 if (json.has("strength")) 22533 res.setStrengthElement(parseEnumeration(json.get("strength").getAsString(), Enumerations.BindingStrength.NULL, 22534 new Enumerations.BindingStrengthEnumFactory())); 22535 if (json.has("_strength")) 22536 parseElementProperties(getJObject(json, "_strength"), res.getStrengthElement()); 22537 if (json.has("valueSet")) 22538 res.setValueSetElement(parseCanonical(json.get("valueSet").getAsString())); 22539 if (json.has("_valueSet")) 22540 parseElementProperties(getJObject(json, "_valueSet"), res.getValueSetElement()); 22541 } 22542 22543 protected OperationDefinition.OperationDefinitionParameterReferencedFromComponent parseOperationDefinitionOperationDefinitionParameterReferencedFromComponent( 22544 JsonObject json, OperationDefinition owner) throws IOException, FHIRFormatError { 22545 OperationDefinition.OperationDefinitionParameterReferencedFromComponent res = new OperationDefinition.OperationDefinitionParameterReferencedFromComponent(); 22546 parseOperationDefinitionOperationDefinitionParameterReferencedFromComponentProperties(json, owner, res); 22547 return res; 22548 } 22549 22550 protected void parseOperationDefinitionOperationDefinitionParameterReferencedFromComponentProperties(JsonObject json, 22551 OperationDefinition owner, OperationDefinition.OperationDefinitionParameterReferencedFromComponent res) 22552 throws IOException, FHIRFormatError { 22553 parseBackboneElementProperties(json, res); 22554 if (json.has("source")) 22555 res.setSourceElement(parseString(json.get("source").getAsString())); 22556 if (json.has("_source")) 22557 parseElementProperties(getJObject(json, "_source"), res.getSourceElement()); 22558 if (json.has("sourceId")) 22559 res.setSourceIdElement(parseString(json.get("sourceId").getAsString())); 22560 if (json.has("_sourceId")) 22561 parseElementProperties(getJObject(json, "_sourceId"), res.getSourceIdElement()); 22562 } 22563 22564 protected OperationDefinition.OperationDefinitionOverloadComponent parseOperationDefinitionOperationDefinitionOverloadComponent( 22565 JsonObject json, OperationDefinition owner) throws IOException, FHIRFormatError { 22566 OperationDefinition.OperationDefinitionOverloadComponent res = new OperationDefinition.OperationDefinitionOverloadComponent(); 22567 parseOperationDefinitionOperationDefinitionOverloadComponentProperties(json, owner, res); 22568 return res; 22569 } 22570 22571 protected void parseOperationDefinitionOperationDefinitionOverloadComponentProperties(JsonObject json, 22572 OperationDefinition owner, OperationDefinition.OperationDefinitionOverloadComponent res) 22573 throws IOException, FHIRFormatError { 22574 parseBackboneElementProperties(json, res); 22575 if (json.has("parameterName")) { 22576 JsonArray array = json.getAsJsonArray("parameterName"); 22577 for (int i = 0; i < array.size(); i++) { 22578 if (array.get(i).isJsonNull()) { 22579 res.getParameterName().add(new StringType()); 22580 } else { 22581 res.getParameterName().add(parseString(array.get(i).getAsString())); 22582 } 22583 } 22584 } 22585 ; 22586 if (json.has("_parameterName")) { 22587 JsonArray array = json.getAsJsonArray("_parameterName"); 22588 for (int i = 0; i < array.size(); i++) { 22589 if (i == res.getParameterName().size()) 22590 res.getParameterName().add(parseString(null)); 22591 if (array.get(i) instanceof JsonObject) 22592 parseElementProperties(array.get(i).getAsJsonObject(), res.getParameterName().get(i)); 22593 } 22594 } 22595 ; 22596 if (json.has("comment")) 22597 res.setCommentElement(parseString(json.get("comment").getAsString())); 22598 if (json.has("_comment")) 22599 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 22600 } 22601 22602 protected OperationOutcome parseOperationOutcome(JsonObject json) throws IOException, FHIRFormatError { 22603 OperationOutcome res = new OperationOutcome(); 22604 parseOperationOutcomeProperties(json, res); 22605 return res; 22606 } 22607 22608 protected void parseOperationOutcomeProperties(JsonObject json, OperationOutcome res) 22609 throws IOException, FHIRFormatError { 22610 parseDomainResourceProperties(json, res); 22611 if (json.has("issue")) { 22612 JsonArray array = json.getAsJsonArray("issue"); 22613 for (int i = 0; i < array.size(); i++) { 22614 res.getIssue().add(parseOperationOutcomeOperationOutcomeIssueComponent(array.get(i).getAsJsonObject(), res)); 22615 } 22616 } 22617 ; 22618 } 22619 22620 protected OperationOutcome.OperationOutcomeIssueComponent parseOperationOutcomeOperationOutcomeIssueComponent( 22621 JsonObject json, OperationOutcome owner) throws IOException, FHIRFormatError { 22622 OperationOutcome.OperationOutcomeIssueComponent res = new OperationOutcome.OperationOutcomeIssueComponent(); 22623 parseOperationOutcomeOperationOutcomeIssueComponentProperties(json, owner, res); 22624 return res; 22625 } 22626 22627 protected void parseOperationOutcomeOperationOutcomeIssueComponentProperties(JsonObject json, OperationOutcome owner, 22628 OperationOutcome.OperationOutcomeIssueComponent res) throws IOException, FHIRFormatError { 22629 parseBackboneElementProperties(json, res); 22630 if (json.has("severity")) 22631 res.setSeverityElement(parseEnumeration(json.get("severity").getAsString(), OperationOutcome.IssueSeverity.NULL, 22632 new OperationOutcome.IssueSeverityEnumFactory())); 22633 if (json.has("_severity")) 22634 parseElementProperties(getJObject(json, "_severity"), res.getSeverityElement()); 22635 if (json.has("code")) 22636 res.setCodeElement(parseEnumeration(json.get("code").getAsString(), OperationOutcome.IssueType.NULL, 22637 new OperationOutcome.IssueTypeEnumFactory())); 22638 if (json.has("_code")) 22639 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 22640 if (json.has("details")) 22641 res.setDetails(parseCodeableConcept(getJObject(json, "details"))); 22642 if (json.has("diagnostics")) 22643 res.setDiagnosticsElement(parseString(json.get("diagnostics").getAsString())); 22644 if (json.has("_diagnostics")) 22645 parseElementProperties(getJObject(json, "_diagnostics"), res.getDiagnosticsElement()); 22646 if (json.has("location")) { 22647 JsonArray array = json.getAsJsonArray("location"); 22648 for (int i = 0; i < array.size(); i++) { 22649 if (array.get(i).isJsonNull()) { 22650 res.getLocation().add(new StringType()); 22651 } else { 22652 res.getLocation().add(parseString(array.get(i).getAsString())); 22653 } 22654 } 22655 } 22656 ; 22657 if (json.has("_location")) { 22658 JsonArray array = json.getAsJsonArray("_location"); 22659 for (int i = 0; i < array.size(); i++) { 22660 if (i == res.getLocation().size()) 22661 res.getLocation().add(parseString(null)); 22662 if (array.get(i) instanceof JsonObject) 22663 parseElementProperties(array.get(i).getAsJsonObject(), res.getLocation().get(i)); 22664 } 22665 } 22666 ; 22667 if (json.has("expression")) { 22668 JsonArray array = json.getAsJsonArray("expression"); 22669 for (int i = 0; i < array.size(); i++) { 22670 if (array.get(i).isJsonNull()) { 22671 res.getExpression().add(new StringType()); 22672 } else { 22673 res.getExpression().add(parseString(array.get(i).getAsString())); 22674 } 22675 } 22676 } 22677 ; 22678 if (json.has("_expression")) { 22679 JsonArray array = json.getAsJsonArray("_expression"); 22680 for (int i = 0; i < array.size(); i++) { 22681 if (i == res.getExpression().size()) 22682 res.getExpression().add(parseString(null)); 22683 if (array.get(i) instanceof JsonObject) 22684 parseElementProperties(array.get(i).getAsJsonObject(), res.getExpression().get(i)); 22685 } 22686 } 22687 ; 22688 } 22689 22690 protected Organization parseOrganization(JsonObject json) throws IOException, FHIRFormatError { 22691 Organization res = new Organization(); 22692 parseOrganizationProperties(json, res); 22693 return res; 22694 } 22695 22696 protected void parseOrganizationProperties(JsonObject json, Organization res) throws IOException, FHIRFormatError { 22697 parseDomainResourceProperties(json, res); 22698 if (json.has("identifier")) { 22699 JsonArray array = json.getAsJsonArray("identifier"); 22700 for (int i = 0; i < array.size(); i++) { 22701 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 22702 } 22703 } 22704 ; 22705 if (json.has("active")) 22706 res.setActiveElement(parseBoolean(json.get("active").getAsBoolean())); 22707 if (json.has("_active")) 22708 parseElementProperties(getJObject(json, "_active"), res.getActiveElement()); 22709 if (json.has("type")) { 22710 JsonArray array = json.getAsJsonArray("type"); 22711 for (int i = 0; i < array.size(); i++) { 22712 res.getType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 22713 } 22714 } 22715 ; 22716 if (json.has("name")) 22717 res.setNameElement(parseString(json.get("name").getAsString())); 22718 if (json.has("_name")) 22719 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 22720 if (json.has("alias")) { 22721 JsonArray array = json.getAsJsonArray("alias"); 22722 for (int i = 0; i < array.size(); i++) { 22723 if (array.get(i).isJsonNull()) { 22724 res.getAlias().add(new StringType()); 22725 } else { 22726 res.getAlias().add(parseString(array.get(i).getAsString())); 22727 } 22728 } 22729 } 22730 ; 22731 if (json.has("_alias")) { 22732 JsonArray array = json.getAsJsonArray("_alias"); 22733 for (int i = 0; i < array.size(); i++) { 22734 if (i == res.getAlias().size()) 22735 res.getAlias().add(parseString(null)); 22736 if (array.get(i) instanceof JsonObject) 22737 parseElementProperties(array.get(i).getAsJsonObject(), res.getAlias().get(i)); 22738 } 22739 } 22740 ; 22741 if (json.has("telecom")) { 22742 JsonArray array = json.getAsJsonArray("telecom"); 22743 for (int i = 0; i < array.size(); i++) { 22744 res.getTelecom().add(parseContactPoint(array.get(i).getAsJsonObject())); 22745 } 22746 } 22747 ; 22748 if (json.has("address")) { 22749 JsonArray array = json.getAsJsonArray("address"); 22750 for (int i = 0; i < array.size(); i++) { 22751 res.getAddress().add(parseAddress(array.get(i).getAsJsonObject())); 22752 } 22753 } 22754 ; 22755 if (json.has("partOf")) 22756 res.setPartOf(parseReference(getJObject(json, "partOf"))); 22757 if (json.has("contact")) { 22758 JsonArray array = json.getAsJsonArray("contact"); 22759 for (int i = 0; i < array.size(); i++) { 22760 res.getContact().add(parseOrganizationOrganizationContactComponent(array.get(i).getAsJsonObject(), res)); 22761 } 22762 } 22763 ; 22764 if (json.has("endpoint")) { 22765 JsonArray array = json.getAsJsonArray("endpoint"); 22766 for (int i = 0; i < array.size(); i++) { 22767 res.getEndpoint().add(parseReference(array.get(i).getAsJsonObject())); 22768 } 22769 } 22770 ; 22771 } 22772 22773 protected Organization.OrganizationContactComponent parseOrganizationOrganizationContactComponent(JsonObject json, 22774 Organization owner) throws IOException, FHIRFormatError { 22775 Organization.OrganizationContactComponent res = new Organization.OrganizationContactComponent(); 22776 parseOrganizationOrganizationContactComponentProperties(json, owner, res); 22777 return res; 22778 } 22779 22780 protected void parseOrganizationOrganizationContactComponentProperties(JsonObject json, Organization owner, 22781 Organization.OrganizationContactComponent res) throws IOException, FHIRFormatError { 22782 parseBackboneElementProperties(json, res); 22783 if (json.has("purpose")) 22784 res.setPurpose(parseCodeableConcept(getJObject(json, "purpose"))); 22785 if (json.has("name")) 22786 res.setName(parseHumanName(getJObject(json, "name"))); 22787 if (json.has("telecom")) { 22788 JsonArray array = json.getAsJsonArray("telecom"); 22789 for (int i = 0; i < array.size(); i++) { 22790 res.getTelecom().add(parseContactPoint(array.get(i).getAsJsonObject())); 22791 } 22792 } 22793 ; 22794 if (json.has("address")) 22795 res.setAddress(parseAddress(getJObject(json, "address"))); 22796 } 22797 22798 protected OrganizationAffiliation parseOrganizationAffiliation(JsonObject json) throws IOException, FHIRFormatError { 22799 OrganizationAffiliation res = new OrganizationAffiliation(); 22800 parseOrganizationAffiliationProperties(json, res); 22801 return res; 22802 } 22803 22804 protected void parseOrganizationAffiliationProperties(JsonObject json, OrganizationAffiliation res) 22805 throws IOException, FHIRFormatError { 22806 parseDomainResourceProperties(json, res); 22807 if (json.has("identifier")) { 22808 JsonArray array = json.getAsJsonArray("identifier"); 22809 for (int i = 0; i < array.size(); i++) { 22810 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 22811 } 22812 } 22813 ; 22814 if (json.has("active")) 22815 res.setActiveElement(parseBoolean(json.get("active").getAsBoolean())); 22816 if (json.has("_active")) 22817 parseElementProperties(getJObject(json, "_active"), res.getActiveElement()); 22818 if (json.has("period")) 22819 res.setPeriod(parsePeriod(getJObject(json, "period"))); 22820 if (json.has("organization")) 22821 res.setOrganization(parseReference(getJObject(json, "organization"))); 22822 if (json.has("participatingOrganization")) 22823 res.setParticipatingOrganization(parseReference(getJObject(json, "participatingOrganization"))); 22824 if (json.has("network")) { 22825 JsonArray array = json.getAsJsonArray("network"); 22826 for (int i = 0; i < array.size(); i++) { 22827 res.getNetwork().add(parseReference(array.get(i).getAsJsonObject())); 22828 } 22829 } 22830 ; 22831 if (json.has("code")) { 22832 JsonArray array = json.getAsJsonArray("code"); 22833 for (int i = 0; i < array.size(); i++) { 22834 res.getCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 22835 } 22836 } 22837 ; 22838 if (json.has("specialty")) { 22839 JsonArray array = json.getAsJsonArray("specialty"); 22840 for (int i = 0; i < array.size(); i++) { 22841 res.getSpecialty().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 22842 } 22843 } 22844 ; 22845 if (json.has("location")) { 22846 JsonArray array = json.getAsJsonArray("location"); 22847 for (int i = 0; i < array.size(); i++) { 22848 res.getLocation().add(parseReference(array.get(i).getAsJsonObject())); 22849 } 22850 } 22851 ; 22852 if (json.has("healthcareService")) { 22853 JsonArray array = json.getAsJsonArray("healthcareService"); 22854 for (int i = 0; i < array.size(); i++) { 22855 res.getHealthcareService().add(parseReference(array.get(i).getAsJsonObject())); 22856 } 22857 } 22858 ; 22859 if (json.has("telecom")) { 22860 JsonArray array = json.getAsJsonArray("telecom"); 22861 for (int i = 0; i < array.size(); i++) { 22862 res.getTelecom().add(parseContactPoint(array.get(i).getAsJsonObject())); 22863 } 22864 } 22865 ; 22866 if (json.has("endpoint")) { 22867 JsonArray array = json.getAsJsonArray("endpoint"); 22868 for (int i = 0; i < array.size(); i++) { 22869 res.getEndpoint().add(parseReference(array.get(i).getAsJsonObject())); 22870 } 22871 } 22872 ; 22873 } 22874 22875 protected Patient parsePatient(JsonObject json) throws IOException, FHIRFormatError { 22876 Patient res = new Patient(); 22877 parsePatientProperties(json, res); 22878 return res; 22879 } 22880 22881 protected void parsePatientProperties(JsonObject json, Patient res) throws IOException, FHIRFormatError { 22882 parseDomainResourceProperties(json, res); 22883 if (json.has("identifier")) { 22884 JsonArray array = json.getAsJsonArray("identifier"); 22885 for (int i = 0; i < array.size(); i++) { 22886 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 22887 } 22888 } 22889 ; 22890 if (json.has("active")) 22891 res.setActiveElement(parseBoolean(json.get("active").getAsBoolean())); 22892 if (json.has("_active")) 22893 parseElementProperties(getJObject(json, "_active"), res.getActiveElement()); 22894 if (json.has("name")) { 22895 JsonArray array = json.getAsJsonArray("name"); 22896 for (int i = 0; i < array.size(); i++) { 22897 res.getName().add(parseHumanName(array.get(i).getAsJsonObject())); 22898 } 22899 } 22900 ; 22901 if (json.has("telecom")) { 22902 JsonArray array = json.getAsJsonArray("telecom"); 22903 for (int i = 0; i < array.size(); i++) { 22904 res.getTelecom().add(parseContactPoint(array.get(i).getAsJsonObject())); 22905 } 22906 } 22907 ; 22908 if (json.has("gender")) 22909 res.setGenderElement(parseEnumeration(json.get("gender").getAsString(), Enumerations.AdministrativeGender.NULL, 22910 new Enumerations.AdministrativeGenderEnumFactory())); 22911 if (json.has("_gender")) 22912 parseElementProperties(getJObject(json, "_gender"), res.getGenderElement()); 22913 if (json.has("birthDate")) 22914 res.setBirthDateElement(parseDate(json.get("birthDate").getAsString())); 22915 if (json.has("_birthDate")) 22916 parseElementProperties(getJObject(json, "_birthDate"), res.getBirthDateElement()); 22917 Type deceased = parseType("deceased", json); 22918 if (deceased != null) 22919 res.setDeceased(deceased); 22920 if (json.has("address")) { 22921 JsonArray array = json.getAsJsonArray("address"); 22922 for (int i = 0; i < array.size(); i++) { 22923 res.getAddress().add(parseAddress(array.get(i).getAsJsonObject())); 22924 } 22925 } 22926 ; 22927 if (json.has("maritalStatus")) 22928 res.setMaritalStatus(parseCodeableConcept(getJObject(json, "maritalStatus"))); 22929 Type multipleBirth = parseType("multipleBirth", json); 22930 if (multipleBirth != null) 22931 res.setMultipleBirth(multipleBirth); 22932 if (json.has("photo")) { 22933 JsonArray array = json.getAsJsonArray("photo"); 22934 for (int i = 0; i < array.size(); i++) { 22935 res.getPhoto().add(parseAttachment(array.get(i).getAsJsonObject())); 22936 } 22937 } 22938 ; 22939 if (json.has("contact")) { 22940 JsonArray array = json.getAsJsonArray("contact"); 22941 for (int i = 0; i < array.size(); i++) { 22942 res.getContact().add(parsePatientContactComponent(array.get(i).getAsJsonObject(), res)); 22943 } 22944 } 22945 ; 22946 if (json.has("communication")) { 22947 JsonArray array = json.getAsJsonArray("communication"); 22948 for (int i = 0; i < array.size(); i++) { 22949 res.getCommunication().add(parsePatientPatientCommunicationComponent(array.get(i).getAsJsonObject(), res)); 22950 } 22951 } 22952 ; 22953 if (json.has("generalPractitioner")) { 22954 JsonArray array = json.getAsJsonArray("generalPractitioner"); 22955 for (int i = 0; i < array.size(); i++) { 22956 res.getGeneralPractitioner().add(parseReference(array.get(i).getAsJsonObject())); 22957 } 22958 } 22959 ; 22960 if (json.has("managingOrganization")) 22961 res.setManagingOrganization(parseReference(getJObject(json, "managingOrganization"))); 22962 if (json.has("link")) { 22963 JsonArray array = json.getAsJsonArray("link"); 22964 for (int i = 0; i < array.size(); i++) { 22965 res.getLink().add(parsePatientPatientLinkComponent(array.get(i).getAsJsonObject(), res)); 22966 } 22967 } 22968 ; 22969 } 22970 22971 protected Patient.ContactComponent parsePatientContactComponent(JsonObject json, Patient owner) 22972 throws IOException, FHIRFormatError { 22973 Patient.ContactComponent res = new Patient.ContactComponent(); 22974 parsePatientContactComponentProperties(json, owner, res); 22975 return res; 22976 } 22977 22978 protected void parsePatientContactComponentProperties(JsonObject json, Patient owner, Patient.ContactComponent res) 22979 throws IOException, FHIRFormatError { 22980 parseBackboneElementProperties(json, res); 22981 if (json.has("relationship")) { 22982 JsonArray array = json.getAsJsonArray("relationship"); 22983 for (int i = 0; i < array.size(); i++) { 22984 res.getRelationship().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 22985 } 22986 } 22987 ; 22988 if (json.has("name")) 22989 res.setName(parseHumanName(getJObject(json, "name"))); 22990 if (json.has("telecom")) { 22991 JsonArray array = json.getAsJsonArray("telecom"); 22992 for (int i = 0; i < array.size(); i++) { 22993 res.getTelecom().add(parseContactPoint(array.get(i).getAsJsonObject())); 22994 } 22995 } 22996 ; 22997 if (json.has("address")) 22998 res.setAddress(parseAddress(getJObject(json, "address"))); 22999 if (json.has("gender")) 23000 res.setGenderElement(parseEnumeration(json.get("gender").getAsString(), Enumerations.AdministrativeGender.NULL, 23001 new Enumerations.AdministrativeGenderEnumFactory())); 23002 if (json.has("_gender")) 23003 parseElementProperties(getJObject(json, "_gender"), res.getGenderElement()); 23004 if (json.has("organization")) 23005 res.setOrganization(parseReference(getJObject(json, "organization"))); 23006 if (json.has("period")) 23007 res.setPeriod(parsePeriod(getJObject(json, "period"))); 23008 } 23009 23010 protected Patient.PatientCommunicationComponent parsePatientPatientCommunicationComponent(JsonObject json, 23011 Patient owner) throws IOException, FHIRFormatError { 23012 Patient.PatientCommunicationComponent res = new Patient.PatientCommunicationComponent(); 23013 parsePatientPatientCommunicationComponentProperties(json, owner, res); 23014 return res; 23015 } 23016 23017 protected void parsePatientPatientCommunicationComponentProperties(JsonObject json, Patient owner, 23018 Patient.PatientCommunicationComponent res) throws IOException, FHIRFormatError { 23019 parseBackboneElementProperties(json, res); 23020 if (json.has("language")) 23021 res.setLanguage(parseCodeableConcept(getJObject(json, "language"))); 23022 if (json.has("preferred")) 23023 res.setPreferredElement(parseBoolean(json.get("preferred").getAsBoolean())); 23024 if (json.has("_preferred")) 23025 parseElementProperties(getJObject(json, "_preferred"), res.getPreferredElement()); 23026 } 23027 23028 protected Patient.PatientLinkComponent parsePatientPatientLinkComponent(JsonObject json, Patient owner) 23029 throws IOException, FHIRFormatError { 23030 Patient.PatientLinkComponent res = new Patient.PatientLinkComponent(); 23031 parsePatientPatientLinkComponentProperties(json, owner, res); 23032 return res; 23033 } 23034 23035 protected void parsePatientPatientLinkComponentProperties(JsonObject json, Patient owner, 23036 Patient.PatientLinkComponent res) throws IOException, FHIRFormatError { 23037 parseBackboneElementProperties(json, res); 23038 if (json.has("other")) 23039 res.setOther(parseReference(getJObject(json, "other"))); 23040 if (json.has("type")) 23041 res.setTypeElement( 23042 parseEnumeration(json.get("type").getAsString(), Patient.LinkType.NULL, new Patient.LinkTypeEnumFactory())); 23043 if (json.has("_type")) 23044 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 23045 } 23046 23047 protected PaymentNotice parsePaymentNotice(JsonObject json) throws IOException, FHIRFormatError { 23048 PaymentNotice res = new PaymentNotice(); 23049 parsePaymentNoticeProperties(json, res); 23050 return res; 23051 } 23052 23053 protected void parsePaymentNoticeProperties(JsonObject json, PaymentNotice res) throws IOException, FHIRFormatError { 23054 parseDomainResourceProperties(json, res); 23055 if (json.has("identifier")) { 23056 JsonArray array = json.getAsJsonArray("identifier"); 23057 for (int i = 0; i < array.size(); i++) { 23058 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 23059 } 23060 } 23061 ; 23062 if (json.has("status")) 23063 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), PaymentNotice.PaymentNoticeStatus.NULL, 23064 new PaymentNotice.PaymentNoticeStatusEnumFactory())); 23065 if (json.has("_status")) 23066 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 23067 if (json.has("request")) 23068 res.setRequest(parseReference(getJObject(json, "request"))); 23069 if (json.has("response")) 23070 res.setResponse(parseReference(getJObject(json, "response"))); 23071 if (json.has("created")) 23072 res.setCreatedElement(parseDateTime(json.get("created").getAsString())); 23073 if (json.has("_created")) 23074 parseElementProperties(getJObject(json, "_created"), res.getCreatedElement()); 23075 if (json.has("provider")) 23076 res.setProvider(parseReference(getJObject(json, "provider"))); 23077 if (json.has("payment")) 23078 res.setPayment(parseReference(getJObject(json, "payment"))); 23079 if (json.has("paymentDate")) 23080 res.setPaymentDateElement(parseDate(json.get("paymentDate").getAsString())); 23081 if (json.has("_paymentDate")) 23082 parseElementProperties(getJObject(json, "_paymentDate"), res.getPaymentDateElement()); 23083 if (json.has("payee")) 23084 res.setPayee(parseReference(getJObject(json, "payee"))); 23085 if (json.has("recipient")) 23086 res.setRecipient(parseReference(getJObject(json, "recipient"))); 23087 if (json.has("amount")) 23088 res.setAmount(parseMoney(getJObject(json, "amount"))); 23089 if (json.has("paymentStatus")) 23090 res.setPaymentStatus(parseCodeableConcept(getJObject(json, "paymentStatus"))); 23091 } 23092 23093 protected PaymentReconciliation parsePaymentReconciliation(JsonObject json) throws IOException, FHIRFormatError { 23094 PaymentReconciliation res = new PaymentReconciliation(); 23095 parsePaymentReconciliationProperties(json, res); 23096 return res; 23097 } 23098 23099 protected void parsePaymentReconciliationProperties(JsonObject json, PaymentReconciliation res) 23100 throws IOException, FHIRFormatError { 23101 parseDomainResourceProperties(json, res); 23102 if (json.has("identifier")) { 23103 JsonArray array = json.getAsJsonArray("identifier"); 23104 for (int i = 0; i < array.size(); i++) { 23105 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 23106 } 23107 } 23108 ; 23109 if (json.has("status")) 23110 res.setStatusElement( 23111 parseEnumeration(json.get("status").getAsString(), PaymentReconciliation.PaymentReconciliationStatus.NULL, 23112 new PaymentReconciliation.PaymentReconciliationStatusEnumFactory())); 23113 if (json.has("_status")) 23114 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 23115 if (json.has("period")) 23116 res.setPeriod(parsePeriod(getJObject(json, "period"))); 23117 if (json.has("created")) 23118 res.setCreatedElement(parseDateTime(json.get("created").getAsString())); 23119 if (json.has("_created")) 23120 parseElementProperties(getJObject(json, "_created"), res.getCreatedElement()); 23121 if (json.has("paymentIssuer")) 23122 res.setPaymentIssuer(parseReference(getJObject(json, "paymentIssuer"))); 23123 if (json.has("request")) 23124 res.setRequest(parseReference(getJObject(json, "request"))); 23125 if (json.has("requestor")) 23126 res.setRequestor(parseReference(getJObject(json, "requestor"))); 23127 if (json.has("outcome")) 23128 res.setOutcomeElement(parseEnumeration(json.get("outcome").getAsString(), Enumerations.RemittanceOutcome.NULL, 23129 new Enumerations.RemittanceOutcomeEnumFactory())); 23130 if (json.has("_outcome")) 23131 parseElementProperties(getJObject(json, "_outcome"), res.getOutcomeElement()); 23132 if (json.has("disposition")) 23133 res.setDispositionElement(parseString(json.get("disposition").getAsString())); 23134 if (json.has("_disposition")) 23135 parseElementProperties(getJObject(json, "_disposition"), res.getDispositionElement()); 23136 if (json.has("paymentDate")) 23137 res.setPaymentDateElement(parseDate(json.get("paymentDate").getAsString())); 23138 if (json.has("_paymentDate")) 23139 parseElementProperties(getJObject(json, "_paymentDate"), res.getPaymentDateElement()); 23140 if (json.has("paymentAmount")) 23141 res.setPaymentAmount(parseMoney(getJObject(json, "paymentAmount"))); 23142 if (json.has("paymentIdentifier")) 23143 res.setPaymentIdentifier(parseIdentifier(getJObject(json, "paymentIdentifier"))); 23144 if (json.has("detail")) { 23145 JsonArray array = json.getAsJsonArray("detail"); 23146 for (int i = 0; i < array.size(); i++) { 23147 res.getDetail().add(parsePaymentReconciliationDetailsComponent(array.get(i).getAsJsonObject(), res)); 23148 } 23149 } 23150 ; 23151 if (json.has("formCode")) 23152 res.setFormCode(parseCodeableConcept(getJObject(json, "formCode"))); 23153 if (json.has("processNote")) { 23154 JsonArray array = json.getAsJsonArray("processNote"); 23155 for (int i = 0; i < array.size(); i++) { 23156 res.getProcessNote().add(parsePaymentReconciliationNotesComponent(array.get(i).getAsJsonObject(), res)); 23157 } 23158 } 23159 ; 23160 } 23161 23162 protected PaymentReconciliation.DetailsComponent parsePaymentReconciliationDetailsComponent(JsonObject json, 23163 PaymentReconciliation owner) throws IOException, FHIRFormatError { 23164 PaymentReconciliation.DetailsComponent res = new PaymentReconciliation.DetailsComponent(); 23165 parsePaymentReconciliationDetailsComponentProperties(json, owner, res); 23166 return res; 23167 } 23168 23169 protected void parsePaymentReconciliationDetailsComponentProperties(JsonObject json, PaymentReconciliation owner, 23170 PaymentReconciliation.DetailsComponent res) throws IOException, FHIRFormatError { 23171 parseBackboneElementProperties(json, res); 23172 if (json.has("identifier")) 23173 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 23174 if (json.has("predecessor")) 23175 res.setPredecessor(parseIdentifier(getJObject(json, "predecessor"))); 23176 if (json.has("type")) 23177 res.setType(parseCodeableConcept(getJObject(json, "type"))); 23178 if (json.has("request")) 23179 res.setRequest(parseReference(getJObject(json, "request"))); 23180 if (json.has("submitter")) 23181 res.setSubmitter(parseReference(getJObject(json, "submitter"))); 23182 if (json.has("response")) 23183 res.setResponse(parseReference(getJObject(json, "response"))); 23184 if (json.has("date")) 23185 res.setDateElement(parseDate(json.get("date").getAsString())); 23186 if (json.has("_date")) 23187 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 23188 if (json.has("responsible")) 23189 res.setResponsible(parseReference(getJObject(json, "responsible"))); 23190 if (json.has("payee")) 23191 res.setPayee(parseReference(getJObject(json, "payee"))); 23192 if (json.has("amount")) 23193 res.setAmount(parseMoney(getJObject(json, "amount"))); 23194 } 23195 23196 protected PaymentReconciliation.NotesComponent parsePaymentReconciliationNotesComponent(JsonObject json, 23197 PaymentReconciliation owner) throws IOException, FHIRFormatError { 23198 PaymentReconciliation.NotesComponent res = new PaymentReconciliation.NotesComponent(); 23199 parsePaymentReconciliationNotesComponentProperties(json, owner, res); 23200 return res; 23201 } 23202 23203 protected void parsePaymentReconciliationNotesComponentProperties(JsonObject json, PaymentReconciliation owner, 23204 PaymentReconciliation.NotesComponent res) throws IOException, FHIRFormatError { 23205 parseBackboneElementProperties(json, res); 23206 if (json.has("type")) 23207 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), Enumerations.NoteType.NULL, 23208 new Enumerations.NoteTypeEnumFactory())); 23209 if (json.has("_type")) 23210 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 23211 if (json.has("text")) 23212 res.setTextElement(parseString(json.get("text").getAsString())); 23213 if (json.has("_text")) 23214 parseElementProperties(getJObject(json, "_text"), res.getTextElement()); 23215 } 23216 23217 protected Person parsePerson(JsonObject json) throws IOException, FHIRFormatError { 23218 Person res = new Person(); 23219 parsePersonProperties(json, res); 23220 return res; 23221 } 23222 23223 protected void parsePersonProperties(JsonObject json, Person res) throws IOException, FHIRFormatError { 23224 parseDomainResourceProperties(json, res); 23225 if (json.has("identifier")) { 23226 JsonArray array = json.getAsJsonArray("identifier"); 23227 for (int i = 0; i < array.size(); i++) { 23228 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 23229 } 23230 } 23231 ; 23232 if (json.has("name")) { 23233 JsonArray array = json.getAsJsonArray("name"); 23234 for (int i = 0; i < array.size(); i++) { 23235 res.getName().add(parseHumanName(array.get(i).getAsJsonObject())); 23236 } 23237 } 23238 ; 23239 if (json.has("telecom")) { 23240 JsonArray array = json.getAsJsonArray("telecom"); 23241 for (int i = 0; i < array.size(); i++) { 23242 res.getTelecom().add(parseContactPoint(array.get(i).getAsJsonObject())); 23243 } 23244 } 23245 ; 23246 if (json.has("gender")) 23247 res.setGenderElement(parseEnumeration(json.get("gender").getAsString(), Enumerations.AdministrativeGender.NULL, 23248 new Enumerations.AdministrativeGenderEnumFactory())); 23249 if (json.has("_gender")) 23250 parseElementProperties(getJObject(json, "_gender"), res.getGenderElement()); 23251 if (json.has("birthDate")) 23252 res.setBirthDateElement(parseDate(json.get("birthDate").getAsString())); 23253 if (json.has("_birthDate")) 23254 parseElementProperties(getJObject(json, "_birthDate"), res.getBirthDateElement()); 23255 if (json.has("address")) { 23256 JsonArray array = json.getAsJsonArray("address"); 23257 for (int i = 0; i < array.size(); i++) { 23258 res.getAddress().add(parseAddress(array.get(i).getAsJsonObject())); 23259 } 23260 } 23261 ; 23262 if (json.has("photo")) 23263 res.setPhoto(parseAttachment(getJObject(json, "photo"))); 23264 if (json.has("managingOrganization")) 23265 res.setManagingOrganization(parseReference(getJObject(json, "managingOrganization"))); 23266 if (json.has("active")) 23267 res.setActiveElement(parseBoolean(json.get("active").getAsBoolean())); 23268 if (json.has("_active")) 23269 parseElementProperties(getJObject(json, "_active"), res.getActiveElement()); 23270 if (json.has("link")) { 23271 JsonArray array = json.getAsJsonArray("link"); 23272 for (int i = 0; i < array.size(); i++) { 23273 res.getLink().add(parsePersonPersonLinkComponent(array.get(i).getAsJsonObject(), res)); 23274 } 23275 } 23276 ; 23277 } 23278 23279 protected Person.PersonLinkComponent parsePersonPersonLinkComponent(JsonObject json, Person owner) 23280 throws IOException, FHIRFormatError { 23281 Person.PersonLinkComponent res = new Person.PersonLinkComponent(); 23282 parsePersonPersonLinkComponentProperties(json, owner, res); 23283 return res; 23284 } 23285 23286 protected void parsePersonPersonLinkComponentProperties(JsonObject json, Person owner, Person.PersonLinkComponent res) 23287 throws IOException, FHIRFormatError { 23288 parseBackboneElementProperties(json, res); 23289 if (json.has("target")) 23290 res.setTarget(parseReference(getJObject(json, "target"))); 23291 if (json.has("assurance")) 23292 res.setAssuranceElement(parseEnumeration(json.get("assurance").getAsString(), Person.IdentityAssuranceLevel.NULL, 23293 new Person.IdentityAssuranceLevelEnumFactory())); 23294 if (json.has("_assurance")) 23295 parseElementProperties(getJObject(json, "_assurance"), res.getAssuranceElement()); 23296 } 23297 23298 protected PlanDefinition parsePlanDefinition(JsonObject json) throws IOException, FHIRFormatError { 23299 PlanDefinition res = new PlanDefinition(); 23300 parsePlanDefinitionProperties(json, res); 23301 return res; 23302 } 23303 23304 protected void parsePlanDefinitionProperties(JsonObject json, PlanDefinition res) 23305 throws IOException, FHIRFormatError { 23306 parseDomainResourceProperties(json, res); 23307 if (json.has("url")) 23308 res.setUrlElement(parseUri(json.get("url").getAsString())); 23309 if (json.has("_url")) 23310 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 23311 if (json.has("identifier")) { 23312 JsonArray array = json.getAsJsonArray("identifier"); 23313 for (int i = 0; i < array.size(); i++) { 23314 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 23315 } 23316 } 23317 ; 23318 if (json.has("version")) 23319 res.setVersionElement(parseString(json.get("version").getAsString())); 23320 if (json.has("_version")) 23321 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 23322 if (json.has("name")) 23323 res.setNameElement(parseString(json.get("name").getAsString())); 23324 if (json.has("_name")) 23325 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 23326 if (json.has("title")) 23327 res.setTitleElement(parseString(json.get("title").getAsString())); 23328 if (json.has("_title")) 23329 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 23330 if (json.has("subtitle")) 23331 res.setSubtitleElement(parseString(json.get("subtitle").getAsString())); 23332 if (json.has("_subtitle")) 23333 parseElementProperties(getJObject(json, "_subtitle"), res.getSubtitleElement()); 23334 if (json.has("type")) 23335 res.setType(parseCodeableConcept(getJObject(json, "type"))); 23336 if (json.has("status")) 23337 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 23338 new Enumerations.PublicationStatusEnumFactory())); 23339 if (json.has("_status")) 23340 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 23341 if (json.has("experimental")) 23342 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 23343 if (json.has("_experimental")) 23344 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 23345 Type subject = parseType("subject", json); 23346 if (subject != null) 23347 res.setSubject(subject); 23348 if (json.has("date")) 23349 res.setDateElement(parseDateTime(json.get("date").getAsString())); 23350 if (json.has("_date")) 23351 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 23352 if (json.has("publisher")) 23353 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 23354 if (json.has("_publisher")) 23355 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 23356 if (json.has("contact")) { 23357 JsonArray array = json.getAsJsonArray("contact"); 23358 for (int i = 0; i < array.size(); i++) { 23359 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 23360 } 23361 } 23362 ; 23363 if (json.has("description")) 23364 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 23365 if (json.has("_description")) 23366 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 23367 if (json.has("useContext")) { 23368 JsonArray array = json.getAsJsonArray("useContext"); 23369 for (int i = 0; i < array.size(); i++) { 23370 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 23371 } 23372 } 23373 ; 23374 if (json.has("jurisdiction")) { 23375 JsonArray array = json.getAsJsonArray("jurisdiction"); 23376 for (int i = 0; i < array.size(); i++) { 23377 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 23378 } 23379 } 23380 ; 23381 if (json.has("purpose")) 23382 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 23383 if (json.has("_purpose")) 23384 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 23385 if (json.has("usage")) 23386 res.setUsageElement(parseString(json.get("usage").getAsString())); 23387 if (json.has("_usage")) 23388 parseElementProperties(getJObject(json, "_usage"), res.getUsageElement()); 23389 if (json.has("copyright")) 23390 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 23391 if (json.has("_copyright")) 23392 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 23393 if (json.has("approvalDate")) 23394 res.setApprovalDateElement(parseDate(json.get("approvalDate").getAsString())); 23395 if (json.has("_approvalDate")) 23396 parseElementProperties(getJObject(json, "_approvalDate"), res.getApprovalDateElement()); 23397 if (json.has("lastReviewDate")) 23398 res.setLastReviewDateElement(parseDate(json.get("lastReviewDate").getAsString())); 23399 if (json.has("_lastReviewDate")) 23400 parseElementProperties(getJObject(json, "_lastReviewDate"), res.getLastReviewDateElement()); 23401 if (json.has("effectivePeriod")) 23402 res.setEffectivePeriod(parsePeriod(getJObject(json, "effectivePeriod"))); 23403 if (json.has("topic")) { 23404 JsonArray array = json.getAsJsonArray("topic"); 23405 for (int i = 0; i < array.size(); i++) { 23406 res.getTopic().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 23407 } 23408 } 23409 ; 23410 if (json.has("author")) { 23411 JsonArray array = json.getAsJsonArray("author"); 23412 for (int i = 0; i < array.size(); i++) { 23413 res.getAuthor().add(parseContactDetail(array.get(i).getAsJsonObject())); 23414 } 23415 } 23416 ; 23417 if (json.has("editor")) { 23418 JsonArray array = json.getAsJsonArray("editor"); 23419 for (int i = 0; i < array.size(); i++) { 23420 res.getEditor().add(parseContactDetail(array.get(i).getAsJsonObject())); 23421 } 23422 } 23423 ; 23424 if (json.has("reviewer")) { 23425 JsonArray array = json.getAsJsonArray("reviewer"); 23426 for (int i = 0; i < array.size(); i++) { 23427 res.getReviewer().add(parseContactDetail(array.get(i).getAsJsonObject())); 23428 } 23429 } 23430 ; 23431 if (json.has("endorser")) { 23432 JsonArray array = json.getAsJsonArray("endorser"); 23433 for (int i = 0; i < array.size(); i++) { 23434 res.getEndorser().add(parseContactDetail(array.get(i).getAsJsonObject())); 23435 } 23436 } 23437 ; 23438 if (json.has("relatedArtifact")) { 23439 JsonArray array = json.getAsJsonArray("relatedArtifact"); 23440 for (int i = 0; i < array.size(); i++) { 23441 res.getRelatedArtifact().add(parseRelatedArtifact(array.get(i).getAsJsonObject())); 23442 } 23443 } 23444 ; 23445 if (json.has("library")) { 23446 JsonArray array = json.getAsJsonArray("library"); 23447 for (int i = 0; i < array.size(); i++) { 23448 if (array.get(i).isJsonNull()) { 23449 res.getLibrary().add(new CanonicalType()); 23450 } else { 23451 res.getLibrary().add(parseCanonical(array.get(i).getAsString())); 23452 } 23453 } 23454 } 23455 ; 23456 if (json.has("_library")) { 23457 JsonArray array = json.getAsJsonArray("_library"); 23458 for (int i = 0; i < array.size(); i++) { 23459 if (i == res.getLibrary().size()) 23460 res.getLibrary().add(parseCanonical(null)); 23461 if (array.get(i) instanceof JsonObject) 23462 parseElementProperties(array.get(i).getAsJsonObject(), res.getLibrary().get(i)); 23463 } 23464 } 23465 ; 23466 if (json.has("goal")) { 23467 JsonArray array = json.getAsJsonArray("goal"); 23468 for (int i = 0; i < array.size(); i++) { 23469 res.getGoal().add(parsePlanDefinitionPlanDefinitionGoalComponent(array.get(i).getAsJsonObject(), res)); 23470 } 23471 } 23472 ; 23473 if (json.has("action")) { 23474 JsonArray array = json.getAsJsonArray("action"); 23475 for (int i = 0; i < array.size(); i++) { 23476 res.getAction().add(parsePlanDefinitionPlanDefinitionActionComponent(array.get(i).getAsJsonObject(), res)); 23477 } 23478 } 23479 ; 23480 } 23481 23482 protected PlanDefinition.PlanDefinitionGoalComponent parsePlanDefinitionPlanDefinitionGoalComponent(JsonObject json, 23483 PlanDefinition owner) throws IOException, FHIRFormatError { 23484 PlanDefinition.PlanDefinitionGoalComponent res = new PlanDefinition.PlanDefinitionGoalComponent(); 23485 parsePlanDefinitionPlanDefinitionGoalComponentProperties(json, owner, res); 23486 return res; 23487 } 23488 23489 protected void parsePlanDefinitionPlanDefinitionGoalComponentProperties(JsonObject json, PlanDefinition owner, 23490 PlanDefinition.PlanDefinitionGoalComponent res) throws IOException, FHIRFormatError { 23491 parseBackboneElementProperties(json, res); 23492 if (json.has("category")) 23493 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 23494 if (json.has("description")) 23495 res.setDescription(parseCodeableConcept(getJObject(json, "description"))); 23496 if (json.has("priority")) 23497 res.setPriority(parseCodeableConcept(getJObject(json, "priority"))); 23498 if (json.has("start")) 23499 res.setStart(parseCodeableConcept(getJObject(json, "start"))); 23500 if (json.has("addresses")) { 23501 JsonArray array = json.getAsJsonArray("addresses"); 23502 for (int i = 0; i < array.size(); i++) { 23503 res.getAddresses().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 23504 } 23505 } 23506 ; 23507 if (json.has("documentation")) { 23508 JsonArray array = json.getAsJsonArray("documentation"); 23509 for (int i = 0; i < array.size(); i++) { 23510 res.getDocumentation().add(parseRelatedArtifact(array.get(i).getAsJsonObject())); 23511 } 23512 } 23513 ; 23514 if (json.has("target")) { 23515 JsonArray array = json.getAsJsonArray("target"); 23516 for (int i = 0; i < array.size(); i++) { 23517 res.getTarget() 23518 .add(parsePlanDefinitionPlanDefinitionGoalTargetComponent(array.get(i).getAsJsonObject(), owner)); 23519 } 23520 } 23521 ; 23522 } 23523 23524 protected PlanDefinition.PlanDefinitionGoalTargetComponent parsePlanDefinitionPlanDefinitionGoalTargetComponent( 23525 JsonObject json, PlanDefinition owner) throws IOException, FHIRFormatError { 23526 PlanDefinition.PlanDefinitionGoalTargetComponent res = new PlanDefinition.PlanDefinitionGoalTargetComponent(); 23527 parsePlanDefinitionPlanDefinitionGoalTargetComponentProperties(json, owner, res); 23528 return res; 23529 } 23530 23531 protected void parsePlanDefinitionPlanDefinitionGoalTargetComponentProperties(JsonObject json, PlanDefinition owner, 23532 PlanDefinition.PlanDefinitionGoalTargetComponent res) throws IOException, FHIRFormatError { 23533 parseBackboneElementProperties(json, res); 23534 if (json.has("measure")) 23535 res.setMeasure(parseCodeableConcept(getJObject(json, "measure"))); 23536 Type detail = parseType("detail", json); 23537 if (detail != null) 23538 res.setDetail(detail); 23539 if (json.has("due")) 23540 res.setDue(parseDuration(getJObject(json, "due"))); 23541 } 23542 23543 protected PlanDefinition.PlanDefinitionActionComponent parsePlanDefinitionPlanDefinitionActionComponent( 23544 JsonObject json, PlanDefinition owner) throws IOException, FHIRFormatError { 23545 PlanDefinition.PlanDefinitionActionComponent res = new PlanDefinition.PlanDefinitionActionComponent(); 23546 parsePlanDefinitionPlanDefinitionActionComponentProperties(json, owner, res); 23547 return res; 23548 } 23549 23550 protected void parsePlanDefinitionPlanDefinitionActionComponentProperties(JsonObject json, PlanDefinition owner, 23551 PlanDefinition.PlanDefinitionActionComponent res) throws IOException, FHIRFormatError { 23552 parseBackboneElementProperties(json, res); 23553 if (json.has("prefix")) 23554 res.setPrefixElement(parseString(json.get("prefix").getAsString())); 23555 if (json.has("_prefix")) 23556 parseElementProperties(getJObject(json, "_prefix"), res.getPrefixElement()); 23557 if (json.has("title")) 23558 res.setTitleElement(parseString(json.get("title").getAsString())); 23559 if (json.has("_title")) 23560 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 23561 if (json.has("description")) 23562 res.setDescriptionElement(parseString(json.get("description").getAsString())); 23563 if (json.has("_description")) 23564 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 23565 if (json.has("textEquivalent")) 23566 res.setTextEquivalentElement(parseString(json.get("textEquivalent").getAsString())); 23567 if (json.has("_textEquivalent")) 23568 parseElementProperties(getJObject(json, "_textEquivalent"), res.getTextEquivalentElement()); 23569 if (json.has("priority")) 23570 res.setPriorityElement(parseEnumeration(json.get("priority").getAsString(), PlanDefinition.RequestPriority.NULL, 23571 new PlanDefinition.RequestPriorityEnumFactory())); 23572 if (json.has("_priority")) 23573 parseElementProperties(getJObject(json, "_priority"), res.getPriorityElement()); 23574 if (json.has("code")) { 23575 JsonArray array = json.getAsJsonArray("code"); 23576 for (int i = 0; i < array.size(); i++) { 23577 res.getCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 23578 } 23579 } 23580 ; 23581 if (json.has("reason")) { 23582 JsonArray array = json.getAsJsonArray("reason"); 23583 for (int i = 0; i < array.size(); i++) { 23584 res.getReason().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 23585 } 23586 } 23587 ; 23588 if (json.has("documentation")) { 23589 JsonArray array = json.getAsJsonArray("documentation"); 23590 for (int i = 0; i < array.size(); i++) { 23591 res.getDocumentation().add(parseRelatedArtifact(array.get(i).getAsJsonObject())); 23592 } 23593 } 23594 ; 23595 if (json.has("goalId")) { 23596 JsonArray array = json.getAsJsonArray("goalId"); 23597 for (int i = 0; i < array.size(); i++) { 23598 if (array.get(i).isJsonNull()) { 23599 res.getGoalId().add(new IdType()); 23600 } else { 23601 res.getGoalId().add(parseId(array.get(i).getAsString())); 23602 } 23603 } 23604 } 23605 ; 23606 if (json.has("_goalId")) { 23607 JsonArray array = json.getAsJsonArray("_goalId"); 23608 for (int i = 0; i < array.size(); i++) { 23609 if (i == res.getGoalId().size()) 23610 res.getGoalId().add(parseId(null)); 23611 if (array.get(i) instanceof JsonObject) 23612 parseElementProperties(array.get(i).getAsJsonObject(), res.getGoalId().get(i)); 23613 } 23614 } 23615 ; 23616 Type subject = parseType("subject", json); 23617 if (subject != null) 23618 res.setSubject(subject); 23619 if (json.has("trigger")) { 23620 JsonArray array = json.getAsJsonArray("trigger"); 23621 for (int i = 0; i < array.size(); i++) { 23622 res.getTrigger().add(parseTriggerDefinition(array.get(i).getAsJsonObject())); 23623 } 23624 } 23625 ; 23626 if (json.has("condition")) { 23627 JsonArray array = json.getAsJsonArray("condition"); 23628 for (int i = 0; i < array.size(); i++) { 23629 res.getCondition() 23630 .add(parsePlanDefinitionPlanDefinitionActionConditionComponent(array.get(i).getAsJsonObject(), owner)); 23631 } 23632 } 23633 ; 23634 if (json.has("input")) { 23635 JsonArray array = json.getAsJsonArray("input"); 23636 for (int i = 0; i < array.size(); i++) { 23637 res.getInput().add(parseDataRequirement(array.get(i).getAsJsonObject())); 23638 } 23639 } 23640 ; 23641 if (json.has("output")) { 23642 JsonArray array = json.getAsJsonArray("output"); 23643 for (int i = 0; i < array.size(); i++) { 23644 res.getOutput().add(parseDataRequirement(array.get(i).getAsJsonObject())); 23645 } 23646 } 23647 ; 23648 if (json.has("relatedAction")) { 23649 JsonArray array = json.getAsJsonArray("relatedAction"); 23650 for (int i = 0; i < array.size(); i++) { 23651 res.getRelatedAction() 23652 .add(parsePlanDefinitionPlanDefinitionActionRelatedActionComponent(array.get(i).getAsJsonObject(), owner)); 23653 } 23654 } 23655 ; 23656 Type timing = parseType("timing", json); 23657 if (timing != null) 23658 res.setTiming(timing); 23659 if (json.has("participant")) { 23660 JsonArray array = json.getAsJsonArray("participant"); 23661 for (int i = 0; i < array.size(); i++) { 23662 res.getParticipant() 23663 .add(parsePlanDefinitionPlanDefinitionActionParticipantComponent(array.get(i).getAsJsonObject(), owner)); 23664 } 23665 } 23666 ; 23667 if (json.has("type")) 23668 res.setType(parseCodeableConcept(getJObject(json, "type"))); 23669 if (json.has("groupingBehavior")) 23670 res.setGroupingBehaviorElement(parseEnumeration(json.get("groupingBehavior").getAsString(), 23671 PlanDefinition.ActionGroupingBehavior.NULL, new PlanDefinition.ActionGroupingBehaviorEnumFactory())); 23672 if (json.has("_groupingBehavior")) 23673 parseElementProperties(getJObject(json, "_groupingBehavior"), res.getGroupingBehaviorElement()); 23674 if (json.has("selectionBehavior")) 23675 res.setSelectionBehaviorElement(parseEnumeration(json.get("selectionBehavior").getAsString(), 23676 PlanDefinition.ActionSelectionBehavior.NULL, new PlanDefinition.ActionSelectionBehaviorEnumFactory())); 23677 if (json.has("_selectionBehavior")) 23678 parseElementProperties(getJObject(json, "_selectionBehavior"), res.getSelectionBehaviorElement()); 23679 if (json.has("requiredBehavior")) 23680 res.setRequiredBehaviorElement(parseEnumeration(json.get("requiredBehavior").getAsString(), 23681 PlanDefinition.ActionRequiredBehavior.NULL, new PlanDefinition.ActionRequiredBehaviorEnumFactory())); 23682 if (json.has("_requiredBehavior")) 23683 parseElementProperties(getJObject(json, "_requiredBehavior"), res.getRequiredBehaviorElement()); 23684 if (json.has("precheckBehavior")) 23685 res.setPrecheckBehaviorElement(parseEnumeration(json.get("precheckBehavior").getAsString(), 23686 PlanDefinition.ActionPrecheckBehavior.NULL, new PlanDefinition.ActionPrecheckBehaviorEnumFactory())); 23687 if (json.has("_precheckBehavior")) 23688 parseElementProperties(getJObject(json, "_precheckBehavior"), res.getPrecheckBehaviorElement()); 23689 if (json.has("cardinalityBehavior")) 23690 res.setCardinalityBehaviorElement(parseEnumeration(json.get("cardinalityBehavior").getAsString(), 23691 PlanDefinition.ActionCardinalityBehavior.NULL, new PlanDefinition.ActionCardinalityBehaviorEnumFactory())); 23692 if (json.has("_cardinalityBehavior")) 23693 parseElementProperties(getJObject(json, "_cardinalityBehavior"), res.getCardinalityBehaviorElement()); 23694 Type definition = parseType("definition", json); 23695 if (definition != null) 23696 res.setDefinition(definition); 23697 if (json.has("transform")) 23698 res.setTransformElement(parseCanonical(json.get("transform").getAsString())); 23699 if (json.has("_transform")) 23700 parseElementProperties(getJObject(json, "_transform"), res.getTransformElement()); 23701 if (json.has("dynamicValue")) { 23702 JsonArray array = json.getAsJsonArray("dynamicValue"); 23703 for (int i = 0; i < array.size(); i++) { 23704 res.getDynamicValue() 23705 .add(parsePlanDefinitionPlanDefinitionActionDynamicValueComponent(array.get(i).getAsJsonObject(), owner)); 23706 } 23707 } 23708 ; 23709 if (json.has("action")) { 23710 JsonArray array = json.getAsJsonArray("action"); 23711 for (int i = 0; i < array.size(); i++) { 23712 res.getAction().add(parsePlanDefinitionPlanDefinitionActionComponent(array.get(i).getAsJsonObject(), owner)); 23713 } 23714 } 23715 ; 23716 } 23717 23718 protected PlanDefinition.PlanDefinitionActionConditionComponent parsePlanDefinitionPlanDefinitionActionConditionComponent( 23719 JsonObject json, PlanDefinition owner) throws IOException, FHIRFormatError { 23720 PlanDefinition.PlanDefinitionActionConditionComponent res = new PlanDefinition.PlanDefinitionActionConditionComponent(); 23721 parsePlanDefinitionPlanDefinitionActionConditionComponentProperties(json, owner, res); 23722 return res; 23723 } 23724 23725 protected void parsePlanDefinitionPlanDefinitionActionConditionComponentProperties(JsonObject json, 23726 PlanDefinition owner, PlanDefinition.PlanDefinitionActionConditionComponent res) 23727 throws IOException, FHIRFormatError { 23728 parseBackboneElementProperties(json, res); 23729 if (json.has("kind")) 23730 res.setKindElement(parseEnumeration(json.get("kind").getAsString(), PlanDefinition.ActionConditionKind.NULL, 23731 new PlanDefinition.ActionConditionKindEnumFactory())); 23732 if (json.has("_kind")) 23733 parseElementProperties(getJObject(json, "_kind"), res.getKindElement()); 23734 if (json.has("expression")) 23735 res.setExpression(parseExpression(getJObject(json, "expression"))); 23736 } 23737 23738 protected PlanDefinition.PlanDefinitionActionRelatedActionComponent parsePlanDefinitionPlanDefinitionActionRelatedActionComponent( 23739 JsonObject json, PlanDefinition owner) throws IOException, FHIRFormatError { 23740 PlanDefinition.PlanDefinitionActionRelatedActionComponent res = new PlanDefinition.PlanDefinitionActionRelatedActionComponent(); 23741 parsePlanDefinitionPlanDefinitionActionRelatedActionComponentProperties(json, owner, res); 23742 return res; 23743 } 23744 23745 protected void parsePlanDefinitionPlanDefinitionActionRelatedActionComponentProperties(JsonObject json, 23746 PlanDefinition owner, PlanDefinition.PlanDefinitionActionRelatedActionComponent res) 23747 throws IOException, FHIRFormatError { 23748 parseBackboneElementProperties(json, res); 23749 if (json.has("actionId")) 23750 res.setActionIdElement(parseId(json.get("actionId").getAsString())); 23751 if (json.has("_actionId")) 23752 parseElementProperties(getJObject(json, "_actionId"), res.getActionIdElement()); 23753 if (json.has("relationship")) 23754 res.setRelationshipElement(parseEnumeration(json.get("relationship").getAsString(), 23755 PlanDefinition.ActionRelationshipType.NULL, new PlanDefinition.ActionRelationshipTypeEnumFactory())); 23756 if (json.has("_relationship")) 23757 parseElementProperties(getJObject(json, "_relationship"), res.getRelationshipElement()); 23758 Type offset = parseType("offset", json); 23759 if (offset != null) 23760 res.setOffset(offset); 23761 } 23762 23763 protected PlanDefinition.PlanDefinitionActionParticipantComponent parsePlanDefinitionPlanDefinitionActionParticipantComponent( 23764 JsonObject json, PlanDefinition owner) throws IOException, FHIRFormatError { 23765 PlanDefinition.PlanDefinitionActionParticipantComponent res = new PlanDefinition.PlanDefinitionActionParticipantComponent(); 23766 parsePlanDefinitionPlanDefinitionActionParticipantComponentProperties(json, owner, res); 23767 return res; 23768 } 23769 23770 protected void parsePlanDefinitionPlanDefinitionActionParticipantComponentProperties(JsonObject json, 23771 PlanDefinition owner, PlanDefinition.PlanDefinitionActionParticipantComponent res) 23772 throws IOException, FHIRFormatError { 23773 parseBackboneElementProperties(json, res); 23774 if (json.has("type")) 23775 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), PlanDefinition.ActionParticipantType.NULL, 23776 new PlanDefinition.ActionParticipantTypeEnumFactory())); 23777 if (json.has("_type")) 23778 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 23779 if (json.has("role")) 23780 res.setRole(parseCodeableConcept(getJObject(json, "role"))); 23781 } 23782 23783 protected PlanDefinition.PlanDefinitionActionDynamicValueComponent parsePlanDefinitionPlanDefinitionActionDynamicValueComponent( 23784 JsonObject json, PlanDefinition owner) throws IOException, FHIRFormatError { 23785 PlanDefinition.PlanDefinitionActionDynamicValueComponent res = new PlanDefinition.PlanDefinitionActionDynamicValueComponent(); 23786 parsePlanDefinitionPlanDefinitionActionDynamicValueComponentProperties(json, owner, res); 23787 return res; 23788 } 23789 23790 protected void parsePlanDefinitionPlanDefinitionActionDynamicValueComponentProperties(JsonObject json, 23791 PlanDefinition owner, PlanDefinition.PlanDefinitionActionDynamicValueComponent res) 23792 throws IOException, FHIRFormatError { 23793 parseBackboneElementProperties(json, res); 23794 if (json.has("path")) 23795 res.setPathElement(parseString(json.get("path").getAsString())); 23796 if (json.has("_path")) 23797 parseElementProperties(getJObject(json, "_path"), res.getPathElement()); 23798 if (json.has("expression")) 23799 res.setExpression(parseExpression(getJObject(json, "expression"))); 23800 } 23801 23802 protected Practitioner parsePractitioner(JsonObject json) throws IOException, FHIRFormatError { 23803 Practitioner res = new Practitioner(); 23804 parsePractitionerProperties(json, res); 23805 return res; 23806 } 23807 23808 protected void parsePractitionerProperties(JsonObject json, Practitioner res) throws IOException, FHIRFormatError { 23809 parseDomainResourceProperties(json, res); 23810 if (json.has("identifier")) { 23811 JsonArray array = json.getAsJsonArray("identifier"); 23812 for (int i = 0; i < array.size(); i++) { 23813 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 23814 } 23815 } 23816 ; 23817 if (json.has("active")) 23818 res.setActiveElement(parseBoolean(json.get("active").getAsBoolean())); 23819 if (json.has("_active")) 23820 parseElementProperties(getJObject(json, "_active"), res.getActiveElement()); 23821 if (json.has("name")) { 23822 JsonArray array = json.getAsJsonArray("name"); 23823 for (int i = 0; i < array.size(); i++) { 23824 res.getName().add(parseHumanName(array.get(i).getAsJsonObject())); 23825 } 23826 } 23827 ; 23828 if (json.has("telecom")) { 23829 JsonArray array = json.getAsJsonArray("telecom"); 23830 for (int i = 0; i < array.size(); i++) { 23831 res.getTelecom().add(parseContactPoint(array.get(i).getAsJsonObject())); 23832 } 23833 } 23834 ; 23835 if (json.has("address")) { 23836 JsonArray array = json.getAsJsonArray("address"); 23837 for (int i = 0; i < array.size(); i++) { 23838 res.getAddress().add(parseAddress(array.get(i).getAsJsonObject())); 23839 } 23840 } 23841 ; 23842 if (json.has("gender")) 23843 res.setGenderElement(parseEnumeration(json.get("gender").getAsString(), Enumerations.AdministrativeGender.NULL, 23844 new Enumerations.AdministrativeGenderEnumFactory())); 23845 if (json.has("_gender")) 23846 parseElementProperties(getJObject(json, "_gender"), res.getGenderElement()); 23847 if (json.has("birthDate")) 23848 res.setBirthDateElement(parseDate(json.get("birthDate").getAsString())); 23849 if (json.has("_birthDate")) 23850 parseElementProperties(getJObject(json, "_birthDate"), res.getBirthDateElement()); 23851 if (json.has("photo")) { 23852 JsonArray array = json.getAsJsonArray("photo"); 23853 for (int i = 0; i < array.size(); i++) { 23854 res.getPhoto().add(parseAttachment(array.get(i).getAsJsonObject())); 23855 } 23856 } 23857 ; 23858 if (json.has("qualification")) { 23859 JsonArray array = json.getAsJsonArray("qualification"); 23860 for (int i = 0; i < array.size(); i++) { 23861 res.getQualification() 23862 .add(parsePractitionerPractitionerQualificationComponent(array.get(i).getAsJsonObject(), res)); 23863 } 23864 } 23865 ; 23866 if (json.has("communication")) { 23867 JsonArray array = json.getAsJsonArray("communication"); 23868 for (int i = 0; i < array.size(); i++) { 23869 res.getCommunication().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 23870 } 23871 } 23872 ; 23873 } 23874 23875 protected Practitioner.PractitionerQualificationComponent parsePractitionerPractitionerQualificationComponent( 23876 JsonObject json, Practitioner owner) throws IOException, FHIRFormatError { 23877 Practitioner.PractitionerQualificationComponent res = new Practitioner.PractitionerQualificationComponent(); 23878 parsePractitionerPractitionerQualificationComponentProperties(json, owner, res); 23879 return res; 23880 } 23881 23882 protected void parsePractitionerPractitionerQualificationComponentProperties(JsonObject json, Practitioner owner, 23883 Practitioner.PractitionerQualificationComponent res) throws IOException, FHIRFormatError { 23884 parseBackboneElementProperties(json, res); 23885 if (json.has("identifier")) { 23886 JsonArray array = json.getAsJsonArray("identifier"); 23887 for (int i = 0; i < array.size(); i++) { 23888 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 23889 } 23890 } 23891 ; 23892 if (json.has("code")) 23893 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 23894 if (json.has("period")) 23895 res.setPeriod(parsePeriod(getJObject(json, "period"))); 23896 if (json.has("issuer")) 23897 res.setIssuer(parseReference(getJObject(json, "issuer"))); 23898 } 23899 23900 protected PractitionerRole parsePractitionerRole(JsonObject json) throws IOException, FHIRFormatError { 23901 PractitionerRole res = new PractitionerRole(); 23902 parsePractitionerRoleProperties(json, res); 23903 return res; 23904 } 23905 23906 protected void parsePractitionerRoleProperties(JsonObject json, PractitionerRole res) 23907 throws IOException, FHIRFormatError { 23908 parseDomainResourceProperties(json, res); 23909 if (json.has("identifier")) { 23910 JsonArray array = json.getAsJsonArray("identifier"); 23911 for (int i = 0; i < array.size(); i++) { 23912 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 23913 } 23914 } 23915 ; 23916 if (json.has("active")) 23917 res.setActiveElement(parseBoolean(json.get("active").getAsBoolean())); 23918 if (json.has("_active")) 23919 parseElementProperties(getJObject(json, "_active"), res.getActiveElement()); 23920 if (json.has("period")) 23921 res.setPeriod(parsePeriod(getJObject(json, "period"))); 23922 if (json.has("practitioner")) 23923 res.setPractitioner(parseReference(getJObject(json, "practitioner"))); 23924 if (json.has("organization")) 23925 res.setOrganization(parseReference(getJObject(json, "organization"))); 23926 if (json.has("code")) { 23927 JsonArray array = json.getAsJsonArray("code"); 23928 for (int i = 0; i < array.size(); i++) { 23929 res.getCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 23930 } 23931 } 23932 ; 23933 if (json.has("specialty")) { 23934 JsonArray array = json.getAsJsonArray("specialty"); 23935 for (int i = 0; i < array.size(); i++) { 23936 res.getSpecialty().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 23937 } 23938 } 23939 ; 23940 if (json.has("location")) { 23941 JsonArray array = json.getAsJsonArray("location"); 23942 for (int i = 0; i < array.size(); i++) { 23943 res.getLocation().add(parseReference(array.get(i).getAsJsonObject())); 23944 } 23945 } 23946 ; 23947 if (json.has("healthcareService")) { 23948 JsonArray array = json.getAsJsonArray("healthcareService"); 23949 for (int i = 0; i < array.size(); i++) { 23950 res.getHealthcareService().add(parseReference(array.get(i).getAsJsonObject())); 23951 } 23952 } 23953 ; 23954 if (json.has("telecom")) { 23955 JsonArray array = json.getAsJsonArray("telecom"); 23956 for (int i = 0; i < array.size(); i++) { 23957 res.getTelecom().add(parseContactPoint(array.get(i).getAsJsonObject())); 23958 } 23959 } 23960 ; 23961 if (json.has("availableTime")) { 23962 JsonArray array = json.getAsJsonArray("availableTime"); 23963 for (int i = 0; i < array.size(); i++) { 23964 res.getAvailableTime() 23965 .add(parsePractitionerRolePractitionerRoleAvailableTimeComponent(array.get(i).getAsJsonObject(), res)); 23966 } 23967 } 23968 ; 23969 if (json.has("notAvailable")) { 23970 JsonArray array = json.getAsJsonArray("notAvailable"); 23971 for (int i = 0; i < array.size(); i++) { 23972 res.getNotAvailable() 23973 .add(parsePractitionerRolePractitionerRoleNotAvailableComponent(array.get(i).getAsJsonObject(), res)); 23974 } 23975 } 23976 ; 23977 if (json.has("availabilityExceptions")) 23978 res.setAvailabilityExceptionsElement(parseString(json.get("availabilityExceptions").getAsString())); 23979 if (json.has("_availabilityExceptions")) 23980 parseElementProperties(getJObject(json, "_availabilityExceptions"), res.getAvailabilityExceptionsElement()); 23981 if (json.has("endpoint")) { 23982 JsonArray array = json.getAsJsonArray("endpoint"); 23983 for (int i = 0; i < array.size(); i++) { 23984 res.getEndpoint().add(parseReference(array.get(i).getAsJsonObject())); 23985 } 23986 } 23987 ; 23988 } 23989 23990 protected PractitionerRole.PractitionerRoleAvailableTimeComponent parsePractitionerRolePractitionerRoleAvailableTimeComponent( 23991 JsonObject json, PractitionerRole owner) throws IOException, FHIRFormatError { 23992 PractitionerRole.PractitionerRoleAvailableTimeComponent res = new PractitionerRole.PractitionerRoleAvailableTimeComponent(); 23993 parsePractitionerRolePractitionerRoleAvailableTimeComponentProperties(json, owner, res); 23994 return res; 23995 } 23996 23997 protected void parsePractitionerRolePractitionerRoleAvailableTimeComponentProperties(JsonObject json, 23998 PractitionerRole owner, PractitionerRole.PractitionerRoleAvailableTimeComponent res) 23999 throws IOException, FHIRFormatError { 24000 parseBackboneElementProperties(json, res); 24001 if (json.has("daysOfWeek")) { 24002 JsonArray array = json.getAsJsonArray("daysOfWeek"); 24003 for (int i = 0; i < array.size(); i++) { 24004 if (array.get(i).isJsonNull()) { 24005 res.getDaysOfWeek().add(new Enumeration<PractitionerRole.DaysOfWeek>()); 24006 } else { 24007 res.getDaysOfWeek().add(parseEnumeration(array.get(i).getAsString(), PractitionerRole.DaysOfWeek.NULL, 24008 new PractitionerRole.DaysOfWeekEnumFactory())); 24009 } 24010 } 24011 } 24012 ; 24013 if (json.has("_daysOfWeek")) { 24014 JsonArray array = json.getAsJsonArray("_daysOfWeek"); 24015 for (int i = 0; i < array.size(); i++) { 24016 if (i == res.getDaysOfWeek().size()) 24017 res.getDaysOfWeek().add( 24018 parseEnumeration(null, PractitionerRole.DaysOfWeek.NULL, new PractitionerRole.DaysOfWeekEnumFactory())); 24019 if (array.get(i) instanceof JsonObject) 24020 parseElementProperties(array.get(i).getAsJsonObject(), res.getDaysOfWeek().get(i)); 24021 } 24022 } 24023 ; 24024 if (json.has("allDay")) 24025 res.setAllDayElement(parseBoolean(json.get("allDay").getAsBoolean())); 24026 if (json.has("_allDay")) 24027 parseElementProperties(getJObject(json, "_allDay"), res.getAllDayElement()); 24028 if (json.has("availableStartTime")) 24029 res.setAvailableStartTimeElement(parseTime(json.get("availableStartTime").getAsString())); 24030 if (json.has("_availableStartTime")) 24031 parseElementProperties(getJObject(json, "_availableStartTime"), res.getAvailableStartTimeElement()); 24032 if (json.has("availableEndTime")) 24033 res.setAvailableEndTimeElement(parseTime(json.get("availableEndTime").getAsString())); 24034 if (json.has("_availableEndTime")) 24035 parseElementProperties(getJObject(json, "_availableEndTime"), res.getAvailableEndTimeElement()); 24036 } 24037 24038 protected PractitionerRole.PractitionerRoleNotAvailableComponent parsePractitionerRolePractitionerRoleNotAvailableComponent( 24039 JsonObject json, PractitionerRole owner) throws IOException, FHIRFormatError { 24040 PractitionerRole.PractitionerRoleNotAvailableComponent res = new PractitionerRole.PractitionerRoleNotAvailableComponent(); 24041 parsePractitionerRolePractitionerRoleNotAvailableComponentProperties(json, owner, res); 24042 return res; 24043 } 24044 24045 protected void parsePractitionerRolePractitionerRoleNotAvailableComponentProperties(JsonObject json, 24046 PractitionerRole owner, PractitionerRole.PractitionerRoleNotAvailableComponent res) 24047 throws IOException, FHIRFormatError { 24048 parseBackboneElementProperties(json, res); 24049 if (json.has("description")) 24050 res.setDescriptionElement(parseString(json.get("description").getAsString())); 24051 if (json.has("_description")) 24052 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 24053 if (json.has("during")) 24054 res.setDuring(parsePeriod(getJObject(json, "during"))); 24055 } 24056 24057 protected Procedure parseProcedure(JsonObject json) throws IOException, FHIRFormatError { 24058 Procedure res = new Procedure(); 24059 parseProcedureProperties(json, res); 24060 return res; 24061 } 24062 24063 protected void parseProcedureProperties(JsonObject json, Procedure res) throws IOException, FHIRFormatError { 24064 parseDomainResourceProperties(json, res); 24065 if (json.has("identifier")) { 24066 JsonArray array = json.getAsJsonArray("identifier"); 24067 for (int i = 0; i < array.size(); i++) { 24068 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 24069 } 24070 } 24071 ; 24072 if (json.has("instantiatesCanonical")) { 24073 JsonArray array = json.getAsJsonArray("instantiatesCanonical"); 24074 for (int i = 0; i < array.size(); i++) { 24075 if (array.get(i).isJsonNull()) { 24076 res.getInstantiatesCanonical().add(new CanonicalType()); 24077 } else { 24078 res.getInstantiatesCanonical().add(parseCanonical(array.get(i).getAsString())); 24079 } 24080 } 24081 } 24082 ; 24083 if (json.has("_instantiatesCanonical")) { 24084 JsonArray array = json.getAsJsonArray("_instantiatesCanonical"); 24085 for (int i = 0; i < array.size(); i++) { 24086 if (i == res.getInstantiatesCanonical().size()) 24087 res.getInstantiatesCanonical().add(parseCanonical(null)); 24088 if (array.get(i) instanceof JsonObject) 24089 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesCanonical().get(i)); 24090 } 24091 } 24092 ; 24093 if (json.has("instantiatesUri")) { 24094 JsonArray array = json.getAsJsonArray("instantiatesUri"); 24095 for (int i = 0; i < array.size(); i++) { 24096 if (array.get(i).isJsonNull()) { 24097 res.getInstantiatesUri().add(new UriType()); 24098 } else { 24099 res.getInstantiatesUri().add(parseUri(array.get(i).getAsString())); 24100 } 24101 } 24102 } 24103 ; 24104 if (json.has("_instantiatesUri")) { 24105 JsonArray array = json.getAsJsonArray("_instantiatesUri"); 24106 for (int i = 0; i < array.size(); i++) { 24107 if (i == res.getInstantiatesUri().size()) 24108 res.getInstantiatesUri().add(parseUri(null)); 24109 if (array.get(i) instanceof JsonObject) 24110 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesUri().get(i)); 24111 } 24112 } 24113 ; 24114 if (json.has("basedOn")) { 24115 JsonArray array = json.getAsJsonArray("basedOn"); 24116 for (int i = 0; i < array.size(); i++) { 24117 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 24118 } 24119 } 24120 ; 24121 if (json.has("partOf")) { 24122 JsonArray array = json.getAsJsonArray("partOf"); 24123 for (int i = 0; i < array.size(); i++) { 24124 res.getPartOf().add(parseReference(array.get(i).getAsJsonObject())); 24125 } 24126 } 24127 ; 24128 if (json.has("status")) 24129 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Procedure.ProcedureStatus.NULL, 24130 new Procedure.ProcedureStatusEnumFactory())); 24131 if (json.has("_status")) 24132 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 24133 if (json.has("statusReason")) 24134 res.setStatusReason(parseCodeableConcept(getJObject(json, "statusReason"))); 24135 if (json.has("category")) 24136 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 24137 if (json.has("code")) 24138 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 24139 if (json.has("subject")) 24140 res.setSubject(parseReference(getJObject(json, "subject"))); 24141 if (json.has("encounter")) 24142 res.setEncounter(parseReference(getJObject(json, "encounter"))); 24143 Type performed = parseType("performed", json); 24144 if (performed != null) 24145 res.setPerformed(performed); 24146 if (json.has("recorder")) 24147 res.setRecorder(parseReference(getJObject(json, "recorder"))); 24148 if (json.has("asserter")) 24149 res.setAsserter(parseReference(getJObject(json, "asserter"))); 24150 if (json.has("performer")) { 24151 JsonArray array = json.getAsJsonArray("performer"); 24152 for (int i = 0; i < array.size(); i++) { 24153 res.getPerformer().add(parseProcedureProcedurePerformerComponent(array.get(i).getAsJsonObject(), res)); 24154 } 24155 } 24156 ; 24157 if (json.has("location")) 24158 res.setLocation(parseReference(getJObject(json, "location"))); 24159 if (json.has("reasonCode")) { 24160 JsonArray array = json.getAsJsonArray("reasonCode"); 24161 for (int i = 0; i < array.size(); i++) { 24162 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 24163 } 24164 } 24165 ; 24166 if (json.has("reasonReference")) { 24167 JsonArray array = json.getAsJsonArray("reasonReference"); 24168 for (int i = 0; i < array.size(); i++) { 24169 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 24170 } 24171 } 24172 ; 24173 if (json.has("bodySite")) { 24174 JsonArray array = json.getAsJsonArray("bodySite"); 24175 for (int i = 0; i < array.size(); i++) { 24176 res.getBodySite().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 24177 } 24178 } 24179 ; 24180 if (json.has("outcome")) 24181 res.setOutcome(parseCodeableConcept(getJObject(json, "outcome"))); 24182 if (json.has("report")) { 24183 JsonArray array = json.getAsJsonArray("report"); 24184 for (int i = 0; i < array.size(); i++) { 24185 res.getReport().add(parseReference(array.get(i).getAsJsonObject())); 24186 } 24187 } 24188 ; 24189 if (json.has("complication")) { 24190 JsonArray array = json.getAsJsonArray("complication"); 24191 for (int i = 0; i < array.size(); i++) { 24192 res.getComplication().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 24193 } 24194 } 24195 ; 24196 if (json.has("complicationDetail")) { 24197 JsonArray array = json.getAsJsonArray("complicationDetail"); 24198 for (int i = 0; i < array.size(); i++) { 24199 res.getComplicationDetail().add(parseReference(array.get(i).getAsJsonObject())); 24200 } 24201 } 24202 ; 24203 if (json.has("followUp")) { 24204 JsonArray array = json.getAsJsonArray("followUp"); 24205 for (int i = 0; i < array.size(); i++) { 24206 res.getFollowUp().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 24207 } 24208 } 24209 ; 24210 if (json.has("note")) { 24211 JsonArray array = json.getAsJsonArray("note"); 24212 for (int i = 0; i < array.size(); i++) { 24213 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 24214 } 24215 } 24216 ; 24217 if (json.has("focalDevice")) { 24218 JsonArray array = json.getAsJsonArray("focalDevice"); 24219 for (int i = 0; i < array.size(); i++) { 24220 res.getFocalDevice().add(parseProcedureProcedureFocalDeviceComponent(array.get(i).getAsJsonObject(), res)); 24221 } 24222 } 24223 ; 24224 if (json.has("usedReference")) { 24225 JsonArray array = json.getAsJsonArray("usedReference"); 24226 for (int i = 0; i < array.size(); i++) { 24227 res.getUsedReference().add(parseReference(array.get(i).getAsJsonObject())); 24228 } 24229 } 24230 ; 24231 if (json.has("usedCode")) { 24232 JsonArray array = json.getAsJsonArray("usedCode"); 24233 for (int i = 0; i < array.size(); i++) { 24234 res.getUsedCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 24235 } 24236 } 24237 ; 24238 } 24239 24240 protected Procedure.ProcedurePerformerComponent parseProcedureProcedurePerformerComponent(JsonObject json, 24241 Procedure owner) throws IOException, FHIRFormatError { 24242 Procedure.ProcedurePerformerComponent res = new Procedure.ProcedurePerformerComponent(); 24243 parseProcedureProcedurePerformerComponentProperties(json, owner, res); 24244 return res; 24245 } 24246 24247 protected void parseProcedureProcedurePerformerComponentProperties(JsonObject json, Procedure owner, 24248 Procedure.ProcedurePerformerComponent res) throws IOException, FHIRFormatError { 24249 parseBackboneElementProperties(json, res); 24250 if (json.has("function")) 24251 res.setFunction(parseCodeableConcept(getJObject(json, "function"))); 24252 if (json.has("actor")) 24253 res.setActor(parseReference(getJObject(json, "actor"))); 24254 if (json.has("onBehalfOf")) 24255 res.setOnBehalfOf(parseReference(getJObject(json, "onBehalfOf"))); 24256 } 24257 24258 protected Procedure.ProcedureFocalDeviceComponent parseProcedureProcedureFocalDeviceComponent(JsonObject json, 24259 Procedure owner) throws IOException, FHIRFormatError { 24260 Procedure.ProcedureFocalDeviceComponent res = new Procedure.ProcedureFocalDeviceComponent(); 24261 parseProcedureProcedureFocalDeviceComponentProperties(json, owner, res); 24262 return res; 24263 } 24264 24265 protected void parseProcedureProcedureFocalDeviceComponentProperties(JsonObject json, Procedure owner, 24266 Procedure.ProcedureFocalDeviceComponent res) throws IOException, FHIRFormatError { 24267 parseBackboneElementProperties(json, res); 24268 if (json.has("action")) 24269 res.setAction(parseCodeableConcept(getJObject(json, "action"))); 24270 if (json.has("manipulated")) 24271 res.setManipulated(parseReference(getJObject(json, "manipulated"))); 24272 } 24273 24274 protected Provenance parseProvenance(JsonObject json) throws IOException, FHIRFormatError { 24275 Provenance res = new Provenance(); 24276 parseProvenanceProperties(json, res); 24277 return res; 24278 } 24279 24280 protected void parseProvenanceProperties(JsonObject json, Provenance res) throws IOException, FHIRFormatError { 24281 parseDomainResourceProperties(json, res); 24282 if (json.has("target")) { 24283 JsonArray array = json.getAsJsonArray("target"); 24284 for (int i = 0; i < array.size(); i++) { 24285 res.getTarget().add(parseReference(array.get(i).getAsJsonObject())); 24286 } 24287 } 24288 ; 24289 Type occurred = parseType("occurred", json); 24290 if (occurred != null) 24291 res.setOccurred(occurred); 24292 if (json.has("recorded")) 24293 res.setRecordedElement(parseInstant(json.get("recorded").getAsString())); 24294 if (json.has("_recorded")) 24295 parseElementProperties(getJObject(json, "_recorded"), res.getRecordedElement()); 24296 if (json.has("policy")) { 24297 JsonArray array = json.getAsJsonArray("policy"); 24298 for (int i = 0; i < array.size(); i++) { 24299 if (array.get(i).isJsonNull()) { 24300 res.getPolicy().add(new UriType()); 24301 } else { 24302 res.getPolicy().add(parseUri(array.get(i).getAsString())); 24303 } 24304 } 24305 } 24306 ; 24307 if (json.has("_policy")) { 24308 JsonArray array = json.getAsJsonArray("_policy"); 24309 for (int i = 0; i < array.size(); i++) { 24310 if (i == res.getPolicy().size()) 24311 res.getPolicy().add(parseUri(null)); 24312 if (array.get(i) instanceof JsonObject) 24313 parseElementProperties(array.get(i).getAsJsonObject(), res.getPolicy().get(i)); 24314 } 24315 } 24316 ; 24317 if (json.has("location")) 24318 res.setLocation(parseReference(getJObject(json, "location"))); 24319 if (json.has("reason")) { 24320 JsonArray array = json.getAsJsonArray("reason"); 24321 for (int i = 0; i < array.size(); i++) { 24322 res.getReason().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 24323 } 24324 } 24325 ; 24326 if (json.has("activity")) 24327 res.setActivity(parseCodeableConcept(getJObject(json, "activity"))); 24328 if (json.has("agent")) { 24329 JsonArray array = json.getAsJsonArray("agent"); 24330 for (int i = 0; i < array.size(); i++) { 24331 res.getAgent().add(parseProvenanceProvenanceAgentComponent(array.get(i).getAsJsonObject(), res)); 24332 } 24333 } 24334 ; 24335 if (json.has("entity")) { 24336 JsonArray array = json.getAsJsonArray("entity"); 24337 for (int i = 0; i < array.size(); i++) { 24338 res.getEntity().add(parseProvenanceProvenanceEntityComponent(array.get(i).getAsJsonObject(), res)); 24339 } 24340 } 24341 ; 24342 if (json.has("signature")) { 24343 JsonArray array = json.getAsJsonArray("signature"); 24344 for (int i = 0; i < array.size(); i++) { 24345 res.getSignature().add(parseSignature(array.get(i).getAsJsonObject())); 24346 } 24347 } 24348 ; 24349 } 24350 24351 protected Provenance.ProvenanceAgentComponent parseProvenanceProvenanceAgentComponent(JsonObject json, 24352 Provenance owner) throws IOException, FHIRFormatError { 24353 Provenance.ProvenanceAgentComponent res = new Provenance.ProvenanceAgentComponent(); 24354 parseProvenanceProvenanceAgentComponentProperties(json, owner, res); 24355 return res; 24356 } 24357 24358 protected void parseProvenanceProvenanceAgentComponentProperties(JsonObject json, Provenance owner, 24359 Provenance.ProvenanceAgentComponent res) throws IOException, FHIRFormatError { 24360 parseBackboneElementProperties(json, res); 24361 if (json.has("type")) 24362 res.setType(parseCodeableConcept(getJObject(json, "type"))); 24363 if (json.has("role")) { 24364 JsonArray array = json.getAsJsonArray("role"); 24365 for (int i = 0; i < array.size(); i++) { 24366 res.getRole().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 24367 } 24368 } 24369 ; 24370 if (json.has("who")) 24371 res.setWho(parseReference(getJObject(json, "who"))); 24372 if (json.has("onBehalfOf")) 24373 res.setOnBehalfOf(parseReference(getJObject(json, "onBehalfOf"))); 24374 } 24375 24376 protected Provenance.ProvenanceEntityComponent parseProvenanceProvenanceEntityComponent(JsonObject json, 24377 Provenance owner) throws IOException, FHIRFormatError { 24378 Provenance.ProvenanceEntityComponent res = new Provenance.ProvenanceEntityComponent(); 24379 parseProvenanceProvenanceEntityComponentProperties(json, owner, res); 24380 return res; 24381 } 24382 24383 protected void parseProvenanceProvenanceEntityComponentProperties(JsonObject json, Provenance owner, 24384 Provenance.ProvenanceEntityComponent res) throws IOException, FHIRFormatError { 24385 parseBackboneElementProperties(json, res); 24386 if (json.has("role")) 24387 res.setRoleElement(parseEnumeration(json.get("role").getAsString(), Provenance.ProvenanceEntityRole.NULL, 24388 new Provenance.ProvenanceEntityRoleEnumFactory())); 24389 if (json.has("_role")) 24390 parseElementProperties(getJObject(json, "_role"), res.getRoleElement()); 24391 if (json.has("what")) 24392 res.setWhat(parseReference(getJObject(json, "what"))); 24393 if (json.has("agent")) { 24394 JsonArray array = json.getAsJsonArray("agent"); 24395 for (int i = 0; i < array.size(); i++) { 24396 res.getAgent().add(parseProvenanceProvenanceAgentComponent(array.get(i).getAsJsonObject(), owner)); 24397 } 24398 } 24399 ; 24400 } 24401 24402 protected Questionnaire parseQuestionnaire(JsonObject json) throws IOException, FHIRFormatError { 24403 Questionnaire res = new Questionnaire(); 24404 parseQuestionnaireProperties(json, res); 24405 return res; 24406 } 24407 24408 protected void parseQuestionnaireProperties(JsonObject json, Questionnaire res) throws IOException, FHIRFormatError { 24409 parseDomainResourceProperties(json, res); 24410 if (json.has("url")) 24411 res.setUrlElement(parseUri(json.get("url").getAsString())); 24412 if (json.has("_url")) 24413 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 24414 if (json.has("identifier")) { 24415 JsonArray array = json.getAsJsonArray("identifier"); 24416 for (int i = 0; i < array.size(); i++) { 24417 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 24418 } 24419 } 24420 ; 24421 if (json.has("version")) 24422 res.setVersionElement(parseString(json.get("version").getAsString())); 24423 if (json.has("_version")) 24424 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 24425 if (json.has("name")) 24426 res.setNameElement(parseString(json.get("name").getAsString())); 24427 if (json.has("_name")) 24428 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 24429 if (json.has("title")) 24430 res.setTitleElement(parseString(json.get("title").getAsString())); 24431 if (json.has("_title")) 24432 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 24433 if (json.has("derivedFrom")) { 24434 JsonArray array = json.getAsJsonArray("derivedFrom"); 24435 for (int i = 0; i < array.size(); i++) { 24436 if (array.get(i).isJsonNull()) { 24437 res.getDerivedFrom().add(new CanonicalType()); 24438 } else { 24439 res.getDerivedFrom().add(parseCanonical(array.get(i).getAsString())); 24440 } 24441 } 24442 } 24443 ; 24444 if (json.has("_derivedFrom")) { 24445 JsonArray array = json.getAsJsonArray("_derivedFrom"); 24446 for (int i = 0; i < array.size(); i++) { 24447 if (i == res.getDerivedFrom().size()) 24448 res.getDerivedFrom().add(parseCanonical(null)); 24449 if (array.get(i) instanceof JsonObject) 24450 parseElementProperties(array.get(i).getAsJsonObject(), res.getDerivedFrom().get(i)); 24451 } 24452 } 24453 ; 24454 if (json.has("status")) 24455 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 24456 new Enumerations.PublicationStatusEnumFactory())); 24457 if (json.has("_status")) 24458 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 24459 if (json.has("experimental")) 24460 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 24461 if (json.has("_experimental")) 24462 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 24463 if (json.has("subjectType")) { 24464 JsonArray array = json.getAsJsonArray("subjectType"); 24465 for (int i = 0; i < array.size(); i++) { 24466 if (array.get(i).isJsonNull()) { 24467 res.getSubjectType().add(new CodeType()); 24468 } else { 24469 res.getSubjectType().add(parseCode(array.get(i).getAsString())); 24470 } 24471 } 24472 } 24473 ; 24474 if (json.has("_subjectType")) { 24475 JsonArray array = json.getAsJsonArray("_subjectType"); 24476 for (int i = 0; i < array.size(); i++) { 24477 if (i == res.getSubjectType().size()) 24478 res.getSubjectType().add(parseCode(null)); 24479 if (array.get(i) instanceof JsonObject) 24480 parseElementProperties(array.get(i).getAsJsonObject(), res.getSubjectType().get(i)); 24481 } 24482 } 24483 ; 24484 if (json.has("date")) 24485 res.setDateElement(parseDateTime(json.get("date").getAsString())); 24486 if (json.has("_date")) 24487 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 24488 if (json.has("publisher")) 24489 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 24490 if (json.has("_publisher")) 24491 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 24492 if (json.has("contact")) { 24493 JsonArray array = json.getAsJsonArray("contact"); 24494 for (int i = 0; i < array.size(); i++) { 24495 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 24496 } 24497 } 24498 ; 24499 if (json.has("description")) 24500 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 24501 if (json.has("_description")) 24502 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 24503 if (json.has("useContext")) { 24504 JsonArray array = json.getAsJsonArray("useContext"); 24505 for (int i = 0; i < array.size(); i++) { 24506 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 24507 } 24508 } 24509 ; 24510 if (json.has("jurisdiction")) { 24511 JsonArray array = json.getAsJsonArray("jurisdiction"); 24512 for (int i = 0; i < array.size(); i++) { 24513 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 24514 } 24515 } 24516 ; 24517 if (json.has("purpose")) 24518 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 24519 if (json.has("_purpose")) 24520 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 24521 if (json.has("copyright")) 24522 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 24523 if (json.has("_copyright")) 24524 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 24525 if (json.has("approvalDate")) 24526 res.setApprovalDateElement(parseDate(json.get("approvalDate").getAsString())); 24527 if (json.has("_approvalDate")) 24528 parseElementProperties(getJObject(json, "_approvalDate"), res.getApprovalDateElement()); 24529 if (json.has("lastReviewDate")) 24530 res.setLastReviewDateElement(parseDate(json.get("lastReviewDate").getAsString())); 24531 if (json.has("_lastReviewDate")) 24532 parseElementProperties(getJObject(json, "_lastReviewDate"), res.getLastReviewDateElement()); 24533 if (json.has("effectivePeriod")) 24534 res.setEffectivePeriod(parsePeriod(getJObject(json, "effectivePeriod"))); 24535 if (json.has("code")) { 24536 JsonArray array = json.getAsJsonArray("code"); 24537 for (int i = 0; i < array.size(); i++) { 24538 res.getCode().add(parseCoding(array.get(i).getAsJsonObject())); 24539 } 24540 } 24541 ; 24542 if (json.has("item")) { 24543 JsonArray array = json.getAsJsonArray("item"); 24544 for (int i = 0; i < array.size(); i++) { 24545 res.getItem().add(parseQuestionnaireQuestionnaireItemComponent(array.get(i).getAsJsonObject(), res)); 24546 } 24547 } 24548 ; 24549 } 24550 24551 protected Questionnaire.QuestionnaireItemComponent parseQuestionnaireQuestionnaireItemComponent(JsonObject json, 24552 Questionnaire owner) throws IOException, FHIRFormatError { 24553 Questionnaire.QuestionnaireItemComponent res = new Questionnaire.QuestionnaireItemComponent(); 24554 parseQuestionnaireQuestionnaireItemComponentProperties(json, owner, res); 24555 return res; 24556 } 24557 24558 protected void parseQuestionnaireQuestionnaireItemComponentProperties(JsonObject json, Questionnaire owner, 24559 Questionnaire.QuestionnaireItemComponent res) throws IOException, FHIRFormatError { 24560 parseBackboneElementProperties(json, res); 24561 if (json.has("linkId")) 24562 res.setLinkIdElement(parseString(json.get("linkId").getAsString())); 24563 if (json.has("_linkId")) 24564 parseElementProperties(getJObject(json, "_linkId"), res.getLinkIdElement()); 24565 if (json.has("definition")) 24566 res.setDefinitionElement(parseUri(json.get("definition").getAsString())); 24567 if (json.has("_definition")) 24568 parseElementProperties(getJObject(json, "_definition"), res.getDefinitionElement()); 24569 if (json.has("code")) { 24570 JsonArray array = json.getAsJsonArray("code"); 24571 for (int i = 0; i < array.size(); i++) { 24572 res.getCode().add(parseCoding(array.get(i).getAsJsonObject())); 24573 } 24574 } 24575 ; 24576 if (json.has("prefix")) 24577 res.setPrefixElement(parseString(json.get("prefix").getAsString())); 24578 if (json.has("_prefix")) 24579 parseElementProperties(getJObject(json, "_prefix"), res.getPrefixElement()); 24580 if (json.has("text")) 24581 res.setTextElement(parseString(json.get("text").getAsString())); 24582 if (json.has("_text")) 24583 parseElementProperties(getJObject(json, "_text"), res.getTextElement()); 24584 if (json.has("type")) 24585 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), Questionnaire.QuestionnaireItemType.NULL, 24586 new Questionnaire.QuestionnaireItemTypeEnumFactory())); 24587 if (json.has("_type")) 24588 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 24589 if (json.has("enableWhen")) { 24590 JsonArray array = json.getAsJsonArray("enableWhen"); 24591 for (int i = 0; i < array.size(); i++) { 24592 res.getEnableWhen() 24593 .add(parseQuestionnaireQuestionnaireItemEnableWhenComponent(array.get(i).getAsJsonObject(), owner)); 24594 } 24595 } 24596 ; 24597 if (json.has("enableBehavior")) 24598 res.setEnableBehaviorElement(parseEnumeration(json.get("enableBehavior").getAsString(), 24599 Questionnaire.EnableWhenBehavior.NULL, new Questionnaire.EnableWhenBehaviorEnumFactory())); 24600 if (json.has("_enableBehavior")) 24601 parseElementProperties(getJObject(json, "_enableBehavior"), res.getEnableBehaviorElement()); 24602 if (json.has("required")) 24603 res.setRequiredElement(parseBoolean(json.get("required").getAsBoolean())); 24604 if (json.has("_required")) 24605 parseElementProperties(getJObject(json, "_required"), res.getRequiredElement()); 24606 if (json.has("repeats")) 24607 res.setRepeatsElement(parseBoolean(json.get("repeats").getAsBoolean())); 24608 if (json.has("_repeats")) 24609 parseElementProperties(getJObject(json, "_repeats"), res.getRepeatsElement()); 24610 if (json.has("readOnly")) 24611 res.setReadOnlyElement(parseBoolean(json.get("readOnly").getAsBoolean())); 24612 if (json.has("_readOnly")) 24613 parseElementProperties(getJObject(json, "_readOnly"), res.getReadOnlyElement()); 24614 if (json.has("maxLength")) 24615 res.setMaxLengthElement(parseInteger(json.get("maxLength").getAsLong())); 24616 if (json.has("_maxLength")) 24617 parseElementProperties(getJObject(json, "_maxLength"), res.getMaxLengthElement()); 24618 if (json.has("answerValueSet")) 24619 res.setAnswerValueSetElement(parseCanonical(json.get("answerValueSet").getAsString())); 24620 if (json.has("_answerValueSet")) 24621 parseElementProperties(getJObject(json, "_answerValueSet"), res.getAnswerValueSetElement()); 24622 if (json.has("answerOption")) { 24623 JsonArray array = json.getAsJsonArray("answerOption"); 24624 for (int i = 0; i < array.size(); i++) { 24625 res.getAnswerOption() 24626 .add(parseQuestionnaireQuestionnaireItemAnswerOptionComponent(array.get(i).getAsJsonObject(), owner)); 24627 } 24628 } 24629 ; 24630 if (json.has("initial")) { 24631 JsonArray array = json.getAsJsonArray("initial"); 24632 for (int i = 0; i < array.size(); i++) { 24633 res.getInitial() 24634 .add(parseQuestionnaireQuestionnaireItemInitialComponent(array.get(i).getAsJsonObject(), owner)); 24635 } 24636 } 24637 ; 24638 if (json.has("item")) { 24639 JsonArray array = json.getAsJsonArray("item"); 24640 for (int i = 0; i < array.size(); i++) { 24641 res.getItem().add(parseQuestionnaireQuestionnaireItemComponent(array.get(i).getAsJsonObject(), owner)); 24642 } 24643 } 24644 ; 24645 } 24646 24647 protected Questionnaire.QuestionnaireItemEnableWhenComponent parseQuestionnaireQuestionnaireItemEnableWhenComponent( 24648 JsonObject json, Questionnaire owner) throws IOException, FHIRFormatError { 24649 Questionnaire.QuestionnaireItemEnableWhenComponent res = new Questionnaire.QuestionnaireItemEnableWhenComponent(); 24650 parseQuestionnaireQuestionnaireItemEnableWhenComponentProperties(json, owner, res); 24651 return res; 24652 } 24653 24654 protected void parseQuestionnaireQuestionnaireItemEnableWhenComponentProperties(JsonObject json, Questionnaire owner, 24655 Questionnaire.QuestionnaireItemEnableWhenComponent res) throws IOException, FHIRFormatError { 24656 parseBackboneElementProperties(json, res); 24657 if (json.has("question")) 24658 res.setQuestionElement(parseString(json.get("question").getAsString())); 24659 if (json.has("_question")) 24660 parseElementProperties(getJObject(json, "_question"), res.getQuestionElement()); 24661 if (json.has("operator")) 24662 res.setOperatorElement(parseEnumeration(json.get("operator").getAsString(), 24663 Questionnaire.QuestionnaireItemOperator.NULL, new Questionnaire.QuestionnaireItemOperatorEnumFactory())); 24664 if (json.has("_operator")) 24665 parseElementProperties(getJObject(json, "_operator"), res.getOperatorElement()); 24666 Type answer = parseType("answer", json); 24667 if (answer != null) 24668 res.setAnswer(answer); 24669 } 24670 24671 protected Questionnaire.QuestionnaireItemAnswerOptionComponent parseQuestionnaireQuestionnaireItemAnswerOptionComponent( 24672 JsonObject json, Questionnaire owner) throws IOException, FHIRFormatError { 24673 Questionnaire.QuestionnaireItemAnswerOptionComponent res = new Questionnaire.QuestionnaireItemAnswerOptionComponent(); 24674 parseQuestionnaireQuestionnaireItemAnswerOptionComponentProperties(json, owner, res); 24675 return res; 24676 } 24677 24678 protected void parseQuestionnaireQuestionnaireItemAnswerOptionComponentProperties(JsonObject json, 24679 Questionnaire owner, Questionnaire.QuestionnaireItemAnswerOptionComponent res) 24680 throws IOException, FHIRFormatError { 24681 parseBackboneElementProperties(json, res); 24682 Type value = parseType("value", json); 24683 if (value != null) 24684 res.setValue(value); 24685 if (json.has("initialSelected")) 24686 res.setInitialSelectedElement(parseBoolean(json.get("initialSelected").getAsBoolean())); 24687 if (json.has("_initialSelected")) 24688 parseElementProperties(getJObject(json, "_initialSelected"), res.getInitialSelectedElement()); 24689 } 24690 24691 protected Questionnaire.QuestionnaireItemInitialComponent parseQuestionnaireQuestionnaireItemInitialComponent( 24692 JsonObject json, Questionnaire owner) throws IOException, FHIRFormatError { 24693 Questionnaire.QuestionnaireItemInitialComponent res = new Questionnaire.QuestionnaireItemInitialComponent(); 24694 parseQuestionnaireQuestionnaireItemInitialComponentProperties(json, owner, res); 24695 return res; 24696 } 24697 24698 protected void parseQuestionnaireQuestionnaireItemInitialComponentProperties(JsonObject json, Questionnaire owner, 24699 Questionnaire.QuestionnaireItemInitialComponent res) throws IOException, FHIRFormatError { 24700 parseBackboneElementProperties(json, res); 24701 Type value = parseType("value", json); 24702 if (value != null) 24703 res.setValue(value); 24704 } 24705 24706 protected QuestionnaireResponse parseQuestionnaireResponse(JsonObject json) throws IOException, FHIRFormatError { 24707 QuestionnaireResponse res = new QuestionnaireResponse(); 24708 parseQuestionnaireResponseProperties(json, res); 24709 return res; 24710 } 24711 24712 protected void parseQuestionnaireResponseProperties(JsonObject json, QuestionnaireResponse res) 24713 throws IOException, FHIRFormatError { 24714 parseDomainResourceProperties(json, res); 24715 if (json.has("identifier")) 24716 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 24717 if (json.has("basedOn")) { 24718 JsonArray array = json.getAsJsonArray("basedOn"); 24719 for (int i = 0; i < array.size(); i++) { 24720 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 24721 } 24722 } 24723 ; 24724 if (json.has("partOf")) { 24725 JsonArray array = json.getAsJsonArray("partOf"); 24726 for (int i = 0; i < array.size(); i++) { 24727 res.getPartOf().add(parseReference(array.get(i).getAsJsonObject())); 24728 } 24729 } 24730 ; 24731 if (json.has("questionnaire")) 24732 res.setQuestionnaireElement(parseCanonical(json.get("questionnaire").getAsString())); 24733 if (json.has("_questionnaire")) 24734 parseElementProperties(getJObject(json, "_questionnaire"), res.getQuestionnaireElement()); 24735 if (json.has("status")) 24736 res.setStatusElement( 24737 parseEnumeration(json.get("status").getAsString(), QuestionnaireResponse.QuestionnaireResponseStatus.NULL, 24738 new QuestionnaireResponse.QuestionnaireResponseStatusEnumFactory())); 24739 if (json.has("_status")) 24740 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 24741 if (json.has("subject")) 24742 res.setSubject(parseReference(getJObject(json, "subject"))); 24743 if (json.has("encounter")) 24744 res.setEncounter(parseReference(getJObject(json, "encounter"))); 24745 if (json.has("authored")) 24746 res.setAuthoredElement(parseDateTime(json.get("authored").getAsString())); 24747 if (json.has("_authored")) 24748 parseElementProperties(getJObject(json, "_authored"), res.getAuthoredElement()); 24749 if (json.has("author")) 24750 res.setAuthor(parseReference(getJObject(json, "author"))); 24751 if (json.has("source")) 24752 res.setSource(parseReference(getJObject(json, "source"))); 24753 if (json.has("item")) { 24754 JsonArray array = json.getAsJsonArray("item"); 24755 for (int i = 0; i < array.size(); i++) { 24756 res.getItem() 24757 .add(parseQuestionnaireResponseQuestionnaireResponseItemComponent(array.get(i).getAsJsonObject(), res)); 24758 } 24759 } 24760 ; 24761 } 24762 24763 protected QuestionnaireResponse.QuestionnaireResponseItemComponent parseQuestionnaireResponseQuestionnaireResponseItemComponent( 24764 JsonObject json, QuestionnaireResponse owner) throws IOException, FHIRFormatError { 24765 QuestionnaireResponse.QuestionnaireResponseItemComponent res = new QuestionnaireResponse.QuestionnaireResponseItemComponent(); 24766 parseQuestionnaireResponseQuestionnaireResponseItemComponentProperties(json, owner, res); 24767 return res; 24768 } 24769 24770 protected void parseQuestionnaireResponseQuestionnaireResponseItemComponentProperties(JsonObject json, 24771 QuestionnaireResponse owner, QuestionnaireResponse.QuestionnaireResponseItemComponent res) 24772 throws IOException, FHIRFormatError { 24773 parseBackboneElementProperties(json, res); 24774 if (json.has("linkId")) 24775 res.setLinkIdElement(parseString(json.get("linkId").getAsString())); 24776 if (json.has("_linkId")) 24777 parseElementProperties(getJObject(json, "_linkId"), res.getLinkIdElement()); 24778 if (json.has("definition")) 24779 res.setDefinitionElement(parseUri(json.get("definition").getAsString())); 24780 if (json.has("_definition")) 24781 parseElementProperties(getJObject(json, "_definition"), res.getDefinitionElement()); 24782 if (json.has("text")) 24783 res.setTextElement(parseString(json.get("text").getAsString())); 24784 if (json.has("_text")) 24785 parseElementProperties(getJObject(json, "_text"), res.getTextElement()); 24786 if (json.has("answer")) { 24787 JsonArray array = json.getAsJsonArray("answer"); 24788 for (int i = 0; i < array.size(); i++) { 24789 res.getAnswer().add( 24790 parseQuestionnaireResponseQuestionnaireResponseItemAnswerComponent(array.get(i).getAsJsonObject(), owner)); 24791 } 24792 } 24793 ; 24794 if (json.has("item")) { 24795 JsonArray array = json.getAsJsonArray("item"); 24796 for (int i = 0; i < array.size(); i++) { 24797 res.getItem() 24798 .add(parseQuestionnaireResponseQuestionnaireResponseItemComponent(array.get(i).getAsJsonObject(), owner)); 24799 } 24800 } 24801 ; 24802 } 24803 24804 protected QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent parseQuestionnaireResponseQuestionnaireResponseItemAnswerComponent( 24805 JsonObject json, QuestionnaireResponse owner) throws IOException, FHIRFormatError { 24806 QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent res = new QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent(); 24807 parseQuestionnaireResponseQuestionnaireResponseItemAnswerComponentProperties(json, owner, res); 24808 return res; 24809 } 24810 24811 protected void parseQuestionnaireResponseQuestionnaireResponseItemAnswerComponentProperties(JsonObject json, 24812 QuestionnaireResponse owner, QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent res) 24813 throws IOException, FHIRFormatError { 24814 parseBackboneElementProperties(json, res); 24815 Type value = parseType("value", json); 24816 if (value != null) 24817 res.setValue(value); 24818 if (json.has("item")) { 24819 JsonArray array = json.getAsJsonArray("item"); 24820 for (int i = 0; i < array.size(); i++) { 24821 res.getItem() 24822 .add(parseQuestionnaireResponseQuestionnaireResponseItemComponent(array.get(i).getAsJsonObject(), owner)); 24823 } 24824 } 24825 ; 24826 } 24827 24828 protected RelatedPerson parseRelatedPerson(JsonObject json) throws IOException, FHIRFormatError { 24829 RelatedPerson res = new RelatedPerson(); 24830 parseRelatedPersonProperties(json, res); 24831 return res; 24832 } 24833 24834 protected void parseRelatedPersonProperties(JsonObject json, RelatedPerson res) throws IOException, FHIRFormatError { 24835 parseDomainResourceProperties(json, res); 24836 if (json.has("identifier")) { 24837 JsonArray array = json.getAsJsonArray("identifier"); 24838 for (int i = 0; i < array.size(); i++) { 24839 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 24840 } 24841 } 24842 ; 24843 if (json.has("active")) 24844 res.setActiveElement(parseBoolean(json.get("active").getAsBoolean())); 24845 if (json.has("_active")) 24846 parseElementProperties(getJObject(json, "_active"), res.getActiveElement()); 24847 if (json.has("patient")) 24848 res.setPatient(parseReference(getJObject(json, "patient"))); 24849 if (json.has("relationship")) { 24850 JsonArray array = json.getAsJsonArray("relationship"); 24851 for (int i = 0; i < array.size(); i++) { 24852 res.getRelationship().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 24853 } 24854 } 24855 ; 24856 if (json.has("name")) { 24857 JsonArray array = json.getAsJsonArray("name"); 24858 for (int i = 0; i < array.size(); i++) { 24859 res.getName().add(parseHumanName(array.get(i).getAsJsonObject())); 24860 } 24861 } 24862 ; 24863 if (json.has("telecom")) { 24864 JsonArray array = json.getAsJsonArray("telecom"); 24865 for (int i = 0; i < array.size(); i++) { 24866 res.getTelecom().add(parseContactPoint(array.get(i).getAsJsonObject())); 24867 } 24868 } 24869 ; 24870 if (json.has("gender")) 24871 res.setGenderElement(parseEnumeration(json.get("gender").getAsString(), Enumerations.AdministrativeGender.NULL, 24872 new Enumerations.AdministrativeGenderEnumFactory())); 24873 if (json.has("_gender")) 24874 parseElementProperties(getJObject(json, "_gender"), res.getGenderElement()); 24875 if (json.has("birthDate")) 24876 res.setBirthDateElement(parseDate(json.get("birthDate").getAsString())); 24877 if (json.has("_birthDate")) 24878 parseElementProperties(getJObject(json, "_birthDate"), res.getBirthDateElement()); 24879 if (json.has("address")) { 24880 JsonArray array = json.getAsJsonArray("address"); 24881 for (int i = 0; i < array.size(); i++) { 24882 res.getAddress().add(parseAddress(array.get(i).getAsJsonObject())); 24883 } 24884 } 24885 ; 24886 if (json.has("photo")) { 24887 JsonArray array = json.getAsJsonArray("photo"); 24888 for (int i = 0; i < array.size(); i++) { 24889 res.getPhoto().add(parseAttachment(array.get(i).getAsJsonObject())); 24890 } 24891 } 24892 ; 24893 if (json.has("period")) 24894 res.setPeriod(parsePeriod(getJObject(json, "period"))); 24895 if (json.has("communication")) { 24896 JsonArray array = json.getAsJsonArray("communication"); 24897 for (int i = 0; i < array.size(); i++) { 24898 res.getCommunication() 24899 .add(parseRelatedPersonRelatedPersonCommunicationComponent(array.get(i).getAsJsonObject(), res)); 24900 } 24901 } 24902 ; 24903 } 24904 24905 protected RelatedPerson.RelatedPersonCommunicationComponent parseRelatedPersonRelatedPersonCommunicationComponent( 24906 JsonObject json, RelatedPerson owner) throws IOException, FHIRFormatError { 24907 RelatedPerson.RelatedPersonCommunicationComponent res = new RelatedPerson.RelatedPersonCommunicationComponent(); 24908 parseRelatedPersonRelatedPersonCommunicationComponentProperties(json, owner, res); 24909 return res; 24910 } 24911 24912 protected void parseRelatedPersonRelatedPersonCommunicationComponentProperties(JsonObject json, RelatedPerson owner, 24913 RelatedPerson.RelatedPersonCommunicationComponent res) throws IOException, FHIRFormatError { 24914 parseBackboneElementProperties(json, res); 24915 if (json.has("language")) 24916 res.setLanguage(parseCodeableConcept(getJObject(json, "language"))); 24917 if (json.has("preferred")) 24918 res.setPreferredElement(parseBoolean(json.get("preferred").getAsBoolean())); 24919 if (json.has("_preferred")) 24920 parseElementProperties(getJObject(json, "_preferred"), res.getPreferredElement()); 24921 } 24922 24923 protected RequestGroup parseRequestGroup(JsonObject json) throws IOException, FHIRFormatError { 24924 RequestGroup res = new RequestGroup(); 24925 parseRequestGroupProperties(json, res); 24926 return res; 24927 } 24928 24929 protected void parseRequestGroupProperties(JsonObject json, RequestGroup res) throws IOException, FHIRFormatError { 24930 parseDomainResourceProperties(json, res); 24931 if (json.has("identifier")) { 24932 JsonArray array = json.getAsJsonArray("identifier"); 24933 for (int i = 0; i < array.size(); i++) { 24934 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 24935 } 24936 } 24937 ; 24938 if (json.has("instantiatesCanonical")) { 24939 JsonArray array = json.getAsJsonArray("instantiatesCanonical"); 24940 for (int i = 0; i < array.size(); i++) { 24941 if (array.get(i).isJsonNull()) { 24942 res.getInstantiatesCanonical().add(new CanonicalType()); 24943 } else { 24944 res.getInstantiatesCanonical().add(parseCanonical(array.get(i).getAsString())); 24945 } 24946 } 24947 } 24948 ; 24949 if (json.has("_instantiatesCanonical")) { 24950 JsonArray array = json.getAsJsonArray("_instantiatesCanonical"); 24951 for (int i = 0; i < array.size(); i++) { 24952 if (i == res.getInstantiatesCanonical().size()) 24953 res.getInstantiatesCanonical().add(parseCanonical(null)); 24954 if (array.get(i) instanceof JsonObject) 24955 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesCanonical().get(i)); 24956 } 24957 } 24958 ; 24959 if (json.has("instantiatesUri")) { 24960 JsonArray array = json.getAsJsonArray("instantiatesUri"); 24961 for (int i = 0; i < array.size(); i++) { 24962 if (array.get(i).isJsonNull()) { 24963 res.getInstantiatesUri().add(new UriType()); 24964 } else { 24965 res.getInstantiatesUri().add(parseUri(array.get(i).getAsString())); 24966 } 24967 } 24968 } 24969 ; 24970 if (json.has("_instantiatesUri")) { 24971 JsonArray array = json.getAsJsonArray("_instantiatesUri"); 24972 for (int i = 0; i < array.size(); i++) { 24973 if (i == res.getInstantiatesUri().size()) 24974 res.getInstantiatesUri().add(parseUri(null)); 24975 if (array.get(i) instanceof JsonObject) 24976 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesUri().get(i)); 24977 } 24978 } 24979 ; 24980 if (json.has("basedOn")) { 24981 JsonArray array = json.getAsJsonArray("basedOn"); 24982 for (int i = 0; i < array.size(); i++) { 24983 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 24984 } 24985 } 24986 ; 24987 if (json.has("replaces")) { 24988 JsonArray array = json.getAsJsonArray("replaces"); 24989 for (int i = 0; i < array.size(); i++) { 24990 res.getReplaces().add(parseReference(array.get(i).getAsJsonObject())); 24991 } 24992 } 24993 ; 24994 if (json.has("groupIdentifier")) 24995 res.setGroupIdentifier(parseIdentifier(getJObject(json, "groupIdentifier"))); 24996 if (json.has("status")) 24997 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), RequestGroup.RequestStatus.NULL, 24998 new RequestGroup.RequestStatusEnumFactory())); 24999 if (json.has("_status")) 25000 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 25001 if (json.has("intent")) 25002 res.setIntentElement(parseEnumeration(json.get("intent").getAsString(), RequestGroup.RequestIntent.NULL, 25003 new RequestGroup.RequestIntentEnumFactory())); 25004 if (json.has("_intent")) 25005 parseElementProperties(getJObject(json, "_intent"), res.getIntentElement()); 25006 if (json.has("priority")) 25007 res.setPriorityElement(parseEnumeration(json.get("priority").getAsString(), RequestGroup.RequestPriority.NULL, 25008 new RequestGroup.RequestPriorityEnumFactory())); 25009 if (json.has("_priority")) 25010 parseElementProperties(getJObject(json, "_priority"), res.getPriorityElement()); 25011 if (json.has("code")) 25012 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 25013 if (json.has("subject")) 25014 res.setSubject(parseReference(getJObject(json, "subject"))); 25015 if (json.has("encounter")) 25016 res.setEncounter(parseReference(getJObject(json, "encounter"))); 25017 if (json.has("authoredOn")) 25018 res.setAuthoredOnElement(parseDateTime(json.get("authoredOn").getAsString())); 25019 if (json.has("_authoredOn")) 25020 parseElementProperties(getJObject(json, "_authoredOn"), res.getAuthoredOnElement()); 25021 if (json.has("author")) 25022 res.setAuthor(parseReference(getJObject(json, "author"))); 25023 if (json.has("reasonCode")) { 25024 JsonArray array = json.getAsJsonArray("reasonCode"); 25025 for (int i = 0; i < array.size(); i++) { 25026 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 25027 } 25028 } 25029 ; 25030 if (json.has("reasonReference")) { 25031 JsonArray array = json.getAsJsonArray("reasonReference"); 25032 for (int i = 0; i < array.size(); i++) { 25033 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 25034 } 25035 } 25036 ; 25037 if (json.has("note")) { 25038 JsonArray array = json.getAsJsonArray("note"); 25039 for (int i = 0; i < array.size(); i++) { 25040 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 25041 } 25042 } 25043 ; 25044 if (json.has("action")) { 25045 JsonArray array = json.getAsJsonArray("action"); 25046 for (int i = 0; i < array.size(); i++) { 25047 res.getAction().add(parseRequestGroupRequestGroupActionComponent(array.get(i).getAsJsonObject(), res)); 25048 } 25049 } 25050 ; 25051 } 25052 25053 protected RequestGroup.RequestGroupActionComponent parseRequestGroupRequestGroupActionComponent(JsonObject json, 25054 RequestGroup owner) throws IOException, FHIRFormatError { 25055 RequestGroup.RequestGroupActionComponent res = new RequestGroup.RequestGroupActionComponent(); 25056 parseRequestGroupRequestGroupActionComponentProperties(json, owner, res); 25057 return res; 25058 } 25059 25060 protected void parseRequestGroupRequestGroupActionComponentProperties(JsonObject json, RequestGroup owner, 25061 RequestGroup.RequestGroupActionComponent res) throws IOException, FHIRFormatError { 25062 parseBackboneElementProperties(json, res); 25063 if (json.has("prefix")) 25064 res.setPrefixElement(parseString(json.get("prefix").getAsString())); 25065 if (json.has("_prefix")) 25066 parseElementProperties(getJObject(json, "_prefix"), res.getPrefixElement()); 25067 if (json.has("title")) 25068 res.setTitleElement(parseString(json.get("title").getAsString())); 25069 if (json.has("_title")) 25070 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 25071 if (json.has("description")) 25072 res.setDescriptionElement(parseString(json.get("description").getAsString())); 25073 if (json.has("_description")) 25074 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 25075 if (json.has("textEquivalent")) 25076 res.setTextEquivalentElement(parseString(json.get("textEquivalent").getAsString())); 25077 if (json.has("_textEquivalent")) 25078 parseElementProperties(getJObject(json, "_textEquivalent"), res.getTextEquivalentElement()); 25079 if (json.has("priority")) 25080 res.setPriorityElement(parseEnumeration(json.get("priority").getAsString(), RequestGroup.RequestPriority.NULL, 25081 new RequestGroup.RequestPriorityEnumFactory())); 25082 if (json.has("_priority")) 25083 parseElementProperties(getJObject(json, "_priority"), res.getPriorityElement()); 25084 if (json.has("code")) { 25085 JsonArray array = json.getAsJsonArray("code"); 25086 for (int i = 0; i < array.size(); i++) { 25087 res.getCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 25088 } 25089 } 25090 ; 25091 if (json.has("documentation")) { 25092 JsonArray array = json.getAsJsonArray("documentation"); 25093 for (int i = 0; i < array.size(); i++) { 25094 res.getDocumentation().add(parseRelatedArtifact(array.get(i).getAsJsonObject())); 25095 } 25096 } 25097 ; 25098 if (json.has("condition")) { 25099 JsonArray array = json.getAsJsonArray("condition"); 25100 for (int i = 0; i < array.size(); i++) { 25101 res.getCondition() 25102 .add(parseRequestGroupRequestGroupActionConditionComponent(array.get(i).getAsJsonObject(), owner)); 25103 } 25104 } 25105 ; 25106 if (json.has("relatedAction")) { 25107 JsonArray array = json.getAsJsonArray("relatedAction"); 25108 for (int i = 0; i < array.size(); i++) { 25109 res.getRelatedAction() 25110 .add(parseRequestGroupRequestGroupActionRelatedActionComponent(array.get(i).getAsJsonObject(), owner)); 25111 } 25112 } 25113 ; 25114 Type timing = parseType("timing", json); 25115 if (timing != null) 25116 res.setTiming(timing); 25117 if (json.has("participant")) { 25118 JsonArray array = json.getAsJsonArray("participant"); 25119 for (int i = 0; i < array.size(); i++) { 25120 res.getParticipant().add(parseReference(array.get(i).getAsJsonObject())); 25121 } 25122 } 25123 ; 25124 if (json.has("type")) 25125 res.setType(parseCodeableConcept(getJObject(json, "type"))); 25126 if (json.has("groupingBehavior")) 25127 res.setGroupingBehaviorElement(parseEnumeration(json.get("groupingBehavior").getAsString(), 25128 RequestGroup.ActionGroupingBehavior.NULL, new RequestGroup.ActionGroupingBehaviorEnumFactory())); 25129 if (json.has("_groupingBehavior")) 25130 parseElementProperties(getJObject(json, "_groupingBehavior"), res.getGroupingBehaviorElement()); 25131 if (json.has("selectionBehavior")) 25132 res.setSelectionBehaviorElement(parseEnumeration(json.get("selectionBehavior").getAsString(), 25133 RequestGroup.ActionSelectionBehavior.NULL, new RequestGroup.ActionSelectionBehaviorEnumFactory())); 25134 if (json.has("_selectionBehavior")) 25135 parseElementProperties(getJObject(json, "_selectionBehavior"), res.getSelectionBehaviorElement()); 25136 if (json.has("requiredBehavior")) 25137 res.setRequiredBehaviorElement(parseEnumeration(json.get("requiredBehavior").getAsString(), 25138 RequestGroup.ActionRequiredBehavior.NULL, new RequestGroup.ActionRequiredBehaviorEnumFactory())); 25139 if (json.has("_requiredBehavior")) 25140 parseElementProperties(getJObject(json, "_requiredBehavior"), res.getRequiredBehaviorElement()); 25141 if (json.has("precheckBehavior")) 25142 res.setPrecheckBehaviorElement(parseEnumeration(json.get("precheckBehavior").getAsString(), 25143 RequestGroup.ActionPrecheckBehavior.NULL, new RequestGroup.ActionPrecheckBehaviorEnumFactory())); 25144 if (json.has("_precheckBehavior")) 25145 parseElementProperties(getJObject(json, "_precheckBehavior"), res.getPrecheckBehaviorElement()); 25146 if (json.has("cardinalityBehavior")) 25147 res.setCardinalityBehaviorElement(parseEnumeration(json.get("cardinalityBehavior").getAsString(), 25148 RequestGroup.ActionCardinalityBehavior.NULL, new RequestGroup.ActionCardinalityBehaviorEnumFactory())); 25149 if (json.has("_cardinalityBehavior")) 25150 parseElementProperties(getJObject(json, "_cardinalityBehavior"), res.getCardinalityBehaviorElement()); 25151 if (json.has("resource")) 25152 res.setResource(parseReference(getJObject(json, "resource"))); 25153 if (json.has("action")) { 25154 JsonArray array = json.getAsJsonArray("action"); 25155 for (int i = 0; i < array.size(); i++) { 25156 res.getAction().add(parseRequestGroupRequestGroupActionComponent(array.get(i).getAsJsonObject(), owner)); 25157 } 25158 } 25159 ; 25160 } 25161 25162 protected RequestGroup.RequestGroupActionConditionComponent parseRequestGroupRequestGroupActionConditionComponent( 25163 JsonObject json, RequestGroup owner) throws IOException, FHIRFormatError { 25164 RequestGroup.RequestGroupActionConditionComponent res = new RequestGroup.RequestGroupActionConditionComponent(); 25165 parseRequestGroupRequestGroupActionConditionComponentProperties(json, owner, res); 25166 return res; 25167 } 25168 25169 protected void parseRequestGroupRequestGroupActionConditionComponentProperties(JsonObject json, RequestGroup owner, 25170 RequestGroup.RequestGroupActionConditionComponent res) throws IOException, FHIRFormatError { 25171 parseBackboneElementProperties(json, res); 25172 if (json.has("kind")) 25173 res.setKindElement(parseEnumeration(json.get("kind").getAsString(), RequestGroup.ActionConditionKind.NULL, 25174 new RequestGroup.ActionConditionKindEnumFactory())); 25175 if (json.has("_kind")) 25176 parseElementProperties(getJObject(json, "_kind"), res.getKindElement()); 25177 if (json.has("expression")) 25178 res.setExpression(parseExpression(getJObject(json, "expression"))); 25179 } 25180 25181 protected RequestGroup.RequestGroupActionRelatedActionComponent parseRequestGroupRequestGroupActionRelatedActionComponent( 25182 JsonObject json, RequestGroup owner) throws IOException, FHIRFormatError { 25183 RequestGroup.RequestGroupActionRelatedActionComponent res = new RequestGroup.RequestGroupActionRelatedActionComponent(); 25184 parseRequestGroupRequestGroupActionRelatedActionComponentProperties(json, owner, res); 25185 return res; 25186 } 25187 25188 protected void parseRequestGroupRequestGroupActionRelatedActionComponentProperties(JsonObject json, 25189 RequestGroup owner, RequestGroup.RequestGroupActionRelatedActionComponent res) 25190 throws IOException, FHIRFormatError { 25191 parseBackboneElementProperties(json, res); 25192 if (json.has("actionId")) 25193 res.setActionIdElement(parseId(json.get("actionId").getAsString())); 25194 if (json.has("_actionId")) 25195 parseElementProperties(getJObject(json, "_actionId"), res.getActionIdElement()); 25196 if (json.has("relationship")) 25197 res.setRelationshipElement(parseEnumeration(json.get("relationship").getAsString(), 25198 RequestGroup.ActionRelationshipType.NULL, new RequestGroup.ActionRelationshipTypeEnumFactory())); 25199 if (json.has("_relationship")) 25200 parseElementProperties(getJObject(json, "_relationship"), res.getRelationshipElement()); 25201 Type offset = parseType("offset", json); 25202 if (offset != null) 25203 res.setOffset(offset); 25204 } 25205 25206 protected ResearchDefinition parseResearchDefinition(JsonObject json) throws IOException, FHIRFormatError { 25207 ResearchDefinition res = new ResearchDefinition(); 25208 parseResearchDefinitionProperties(json, res); 25209 return res; 25210 } 25211 25212 protected void parseResearchDefinitionProperties(JsonObject json, ResearchDefinition res) 25213 throws IOException, FHIRFormatError { 25214 parseDomainResourceProperties(json, res); 25215 if (json.has("url")) 25216 res.setUrlElement(parseUri(json.get("url").getAsString())); 25217 if (json.has("_url")) 25218 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 25219 if (json.has("identifier")) { 25220 JsonArray array = json.getAsJsonArray("identifier"); 25221 for (int i = 0; i < array.size(); i++) { 25222 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 25223 } 25224 } 25225 ; 25226 if (json.has("version")) 25227 res.setVersionElement(parseString(json.get("version").getAsString())); 25228 if (json.has("_version")) 25229 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 25230 if (json.has("name")) 25231 res.setNameElement(parseString(json.get("name").getAsString())); 25232 if (json.has("_name")) 25233 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 25234 if (json.has("title")) 25235 res.setTitleElement(parseString(json.get("title").getAsString())); 25236 if (json.has("_title")) 25237 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 25238 if (json.has("shortTitle")) 25239 res.setShortTitleElement(parseString(json.get("shortTitle").getAsString())); 25240 if (json.has("_shortTitle")) 25241 parseElementProperties(getJObject(json, "_shortTitle"), res.getShortTitleElement()); 25242 if (json.has("subtitle")) 25243 res.setSubtitleElement(parseString(json.get("subtitle").getAsString())); 25244 if (json.has("_subtitle")) 25245 parseElementProperties(getJObject(json, "_subtitle"), res.getSubtitleElement()); 25246 if (json.has("status")) 25247 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 25248 new Enumerations.PublicationStatusEnumFactory())); 25249 if (json.has("_status")) 25250 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 25251 if (json.has("experimental")) 25252 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 25253 if (json.has("_experimental")) 25254 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 25255 Type subject = parseType("subject", json); 25256 if (subject != null) 25257 res.setSubject(subject); 25258 if (json.has("date")) 25259 res.setDateElement(parseDateTime(json.get("date").getAsString())); 25260 if (json.has("_date")) 25261 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 25262 if (json.has("publisher")) 25263 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 25264 if (json.has("_publisher")) 25265 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 25266 if (json.has("contact")) { 25267 JsonArray array = json.getAsJsonArray("contact"); 25268 for (int i = 0; i < array.size(); i++) { 25269 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 25270 } 25271 } 25272 ; 25273 if (json.has("description")) 25274 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 25275 if (json.has("_description")) 25276 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 25277 if (json.has("comment")) { 25278 JsonArray array = json.getAsJsonArray("comment"); 25279 for (int i = 0; i < array.size(); i++) { 25280 if (array.get(i).isJsonNull()) { 25281 res.getComment().add(new StringType()); 25282 } else { 25283 res.getComment().add(parseString(array.get(i).getAsString())); 25284 } 25285 } 25286 } 25287 ; 25288 if (json.has("_comment")) { 25289 JsonArray array = json.getAsJsonArray("_comment"); 25290 for (int i = 0; i < array.size(); i++) { 25291 if (i == res.getComment().size()) 25292 res.getComment().add(parseString(null)); 25293 if (array.get(i) instanceof JsonObject) 25294 parseElementProperties(array.get(i).getAsJsonObject(), res.getComment().get(i)); 25295 } 25296 } 25297 ; 25298 if (json.has("useContext")) { 25299 JsonArray array = json.getAsJsonArray("useContext"); 25300 for (int i = 0; i < array.size(); i++) { 25301 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 25302 } 25303 } 25304 ; 25305 if (json.has("jurisdiction")) { 25306 JsonArray array = json.getAsJsonArray("jurisdiction"); 25307 for (int i = 0; i < array.size(); i++) { 25308 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 25309 } 25310 } 25311 ; 25312 if (json.has("purpose")) 25313 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 25314 if (json.has("_purpose")) 25315 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 25316 if (json.has("usage")) 25317 res.setUsageElement(parseString(json.get("usage").getAsString())); 25318 if (json.has("_usage")) 25319 parseElementProperties(getJObject(json, "_usage"), res.getUsageElement()); 25320 if (json.has("copyright")) 25321 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 25322 if (json.has("_copyright")) 25323 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 25324 if (json.has("approvalDate")) 25325 res.setApprovalDateElement(parseDate(json.get("approvalDate").getAsString())); 25326 if (json.has("_approvalDate")) 25327 parseElementProperties(getJObject(json, "_approvalDate"), res.getApprovalDateElement()); 25328 if (json.has("lastReviewDate")) 25329 res.setLastReviewDateElement(parseDate(json.get("lastReviewDate").getAsString())); 25330 if (json.has("_lastReviewDate")) 25331 parseElementProperties(getJObject(json, "_lastReviewDate"), res.getLastReviewDateElement()); 25332 if (json.has("effectivePeriod")) 25333 res.setEffectivePeriod(parsePeriod(getJObject(json, "effectivePeriod"))); 25334 if (json.has("topic")) { 25335 JsonArray array = json.getAsJsonArray("topic"); 25336 for (int i = 0; i < array.size(); i++) { 25337 res.getTopic().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 25338 } 25339 } 25340 ; 25341 if (json.has("author")) { 25342 JsonArray array = json.getAsJsonArray("author"); 25343 for (int i = 0; i < array.size(); i++) { 25344 res.getAuthor().add(parseContactDetail(array.get(i).getAsJsonObject())); 25345 } 25346 } 25347 ; 25348 if (json.has("editor")) { 25349 JsonArray array = json.getAsJsonArray("editor"); 25350 for (int i = 0; i < array.size(); i++) { 25351 res.getEditor().add(parseContactDetail(array.get(i).getAsJsonObject())); 25352 } 25353 } 25354 ; 25355 if (json.has("reviewer")) { 25356 JsonArray array = json.getAsJsonArray("reviewer"); 25357 for (int i = 0; i < array.size(); i++) { 25358 res.getReviewer().add(parseContactDetail(array.get(i).getAsJsonObject())); 25359 } 25360 } 25361 ; 25362 if (json.has("endorser")) { 25363 JsonArray array = json.getAsJsonArray("endorser"); 25364 for (int i = 0; i < array.size(); i++) { 25365 res.getEndorser().add(parseContactDetail(array.get(i).getAsJsonObject())); 25366 } 25367 } 25368 ; 25369 if (json.has("relatedArtifact")) { 25370 JsonArray array = json.getAsJsonArray("relatedArtifact"); 25371 for (int i = 0; i < array.size(); i++) { 25372 res.getRelatedArtifact().add(parseRelatedArtifact(array.get(i).getAsJsonObject())); 25373 } 25374 } 25375 ; 25376 if (json.has("library")) { 25377 JsonArray array = json.getAsJsonArray("library"); 25378 for (int i = 0; i < array.size(); i++) { 25379 if (array.get(i).isJsonNull()) { 25380 res.getLibrary().add(new CanonicalType()); 25381 } else { 25382 res.getLibrary().add(parseCanonical(array.get(i).getAsString())); 25383 } 25384 } 25385 } 25386 ; 25387 if (json.has("_library")) { 25388 JsonArray array = json.getAsJsonArray("_library"); 25389 for (int i = 0; i < array.size(); i++) { 25390 if (i == res.getLibrary().size()) 25391 res.getLibrary().add(parseCanonical(null)); 25392 if (array.get(i) instanceof JsonObject) 25393 parseElementProperties(array.get(i).getAsJsonObject(), res.getLibrary().get(i)); 25394 } 25395 } 25396 ; 25397 if (json.has("population")) 25398 res.setPopulation(parseReference(getJObject(json, "population"))); 25399 if (json.has("exposure")) 25400 res.setExposure(parseReference(getJObject(json, "exposure"))); 25401 if (json.has("exposureAlternative")) 25402 res.setExposureAlternative(parseReference(getJObject(json, "exposureAlternative"))); 25403 if (json.has("outcome")) 25404 res.setOutcome(parseReference(getJObject(json, "outcome"))); 25405 } 25406 25407 protected ResearchElementDefinition parseResearchElementDefinition(JsonObject json) 25408 throws IOException, FHIRFormatError { 25409 ResearchElementDefinition res = new ResearchElementDefinition(); 25410 parseResearchElementDefinitionProperties(json, res); 25411 return res; 25412 } 25413 25414 protected void parseResearchElementDefinitionProperties(JsonObject json, ResearchElementDefinition res) 25415 throws IOException, FHIRFormatError { 25416 parseDomainResourceProperties(json, res); 25417 if (json.has("url")) 25418 res.setUrlElement(parseUri(json.get("url").getAsString())); 25419 if (json.has("_url")) 25420 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 25421 if (json.has("identifier")) { 25422 JsonArray array = json.getAsJsonArray("identifier"); 25423 for (int i = 0; i < array.size(); i++) { 25424 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 25425 } 25426 } 25427 ; 25428 if (json.has("version")) 25429 res.setVersionElement(parseString(json.get("version").getAsString())); 25430 if (json.has("_version")) 25431 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 25432 if (json.has("name")) 25433 res.setNameElement(parseString(json.get("name").getAsString())); 25434 if (json.has("_name")) 25435 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 25436 if (json.has("title")) 25437 res.setTitleElement(parseString(json.get("title").getAsString())); 25438 if (json.has("_title")) 25439 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 25440 if (json.has("shortTitle")) 25441 res.setShortTitleElement(parseString(json.get("shortTitle").getAsString())); 25442 if (json.has("_shortTitle")) 25443 parseElementProperties(getJObject(json, "_shortTitle"), res.getShortTitleElement()); 25444 if (json.has("subtitle")) 25445 res.setSubtitleElement(parseString(json.get("subtitle").getAsString())); 25446 if (json.has("_subtitle")) 25447 parseElementProperties(getJObject(json, "_subtitle"), res.getSubtitleElement()); 25448 if (json.has("status")) 25449 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 25450 new Enumerations.PublicationStatusEnumFactory())); 25451 if (json.has("_status")) 25452 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 25453 if (json.has("experimental")) 25454 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 25455 if (json.has("_experimental")) 25456 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 25457 Type subject = parseType("subject", json); 25458 if (subject != null) 25459 res.setSubject(subject); 25460 if (json.has("date")) 25461 res.setDateElement(parseDateTime(json.get("date").getAsString())); 25462 if (json.has("_date")) 25463 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 25464 if (json.has("publisher")) 25465 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 25466 if (json.has("_publisher")) 25467 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 25468 if (json.has("contact")) { 25469 JsonArray array = json.getAsJsonArray("contact"); 25470 for (int i = 0; i < array.size(); i++) { 25471 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 25472 } 25473 } 25474 ; 25475 if (json.has("description")) 25476 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 25477 if (json.has("_description")) 25478 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 25479 if (json.has("comment")) { 25480 JsonArray array = json.getAsJsonArray("comment"); 25481 for (int i = 0; i < array.size(); i++) { 25482 if (array.get(i).isJsonNull()) { 25483 res.getComment().add(new StringType()); 25484 } else { 25485 res.getComment().add(parseString(array.get(i).getAsString())); 25486 } 25487 } 25488 } 25489 ; 25490 if (json.has("_comment")) { 25491 JsonArray array = json.getAsJsonArray("_comment"); 25492 for (int i = 0; i < array.size(); i++) { 25493 if (i == res.getComment().size()) 25494 res.getComment().add(parseString(null)); 25495 if (array.get(i) instanceof JsonObject) 25496 parseElementProperties(array.get(i).getAsJsonObject(), res.getComment().get(i)); 25497 } 25498 } 25499 ; 25500 if (json.has("useContext")) { 25501 JsonArray array = json.getAsJsonArray("useContext"); 25502 for (int i = 0; i < array.size(); i++) { 25503 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 25504 } 25505 } 25506 ; 25507 if (json.has("jurisdiction")) { 25508 JsonArray array = json.getAsJsonArray("jurisdiction"); 25509 for (int i = 0; i < array.size(); i++) { 25510 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 25511 } 25512 } 25513 ; 25514 if (json.has("purpose")) 25515 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 25516 if (json.has("_purpose")) 25517 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 25518 if (json.has("usage")) 25519 res.setUsageElement(parseString(json.get("usage").getAsString())); 25520 if (json.has("_usage")) 25521 parseElementProperties(getJObject(json, "_usage"), res.getUsageElement()); 25522 if (json.has("copyright")) 25523 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 25524 if (json.has("_copyright")) 25525 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 25526 if (json.has("approvalDate")) 25527 res.setApprovalDateElement(parseDate(json.get("approvalDate").getAsString())); 25528 if (json.has("_approvalDate")) 25529 parseElementProperties(getJObject(json, "_approvalDate"), res.getApprovalDateElement()); 25530 if (json.has("lastReviewDate")) 25531 res.setLastReviewDateElement(parseDate(json.get("lastReviewDate").getAsString())); 25532 if (json.has("_lastReviewDate")) 25533 parseElementProperties(getJObject(json, "_lastReviewDate"), res.getLastReviewDateElement()); 25534 if (json.has("effectivePeriod")) 25535 res.setEffectivePeriod(parsePeriod(getJObject(json, "effectivePeriod"))); 25536 if (json.has("topic")) { 25537 JsonArray array = json.getAsJsonArray("topic"); 25538 for (int i = 0; i < array.size(); i++) { 25539 res.getTopic().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 25540 } 25541 } 25542 ; 25543 if (json.has("author")) { 25544 JsonArray array = json.getAsJsonArray("author"); 25545 for (int i = 0; i < array.size(); i++) { 25546 res.getAuthor().add(parseContactDetail(array.get(i).getAsJsonObject())); 25547 } 25548 } 25549 ; 25550 if (json.has("editor")) { 25551 JsonArray array = json.getAsJsonArray("editor"); 25552 for (int i = 0; i < array.size(); i++) { 25553 res.getEditor().add(parseContactDetail(array.get(i).getAsJsonObject())); 25554 } 25555 } 25556 ; 25557 if (json.has("reviewer")) { 25558 JsonArray array = json.getAsJsonArray("reviewer"); 25559 for (int i = 0; i < array.size(); i++) { 25560 res.getReviewer().add(parseContactDetail(array.get(i).getAsJsonObject())); 25561 } 25562 } 25563 ; 25564 if (json.has("endorser")) { 25565 JsonArray array = json.getAsJsonArray("endorser"); 25566 for (int i = 0; i < array.size(); i++) { 25567 res.getEndorser().add(parseContactDetail(array.get(i).getAsJsonObject())); 25568 } 25569 } 25570 ; 25571 if (json.has("relatedArtifact")) { 25572 JsonArray array = json.getAsJsonArray("relatedArtifact"); 25573 for (int i = 0; i < array.size(); i++) { 25574 res.getRelatedArtifact().add(parseRelatedArtifact(array.get(i).getAsJsonObject())); 25575 } 25576 } 25577 ; 25578 if (json.has("library")) { 25579 JsonArray array = json.getAsJsonArray("library"); 25580 for (int i = 0; i < array.size(); i++) { 25581 if (array.get(i).isJsonNull()) { 25582 res.getLibrary().add(new CanonicalType()); 25583 } else { 25584 res.getLibrary().add(parseCanonical(array.get(i).getAsString())); 25585 } 25586 } 25587 } 25588 ; 25589 if (json.has("_library")) { 25590 JsonArray array = json.getAsJsonArray("_library"); 25591 for (int i = 0; i < array.size(); i++) { 25592 if (i == res.getLibrary().size()) 25593 res.getLibrary().add(parseCanonical(null)); 25594 if (array.get(i) instanceof JsonObject) 25595 parseElementProperties(array.get(i).getAsJsonObject(), res.getLibrary().get(i)); 25596 } 25597 } 25598 ; 25599 if (json.has("type")) 25600 res.setTypeElement( 25601 parseEnumeration(json.get("type").getAsString(), ResearchElementDefinition.ResearchElementType.NULL, 25602 new ResearchElementDefinition.ResearchElementTypeEnumFactory())); 25603 if (json.has("_type")) 25604 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 25605 if (json.has("variableType")) 25606 res.setVariableTypeElement(parseEnumeration(json.get("variableType").getAsString(), 25607 ResearchElementDefinition.VariableType.NULL, new ResearchElementDefinition.VariableTypeEnumFactory())); 25608 if (json.has("_variableType")) 25609 parseElementProperties(getJObject(json, "_variableType"), res.getVariableTypeElement()); 25610 if (json.has("characteristic")) { 25611 JsonArray array = json.getAsJsonArray("characteristic"); 25612 for (int i = 0; i < array.size(); i++) { 25613 res.getCharacteristic().add(parseResearchElementDefinitionResearchElementDefinitionCharacteristicComponent( 25614 array.get(i).getAsJsonObject(), res)); 25615 } 25616 } 25617 ; 25618 } 25619 25620 protected ResearchElementDefinition.ResearchElementDefinitionCharacteristicComponent parseResearchElementDefinitionResearchElementDefinitionCharacteristicComponent( 25621 JsonObject json, ResearchElementDefinition owner) throws IOException, FHIRFormatError { 25622 ResearchElementDefinition.ResearchElementDefinitionCharacteristicComponent res = new ResearchElementDefinition.ResearchElementDefinitionCharacteristicComponent(); 25623 parseResearchElementDefinitionResearchElementDefinitionCharacteristicComponentProperties(json, owner, res); 25624 return res; 25625 } 25626 25627 protected void parseResearchElementDefinitionResearchElementDefinitionCharacteristicComponentProperties( 25628 JsonObject json, ResearchElementDefinition owner, 25629 ResearchElementDefinition.ResearchElementDefinitionCharacteristicComponent res) 25630 throws IOException, FHIRFormatError { 25631 parseBackboneElementProperties(json, res); 25632 Type definition = parseType("definition", json); 25633 if (definition != null) 25634 res.setDefinition(definition); 25635 if (json.has("usageContext")) { 25636 JsonArray array = json.getAsJsonArray("usageContext"); 25637 for (int i = 0; i < array.size(); i++) { 25638 res.getUsageContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 25639 } 25640 } 25641 ; 25642 if (json.has("exclude")) 25643 res.setExcludeElement(parseBoolean(json.get("exclude").getAsBoolean())); 25644 if (json.has("_exclude")) 25645 parseElementProperties(getJObject(json, "_exclude"), res.getExcludeElement()); 25646 if (json.has("unitOfMeasure")) 25647 res.setUnitOfMeasure(parseCodeableConcept(getJObject(json, "unitOfMeasure"))); 25648 if (json.has("studyEffectiveDescription")) 25649 res.setStudyEffectiveDescriptionElement(parseString(json.get("studyEffectiveDescription").getAsString())); 25650 if (json.has("_studyEffectiveDescription")) 25651 parseElementProperties(getJObject(json, "_studyEffectiveDescription"), res.getStudyEffectiveDescriptionElement()); 25652 Type studyEffective = parseType("studyEffective", json); 25653 if (studyEffective != null) 25654 res.setStudyEffective(studyEffective); 25655 if (json.has("studyEffectiveTimeFromStart")) 25656 res.setStudyEffectiveTimeFromStart(parseDuration(getJObject(json, "studyEffectiveTimeFromStart"))); 25657 if (json.has("studyEffectiveGroupMeasure")) 25658 res.setStudyEffectiveGroupMeasureElement(parseEnumeration(json.get("studyEffectiveGroupMeasure").getAsString(), 25659 ResearchElementDefinition.GroupMeasure.NULL, new ResearchElementDefinition.GroupMeasureEnumFactory())); 25660 if (json.has("_studyEffectiveGroupMeasure")) 25661 parseElementProperties(getJObject(json, "_studyEffectiveGroupMeasure"), 25662 res.getStudyEffectiveGroupMeasureElement()); 25663 if (json.has("participantEffectiveDescription")) 25664 res.setParticipantEffectiveDescriptionElement( 25665 parseString(json.get("participantEffectiveDescription").getAsString())); 25666 if (json.has("_participantEffectiveDescription")) 25667 parseElementProperties(getJObject(json, "_participantEffectiveDescription"), 25668 res.getParticipantEffectiveDescriptionElement()); 25669 Type participantEffective = parseType("participantEffective", json); 25670 if (participantEffective != null) 25671 res.setParticipantEffective(participantEffective); 25672 if (json.has("participantEffectiveTimeFromStart")) 25673 res.setParticipantEffectiveTimeFromStart(parseDuration(getJObject(json, "participantEffectiveTimeFromStart"))); 25674 if (json.has("participantEffectiveGroupMeasure")) 25675 res.setParticipantEffectiveGroupMeasureElement( 25676 parseEnumeration(json.get("participantEffectiveGroupMeasure").getAsString(), 25677 ResearchElementDefinition.GroupMeasure.NULL, new ResearchElementDefinition.GroupMeasureEnumFactory())); 25678 if (json.has("_participantEffectiveGroupMeasure")) 25679 parseElementProperties(getJObject(json, "_participantEffectiveGroupMeasure"), 25680 res.getParticipantEffectiveGroupMeasureElement()); 25681 } 25682 25683 protected ResearchStudy parseResearchStudy(JsonObject json) throws IOException, FHIRFormatError { 25684 ResearchStudy res = new ResearchStudy(); 25685 parseResearchStudyProperties(json, res); 25686 return res; 25687 } 25688 25689 protected void parseResearchStudyProperties(JsonObject json, ResearchStudy res) throws IOException, FHIRFormatError { 25690 parseDomainResourceProperties(json, res); 25691 if (json.has("identifier")) { 25692 JsonArray array = json.getAsJsonArray("identifier"); 25693 for (int i = 0; i < array.size(); i++) { 25694 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 25695 } 25696 } 25697 ; 25698 if (json.has("title")) 25699 res.setTitleElement(parseString(json.get("title").getAsString())); 25700 if (json.has("_title")) 25701 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 25702 if (json.has("protocol")) { 25703 JsonArray array = json.getAsJsonArray("protocol"); 25704 for (int i = 0; i < array.size(); i++) { 25705 res.getProtocol().add(parseReference(array.get(i).getAsJsonObject())); 25706 } 25707 } 25708 ; 25709 if (json.has("partOf")) { 25710 JsonArray array = json.getAsJsonArray("partOf"); 25711 for (int i = 0; i < array.size(); i++) { 25712 res.getPartOf().add(parseReference(array.get(i).getAsJsonObject())); 25713 } 25714 } 25715 ; 25716 if (json.has("status")) 25717 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), ResearchStudy.ResearchStudyStatus.NULL, 25718 new ResearchStudy.ResearchStudyStatusEnumFactory())); 25719 if (json.has("_status")) 25720 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 25721 if (json.has("primaryPurposeType")) 25722 res.setPrimaryPurposeType(parseCodeableConcept(getJObject(json, "primaryPurposeType"))); 25723 if (json.has("phase")) 25724 res.setPhase(parseCodeableConcept(getJObject(json, "phase"))); 25725 if (json.has("category")) { 25726 JsonArray array = json.getAsJsonArray("category"); 25727 for (int i = 0; i < array.size(); i++) { 25728 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 25729 } 25730 } 25731 ; 25732 if (json.has("focus")) { 25733 JsonArray array = json.getAsJsonArray("focus"); 25734 for (int i = 0; i < array.size(); i++) { 25735 res.getFocus().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 25736 } 25737 } 25738 ; 25739 if (json.has("condition")) { 25740 JsonArray array = json.getAsJsonArray("condition"); 25741 for (int i = 0; i < array.size(); i++) { 25742 res.getCondition().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 25743 } 25744 } 25745 ; 25746 if (json.has("contact")) { 25747 JsonArray array = json.getAsJsonArray("contact"); 25748 for (int i = 0; i < array.size(); i++) { 25749 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 25750 } 25751 } 25752 ; 25753 if (json.has("relatedArtifact")) { 25754 JsonArray array = json.getAsJsonArray("relatedArtifact"); 25755 for (int i = 0; i < array.size(); i++) { 25756 res.getRelatedArtifact().add(parseRelatedArtifact(array.get(i).getAsJsonObject())); 25757 } 25758 } 25759 ; 25760 if (json.has("keyword")) { 25761 JsonArray array = json.getAsJsonArray("keyword"); 25762 for (int i = 0; i < array.size(); i++) { 25763 res.getKeyword().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 25764 } 25765 } 25766 ; 25767 if (json.has("location")) { 25768 JsonArray array = json.getAsJsonArray("location"); 25769 for (int i = 0; i < array.size(); i++) { 25770 res.getLocation().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 25771 } 25772 } 25773 ; 25774 if (json.has("description")) 25775 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 25776 if (json.has("_description")) 25777 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 25778 if (json.has("enrollment")) { 25779 JsonArray array = json.getAsJsonArray("enrollment"); 25780 for (int i = 0; i < array.size(); i++) { 25781 res.getEnrollment().add(parseReference(array.get(i).getAsJsonObject())); 25782 } 25783 } 25784 ; 25785 if (json.has("period")) 25786 res.setPeriod(parsePeriod(getJObject(json, "period"))); 25787 if (json.has("sponsor")) 25788 res.setSponsor(parseReference(getJObject(json, "sponsor"))); 25789 if (json.has("principalInvestigator")) 25790 res.setPrincipalInvestigator(parseReference(getJObject(json, "principalInvestigator"))); 25791 if (json.has("site")) { 25792 JsonArray array = json.getAsJsonArray("site"); 25793 for (int i = 0; i < array.size(); i++) { 25794 res.getSite().add(parseReference(array.get(i).getAsJsonObject())); 25795 } 25796 } 25797 ; 25798 if (json.has("reasonStopped")) 25799 res.setReasonStopped(parseCodeableConcept(getJObject(json, "reasonStopped"))); 25800 if (json.has("note")) { 25801 JsonArray array = json.getAsJsonArray("note"); 25802 for (int i = 0; i < array.size(); i++) { 25803 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 25804 } 25805 } 25806 ; 25807 if (json.has("arm")) { 25808 JsonArray array = json.getAsJsonArray("arm"); 25809 for (int i = 0; i < array.size(); i++) { 25810 res.getArm().add(parseResearchStudyResearchStudyArmComponent(array.get(i).getAsJsonObject(), res)); 25811 } 25812 } 25813 ; 25814 if (json.has("objective")) { 25815 JsonArray array = json.getAsJsonArray("objective"); 25816 for (int i = 0; i < array.size(); i++) { 25817 res.getObjective().add(parseResearchStudyResearchStudyObjectiveComponent(array.get(i).getAsJsonObject(), res)); 25818 } 25819 } 25820 ; 25821 } 25822 25823 protected ResearchStudy.ResearchStudyArmComponent parseResearchStudyResearchStudyArmComponent(JsonObject json, 25824 ResearchStudy owner) throws IOException, FHIRFormatError { 25825 ResearchStudy.ResearchStudyArmComponent res = new ResearchStudy.ResearchStudyArmComponent(); 25826 parseResearchStudyResearchStudyArmComponentProperties(json, owner, res); 25827 return res; 25828 } 25829 25830 protected void parseResearchStudyResearchStudyArmComponentProperties(JsonObject json, ResearchStudy owner, 25831 ResearchStudy.ResearchStudyArmComponent res) throws IOException, FHIRFormatError { 25832 parseBackboneElementProperties(json, res); 25833 if (json.has("name")) 25834 res.setNameElement(parseString(json.get("name").getAsString())); 25835 if (json.has("_name")) 25836 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 25837 if (json.has("type")) 25838 res.setType(parseCodeableConcept(getJObject(json, "type"))); 25839 if (json.has("description")) 25840 res.setDescriptionElement(parseString(json.get("description").getAsString())); 25841 if (json.has("_description")) 25842 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 25843 } 25844 25845 protected ResearchStudy.ResearchStudyObjectiveComponent parseResearchStudyResearchStudyObjectiveComponent( 25846 JsonObject json, ResearchStudy owner) throws IOException, FHIRFormatError { 25847 ResearchStudy.ResearchStudyObjectiveComponent res = new ResearchStudy.ResearchStudyObjectiveComponent(); 25848 parseResearchStudyResearchStudyObjectiveComponentProperties(json, owner, res); 25849 return res; 25850 } 25851 25852 protected void parseResearchStudyResearchStudyObjectiveComponentProperties(JsonObject json, ResearchStudy owner, 25853 ResearchStudy.ResearchStudyObjectiveComponent res) throws IOException, FHIRFormatError { 25854 parseBackboneElementProperties(json, res); 25855 if (json.has("name")) 25856 res.setNameElement(parseString(json.get("name").getAsString())); 25857 if (json.has("_name")) 25858 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 25859 if (json.has("type")) 25860 res.setType(parseCodeableConcept(getJObject(json, "type"))); 25861 } 25862 25863 protected ResearchSubject parseResearchSubject(JsonObject json) throws IOException, FHIRFormatError { 25864 ResearchSubject res = new ResearchSubject(); 25865 parseResearchSubjectProperties(json, res); 25866 return res; 25867 } 25868 25869 protected void parseResearchSubjectProperties(JsonObject json, ResearchSubject res) 25870 throws IOException, FHIRFormatError { 25871 parseDomainResourceProperties(json, res); 25872 if (json.has("identifier")) { 25873 JsonArray array = json.getAsJsonArray("identifier"); 25874 for (int i = 0; i < array.size(); i++) { 25875 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 25876 } 25877 } 25878 ; 25879 if (json.has("status")) 25880 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), 25881 ResearchSubject.ResearchSubjectStatus.NULL, new ResearchSubject.ResearchSubjectStatusEnumFactory())); 25882 if (json.has("_status")) 25883 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 25884 if (json.has("period")) 25885 res.setPeriod(parsePeriod(getJObject(json, "period"))); 25886 if (json.has("study")) 25887 res.setStudy(parseReference(getJObject(json, "study"))); 25888 if (json.has("individual")) 25889 res.setIndividual(parseReference(getJObject(json, "individual"))); 25890 if (json.has("assignedArm")) 25891 res.setAssignedArmElement(parseString(json.get("assignedArm").getAsString())); 25892 if (json.has("_assignedArm")) 25893 parseElementProperties(getJObject(json, "_assignedArm"), res.getAssignedArmElement()); 25894 if (json.has("actualArm")) 25895 res.setActualArmElement(parseString(json.get("actualArm").getAsString())); 25896 if (json.has("_actualArm")) 25897 parseElementProperties(getJObject(json, "_actualArm"), res.getActualArmElement()); 25898 if (json.has("consent")) 25899 res.setConsent(parseReference(getJObject(json, "consent"))); 25900 } 25901 25902 protected RiskAssessment parseRiskAssessment(JsonObject json) throws IOException, FHIRFormatError { 25903 RiskAssessment res = new RiskAssessment(); 25904 parseRiskAssessmentProperties(json, res); 25905 return res; 25906 } 25907 25908 protected void parseRiskAssessmentProperties(JsonObject json, RiskAssessment res) 25909 throws IOException, FHIRFormatError { 25910 parseDomainResourceProperties(json, res); 25911 if (json.has("identifier")) { 25912 JsonArray array = json.getAsJsonArray("identifier"); 25913 for (int i = 0; i < array.size(); i++) { 25914 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 25915 } 25916 } 25917 ; 25918 if (json.has("basedOn")) 25919 res.setBasedOn(parseReference(getJObject(json, "basedOn"))); 25920 if (json.has("parent")) 25921 res.setParent(parseReference(getJObject(json, "parent"))); 25922 if (json.has("status")) 25923 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), RiskAssessment.RiskAssessmentStatus.NULL, 25924 new RiskAssessment.RiskAssessmentStatusEnumFactory())); 25925 if (json.has("_status")) 25926 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 25927 if (json.has("method")) 25928 res.setMethod(parseCodeableConcept(getJObject(json, "method"))); 25929 if (json.has("code")) 25930 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 25931 if (json.has("subject")) 25932 res.setSubject(parseReference(getJObject(json, "subject"))); 25933 if (json.has("encounter")) 25934 res.setEncounter(parseReference(getJObject(json, "encounter"))); 25935 Type occurrence = parseType("occurrence", json); 25936 if (occurrence != null) 25937 res.setOccurrence(occurrence); 25938 if (json.has("condition")) 25939 res.setCondition(parseReference(getJObject(json, "condition"))); 25940 if (json.has("performer")) 25941 res.setPerformer(parseReference(getJObject(json, "performer"))); 25942 if (json.has("reasonCode")) { 25943 JsonArray array = json.getAsJsonArray("reasonCode"); 25944 for (int i = 0; i < array.size(); i++) { 25945 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 25946 } 25947 } 25948 ; 25949 if (json.has("reasonReference")) { 25950 JsonArray array = json.getAsJsonArray("reasonReference"); 25951 for (int i = 0; i < array.size(); i++) { 25952 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 25953 } 25954 } 25955 ; 25956 if (json.has("basis")) { 25957 JsonArray array = json.getAsJsonArray("basis"); 25958 for (int i = 0; i < array.size(); i++) { 25959 res.getBasis().add(parseReference(array.get(i).getAsJsonObject())); 25960 } 25961 } 25962 ; 25963 if (json.has("prediction")) { 25964 JsonArray array = json.getAsJsonArray("prediction"); 25965 for (int i = 0; i < array.size(); i++) { 25966 res.getPrediction() 25967 .add(parseRiskAssessmentRiskAssessmentPredictionComponent(array.get(i).getAsJsonObject(), res)); 25968 } 25969 } 25970 ; 25971 if (json.has("mitigation")) 25972 res.setMitigationElement(parseString(json.get("mitigation").getAsString())); 25973 if (json.has("_mitigation")) 25974 parseElementProperties(getJObject(json, "_mitigation"), res.getMitigationElement()); 25975 if (json.has("note")) { 25976 JsonArray array = json.getAsJsonArray("note"); 25977 for (int i = 0; i < array.size(); i++) { 25978 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 25979 } 25980 } 25981 ; 25982 } 25983 25984 protected RiskAssessment.RiskAssessmentPredictionComponent parseRiskAssessmentRiskAssessmentPredictionComponent( 25985 JsonObject json, RiskAssessment owner) throws IOException, FHIRFormatError { 25986 RiskAssessment.RiskAssessmentPredictionComponent res = new RiskAssessment.RiskAssessmentPredictionComponent(); 25987 parseRiskAssessmentRiskAssessmentPredictionComponentProperties(json, owner, res); 25988 return res; 25989 } 25990 25991 protected void parseRiskAssessmentRiskAssessmentPredictionComponentProperties(JsonObject json, RiskAssessment owner, 25992 RiskAssessment.RiskAssessmentPredictionComponent res) throws IOException, FHIRFormatError { 25993 parseBackboneElementProperties(json, res); 25994 if (json.has("outcome")) 25995 res.setOutcome(parseCodeableConcept(getJObject(json, "outcome"))); 25996 Type probability = parseType("probability", json); 25997 if (probability != null) 25998 res.setProbability(probability); 25999 if (json.has("qualitativeRisk")) 26000 res.setQualitativeRisk(parseCodeableConcept(getJObject(json, "qualitativeRisk"))); 26001 if (json.has("relativeRisk")) 26002 res.setRelativeRiskElement(parseDecimal(json.get("relativeRisk").getAsBigDecimal())); 26003 if (json.has("_relativeRisk")) 26004 parseElementProperties(getJObject(json, "_relativeRisk"), res.getRelativeRiskElement()); 26005 Type when = parseType("when", json); 26006 if (when != null) 26007 res.setWhen(when); 26008 if (json.has("rationale")) 26009 res.setRationaleElement(parseString(json.get("rationale").getAsString())); 26010 if (json.has("_rationale")) 26011 parseElementProperties(getJObject(json, "_rationale"), res.getRationaleElement()); 26012 } 26013 26014 protected RiskEvidenceSynthesis parseRiskEvidenceSynthesis(JsonObject json) throws IOException, FHIRFormatError { 26015 RiskEvidenceSynthesis res = new RiskEvidenceSynthesis(); 26016 parseRiskEvidenceSynthesisProperties(json, res); 26017 return res; 26018 } 26019 26020 protected void parseRiskEvidenceSynthesisProperties(JsonObject json, RiskEvidenceSynthesis res) 26021 throws IOException, FHIRFormatError { 26022 parseDomainResourceProperties(json, res); 26023 if (json.has("url")) 26024 res.setUrlElement(parseUri(json.get("url").getAsString())); 26025 if (json.has("_url")) 26026 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 26027 if (json.has("identifier")) { 26028 JsonArray array = json.getAsJsonArray("identifier"); 26029 for (int i = 0; i < array.size(); i++) { 26030 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 26031 } 26032 } 26033 ; 26034 if (json.has("version")) 26035 res.setVersionElement(parseString(json.get("version").getAsString())); 26036 if (json.has("_version")) 26037 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 26038 if (json.has("name")) 26039 res.setNameElement(parseString(json.get("name").getAsString())); 26040 if (json.has("_name")) 26041 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 26042 if (json.has("title")) 26043 res.setTitleElement(parseString(json.get("title").getAsString())); 26044 if (json.has("_title")) 26045 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 26046 if (json.has("status")) 26047 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 26048 new Enumerations.PublicationStatusEnumFactory())); 26049 if (json.has("_status")) 26050 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 26051 if (json.has("date")) 26052 res.setDateElement(parseDateTime(json.get("date").getAsString())); 26053 if (json.has("_date")) 26054 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 26055 if (json.has("publisher")) 26056 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 26057 if (json.has("_publisher")) 26058 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 26059 if (json.has("contact")) { 26060 JsonArray array = json.getAsJsonArray("contact"); 26061 for (int i = 0; i < array.size(); i++) { 26062 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 26063 } 26064 } 26065 ; 26066 if (json.has("description")) 26067 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 26068 if (json.has("_description")) 26069 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 26070 if (json.has("note")) { 26071 JsonArray array = json.getAsJsonArray("note"); 26072 for (int i = 0; i < array.size(); i++) { 26073 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 26074 } 26075 } 26076 ; 26077 if (json.has("useContext")) { 26078 JsonArray array = json.getAsJsonArray("useContext"); 26079 for (int i = 0; i < array.size(); i++) { 26080 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 26081 } 26082 } 26083 ; 26084 if (json.has("jurisdiction")) { 26085 JsonArray array = json.getAsJsonArray("jurisdiction"); 26086 for (int i = 0; i < array.size(); i++) { 26087 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26088 } 26089 } 26090 ; 26091 if (json.has("copyright")) 26092 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 26093 if (json.has("_copyright")) 26094 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 26095 if (json.has("approvalDate")) 26096 res.setApprovalDateElement(parseDate(json.get("approvalDate").getAsString())); 26097 if (json.has("_approvalDate")) 26098 parseElementProperties(getJObject(json, "_approvalDate"), res.getApprovalDateElement()); 26099 if (json.has("lastReviewDate")) 26100 res.setLastReviewDateElement(parseDate(json.get("lastReviewDate").getAsString())); 26101 if (json.has("_lastReviewDate")) 26102 parseElementProperties(getJObject(json, "_lastReviewDate"), res.getLastReviewDateElement()); 26103 if (json.has("effectivePeriod")) 26104 res.setEffectivePeriod(parsePeriod(getJObject(json, "effectivePeriod"))); 26105 if (json.has("topic")) { 26106 JsonArray array = json.getAsJsonArray("topic"); 26107 for (int i = 0; i < array.size(); i++) { 26108 res.getTopic().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26109 } 26110 } 26111 ; 26112 if (json.has("author")) { 26113 JsonArray array = json.getAsJsonArray("author"); 26114 for (int i = 0; i < array.size(); i++) { 26115 res.getAuthor().add(parseContactDetail(array.get(i).getAsJsonObject())); 26116 } 26117 } 26118 ; 26119 if (json.has("editor")) { 26120 JsonArray array = json.getAsJsonArray("editor"); 26121 for (int i = 0; i < array.size(); i++) { 26122 res.getEditor().add(parseContactDetail(array.get(i).getAsJsonObject())); 26123 } 26124 } 26125 ; 26126 if (json.has("reviewer")) { 26127 JsonArray array = json.getAsJsonArray("reviewer"); 26128 for (int i = 0; i < array.size(); i++) { 26129 res.getReviewer().add(parseContactDetail(array.get(i).getAsJsonObject())); 26130 } 26131 } 26132 ; 26133 if (json.has("endorser")) { 26134 JsonArray array = json.getAsJsonArray("endorser"); 26135 for (int i = 0; i < array.size(); i++) { 26136 res.getEndorser().add(parseContactDetail(array.get(i).getAsJsonObject())); 26137 } 26138 } 26139 ; 26140 if (json.has("relatedArtifact")) { 26141 JsonArray array = json.getAsJsonArray("relatedArtifact"); 26142 for (int i = 0; i < array.size(); i++) { 26143 res.getRelatedArtifact().add(parseRelatedArtifact(array.get(i).getAsJsonObject())); 26144 } 26145 } 26146 ; 26147 if (json.has("synthesisType")) 26148 res.setSynthesisType(parseCodeableConcept(getJObject(json, "synthesisType"))); 26149 if (json.has("studyType")) 26150 res.setStudyType(parseCodeableConcept(getJObject(json, "studyType"))); 26151 if (json.has("population")) 26152 res.setPopulation(parseReference(getJObject(json, "population"))); 26153 if (json.has("exposure")) 26154 res.setExposure(parseReference(getJObject(json, "exposure"))); 26155 if (json.has("outcome")) 26156 res.setOutcome(parseReference(getJObject(json, "outcome"))); 26157 if (json.has("sampleSize")) 26158 res.setSampleSize( 26159 parseRiskEvidenceSynthesisRiskEvidenceSynthesisSampleSizeComponent(getJObject(json, "sampleSize"), res)); 26160 if (json.has("riskEstimate")) 26161 res.setRiskEstimate( 26162 parseRiskEvidenceSynthesisRiskEvidenceSynthesisRiskEstimateComponent(getJObject(json, "riskEstimate"), res)); 26163 if (json.has("certainty")) { 26164 JsonArray array = json.getAsJsonArray("certainty"); 26165 for (int i = 0; i < array.size(); i++) { 26166 res.getCertainty().add( 26167 parseRiskEvidenceSynthesisRiskEvidenceSynthesisCertaintyComponent(array.get(i).getAsJsonObject(), res)); 26168 } 26169 } 26170 ; 26171 } 26172 26173 protected RiskEvidenceSynthesis.RiskEvidenceSynthesisSampleSizeComponent parseRiskEvidenceSynthesisRiskEvidenceSynthesisSampleSizeComponent( 26174 JsonObject json, RiskEvidenceSynthesis owner) throws IOException, FHIRFormatError { 26175 RiskEvidenceSynthesis.RiskEvidenceSynthesisSampleSizeComponent res = new RiskEvidenceSynthesis.RiskEvidenceSynthesisSampleSizeComponent(); 26176 parseRiskEvidenceSynthesisRiskEvidenceSynthesisSampleSizeComponentProperties(json, owner, res); 26177 return res; 26178 } 26179 26180 protected void parseRiskEvidenceSynthesisRiskEvidenceSynthesisSampleSizeComponentProperties(JsonObject json, 26181 RiskEvidenceSynthesis owner, RiskEvidenceSynthesis.RiskEvidenceSynthesisSampleSizeComponent res) 26182 throws IOException, FHIRFormatError { 26183 parseBackboneElementProperties(json, res); 26184 if (json.has("description")) 26185 res.setDescriptionElement(parseString(json.get("description").getAsString())); 26186 if (json.has("_description")) 26187 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 26188 if (json.has("numberOfStudies")) 26189 res.setNumberOfStudiesElement(parseInteger(json.get("numberOfStudies").getAsLong())); 26190 if (json.has("_numberOfStudies")) 26191 parseElementProperties(getJObject(json, "_numberOfStudies"), res.getNumberOfStudiesElement()); 26192 if (json.has("numberOfParticipants")) 26193 res.setNumberOfParticipantsElement(parseInteger(json.get("numberOfParticipants").getAsLong())); 26194 if (json.has("_numberOfParticipants")) 26195 parseElementProperties(getJObject(json, "_numberOfParticipants"), res.getNumberOfParticipantsElement()); 26196 } 26197 26198 protected RiskEvidenceSynthesis.RiskEvidenceSynthesisRiskEstimateComponent parseRiskEvidenceSynthesisRiskEvidenceSynthesisRiskEstimateComponent( 26199 JsonObject json, RiskEvidenceSynthesis owner) throws IOException, FHIRFormatError { 26200 RiskEvidenceSynthesis.RiskEvidenceSynthesisRiskEstimateComponent res = new RiskEvidenceSynthesis.RiskEvidenceSynthesisRiskEstimateComponent(); 26201 parseRiskEvidenceSynthesisRiskEvidenceSynthesisRiskEstimateComponentProperties(json, owner, res); 26202 return res; 26203 } 26204 26205 protected void parseRiskEvidenceSynthesisRiskEvidenceSynthesisRiskEstimateComponentProperties(JsonObject json, 26206 RiskEvidenceSynthesis owner, RiskEvidenceSynthesis.RiskEvidenceSynthesisRiskEstimateComponent res) 26207 throws IOException, FHIRFormatError { 26208 parseBackboneElementProperties(json, res); 26209 if (json.has("description")) 26210 res.setDescriptionElement(parseString(json.get("description").getAsString())); 26211 if (json.has("_description")) 26212 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 26213 if (json.has("type")) 26214 res.setType(parseCodeableConcept(getJObject(json, "type"))); 26215 if (json.has("value")) 26216 res.setValueElement(parseDecimal(json.get("value").getAsBigDecimal())); 26217 if (json.has("_value")) 26218 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 26219 if (json.has("unitOfMeasure")) 26220 res.setUnitOfMeasure(parseCodeableConcept(getJObject(json, "unitOfMeasure"))); 26221 if (json.has("denominatorCount")) 26222 res.setDenominatorCountElement(parseInteger(json.get("denominatorCount").getAsLong())); 26223 if (json.has("_denominatorCount")) 26224 parseElementProperties(getJObject(json, "_denominatorCount"), res.getDenominatorCountElement()); 26225 if (json.has("numeratorCount")) 26226 res.setNumeratorCountElement(parseInteger(json.get("numeratorCount").getAsLong())); 26227 if (json.has("_numeratorCount")) 26228 parseElementProperties(getJObject(json, "_numeratorCount"), res.getNumeratorCountElement()); 26229 if (json.has("precisionEstimate")) { 26230 JsonArray array = json.getAsJsonArray("precisionEstimate"); 26231 for (int i = 0; i < array.size(); i++) { 26232 res.getPrecisionEstimate() 26233 .add(parseRiskEvidenceSynthesisRiskEvidenceSynthesisRiskEstimatePrecisionEstimateComponent( 26234 array.get(i).getAsJsonObject(), owner)); 26235 } 26236 } 26237 ; 26238 } 26239 26240 protected RiskEvidenceSynthesis.RiskEvidenceSynthesisRiskEstimatePrecisionEstimateComponent parseRiskEvidenceSynthesisRiskEvidenceSynthesisRiskEstimatePrecisionEstimateComponent( 26241 JsonObject json, RiskEvidenceSynthesis owner) throws IOException, FHIRFormatError { 26242 RiskEvidenceSynthesis.RiskEvidenceSynthesisRiskEstimatePrecisionEstimateComponent res = new RiskEvidenceSynthesis.RiskEvidenceSynthesisRiskEstimatePrecisionEstimateComponent(); 26243 parseRiskEvidenceSynthesisRiskEvidenceSynthesisRiskEstimatePrecisionEstimateComponentProperties(json, owner, res); 26244 return res; 26245 } 26246 26247 protected void parseRiskEvidenceSynthesisRiskEvidenceSynthesisRiskEstimatePrecisionEstimateComponentProperties( 26248 JsonObject json, RiskEvidenceSynthesis owner, 26249 RiskEvidenceSynthesis.RiskEvidenceSynthesisRiskEstimatePrecisionEstimateComponent res) 26250 throws IOException, FHIRFormatError { 26251 parseBackboneElementProperties(json, res); 26252 if (json.has("type")) 26253 res.setType(parseCodeableConcept(getJObject(json, "type"))); 26254 if (json.has("level")) 26255 res.setLevelElement(parseDecimal(json.get("level").getAsBigDecimal())); 26256 if (json.has("_level")) 26257 parseElementProperties(getJObject(json, "_level"), res.getLevelElement()); 26258 if (json.has("from")) 26259 res.setFromElement(parseDecimal(json.get("from").getAsBigDecimal())); 26260 if (json.has("_from")) 26261 parseElementProperties(getJObject(json, "_from"), res.getFromElement()); 26262 if (json.has("to")) 26263 res.setToElement(parseDecimal(json.get("to").getAsBigDecimal())); 26264 if (json.has("_to")) 26265 parseElementProperties(getJObject(json, "_to"), res.getToElement()); 26266 } 26267 26268 protected RiskEvidenceSynthesis.RiskEvidenceSynthesisCertaintyComponent parseRiskEvidenceSynthesisRiskEvidenceSynthesisCertaintyComponent( 26269 JsonObject json, RiskEvidenceSynthesis owner) throws IOException, FHIRFormatError { 26270 RiskEvidenceSynthesis.RiskEvidenceSynthesisCertaintyComponent res = new RiskEvidenceSynthesis.RiskEvidenceSynthesisCertaintyComponent(); 26271 parseRiskEvidenceSynthesisRiskEvidenceSynthesisCertaintyComponentProperties(json, owner, res); 26272 return res; 26273 } 26274 26275 protected void parseRiskEvidenceSynthesisRiskEvidenceSynthesisCertaintyComponentProperties(JsonObject json, 26276 RiskEvidenceSynthesis owner, RiskEvidenceSynthesis.RiskEvidenceSynthesisCertaintyComponent res) 26277 throws IOException, FHIRFormatError { 26278 parseBackboneElementProperties(json, res); 26279 if (json.has("rating")) { 26280 JsonArray array = json.getAsJsonArray("rating"); 26281 for (int i = 0; i < array.size(); i++) { 26282 res.getRating().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26283 } 26284 } 26285 ; 26286 if (json.has("note")) { 26287 JsonArray array = json.getAsJsonArray("note"); 26288 for (int i = 0; i < array.size(); i++) { 26289 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 26290 } 26291 } 26292 ; 26293 if (json.has("certaintySubcomponent")) { 26294 JsonArray array = json.getAsJsonArray("certaintySubcomponent"); 26295 for (int i = 0; i < array.size(); i++) { 26296 res.getCertaintySubcomponent() 26297 .add(parseRiskEvidenceSynthesisRiskEvidenceSynthesisCertaintyCertaintySubcomponentComponent( 26298 array.get(i).getAsJsonObject(), owner)); 26299 } 26300 } 26301 ; 26302 } 26303 26304 protected RiskEvidenceSynthesis.RiskEvidenceSynthesisCertaintyCertaintySubcomponentComponent parseRiskEvidenceSynthesisRiskEvidenceSynthesisCertaintyCertaintySubcomponentComponent( 26305 JsonObject json, RiskEvidenceSynthesis owner) throws IOException, FHIRFormatError { 26306 RiskEvidenceSynthesis.RiskEvidenceSynthesisCertaintyCertaintySubcomponentComponent res = new RiskEvidenceSynthesis.RiskEvidenceSynthesisCertaintyCertaintySubcomponentComponent(); 26307 parseRiskEvidenceSynthesisRiskEvidenceSynthesisCertaintyCertaintySubcomponentComponentProperties(json, owner, res); 26308 return res; 26309 } 26310 26311 protected void parseRiskEvidenceSynthesisRiskEvidenceSynthesisCertaintyCertaintySubcomponentComponentProperties( 26312 JsonObject json, RiskEvidenceSynthesis owner, 26313 RiskEvidenceSynthesis.RiskEvidenceSynthesisCertaintyCertaintySubcomponentComponent res) 26314 throws IOException, FHIRFormatError { 26315 parseBackboneElementProperties(json, res); 26316 if (json.has("type")) 26317 res.setType(parseCodeableConcept(getJObject(json, "type"))); 26318 if (json.has("rating")) { 26319 JsonArray array = json.getAsJsonArray("rating"); 26320 for (int i = 0; i < array.size(); i++) { 26321 res.getRating().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26322 } 26323 } 26324 ; 26325 if (json.has("note")) { 26326 JsonArray array = json.getAsJsonArray("note"); 26327 for (int i = 0; i < array.size(); i++) { 26328 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 26329 } 26330 } 26331 ; 26332 } 26333 26334 protected Schedule parseSchedule(JsonObject json) throws IOException, FHIRFormatError { 26335 Schedule res = new Schedule(); 26336 parseScheduleProperties(json, res); 26337 return res; 26338 } 26339 26340 protected void parseScheduleProperties(JsonObject json, Schedule res) throws IOException, FHIRFormatError { 26341 parseDomainResourceProperties(json, res); 26342 if (json.has("identifier")) { 26343 JsonArray array = json.getAsJsonArray("identifier"); 26344 for (int i = 0; i < array.size(); i++) { 26345 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 26346 } 26347 } 26348 ; 26349 if (json.has("active")) 26350 res.setActiveElement(parseBoolean(json.get("active").getAsBoolean())); 26351 if (json.has("_active")) 26352 parseElementProperties(getJObject(json, "_active"), res.getActiveElement()); 26353 if (json.has("serviceCategory")) { 26354 JsonArray array = json.getAsJsonArray("serviceCategory"); 26355 for (int i = 0; i < array.size(); i++) { 26356 res.getServiceCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26357 } 26358 } 26359 ; 26360 if (json.has("serviceType")) { 26361 JsonArray array = json.getAsJsonArray("serviceType"); 26362 for (int i = 0; i < array.size(); i++) { 26363 res.getServiceType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26364 } 26365 } 26366 ; 26367 if (json.has("specialty")) { 26368 JsonArray array = json.getAsJsonArray("specialty"); 26369 for (int i = 0; i < array.size(); i++) { 26370 res.getSpecialty().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26371 } 26372 } 26373 ; 26374 if (json.has("actor")) { 26375 JsonArray array = json.getAsJsonArray("actor"); 26376 for (int i = 0; i < array.size(); i++) { 26377 res.getActor().add(parseReference(array.get(i).getAsJsonObject())); 26378 } 26379 } 26380 ; 26381 if (json.has("planningHorizon")) 26382 res.setPlanningHorizon(parsePeriod(getJObject(json, "planningHorizon"))); 26383 if (json.has("comment")) 26384 res.setCommentElement(parseString(json.get("comment").getAsString())); 26385 if (json.has("_comment")) 26386 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 26387 } 26388 26389 protected SearchParameter parseSearchParameter(JsonObject json) throws IOException, FHIRFormatError { 26390 SearchParameter res = new SearchParameter(); 26391 parseSearchParameterProperties(json, res); 26392 return res; 26393 } 26394 26395 protected void parseSearchParameterProperties(JsonObject json, SearchParameter res) 26396 throws IOException, FHIRFormatError { 26397 parseDomainResourceProperties(json, res); 26398 if (json.has("url")) 26399 res.setUrlElement(parseUri(json.get("url").getAsString())); 26400 if (json.has("_url")) 26401 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 26402 if (json.has("version")) 26403 res.setVersionElement(parseString(json.get("version").getAsString())); 26404 if (json.has("_version")) 26405 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 26406 if (json.has("name")) 26407 res.setNameElement(parseString(json.get("name").getAsString())); 26408 if (json.has("_name")) 26409 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 26410 if (json.has("derivedFrom")) 26411 res.setDerivedFromElement(parseCanonical(json.get("derivedFrom").getAsString())); 26412 if (json.has("_derivedFrom")) 26413 parseElementProperties(getJObject(json, "_derivedFrom"), res.getDerivedFromElement()); 26414 if (json.has("status")) 26415 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 26416 new Enumerations.PublicationStatusEnumFactory())); 26417 if (json.has("_status")) 26418 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 26419 if (json.has("experimental")) 26420 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 26421 if (json.has("_experimental")) 26422 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 26423 if (json.has("date")) 26424 res.setDateElement(parseDateTime(json.get("date").getAsString())); 26425 if (json.has("_date")) 26426 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 26427 if (json.has("publisher")) 26428 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 26429 if (json.has("_publisher")) 26430 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 26431 if (json.has("contact")) { 26432 JsonArray array = json.getAsJsonArray("contact"); 26433 for (int i = 0; i < array.size(); i++) { 26434 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 26435 } 26436 } 26437 ; 26438 if (json.has("description")) 26439 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 26440 if (json.has("_description")) 26441 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 26442 if (json.has("useContext")) { 26443 JsonArray array = json.getAsJsonArray("useContext"); 26444 for (int i = 0; i < array.size(); i++) { 26445 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 26446 } 26447 } 26448 ; 26449 if (json.has("jurisdiction")) { 26450 JsonArray array = json.getAsJsonArray("jurisdiction"); 26451 for (int i = 0; i < array.size(); i++) { 26452 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26453 } 26454 } 26455 ; 26456 if (json.has("purpose")) 26457 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 26458 if (json.has("_purpose")) 26459 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 26460 if (json.has("code")) 26461 res.setCodeElement(parseCode(json.get("code").getAsString())); 26462 if (json.has("_code")) 26463 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 26464 if (json.has("base")) { 26465 JsonArray array = json.getAsJsonArray("base"); 26466 for (int i = 0; i < array.size(); i++) { 26467 if (array.get(i).isJsonNull()) { 26468 res.getBase().add(new CodeType()); 26469 } else { 26470 res.getBase().add(parseCode(array.get(i).getAsString())); 26471 } 26472 } 26473 } 26474 ; 26475 if (json.has("_base")) { 26476 JsonArray array = json.getAsJsonArray("_base"); 26477 for (int i = 0; i < array.size(); i++) { 26478 if (i == res.getBase().size()) 26479 res.getBase().add(parseCode(null)); 26480 if (array.get(i) instanceof JsonObject) 26481 parseElementProperties(array.get(i).getAsJsonObject(), res.getBase().get(i)); 26482 } 26483 } 26484 ; 26485 if (json.has("type")) 26486 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), Enumerations.SearchParamType.NULL, 26487 new Enumerations.SearchParamTypeEnumFactory())); 26488 if (json.has("_type")) 26489 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 26490 if (json.has("expression")) 26491 res.setExpressionElement(parseString(json.get("expression").getAsString())); 26492 if (json.has("_expression")) 26493 parseElementProperties(getJObject(json, "_expression"), res.getExpressionElement()); 26494 if (json.has("xpath")) 26495 res.setXpathElement(parseString(json.get("xpath").getAsString())); 26496 if (json.has("_xpath")) 26497 parseElementProperties(getJObject(json, "_xpath"), res.getXpathElement()); 26498 if (json.has("xpathUsage")) 26499 res.setXpathUsageElement(parseEnumeration(json.get("xpathUsage").getAsString(), 26500 SearchParameter.XPathUsageType.NULL, new SearchParameter.XPathUsageTypeEnumFactory())); 26501 if (json.has("_xpathUsage")) 26502 parseElementProperties(getJObject(json, "_xpathUsage"), res.getXpathUsageElement()); 26503 if (json.has("target")) { 26504 JsonArray array = json.getAsJsonArray("target"); 26505 for (int i = 0; i < array.size(); i++) { 26506 if (array.get(i).isJsonNull()) { 26507 res.getTarget().add(new CodeType()); 26508 } else { 26509 res.getTarget().add(parseCode(array.get(i).getAsString())); 26510 } 26511 } 26512 } 26513 ; 26514 if (json.has("_target")) { 26515 JsonArray array = json.getAsJsonArray("_target"); 26516 for (int i = 0; i < array.size(); i++) { 26517 if (i == res.getTarget().size()) 26518 res.getTarget().add(parseCode(null)); 26519 if (array.get(i) instanceof JsonObject) 26520 parseElementProperties(array.get(i).getAsJsonObject(), res.getTarget().get(i)); 26521 } 26522 } 26523 ; 26524 if (json.has("multipleOr")) 26525 res.setMultipleOrElement(parseBoolean(json.get("multipleOr").getAsBoolean())); 26526 if (json.has("_multipleOr")) 26527 parseElementProperties(getJObject(json, "_multipleOr"), res.getMultipleOrElement()); 26528 if (json.has("multipleAnd")) 26529 res.setMultipleAndElement(parseBoolean(json.get("multipleAnd").getAsBoolean())); 26530 if (json.has("_multipleAnd")) 26531 parseElementProperties(getJObject(json, "_multipleAnd"), res.getMultipleAndElement()); 26532 if (json.has("comparator")) { 26533 JsonArray array = json.getAsJsonArray("comparator"); 26534 for (int i = 0; i < array.size(); i++) { 26535 if (array.get(i).isJsonNull()) { 26536 res.getComparator().add(new Enumeration<SearchParameter.SearchComparator>()); 26537 } else { 26538 res.getComparator().add(parseEnumeration(array.get(i).getAsString(), SearchParameter.SearchComparator.NULL, 26539 new SearchParameter.SearchComparatorEnumFactory())); 26540 } 26541 } 26542 } 26543 ; 26544 if (json.has("_comparator")) { 26545 JsonArray array = json.getAsJsonArray("_comparator"); 26546 for (int i = 0; i < array.size(); i++) { 26547 if (i == res.getComparator().size()) 26548 res.getComparator().add(parseEnumeration(null, SearchParameter.SearchComparator.NULL, 26549 new SearchParameter.SearchComparatorEnumFactory())); 26550 if (array.get(i) instanceof JsonObject) 26551 parseElementProperties(array.get(i).getAsJsonObject(), res.getComparator().get(i)); 26552 } 26553 } 26554 ; 26555 if (json.has("modifier")) { 26556 JsonArray array = json.getAsJsonArray("modifier"); 26557 for (int i = 0; i < array.size(); i++) { 26558 if (array.get(i).isJsonNull()) { 26559 res.getModifier().add(new Enumeration<SearchParameter.SearchModifierCode>()); 26560 } else { 26561 res.getModifier().add(parseEnumeration(array.get(i).getAsString(), SearchParameter.SearchModifierCode.NULL, 26562 new SearchParameter.SearchModifierCodeEnumFactory())); 26563 } 26564 } 26565 } 26566 ; 26567 if (json.has("_modifier")) { 26568 JsonArray array = json.getAsJsonArray("_modifier"); 26569 for (int i = 0; i < array.size(); i++) { 26570 if (i == res.getModifier().size()) 26571 res.getModifier().add(parseEnumeration(null, SearchParameter.SearchModifierCode.NULL, 26572 new SearchParameter.SearchModifierCodeEnumFactory())); 26573 if (array.get(i) instanceof JsonObject) 26574 parseElementProperties(array.get(i).getAsJsonObject(), res.getModifier().get(i)); 26575 } 26576 } 26577 ; 26578 if (json.has("chain")) { 26579 JsonArray array = json.getAsJsonArray("chain"); 26580 for (int i = 0; i < array.size(); i++) { 26581 if (array.get(i).isJsonNull()) { 26582 res.getChain().add(new StringType()); 26583 } else { 26584 res.getChain().add(parseString(array.get(i).getAsString())); 26585 } 26586 } 26587 } 26588 ; 26589 if (json.has("_chain")) { 26590 JsonArray array = json.getAsJsonArray("_chain"); 26591 for (int i = 0; i < array.size(); i++) { 26592 if (i == res.getChain().size()) 26593 res.getChain().add(parseString(null)); 26594 if (array.get(i) instanceof JsonObject) 26595 parseElementProperties(array.get(i).getAsJsonObject(), res.getChain().get(i)); 26596 } 26597 } 26598 ; 26599 if (json.has("component")) { 26600 JsonArray array = json.getAsJsonArray("component"); 26601 for (int i = 0; i < array.size(); i++) { 26602 res.getComponent() 26603 .add(parseSearchParameterSearchParameterComponentComponent(array.get(i).getAsJsonObject(), res)); 26604 } 26605 } 26606 ; 26607 } 26608 26609 protected SearchParameter.SearchParameterComponentComponent parseSearchParameterSearchParameterComponentComponent( 26610 JsonObject json, SearchParameter owner) throws IOException, FHIRFormatError { 26611 SearchParameter.SearchParameterComponentComponent res = new SearchParameter.SearchParameterComponentComponent(); 26612 parseSearchParameterSearchParameterComponentComponentProperties(json, owner, res); 26613 return res; 26614 } 26615 26616 protected void parseSearchParameterSearchParameterComponentComponentProperties(JsonObject json, SearchParameter owner, 26617 SearchParameter.SearchParameterComponentComponent res) throws IOException, FHIRFormatError { 26618 parseBackboneElementProperties(json, res); 26619 if (json.has("definition")) 26620 res.setDefinitionElement(parseCanonical(json.get("definition").getAsString())); 26621 if (json.has("_definition")) 26622 parseElementProperties(getJObject(json, "_definition"), res.getDefinitionElement()); 26623 if (json.has("expression")) 26624 res.setExpressionElement(parseString(json.get("expression").getAsString())); 26625 if (json.has("_expression")) 26626 parseElementProperties(getJObject(json, "_expression"), res.getExpressionElement()); 26627 } 26628 26629 protected ServiceRequest parseServiceRequest(JsonObject json) throws IOException, FHIRFormatError { 26630 ServiceRequest res = new ServiceRequest(); 26631 parseServiceRequestProperties(json, res); 26632 return res; 26633 } 26634 26635 protected void parseServiceRequestProperties(JsonObject json, ServiceRequest res) 26636 throws IOException, FHIRFormatError { 26637 parseDomainResourceProperties(json, res); 26638 if (json.has("identifier")) { 26639 JsonArray array = json.getAsJsonArray("identifier"); 26640 for (int i = 0; i < array.size(); i++) { 26641 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 26642 } 26643 } 26644 ; 26645 if (json.has("instantiatesCanonical")) { 26646 JsonArray array = json.getAsJsonArray("instantiatesCanonical"); 26647 for (int i = 0; i < array.size(); i++) { 26648 if (array.get(i).isJsonNull()) { 26649 res.getInstantiatesCanonical().add(new CanonicalType()); 26650 } else { 26651 res.getInstantiatesCanonical().add(parseCanonical(array.get(i).getAsString())); 26652 } 26653 } 26654 } 26655 ; 26656 if (json.has("_instantiatesCanonical")) { 26657 JsonArray array = json.getAsJsonArray("_instantiatesCanonical"); 26658 for (int i = 0; i < array.size(); i++) { 26659 if (i == res.getInstantiatesCanonical().size()) 26660 res.getInstantiatesCanonical().add(parseCanonical(null)); 26661 if (array.get(i) instanceof JsonObject) 26662 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesCanonical().get(i)); 26663 } 26664 } 26665 ; 26666 if (json.has("instantiatesUri")) { 26667 JsonArray array = json.getAsJsonArray("instantiatesUri"); 26668 for (int i = 0; i < array.size(); i++) { 26669 if (array.get(i).isJsonNull()) { 26670 res.getInstantiatesUri().add(new UriType()); 26671 } else { 26672 res.getInstantiatesUri().add(parseUri(array.get(i).getAsString())); 26673 } 26674 } 26675 } 26676 ; 26677 if (json.has("_instantiatesUri")) { 26678 JsonArray array = json.getAsJsonArray("_instantiatesUri"); 26679 for (int i = 0; i < array.size(); i++) { 26680 if (i == res.getInstantiatesUri().size()) 26681 res.getInstantiatesUri().add(parseUri(null)); 26682 if (array.get(i) instanceof JsonObject) 26683 parseElementProperties(array.get(i).getAsJsonObject(), res.getInstantiatesUri().get(i)); 26684 } 26685 } 26686 ; 26687 if (json.has("basedOn")) { 26688 JsonArray array = json.getAsJsonArray("basedOn"); 26689 for (int i = 0; i < array.size(); i++) { 26690 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 26691 } 26692 } 26693 ; 26694 if (json.has("replaces")) { 26695 JsonArray array = json.getAsJsonArray("replaces"); 26696 for (int i = 0; i < array.size(); i++) { 26697 res.getReplaces().add(parseReference(array.get(i).getAsJsonObject())); 26698 } 26699 } 26700 ; 26701 if (json.has("requisition")) 26702 res.setRequisition(parseIdentifier(getJObject(json, "requisition"))); 26703 if (json.has("status")) 26704 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), ServiceRequest.ServiceRequestStatus.NULL, 26705 new ServiceRequest.ServiceRequestStatusEnumFactory())); 26706 if (json.has("_status")) 26707 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 26708 if (json.has("intent")) 26709 res.setIntentElement(parseEnumeration(json.get("intent").getAsString(), ServiceRequest.ServiceRequestIntent.NULL, 26710 new ServiceRequest.ServiceRequestIntentEnumFactory())); 26711 if (json.has("_intent")) 26712 parseElementProperties(getJObject(json, "_intent"), res.getIntentElement()); 26713 if (json.has("category")) { 26714 JsonArray array = json.getAsJsonArray("category"); 26715 for (int i = 0; i < array.size(); i++) { 26716 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26717 } 26718 } 26719 ; 26720 if (json.has("priority")) 26721 res.setPriorityElement(parseEnumeration(json.get("priority").getAsString(), 26722 ServiceRequest.ServiceRequestPriority.NULL, new ServiceRequest.ServiceRequestPriorityEnumFactory())); 26723 if (json.has("_priority")) 26724 parseElementProperties(getJObject(json, "_priority"), res.getPriorityElement()); 26725 if (json.has("doNotPerform")) 26726 res.setDoNotPerformElement(parseBoolean(json.get("doNotPerform").getAsBoolean())); 26727 if (json.has("_doNotPerform")) 26728 parseElementProperties(getJObject(json, "_doNotPerform"), res.getDoNotPerformElement()); 26729 if (json.has("code")) 26730 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 26731 if (json.has("orderDetail")) { 26732 JsonArray array = json.getAsJsonArray("orderDetail"); 26733 for (int i = 0; i < array.size(); i++) { 26734 res.getOrderDetail().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26735 } 26736 } 26737 ; 26738 Type quantity = parseType("quantity", json); 26739 if (quantity != null) 26740 res.setQuantity(quantity); 26741 if (json.has("subject")) 26742 res.setSubject(parseReference(getJObject(json, "subject"))); 26743 if (json.has("encounter")) 26744 res.setEncounter(parseReference(getJObject(json, "encounter"))); 26745 Type occurrence = parseType("occurrence", json); 26746 if (occurrence != null) 26747 res.setOccurrence(occurrence); 26748 Type asNeeded = parseType("asNeeded", json); 26749 if (asNeeded != null) 26750 res.setAsNeeded(asNeeded); 26751 if (json.has("authoredOn")) 26752 res.setAuthoredOnElement(parseDateTime(json.get("authoredOn").getAsString())); 26753 if (json.has("_authoredOn")) 26754 parseElementProperties(getJObject(json, "_authoredOn"), res.getAuthoredOnElement()); 26755 if (json.has("requester")) 26756 res.setRequester(parseReference(getJObject(json, "requester"))); 26757 if (json.has("performerType")) 26758 res.setPerformerType(parseCodeableConcept(getJObject(json, "performerType"))); 26759 if (json.has("performer")) { 26760 JsonArray array = json.getAsJsonArray("performer"); 26761 for (int i = 0; i < array.size(); i++) { 26762 res.getPerformer().add(parseReference(array.get(i).getAsJsonObject())); 26763 } 26764 } 26765 ; 26766 if (json.has("locationCode")) { 26767 JsonArray array = json.getAsJsonArray("locationCode"); 26768 for (int i = 0; i < array.size(); i++) { 26769 res.getLocationCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26770 } 26771 } 26772 ; 26773 if (json.has("locationReference")) { 26774 JsonArray array = json.getAsJsonArray("locationReference"); 26775 for (int i = 0; i < array.size(); i++) { 26776 res.getLocationReference().add(parseReference(array.get(i).getAsJsonObject())); 26777 } 26778 } 26779 ; 26780 if (json.has("reasonCode")) { 26781 JsonArray array = json.getAsJsonArray("reasonCode"); 26782 for (int i = 0; i < array.size(); i++) { 26783 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26784 } 26785 } 26786 ; 26787 if (json.has("reasonReference")) { 26788 JsonArray array = json.getAsJsonArray("reasonReference"); 26789 for (int i = 0; i < array.size(); i++) { 26790 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 26791 } 26792 } 26793 ; 26794 if (json.has("insurance")) { 26795 JsonArray array = json.getAsJsonArray("insurance"); 26796 for (int i = 0; i < array.size(); i++) { 26797 res.getInsurance().add(parseReference(array.get(i).getAsJsonObject())); 26798 } 26799 } 26800 ; 26801 if (json.has("supportingInfo")) { 26802 JsonArray array = json.getAsJsonArray("supportingInfo"); 26803 for (int i = 0; i < array.size(); i++) { 26804 res.getSupportingInfo().add(parseReference(array.get(i).getAsJsonObject())); 26805 } 26806 } 26807 ; 26808 if (json.has("specimen")) { 26809 JsonArray array = json.getAsJsonArray("specimen"); 26810 for (int i = 0; i < array.size(); i++) { 26811 res.getSpecimen().add(parseReference(array.get(i).getAsJsonObject())); 26812 } 26813 } 26814 ; 26815 if (json.has("bodySite")) { 26816 JsonArray array = json.getAsJsonArray("bodySite"); 26817 for (int i = 0; i < array.size(); i++) { 26818 res.getBodySite().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26819 } 26820 } 26821 ; 26822 if (json.has("note")) { 26823 JsonArray array = json.getAsJsonArray("note"); 26824 for (int i = 0; i < array.size(); i++) { 26825 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 26826 } 26827 } 26828 ; 26829 if (json.has("patientInstruction")) 26830 res.setPatientInstructionElement(parseString(json.get("patientInstruction").getAsString())); 26831 if (json.has("_patientInstruction")) 26832 parseElementProperties(getJObject(json, "_patientInstruction"), res.getPatientInstructionElement()); 26833 if (json.has("relevantHistory")) { 26834 JsonArray array = json.getAsJsonArray("relevantHistory"); 26835 for (int i = 0; i < array.size(); i++) { 26836 res.getRelevantHistory().add(parseReference(array.get(i).getAsJsonObject())); 26837 } 26838 } 26839 ; 26840 } 26841 26842 protected Slot parseSlot(JsonObject json) throws IOException, FHIRFormatError { 26843 Slot res = new Slot(); 26844 parseSlotProperties(json, res); 26845 return res; 26846 } 26847 26848 protected void parseSlotProperties(JsonObject json, Slot res) throws IOException, FHIRFormatError { 26849 parseDomainResourceProperties(json, res); 26850 if (json.has("identifier")) { 26851 JsonArray array = json.getAsJsonArray("identifier"); 26852 for (int i = 0; i < array.size(); i++) { 26853 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 26854 } 26855 } 26856 ; 26857 if (json.has("serviceCategory")) { 26858 JsonArray array = json.getAsJsonArray("serviceCategory"); 26859 for (int i = 0; i < array.size(); i++) { 26860 res.getServiceCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26861 } 26862 } 26863 ; 26864 if (json.has("serviceType")) { 26865 JsonArray array = json.getAsJsonArray("serviceType"); 26866 for (int i = 0; i < array.size(); i++) { 26867 res.getServiceType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26868 } 26869 } 26870 ; 26871 if (json.has("specialty")) { 26872 JsonArray array = json.getAsJsonArray("specialty"); 26873 for (int i = 0; i < array.size(); i++) { 26874 res.getSpecialty().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26875 } 26876 } 26877 ; 26878 if (json.has("appointmentType")) 26879 res.setAppointmentType(parseCodeableConcept(getJObject(json, "appointmentType"))); 26880 if (json.has("schedule")) 26881 res.setSchedule(parseReference(getJObject(json, "schedule"))); 26882 if (json.has("status")) 26883 res.setStatusElement( 26884 parseEnumeration(json.get("status").getAsString(), Slot.SlotStatus.NULL, new Slot.SlotStatusEnumFactory())); 26885 if (json.has("_status")) 26886 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 26887 if (json.has("start")) 26888 res.setStartElement(parseInstant(json.get("start").getAsString())); 26889 if (json.has("_start")) 26890 parseElementProperties(getJObject(json, "_start"), res.getStartElement()); 26891 if (json.has("end")) 26892 res.setEndElement(parseInstant(json.get("end").getAsString())); 26893 if (json.has("_end")) 26894 parseElementProperties(getJObject(json, "_end"), res.getEndElement()); 26895 if (json.has("overbooked")) 26896 res.setOverbookedElement(parseBoolean(json.get("overbooked").getAsBoolean())); 26897 if (json.has("_overbooked")) 26898 parseElementProperties(getJObject(json, "_overbooked"), res.getOverbookedElement()); 26899 if (json.has("comment")) 26900 res.setCommentElement(parseString(json.get("comment").getAsString())); 26901 if (json.has("_comment")) 26902 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 26903 } 26904 26905 protected Specimen parseSpecimen(JsonObject json) throws IOException, FHIRFormatError { 26906 Specimen res = new Specimen(); 26907 parseSpecimenProperties(json, res); 26908 return res; 26909 } 26910 26911 protected void parseSpecimenProperties(JsonObject json, Specimen res) throws IOException, FHIRFormatError { 26912 parseDomainResourceProperties(json, res); 26913 if (json.has("identifier")) { 26914 JsonArray array = json.getAsJsonArray("identifier"); 26915 for (int i = 0; i < array.size(); i++) { 26916 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 26917 } 26918 } 26919 ; 26920 if (json.has("accessionIdentifier")) 26921 res.setAccessionIdentifier(parseIdentifier(getJObject(json, "accessionIdentifier"))); 26922 if (json.has("status")) 26923 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Specimen.SpecimenStatus.NULL, 26924 new Specimen.SpecimenStatusEnumFactory())); 26925 if (json.has("_status")) 26926 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 26927 if (json.has("type")) 26928 res.setType(parseCodeableConcept(getJObject(json, "type"))); 26929 if (json.has("subject")) 26930 res.setSubject(parseReference(getJObject(json, "subject"))); 26931 if (json.has("receivedTime")) 26932 res.setReceivedTimeElement(parseDateTime(json.get("receivedTime").getAsString())); 26933 if (json.has("_receivedTime")) 26934 parseElementProperties(getJObject(json, "_receivedTime"), res.getReceivedTimeElement()); 26935 if (json.has("parent")) { 26936 JsonArray array = json.getAsJsonArray("parent"); 26937 for (int i = 0; i < array.size(); i++) { 26938 res.getParent().add(parseReference(array.get(i).getAsJsonObject())); 26939 } 26940 } 26941 ; 26942 if (json.has("request")) { 26943 JsonArray array = json.getAsJsonArray("request"); 26944 for (int i = 0; i < array.size(); i++) { 26945 res.getRequest().add(parseReference(array.get(i).getAsJsonObject())); 26946 } 26947 } 26948 ; 26949 if (json.has("collection")) 26950 res.setCollection(parseSpecimenSpecimenCollectionComponent(getJObject(json, "collection"), res)); 26951 if (json.has("processing")) { 26952 JsonArray array = json.getAsJsonArray("processing"); 26953 for (int i = 0; i < array.size(); i++) { 26954 res.getProcessing().add(parseSpecimenSpecimenProcessingComponent(array.get(i).getAsJsonObject(), res)); 26955 } 26956 } 26957 ; 26958 if (json.has("container")) { 26959 JsonArray array = json.getAsJsonArray("container"); 26960 for (int i = 0; i < array.size(); i++) { 26961 res.getContainer().add(parseSpecimenSpecimenContainerComponent(array.get(i).getAsJsonObject(), res)); 26962 } 26963 } 26964 ; 26965 if (json.has("condition")) { 26966 JsonArray array = json.getAsJsonArray("condition"); 26967 for (int i = 0; i < array.size(); i++) { 26968 res.getCondition().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 26969 } 26970 } 26971 ; 26972 if (json.has("note")) { 26973 JsonArray array = json.getAsJsonArray("note"); 26974 for (int i = 0; i < array.size(); i++) { 26975 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 26976 } 26977 } 26978 ; 26979 } 26980 26981 protected Specimen.SpecimenCollectionComponent parseSpecimenSpecimenCollectionComponent(JsonObject json, 26982 Specimen owner) throws IOException, FHIRFormatError { 26983 Specimen.SpecimenCollectionComponent res = new Specimen.SpecimenCollectionComponent(); 26984 parseSpecimenSpecimenCollectionComponentProperties(json, owner, res); 26985 return res; 26986 } 26987 26988 protected void parseSpecimenSpecimenCollectionComponentProperties(JsonObject json, Specimen owner, 26989 Specimen.SpecimenCollectionComponent res) throws IOException, FHIRFormatError { 26990 parseBackboneElementProperties(json, res); 26991 if (json.has("collector")) 26992 res.setCollector(parseReference(getJObject(json, "collector"))); 26993 Type collected = parseType("collected", json); 26994 if (collected != null) 26995 res.setCollected(collected); 26996 if (json.has("duration")) 26997 res.setDuration(parseDuration(getJObject(json, "duration"))); 26998 if (json.has("quantity")) 26999 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 27000 if (json.has("method")) 27001 res.setMethod(parseCodeableConcept(getJObject(json, "method"))); 27002 if (json.has("bodySite")) 27003 res.setBodySite(parseCodeableConcept(getJObject(json, "bodySite"))); 27004 Type fastingStatus = parseType("fastingStatus", json); 27005 if (fastingStatus != null) 27006 res.setFastingStatus(fastingStatus); 27007 } 27008 27009 protected Specimen.SpecimenProcessingComponent parseSpecimenSpecimenProcessingComponent(JsonObject json, 27010 Specimen owner) throws IOException, FHIRFormatError { 27011 Specimen.SpecimenProcessingComponent res = new Specimen.SpecimenProcessingComponent(); 27012 parseSpecimenSpecimenProcessingComponentProperties(json, owner, res); 27013 return res; 27014 } 27015 27016 protected void parseSpecimenSpecimenProcessingComponentProperties(JsonObject json, Specimen owner, 27017 Specimen.SpecimenProcessingComponent res) throws IOException, FHIRFormatError { 27018 parseBackboneElementProperties(json, res); 27019 if (json.has("description")) 27020 res.setDescriptionElement(parseString(json.get("description").getAsString())); 27021 if (json.has("_description")) 27022 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 27023 if (json.has("procedure")) 27024 res.setProcedure(parseCodeableConcept(getJObject(json, "procedure"))); 27025 if (json.has("additive")) { 27026 JsonArray array = json.getAsJsonArray("additive"); 27027 for (int i = 0; i < array.size(); i++) { 27028 res.getAdditive().add(parseReference(array.get(i).getAsJsonObject())); 27029 } 27030 } 27031 ; 27032 Type time = parseType("time", json); 27033 if (time != null) 27034 res.setTime(time); 27035 } 27036 27037 protected Specimen.SpecimenContainerComponent parseSpecimenSpecimenContainerComponent(JsonObject json, Specimen owner) 27038 throws IOException, FHIRFormatError { 27039 Specimen.SpecimenContainerComponent res = new Specimen.SpecimenContainerComponent(); 27040 parseSpecimenSpecimenContainerComponentProperties(json, owner, res); 27041 return res; 27042 } 27043 27044 protected void parseSpecimenSpecimenContainerComponentProperties(JsonObject json, Specimen owner, 27045 Specimen.SpecimenContainerComponent res) throws IOException, FHIRFormatError { 27046 parseBackboneElementProperties(json, res); 27047 if (json.has("identifier")) { 27048 JsonArray array = json.getAsJsonArray("identifier"); 27049 for (int i = 0; i < array.size(); i++) { 27050 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 27051 } 27052 } 27053 ; 27054 if (json.has("description")) 27055 res.setDescriptionElement(parseString(json.get("description").getAsString())); 27056 if (json.has("_description")) 27057 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 27058 if (json.has("type")) 27059 res.setType(parseCodeableConcept(getJObject(json, "type"))); 27060 if (json.has("capacity")) 27061 res.setCapacity(parseQuantity(getJObject(json, "capacity"))); 27062 if (json.has("specimenQuantity")) 27063 res.setSpecimenQuantity(parseQuantity(getJObject(json, "specimenQuantity"))); 27064 Type additive = parseType("additive", json); 27065 if (additive != null) 27066 res.setAdditive(additive); 27067 } 27068 27069 protected SpecimenDefinition parseSpecimenDefinition(JsonObject json) throws IOException, FHIRFormatError { 27070 SpecimenDefinition res = new SpecimenDefinition(); 27071 parseSpecimenDefinitionProperties(json, res); 27072 return res; 27073 } 27074 27075 protected void parseSpecimenDefinitionProperties(JsonObject json, SpecimenDefinition res) 27076 throws IOException, FHIRFormatError { 27077 parseDomainResourceProperties(json, res); 27078 if (json.has("identifier")) 27079 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 27080 if (json.has("typeCollected")) 27081 res.setTypeCollected(parseCodeableConcept(getJObject(json, "typeCollected"))); 27082 if (json.has("patientPreparation")) { 27083 JsonArray array = json.getAsJsonArray("patientPreparation"); 27084 for (int i = 0; i < array.size(); i++) { 27085 res.getPatientPreparation().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 27086 } 27087 } 27088 ; 27089 if (json.has("timeAspect")) 27090 res.setTimeAspectElement(parseString(json.get("timeAspect").getAsString())); 27091 if (json.has("_timeAspect")) 27092 parseElementProperties(getJObject(json, "_timeAspect"), res.getTimeAspectElement()); 27093 if (json.has("collection")) { 27094 JsonArray array = json.getAsJsonArray("collection"); 27095 for (int i = 0; i < array.size(); i++) { 27096 res.getCollection().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 27097 } 27098 } 27099 ; 27100 if (json.has("typeTested")) { 27101 JsonArray array = json.getAsJsonArray("typeTested"); 27102 for (int i = 0; i < array.size(); i++) { 27103 res.getTypeTested() 27104 .add(parseSpecimenDefinitionSpecimenDefinitionTypeTestedComponent(array.get(i).getAsJsonObject(), res)); 27105 } 27106 } 27107 ; 27108 } 27109 27110 protected SpecimenDefinition.SpecimenDefinitionTypeTestedComponent parseSpecimenDefinitionSpecimenDefinitionTypeTestedComponent( 27111 JsonObject json, SpecimenDefinition owner) throws IOException, FHIRFormatError { 27112 SpecimenDefinition.SpecimenDefinitionTypeTestedComponent res = new SpecimenDefinition.SpecimenDefinitionTypeTestedComponent(); 27113 parseSpecimenDefinitionSpecimenDefinitionTypeTestedComponentProperties(json, owner, res); 27114 return res; 27115 } 27116 27117 protected void parseSpecimenDefinitionSpecimenDefinitionTypeTestedComponentProperties(JsonObject json, 27118 SpecimenDefinition owner, SpecimenDefinition.SpecimenDefinitionTypeTestedComponent res) 27119 throws IOException, FHIRFormatError { 27120 parseBackboneElementProperties(json, res); 27121 if (json.has("isDerived")) 27122 res.setIsDerivedElement(parseBoolean(json.get("isDerived").getAsBoolean())); 27123 if (json.has("_isDerived")) 27124 parseElementProperties(getJObject(json, "_isDerived"), res.getIsDerivedElement()); 27125 if (json.has("type")) 27126 res.setType(parseCodeableConcept(getJObject(json, "type"))); 27127 if (json.has("preference")) 27128 res.setPreferenceElement( 27129 parseEnumeration(json.get("preference").getAsString(), SpecimenDefinition.SpecimenContainedPreference.NULL, 27130 new SpecimenDefinition.SpecimenContainedPreferenceEnumFactory())); 27131 if (json.has("_preference")) 27132 parseElementProperties(getJObject(json, "_preference"), res.getPreferenceElement()); 27133 if (json.has("container")) 27134 res.setContainer( 27135 parseSpecimenDefinitionSpecimenDefinitionTypeTestedContainerComponent(getJObject(json, "container"), owner)); 27136 if (json.has("requirement")) 27137 res.setRequirementElement(parseString(json.get("requirement").getAsString())); 27138 if (json.has("_requirement")) 27139 parseElementProperties(getJObject(json, "_requirement"), res.getRequirementElement()); 27140 if (json.has("retentionTime")) 27141 res.setRetentionTime(parseDuration(getJObject(json, "retentionTime"))); 27142 if (json.has("rejectionCriterion")) { 27143 JsonArray array = json.getAsJsonArray("rejectionCriterion"); 27144 for (int i = 0; i < array.size(); i++) { 27145 res.getRejectionCriterion().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 27146 } 27147 } 27148 ; 27149 if (json.has("handling")) { 27150 JsonArray array = json.getAsJsonArray("handling"); 27151 for (int i = 0; i < array.size(); i++) { 27152 res.getHandling().add(parseSpecimenDefinitionSpecimenDefinitionTypeTestedHandlingComponent( 27153 array.get(i).getAsJsonObject(), owner)); 27154 } 27155 } 27156 ; 27157 } 27158 27159 protected SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent parseSpecimenDefinitionSpecimenDefinitionTypeTestedContainerComponent( 27160 JsonObject json, SpecimenDefinition owner) throws IOException, FHIRFormatError { 27161 SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent res = new SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent(); 27162 parseSpecimenDefinitionSpecimenDefinitionTypeTestedContainerComponentProperties(json, owner, res); 27163 return res; 27164 } 27165 27166 protected void parseSpecimenDefinitionSpecimenDefinitionTypeTestedContainerComponentProperties(JsonObject json, 27167 SpecimenDefinition owner, SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent res) 27168 throws IOException, FHIRFormatError { 27169 parseBackboneElementProperties(json, res); 27170 if (json.has("material")) 27171 res.setMaterial(parseCodeableConcept(getJObject(json, "material"))); 27172 if (json.has("type")) 27173 res.setType(parseCodeableConcept(getJObject(json, "type"))); 27174 if (json.has("cap")) 27175 res.setCap(parseCodeableConcept(getJObject(json, "cap"))); 27176 if (json.has("description")) 27177 res.setDescriptionElement(parseString(json.get("description").getAsString())); 27178 if (json.has("_description")) 27179 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 27180 if (json.has("capacity")) 27181 res.setCapacity(parseQuantity(getJObject(json, "capacity"))); 27182 Type minimumVolume = parseType("minimumVolume", json); 27183 if (minimumVolume != null) 27184 res.setMinimumVolume(minimumVolume); 27185 if (json.has("additive")) { 27186 JsonArray array = json.getAsJsonArray("additive"); 27187 for (int i = 0; i < array.size(); i++) { 27188 res.getAdditive().add(parseSpecimenDefinitionSpecimenDefinitionTypeTestedContainerAdditiveComponent( 27189 array.get(i).getAsJsonObject(), owner)); 27190 } 27191 } 27192 ; 27193 if (json.has("preparation")) 27194 res.setPreparationElement(parseString(json.get("preparation").getAsString())); 27195 if (json.has("_preparation")) 27196 parseElementProperties(getJObject(json, "_preparation"), res.getPreparationElement()); 27197 } 27198 27199 protected SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent parseSpecimenDefinitionSpecimenDefinitionTypeTestedContainerAdditiveComponent( 27200 JsonObject json, SpecimenDefinition owner) throws IOException, FHIRFormatError { 27201 SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent res = new SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent(); 27202 parseSpecimenDefinitionSpecimenDefinitionTypeTestedContainerAdditiveComponentProperties(json, owner, res); 27203 return res; 27204 } 27205 27206 protected void parseSpecimenDefinitionSpecimenDefinitionTypeTestedContainerAdditiveComponentProperties( 27207 JsonObject json, SpecimenDefinition owner, 27208 SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent res) 27209 throws IOException, FHIRFormatError { 27210 parseBackboneElementProperties(json, res); 27211 Type additive = parseType("additive", json); 27212 if (additive != null) 27213 res.setAdditive(additive); 27214 } 27215 27216 protected SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent parseSpecimenDefinitionSpecimenDefinitionTypeTestedHandlingComponent( 27217 JsonObject json, SpecimenDefinition owner) throws IOException, FHIRFormatError { 27218 SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent res = new SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent(); 27219 parseSpecimenDefinitionSpecimenDefinitionTypeTestedHandlingComponentProperties(json, owner, res); 27220 return res; 27221 } 27222 27223 protected void parseSpecimenDefinitionSpecimenDefinitionTypeTestedHandlingComponentProperties(JsonObject json, 27224 SpecimenDefinition owner, SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent res) 27225 throws IOException, FHIRFormatError { 27226 parseBackboneElementProperties(json, res); 27227 if (json.has("temperatureQualifier")) 27228 res.setTemperatureQualifier(parseCodeableConcept(getJObject(json, "temperatureQualifier"))); 27229 if (json.has("temperatureRange")) 27230 res.setTemperatureRange(parseRange(getJObject(json, "temperatureRange"))); 27231 if (json.has("maxDuration")) 27232 res.setMaxDuration(parseDuration(getJObject(json, "maxDuration"))); 27233 if (json.has("instruction")) 27234 res.setInstructionElement(parseString(json.get("instruction").getAsString())); 27235 if (json.has("_instruction")) 27236 parseElementProperties(getJObject(json, "_instruction"), res.getInstructionElement()); 27237 } 27238 27239 protected StructureDefinition parseStructureDefinition(JsonObject json) throws IOException, FHIRFormatError { 27240 StructureDefinition res = new StructureDefinition(); 27241 parseStructureDefinitionProperties(json, res); 27242 return res; 27243 } 27244 27245 protected void parseStructureDefinitionProperties(JsonObject json, StructureDefinition res) 27246 throws IOException, FHIRFormatError { 27247 parseDomainResourceProperties(json, res); 27248 if (json.has("url")) 27249 res.setUrlElement(parseUri(json.get("url").getAsString())); 27250 if (json.has("_url")) 27251 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 27252 if (json.has("identifier")) { 27253 JsonArray array = json.getAsJsonArray("identifier"); 27254 for (int i = 0; i < array.size(); i++) { 27255 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 27256 } 27257 } 27258 ; 27259 if (json.has("version")) 27260 res.setVersionElement(parseString(json.get("version").getAsString())); 27261 if (json.has("_version")) 27262 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 27263 if (json.has("name")) 27264 res.setNameElement(parseString(json.get("name").getAsString())); 27265 if (json.has("_name")) 27266 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 27267 if (json.has("title")) 27268 res.setTitleElement(parseString(json.get("title").getAsString())); 27269 if (json.has("_title")) 27270 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 27271 if (json.has("status")) 27272 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 27273 new Enumerations.PublicationStatusEnumFactory())); 27274 if (json.has("_status")) 27275 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 27276 if (json.has("experimental")) 27277 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 27278 if (json.has("_experimental")) 27279 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 27280 if (json.has("date")) 27281 res.setDateElement(parseDateTime(json.get("date").getAsString())); 27282 if (json.has("_date")) 27283 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 27284 if (json.has("publisher")) 27285 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 27286 if (json.has("_publisher")) 27287 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 27288 if (json.has("contact")) { 27289 JsonArray array = json.getAsJsonArray("contact"); 27290 for (int i = 0; i < array.size(); i++) { 27291 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 27292 } 27293 } 27294 ; 27295 if (json.has("description")) 27296 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 27297 if (json.has("_description")) 27298 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 27299 if (json.has("useContext")) { 27300 JsonArray array = json.getAsJsonArray("useContext"); 27301 for (int i = 0; i < array.size(); i++) { 27302 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 27303 } 27304 } 27305 ; 27306 if (json.has("jurisdiction")) { 27307 JsonArray array = json.getAsJsonArray("jurisdiction"); 27308 for (int i = 0; i < array.size(); i++) { 27309 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 27310 } 27311 } 27312 ; 27313 if (json.has("purpose")) 27314 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 27315 if (json.has("_purpose")) 27316 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 27317 if (json.has("copyright")) 27318 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 27319 if (json.has("_copyright")) 27320 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 27321 if (json.has("keyword")) { 27322 JsonArray array = json.getAsJsonArray("keyword"); 27323 for (int i = 0; i < array.size(); i++) { 27324 res.getKeyword().add(parseCoding(array.get(i).getAsJsonObject())); 27325 } 27326 } 27327 ; 27328 if (json.has("fhirVersion")) 27329 res.setFhirVersionElement(parseEnumeration(json.get("fhirVersion").getAsString(), Enumerations.FHIRVersion.NULL, 27330 new Enumerations.FHIRVersionEnumFactory())); 27331 if (json.has("_fhirVersion")) 27332 parseElementProperties(getJObject(json, "_fhirVersion"), res.getFhirVersionElement()); 27333 if (json.has("mapping")) { 27334 JsonArray array = json.getAsJsonArray("mapping"); 27335 for (int i = 0; i < array.size(); i++) { 27336 res.getMapping() 27337 .add(parseStructureDefinitionStructureDefinitionMappingComponent(array.get(i).getAsJsonObject(), res)); 27338 } 27339 } 27340 ; 27341 if (json.has("kind")) 27342 res.setKindElement( 27343 parseEnumeration(json.get("kind").getAsString(), StructureDefinition.StructureDefinitionKind.NULL, 27344 new StructureDefinition.StructureDefinitionKindEnumFactory())); 27345 if (json.has("_kind")) 27346 parseElementProperties(getJObject(json, "_kind"), res.getKindElement()); 27347 if (json.has("abstract")) 27348 res.setAbstractElement(parseBoolean(json.get("abstract").getAsBoolean())); 27349 if (json.has("_abstract")) 27350 parseElementProperties(getJObject(json, "_abstract"), res.getAbstractElement()); 27351 if (json.has("context")) { 27352 JsonArray array = json.getAsJsonArray("context"); 27353 for (int i = 0; i < array.size(); i++) { 27354 res.getContext() 27355 .add(parseStructureDefinitionStructureDefinitionContextComponent(array.get(i).getAsJsonObject(), res)); 27356 } 27357 } 27358 ; 27359 if (json.has("contextInvariant")) { 27360 JsonArray array = json.getAsJsonArray("contextInvariant"); 27361 for (int i = 0; i < array.size(); i++) { 27362 if (array.get(i).isJsonNull()) { 27363 res.getContextInvariant().add(new StringType()); 27364 } else { 27365 res.getContextInvariant().add(parseString(array.get(i).getAsString())); 27366 } 27367 } 27368 } 27369 ; 27370 if (json.has("_contextInvariant")) { 27371 JsonArray array = json.getAsJsonArray("_contextInvariant"); 27372 for (int i = 0; i < array.size(); i++) { 27373 if (i == res.getContextInvariant().size()) 27374 res.getContextInvariant().add(parseString(null)); 27375 if (array.get(i) instanceof JsonObject) 27376 parseElementProperties(array.get(i).getAsJsonObject(), res.getContextInvariant().get(i)); 27377 } 27378 } 27379 ; 27380 if (json.has("type")) 27381 res.setTypeElement(parseUri(json.get("type").getAsString())); 27382 if (json.has("_type")) 27383 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 27384 if (json.has("baseDefinition")) 27385 res.setBaseDefinitionElement(parseCanonical(json.get("baseDefinition").getAsString())); 27386 if (json.has("_baseDefinition")) 27387 parseElementProperties(getJObject(json, "_baseDefinition"), res.getBaseDefinitionElement()); 27388 if (json.has("derivation")) 27389 res.setDerivationElement(parseEnumeration(json.get("derivation").getAsString(), 27390 StructureDefinition.TypeDerivationRule.NULL, new StructureDefinition.TypeDerivationRuleEnumFactory())); 27391 if (json.has("_derivation")) 27392 parseElementProperties(getJObject(json, "_derivation"), res.getDerivationElement()); 27393 if (json.has("snapshot")) 27394 res.setSnapshot(parseStructureDefinitionStructureDefinitionSnapshotComponent(getJObject(json, "snapshot"), res)); 27395 if (json.has("differential")) 27396 res.setDifferential( 27397 parseStructureDefinitionStructureDefinitionDifferentialComponent(getJObject(json, "differential"), res)); 27398 } 27399 27400 protected StructureDefinition.StructureDefinitionMappingComponent parseStructureDefinitionStructureDefinitionMappingComponent( 27401 JsonObject json, StructureDefinition owner) throws IOException, FHIRFormatError { 27402 StructureDefinition.StructureDefinitionMappingComponent res = new StructureDefinition.StructureDefinitionMappingComponent(); 27403 parseStructureDefinitionStructureDefinitionMappingComponentProperties(json, owner, res); 27404 return res; 27405 } 27406 27407 protected void parseStructureDefinitionStructureDefinitionMappingComponentProperties(JsonObject json, 27408 StructureDefinition owner, StructureDefinition.StructureDefinitionMappingComponent res) 27409 throws IOException, FHIRFormatError { 27410 parseBackboneElementProperties(json, res); 27411 if (json.has("identity")) 27412 res.setIdentityElement(parseId(json.get("identity").getAsString())); 27413 if (json.has("_identity")) 27414 parseElementProperties(getJObject(json, "_identity"), res.getIdentityElement()); 27415 if (json.has("uri")) 27416 res.setUriElement(parseUri(json.get("uri").getAsString())); 27417 if (json.has("_uri")) 27418 parseElementProperties(getJObject(json, "_uri"), res.getUriElement()); 27419 if (json.has("name")) 27420 res.setNameElement(parseString(json.get("name").getAsString())); 27421 if (json.has("_name")) 27422 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 27423 if (json.has("comment")) 27424 res.setCommentElement(parseString(json.get("comment").getAsString())); 27425 if (json.has("_comment")) 27426 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 27427 } 27428 27429 protected StructureDefinition.StructureDefinitionContextComponent parseStructureDefinitionStructureDefinitionContextComponent( 27430 JsonObject json, StructureDefinition owner) throws IOException, FHIRFormatError { 27431 StructureDefinition.StructureDefinitionContextComponent res = new StructureDefinition.StructureDefinitionContextComponent(); 27432 parseStructureDefinitionStructureDefinitionContextComponentProperties(json, owner, res); 27433 return res; 27434 } 27435 27436 protected void parseStructureDefinitionStructureDefinitionContextComponentProperties(JsonObject json, 27437 StructureDefinition owner, StructureDefinition.StructureDefinitionContextComponent res) 27438 throws IOException, FHIRFormatError { 27439 parseBackboneElementProperties(json, res); 27440 if (json.has("type")) 27441 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), StructureDefinition.ExtensionContextType.NULL, 27442 new StructureDefinition.ExtensionContextTypeEnumFactory())); 27443 if (json.has("_type")) 27444 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 27445 if (json.has("expression")) 27446 res.setExpressionElement(parseString(json.get("expression").getAsString())); 27447 if (json.has("_expression")) 27448 parseElementProperties(getJObject(json, "_expression"), res.getExpressionElement()); 27449 } 27450 27451 protected StructureDefinition.StructureDefinitionSnapshotComponent parseStructureDefinitionStructureDefinitionSnapshotComponent( 27452 JsonObject json, StructureDefinition owner) throws IOException, FHIRFormatError { 27453 StructureDefinition.StructureDefinitionSnapshotComponent res = new StructureDefinition.StructureDefinitionSnapshotComponent(); 27454 parseStructureDefinitionStructureDefinitionSnapshotComponentProperties(json, owner, res); 27455 return res; 27456 } 27457 27458 protected void parseStructureDefinitionStructureDefinitionSnapshotComponentProperties(JsonObject json, 27459 StructureDefinition owner, StructureDefinition.StructureDefinitionSnapshotComponent res) 27460 throws IOException, FHIRFormatError { 27461 parseBackboneElementProperties(json, res); 27462 if (json.has("element")) { 27463 JsonArray array = json.getAsJsonArray("element"); 27464 for (int i = 0; i < array.size(); i++) { 27465 res.getElement().add(parseElementDefinition(array.get(i).getAsJsonObject())); 27466 } 27467 } 27468 ; 27469 } 27470 27471 protected StructureDefinition.StructureDefinitionDifferentialComponent parseStructureDefinitionStructureDefinitionDifferentialComponent( 27472 JsonObject json, StructureDefinition owner) throws IOException, FHIRFormatError { 27473 StructureDefinition.StructureDefinitionDifferentialComponent res = new StructureDefinition.StructureDefinitionDifferentialComponent(); 27474 parseStructureDefinitionStructureDefinitionDifferentialComponentProperties(json, owner, res); 27475 return res; 27476 } 27477 27478 protected void parseStructureDefinitionStructureDefinitionDifferentialComponentProperties(JsonObject json, 27479 StructureDefinition owner, StructureDefinition.StructureDefinitionDifferentialComponent res) 27480 throws IOException, FHIRFormatError { 27481 parseBackboneElementProperties(json, res); 27482 if (json.has("element")) { 27483 JsonArray array = json.getAsJsonArray("element"); 27484 for (int i = 0; i < array.size(); i++) { 27485 res.getElement().add(parseElementDefinition(array.get(i).getAsJsonObject())); 27486 } 27487 } 27488 ; 27489 } 27490 27491 protected StructureMap parseStructureMap(JsonObject json) throws IOException, FHIRFormatError { 27492 StructureMap res = new StructureMap(); 27493 parseStructureMapProperties(json, res); 27494 return res; 27495 } 27496 27497 protected void parseStructureMapProperties(JsonObject json, StructureMap res) throws IOException, FHIRFormatError { 27498 parseDomainResourceProperties(json, res); 27499 if (json.has("url")) 27500 res.setUrlElement(parseUri(json.get("url").getAsString())); 27501 if (json.has("_url")) 27502 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 27503 if (json.has("identifier")) { 27504 JsonArray array = json.getAsJsonArray("identifier"); 27505 for (int i = 0; i < array.size(); i++) { 27506 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 27507 } 27508 } 27509 ; 27510 if (json.has("version")) 27511 res.setVersionElement(parseString(json.get("version").getAsString())); 27512 if (json.has("_version")) 27513 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 27514 if (json.has("name")) 27515 res.setNameElement(parseString(json.get("name").getAsString())); 27516 if (json.has("_name")) 27517 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 27518 if (json.has("title")) 27519 res.setTitleElement(parseString(json.get("title").getAsString())); 27520 if (json.has("_title")) 27521 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 27522 if (json.has("status")) 27523 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 27524 new Enumerations.PublicationStatusEnumFactory())); 27525 if (json.has("_status")) 27526 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 27527 if (json.has("experimental")) 27528 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 27529 if (json.has("_experimental")) 27530 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 27531 if (json.has("date")) 27532 res.setDateElement(parseDateTime(json.get("date").getAsString())); 27533 if (json.has("_date")) 27534 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 27535 if (json.has("publisher")) 27536 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 27537 if (json.has("_publisher")) 27538 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 27539 if (json.has("contact")) { 27540 JsonArray array = json.getAsJsonArray("contact"); 27541 for (int i = 0; i < array.size(); i++) { 27542 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 27543 } 27544 } 27545 ; 27546 if (json.has("description")) 27547 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 27548 if (json.has("_description")) 27549 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 27550 if (json.has("useContext")) { 27551 JsonArray array = json.getAsJsonArray("useContext"); 27552 for (int i = 0; i < array.size(); i++) { 27553 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 27554 } 27555 } 27556 ; 27557 if (json.has("jurisdiction")) { 27558 JsonArray array = json.getAsJsonArray("jurisdiction"); 27559 for (int i = 0; i < array.size(); i++) { 27560 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 27561 } 27562 } 27563 ; 27564 if (json.has("purpose")) 27565 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 27566 if (json.has("_purpose")) 27567 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 27568 if (json.has("copyright")) 27569 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 27570 if (json.has("_copyright")) 27571 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 27572 if (json.has("structure")) { 27573 JsonArray array = json.getAsJsonArray("structure"); 27574 for (int i = 0; i < array.size(); i++) { 27575 res.getStructure().add(parseStructureMapStructureMapStructureComponent(array.get(i).getAsJsonObject(), res)); 27576 } 27577 } 27578 ; 27579 if (json.has("import")) { 27580 JsonArray array = json.getAsJsonArray("import"); 27581 for (int i = 0; i < array.size(); i++) { 27582 if (array.get(i).isJsonNull()) { 27583 res.getImport().add(new CanonicalType()); 27584 } else { 27585 res.getImport().add(parseCanonical(array.get(i).getAsString())); 27586 } 27587 } 27588 } 27589 ; 27590 if (json.has("_import")) { 27591 JsonArray array = json.getAsJsonArray("_import"); 27592 for (int i = 0; i < array.size(); i++) { 27593 if (i == res.getImport().size()) 27594 res.getImport().add(parseCanonical(null)); 27595 if (array.get(i) instanceof JsonObject) 27596 parseElementProperties(array.get(i).getAsJsonObject(), res.getImport().get(i)); 27597 } 27598 } 27599 ; 27600 if (json.has("group")) { 27601 JsonArray array = json.getAsJsonArray("group"); 27602 for (int i = 0; i < array.size(); i++) { 27603 res.getGroup().add(parseStructureMapStructureMapGroupComponent(array.get(i).getAsJsonObject(), res)); 27604 } 27605 } 27606 ; 27607 } 27608 27609 protected StructureMap.StructureMapStructureComponent parseStructureMapStructureMapStructureComponent(JsonObject json, 27610 StructureMap owner) throws IOException, FHIRFormatError { 27611 StructureMap.StructureMapStructureComponent res = new StructureMap.StructureMapStructureComponent(); 27612 parseStructureMapStructureMapStructureComponentProperties(json, owner, res); 27613 return res; 27614 } 27615 27616 protected void parseStructureMapStructureMapStructureComponentProperties(JsonObject json, StructureMap owner, 27617 StructureMap.StructureMapStructureComponent res) throws IOException, FHIRFormatError { 27618 parseBackboneElementProperties(json, res); 27619 if (json.has("url")) 27620 res.setUrlElement(parseCanonical(json.get("url").getAsString())); 27621 if (json.has("_url")) 27622 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 27623 if (json.has("mode")) 27624 res.setModeElement(parseEnumeration(json.get("mode").getAsString(), StructureMap.StructureMapModelMode.NULL, 27625 new StructureMap.StructureMapModelModeEnumFactory())); 27626 if (json.has("_mode")) 27627 parseElementProperties(getJObject(json, "_mode"), res.getModeElement()); 27628 if (json.has("alias")) 27629 res.setAliasElement(parseString(json.get("alias").getAsString())); 27630 if (json.has("_alias")) 27631 parseElementProperties(getJObject(json, "_alias"), res.getAliasElement()); 27632 if (json.has("documentation")) 27633 res.setDocumentationElement(parseString(json.get("documentation").getAsString())); 27634 if (json.has("_documentation")) 27635 parseElementProperties(getJObject(json, "_documentation"), res.getDocumentationElement()); 27636 } 27637 27638 protected StructureMap.StructureMapGroupComponent parseStructureMapStructureMapGroupComponent(JsonObject json, 27639 StructureMap owner) throws IOException, FHIRFormatError { 27640 StructureMap.StructureMapGroupComponent res = new StructureMap.StructureMapGroupComponent(); 27641 parseStructureMapStructureMapGroupComponentProperties(json, owner, res); 27642 return res; 27643 } 27644 27645 protected void parseStructureMapStructureMapGroupComponentProperties(JsonObject json, StructureMap owner, 27646 StructureMap.StructureMapGroupComponent res) throws IOException, FHIRFormatError { 27647 parseBackboneElementProperties(json, res); 27648 if (json.has("name")) 27649 res.setNameElement(parseId(json.get("name").getAsString())); 27650 if (json.has("_name")) 27651 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 27652 if (json.has("extends")) 27653 res.setExtendsElement(parseId(json.get("extends").getAsString())); 27654 if (json.has("_extends")) 27655 parseElementProperties(getJObject(json, "_extends"), res.getExtendsElement()); 27656 if (json.has("typeMode")) 27657 res.setTypeModeElement(parseEnumeration(json.get("typeMode").getAsString(), 27658 StructureMap.StructureMapGroupTypeMode.NULL, new StructureMap.StructureMapGroupTypeModeEnumFactory())); 27659 if (json.has("_typeMode")) 27660 parseElementProperties(getJObject(json, "_typeMode"), res.getTypeModeElement()); 27661 if (json.has("documentation")) 27662 res.setDocumentationElement(parseString(json.get("documentation").getAsString())); 27663 if (json.has("_documentation")) 27664 parseElementProperties(getJObject(json, "_documentation"), res.getDocumentationElement()); 27665 if (json.has("input")) { 27666 JsonArray array = json.getAsJsonArray("input"); 27667 for (int i = 0; i < array.size(); i++) { 27668 res.getInput().add(parseStructureMapStructureMapGroupInputComponent(array.get(i).getAsJsonObject(), owner)); 27669 } 27670 } 27671 ; 27672 if (json.has("rule")) { 27673 JsonArray array = json.getAsJsonArray("rule"); 27674 for (int i = 0; i < array.size(); i++) { 27675 res.getRule().add(parseStructureMapStructureMapGroupRuleComponent(array.get(i).getAsJsonObject(), owner)); 27676 } 27677 } 27678 ; 27679 } 27680 27681 protected StructureMap.StructureMapGroupInputComponent parseStructureMapStructureMapGroupInputComponent( 27682 JsonObject json, StructureMap owner) throws IOException, FHIRFormatError { 27683 StructureMap.StructureMapGroupInputComponent res = new StructureMap.StructureMapGroupInputComponent(); 27684 parseStructureMapStructureMapGroupInputComponentProperties(json, owner, res); 27685 return res; 27686 } 27687 27688 protected void parseStructureMapStructureMapGroupInputComponentProperties(JsonObject json, StructureMap owner, 27689 StructureMap.StructureMapGroupInputComponent res) throws IOException, FHIRFormatError { 27690 parseBackboneElementProperties(json, res); 27691 if (json.has("name")) 27692 res.setNameElement(parseId(json.get("name").getAsString())); 27693 if (json.has("_name")) 27694 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 27695 if (json.has("type")) 27696 res.setTypeElement(parseString(json.get("type").getAsString())); 27697 if (json.has("_type")) 27698 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 27699 if (json.has("mode")) 27700 res.setModeElement(parseEnumeration(json.get("mode").getAsString(), StructureMap.StructureMapInputMode.NULL, 27701 new StructureMap.StructureMapInputModeEnumFactory())); 27702 if (json.has("_mode")) 27703 parseElementProperties(getJObject(json, "_mode"), res.getModeElement()); 27704 if (json.has("documentation")) 27705 res.setDocumentationElement(parseString(json.get("documentation").getAsString())); 27706 if (json.has("_documentation")) 27707 parseElementProperties(getJObject(json, "_documentation"), res.getDocumentationElement()); 27708 } 27709 27710 protected StructureMap.StructureMapGroupRuleComponent parseStructureMapStructureMapGroupRuleComponent(JsonObject json, 27711 StructureMap owner) throws IOException, FHIRFormatError { 27712 StructureMap.StructureMapGroupRuleComponent res = new StructureMap.StructureMapGroupRuleComponent(); 27713 parseStructureMapStructureMapGroupRuleComponentProperties(json, owner, res); 27714 return res; 27715 } 27716 27717 protected void parseStructureMapStructureMapGroupRuleComponentProperties(JsonObject json, StructureMap owner, 27718 StructureMap.StructureMapGroupRuleComponent res) throws IOException, FHIRFormatError { 27719 parseBackboneElementProperties(json, res); 27720 if (json.has("name")) 27721 res.setNameElement(parseId(json.get("name").getAsString())); 27722 if (json.has("_name")) 27723 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 27724 if (json.has("source")) { 27725 JsonArray array = json.getAsJsonArray("source"); 27726 for (int i = 0; i < array.size(); i++) { 27727 res.getSource() 27728 .add(parseStructureMapStructureMapGroupRuleSourceComponent(array.get(i).getAsJsonObject(), owner)); 27729 } 27730 } 27731 ; 27732 if (json.has("target")) { 27733 JsonArray array = json.getAsJsonArray("target"); 27734 for (int i = 0; i < array.size(); i++) { 27735 res.getTarget() 27736 .add(parseStructureMapStructureMapGroupRuleTargetComponent(array.get(i).getAsJsonObject(), owner)); 27737 } 27738 } 27739 ; 27740 if (json.has("rule")) { 27741 JsonArray array = json.getAsJsonArray("rule"); 27742 for (int i = 0; i < array.size(); i++) { 27743 res.getRule().add(parseStructureMapStructureMapGroupRuleComponent(array.get(i).getAsJsonObject(), owner)); 27744 } 27745 } 27746 ; 27747 if (json.has("dependent")) { 27748 JsonArray array = json.getAsJsonArray("dependent"); 27749 for (int i = 0; i < array.size(); i++) { 27750 res.getDependent() 27751 .add(parseStructureMapStructureMapGroupRuleDependentComponent(array.get(i).getAsJsonObject(), owner)); 27752 } 27753 } 27754 ; 27755 if (json.has("documentation")) 27756 res.setDocumentationElement(parseString(json.get("documentation").getAsString())); 27757 if (json.has("_documentation")) 27758 parseElementProperties(getJObject(json, "_documentation"), res.getDocumentationElement()); 27759 } 27760 27761 protected StructureMap.StructureMapGroupRuleSourceComponent parseStructureMapStructureMapGroupRuleSourceComponent( 27762 JsonObject json, StructureMap owner) throws IOException, FHIRFormatError { 27763 StructureMap.StructureMapGroupRuleSourceComponent res = new StructureMap.StructureMapGroupRuleSourceComponent(); 27764 parseStructureMapStructureMapGroupRuleSourceComponentProperties(json, owner, res); 27765 return res; 27766 } 27767 27768 protected void parseStructureMapStructureMapGroupRuleSourceComponentProperties(JsonObject json, StructureMap owner, 27769 StructureMap.StructureMapGroupRuleSourceComponent res) throws IOException, FHIRFormatError { 27770 parseBackboneElementProperties(json, res); 27771 if (json.has("context")) 27772 res.setContextElement(parseId(json.get("context").getAsString())); 27773 if (json.has("_context")) 27774 parseElementProperties(getJObject(json, "_context"), res.getContextElement()); 27775 if (json.has("min")) 27776 res.setMinElement(parseInteger(json.get("min").getAsLong())); 27777 if (json.has("_min")) 27778 parseElementProperties(getJObject(json, "_min"), res.getMinElement()); 27779 if (json.has("max")) 27780 res.setMaxElement(parseString(json.get("max").getAsString())); 27781 if (json.has("_max")) 27782 parseElementProperties(getJObject(json, "_max"), res.getMaxElement()); 27783 if (json.has("type")) 27784 res.setTypeElement(parseString(json.get("type").getAsString())); 27785 if (json.has("_type")) 27786 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 27787 Type defaultValue = parseType("defaultValue", json); 27788 if (defaultValue != null) 27789 res.setDefaultValue(defaultValue); 27790 if (json.has("element")) 27791 res.setElementElement(parseString(json.get("element").getAsString())); 27792 if (json.has("_element")) 27793 parseElementProperties(getJObject(json, "_element"), res.getElementElement()); 27794 if (json.has("listMode")) 27795 res.setListModeElement(parseEnumeration(json.get("listMode").getAsString(), 27796 StructureMap.StructureMapSourceListMode.NULL, new StructureMap.StructureMapSourceListModeEnumFactory())); 27797 if (json.has("_listMode")) 27798 parseElementProperties(getJObject(json, "_listMode"), res.getListModeElement()); 27799 if (json.has("variable")) 27800 res.setVariableElement(parseId(json.get("variable").getAsString())); 27801 if (json.has("_variable")) 27802 parseElementProperties(getJObject(json, "_variable"), res.getVariableElement()); 27803 if (json.has("condition")) 27804 res.setConditionElement(parseString(json.get("condition").getAsString())); 27805 if (json.has("_condition")) 27806 parseElementProperties(getJObject(json, "_condition"), res.getConditionElement()); 27807 if (json.has("check")) 27808 res.setCheckElement(parseString(json.get("check").getAsString())); 27809 if (json.has("_check")) 27810 parseElementProperties(getJObject(json, "_check"), res.getCheckElement()); 27811 if (json.has("logMessage")) 27812 res.setLogMessageElement(parseString(json.get("logMessage").getAsString())); 27813 if (json.has("_logMessage")) 27814 parseElementProperties(getJObject(json, "_logMessage"), res.getLogMessageElement()); 27815 } 27816 27817 protected StructureMap.StructureMapGroupRuleTargetComponent parseStructureMapStructureMapGroupRuleTargetComponent( 27818 JsonObject json, StructureMap owner) throws IOException, FHIRFormatError { 27819 StructureMap.StructureMapGroupRuleTargetComponent res = new StructureMap.StructureMapGroupRuleTargetComponent(); 27820 parseStructureMapStructureMapGroupRuleTargetComponentProperties(json, owner, res); 27821 return res; 27822 } 27823 27824 protected void parseStructureMapStructureMapGroupRuleTargetComponentProperties(JsonObject json, StructureMap owner, 27825 StructureMap.StructureMapGroupRuleTargetComponent res) throws IOException, FHIRFormatError { 27826 parseBackboneElementProperties(json, res); 27827 if (json.has("context")) 27828 res.setContextElement(parseId(json.get("context").getAsString())); 27829 if (json.has("_context")) 27830 parseElementProperties(getJObject(json, "_context"), res.getContextElement()); 27831 if (json.has("contextType")) 27832 res.setContextTypeElement(parseEnumeration(json.get("contextType").getAsString(), 27833 StructureMap.StructureMapContextType.NULL, new StructureMap.StructureMapContextTypeEnumFactory())); 27834 if (json.has("_contextType")) 27835 parseElementProperties(getJObject(json, "_contextType"), res.getContextTypeElement()); 27836 if (json.has("element")) 27837 res.setElementElement(parseString(json.get("element").getAsString())); 27838 if (json.has("_element")) 27839 parseElementProperties(getJObject(json, "_element"), res.getElementElement()); 27840 if (json.has("variable")) 27841 res.setVariableElement(parseId(json.get("variable").getAsString())); 27842 if (json.has("_variable")) 27843 parseElementProperties(getJObject(json, "_variable"), res.getVariableElement()); 27844 if (json.has("listMode")) { 27845 JsonArray array = json.getAsJsonArray("listMode"); 27846 for (int i = 0; i < array.size(); i++) { 27847 if (array.get(i).isJsonNull()) { 27848 res.getListMode().add(new Enumeration<StructureMap.StructureMapTargetListMode>()); 27849 } else { 27850 res.getListMode().add(parseEnumeration(array.get(i).getAsString(), 27851 StructureMap.StructureMapTargetListMode.NULL, new StructureMap.StructureMapTargetListModeEnumFactory())); 27852 } 27853 } 27854 } 27855 ; 27856 if (json.has("_listMode")) { 27857 JsonArray array = json.getAsJsonArray("_listMode"); 27858 for (int i = 0; i < array.size(); i++) { 27859 if (i == res.getListMode().size()) 27860 res.getListMode().add(parseEnumeration(null, StructureMap.StructureMapTargetListMode.NULL, 27861 new StructureMap.StructureMapTargetListModeEnumFactory())); 27862 if (array.get(i) instanceof JsonObject) 27863 parseElementProperties(array.get(i).getAsJsonObject(), res.getListMode().get(i)); 27864 } 27865 } 27866 ; 27867 if (json.has("listRuleId")) 27868 res.setListRuleIdElement(parseId(json.get("listRuleId").getAsString())); 27869 if (json.has("_listRuleId")) 27870 parseElementProperties(getJObject(json, "_listRuleId"), res.getListRuleIdElement()); 27871 if (json.has("transform")) 27872 res.setTransformElement(parseEnumeration(json.get("transform").getAsString(), 27873 StructureMap.StructureMapTransform.NULL, new StructureMap.StructureMapTransformEnumFactory())); 27874 if (json.has("_transform")) 27875 parseElementProperties(getJObject(json, "_transform"), res.getTransformElement()); 27876 if (json.has("parameter")) { 27877 JsonArray array = json.getAsJsonArray("parameter"); 27878 for (int i = 0; i < array.size(); i++) { 27879 res.getParameter() 27880 .add(parseStructureMapStructureMapGroupRuleTargetParameterComponent(array.get(i).getAsJsonObject(), owner)); 27881 } 27882 } 27883 ; 27884 } 27885 27886 protected StructureMap.StructureMapGroupRuleTargetParameterComponent parseStructureMapStructureMapGroupRuleTargetParameterComponent( 27887 JsonObject json, StructureMap owner) throws IOException, FHIRFormatError { 27888 StructureMap.StructureMapGroupRuleTargetParameterComponent res = new StructureMap.StructureMapGroupRuleTargetParameterComponent(); 27889 parseStructureMapStructureMapGroupRuleTargetParameterComponentProperties(json, owner, res); 27890 return res; 27891 } 27892 27893 protected void parseStructureMapStructureMapGroupRuleTargetParameterComponentProperties(JsonObject json, 27894 StructureMap owner, StructureMap.StructureMapGroupRuleTargetParameterComponent res) 27895 throws IOException, FHIRFormatError { 27896 parseBackboneElementProperties(json, res); 27897 Type value = parseType("value", json); 27898 if (value != null) 27899 res.setValue(value); 27900 } 27901 27902 protected StructureMap.StructureMapGroupRuleDependentComponent parseStructureMapStructureMapGroupRuleDependentComponent( 27903 JsonObject json, StructureMap owner) throws IOException, FHIRFormatError { 27904 StructureMap.StructureMapGroupRuleDependentComponent res = new StructureMap.StructureMapGroupRuleDependentComponent(); 27905 parseStructureMapStructureMapGroupRuleDependentComponentProperties(json, owner, res); 27906 return res; 27907 } 27908 27909 protected void parseStructureMapStructureMapGroupRuleDependentComponentProperties(JsonObject json, StructureMap owner, 27910 StructureMap.StructureMapGroupRuleDependentComponent res) throws IOException, FHIRFormatError { 27911 parseBackboneElementProperties(json, res); 27912 if (json.has("name")) 27913 res.setNameElement(parseId(json.get("name").getAsString())); 27914 if (json.has("_name")) 27915 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 27916 if (json.has("variable")) { 27917 JsonArray array = json.getAsJsonArray("variable"); 27918 for (int i = 0; i < array.size(); i++) { 27919 if (array.get(i).isJsonNull()) { 27920 res.getVariable().add(new StringType()); 27921 } else { 27922 res.getVariable().add(parseString(array.get(i).getAsString())); 27923 } 27924 } 27925 } 27926 ; 27927 if (json.has("_variable")) { 27928 JsonArray array = json.getAsJsonArray("_variable"); 27929 for (int i = 0; i < array.size(); i++) { 27930 if (i == res.getVariable().size()) 27931 res.getVariable().add(parseString(null)); 27932 if (array.get(i) instanceof JsonObject) 27933 parseElementProperties(array.get(i).getAsJsonObject(), res.getVariable().get(i)); 27934 } 27935 } 27936 ; 27937 } 27938 27939 protected Subscription parseSubscription(JsonObject json) throws IOException, FHIRFormatError { 27940 Subscription res = new Subscription(); 27941 parseSubscriptionProperties(json, res); 27942 return res; 27943 } 27944 27945 protected void parseSubscriptionProperties(JsonObject json, Subscription res) throws IOException, FHIRFormatError { 27946 parseDomainResourceProperties(json, res); 27947 if (json.has("status")) 27948 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Subscription.SubscriptionStatus.NULL, 27949 new Subscription.SubscriptionStatusEnumFactory())); 27950 if (json.has("_status")) 27951 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 27952 if (json.has("contact")) { 27953 JsonArray array = json.getAsJsonArray("contact"); 27954 for (int i = 0; i < array.size(); i++) { 27955 res.getContact().add(parseContactPoint(array.get(i).getAsJsonObject())); 27956 } 27957 } 27958 ; 27959 if (json.has("end")) 27960 res.setEndElement(parseInstant(json.get("end").getAsString())); 27961 if (json.has("_end")) 27962 parseElementProperties(getJObject(json, "_end"), res.getEndElement()); 27963 if (json.has("reason")) 27964 res.setReasonElement(parseString(json.get("reason").getAsString())); 27965 if (json.has("_reason")) 27966 parseElementProperties(getJObject(json, "_reason"), res.getReasonElement()); 27967 if (json.has("criteria")) 27968 res.setCriteriaElement(parseString(json.get("criteria").getAsString())); 27969 if (json.has("_criteria")) 27970 parseElementProperties(getJObject(json, "_criteria"), res.getCriteriaElement()); 27971 if (json.has("error")) 27972 res.setErrorElement(parseString(json.get("error").getAsString())); 27973 if (json.has("_error")) 27974 parseElementProperties(getJObject(json, "_error"), res.getErrorElement()); 27975 if (json.has("channel")) 27976 res.setChannel(parseSubscriptionSubscriptionChannelComponent(getJObject(json, "channel"), res)); 27977 } 27978 27979 protected Subscription.SubscriptionChannelComponent parseSubscriptionSubscriptionChannelComponent(JsonObject json, 27980 Subscription owner) throws IOException, FHIRFormatError { 27981 Subscription.SubscriptionChannelComponent res = new Subscription.SubscriptionChannelComponent(); 27982 parseSubscriptionSubscriptionChannelComponentProperties(json, owner, res); 27983 return res; 27984 } 27985 27986 protected void parseSubscriptionSubscriptionChannelComponentProperties(JsonObject json, Subscription owner, 27987 Subscription.SubscriptionChannelComponent res) throws IOException, FHIRFormatError { 27988 parseBackboneElementProperties(json, res); 27989 if (json.has("type")) 27990 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), Subscription.SubscriptionChannelType.NULL, 27991 new Subscription.SubscriptionChannelTypeEnumFactory())); 27992 if (json.has("_type")) 27993 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 27994 if (json.has("endpoint")) 27995 res.setEndpointElement(parseUrl(json.get("endpoint").getAsString())); 27996 if (json.has("_endpoint")) 27997 parseElementProperties(getJObject(json, "_endpoint"), res.getEndpointElement()); 27998 if (json.has("payload")) 27999 res.setPayloadElement(parseCode(json.get("payload").getAsString())); 28000 if (json.has("_payload")) 28001 parseElementProperties(getJObject(json, "_payload"), res.getPayloadElement()); 28002 if (json.has("header")) { 28003 JsonArray array = json.getAsJsonArray("header"); 28004 for (int i = 0; i < array.size(); i++) { 28005 if (array.get(i).isJsonNull()) { 28006 res.getHeader().add(new StringType()); 28007 } else { 28008 res.getHeader().add(parseString(array.get(i).getAsString())); 28009 } 28010 } 28011 } 28012 ; 28013 if (json.has("_header")) { 28014 JsonArray array = json.getAsJsonArray("_header"); 28015 for (int i = 0; i < array.size(); i++) { 28016 if (i == res.getHeader().size()) 28017 res.getHeader().add(parseString(null)); 28018 if (array.get(i) instanceof JsonObject) 28019 parseElementProperties(array.get(i).getAsJsonObject(), res.getHeader().get(i)); 28020 } 28021 } 28022 ; 28023 } 28024 28025 protected Substance parseSubstance(JsonObject json) throws IOException, FHIRFormatError { 28026 Substance res = new Substance(); 28027 parseSubstanceProperties(json, res); 28028 return res; 28029 } 28030 28031 protected void parseSubstanceProperties(JsonObject json, Substance res) throws IOException, FHIRFormatError { 28032 parseDomainResourceProperties(json, res); 28033 if (json.has("identifier")) { 28034 JsonArray array = json.getAsJsonArray("identifier"); 28035 for (int i = 0; i < array.size(); i++) { 28036 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 28037 } 28038 } 28039 ; 28040 if (json.has("status")) 28041 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Substance.FHIRSubstanceStatus.NULL, 28042 new Substance.FHIRSubstanceStatusEnumFactory())); 28043 if (json.has("_status")) 28044 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 28045 if (json.has("category")) { 28046 JsonArray array = json.getAsJsonArray("category"); 28047 for (int i = 0; i < array.size(); i++) { 28048 res.getCategory().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 28049 } 28050 } 28051 ; 28052 if (json.has("code")) 28053 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 28054 if (json.has("description")) 28055 res.setDescriptionElement(parseString(json.get("description").getAsString())); 28056 if (json.has("_description")) 28057 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 28058 if (json.has("instance")) { 28059 JsonArray array = json.getAsJsonArray("instance"); 28060 for (int i = 0; i < array.size(); i++) { 28061 res.getInstance().add(parseSubstanceSubstanceInstanceComponent(array.get(i).getAsJsonObject(), res)); 28062 } 28063 } 28064 ; 28065 if (json.has("ingredient")) { 28066 JsonArray array = json.getAsJsonArray("ingredient"); 28067 for (int i = 0; i < array.size(); i++) { 28068 res.getIngredient().add(parseSubstanceSubstanceIngredientComponent(array.get(i).getAsJsonObject(), res)); 28069 } 28070 } 28071 ; 28072 } 28073 28074 protected Substance.SubstanceInstanceComponent parseSubstanceSubstanceInstanceComponent(JsonObject json, 28075 Substance owner) throws IOException, FHIRFormatError { 28076 Substance.SubstanceInstanceComponent res = new Substance.SubstanceInstanceComponent(); 28077 parseSubstanceSubstanceInstanceComponentProperties(json, owner, res); 28078 return res; 28079 } 28080 28081 protected void parseSubstanceSubstanceInstanceComponentProperties(JsonObject json, Substance owner, 28082 Substance.SubstanceInstanceComponent res) throws IOException, FHIRFormatError { 28083 parseBackboneElementProperties(json, res); 28084 if (json.has("identifier")) 28085 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 28086 if (json.has("expiry")) 28087 res.setExpiryElement(parseDateTime(json.get("expiry").getAsString())); 28088 if (json.has("_expiry")) 28089 parseElementProperties(getJObject(json, "_expiry"), res.getExpiryElement()); 28090 if (json.has("quantity")) 28091 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 28092 } 28093 28094 protected Substance.SubstanceIngredientComponent parseSubstanceSubstanceIngredientComponent(JsonObject json, 28095 Substance owner) throws IOException, FHIRFormatError { 28096 Substance.SubstanceIngredientComponent res = new Substance.SubstanceIngredientComponent(); 28097 parseSubstanceSubstanceIngredientComponentProperties(json, owner, res); 28098 return res; 28099 } 28100 28101 protected void parseSubstanceSubstanceIngredientComponentProperties(JsonObject json, Substance owner, 28102 Substance.SubstanceIngredientComponent res) throws IOException, FHIRFormatError { 28103 parseBackboneElementProperties(json, res); 28104 if (json.has("quantity")) 28105 res.setQuantity(parseRatio(getJObject(json, "quantity"))); 28106 Type substance = parseType("substance", json); 28107 if (substance != null) 28108 res.setSubstance(substance); 28109 } 28110 28111 protected SubstanceNucleicAcid parseSubstanceNucleicAcid(JsonObject json) throws IOException, FHIRFormatError { 28112 SubstanceNucleicAcid res = new SubstanceNucleicAcid(); 28113 parseSubstanceNucleicAcidProperties(json, res); 28114 return res; 28115 } 28116 28117 protected void parseSubstanceNucleicAcidProperties(JsonObject json, SubstanceNucleicAcid res) 28118 throws IOException, FHIRFormatError { 28119 parseDomainResourceProperties(json, res); 28120 if (json.has("sequenceType")) 28121 res.setSequenceType(parseCodeableConcept(getJObject(json, "sequenceType"))); 28122 if (json.has("numberOfSubunits")) 28123 res.setNumberOfSubunitsElement(parseInteger(json.get("numberOfSubunits").getAsLong())); 28124 if (json.has("_numberOfSubunits")) 28125 parseElementProperties(getJObject(json, "_numberOfSubunits"), res.getNumberOfSubunitsElement()); 28126 if (json.has("areaOfHybridisation")) 28127 res.setAreaOfHybridisationElement(parseString(json.get("areaOfHybridisation").getAsString())); 28128 if (json.has("_areaOfHybridisation")) 28129 parseElementProperties(getJObject(json, "_areaOfHybridisation"), res.getAreaOfHybridisationElement()); 28130 if (json.has("oligoNucleotideType")) 28131 res.setOligoNucleotideType(parseCodeableConcept(getJObject(json, "oligoNucleotideType"))); 28132 if (json.has("subunit")) { 28133 JsonArray array = json.getAsJsonArray("subunit"); 28134 for (int i = 0; i < array.size(); i++) { 28135 res.getSubunit() 28136 .add(parseSubstanceNucleicAcidSubstanceNucleicAcidSubunitComponent(array.get(i).getAsJsonObject(), res)); 28137 } 28138 } 28139 ; 28140 } 28141 28142 protected SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent parseSubstanceNucleicAcidSubstanceNucleicAcidSubunitComponent( 28143 JsonObject json, SubstanceNucleicAcid owner) throws IOException, FHIRFormatError { 28144 SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent res = new SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent(); 28145 parseSubstanceNucleicAcidSubstanceNucleicAcidSubunitComponentProperties(json, owner, res); 28146 return res; 28147 } 28148 28149 protected void parseSubstanceNucleicAcidSubstanceNucleicAcidSubunitComponentProperties(JsonObject json, 28150 SubstanceNucleicAcid owner, SubstanceNucleicAcid.SubstanceNucleicAcidSubunitComponent res) 28151 throws IOException, FHIRFormatError { 28152 parseBackboneElementProperties(json, res); 28153 if (json.has("subunit")) 28154 res.setSubunitElement(parseInteger(json.get("subunit").getAsLong())); 28155 if (json.has("_subunit")) 28156 parseElementProperties(getJObject(json, "_subunit"), res.getSubunitElement()); 28157 if (json.has("sequence")) 28158 res.setSequenceElement(parseString(json.get("sequence").getAsString())); 28159 if (json.has("_sequence")) 28160 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 28161 if (json.has("length")) 28162 res.setLengthElement(parseInteger(json.get("length").getAsLong())); 28163 if (json.has("_length")) 28164 parseElementProperties(getJObject(json, "_length"), res.getLengthElement()); 28165 if (json.has("sequenceAttachment")) 28166 res.setSequenceAttachment(parseAttachment(getJObject(json, "sequenceAttachment"))); 28167 if (json.has("fivePrime")) 28168 res.setFivePrime(parseCodeableConcept(getJObject(json, "fivePrime"))); 28169 if (json.has("threePrime")) 28170 res.setThreePrime(parseCodeableConcept(getJObject(json, "threePrime"))); 28171 if (json.has("linkage")) { 28172 JsonArray array = json.getAsJsonArray("linkage"); 28173 for (int i = 0; i < array.size(); i++) { 28174 res.getLinkage().add(parseSubstanceNucleicAcidSubstanceNucleicAcidSubunitLinkageComponent( 28175 array.get(i).getAsJsonObject(), owner)); 28176 } 28177 } 28178 ; 28179 if (json.has("sugar")) { 28180 JsonArray array = json.getAsJsonArray("sugar"); 28181 for (int i = 0; i < array.size(); i++) { 28182 res.getSugar().add( 28183 parseSubstanceNucleicAcidSubstanceNucleicAcidSubunitSugarComponent(array.get(i).getAsJsonObject(), owner)); 28184 } 28185 } 28186 ; 28187 } 28188 28189 protected SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent parseSubstanceNucleicAcidSubstanceNucleicAcidSubunitLinkageComponent( 28190 JsonObject json, SubstanceNucleicAcid owner) throws IOException, FHIRFormatError { 28191 SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent res = new SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent(); 28192 parseSubstanceNucleicAcidSubstanceNucleicAcidSubunitLinkageComponentProperties(json, owner, res); 28193 return res; 28194 } 28195 28196 protected void parseSubstanceNucleicAcidSubstanceNucleicAcidSubunitLinkageComponentProperties(JsonObject json, 28197 SubstanceNucleicAcid owner, SubstanceNucleicAcid.SubstanceNucleicAcidSubunitLinkageComponent res) 28198 throws IOException, FHIRFormatError { 28199 parseBackboneElementProperties(json, res); 28200 if (json.has("connectivity")) 28201 res.setConnectivityElement(parseString(json.get("connectivity").getAsString())); 28202 if (json.has("_connectivity")) 28203 parseElementProperties(getJObject(json, "_connectivity"), res.getConnectivityElement()); 28204 if (json.has("identifier")) 28205 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 28206 if (json.has("name")) 28207 res.setNameElement(parseString(json.get("name").getAsString())); 28208 if (json.has("_name")) 28209 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 28210 if (json.has("residueSite")) 28211 res.setResidueSiteElement(parseString(json.get("residueSite").getAsString())); 28212 if (json.has("_residueSite")) 28213 parseElementProperties(getJObject(json, "_residueSite"), res.getResidueSiteElement()); 28214 } 28215 28216 protected SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent parseSubstanceNucleicAcidSubstanceNucleicAcidSubunitSugarComponent( 28217 JsonObject json, SubstanceNucleicAcid owner) throws IOException, FHIRFormatError { 28218 SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent res = new SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent(); 28219 parseSubstanceNucleicAcidSubstanceNucleicAcidSubunitSugarComponentProperties(json, owner, res); 28220 return res; 28221 } 28222 28223 protected void parseSubstanceNucleicAcidSubstanceNucleicAcidSubunitSugarComponentProperties(JsonObject json, 28224 SubstanceNucleicAcid owner, SubstanceNucleicAcid.SubstanceNucleicAcidSubunitSugarComponent res) 28225 throws IOException, FHIRFormatError { 28226 parseBackboneElementProperties(json, res); 28227 if (json.has("identifier")) 28228 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 28229 if (json.has("name")) 28230 res.setNameElement(parseString(json.get("name").getAsString())); 28231 if (json.has("_name")) 28232 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 28233 if (json.has("residueSite")) 28234 res.setResidueSiteElement(parseString(json.get("residueSite").getAsString())); 28235 if (json.has("_residueSite")) 28236 parseElementProperties(getJObject(json, "_residueSite"), res.getResidueSiteElement()); 28237 } 28238 28239 protected SubstancePolymer parseSubstancePolymer(JsonObject json) throws IOException, FHIRFormatError { 28240 SubstancePolymer res = new SubstancePolymer(); 28241 parseSubstancePolymerProperties(json, res); 28242 return res; 28243 } 28244 28245 protected void parseSubstancePolymerProperties(JsonObject json, SubstancePolymer res) 28246 throws IOException, FHIRFormatError { 28247 parseDomainResourceProperties(json, res); 28248 if (json.has("class")) 28249 res.setClass_(parseCodeableConcept(getJObject(json, "class"))); 28250 if (json.has("geometry")) 28251 res.setGeometry(parseCodeableConcept(getJObject(json, "geometry"))); 28252 if (json.has("copolymerConnectivity")) { 28253 JsonArray array = json.getAsJsonArray("copolymerConnectivity"); 28254 for (int i = 0; i < array.size(); i++) { 28255 res.getCopolymerConnectivity().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 28256 } 28257 } 28258 ; 28259 if (json.has("modification")) { 28260 JsonArray array = json.getAsJsonArray("modification"); 28261 for (int i = 0; i < array.size(); i++) { 28262 if (array.get(i).isJsonNull()) { 28263 res.getModification().add(new StringType()); 28264 } else { 28265 res.getModification().add(parseString(array.get(i).getAsString())); 28266 } 28267 } 28268 } 28269 ; 28270 if (json.has("_modification")) { 28271 JsonArray array = json.getAsJsonArray("_modification"); 28272 for (int i = 0; i < array.size(); i++) { 28273 if (i == res.getModification().size()) 28274 res.getModification().add(parseString(null)); 28275 if (array.get(i) instanceof JsonObject) 28276 parseElementProperties(array.get(i).getAsJsonObject(), res.getModification().get(i)); 28277 } 28278 } 28279 ; 28280 if (json.has("monomerSet")) { 28281 JsonArray array = json.getAsJsonArray("monomerSet"); 28282 for (int i = 0; i < array.size(); i++) { 28283 res.getMonomerSet() 28284 .add(parseSubstancePolymerSubstancePolymerMonomerSetComponent(array.get(i).getAsJsonObject(), res)); 28285 } 28286 } 28287 ; 28288 if (json.has("repeat")) { 28289 JsonArray array = json.getAsJsonArray("repeat"); 28290 for (int i = 0; i < array.size(); i++) { 28291 res.getRepeat().add(parseSubstancePolymerSubstancePolymerRepeatComponent(array.get(i).getAsJsonObject(), res)); 28292 } 28293 } 28294 ; 28295 } 28296 28297 protected SubstancePolymer.SubstancePolymerMonomerSetComponent parseSubstancePolymerSubstancePolymerMonomerSetComponent( 28298 JsonObject json, SubstancePolymer owner) throws IOException, FHIRFormatError { 28299 SubstancePolymer.SubstancePolymerMonomerSetComponent res = new SubstancePolymer.SubstancePolymerMonomerSetComponent(); 28300 parseSubstancePolymerSubstancePolymerMonomerSetComponentProperties(json, owner, res); 28301 return res; 28302 } 28303 28304 protected void parseSubstancePolymerSubstancePolymerMonomerSetComponentProperties(JsonObject json, 28305 SubstancePolymer owner, SubstancePolymer.SubstancePolymerMonomerSetComponent res) 28306 throws IOException, FHIRFormatError { 28307 parseBackboneElementProperties(json, res); 28308 if (json.has("ratioType")) 28309 res.setRatioType(parseCodeableConcept(getJObject(json, "ratioType"))); 28310 if (json.has("startingMaterial")) { 28311 JsonArray array = json.getAsJsonArray("startingMaterial"); 28312 for (int i = 0; i < array.size(); i++) { 28313 res.getStartingMaterial().add(parseSubstancePolymerSubstancePolymerMonomerSetStartingMaterialComponent( 28314 array.get(i).getAsJsonObject(), owner)); 28315 } 28316 } 28317 ; 28318 } 28319 28320 protected SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent parseSubstancePolymerSubstancePolymerMonomerSetStartingMaterialComponent( 28321 JsonObject json, SubstancePolymer owner) throws IOException, FHIRFormatError { 28322 SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent res = new SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent(); 28323 parseSubstancePolymerSubstancePolymerMonomerSetStartingMaterialComponentProperties(json, owner, res); 28324 return res; 28325 } 28326 28327 protected void parseSubstancePolymerSubstancePolymerMonomerSetStartingMaterialComponentProperties(JsonObject json, 28328 SubstancePolymer owner, SubstancePolymer.SubstancePolymerMonomerSetStartingMaterialComponent res) 28329 throws IOException, FHIRFormatError { 28330 parseBackboneElementProperties(json, res); 28331 if (json.has("material")) 28332 res.setMaterial(parseCodeableConcept(getJObject(json, "material"))); 28333 if (json.has("type")) 28334 res.setType(parseCodeableConcept(getJObject(json, "type"))); 28335 if (json.has("isDefining")) 28336 res.setIsDefiningElement(parseBoolean(json.get("isDefining").getAsBoolean())); 28337 if (json.has("_isDefining")) 28338 parseElementProperties(getJObject(json, "_isDefining"), res.getIsDefiningElement()); 28339 if (json.has("amount")) 28340 res.setAmount(parseSubstanceAmount(getJObject(json, "amount"))); 28341 } 28342 28343 protected SubstancePolymer.SubstancePolymerRepeatComponent parseSubstancePolymerSubstancePolymerRepeatComponent( 28344 JsonObject json, SubstancePolymer owner) throws IOException, FHIRFormatError { 28345 SubstancePolymer.SubstancePolymerRepeatComponent res = new SubstancePolymer.SubstancePolymerRepeatComponent(); 28346 parseSubstancePolymerSubstancePolymerRepeatComponentProperties(json, owner, res); 28347 return res; 28348 } 28349 28350 protected void parseSubstancePolymerSubstancePolymerRepeatComponentProperties(JsonObject json, SubstancePolymer owner, 28351 SubstancePolymer.SubstancePolymerRepeatComponent res) throws IOException, FHIRFormatError { 28352 parseBackboneElementProperties(json, res); 28353 if (json.has("numberOfUnits")) 28354 res.setNumberOfUnitsElement(parseInteger(json.get("numberOfUnits").getAsLong())); 28355 if (json.has("_numberOfUnits")) 28356 parseElementProperties(getJObject(json, "_numberOfUnits"), res.getNumberOfUnitsElement()); 28357 if (json.has("averageMolecularFormula")) 28358 res.setAverageMolecularFormulaElement(parseString(json.get("averageMolecularFormula").getAsString())); 28359 if (json.has("_averageMolecularFormula")) 28360 parseElementProperties(getJObject(json, "_averageMolecularFormula"), res.getAverageMolecularFormulaElement()); 28361 if (json.has("repeatUnitAmountType")) 28362 res.setRepeatUnitAmountType(parseCodeableConcept(getJObject(json, "repeatUnitAmountType"))); 28363 if (json.has("repeatUnit")) { 28364 JsonArray array = json.getAsJsonArray("repeatUnit"); 28365 for (int i = 0; i < array.size(); i++) { 28366 res.getRepeatUnit() 28367 .add(parseSubstancePolymerSubstancePolymerRepeatRepeatUnitComponent(array.get(i).getAsJsonObject(), owner)); 28368 } 28369 } 28370 ; 28371 } 28372 28373 protected SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent parseSubstancePolymerSubstancePolymerRepeatRepeatUnitComponent( 28374 JsonObject json, SubstancePolymer owner) throws IOException, FHIRFormatError { 28375 SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent res = new SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent(); 28376 parseSubstancePolymerSubstancePolymerRepeatRepeatUnitComponentProperties(json, owner, res); 28377 return res; 28378 } 28379 28380 protected void parseSubstancePolymerSubstancePolymerRepeatRepeatUnitComponentProperties(JsonObject json, 28381 SubstancePolymer owner, SubstancePolymer.SubstancePolymerRepeatRepeatUnitComponent res) 28382 throws IOException, FHIRFormatError { 28383 parseBackboneElementProperties(json, res); 28384 if (json.has("orientationOfPolymerisation")) 28385 res.setOrientationOfPolymerisation(parseCodeableConcept(getJObject(json, "orientationOfPolymerisation"))); 28386 if (json.has("repeatUnit")) 28387 res.setRepeatUnitElement(parseString(json.get("repeatUnit").getAsString())); 28388 if (json.has("_repeatUnit")) 28389 parseElementProperties(getJObject(json, "_repeatUnit"), res.getRepeatUnitElement()); 28390 if (json.has("amount")) 28391 res.setAmount(parseSubstanceAmount(getJObject(json, "amount"))); 28392 if (json.has("degreeOfPolymerisation")) { 28393 JsonArray array = json.getAsJsonArray("degreeOfPolymerisation"); 28394 for (int i = 0; i < array.size(); i++) { 28395 res.getDegreeOfPolymerisation() 28396 .add(parseSubstancePolymerSubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent( 28397 array.get(i).getAsJsonObject(), owner)); 28398 } 28399 } 28400 ; 28401 if (json.has("structuralRepresentation")) { 28402 JsonArray array = json.getAsJsonArray("structuralRepresentation"); 28403 for (int i = 0; i < array.size(); i++) { 28404 res.getStructuralRepresentation() 28405 .add(parseSubstancePolymerSubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent( 28406 array.get(i).getAsJsonObject(), owner)); 28407 } 28408 } 28409 ; 28410 } 28411 28412 protected SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent parseSubstancePolymerSubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent( 28413 JsonObject json, SubstancePolymer owner) throws IOException, FHIRFormatError { 28414 SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent res = new SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent(); 28415 parseSubstancePolymerSubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponentProperties(json, owner, res); 28416 return res; 28417 } 28418 28419 protected void parseSubstancePolymerSubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponentProperties( 28420 JsonObject json, SubstancePolymer owner, 28421 SubstancePolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent res) 28422 throws IOException, FHIRFormatError { 28423 parseBackboneElementProperties(json, res); 28424 if (json.has("degree")) 28425 res.setDegree(parseCodeableConcept(getJObject(json, "degree"))); 28426 if (json.has("amount")) 28427 res.setAmount(parseSubstanceAmount(getJObject(json, "amount"))); 28428 } 28429 28430 protected SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent parseSubstancePolymerSubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent( 28431 JsonObject json, SubstancePolymer owner) throws IOException, FHIRFormatError { 28432 SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent res = new SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent(); 28433 parseSubstancePolymerSubstancePolymerRepeatRepeatUnitStructuralRepresentationComponentProperties(json, owner, res); 28434 return res; 28435 } 28436 28437 protected void parseSubstancePolymerSubstancePolymerRepeatRepeatUnitStructuralRepresentationComponentProperties( 28438 JsonObject json, SubstancePolymer owner, 28439 SubstancePolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent res) 28440 throws IOException, FHIRFormatError { 28441 parseBackboneElementProperties(json, res); 28442 if (json.has("type")) 28443 res.setType(parseCodeableConcept(getJObject(json, "type"))); 28444 if (json.has("representation")) 28445 res.setRepresentationElement(parseString(json.get("representation").getAsString())); 28446 if (json.has("_representation")) 28447 parseElementProperties(getJObject(json, "_representation"), res.getRepresentationElement()); 28448 if (json.has("attachment")) 28449 res.setAttachment(parseAttachment(getJObject(json, "attachment"))); 28450 } 28451 28452 protected SubstanceProtein parseSubstanceProtein(JsonObject json) throws IOException, FHIRFormatError { 28453 SubstanceProtein res = new SubstanceProtein(); 28454 parseSubstanceProteinProperties(json, res); 28455 return res; 28456 } 28457 28458 protected void parseSubstanceProteinProperties(JsonObject json, SubstanceProtein res) 28459 throws IOException, FHIRFormatError { 28460 parseDomainResourceProperties(json, res); 28461 if (json.has("sequenceType")) 28462 res.setSequenceType(parseCodeableConcept(getJObject(json, "sequenceType"))); 28463 if (json.has("numberOfSubunits")) 28464 res.setNumberOfSubunitsElement(parseInteger(json.get("numberOfSubunits").getAsLong())); 28465 if (json.has("_numberOfSubunits")) 28466 parseElementProperties(getJObject(json, "_numberOfSubunits"), res.getNumberOfSubunitsElement()); 28467 if (json.has("disulfideLinkage")) { 28468 JsonArray array = json.getAsJsonArray("disulfideLinkage"); 28469 for (int i = 0; i < array.size(); i++) { 28470 if (array.get(i).isJsonNull()) { 28471 res.getDisulfideLinkage().add(new StringType()); 28472 } else { 28473 res.getDisulfideLinkage().add(parseString(array.get(i).getAsString())); 28474 } 28475 } 28476 } 28477 ; 28478 if (json.has("_disulfideLinkage")) { 28479 JsonArray array = json.getAsJsonArray("_disulfideLinkage"); 28480 for (int i = 0; i < array.size(); i++) { 28481 if (i == res.getDisulfideLinkage().size()) 28482 res.getDisulfideLinkage().add(parseString(null)); 28483 if (array.get(i) instanceof JsonObject) 28484 parseElementProperties(array.get(i).getAsJsonObject(), res.getDisulfideLinkage().get(i)); 28485 } 28486 } 28487 ; 28488 if (json.has("subunit")) { 28489 JsonArray array = json.getAsJsonArray("subunit"); 28490 for (int i = 0; i < array.size(); i++) { 28491 res.getSubunit() 28492 .add(parseSubstanceProteinSubstanceProteinSubunitComponent(array.get(i).getAsJsonObject(), res)); 28493 } 28494 } 28495 ; 28496 } 28497 28498 protected SubstanceProtein.SubstanceProteinSubunitComponent parseSubstanceProteinSubstanceProteinSubunitComponent( 28499 JsonObject json, SubstanceProtein owner) throws IOException, FHIRFormatError { 28500 SubstanceProtein.SubstanceProteinSubunitComponent res = new SubstanceProtein.SubstanceProteinSubunitComponent(); 28501 parseSubstanceProteinSubstanceProteinSubunitComponentProperties(json, owner, res); 28502 return res; 28503 } 28504 28505 protected void parseSubstanceProteinSubstanceProteinSubunitComponentProperties(JsonObject json, 28506 SubstanceProtein owner, SubstanceProtein.SubstanceProteinSubunitComponent res) 28507 throws IOException, FHIRFormatError { 28508 parseBackboneElementProperties(json, res); 28509 if (json.has("subunit")) 28510 res.setSubunitElement(parseInteger(json.get("subunit").getAsLong())); 28511 if (json.has("_subunit")) 28512 parseElementProperties(getJObject(json, "_subunit"), res.getSubunitElement()); 28513 if (json.has("sequence")) 28514 res.setSequenceElement(parseString(json.get("sequence").getAsString())); 28515 if (json.has("_sequence")) 28516 parseElementProperties(getJObject(json, "_sequence"), res.getSequenceElement()); 28517 if (json.has("length")) 28518 res.setLengthElement(parseInteger(json.get("length").getAsLong())); 28519 if (json.has("_length")) 28520 parseElementProperties(getJObject(json, "_length"), res.getLengthElement()); 28521 if (json.has("sequenceAttachment")) 28522 res.setSequenceAttachment(parseAttachment(getJObject(json, "sequenceAttachment"))); 28523 if (json.has("nTerminalModificationId")) 28524 res.setNTerminalModificationId(parseIdentifier(getJObject(json, "nTerminalModificationId"))); 28525 if (json.has("nTerminalModification")) 28526 res.setNTerminalModificationElement(parseString(json.get("nTerminalModification").getAsString())); 28527 if (json.has("_nTerminalModification")) 28528 parseElementProperties(getJObject(json, "_nTerminalModification"), res.getNTerminalModificationElement()); 28529 if (json.has("cTerminalModificationId")) 28530 res.setCTerminalModificationId(parseIdentifier(getJObject(json, "cTerminalModificationId"))); 28531 if (json.has("cTerminalModification")) 28532 res.setCTerminalModificationElement(parseString(json.get("cTerminalModification").getAsString())); 28533 if (json.has("_cTerminalModification")) 28534 parseElementProperties(getJObject(json, "_cTerminalModification"), res.getCTerminalModificationElement()); 28535 } 28536 28537 protected SubstanceReferenceInformation parseSubstanceReferenceInformation(JsonObject json) 28538 throws IOException, FHIRFormatError { 28539 SubstanceReferenceInformation res = new SubstanceReferenceInformation(); 28540 parseSubstanceReferenceInformationProperties(json, res); 28541 return res; 28542 } 28543 28544 protected void parseSubstanceReferenceInformationProperties(JsonObject json, SubstanceReferenceInformation res) 28545 throws IOException, FHIRFormatError { 28546 parseDomainResourceProperties(json, res); 28547 if (json.has("comment")) 28548 res.setCommentElement(parseString(json.get("comment").getAsString())); 28549 if (json.has("_comment")) 28550 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 28551 if (json.has("gene")) { 28552 JsonArray array = json.getAsJsonArray("gene"); 28553 for (int i = 0; i < array.size(); i++) { 28554 res.getGene().add(parseSubstanceReferenceInformationSubstanceReferenceInformationGeneComponent( 28555 array.get(i).getAsJsonObject(), res)); 28556 } 28557 } 28558 ; 28559 if (json.has("geneElement")) { 28560 JsonArray array = json.getAsJsonArray("geneElement"); 28561 for (int i = 0; i < array.size(); i++) { 28562 res.getGeneElement().add(parseSubstanceReferenceInformationSubstanceReferenceInformationGeneElementComponent( 28563 array.get(i).getAsJsonObject(), res)); 28564 } 28565 } 28566 ; 28567 if (json.has("classification")) { 28568 JsonArray array = json.getAsJsonArray("classification"); 28569 for (int i = 0; i < array.size(); i++) { 28570 res.getClassification() 28571 .add(parseSubstanceReferenceInformationSubstanceReferenceInformationClassificationComponent( 28572 array.get(i).getAsJsonObject(), res)); 28573 } 28574 } 28575 ; 28576 if (json.has("target")) { 28577 JsonArray array = json.getAsJsonArray("target"); 28578 for (int i = 0; i < array.size(); i++) { 28579 res.getTarget().add(parseSubstanceReferenceInformationSubstanceReferenceInformationTargetComponent( 28580 array.get(i).getAsJsonObject(), res)); 28581 } 28582 } 28583 ; 28584 } 28585 28586 protected SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent parseSubstanceReferenceInformationSubstanceReferenceInformationGeneComponent( 28587 JsonObject json, SubstanceReferenceInformation owner) throws IOException, FHIRFormatError { 28588 SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent res = new SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent(); 28589 parseSubstanceReferenceInformationSubstanceReferenceInformationGeneComponentProperties(json, owner, res); 28590 return res; 28591 } 28592 28593 protected void parseSubstanceReferenceInformationSubstanceReferenceInformationGeneComponentProperties(JsonObject json, 28594 SubstanceReferenceInformation owner, SubstanceReferenceInformation.SubstanceReferenceInformationGeneComponent res) 28595 throws IOException, FHIRFormatError { 28596 parseBackboneElementProperties(json, res); 28597 if (json.has("geneSequenceOrigin")) 28598 res.setGeneSequenceOrigin(parseCodeableConcept(getJObject(json, "geneSequenceOrigin"))); 28599 if (json.has("gene")) 28600 res.setGene(parseCodeableConcept(getJObject(json, "gene"))); 28601 if (json.has("source")) { 28602 JsonArray array = json.getAsJsonArray("source"); 28603 for (int i = 0; i < array.size(); i++) { 28604 res.getSource().add(parseReference(array.get(i).getAsJsonObject())); 28605 } 28606 } 28607 ; 28608 } 28609 28610 protected SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent parseSubstanceReferenceInformationSubstanceReferenceInformationGeneElementComponent( 28611 JsonObject json, SubstanceReferenceInformation owner) throws IOException, FHIRFormatError { 28612 SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent res = new SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent(); 28613 parseSubstanceReferenceInformationSubstanceReferenceInformationGeneElementComponentProperties(json, owner, res); 28614 return res; 28615 } 28616 28617 protected void parseSubstanceReferenceInformationSubstanceReferenceInformationGeneElementComponentProperties( 28618 JsonObject json, SubstanceReferenceInformation owner, 28619 SubstanceReferenceInformation.SubstanceReferenceInformationGeneElementComponent res) 28620 throws IOException, FHIRFormatError { 28621 parseBackboneElementProperties(json, res); 28622 if (json.has("type")) 28623 res.setType(parseCodeableConcept(getJObject(json, "type"))); 28624 if (json.has("element")) 28625 res.setElement(parseIdentifier(getJObject(json, "element"))); 28626 if (json.has("source")) { 28627 JsonArray array = json.getAsJsonArray("source"); 28628 for (int i = 0; i < array.size(); i++) { 28629 res.getSource().add(parseReference(array.get(i).getAsJsonObject())); 28630 } 28631 } 28632 ; 28633 } 28634 28635 protected SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent parseSubstanceReferenceInformationSubstanceReferenceInformationClassificationComponent( 28636 JsonObject json, SubstanceReferenceInformation owner) throws IOException, FHIRFormatError { 28637 SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent res = new SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent(); 28638 parseSubstanceReferenceInformationSubstanceReferenceInformationClassificationComponentProperties(json, owner, res); 28639 return res; 28640 } 28641 28642 protected void parseSubstanceReferenceInformationSubstanceReferenceInformationClassificationComponentProperties( 28643 JsonObject json, SubstanceReferenceInformation owner, 28644 SubstanceReferenceInformation.SubstanceReferenceInformationClassificationComponent res) 28645 throws IOException, FHIRFormatError { 28646 parseBackboneElementProperties(json, res); 28647 if (json.has("domain")) 28648 res.setDomain(parseCodeableConcept(getJObject(json, "domain"))); 28649 if (json.has("classification")) 28650 res.setClassification(parseCodeableConcept(getJObject(json, "classification"))); 28651 if (json.has("subtype")) { 28652 JsonArray array = json.getAsJsonArray("subtype"); 28653 for (int i = 0; i < array.size(); i++) { 28654 res.getSubtype().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 28655 } 28656 } 28657 ; 28658 if (json.has("source")) { 28659 JsonArray array = json.getAsJsonArray("source"); 28660 for (int i = 0; i < array.size(); i++) { 28661 res.getSource().add(parseReference(array.get(i).getAsJsonObject())); 28662 } 28663 } 28664 ; 28665 } 28666 28667 protected SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent parseSubstanceReferenceInformationSubstanceReferenceInformationTargetComponent( 28668 JsonObject json, SubstanceReferenceInformation owner) throws IOException, FHIRFormatError { 28669 SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent res = new SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent(); 28670 parseSubstanceReferenceInformationSubstanceReferenceInformationTargetComponentProperties(json, owner, res); 28671 return res; 28672 } 28673 28674 protected void parseSubstanceReferenceInformationSubstanceReferenceInformationTargetComponentProperties( 28675 JsonObject json, SubstanceReferenceInformation owner, 28676 SubstanceReferenceInformation.SubstanceReferenceInformationTargetComponent res) 28677 throws IOException, FHIRFormatError { 28678 parseBackboneElementProperties(json, res); 28679 if (json.has("target")) 28680 res.setTarget(parseIdentifier(getJObject(json, "target"))); 28681 if (json.has("type")) 28682 res.setType(parseCodeableConcept(getJObject(json, "type"))); 28683 if (json.has("interaction")) 28684 res.setInteraction(parseCodeableConcept(getJObject(json, "interaction"))); 28685 if (json.has("organism")) 28686 res.setOrganism(parseCodeableConcept(getJObject(json, "organism"))); 28687 if (json.has("organismType")) 28688 res.setOrganismType(parseCodeableConcept(getJObject(json, "organismType"))); 28689 Type amount = parseType("amount", json); 28690 if (amount != null) 28691 res.setAmount(amount); 28692 if (json.has("amountType")) 28693 res.setAmountType(parseCodeableConcept(getJObject(json, "amountType"))); 28694 if (json.has("source")) { 28695 JsonArray array = json.getAsJsonArray("source"); 28696 for (int i = 0; i < array.size(); i++) { 28697 res.getSource().add(parseReference(array.get(i).getAsJsonObject())); 28698 } 28699 } 28700 ; 28701 } 28702 28703 protected SubstanceSourceMaterial parseSubstanceSourceMaterial(JsonObject json) throws IOException, FHIRFormatError { 28704 SubstanceSourceMaterial res = new SubstanceSourceMaterial(); 28705 parseSubstanceSourceMaterialProperties(json, res); 28706 return res; 28707 } 28708 28709 protected void parseSubstanceSourceMaterialProperties(JsonObject json, SubstanceSourceMaterial res) 28710 throws IOException, FHIRFormatError { 28711 parseDomainResourceProperties(json, res); 28712 if (json.has("sourceMaterialClass")) 28713 res.setSourceMaterialClass(parseCodeableConcept(getJObject(json, "sourceMaterialClass"))); 28714 if (json.has("sourceMaterialType")) 28715 res.setSourceMaterialType(parseCodeableConcept(getJObject(json, "sourceMaterialType"))); 28716 if (json.has("sourceMaterialState")) 28717 res.setSourceMaterialState(parseCodeableConcept(getJObject(json, "sourceMaterialState"))); 28718 if (json.has("organismId")) 28719 res.setOrganismId(parseIdentifier(getJObject(json, "organismId"))); 28720 if (json.has("organismName")) 28721 res.setOrganismNameElement(parseString(json.get("organismName").getAsString())); 28722 if (json.has("_organismName")) 28723 parseElementProperties(getJObject(json, "_organismName"), res.getOrganismNameElement()); 28724 if (json.has("parentSubstanceId")) { 28725 JsonArray array = json.getAsJsonArray("parentSubstanceId"); 28726 for (int i = 0; i < array.size(); i++) { 28727 res.getParentSubstanceId().add(parseIdentifier(array.get(i).getAsJsonObject())); 28728 } 28729 } 28730 ; 28731 if (json.has("parentSubstanceName")) { 28732 JsonArray array = json.getAsJsonArray("parentSubstanceName"); 28733 for (int i = 0; i < array.size(); i++) { 28734 if (array.get(i).isJsonNull()) { 28735 res.getParentSubstanceName().add(new StringType()); 28736 } else { 28737 res.getParentSubstanceName().add(parseString(array.get(i).getAsString())); 28738 } 28739 } 28740 } 28741 ; 28742 if (json.has("_parentSubstanceName")) { 28743 JsonArray array = json.getAsJsonArray("_parentSubstanceName"); 28744 for (int i = 0; i < array.size(); i++) { 28745 if (i == res.getParentSubstanceName().size()) 28746 res.getParentSubstanceName().add(parseString(null)); 28747 if (array.get(i) instanceof JsonObject) 28748 parseElementProperties(array.get(i).getAsJsonObject(), res.getParentSubstanceName().get(i)); 28749 } 28750 } 28751 ; 28752 if (json.has("countryOfOrigin")) { 28753 JsonArray array = json.getAsJsonArray("countryOfOrigin"); 28754 for (int i = 0; i < array.size(); i++) { 28755 res.getCountryOfOrigin().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 28756 } 28757 } 28758 ; 28759 if (json.has("geographicalLocation")) { 28760 JsonArray array = json.getAsJsonArray("geographicalLocation"); 28761 for (int i = 0; i < array.size(); i++) { 28762 if (array.get(i).isJsonNull()) { 28763 res.getGeographicalLocation().add(new StringType()); 28764 } else { 28765 res.getGeographicalLocation().add(parseString(array.get(i).getAsString())); 28766 } 28767 } 28768 } 28769 ; 28770 if (json.has("_geographicalLocation")) { 28771 JsonArray array = json.getAsJsonArray("_geographicalLocation"); 28772 for (int i = 0; i < array.size(); i++) { 28773 if (i == res.getGeographicalLocation().size()) 28774 res.getGeographicalLocation().add(parseString(null)); 28775 if (array.get(i) instanceof JsonObject) 28776 parseElementProperties(array.get(i).getAsJsonObject(), res.getGeographicalLocation().get(i)); 28777 } 28778 } 28779 ; 28780 if (json.has("developmentStage")) 28781 res.setDevelopmentStage(parseCodeableConcept(getJObject(json, "developmentStage"))); 28782 if (json.has("fractionDescription")) { 28783 JsonArray array = json.getAsJsonArray("fractionDescription"); 28784 for (int i = 0; i < array.size(); i++) { 28785 res.getFractionDescription() 28786 .add(parseSubstanceSourceMaterialSubstanceSourceMaterialFractionDescriptionComponent( 28787 array.get(i).getAsJsonObject(), res)); 28788 } 28789 } 28790 ; 28791 if (json.has("organism")) 28792 res.setOrganism( 28793 parseSubstanceSourceMaterialSubstanceSourceMaterialOrganismComponent(getJObject(json, "organism"), res)); 28794 if (json.has("partDescription")) { 28795 JsonArray array = json.getAsJsonArray("partDescription"); 28796 for (int i = 0; i < array.size(); i++) { 28797 res.getPartDescription().add(parseSubstanceSourceMaterialSubstanceSourceMaterialPartDescriptionComponent( 28798 array.get(i).getAsJsonObject(), res)); 28799 } 28800 } 28801 ; 28802 } 28803 28804 protected SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent parseSubstanceSourceMaterialSubstanceSourceMaterialFractionDescriptionComponent( 28805 JsonObject json, SubstanceSourceMaterial owner) throws IOException, FHIRFormatError { 28806 SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent res = new SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent(); 28807 parseSubstanceSourceMaterialSubstanceSourceMaterialFractionDescriptionComponentProperties(json, owner, res); 28808 return res; 28809 } 28810 28811 protected void parseSubstanceSourceMaterialSubstanceSourceMaterialFractionDescriptionComponentProperties( 28812 JsonObject json, SubstanceSourceMaterial owner, 28813 SubstanceSourceMaterial.SubstanceSourceMaterialFractionDescriptionComponent res) 28814 throws IOException, FHIRFormatError { 28815 parseBackboneElementProperties(json, res); 28816 if (json.has("fraction")) 28817 res.setFractionElement(parseString(json.get("fraction").getAsString())); 28818 if (json.has("_fraction")) 28819 parseElementProperties(getJObject(json, "_fraction"), res.getFractionElement()); 28820 if (json.has("materialType")) 28821 res.setMaterialType(parseCodeableConcept(getJObject(json, "materialType"))); 28822 } 28823 28824 protected SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent parseSubstanceSourceMaterialSubstanceSourceMaterialOrganismComponent( 28825 JsonObject json, SubstanceSourceMaterial owner) throws IOException, FHIRFormatError { 28826 SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent res = new SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent(); 28827 parseSubstanceSourceMaterialSubstanceSourceMaterialOrganismComponentProperties(json, owner, res); 28828 return res; 28829 } 28830 28831 protected void parseSubstanceSourceMaterialSubstanceSourceMaterialOrganismComponentProperties(JsonObject json, 28832 SubstanceSourceMaterial owner, SubstanceSourceMaterial.SubstanceSourceMaterialOrganismComponent res) 28833 throws IOException, FHIRFormatError { 28834 parseBackboneElementProperties(json, res); 28835 if (json.has("family")) 28836 res.setFamily(parseCodeableConcept(getJObject(json, "family"))); 28837 if (json.has("genus")) 28838 res.setGenus(parseCodeableConcept(getJObject(json, "genus"))); 28839 if (json.has("species")) 28840 res.setSpecies(parseCodeableConcept(getJObject(json, "species"))); 28841 if (json.has("intraspecificType")) 28842 res.setIntraspecificType(parseCodeableConcept(getJObject(json, "intraspecificType"))); 28843 if (json.has("intraspecificDescription")) 28844 res.setIntraspecificDescriptionElement(parseString(json.get("intraspecificDescription").getAsString())); 28845 if (json.has("_intraspecificDescription")) 28846 parseElementProperties(getJObject(json, "_intraspecificDescription"), res.getIntraspecificDescriptionElement()); 28847 if (json.has("author")) { 28848 JsonArray array = json.getAsJsonArray("author"); 28849 for (int i = 0; i < array.size(); i++) { 28850 res.getAuthor().add(parseSubstanceSourceMaterialSubstanceSourceMaterialOrganismAuthorComponent( 28851 array.get(i).getAsJsonObject(), owner)); 28852 } 28853 } 28854 ; 28855 if (json.has("hybrid")) 28856 res.setHybrid(parseSubstanceSourceMaterialSubstanceSourceMaterialOrganismHybridComponent( 28857 getJObject(json, "hybrid"), owner)); 28858 if (json.has("organismGeneral")) 28859 res.setOrganismGeneral(parseSubstanceSourceMaterialSubstanceSourceMaterialOrganismOrganismGeneralComponent( 28860 getJObject(json, "organismGeneral"), owner)); 28861 } 28862 28863 protected SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent parseSubstanceSourceMaterialSubstanceSourceMaterialOrganismAuthorComponent( 28864 JsonObject json, SubstanceSourceMaterial owner) throws IOException, FHIRFormatError { 28865 SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent res = new SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent(); 28866 parseSubstanceSourceMaterialSubstanceSourceMaterialOrganismAuthorComponentProperties(json, owner, res); 28867 return res; 28868 } 28869 28870 protected void parseSubstanceSourceMaterialSubstanceSourceMaterialOrganismAuthorComponentProperties(JsonObject json, 28871 SubstanceSourceMaterial owner, SubstanceSourceMaterial.SubstanceSourceMaterialOrganismAuthorComponent res) 28872 throws IOException, FHIRFormatError { 28873 parseBackboneElementProperties(json, res); 28874 if (json.has("authorType")) 28875 res.setAuthorType(parseCodeableConcept(getJObject(json, "authorType"))); 28876 if (json.has("authorDescription")) 28877 res.setAuthorDescriptionElement(parseString(json.get("authorDescription").getAsString())); 28878 if (json.has("_authorDescription")) 28879 parseElementProperties(getJObject(json, "_authorDescription"), res.getAuthorDescriptionElement()); 28880 } 28881 28882 protected SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent parseSubstanceSourceMaterialSubstanceSourceMaterialOrganismHybridComponent( 28883 JsonObject json, SubstanceSourceMaterial owner) throws IOException, FHIRFormatError { 28884 SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent res = new SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent(); 28885 parseSubstanceSourceMaterialSubstanceSourceMaterialOrganismHybridComponentProperties(json, owner, res); 28886 return res; 28887 } 28888 28889 protected void parseSubstanceSourceMaterialSubstanceSourceMaterialOrganismHybridComponentProperties(JsonObject json, 28890 SubstanceSourceMaterial owner, SubstanceSourceMaterial.SubstanceSourceMaterialOrganismHybridComponent res) 28891 throws IOException, FHIRFormatError { 28892 parseBackboneElementProperties(json, res); 28893 if (json.has("maternalOrganismId")) 28894 res.setMaternalOrganismIdElement(parseString(json.get("maternalOrganismId").getAsString())); 28895 if (json.has("_maternalOrganismId")) 28896 parseElementProperties(getJObject(json, "_maternalOrganismId"), res.getMaternalOrganismIdElement()); 28897 if (json.has("maternalOrganismName")) 28898 res.setMaternalOrganismNameElement(parseString(json.get("maternalOrganismName").getAsString())); 28899 if (json.has("_maternalOrganismName")) 28900 parseElementProperties(getJObject(json, "_maternalOrganismName"), res.getMaternalOrganismNameElement()); 28901 if (json.has("paternalOrganismId")) 28902 res.setPaternalOrganismIdElement(parseString(json.get("paternalOrganismId").getAsString())); 28903 if (json.has("_paternalOrganismId")) 28904 parseElementProperties(getJObject(json, "_paternalOrganismId"), res.getPaternalOrganismIdElement()); 28905 if (json.has("paternalOrganismName")) 28906 res.setPaternalOrganismNameElement(parseString(json.get("paternalOrganismName").getAsString())); 28907 if (json.has("_paternalOrganismName")) 28908 parseElementProperties(getJObject(json, "_paternalOrganismName"), res.getPaternalOrganismNameElement()); 28909 if (json.has("hybridType")) 28910 res.setHybridType(parseCodeableConcept(getJObject(json, "hybridType"))); 28911 } 28912 28913 protected SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent parseSubstanceSourceMaterialSubstanceSourceMaterialOrganismOrganismGeneralComponent( 28914 JsonObject json, SubstanceSourceMaterial owner) throws IOException, FHIRFormatError { 28915 SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent res = new SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent(); 28916 parseSubstanceSourceMaterialSubstanceSourceMaterialOrganismOrganismGeneralComponentProperties(json, owner, res); 28917 return res; 28918 } 28919 28920 protected void parseSubstanceSourceMaterialSubstanceSourceMaterialOrganismOrganismGeneralComponentProperties( 28921 JsonObject json, SubstanceSourceMaterial owner, 28922 SubstanceSourceMaterial.SubstanceSourceMaterialOrganismOrganismGeneralComponent res) 28923 throws IOException, FHIRFormatError { 28924 parseBackboneElementProperties(json, res); 28925 if (json.has("kingdom")) 28926 res.setKingdom(parseCodeableConcept(getJObject(json, "kingdom"))); 28927 if (json.has("phylum")) 28928 res.setPhylum(parseCodeableConcept(getJObject(json, "phylum"))); 28929 if (json.has("class")) 28930 res.setClass_(parseCodeableConcept(getJObject(json, "class"))); 28931 if (json.has("order")) 28932 res.setOrder(parseCodeableConcept(getJObject(json, "order"))); 28933 } 28934 28935 protected SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent parseSubstanceSourceMaterialSubstanceSourceMaterialPartDescriptionComponent( 28936 JsonObject json, SubstanceSourceMaterial owner) throws IOException, FHIRFormatError { 28937 SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent res = new SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent(); 28938 parseSubstanceSourceMaterialSubstanceSourceMaterialPartDescriptionComponentProperties(json, owner, res); 28939 return res; 28940 } 28941 28942 protected void parseSubstanceSourceMaterialSubstanceSourceMaterialPartDescriptionComponentProperties(JsonObject json, 28943 SubstanceSourceMaterial owner, SubstanceSourceMaterial.SubstanceSourceMaterialPartDescriptionComponent res) 28944 throws IOException, FHIRFormatError { 28945 parseBackboneElementProperties(json, res); 28946 if (json.has("part")) 28947 res.setPart(parseCodeableConcept(getJObject(json, "part"))); 28948 if (json.has("partLocation")) 28949 res.setPartLocation(parseCodeableConcept(getJObject(json, "partLocation"))); 28950 } 28951 28952 protected SubstanceSpecification parseSubstanceSpecification(JsonObject json) throws IOException, FHIRFormatError { 28953 SubstanceSpecification res = new SubstanceSpecification(); 28954 parseSubstanceSpecificationProperties(json, res); 28955 return res; 28956 } 28957 28958 protected void parseSubstanceSpecificationProperties(JsonObject json, SubstanceSpecification res) 28959 throws IOException, FHIRFormatError { 28960 parseDomainResourceProperties(json, res); 28961 if (json.has("identifier")) 28962 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 28963 if (json.has("type")) 28964 res.setType(parseCodeableConcept(getJObject(json, "type"))); 28965 if (json.has("status")) 28966 res.setStatus(parseCodeableConcept(getJObject(json, "status"))); 28967 if (json.has("domain")) 28968 res.setDomain(parseCodeableConcept(getJObject(json, "domain"))); 28969 if (json.has("description")) 28970 res.setDescriptionElement(parseString(json.get("description").getAsString())); 28971 if (json.has("_description")) 28972 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 28973 if (json.has("source")) { 28974 JsonArray array = json.getAsJsonArray("source"); 28975 for (int i = 0; i < array.size(); i++) { 28976 res.getSource().add(parseReference(array.get(i).getAsJsonObject())); 28977 } 28978 } 28979 ; 28980 if (json.has("comment")) 28981 res.setCommentElement(parseString(json.get("comment").getAsString())); 28982 if (json.has("_comment")) 28983 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 28984 if (json.has("moiety")) { 28985 JsonArray array = json.getAsJsonArray("moiety"); 28986 for (int i = 0; i < array.size(); i++) { 28987 res.getMoiety() 28988 .add(parseSubstanceSpecificationSubstanceSpecificationMoietyComponent(array.get(i).getAsJsonObject(), res)); 28989 } 28990 } 28991 ; 28992 if (json.has("property")) { 28993 JsonArray array = json.getAsJsonArray("property"); 28994 for (int i = 0; i < array.size(); i++) { 28995 res.getProperty().add( 28996 parseSubstanceSpecificationSubstanceSpecificationPropertyComponent(array.get(i).getAsJsonObject(), res)); 28997 } 28998 } 28999 ; 29000 if (json.has("referenceInformation")) 29001 res.setReferenceInformation(parseReference(getJObject(json, "referenceInformation"))); 29002 if (json.has("structure")) 29003 res.setStructure( 29004 parseSubstanceSpecificationSubstanceSpecificationStructureComponent(getJObject(json, "structure"), res)); 29005 if (json.has("code")) { 29006 JsonArray array = json.getAsJsonArray("code"); 29007 for (int i = 0; i < array.size(); i++) { 29008 res.getCode() 29009 .add(parseSubstanceSpecificationSubstanceSpecificationCodeComponent(array.get(i).getAsJsonObject(), res)); 29010 } 29011 } 29012 ; 29013 if (json.has("name")) { 29014 JsonArray array = json.getAsJsonArray("name"); 29015 for (int i = 0; i < array.size(); i++) { 29016 res.getName() 29017 .add(parseSubstanceSpecificationSubstanceSpecificationNameComponent(array.get(i).getAsJsonObject(), res)); 29018 } 29019 } 29020 ; 29021 if (json.has("molecularWeight")) { 29022 JsonArray array = json.getAsJsonArray("molecularWeight"); 29023 for (int i = 0; i < array.size(); i++) { 29024 res.getMolecularWeight() 29025 .add(parseSubstanceSpecificationSubstanceSpecificationStructureIsotopeMolecularWeightComponent( 29026 array.get(i).getAsJsonObject(), res)); 29027 } 29028 } 29029 ; 29030 if (json.has("relationship")) { 29031 JsonArray array = json.getAsJsonArray("relationship"); 29032 for (int i = 0; i < array.size(); i++) { 29033 res.getRelationship().add(parseSubstanceSpecificationSubstanceSpecificationRelationshipComponent( 29034 array.get(i).getAsJsonObject(), res)); 29035 } 29036 } 29037 ; 29038 if (json.has("nucleicAcid")) 29039 res.setNucleicAcid(parseReference(getJObject(json, "nucleicAcid"))); 29040 if (json.has("polymer")) 29041 res.setPolymer(parseReference(getJObject(json, "polymer"))); 29042 if (json.has("protein")) 29043 res.setProtein(parseReference(getJObject(json, "protein"))); 29044 if (json.has("sourceMaterial")) 29045 res.setSourceMaterial(parseReference(getJObject(json, "sourceMaterial"))); 29046 } 29047 29048 protected SubstanceSpecification.SubstanceSpecificationMoietyComponent parseSubstanceSpecificationSubstanceSpecificationMoietyComponent( 29049 JsonObject json, SubstanceSpecification owner) throws IOException, FHIRFormatError { 29050 SubstanceSpecification.SubstanceSpecificationMoietyComponent res = new SubstanceSpecification.SubstanceSpecificationMoietyComponent(); 29051 parseSubstanceSpecificationSubstanceSpecificationMoietyComponentProperties(json, owner, res); 29052 return res; 29053 } 29054 29055 protected void parseSubstanceSpecificationSubstanceSpecificationMoietyComponentProperties(JsonObject json, 29056 SubstanceSpecification owner, SubstanceSpecification.SubstanceSpecificationMoietyComponent res) 29057 throws IOException, FHIRFormatError { 29058 parseBackboneElementProperties(json, res); 29059 if (json.has("role")) 29060 res.setRole(parseCodeableConcept(getJObject(json, "role"))); 29061 if (json.has("identifier")) 29062 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 29063 if (json.has("name")) 29064 res.setNameElement(parseString(json.get("name").getAsString())); 29065 if (json.has("_name")) 29066 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 29067 if (json.has("stereochemistry")) 29068 res.setStereochemistry(parseCodeableConcept(getJObject(json, "stereochemistry"))); 29069 if (json.has("opticalActivity")) 29070 res.setOpticalActivity(parseCodeableConcept(getJObject(json, "opticalActivity"))); 29071 if (json.has("molecularFormula")) 29072 res.setMolecularFormulaElement(parseString(json.get("molecularFormula").getAsString())); 29073 if (json.has("_molecularFormula")) 29074 parseElementProperties(getJObject(json, "_molecularFormula"), res.getMolecularFormulaElement()); 29075 Type amount = parseType("amount", json); 29076 if (amount != null) 29077 res.setAmount(amount); 29078 } 29079 29080 protected SubstanceSpecification.SubstanceSpecificationPropertyComponent parseSubstanceSpecificationSubstanceSpecificationPropertyComponent( 29081 JsonObject json, SubstanceSpecification owner) throws IOException, FHIRFormatError { 29082 SubstanceSpecification.SubstanceSpecificationPropertyComponent res = new SubstanceSpecification.SubstanceSpecificationPropertyComponent(); 29083 parseSubstanceSpecificationSubstanceSpecificationPropertyComponentProperties(json, owner, res); 29084 return res; 29085 } 29086 29087 protected void parseSubstanceSpecificationSubstanceSpecificationPropertyComponentProperties(JsonObject json, 29088 SubstanceSpecification owner, SubstanceSpecification.SubstanceSpecificationPropertyComponent res) 29089 throws IOException, FHIRFormatError { 29090 parseBackboneElementProperties(json, res); 29091 if (json.has("category")) 29092 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 29093 if (json.has("code")) 29094 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 29095 if (json.has("parameters")) 29096 res.setParametersElement(parseString(json.get("parameters").getAsString())); 29097 if (json.has("_parameters")) 29098 parseElementProperties(getJObject(json, "_parameters"), res.getParametersElement()); 29099 Type definingSubstance = parseType("definingSubstance", json); 29100 if (definingSubstance != null) 29101 res.setDefiningSubstance(definingSubstance); 29102 Type amount = parseType("amount", json); 29103 if (amount != null) 29104 res.setAmount(amount); 29105 } 29106 29107 protected SubstanceSpecification.SubstanceSpecificationStructureComponent parseSubstanceSpecificationSubstanceSpecificationStructureComponent( 29108 JsonObject json, SubstanceSpecification owner) throws IOException, FHIRFormatError { 29109 SubstanceSpecification.SubstanceSpecificationStructureComponent res = new SubstanceSpecification.SubstanceSpecificationStructureComponent(); 29110 parseSubstanceSpecificationSubstanceSpecificationStructureComponentProperties(json, owner, res); 29111 return res; 29112 } 29113 29114 protected void parseSubstanceSpecificationSubstanceSpecificationStructureComponentProperties(JsonObject json, 29115 SubstanceSpecification owner, SubstanceSpecification.SubstanceSpecificationStructureComponent res) 29116 throws IOException, FHIRFormatError { 29117 parseBackboneElementProperties(json, res); 29118 if (json.has("stereochemistry")) 29119 res.setStereochemistry(parseCodeableConcept(getJObject(json, "stereochemistry"))); 29120 if (json.has("opticalActivity")) 29121 res.setOpticalActivity(parseCodeableConcept(getJObject(json, "opticalActivity"))); 29122 if (json.has("molecularFormula")) 29123 res.setMolecularFormulaElement(parseString(json.get("molecularFormula").getAsString())); 29124 if (json.has("_molecularFormula")) 29125 parseElementProperties(getJObject(json, "_molecularFormula"), res.getMolecularFormulaElement()); 29126 if (json.has("molecularFormulaByMoiety")) 29127 res.setMolecularFormulaByMoietyElement(parseString(json.get("molecularFormulaByMoiety").getAsString())); 29128 if (json.has("_molecularFormulaByMoiety")) 29129 parseElementProperties(getJObject(json, "_molecularFormulaByMoiety"), res.getMolecularFormulaByMoietyElement()); 29130 if (json.has("isotope")) { 29131 JsonArray array = json.getAsJsonArray("isotope"); 29132 for (int i = 0; i < array.size(); i++) { 29133 res.getIsotope().add(parseSubstanceSpecificationSubstanceSpecificationStructureIsotopeComponent( 29134 array.get(i).getAsJsonObject(), owner)); 29135 } 29136 } 29137 ; 29138 if (json.has("molecularWeight")) 29139 res.setMolecularWeight(parseSubstanceSpecificationSubstanceSpecificationStructureIsotopeMolecularWeightComponent( 29140 getJObject(json, "molecularWeight"), owner)); 29141 if (json.has("source")) { 29142 JsonArray array = json.getAsJsonArray("source"); 29143 for (int i = 0; i < array.size(); i++) { 29144 res.getSource().add(parseReference(array.get(i).getAsJsonObject())); 29145 } 29146 } 29147 ; 29148 if (json.has("representation")) { 29149 JsonArray array = json.getAsJsonArray("representation"); 29150 for (int i = 0; i < array.size(); i++) { 29151 res.getRepresentation().add(parseSubstanceSpecificationSubstanceSpecificationStructureRepresentationComponent( 29152 array.get(i).getAsJsonObject(), owner)); 29153 } 29154 } 29155 ; 29156 } 29157 29158 protected SubstanceSpecification.SubstanceSpecificationStructureIsotopeComponent parseSubstanceSpecificationSubstanceSpecificationStructureIsotopeComponent( 29159 JsonObject json, SubstanceSpecification owner) throws IOException, FHIRFormatError { 29160 SubstanceSpecification.SubstanceSpecificationStructureIsotopeComponent res = new SubstanceSpecification.SubstanceSpecificationStructureIsotopeComponent(); 29161 parseSubstanceSpecificationSubstanceSpecificationStructureIsotopeComponentProperties(json, owner, res); 29162 return res; 29163 } 29164 29165 protected void parseSubstanceSpecificationSubstanceSpecificationStructureIsotopeComponentProperties(JsonObject json, 29166 SubstanceSpecification owner, SubstanceSpecification.SubstanceSpecificationStructureIsotopeComponent res) 29167 throws IOException, FHIRFormatError { 29168 parseBackboneElementProperties(json, res); 29169 if (json.has("identifier")) 29170 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 29171 if (json.has("name")) 29172 res.setName(parseCodeableConcept(getJObject(json, "name"))); 29173 if (json.has("substitution")) 29174 res.setSubstitution(parseCodeableConcept(getJObject(json, "substitution"))); 29175 if (json.has("halfLife")) 29176 res.setHalfLife(parseQuantity(getJObject(json, "halfLife"))); 29177 if (json.has("molecularWeight")) 29178 res.setMolecularWeight(parseSubstanceSpecificationSubstanceSpecificationStructureIsotopeMolecularWeightComponent( 29179 getJObject(json, "molecularWeight"), owner)); 29180 } 29181 29182 protected SubstanceSpecification.SubstanceSpecificationStructureIsotopeMolecularWeightComponent parseSubstanceSpecificationSubstanceSpecificationStructureIsotopeMolecularWeightComponent( 29183 JsonObject json, SubstanceSpecification owner) throws IOException, FHIRFormatError { 29184 SubstanceSpecification.SubstanceSpecificationStructureIsotopeMolecularWeightComponent res = new SubstanceSpecification.SubstanceSpecificationStructureIsotopeMolecularWeightComponent(); 29185 parseSubstanceSpecificationSubstanceSpecificationStructureIsotopeMolecularWeightComponentProperties(json, owner, 29186 res); 29187 return res; 29188 } 29189 29190 protected void parseSubstanceSpecificationSubstanceSpecificationStructureIsotopeMolecularWeightComponentProperties( 29191 JsonObject json, SubstanceSpecification owner, 29192 SubstanceSpecification.SubstanceSpecificationStructureIsotopeMolecularWeightComponent res) 29193 throws IOException, FHIRFormatError { 29194 parseBackboneElementProperties(json, res); 29195 if (json.has("method")) 29196 res.setMethod(parseCodeableConcept(getJObject(json, "method"))); 29197 if (json.has("type")) 29198 res.setType(parseCodeableConcept(getJObject(json, "type"))); 29199 if (json.has("amount")) 29200 res.setAmount(parseQuantity(getJObject(json, "amount"))); 29201 } 29202 29203 protected SubstanceSpecification.SubstanceSpecificationStructureRepresentationComponent parseSubstanceSpecificationSubstanceSpecificationStructureRepresentationComponent( 29204 JsonObject json, SubstanceSpecification owner) throws IOException, FHIRFormatError { 29205 SubstanceSpecification.SubstanceSpecificationStructureRepresentationComponent res = new SubstanceSpecification.SubstanceSpecificationStructureRepresentationComponent(); 29206 parseSubstanceSpecificationSubstanceSpecificationStructureRepresentationComponentProperties(json, owner, res); 29207 return res; 29208 } 29209 29210 protected void parseSubstanceSpecificationSubstanceSpecificationStructureRepresentationComponentProperties( 29211 JsonObject json, SubstanceSpecification owner, 29212 SubstanceSpecification.SubstanceSpecificationStructureRepresentationComponent res) 29213 throws IOException, FHIRFormatError { 29214 parseBackboneElementProperties(json, res); 29215 if (json.has("type")) 29216 res.setType(parseCodeableConcept(getJObject(json, "type"))); 29217 if (json.has("representation")) 29218 res.setRepresentationElement(parseString(json.get("representation").getAsString())); 29219 if (json.has("_representation")) 29220 parseElementProperties(getJObject(json, "_representation"), res.getRepresentationElement()); 29221 if (json.has("attachment")) 29222 res.setAttachment(parseAttachment(getJObject(json, "attachment"))); 29223 } 29224 29225 protected SubstanceSpecification.SubstanceSpecificationCodeComponent parseSubstanceSpecificationSubstanceSpecificationCodeComponent( 29226 JsonObject json, SubstanceSpecification owner) throws IOException, FHIRFormatError { 29227 SubstanceSpecification.SubstanceSpecificationCodeComponent res = new SubstanceSpecification.SubstanceSpecificationCodeComponent(); 29228 parseSubstanceSpecificationSubstanceSpecificationCodeComponentProperties(json, owner, res); 29229 return res; 29230 } 29231 29232 protected void parseSubstanceSpecificationSubstanceSpecificationCodeComponentProperties(JsonObject json, 29233 SubstanceSpecification owner, SubstanceSpecification.SubstanceSpecificationCodeComponent res) 29234 throws IOException, FHIRFormatError { 29235 parseBackboneElementProperties(json, res); 29236 if (json.has("code")) 29237 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 29238 if (json.has("status")) 29239 res.setStatus(parseCodeableConcept(getJObject(json, "status"))); 29240 if (json.has("statusDate")) 29241 res.setStatusDateElement(parseDateTime(json.get("statusDate").getAsString())); 29242 if (json.has("_statusDate")) 29243 parseElementProperties(getJObject(json, "_statusDate"), res.getStatusDateElement()); 29244 if (json.has("comment")) 29245 res.setCommentElement(parseString(json.get("comment").getAsString())); 29246 if (json.has("_comment")) 29247 parseElementProperties(getJObject(json, "_comment"), res.getCommentElement()); 29248 if (json.has("source")) { 29249 JsonArray array = json.getAsJsonArray("source"); 29250 for (int i = 0; i < array.size(); i++) { 29251 res.getSource().add(parseReference(array.get(i).getAsJsonObject())); 29252 } 29253 } 29254 ; 29255 } 29256 29257 protected SubstanceSpecification.SubstanceSpecificationNameComponent parseSubstanceSpecificationSubstanceSpecificationNameComponent( 29258 JsonObject json, SubstanceSpecification owner) throws IOException, FHIRFormatError { 29259 SubstanceSpecification.SubstanceSpecificationNameComponent res = new SubstanceSpecification.SubstanceSpecificationNameComponent(); 29260 parseSubstanceSpecificationSubstanceSpecificationNameComponentProperties(json, owner, res); 29261 return res; 29262 } 29263 29264 protected void parseSubstanceSpecificationSubstanceSpecificationNameComponentProperties(JsonObject json, 29265 SubstanceSpecification owner, SubstanceSpecification.SubstanceSpecificationNameComponent res) 29266 throws IOException, FHIRFormatError { 29267 parseBackboneElementProperties(json, res); 29268 if (json.has("name")) 29269 res.setNameElement(parseString(json.get("name").getAsString())); 29270 if (json.has("_name")) 29271 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 29272 if (json.has("type")) 29273 res.setType(parseCodeableConcept(getJObject(json, "type"))); 29274 if (json.has("status")) 29275 res.setStatus(parseCodeableConcept(getJObject(json, "status"))); 29276 if (json.has("preferred")) 29277 res.setPreferredElement(parseBoolean(json.get("preferred").getAsBoolean())); 29278 if (json.has("_preferred")) 29279 parseElementProperties(getJObject(json, "_preferred"), res.getPreferredElement()); 29280 if (json.has("language")) { 29281 JsonArray array = json.getAsJsonArray("language"); 29282 for (int i = 0; i < array.size(); i++) { 29283 res.getLanguage().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 29284 } 29285 } 29286 ; 29287 if (json.has("domain")) { 29288 JsonArray array = json.getAsJsonArray("domain"); 29289 for (int i = 0; i < array.size(); i++) { 29290 res.getDomain().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 29291 } 29292 } 29293 ; 29294 if (json.has("jurisdiction")) { 29295 JsonArray array = json.getAsJsonArray("jurisdiction"); 29296 for (int i = 0; i < array.size(); i++) { 29297 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 29298 } 29299 } 29300 ; 29301 if (json.has("synonym")) { 29302 JsonArray array = json.getAsJsonArray("synonym"); 29303 for (int i = 0; i < array.size(); i++) { 29304 res.getSynonym() 29305 .add(parseSubstanceSpecificationSubstanceSpecificationNameComponent(array.get(i).getAsJsonObject(), owner)); 29306 } 29307 } 29308 ; 29309 if (json.has("translation")) { 29310 JsonArray array = json.getAsJsonArray("translation"); 29311 for (int i = 0; i < array.size(); i++) { 29312 res.getTranslation() 29313 .add(parseSubstanceSpecificationSubstanceSpecificationNameComponent(array.get(i).getAsJsonObject(), owner)); 29314 } 29315 } 29316 ; 29317 if (json.has("official")) { 29318 JsonArray array = json.getAsJsonArray("official"); 29319 for (int i = 0; i < array.size(); i++) { 29320 res.getOfficial().add(parseSubstanceSpecificationSubstanceSpecificationNameOfficialComponent( 29321 array.get(i).getAsJsonObject(), owner)); 29322 } 29323 } 29324 ; 29325 if (json.has("source")) { 29326 JsonArray array = json.getAsJsonArray("source"); 29327 for (int i = 0; i < array.size(); i++) { 29328 res.getSource().add(parseReference(array.get(i).getAsJsonObject())); 29329 } 29330 } 29331 ; 29332 } 29333 29334 protected SubstanceSpecification.SubstanceSpecificationNameOfficialComponent parseSubstanceSpecificationSubstanceSpecificationNameOfficialComponent( 29335 JsonObject json, SubstanceSpecification owner) throws IOException, FHIRFormatError { 29336 SubstanceSpecification.SubstanceSpecificationNameOfficialComponent res = new SubstanceSpecification.SubstanceSpecificationNameOfficialComponent(); 29337 parseSubstanceSpecificationSubstanceSpecificationNameOfficialComponentProperties(json, owner, res); 29338 return res; 29339 } 29340 29341 protected void parseSubstanceSpecificationSubstanceSpecificationNameOfficialComponentProperties(JsonObject json, 29342 SubstanceSpecification owner, SubstanceSpecification.SubstanceSpecificationNameOfficialComponent res) 29343 throws IOException, FHIRFormatError { 29344 parseBackboneElementProperties(json, res); 29345 if (json.has("authority")) 29346 res.setAuthority(parseCodeableConcept(getJObject(json, "authority"))); 29347 if (json.has("status")) 29348 res.setStatus(parseCodeableConcept(getJObject(json, "status"))); 29349 if (json.has("date")) 29350 res.setDateElement(parseDateTime(json.get("date").getAsString())); 29351 if (json.has("_date")) 29352 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 29353 } 29354 29355 protected SubstanceSpecification.SubstanceSpecificationRelationshipComponent parseSubstanceSpecificationSubstanceSpecificationRelationshipComponent( 29356 JsonObject json, SubstanceSpecification owner) throws IOException, FHIRFormatError { 29357 SubstanceSpecification.SubstanceSpecificationRelationshipComponent res = new SubstanceSpecification.SubstanceSpecificationRelationshipComponent(); 29358 parseSubstanceSpecificationSubstanceSpecificationRelationshipComponentProperties(json, owner, res); 29359 return res; 29360 } 29361 29362 protected void parseSubstanceSpecificationSubstanceSpecificationRelationshipComponentProperties(JsonObject json, 29363 SubstanceSpecification owner, SubstanceSpecification.SubstanceSpecificationRelationshipComponent res) 29364 throws IOException, FHIRFormatError { 29365 parseBackboneElementProperties(json, res); 29366 Type substance = parseType("substance", json); 29367 if (substance != null) 29368 res.setSubstance(substance); 29369 if (json.has("relationship")) 29370 res.setRelationship(parseCodeableConcept(getJObject(json, "relationship"))); 29371 if (json.has("isDefining")) 29372 res.setIsDefiningElement(parseBoolean(json.get("isDefining").getAsBoolean())); 29373 if (json.has("_isDefining")) 29374 parseElementProperties(getJObject(json, "_isDefining"), res.getIsDefiningElement()); 29375 Type amount = parseType("amount", json); 29376 if (amount != null) 29377 res.setAmount(amount); 29378 if (json.has("amountRatioLowLimit")) 29379 res.setAmountRatioLowLimit(parseRatio(getJObject(json, "amountRatioLowLimit"))); 29380 if (json.has("amountType")) 29381 res.setAmountType(parseCodeableConcept(getJObject(json, "amountType"))); 29382 if (json.has("source")) { 29383 JsonArray array = json.getAsJsonArray("source"); 29384 for (int i = 0; i < array.size(); i++) { 29385 res.getSource().add(parseReference(array.get(i).getAsJsonObject())); 29386 } 29387 } 29388 ; 29389 } 29390 29391 protected SupplyDelivery parseSupplyDelivery(JsonObject json) throws IOException, FHIRFormatError { 29392 SupplyDelivery res = new SupplyDelivery(); 29393 parseSupplyDeliveryProperties(json, res); 29394 return res; 29395 } 29396 29397 protected void parseSupplyDeliveryProperties(JsonObject json, SupplyDelivery res) 29398 throws IOException, FHIRFormatError { 29399 parseDomainResourceProperties(json, res); 29400 if (json.has("identifier")) { 29401 JsonArray array = json.getAsJsonArray("identifier"); 29402 for (int i = 0; i < array.size(); i++) { 29403 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 29404 } 29405 } 29406 ; 29407 if (json.has("basedOn")) { 29408 JsonArray array = json.getAsJsonArray("basedOn"); 29409 for (int i = 0; i < array.size(); i++) { 29410 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 29411 } 29412 } 29413 ; 29414 if (json.has("partOf")) { 29415 JsonArray array = json.getAsJsonArray("partOf"); 29416 for (int i = 0; i < array.size(); i++) { 29417 res.getPartOf().add(parseReference(array.get(i).getAsJsonObject())); 29418 } 29419 } 29420 ; 29421 if (json.has("status")) 29422 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), SupplyDelivery.SupplyDeliveryStatus.NULL, 29423 new SupplyDelivery.SupplyDeliveryStatusEnumFactory())); 29424 if (json.has("_status")) 29425 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 29426 if (json.has("patient")) 29427 res.setPatient(parseReference(getJObject(json, "patient"))); 29428 if (json.has("type")) 29429 res.setType(parseCodeableConcept(getJObject(json, "type"))); 29430 if (json.has("suppliedItem")) 29431 res.setSuppliedItem( 29432 parseSupplyDeliverySupplyDeliverySuppliedItemComponent(getJObject(json, "suppliedItem"), res)); 29433 Type occurrence = parseType("occurrence", json); 29434 if (occurrence != null) 29435 res.setOccurrence(occurrence); 29436 if (json.has("supplier")) 29437 res.setSupplier(parseReference(getJObject(json, "supplier"))); 29438 if (json.has("destination")) 29439 res.setDestination(parseReference(getJObject(json, "destination"))); 29440 if (json.has("receiver")) { 29441 JsonArray array = json.getAsJsonArray("receiver"); 29442 for (int i = 0; i < array.size(); i++) { 29443 res.getReceiver().add(parseReference(array.get(i).getAsJsonObject())); 29444 } 29445 } 29446 ; 29447 } 29448 29449 protected SupplyDelivery.SupplyDeliverySuppliedItemComponent parseSupplyDeliverySupplyDeliverySuppliedItemComponent( 29450 JsonObject json, SupplyDelivery owner) throws IOException, FHIRFormatError { 29451 SupplyDelivery.SupplyDeliverySuppliedItemComponent res = new SupplyDelivery.SupplyDeliverySuppliedItemComponent(); 29452 parseSupplyDeliverySupplyDeliverySuppliedItemComponentProperties(json, owner, res); 29453 return res; 29454 } 29455 29456 protected void parseSupplyDeliverySupplyDeliverySuppliedItemComponentProperties(JsonObject json, SupplyDelivery owner, 29457 SupplyDelivery.SupplyDeliverySuppliedItemComponent res) throws IOException, FHIRFormatError { 29458 parseBackboneElementProperties(json, res); 29459 if (json.has("quantity")) 29460 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 29461 Type item = parseType("item", json); 29462 if (item != null) 29463 res.setItem(item); 29464 } 29465 29466 protected SupplyRequest parseSupplyRequest(JsonObject json) throws IOException, FHIRFormatError { 29467 SupplyRequest res = new SupplyRequest(); 29468 parseSupplyRequestProperties(json, res); 29469 return res; 29470 } 29471 29472 protected void parseSupplyRequestProperties(JsonObject json, SupplyRequest res) throws IOException, FHIRFormatError { 29473 parseDomainResourceProperties(json, res); 29474 if (json.has("identifier")) { 29475 JsonArray array = json.getAsJsonArray("identifier"); 29476 for (int i = 0; i < array.size(); i++) { 29477 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 29478 } 29479 } 29480 ; 29481 if (json.has("status")) 29482 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), SupplyRequest.SupplyRequestStatus.NULL, 29483 new SupplyRequest.SupplyRequestStatusEnumFactory())); 29484 if (json.has("_status")) 29485 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 29486 if (json.has("category")) 29487 res.setCategory(parseCodeableConcept(getJObject(json, "category"))); 29488 if (json.has("priority")) 29489 res.setPriorityElement(parseEnumeration(json.get("priority").getAsString(), SupplyRequest.RequestPriority.NULL, 29490 new SupplyRequest.RequestPriorityEnumFactory())); 29491 if (json.has("_priority")) 29492 parseElementProperties(getJObject(json, "_priority"), res.getPriorityElement()); 29493 Type item = parseType("item", json); 29494 if (item != null) 29495 res.setItem(item); 29496 if (json.has("quantity")) 29497 res.setQuantity(parseQuantity(getJObject(json, "quantity"))); 29498 if (json.has("parameter")) { 29499 JsonArray array = json.getAsJsonArray("parameter"); 29500 for (int i = 0; i < array.size(); i++) { 29501 res.getParameter().add(parseSupplyRequestSupplyRequestParameterComponent(array.get(i).getAsJsonObject(), res)); 29502 } 29503 } 29504 ; 29505 Type occurrence = parseType("occurrence", json); 29506 if (occurrence != null) 29507 res.setOccurrence(occurrence); 29508 if (json.has("authoredOn")) 29509 res.setAuthoredOnElement(parseDateTime(json.get("authoredOn").getAsString())); 29510 if (json.has("_authoredOn")) 29511 parseElementProperties(getJObject(json, "_authoredOn"), res.getAuthoredOnElement()); 29512 if (json.has("requester")) 29513 res.setRequester(parseReference(getJObject(json, "requester"))); 29514 if (json.has("supplier")) { 29515 JsonArray array = json.getAsJsonArray("supplier"); 29516 for (int i = 0; i < array.size(); i++) { 29517 res.getSupplier().add(parseReference(array.get(i).getAsJsonObject())); 29518 } 29519 } 29520 ; 29521 if (json.has("reasonCode")) { 29522 JsonArray array = json.getAsJsonArray("reasonCode"); 29523 for (int i = 0; i < array.size(); i++) { 29524 res.getReasonCode().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 29525 } 29526 } 29527 ; 29528 if (json.has("reasonReference")) { 29529 JsonArray array = json.getAsJsonArray("reasonReference"); 29530 for (int i = 0; i < array.size(); i++) { 29531 res.getReasonReference().add(parseReference(array.get(i).getAsJsonObject())); 29532 } 29533 } 29534 ; 29535 if (json.has("deliverFrom")) 29536 res.setDeliverFrom(parseReference(getJObject(json, "deliverFrom"))); 29537 if (json.has("deliverTo")) 29538 res.setDeliverTo(parseReference(getJObject(json, "deliverTo"))); 29539 } 29540 29541 protected SupplyRequest.SupplyRequestParameterComponent parseSupplyRequestSupplyRequestParameterComponent( 29542 JsonObject json, SupplyRequest owner) throws IOException, FHIRFormatError { 29543 SupplyRequest.SupplyRequestParameterComponent res = new SupplyRequest.SupplyRequestParameterComponent(); 29544 parseSupplyRequestSupplyRequestParameterComponentProperties(json, owner, res); 29545 return res; 29546 } 29547 29548 protected void parseSupplyRequestSupplyRequestParameterComponentProperties(JsonObject json, SupplyRequest owner, 29549 SupplyRequest.SupplyRequestParameterComponent res) throws IOException, FHIRFormatError { 29550 parseBackboneElementProperties(json, res); 29551 if (json.has("code")) 29552 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 29553 Type value = parseType("value", json); 29554 if (value != null) 29555 res.setValue(value); 29556 } 29557 29558 protected Task parseTask(JsonObject json) throws IOException, FHIRFormatError { 29559 Task res = new Task(); 29560 parseTaskProperties(json, res); 29561 return res; 29562 } 29563 29564 protected void parseTaskProperties(JsonObject json, Task res) throws IOException, FHIRFormatError { 29565 parseDomainResourceProperties(json, res); 29566 if (json.has("identifier")) { 29567 JsonArray array = json.getAsJsonArray("identifier"); 29568 for (int i = 0; i < array.size(); i++) { 29569 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 29570 } 29571 } 29572 ; 29573 if (json.has("instantiatesCanonical")) 29574 res.setInstantiatesCanonicalElement(parseCanonical(json.get("instantiatesCanonical").getAsString())); 29575 if (json.has("_instantiatesCanonical")) 29576 parseElementProperties(getJObject(json, "_instantiatesCanonical"), res.getInstantiatesCanonicalElement()); 29577 if (json.has("instantiatesUri")) 29578 res.setInstantiatesUriElement(parseUri(json.get("instantiatesUri").getAsString())); 29579 if (json.has("_instantiatesUri")) 29580 parseElementProperties(getJObject(json, "_instantiatesUri"), res.getInstantiatesUriElement()); 29581 if (json.has("basedOn")) { 29582 JsonArray array = json.getAsJsonArray("basedOn"); 29583 for (int i = 0; i < array.size(); i++) { 29584 res.getBasedOn().add(parseReference(array.get(i).getAsJsonObject())); 29585 } 29586 } 29587 ; 29588 if (json.has("groupIdentifier")) 29589 res.setGroupIdentifier(parseIdentifier(getJObject(json, "groupIdentifier"))); 29590 if (json.has("partOf")) { 29591 JsonArray array = json.getAsJsonArray("partOf"); 29592 for (int i = 0; i < array.size(); i++) { 29593 res.getPartOf().add(parseReference(array.get(i).getAsJsonObject())); 29594 } 29595 } 29596 ; 29597 if (json.has("status")) 29598 res.setStatusElement( 29599 parseEnumeration(json.get("status").getAsString(), Task.TaskStatus.NULL, new Task.TaskStatusEnumFactory())); 29600 if (json.has("_status")) 29601 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 29602 if (json.has("statusReason")) 29603 res.setStatusReason(parseCodeableConcept(getJObject(json, "statusReason"))); 29604 if (json.has("businessStatus")) 29605 res.setBusinessStatus(parseCodeableConcept(getJObject(json, "businessStatus"))); 29606 if (json.has("intent")) 29607 res.setIntentElement( 29608 parseEnumeration(json.get("intent").getAsString(), Task.TaskIntent.NULL, new Task.TaskIntentEnumFactory())); 29609 if (json.has("_intent")) 29610 parseElementProperties(getJObject(json, "_intent"), res.getIntentElement()); 29611 if (json.has("priority")) 29612 res.setPriorityElement(parseEnumeration(json.get("priority").getAsString(), Task.TaskPriority.NULL, 29613 new Task.TaskPriorityEnumFactory())); 29614 if (json.has("_priority")) 29615 parseElementProperties(getJObject(json, "_priority"), res.getPriorityElement()); 29616 if (json.has("code")) 29617 res.setCode(parseCodeableConcept(getJObject(json, "code"))); 29618 if (json.has("description")) 29619 res.setDescriptionElement(parseString(json.get("description").getAsString())); 29620 if (json.has("_description")) 29621 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 29622 if (json.has("focus")) 29623 res.setFocus(parseReference(getJObject(json, "focus"))); 29624 if (json.has("for")) 29625 res.setFor(parseReference(getJObject(json, "for"))); 29626 if (json.has("encounter")) 29627 res.setEncounter(parseReference(getJObject(json, "encounter"))); 29628 if (json.has("executionPeriod")) 29629 res.setExecutionPeriod(parsePeriod(getJObject(json, "executionPeriod"))); 29630 if (json.has("authoredOn")) 29631 res.setAuthoredOnElement(parseDateTime(json.get("authoredOn").getAsString())); 29632 if (json.has("_authoredOn")) 29633 parseElementProperties(getJObject(json, "_authoredOn"), res.getAuthoredOnElement()); 29634 if (json.has("lastModified")) 29635 res.setLastModifiedElement(parseDateTime(json.get("lastModified").getAsString())); 29636 if (json.has("_lastModified")) 29637 parseElementProperties(getJObject(json, "_lastModified"), res.getLastModifiedElement()); 29638 if (json.has("requester")) 29639 res.setRequester(parseReference(getJObject(json, "requester"))); 29640 if (json.has("performerType")) { 29641 JsonArray array = json.getAsJsonArray("performerType"); 29642 for (int i = 0; i < array.size(); i++) { 29643 res.getPerformerType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 29644 } 29645 } 29646 ; 29647 if (json.has("owner")) 29648 res.setOwner(parseReference(getJObject(json, "owner"))); 29649 if (json.has("location")) 29650 res.setLocation(parseReference(getJObject(json, "location"))); 29651 if (json.has("reasonCode")) 29652 res.setReasonCode(parseCodeableConcept(getJObject(json, "reasonCode"))); 29653 if (json.has("reasonReference")) 29654 res.setReasonReference(parseReference(getJObject(json, "reasonReference"))); 29655 if (json.has("insurance")) { 29656 JsonArray array = json.getAsJsonArray("insurance"); 29657 for (int i = 0; i < array.size(); i++) { 29658 res.getInsurance().add(parseReference(array.get(i).getAsJsonObject())); 29659 } 29660 } 29661 ; 29662 if (json.has("note")) { 29663 JsonArray array = json.getAsJsonArray("note"); 29664 for (int i = 0; i < array.size(); i++) { 29665 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 29666 } 29667 } 29668 ; 29669 if (json.has("relevantHistory")) { 29670 JsonArray array = json.getAsJsonArray("relevantHistory"); 29671 for (int i = 0; i < array.size(); i++) { 29672 res.getRelevantHistory().add(parseReference(array.get(i).getAsJsonObject())); 29673 } 29674 } 29675 ; 29676 if (json.has("restriction")) 29677 res.setRestriction(parseTaskTaskRestrictionComponent(getJObject(json, "restriction"), res)); 29678 if (json.has("input")) { 29679 JsonArray array = json.getAsJsonArray("input"); 29680 for (int i = 0; i < array.size(); i++) { 29681 res.getInput().add(parseTaskParameterComponent(array.get(i).getAsJsonObject(), res)); 29682 } 29683 } 29684 ; 29685 if (json.has("output")) { 29686 JsonArray array = json.getAsJsonArray("output"); 29687 for (int i = 0; i < array.size(); i++) { 29688 res.getOutput().add(parseTaskTaskOutputComponent(array.get(i).getAsJsonObject(), res)); 29689 } 29690 } 29691 ; 29692 } 29693 29694 protected Task.TaskRestrictionComponent parseTaskTaskRestrictionComponent(JsonObject json, Task owner) 29695 throws IOException, FHIRFormatError { 29696 Task.TaskRestrictionComponent res = new Task.TaskRestrictionComponent(); 29697 parseTaskTaskRestrictionComponentProperties(json, owner, res); 29698 return res; 29699 } 29700 29701 protected void parseTaskTaskRestrictionComponentProperties(JsonObject json, Task owner, 29702 Task.TaskRestrictionComponent res) throws IOException, FHIRFormatError { 29703 parseBackboneElementProperties(json, res); 29704 if (json.has("repetitions")) 29705 res.setRepetitionsElement(parsePositiveInt(json.get("repetitions").getAsString())); 29706 if (json.has("_repetitions")) 29707 parseElementProperties(getJObject(json, "_repetitions"), res.getRepetitionsElement()); 29708 if (json.has("period")) 29709 res.setPeriod(parsePeriod(getJObject(json, "period"))); 29710 if (json.has("recipient")) { 29711 JsonArray array = json.getAsJsonArray("recipient"); 29712 for (int i = 0; i < array.size(); i++) { 29713 res.getRecipient().add(parseReference(array.get(i).getAsJsonObject())); 29714 } 29715 } 29716 ; 29717 } 29718 29719 protected Task.ParameterComponent parseTaskParameterComponent(JsonObject json, Task owner) 29720 throws IOException, FHIRFormatError { 29721 Task.ParameterComponent res = new Task.ParameterComponent(); 29722 parseTaskParameterComponentProperties(json, owner, res); 29723 return res; 29724 } 29725 29726 protected void parseTaskParameterComponentProperties(JsonObject json, Task owner, Task.ParameterComponent res) 29727 throws IOException, FHIRFormatError { 29728 parseBackboneElementProperties(json, res); 29729 if (json.has("type")) 29730 res.setType(parseCodeableConcept(getJObject(json, "type"))); 29731 Type value = parseType("value", json); 29732 if (value != null) 29733 res.setValue(value); 29734 } 29735 29736 protected Task.TaskOutputComponent parseTaskTaskOutputComponent(JsonObject json, Task owner) 29737 throws IOException, FHIRFormatError { 29738 Task.TaskOutputComponent res = new Task.TaskOutputComponent(); 29739 parseTaskTaskOutputComponentProperties(json, owner, res); 29740 return res; 29741 } 29742 29743 protected void parseTaskTaskOutputComponentProperties(JsonObject json, Task owner, Task.TaskOutputComponent res) 29744 throws IOException, FHIRFormatError { 29745 parseBackboneElementProperties(json, res); 29746 if (json.has("type")) 29747 res.setType(parseCodeableConcept(getJObject(json, "type"))); 29748 Type value = parseType("value", json); 29749 if (value != null) 29750 res.setValue(value); 29751 } 29752 29753 protected TerminologyCapabilities parseTerminologyCapabilities(JsonObject json) throws IOException, FHIRFormatError { 29754 TerminologyCapabilities res = new TerminologyCapabilities(); 29755 parseTerminologyCapabilitiesProperties(json, res); 29756 return res; 29757 } 29758 29759 protected void parseTerminologyCapabilitiesProperties(JsonObject json, TerminologyCapabilities res) 29760 throws IOException, FHIRFormatError { 29761 parseDomainResourceProperties(json, res); 29762 if (json.has("url")) 29763 res.setUrlElement(parseUri(json.get("url").getAsString())); 29764 if (json.has("_url")) 29765 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 29766 if (json.has("version")) 29767 res.setVersionElement(parseString(json.get("version").getAsString())); 29768 if (json.has("_version")) 29769 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 29770 if (json.has("name")) 29771 res.setNameElement(parseString(json.get("name").getAsString())); 29772 if (json.has("_name")) 29773 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 29774 if (json.has("title")) 29775 res.setTitleElement(parseString(json.get("title").getAsString())); 29776 if (json.has("_title")) 29777 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 29778 if (json.has("status")) 29779 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 29780 new Enumerations.PublicationStatusEnumFactory())); 29781 if (json.has("_status")) 29782 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 29783 if (json.has("experimental")) 29784 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 29785 if (json.has("_experimental")) 29786 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 29787 if (json.has("date")) 29788 res.setDateElement(parseDateTime(json.get("date").getAsString())); 29789 if (json.has("_date")) 29790 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 29791 if (json.has("publisher")) 29792 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 29793 if (json.has("_publisher")) 29794 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 29795 if (json.has("contact")) { 29796 JsonArray array = json.getAsJsonArray("contact"); 29797 for (int i = 0; i < array.size(); i++) { 29798 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 29799 } 29800 } 29801 ; 29802 if (json.has("description")) 29803 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 29804 if (json.has("_description")) 29805 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 29806 if (json.has("useContext")) { 29807 JsonArray array = json.getAsJsonArray("useContext"); 29808 for (int i = 0; i < array.size(); i++) { 29809 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 29810 } 29811 } 29812 ; 29813 if (json.has("jurisdiction")) { 29814 JsonArray array = json.getAsJsonArray("jurisdiction"); 29815 for (int i = 0; i < array.size(); i++) { 29816 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 29817 } 29818 } 29819 ; 29820 if (json.has("purpose")) 29821 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 29822 if (json.has("_purpose")) 29823 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 29824 if (json.has("copyright")) 29825 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 29826 if (json.has("_copyright")) 29827 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 29828 if (json.has("kind")) 29829 res.setKindElement( 29830 parseEnumeration(json.get("kind").getAsString(), TerminologyCapabilities.CapabilityStatementKind.NULL, 29831 new TerminologyCapabilities.CapabilityStatementKindEnumFactory())); 29832 if (json.has("_kind")) 29833 parseElementProperties(getJObject(json, "_kind"), res.getKindElement()); 29834 if (json.has("software")) 29835 res.setSoftware( 29836 parseTerminologyCapabilitiesTerminologyCapabilitiesSoftwareComponent(getJObject(json, "software"), res)); 29837 if (json.has("implementation")) 29838 res.setImplementation(parseTerminologyCapabilitiesTerminologyCapabilitiesImplementationComponent( 29839 getJObject(json, "implementation"), res)); 29840 if (json.has("lockedDate")) 29841 res.setLockedDateElement(parseBoolean(json.get("lockedDate").getAsBoolean())); 29842 if (json.has("_lockedDate")) 29843 parseElementProperties(getJObject(json, "_lockedDate"), res.getLockedDateElement()); 29844 if (json.has("codeSystem")) { 29845 JsonArray array = json.getAsJsonArray("codeSystem"); 29846 for (int i = 0; i < array.size(); i++) { 29847 res.getCodeSystem().add(parseTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemComponent( 29848 array.get(i).getAsJsonObject(), res)); 29849 } 29850 } 29851 ; 29852 if (json.has("expansion")) 29853 res.setExpansion( 29854 parseTerminologyCapabilitiesTerminologyCapabilitiesExpansionComponent(getJObject(json, "expansion"), res)); 29855 if (json.has("codeSearch")) 29856 res.setCodeSearchElement(parseEnumeration(json.get("codeSearch").getAsString(), 29857 TerminologyCapabilities.CodeSearchSupport.NULL, new TerminologyCapabilities.CodeSearchSupportEnumFactory())); 29858 if (json.has("_codeSearch")) 29859 parseElementProperties(getJObject(json, "_codeSearch"), res.getCodeSearchElement()); 29860 if (json.has("validateCode")) 29861 res.setValidateCode(parseTerminologyCapabilitiesTerminologyCapabilitiesValidateCodeComponent( 29862 getJObject(json, "validateCode"), res)); 29863 if (json.has("translation")) 29864 res.setTranslation(parseTerminologyCapabilitiesTerminologyCapabilitiesTranslationComponent( 29865 getJObject(json, "translation"), res)); 29866 if (json.has("closure")) 29867 res.setClosure( 29868 parseTerminologyCapabilitiesTerminologyCapabilitiesClosureComponent(getJObject(json, "closure"), res)); 29869 } 29870 29871 protected TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent parseTerminologyCapabilitiesTerminologyCapabilitiesSoftwareComponent( 29872 JsonObject json, TerminologyCapabilities owner) throws IOException, FHIRFormatError { 29873 TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent res = new TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent(); 29874 parseTerminologyCapabilitiesTerminologyCapabilitiesSoftwareComponentProperties(json, owner, res); 29875 return res; 29876 } 29877 29878 protected void parseTerminologyCapabilitiesTerminologyCapabilitiesSoftwareComponentProperties(JsonObject json, 29879 TerminologyCapabilities owner, TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent res) 29880 throws IOException, FHIRFormatError { 29881 parseBackboneElementProperties(json, res); 29882 if (json.has("name")) 29883 res.setNameElement(parseString(json.get("name").getAsString())); 29884 if (json.has("_name")) 29885 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 29886 if (json.has("version")) 29887 res.setVersionElement(parseString(json.get("version").getAsString())); 29888 if (json.has("_version")) 29889 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 29890 } 29891 29892 protected TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent parseTerminologyCapabilitiesTerminologyCapabilitiesImplementationComponent( 29893 JsonObject json, TerminologyCapabilities owner) throws IOException, FHIRFormatError { 29894 TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent res = new TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent(); 29895 parseTerminologyCapabilitiesTerminologyCapabilitiesImplementationComponentProperties(json, owner, res); 29896 return res; 29897 } 29898 29899 protected void parseTerminologyCapabilitiesTerminologyCapabilitiesImplementationComponentProperties(JsonObject json, 29900 TerminologyCapabilities owner, TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent res) 29901 throws IOException, FHIRFormatError { 29902 parseBackboneElementProperties(json, res); 29903 if (json.has("description")) 29904 res.setDescriptionElement(parseString(json.get("description").getAsString())); 29905 if (json.has("_description")) 29906 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 29907 if (json.has("url")) 29908 res.setUrlElement(parseUrl(json.get("url").getAsString())); 29909 if (json.has("_url")) 29910 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 29911 } 29912 29913 protected TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent parseTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemComponent( 29914 JsonObject json, TerminologyCapabilities owner) throws IOException, FHIRFormatError { 29915 TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent res = new TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent(); 29916 parseTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemComponentProperties(json, owner, res); 29917 return res; 29918 } 29919 29920 protected void parseTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemComponentProperties(JsonObject json, 29921 TerminologyCapabilities owner, TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent res) 29922 throws IOException, FHIRFormatError { 29923 parseBackboneElementProperties(json, res); 29924 if (json.has("uri")) 29925 res.setUriElement(parseCanonical(json.get("uri").getAsString())); 29926 if (json.has("_uri")) 29927 parseElementProperties(getJObject(json, "_uri"), res.getUriElement()); 29928 if (json.has("version")) { 29929 JsonArray array = json.getAsJsonArray("version"); 29930 for (int i = 0; i < array.size(); i++) { 29931 res.getVersion().add(parseTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemVersionComponent( 29932 array.get(i).getAsJsonObject(), owner)); 29933 } 29934 } 29935 ; 29936 if (json.has("subsumption")) 29937 res.setSubsumptionElement(parseBoolean(json.get("subsumption").getAsBoolean())); 29938 if (json.has("_subsumption")) 29939 parseElementProperties(getJObject(json, "_subsumption"), res.getSubsumptionElement()); 29940 } 29941 29942 protected TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent parseTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemVersionComponent( 29943 JsonObject json, TerminologyCapabilities owner) throws IOException, FHIRFormatError { 29944 TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent res = new TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent(); 29945 parseTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemVersionComponentProperties(json, owner, res); 29946 return res; 29947 } 29948 29949 protected void parseTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemVersionComponentProperties( 29950 JsonObject json, TerminologyCapabilities owner, 29951 TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent res) 29952 throws IOException, FHIRFormatError { 29953 parseBackboneElementProperties(json, res); 29954 if (json.has("code")) 29955 res.setCodeElement(parseString(json.get("code").getAsString())); 29956 if (json.has("_code")) 29957 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 29958 if (json.has("isDefault")) 29959 res.setIsDefaultElement(parseBoolean(json.get("isDefault").getAsBoolean())); 29960 if (json.has("_isDefault")) 29961 parseElementProperties(getJObject(json, "_isDefault"), res.getIsDefaultElement()); 29962 if (json.has("compositional")) 29963 res.setCompositionalElement(parseBoolean(json.get("compositional").getAsBoolean())); 29964 if (json.has("_compositional")) 29965 parseElementProperties(getJObject(json, "_compositional"), res.getCompositionalElement()); 29966 if (json.has("language")) { 29967 JsonArray array = json.getAsJsonArray("language"); 29968 for (int i = 0; i < array.size(); i++) { 29969 if (array.get(i).isJsonNull()) { 29970 res.getLanguage().add(new CodeType()); 29971 } else { 29972 res.getLanguage().add(parseCode(array.get(i).getAsString())); 29973 } 29974 } 29975 } 29976 ; 29977 if (json.has("_language")) { 29978 JsonArray array = json.getAsJsonArray("_language"); 29979 for (int i = 0; i < array.size(); i++) { 29980 if (i == res.getLanguage().size()) 29981 res.getLanguage().add(parseCode(null)); 29982 if (array.get(i) instanceof JsonObject) 29983 parseElementProperties(array.get(i).getAsJsonObject(), res.getLanguage().get(i)); 29984 } 29985 } 29986 ; 29987 if (json.has("filter")) { 29988 JsonArray array = json.getAsJsonArray("filter"); 29989 for (int i = 0; i < array.size(); i++) { 29990 res.getFilter().add(parseTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemVersionFilterComponent( 29991 array.get(i).getAsJsonObject(), owner)); 29992 } 29993 } 29994 ; 29995 if (json.has("property")) { 29996 JsonArray array = json.getAsJsonArray("property"); 29997 for (int i = 0; i < array.size(); i++) { 29998 if (array.get(i).isJsonNull()) { 29999 res.getProperty().add(new CodeType()); 30000 } else { 30001 res.getProperty().add(parseCode(array.get(i).getAsString())); 30002 } 30003 } 30004 } 30005 ; 30006 if (json.has("_property")) { 30007 JsonArray array = json.getAsJsonArray("_property"); 30008 for (int i = 0; i < array.size(); i++) { 30009 if (i == res.getProperty().size()) 30010 res.getProperty().add(parseCode(null)); 30011 if (array.get(i) instanceof JsonObject) 30012 parseElementProperties(array.get(i).getAsJsonObject(), res.getProperty().get(i)); 30013 } 30014 } 30015 ; 30016 } 30017 30018 protected TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent parseTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemVersionFilterComponent( 30019 JsonObject json, TerminologyCapabilities owner) throws IOException, FHIRFormatError { 30020 TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent res = new TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent(); 30021 parseTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemVersionFilterComponentProperties(json, owner, res); 30022 return res; 30023 } 30024 30025 protected void parseTerminologyCapabilitiesTerminologyCapabilitiesCodeSystemVersionFilterComponentProperties( 30026 JsonObject json, TerminologyCapabilities owner, 30027 TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent res) 30028 throws IOException, FHIRFormatError { 30029 parseBackboneElementProperties(json, res); 30030 if (json.has("code")) 30031 res.setCodeElement(parseCode(json.get("code").getAsString())); 30032 if (json.has("_code")) 30033 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 30034 if (json.has("op")) { 30035 JsonArray array = json.getAsJsonArray("op"); 30036 for (int i = 0; i < array.size(); i++) { 30037 if (array.get(i).isJsonNull()) { 30038 res.getOp().add(new CodeType()); 30039 } else { 30040 res.getOp().add(parseCode(array.get(i).getAsString())); 30041 } 30042 } 30043 } 30044 ; 30045 if (json.has("_op")) { 30046 JsonArray array = json.getAsJsonArray("_op"); 30047 for (int i = 0; i < array.size(); i++) { 30048 if (i == res.getOp().size()) 30049 res.getOp().add(parseCode(null)); 30050 if (array.get(i) instanceof JsonObject) 30051 parseElementProperties(array.get(i).getAsJsonObject(), res.getOp().get(i)); 30052 } 30053 } 30054 ; 30055 } 30056 30057 protected TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent parseTerminologyCapabilitiesTerminologyCapabilitiesExpansionComponent( 30058 JsonObject json, TerminologyCapabilities owner) throws IOException, FHIRFormatError { 30059 TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent res = new TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent(); 30060 parseTerminologyCapabilitiesTerminologyCapabilitiesExpansionComponentProperties(json, owner, res); 30061 return res; 30062 } 30063 30064 protected void parseTerminologyCapabilitiesTerminologyCapabilitiesExpansionComponentProperties(JsonObject json, 30065 TerminologyCapabilities owner, TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent res) 30066 throws IOException, FHIRFormatError { 30067 parseBackboneElementProperties(json, res); 30068 if (json.has("hierarchical")) 30069 res.setHierarchicalElement(parseBoolean(json.get("hierarchical").getAsBoolean())); 30070 if (json.has("_hierarchical")) 30071 parseElementProperties(getJObject(json, "_hierarchical"), res.getHierarchicalElement()); 30072 if (json.has("paging")) 30073 res.setPagingElement(parseBoolean(json.get("paging").getAsBoolean())); 30074 if (json.has("_paging")) 30075 parseElementProperties(getJObject(json, "_paging"), res.getPagingElement()); 30076 if (json.has("incomplete")) 30077 res.setIncompleteElement(parseBoolean(json.get("incomplete").getAsBoolean())); 30078 if (json.has("_incomplete")) 30079 parseElementProperties(getJObject(json, "_incomplete"), res.getIncompleteElement()); 30080 if (json.has("parameter")) { 30081 JsonArray array = json.getAsJsonArray("parameter"); 30082 for (int i = 0; i < array.size(); i++) { 30083 res.getParameter().add(parseTerminologyCapabilitiesTerminologyCapabilitiesExpansionParameterComponent( 30084 array.get(i).getAsJsonObject(), owner)); 30085 } 30086 } 30087 ; 30088 if (json.has("textFilter")) 30089 res.setTextFilterElement(parseMarkdown(json.get("textFilter").getAsString())); 30090 if (json.has("_textFilter")) 30091 parseElementProperties(getJObject(json, "_textFilter"), res.getTextFilterElement()); 30092 } 30093 30094 protected TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent parseTerminologyCapabilitiesTerminologyCapabilitiesExpansionParameterComponent( 30095 JsonObject json, TerminologyCapabilities owner) throws IOException, FHIRFormatError { 30096 TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent res = new TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent(); 30097 parseTerminologyCapabilitiesTerminologyCapabilitiesExpansionParameterComponentProperties(json, owner, res); 30098 return res; 30099 } 30100 30101 protected void parseTerminologyCapabilitiesTerminologyCapabilitiesExpansionParameterComponentProperties( 30102 JsonObject json, TerminologyCapabilities owner, 30103 TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent res) 30104 throws IOException, FHIRFormatError { 30105 parseBackboneElementProperties(json, res); 30106 if (json.has("name")) 30107 res.setNameElement(parseCode(json.get("name").getAsString())); 30108 if (json.has("_name")) 30109 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 30110 if (json.has("documentation")) 30111 res.setDocumentationElement(parseString(json.get("documentation").getAsString())); 30112 if (json.has("_documentation")) 30113 parseElementProperties(getJObject(json, "_documentation"), res.getDocumentationElement()); 30114 } 30115 30116 protected TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent parseTerminologyCapabilitiesTerminologyCapabilitiesValidateCodeComponent( 30117 JsonObject json, TerminologyCapabilities owner) throws IOException, FHIRFormatError { 30118 TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent res = new TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent(); 30119 parseTerminologyCapabilitiesTerminologyCapabilitiesValidateCodeComponentProperties(json, owner, res); 30120 return res; 30121 } 30122 30123 protected void parseTerminologyCapabilitiesTerminologyCapabilitiesValidateCodeComponentProperties(JsonObject json, 30124 TerminologyCapabilities owner, TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent res) 30125 throws IOException, FHIRFormatError { 30126 parseBackboneElementProperties(json, res); 30127 if (json.has("translations")) 30128 res.setTranslationsElement(parseBoolean(json.get("translations").getAsBoolean())); 30129 if (json.has("_translations")) 30130 parseElementProperties(getJObject(json, "_translations"), res.getTranslationsElement()); 30131 } 30132 30133 protected TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent parseTerminologyCapabilitiesTerminologyCapabilitiesTranslationComponent( 30134 JsonObject json, TerminologyCapabilities owner) throws IOException, FHIRFormatError { 30135 TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent res = new TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent(); 30136 parseTerminologyCapabilitiesTerminologyCapabilitiesTranslationComponentProperties(json, owner, res); 30137 return res; 30138 } 30139 30140 protected void parseTerminologyCapabilitiesTerminologyCapabilitiesTranslationComponentProperties(JsonObject json, 30141 TerminologyCapabilities owner, TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent res) 30142 throws IOException, FHIRFormatError { 30143 parseBackboneElementProperties(json, res); 30144 if (json.has("needsMap")) 30145 res.setNeedsMapElement(parseBoolean(json.get("needsMap").getAsBoolean())); 30146 if (json.has("_needsMap")) 30147 parseElementProperties(getJObject(json, "_needsMap"), res.getNeedsMapElement()); 30148 } 30149 30150 protected TerminologyCapabilities.TerminologyCapabilitiesClosureComponent parseTerminologyCapabilitiesTerminologyCapabilitiesClosureComponent( 30151 JsonObject json, TerminologyCapabilities owner) throws IOException, FHIRFormatError { 30152 TerminologyCapabilities.TerminologyCapabilitiesClosureComponent res = new TerminologyCapabilities.TerminologyCapabilitiesClosureComponent(); 30153 parseTerminologyCapabilitiesTerminologyCapabilitiesClosureComponentProperties(json, owner, res); 30154 return res; 30155 } 30156 30157 protected void parseTerminologyCapabilitiesTerminologyCapabilitiesClosureComponentProperties(JsonObject json, 30158 TerminologyCapabilities owner, TerminologyCapabilities.TerminologyCapabilitiesClosureComponent res) 30159 throws IOException, FHIRFormatError { 30160 parseBackboneElementProperties(json, res); 30161 if (json.has("translation")) 30162 res.setTranslationElement(parseBoolean(json.get("translation").getAsBoolean())); 30163 if (json.has("_translation")) 30164 parseElementProperties(getJObject(json, "_translation"), res.getTranslationElement()); 30165 } 30166 30167 protected TestReport parseTestReport(JsonObject json) throws IOException, FHIRFormatError { 30168 TestReport res = new TestReport(); 30169 parseTestReportProperties(json, res); 30170 return res; 30171 } 30172 30173 protected void parseTestReportProperties(JsonObject json, TestReport res) throws IOException, FHIRFormatError { 30174 parseDomainResourceProperties(json, res); 30175 if (json.has("identifier")) 30176 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 30177 if (json.has("name")) 30178 res.setNameElement(parseString(json.get("name").getAsString())); 30179 if (json.has("_name")) 30180 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 30181 if (json.has("status")) 30182 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), TestReport.TestReportStatus.NULL, 30183 new TestReport.TestReportStatusEnumFactory())); 30184 if (json.has("_status")) 30185 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 30186 if (json.has("testScript")) 30187 res.setTestScript(parseReference(getJObject(json, "testScript"))); 30188 if (json.has("result")) 30189 res.setResultElement(parseEnumeration(json.get("result").getAsString(), TestReport.TestReportResult.NULL, 30190 new TestReport.TestReportResultEnumFactory())); 30191 if (json.has("_result")) 30192 parseElementProperties(getJObject(json, "_result"), res.getResultElement()); 30193 if (json.has("score")) 30194 res.setScoreElement(parseDecimal(json.get("score").getAsBigDecimal())); 30195 if (json.has("_score")) 30196 parseElementProperties(getJObject(json, "_score"), res.getScoreElement()); 30197 if (json.has("tester")) 30198 res.setTesterElement(parseString(json.get("tester").getAsString())); 30199 if (json.has("_tester")) 30200 parseElementProperties(getJObject(json, "_tester"), res.getTesterElement()); 30201 if (json.has("issued")) 30202 res.setIssuedElement(parseDateTime(json.get("issued").getAsString())); 30203 if (json.has("_issued")) 30204 parseElementProperties(getJObject(json, "_issued"), res.getIssuedElement()); 30205 if (json.has("participant")) { 30206 JsonArray array = json.getAsJsonArray("participant"); 30207 for (int i = 0; i < array.size(); i++) { 30208 res.getParticipant().add(parseTestReportTestReportParticipantComponent(array.get(i).getAsJsonObject(), res)); 30209 } 30210 } 30211 ; 30212 if (json.has("setup")) 30213 res.setSetup(parseTestReportTestReportSetupComponent(getJObject(json, "setup"), res)); 30214 if (json.has("test")) { 30215 JsonArray array = json.getAsJsonArray("test"); 30216 for (int i = 0; i < array.size(); i++) { 30217 res.getTest().add(parseTestReportTestReportTestComponent(array.get(i).getAsJsonObject(), res)); 30218 } 30219 } 30220 ; 30221 if (json.has("teardown")) 30222 res.setTeardown(parseTestReportTestReportTeardownComponent(getJObject(json, "teardown"), res)); 30223 } 30224 30225 protected TestReport.TestReportParticipantComponent parseTestReportTestReportParticipantComponent(JsonObject json, 30226 TestReport owner) throws IOException, FHIRFormatError { 30227 TestReport.TestReportParticipantComponent res = new TestReport.TestReportParticipantComponent(); 30228 parseTestReportTestReportParticipantComponentProperties(json, owner, res); 30229 return res; 30230 } 30231 30232 protected void parseTestReportTestReportParticipantComponentProperties(JsonObject json, TestReport owner, 30233 TestReport.TestReportParticipantComponent res) throws IOException, FHIRFormatError { 30234 parseBackboneElementProperties(json, res); 30235 if (json.has("type")) 30236 res.setTypeElement(parseEnumeration(json.get("type").getAsString(), TestReport.TestReportParticipantType.NULL, 30237 new TestReport.TestReportParticipantTypeEnumFactory())); 30238 if (json.has("_type")) 30239 parseElementProperties(getJObject(json, "_type"), res.getTypeElement()); 30240 if (json.has("uri")) 30241 res.setUriElement(parseUri(json.get("uri").getAsString())); 30242 if (json.has("_uri")) 30243 parseElementProperties(getJObject(json, "_uri"), res.getUriElement()); 30244 if (json.has("display")) 30245 res.setDisplayElement(parseString(json.get("display").getAsString())); 30246 if (json.has("_display")) 30247 parseElementProperties(getJObject(json, "_display"), res.getDisplayElement()); 30248 } 30249 30250 protected TestReport.TestReportSetupComponent parseTestReportTestReportSetupComponent(JsonObject json, 30251 TestReport owner) throws IOException, FHIRFormatError { 30252 TestReport.TestReportSetupComponent res = new TestReport.TestReportSetupComponent(); 30253 parseTestReportTestReportSetupComponentProperties(json, owner, res); 30254 return res; 30255 } 30256 30257 protected void parseTestReportTestReportSetupComponentProperties(JsonObject json, TestReport owner, 30258 TestReport.TestReportSetupComponent res) throws IOException, FHIRFormatError { 30259 parseBackboneElementProperties(json, res); 30260 if (json.has("action")) { 30261 JsonArray array = json.getAsJsonArray("action"); 30262 for (int i = 0; i < array.size(); i++) { 30263 res.getAction().add(parseTestReportSetupActionComponent(array.get(i).getAsJsonObject(), owner)); 30264 } 30265 } 30266 ; 30267 } 30268 30269 protected TestReport.SetupActionComponent parseTestReportSetupActionComponent(JsonObject json, TestReport owner) 30270 throws IOException, FHIRFormatError { 30271 TestReport.SetupActionComponent res = new TestReport.SetupActionComponent(); 30272 parseTestReportSetupActionComponentProperties(json, owner, res); 30273 return res; 30274 } 30275 30276 protected void parseTestReportSetupActionComponentProperties(JsonObject json, TestReport owner, 30277 TestReport.SetupActionComponent res) throws IOException, FHIRFormatError { 30278 parseBackboneElementProperties(json, res); 30279 if (json.has("operation")) 30280 res.setOperation(parseTestReportSetupActionOperationComponent(getJObject(json, "operation"), owner)); 30281 if (json.has("assert")) 30282 res.setAssert(parseTestReportSetupActionAssertComponent(getJObject(json, "assert"), owner)); 30283 } 30284 30285 protected TestReport.SetupActionOperationComponent parseTestReportSetupActionOperationComponent(JsonObject json, 30286 TestReport owner) throws IOException, FHIRFormatError { 30287 TestReport.SetupActionOperationComponent res = new TestReport.SetupActionOperationComponent(); 30288 parseTestReportSetupActionOperationComponentProperties(json, owner, res); 30289 return res; 30290 } 30291 30292 protected void parseTestReportSetupActionOperationComponentProperties(JsonObject json, TestReport owner, 30293 TestReport.SetupActionOperationComponent res) throws IOException, FHIRFormatError { 30294 parseBackboneElementProperties(json, res); 30295 if (json.has("result")) 30296 res.setResultElement(parseEnumeration(json.get("result").getAsString(), TestReport.TestReportActionResult.NULL, 30297 new TestReport.TestReportActionResultEnumFactory())); 30298 if (json.has("_result")) 30299 parseElementProperties(getJObject(json, "_result"), res.getResultElement()); 30300 if (json.has("message")) 30301 res.setMessageElement(parseMarkdown(json.get("message").getAsString())); 30302 if (json.has("_message")) 30303 parseElementProperties(getJObject(json, "_message"), res.getMessageElement()); 30304 if (json.has("detail")) 30305 res.setDetailElement(parseUri(json.get("detail").getAsString())); 30306 if (json.has("_detail")) 30307 parseElementProperties(getJObject(json, "_detail"), res.getDetailElement()); 30308 } 30309 30310 protected TestReport.SetupActionAssertComponent parseTestReportSetupActionAssertComponent(JsonObject json, 30311 TestReport owner) throws IOException, FHIRFormatError { 30312 TestReport.SetupActionAssertComponent res = new TestReport.SetupActionAssertComponent(); 30313 parseTestReportSetupActionAssertComponentProperties(json, owner, res); 30314 return res; 30315 } 30316 30317 protected void parseTestReportSetupActionAssertComponentProperties(JsonObject json, TestReport owner, 30318 TestReport.SetupActionAssertComponent res) throws IOException, FHIRFormatError { 30319 parseBackboneElementProperties(json, res); 30320 if (json.has("result")) 30321 res.setResultElement(parseEnumeration(json.get("result").getAsString(), TestReport.TestReportActionResult.NULL, 30322 new TestReport.TestReportActionResultEnumFactory())); 30323 if (json.has("_result")) 30324 parseElementProperties(getJObject(json, "_result"), res.getResultElement()); 30325 if (json.has("message")) 30326 res.setMessageElement(parseMarkdown(json.get("message").getAsString())); 30327 if (json.has("_message")) 30328 parseElementProperties(getJObject(json, "_message"), res.getMessageElement()); 30329 if (json.has("detail")) 30330 res.setDetailElement(parseString(json.get("detail").getAsString())); 30331 if (json.has("_detail")) 30332 parseElementProperties(getJObject(json, "_detail"), res.getDetailElement()); 30333 } 30334 30335 protected TestReport.TestReportTestComponent parseTestReportTestReportTestComponent(JsonObject json, TestReport owner) 30336 throws IOException, FHIRFormatError { 30337 TestReport.TestReportTestComponent res = new TestReport.TestReportTestComponent(); 30338 parseTestReportTestReportTestComponentProperties(json, owner, res); 30339 return res; 30340 } 30341 30342 protected void parseTestReportTestReportTestComponentProperties(JsonObject json, TestReport owner, 30343 TestReport.TestReportTestComponent res) throws IOException, FHIRFormatError { 30344 parseBackboneElementProperties(json, res); 30345 if (json.has("name")) 30346 res.setNameElement(parseString(json.get("name").getAsString())); 30347 if (json.has("_name")) 30348 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 30349 if (json.has("description")) 30350 res.setDescriptionElement(parseString(json.get("description").getAsString())); 30351 if (json.has("_description")) 30352 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 30353 if (json.has("action")) { 30354 JsonArray array = json.getAsJsonArray("action"); 30355 for (int i = 0; i < array.size(); i++) { 30356 res.getAction().add(parseTestReportTestActionComponent(array.get(i).getAsJsonObject(), owner)); 30357 } 30358 } 30359 ; 30360 } 30361 30362 protected TestReport.TestActionComponent parseTestReportTestActionComponent(JsonObject json, TestReport owner) 30363 throws IOException, FHIRFormatError { 30364 TestReport.TestActionComponent res = new TestReport.TestActionComponent(); 30365 parseTestReportTestActionComponentProperties(json, owner, res); 30366 return res; 30367 } 30368 30369 protected void parseTestReportTestActionComponentProperties(JsonObject json, TestReport owner, 30370 TestReport.TestActionComponent res) throws IOException, FHIRFormatError { 30371 parseBackboneElementProperties(json, res); 30372 if (json.has("operation")) 30373 res.setOperation(parseTestReportSetupActionOperationComponent(getJObject(json, "operation"), owner)); 30374 if (json.has("assert")) 30375 res.setAssert(parseTestReportSetupActionAssertComponent(getJObject(json, "assert"), owner)); 30376 } 30377 30378 protected TestReport.TestReportTeardownComponent parseTestReportTestReportTeardownComponent(JsonObject json, 30379 TestReport owner) throws IOException, FHIRFormatError { 30380 TestReport.TestReportTeardownComponent res = new TestReport.TestReportTeardownComponent(); 30381 parseTestReportTestReportTeardownComponentProperties(json, owner, res); 30382 return res; 30383 } 30384 30385 protected void parseTestReportTestReportTeardownComponentProperties(JsonObject json, TestReport owner, 30386 TestReport.TestReportTeardownComponent res) throws IOException, FHIRFormatError { 30387 parseBackboneElementProperties(json, res); 30388 if (json.has("action")) { 30389 JsonArray array = json.getAsJsonArray("action"); 30390 for (int i = 0; i < array.size(); i++) { 30391 res.getAction().add(parseTestReportTeardownActionComponent(array.get(i).getAsJsonObject(), owner)); 30392 } 30393 } 30394 ; 30395 } 30396 30397 protected TestReport.TeardownActionComponent parseTestReportTeardownActionComponent(JsonObject json, TestReport owner) 30398 throws IOException, FHIRFormatError { 30399 TestReport.TeardownActionComponent res = new TestReport.TeardownActionComponent(); 30400 parseTestReportTeardownActionComponentProperties(json, owner, res); 30401 return res; 30402 } 30403 30404 protected void parseTestReportTeardownActionComponentProperties(JsonObject json, TestReport owner, 30405 TestReport.TeardownActionComponent res) throws IOException, FHIRFormatError { 30406 parseBackboneElementProperties(json, res); 30407 if (json.has("operation")) 30408 res.setOperation(parseTestReportSetupActionOperationComponent(getJObject(json, "operation"), owner)); 30409 } 30410 30411 protected TestScript parseTestScript(JsonObject json) throws IOException, FHIRFormatError { 30412 TestScript res = new TestScript(); 30413 parseTestScriptProperties(json, res); 30414 return res; 30415 } 30416 30417 protected void parseTestScriptProperties(JsonObject json, TestScript res) throws IOException, FHIRFormatError { 30418 parseDomainResourceProperties(json, res); 30419 if (json.has("url")) 30420 res.setUrlElement(parseUri(json.get("url").getAsString())); 30421 if (json.has("_url")) 30422 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 30423 if (json.has("identifier")) 30424 res.setIdentifier(parseIdentifier(getJObject(json, "identifier"))); 30425 if (json.has("version")) 30426 res.setVersionElement(parseString(json.get("version").getAsString())); 30427 if (json.has("_version")) 30428 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 30429 if (json.has("name")) 30430 res.setNameElement(parseString(json.get("name").getAsString())); 30431 if (json.has("_name")) 30432 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 30433 if (json.has("title")) 30434 res.setTitleElement(parseString(json.get("title").getAsString())); 30435 if (json.has("_title")) 30436 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 30437 if (json.has("status")) 30438 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 30439 new Enumerations.PublicationStatusEnumFactory())); 30440 if (json.has("_status")) 30441 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 30442 if (json.has("experimental")) 30443 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 30444 if (json.has("_experimental")) 30445 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 30446 if (json.has("date")) 30447 res.setDateElement(parseDateTime(json.get("date").getAsString())); 30448 if (json.has("_date")) 30449 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 30450 if (json.has("publisher")) 30451 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 30452 if (json.has("_publisher")) 30453 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 30454 if (json.has("contact")) { 30455 JsonArray array = json.getAsJsonArray("contact"); 30456 for (int i = 0; i < array.size(); i++) { 30457 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 30458 } 30459 } 30460 ; 30461 if (json.has("description")) 30462 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 30463 if (json.has("_description")) 30464 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 30465 if (json.has("useContext")) { 30466 JsonArray array = json.getAsJsonArray("useContext"); 30467 for (int i = 0; i < array.size(); i++) { 30468 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 30469 } 30470 } 30471 ; 30472 if (json.has("jurisdiction")) { 30473 JsonArray array = json.getAsJsonArray("jurisdiction"); 30474 for (int i = 0; i < array.size(); i++) { 30475 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 30476 } 30477 } 30478 ; 30479 if (json.has("purpose")) 30480 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 30481 if (json.has("_purpose")) 30482 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 30483 if (json.has("copyright")) 30484 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 30485 if (json.has("_copyright")) 30486 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 30487 if (json.has("origin")) { 30488 JsonArray array = json.getAsJsonArray("origin"); 30489 for (int i = 0; i < array.size(); i++) { 30490 res.getOrigin().add(parseTestScriptTestScriptOriginComponent(array.get(i).getAsJsonObject(), res)); 30491 } 30492 } 30493 ; 30494 if (json.has("destination")) { 30495 JsonArray array = json.getAsJsonArray("destination"); 30496 for (int i = 0; i < array.size(); i++) { 30497 res.getDestination().add(parseTestScriptTestScriptDestinationComponent(array.get(i).getAsJsonObject(), res)); 30498 } 30499 } 30500 ; 30501 if (json.has("metadata")) 30502 res.setMetadata(parseTestScriptTestScriptMetadataComponent(getJObject(json, "metadata"), res)); 30503 if (json.has("fixture")) { 30504 JsonArray array = json.getAsJsonArray("fixture"); 30505 for (int i = 0; i < array.size(); i++) { 30506 res.getFixture().add(parseTestScriptTestScriptFixtureComponent(array.get(i).getAsJsonObject(), res)); 30507 } 30508 } 30509 ; 30510 if (json.has("profile")) { 30511 JsonArray array = json.getAsJsonArray("profile"); 30512 for (int i = 0; i < array.size(); i++) { 30513 res.getProfile().add(parseReference(array.get(i).getAsJsonObject())); 30514 } 30515 } 30516 ; 30517 if (json.has("variable")) { 30518 JsonArray array = json.getAsJsonArray("variable"); 30519 for (int i = 0; i < array.size(); i++) { 30520 res.getVariable().add(parseTestScriptTestScriptVariableComponent(array.get(i).getAsJsonObject(), res)); 30521 } 30522 } 30523 ; 30524 if (json.has("setup")) 30525 res.setSetup(parseTestScriptTestScriptSetupComponent(getJObject(json, "setup"), res)); 30526 if (json.has("test")) { 30527 JsonArray array = json.getAsJsonArray("test"); 30528 for (int i = 0; i < array.size(); i++) { 30529 res.getTest().add(parseTestScriptTestScriptTestComponent(array.get(i).getAsJsonObject(), res)); 30530 } 30531 } 30532 ; 30533 if (json.has("teardown")) 30534 res.setTeardown(parseTestScriptTestScriptTeardownComponent(getJObject(json, "teardown"), res)); 30535 } 30536 30537 protected TestScript.TestScriptOriginComponent parseTestScriptTestScriptOriginComponent(JsonObject json, 30538 TestScript owner) throws IOException, FHIRFormatError { 30539 TestScript.TestScriptOriginComponent res = new TestScript.TestScriptOriginComponent(); 30540 parseTestScriptTestScriptOriginComponentProperties(json, owner, res); 30541 return res; 30542 } 30543 30544 protected void parseTestScriptTestScriptOriginComponentProperties(JsonObject json, TestScript owner, 30545 TestScript.TestScriptOriginComponent res) throws IOException, FHIRFormatError { 30546 parseBackboneElementProperties(json, res); 30547 if (json.has("index")) 30548 res.setIndexElement(parseInteger(json.get("index").getAsLong())); 30549 if (json.has("_index")) 30550 parseElementProperties(getJObject(json, "_index"), res.getIndexElement()); 30551 if (json.has("profile")) 30552 res.setProfile(parseCoding(getJObject(json, "profile"))); 30553 } 30554 30555 protected TestScript.TestScriptDestinationComponent parseTestScriptTestScriptDestinationComponent(JsonObject json, 30556 TestScript owner) throws IOException, FHIRFormatError { 30557 TestScript.TestScriptDestinationComponent res = new TestScript.TestScriptDestinationComponent(); 30558 parseTestScriptTestScriptDestinationComponentProperties(json, owner, res); 30559 return res; 30560 } 30561 30562 protected void parseTestScriptTestScriptDestinationComponentProperties(JsonObject json, TestScript owner, 30563 TestScript.TestScriptDestinationComponent res) throws IOException, FHIRFormatError { 30564 parseBackboneElementProperties(json, res); 30565 if (json.has("index")) 30566 res.setIndexElement(parseInteger(json.get("index").getAsLong())); 30567 if (json.has("_index")) 30568 parseElementProperties(getJObject(json, "_index"), res.getIndexElement()); 30569 if (json.has("profile")) 30570 res.setProfile(parseCoding(getJObject(json, "profile"))); 30571 } 30572 30573 protected TestScript.TestScriptMetadataComponent parseTestScriptTestScriptMetadataComponent(JsonObject json, 30574 TestScript owner) throws IOException, FHIRFormatError { 30575 TestScript.TestScriptMetadataComponent res = new TestScript.TestScriptMetadataComponent(); 30576 parseTestScriptTestScriptMetadataComponentProperties(json, owner, res); 30577 return res; 30578 } 30579 30580 protected void parseTestScriptTestScriptMetadataComponentProperties(JsonObject json, TestScript owner, 30581 TestScript.TestScriptMetadataComponent res) throws IOException, FHIRFormatError { 30582 parseBackboneElementProperties(json, res); 30583 if (json.has("link")) { 30584 JsonArray array = json.getAsJsonArray("link"); 30585 for (int i = 0; i < array.size(); i++) { 30586 res.getLink().add(parseTestScriptTestScriptMetadataLinkComponent(array.get(i).getAsJsonObject(), owner)); 30587 } 30588 } 30589 ; 30590 if (json.has("capability")) { 30591 JsonArray array = json.getAsJsonArray("capability"); 30592 for (int i = 0; i < array.size(); i++) { 30593 res.getCapability() 30594 .add(parseTestScriptTestScriptMetadataCapabilityComponent(array.get(i).getAsJsonObject(), owner)); 30595 } 30596 } 30597 ; 30598 } 30599 30600 protected TestScript.TestScriptMetadataLinkComponent parseTestScriptTestScriptMetadataLinkComponent(JsonObject json, 30601 TestScript owner) throws IOException, FHIRFormatError { 30602 TestScript.TestScriptMetadataLinkComponent res = new TestScript.TestScriptMetadataLinkComponent(); 30603 parseTestScriptTestScriptMetadataLinkComponentProperties(json, owner, res); 30604 return res; 30605 } 30606 30607 protected void parseTestScriptTestScriptMetadataLinkComponentProperties(JsonObject json, TestScript owner, 30608 TestScript.TestScriptMetadataLinkComponent res) throws IOException, FHIRFormatError { 30609 parseBackboneElementProperties(json, res); 30610 if (json.has("url")) 30611 res.setUrlElement(parseUri(json.get("url").getAsString())); 30612 if (json.has("_url")) 30613 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 30614 if (json.has("description")) 30615 res.setDescriptionElement(parseString(json.get("description").getAsString())); 30616 if (json.has("_description")) 30617 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 30618 } 30619 30620 protected TestScript.TestScriptMetadataCapabilityComponent parseTestScriptTestScriptMetadataCapabilityComponent( 30621 JsonObject json, TestScript owner) throws IOException, FHIRFormatError { 30622 TestScript.TestScriptMetadataCapabilityComponent res = new TestScript.TestScriptMetadataCapabilityComponent(); 30623 parseTestScriptTestScriptMetadataCapabilityComponentProperties(json, owner, res); 30624 return res; 30625 } 30626 30627 protected void parseTestScriptTestScriptMetadataCapabilityComponentProperties(JsonObject json, TestScript owner, 30628 TestScript.TestScriptMetadataCapabilityComponent res) throws IOException, FHIRFormatError { 30629 parseBackboneElementProperties(json, res); 30630 if (json.has("required")) 30631 res.setRequiredElement(parseBoolean(json.get("required").getAsBoolean())); 30632 if (json.has("_required")) 30633 parseElementProperties(getJObject(json, "_required"), res.getRequiredElement()); 30634 if (json.has("validated")) 30635 res.setValidatedElement(parseBoolean(json.get("validated").getAsBoolean())); 30636 if (json.has("_validated")) 30637 parseElementProperties(getJObject(json, "_validated"), res.getValidatedElement()); 30638 if (json.has("description")) 30639 res.setDescriptionElement(parseString(json.get("description").getAsString())); 30640 if (json.has("_description")) 30641 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 30642 if (json.has("origin")) { 30643 JsonArray array = json.getAsJsonArray("origin"); 30644 for (int i = 0; i < array.size(); i++) { 30645 if (array.get(i).isJsonNull()) { 30646 res.getOrigin().add(new IntegerType()); 30647 } else { 30648 res.getOrigin().add(parseInteger(array.get(i).getAsLong())); 30649 } 30650 } 30651 } 30652 ; 30653 if (json.has("_origin")) { 30654 JsonArray array = json.getAsJsonArray("_origin"); 30655 for (int i = 0; i < array.size(); i++) { 30656 if (i == res.getOrigin().size()) 30657 res.getOrigin().add(parseInteger(null)); 30658 if (array.get(i) instanceof JsonObject) 30659 parseElementProperties(array.get(i).getAsJsonObject(), res.getOrigin().get(i)); 30660 } 30661 } 30662 ; 30663 if (json.has("destination")) 30664 res.setDestinationElement(parseInteger(json.get("destination").getAsLong())); 30665 if (json.has("_destination")) 30666 parseElementProperties(getJObject(json, "_destination"), res.getDestinationElement()); 30667 if (json.has("link")) { 30668 JsonArray array = json.getAsJsonArray("link"); 30669 for (int i = 0; i < array.size(); i++) { 30670 if (array.get(i).isJsonNull()) { 30671 res.getLink().add(new UriType()); 30672 } else { 30673 res.getLink().add(parseUri(array.get(i).getAsString())); 30674 } 30675 } 30676 } 30677 ; 30678 if (json.has("_link")) { 30679 JsonArray array = json.getAsJsonArray("_link"); 30680 for (int i = 0; i < array.size(); i++) { 30681 if (i == res.getLink().size()) 30682 res.getLink().add(parseUri(null)); 30683 if (array.get(i) instanceof JsonObject) 30684 parseElementProperties(array.get(i).getAsJsonObject(), res.getLink().get(i)); 30685 } 30686 } 30687 ; 30688 if (json.has("capabilities")) 30689 res.setCapabilitiesElement(parseCanonical(json.get("capabilities").getAsString())); 30690 if (json.has("_capabilities")) 30691 parseElementProperties(getJObject(json, "_capabilities"), res.getCapabilitiesElement()); 30692 } 30693 30694 protected TestScript.TestScriptFixtureComponent parseTestScriptTestScriptFixtureComponent(JsonObject json, 30695 TestScript owner) throws IOException, FHIRFormatError { 30696 TestScript.TestScriptFixtureComponent res = new TestScript.TestScriptFixtureComponent(); 30697 parseTestScriptTestScriptFixtureComponentProperties(json, owner, res); 30698 return res; 30699 } 30700 30701 protected void parseTestScriptTestScriptFixtureComponentProperties(JsonObject json, TestScript owner, 30702 TestScript.TestScriptFixtureComponent res) throws IOException, FHIRFormatError { 30703 parseBackboneElementProperties(json, res); 30704 if (json.has("autocreate")) 30705 res.setAutocreateElement(parseBoolean(json.get("autocreate").getAsBoolean())); 30706 if (json.has("_autocreate")) 30707 parseElementProperties(getJObject(json, "_autocreate"), res.getAutocreateElement()); 30708 if (json.has("autodelete")) 30709 res.setAutodeleteElement(parseBoolean(json.get("autodelete").getAsBoolean())); 30710 if (json.has("_autodelete")) 30711 parseElementProperties(getJObject(json, "_autodelete"), res.getAutodeleteElement()); 30712 if (json.has("resource")) 30713 res.setResource(parseReference(getJObject(json, "resource"))); 30714 } 30715 30716 protected TestScript.TestScriptVariableComponent parseTestScriptTestScriptVariableComponent(JsonObject json, 30717 TestScript owner) throws IOException, FHIRFormatError { 30718 TestScript.TestScriptVariableComponent res = new TestScript.TestScriptVariableComponent(); 30719 parseTestScriptTestScriptVariableComponentProperties(json, owner, res); 30720 return res; 30721 } 30722 30723 protected void parseTestScriptTestScriptVariableComponentProperties(JsonObject json, TestScript owner, 30724 TestScript.TestScriptVariableComponent res) throws IOException, FHIRFormatError { 30725 parseBackboneElementProperties(json, res); 30726 if (json.has("name")) 30727 res.setNameElement(parseString(json.get("name").getAsString())); 30728 if (json.has("_name")) 30729 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 30730 if (json.has("defaultValue")) 30731 res.setDefaultValueElement(parseString(json.get("defaultValue").getAsString())); 30732 if (json.has("_defaultValue")) 30733 parseElementProperties(getJObject(json, "_defaultValue"), res.getDefaultValueElement()); 30734 if (json.has("description")) 30735 res.setDescriptionElement(parseString(json.get("description").getAsString())); 30736 if (json.has("_description")) 30737 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 30738 if (json.has("expression")) 30739 res.setExpressionElement(parseString(json.get("expression").getAsString())); 30740 if (json.has("_expression")) 30741 parseElementProperties(getJObject(json, "_expression"), res.getExpressionElement()); 30742 if (json.has("headerField")) 30743 res.setHeaderFieldElement(parseString(json.get("headerField").getAsString())); 30744 if (json.has("_headerField")) 30745 parseElementProperties(getJObject(json, "_headerField"), res.getHeaderFieldElement()); 30746 if (json.has("hint")) 30747 res.setHintElement(parseString(json.get("hint").getAsString())); 30748 if (json.has("_hint")) 30749 parseElementProperties(getJObject(json, "_hint"), res.getHintElement()); 30750 if (json.has("path")) 30751 res.setPathElement(parseString(json.get("path").getAsString())); 30752 if (json.has("_path")) 30753 parseElementProperties(getJObject(json, "_path"), res.getPathElement()); 30754 if (json.has("sourceId")) 30755 res.setSourceIdElement(parseId(json.get("sourceId").getAsString())); 30756 if (json.has("_sourceId")) 30757 parseElementProperties(getJObject(json, "_sourceId"), res.getSourceIdElement()); 30758 } 30759 30760 protected TestScript.TestScriptSetupComponent parseTestScriptTestScriptSetupComponent(JsonObject json, 30761 TestScript owner) throws IOException, FHIRFormatError { 30762 TestScript.TestScriptSetupComponent res = new TestScript.TestScriptSetupComponent(); 30763 parseTestScriptTestScriptSetupComponentProperties(json, owner, res); 30764 return res; 30765 } 30766 30767 protected void parseTestScriptTestScriptSetupComponentProperties(JsonObject json, TestScript owner, 30768 TestScript.TestScriptSetupComponent res) throws IOException, FHIRFormatError { 30769 parseBackboneElementProperties(json, res); 30770 if (json.has("action")) { 30771 JsonArray array = json.getAsJsonArray("action"); 30772 for (int i = 0; i < array.size(); i++) { 30773 res.getAction().add(parseTestScriptSetupActionComponent(array.get(i).getAsJsonObject(), owner)); 30774 } 30775 } 30776 ; 30777 } 30778 30779 protected TestScript.SetupActionComponent parseTestScriptSetupActionComponent(JsonObject json, TestScript owner) 30780 throws IOException, FHIRFormatError { 30781 TestScript.SetupActionComponent res = new TestScript.SetupActionComponent(); 30782 parseTestScriptSetupActionComponentProperties(json, owner, res); 30783 return res; 30784 } 30785 30786 protected void parseTestScriptSetupActionComponentProperties(JsonObject json, TestScript owner, 30787 TestScript.SetupActionComponent res) throws IOException, FHIRFormatError { 30788 parseBackboneElementProperties(json, res); 30789 if (json.has("operation")) 30790 res.setOperation(parseTestScriptSetupActionOperationComponent(getJObject(json, "operation"), owner)); 30791 if (json.has("assert")) 30792 res.setAssert(parseTestScriptSetupActionAssertComponent(getJObject(json, "assert"), owner)); 30793 } 30794 30795 protected TestScript.SetupActionOperationComponent parseTestScriptSetupActionOperationComponent(JsonObject json, 30796 TestScript owner) throws IOException, FHIRFormatError { 30797 TestScript.SetupActionOperationComponent res = new TestScript.SetupActionOperationComponent(); 30798 parseTestScriptSetupActionOperationComponentProperties(json, owner, res); 30799 return res; 30800 } 30801 30802 protected void parseTestScriptSetupActionOperationComponentProperties(JsonObject json, TestScript owner, 30803 TestScript.SetupActionOperationComponent res) throws IOException, FHIRFormatError { 30804 parseBackboneElementProperties(json, res); 30805 if (json.has("type")) 30806 res.setType(parseCoding(getJObject(json, "type"))); 30807 if (json.has("resource")) 30808 res.setResourceElement(parseCode(json.get("resource").getAsString())); 30809 if (json.has("_resource")) 30810 parseElementProperties(getJObject(json, "_resource"), res.getResourceElement()); 30811 if (json.has("label")) 30812 res.setLabelElement(parseString(json.get("label").getAsString())); 30813 if (json.has("_label")) 30814 parseElementProperties(getJObject(json, "_label"), res.getLabelElement()); 30815 if (json.has("description")) 30816 res.setDescriptionElement(parseString(json.get("description").getAsString())); 30817 if (json.has("_description")) 30818 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 30819 if (json.has("accept")) 30820 res.setAcceptElement(parseCode(json.get("accept").getAsString())); 30821 if (json.has("_accept")) 30822 parseElementProperties(getJObject(json, "_accept"), res.getAcceptElement()); 30823 if (json.has("contentType")) 30824 res.setContentTypeElement(parseCode(json.get("contentType").getAsString())); 30825 if (json.has("_contentType")) 30826 parseElementProperties(getJObject(json, "_contentType"), res.getContentTypeElement()); 30827 if (json.has("destination")) 30828 res.setDestinationElement(parseInteger(json.get("destination").getAsLong())); 30829 if (json.has("_destination")) 30830 parseElementProperties(getJObject(json, "_destination"), res.getDestinationElement()); 30831 if (json.has("encodeRequestUrl")) 30832 res.setEncodeRequestUrlElement(parseBoolean(json.get("encodeRequestUrl").getAsBoolean())); 30833 if (json.has("_encodeRequestUrl")) 30834 parseElementProperties(getJObject(json, "_encodeRequestUrl"), res.getEncodeRequestUrlElement()); 30835 if (json.has("method")) 30836 res.setMethodElement(parseEnumeration(json.get("method").getAsString(), 30837 TestScript.TestScriptRequestMethodCode.NULL, new TestScript.TestScriptRequestMethodCodeEnumFactory())); 30838 if (json.has("_method")) 30839 parseElementProperties(getJObject(json, "_method"), res.getMethodElement()); 30840 if (json.has("origin")) 30841 res.setOriginElement(parseInteger(json.get("origin").getAsLong())); 30842 if (json.has("_origin")) 30843 parseElementProperties(getJObject(json, "_origin"), res.getOriginElement()); 30844 if (json.has("params")) 30845 res.setParamsElement(parseString(json.get("params").getAsString())); 30846 if (json.has("_params")) 30847 parseElementProperties(getJObject(json, "_params"), res.getParamsElement()); 30848 if (json.has("requestHeader")) { 30849 JsonArray array = json.getAsJsonArray("requestHeader"); 30850 for (int i = 0; i < array.size(); i++) { 30851 res.getRequestHeader() 30852 .add(parseTestScriptSetupActionOperationRequestHeaderComponent(array.get(i).getAsJsonObject(), owner)); 30853 } 30854 } 30855 ; 30856 if (json.has("requestId")) 30857 res.setRequestIdElement(parseId(json.get("requestId").getAsString())); 30858 if (json.has("_requestId")) 30859 parseElementProperties(getJObject(json, "_requestId"), res.getRequestIdElement()); 30860 if (json.has("responseId")) 30861 res.setResponseIdElement(parseId(json.get("responseId").getAsString())); 30862 if (json.has("_responseId")) 30863 parseElementProperties(getJObject(json, "_responseId"), res.getResponseIdElement()); 30864 if (json.has("sourceId")) 30865 res.setSourceIdElement(parseId(json.get("sourceId").getAsString())); 30866 if (json.has("_sourceId")) 30867 parseElementProperties(getJObject(json, "_sourceId"), res.getSourceIdElement()); 30868 if (json.has("targetId")) 30869 res.setTargetIdElement(parseId(json.get("targetId").getAsString())); 30870 if (json.has("_targetId")) 30871 parseElementProperties(getJObject(json, "_targetId"), res.getTargetIdElement()); 30872 if (json.has("url")) 30873 res.setUrlElement(parseString(json.get("url").getAsString())); 30874 if (json.has("_url")) 30875 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 30876 } 30877 30878 protected TestScript.SetupActionOperationRequestHeaderComponent parseTestScriptSetupActionOperationRequestHeaderComponent( 30879 JsonObject json, TestScript owner) throws IOException, FHIRFormatError { 30880 TestScript.SetupActionOperationRequestHeaderComponent res = new TestScript.SetupActionOperationRequestHeaderComponent(); 30881 parseTestScriptSetupActionOperationRequestHeaderComponentProperties(json, owner, res); 30882 return res; 30883 } 30884 30885 protected void parseTestScriptSetupActionOperationRequestHeaderComponentProperties(JsonObject json, TestScript owner, 30886 TestScript.SetupActionOperationRequestHeaderComponent res) throws IOException, FHIRFormatError { 30887 parseBackboneElementProperties(json, res); 30888 if (json.has("field")) 30889 res.setFieldElement(parseString(json.get("field").getAsString())); 30890 if (json.has("_field")) 30891 parseElementProperties(getJObject(json, "_field"), res.getFieldElement()); 30892 if (json.has("value")) 30893 res.setValueElement(parseString(json.get("value").getAsString())); 30894 if (json.has("_value")) 30895 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 30896 } 30897 30898 protected TestScript.SetupActionAssertComponent parseTestScriptSetupActionAssertComponent(JsonObject json, 30899 TestScript owner) throws IOException, FHIRFormatError { 30900 TestScript.SetupActionAssertComponent res = new TestScript.SetupActionAssertComponent(); 30901 parseTestScriptSetupActionAssertComponentProperties(json, owner, res); 30902 return res; 30903 } 30904 30905 protected void parseTestScriptSetupActionAssertComponentProperties(JsonObject json, TestScript owner, 30906 TestScript.SetupActionAssertComponent res) throws IOException, FHIRFormatError { 30907 parseBackboneElementProperties(json, res); 30908 if (json.has("label")) 30909 res.setLabelElement(parseString(json.get("label").getAsString())); 30910 if (json.has("_label")) 30911 parseElementProperties(getJObject(json, "_label"), res.getLabelElement()); 30912 if (json.has("description")) 30913 res.setDescriptionElement(parseString(json.get("description").getAsString())); 30914 if (json.has("_description")) 30915 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 30916 if (json.has("direction")) 30917 res.setDirectionElement(parseEnumeration(json.get("direction").getAsString(), 30918 TestScript.AssertionDirectionType.NULL, new TestScript.AssertionDirectionTypeEnumFactory())); 30919 if (json.has("_direction")) 30920 parseElementProperties(getJObject(json, "_direction"), res.getDirectionElement()); 30921 if (json.has("compareToSourceId")) 30922 res.setCompareToSourceIdElement(parseString(json.get("compareToSourceId").getAsString())); 30923 if (json.has("_compareToSourceId")) 30924 parseElementProperties(getJObject(json, "_compareToSourceId"), res.getCompareToSourceIdElement()); 30925 if (json.has("compareToSourceExpression")) 30926 res.setCompareToSourceExpressionElement(parseString(json.get("compareToSourceExpression").getAsString())); 30927 if (json.has("_compareToSourceExpression")) 30928 parseElementProperties(getJObject(json, "_compareToSourceExpression"), res.getCompareToSourceExpressionElement()); 30929 if (json.has("compareToSourcePath")) 30930 res.setCompareToSourcePathElement(parseString(json.get("compareToSourcePath").getAsString())); 30931 if (json.has("_compareToSourcePath")) 30932 parseElementProperties(getJObject(json, "_compareToSourcePath"), res.getCompareToSourcePathElement()); 30933 if (json.has("contentType")) 30934 res.setContentTypeElement(parseCode(json.get("contentType").getAsString())); 30935 if (json.has("_contentType")) 30936 parseElementProperties(getJObject(json, "_contentType"), res.getContentTypeElement()); 30937 if (json.has("expression")) 30938 res.setExpressionElement(parseString(json.get("expression").getAsString())); 30939 if (json.has("_expression")) 30940 parseElementProperties(getJObject(json, "_expression"), res.getExpressionElement()); 30941 if (json.has("headerField")) 30942 res.setHeaderFieldElement(parseString(json.get("headerField").getAsString())); 30943 if (json.has("_headerField")) 30944 parseElementProperties(getJObject(json, "_headerField"), res.getHeaderFieldElement()); 30945 if (json.has("minimumId")) 30946 res.setMinimumIdElement(parseString(json.get("minimumId").getAsString())); 30947 if (json.has("_minimumId")) 30948 parseElementProperties(getJObject(json, "_minimumId"), res.getMinimumIdElement()); 30949 if (json.has("navigationLinks")) 30950 res.setNavigationLinksElement(parseBoolean(json.get("navigationLinks").getAsBoolean())); 30951 if (json.has("_navigationLinks")) 30952 parseElementProperties(getJObject(json, "_navigationLinks"), res.getNavigationLinksElement()); 30953 if (json.has("operator")) 30954 res.setOperatorElement(parseEnumeration(json.get("operator").getAsString(), TestScript.AssertionOperatorType.NULL, 30955 new TestScript.AssertionOperatorTypeEnumFactory())); 30956 if (json.has("_operator")) 30957 parseElementProperties(getJObject(json, "_operator"), res.getOperatorElement()); 30958 if (json.has("path")) 30959 res.setPathElement(parseString(json.get("path").getAsString())); 30960 if (json.has("_path")) 30961 parseElementProperties(getJObject(json, "_path"), res.getPathElement()); 30962 if (json.has("requestMethod")) 30963 res.setRequestMethodElement(parseEnumeration(json.get("requestMethod").getAsString(), 30964 TestScript.TestScriptRequestMethodCode.NULL, new TestScript.TestScriptRequestMethodCodeEnumFactory())); 30965 if (json.has("_requestMethod")) 30966 parseElementProperties(getJObject(json, "_requestMethod"), res.getRequestMethodElement()); 30967 if (json.has("requestURL")) 30968 res.setRequestURLElement(parseString(json.get("requestURL").getAsString())); 30969 if (json.has("_requestURL")) 30970 parseElementProperties(getJObject(json, "_requestURL"), res.getRequestURLElement()); 30971 if (json.has("resource")) 30972 res.setResourceElement(parseCode(json.get("resource").getAsString())); 30973 if (json.has("_resource")) 30974 parseElementProperties(getJObject(json, "_resource"), res.getResourceElement()); 30975 if (json.has("response")) 30976 res.setResponseElement(parseEnumeration(json.get("response").getAsString(), 30977 TestScript.AssertionResponseTypes.NULL, new TestScript.AssertionResponseTypesEnumFactory())); 30978 if (json.has("_response")) 30979 parseElementProperties(getJObject(json, "_response"), res.getResponseElement()); 30980 if (json.has("responseCode")) 30981 res.setResponseCodeElement(parseString(json.get("responseCode").getAsString())); 30982 if (json.has("_responseCode")) 30983 parseElementProperties(getJObject(json, "_responseCode"), res.getResponseCodeElement()); 30984 if (json.has("sourceId")) 30985 res.setSourceIdElement(parseId(json.get("sourceId").getAsString())); 30986 if (json.has("_sourceId")) 30987 parseElementProperties(getJObject(json, "_sourceId"), res.getSourceIdElement()); 30988 if (json.has("validateProfileId")) 30989 res.setValidateProfileIdElement(parseId(json.get("validateProfileId").getAsString())); 30990 if (json.has("_validateProfileId")) 30991 parseElementProperties(getJObject(json, "_validateProfileId"), res.getValidateProfileIdElement()); 30992 if (json.has("value")) 30993 res.setValueElement(parseString(json.get("value").getAsString())); 30994 if (json.has("_value")) 30995 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 30996 if (json.has("warningOnly")) 30997 res.setWarningOnlyElement(parseBoolean(json.get("warningOnly").getAsBoolean())); 30998 if (json.has("_warningOnly")) 30999 parseElementProperties(getJObject(json, "_warningOnly"), res.getWarningOnlyElement()); 31000 } 31001 31002 protected TestScript.TestScriptTestComponent parseTestScriptTestScriptTestComponent(JsonObject json, TestScript owner) 31003 throws IOException, FHIRFormatError { 31004 TestScript.TestScriptTestComponent res = new TestScript.TestScriptTestComponent(); 31005 parseTestScriptTestScriptTestComponentProperties(json, owner, res); 31006 return res; 31007 } 31008 31009 protected void parseTestScriptTestScriptTestComponentProperties(JsonObject json, TestScript owner, 31010 TestScript.TestScriptTestComponent res) throws IOException, FHIRFormatError { 31011 parseBackboneElementProperties(json, res); 31012 if (json.has("name")) 31013 res.setNameElement(parseString(json.get("name").getAsString())); 31014 if (json.has("_name")) 31015 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 31016 if (json.has("description")) 31017 res.setDescriptionElement(parseString(json.get("description").getAsString())); 31018 if (json.has("_description")) 31019 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 31020 if (json.has("action")) { 31021 JsonArray array = json.getAsJsonArray("action"); 31022 for (int i = 0; i < array.size(); i++) { 31023 res.getAction().add(parseTestScriptTestActionComponent(array.get(i).getAsJsonObject(), owner)); 31024 } 31025 } 31026 ; 31027 } 31028 31029 protected TestScript.TestActionComponent parseTestScriptTestActionComponent(JsonObject json, TestScript owner) 31030 throws IOException, FHIRFormatError { 31031 TestScript.TestActionComponent res = new TestScript.TestActionComponent(); 31032 parseTestScriptTestActionComponentProperties(json, owner, res); 31033 return res; 31034 } 31035 31036 protected void parseTestScriptTestActionComponentProperties(JsonObject json, TestScript owner, 31037 TestScript.TestActionComponent res) throws IOException, FHIRFormatError { 31038 parseBackboneElementProperties(json, res); 31039 if (json.has("operation")) 31040 res.setOperation(parseTestScriptSetupActionOperationComponent(getJObject(json, "operation"), owner)); 31041 if (json.has("assert")) 31042 res.setAssert(parseTestScriptSetupActionAssertComponent(getJObject(json, "assert"), owner)); 31043 } 31044 31045 protected TestScript.TestScriptTeardownComponent parseTestScriptTestScriptTeardownComponent(JsonObject json, 31046 TestScript owner) throws IOException, FHIRFormatError { 31047 TestScript.TestScriptTeardownComponent res = new TestScript.TestScriptTeardownComponent(); 31048 parseTestScriptTestScriptTeardownComponentProperties(json, owner, res); 31049 return res; 31050 } 31051 31052 protected void parseTestScriptTestScriptTeardownComponentProperties(JsonObject json, TestScript owner, 31053 TestScript.TestScriptTeardownComponent res) throws IOException, FHIRFormatError { 31054 parseBackboneElementProperties(json, res); 31055 if (json.has("action")) { 31056 JsonArray array = json.getAsJsonArray("action"); 31057 for (int i = 0; i < array.size(); i++) { 31058 res.getAction().add(parseTestScriptTeardownActionComponent(array.get(i).getAsJsonObject(), owner)); 31059 } 31060 } 31061 ; 31062 } 31063 31064 protected TestScript.TeardownActionComponent parseTestScriptTeardownActionComponent(JsonObject json, TestScript owner) 31065 throws IOException, FHIRFormatError { 31066 TestScript.TeardownActionComponent res = new TestScript.TeardownActionComponent(); 31067 parseTestScriptTeardownActionComponentProperties(json, owner, res); 31068 return res; 31069 } 31070 31071 protected void parseTestScriptTeardownActionComponentProperties(JsonObject json, TestScript owner, 31072 TestScript.TeardownActionComponent res) throws IOException, FHIRFormatError { 31073 parseBackboneElementProperties(json, res); 31074 if (json.has("operation")) 31075 res.setOperation(parseTestScriptSetupActionOperationComponent(getJObject(json, "operation"), owner)); 31076 } 31077 31078 protected ValueSet parseValueSet(JsonObject json) throws IOException, FHIRFormatError { 31079 ValueSet res = new ValueSet(); 31080 parseValueSetProperties(json, res); 31081 return res; 31082 } 31083 31084 protected void parseValueSetProperties(JsonObject json, ValueSet res) throws IOException, FHIRFormatError { 31085 parseDomainResourceProperties(json, res); 31086 if (json.has("url")) 31087 res.setUrlElement(parseUri(json.get("url").getAsString())); 31088 if (json.has("_url")) 31089 parseElementProperties(getJObject(json, "_url"), res.getUrlElement()); 31090 if (json.has("identifier")) { 31091 JsonArray array = json.getAsJsonArray("identifier"); 31092 for (int i = 0; i < array.size(); i++) { 31093 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 31094 } 31095 } 31096 ; 31097 if (json.has("version")) 31098 res.setVersionElement(parseString(json.get("version").getAsString())); 31099 if (json.has("_version")) 31100 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 31101 if (json.has("name")) 31102 res.setNameElement(parseString(json.get("name").getAsString())); 31103 if (json.has("_name")) 31104 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 31105 if (json.has("title")) 31106 res.setTitleElement(parseString(json.get("title").getAsString())); 31107 if (json.has("_title")) 31108 parseElementProperties(getJObject(json, "_title"), res.getTitleElement()); 31109 if (json.has("status")) 31110 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), Enumerations.PublicationStatus.NULL, 31111 new Enumerations.PublicationStatusEnumFactory())); 31112 if (json.has("_status")) 31113 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 31114 if (json.has("experimental")) 31115 res.setExperimentalElement(parseBoolean(json.get("experimental").getAsBoolean())); 31116 if (json.has("_experimental")) 31117 parseElementProperties(getJObject(json, "_experimental"), res.getExperimentalElement()); 31118 if (json.has("date")) 31119 res.setDateElement(parseDateTime(json.get("date").getAsString())); 31120 if (json.has("_date")) 31121 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 31122 if (json.has("publisher")) 31123 res.setPublisherElement(parseString(json.get("publisher").getAsString())); 31124 if (json.has("_publisher")) 31125 parseElementProperties(getJObject(json, "_publisher"), res.getPublisherElement()); 31126 if (json.has("contact")) { 31127 JsonArray array = json.getAsJsonArray("contact"); 31128 for (int i = 0; i < array.size(); i++) { 31129 res.getContact().add(parseContactDetail(array.get(i).getAsJsonObject())); 31130 } 31131 } 31132 ; 31133 if (json.has("description")) 31134 res.setDescriptionElement(parseMarkdown(json.get("description").getAsString())); 31135 if (json.has("_description")) 31136 parseElementProperties(getJObject(json, "_description"), res.getDescriptionElement()); 31137 if (json.has("useContext")) { 31138 JsonArray array = json.getAsJsonArray("useContext"); 31139 for (int i = 0; i < array.size(); i++) { 31140 res.getUseContext().add(parseUsageContext(array.get(i).getAsJsonObject())); 31141 } 31142 } 31143 ; 31144 if (json.has("jurisdiction")) { 31145 JsonArray array = json.getAsJsonArray("jurisdiction"); 31146 for (int i = 0; i < array.size(); i++) { 31147 res.getJurisdiction().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 31148 } 31149 } 31150 ; 31151 if (json.has("immutable")) 31152 res.setImmutableElement(parseBoolean(json.get("immutable").getAsBoolean())); 31153 if (json.has("_immutable")) 31154 parseElementProperties(getJObject(json, "_immutable"), res.getImmutableElement()); 31155 if (json.has("purpose")) 31156 res.setPurposeElement(parseMarkdown(json.get("purpose").getAsString())); 31157 if (json.has("_purpose")) 31158 parseElementProperties(getJObject(json, "_purpose"), res.getPurposeElement()); 31159 if (json.has("copyright")) 31160 res.setCopyrightElement(parseMarkdown(json.get("copyright").getAsString())); 31161 if (json.has("_copyright")) 31162 parseElementProperties(getJObject(json, "_copyright"), res.getCopyrightElement()); 31163 if (json.has("compose")) 31164 res.setCompose(parseValueSetValueSetComposeComponent(getJObject(json, "compose"), res)); 31165 if (json.has("expansion")) 31166 res.setExpansion(parseValueSetValueSetExpansionComponent(getJObject(json, "expansion"), res)); 31167 } 31168 31169 protected ValueSet.ValueSetComposeComponent parseValueSetValueSetComposeComponent(JsonObject json, ValueSet owner) 31170 throws IOException, FHIRFormatError { 31171 ValueSet.ValueSetComposeComponent res = new ValueSet.ValueSetComposeComponent(); 31172 parseValueSetValueSetComposeComponentProperties(json, owner, res); 31173 return res; 31174 } 31175 31176 protected void parseValueSetValueSetComposeComponentProperties(JsonObject json, ValueSet owner, 31177 ValueSet.ValueSetComposeComponent res) throws IOException, FHIRFormatError { 31178 parseBackboneElementProperties(json, res); 31179 if (json.has("lockedDate")) 31180 res.setLockedDateElement(parseDate(json.get("lockedDate").getAsString())); 31181 if (json.has("_lockedDate")) 31182 parseElementProperties(getJObject(json, "_lockedDate"), res.getLockedDateElement()); 31183 if (json.has("inactive")) 31184 res.setInactiveElement(parseBoolean(json.get("inactive").getAsBoolean())); 31185 if (json.has("_inactive")) 31186 parseElementProperties(getJObject(json, "_inactive"), res.getInactiveElement()); 31187 if (json.has("include")) { 31188 JsonArray array = json.getAsJsonArray("include"); 31189 for (int i = 0; i < array.size(); i++) { 31190 res.getInclude().add(parseValueSetConceptSetComponent(array.get(i).getAsJsonObject(), owner)); 31191 } 31192 } 31193 ; 31194 if (json.has("exclude")) { 31195 JsonArray array = json.getAsJsonArray("exclude"); 31196 for (int i = 0; i < array.size(); i++) { 31197 res.getExclude().add(parseValueSetConceptSetComponent(array.get(i).getAsJsonObject(), owner)); 31198 } 31199 } 31200 ; 31201 } 31202 31203 protected ValueSet.ConceptSetComponent parseValueSetConceptSetComponent(JsonObject json, ValueSet owner) 31204 throws IOException, FHIRFormatError { 31205 ValueSet.ConceptSetComponent res = new ValueSet.ConceptSetComponent(); 31206 parseValueSetConceptSetComponentProperties(json, owner, res); 31207 return res; 31208 } 31209 31210 protected void parseValueSetConceptSetComponentProperties(JsonObject json, ValueSet owner, 31211 ValueSet.ConceptSetComponent res) throws IOException, FHIRFormatError { 31212 parseBackboneElementProperties(json, res); 31213 if (json.has("system")) 31214 res.setSystemElement(parseUri(json.get("system").getAsString())); 31215 if (json.has("_system")) 31216 parseElementProperties(getJObject(json, "_system"), res.getSystemElement()); 31217 if (json.has("version")) 31218 res.setVersionElement(parseString(json.get("version").getAsString())); 31219 if (json.has("_version")) 31220 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 31221 if (json.has("concept")) { 31222 JsonArray array = json.getAsJsonArray("concept"); 31223 for (int i = 0; i < array.size(); i++) { 31224 res.getConcept().add(parseValueSetConceptReferenceComponent(array.get(i).getAsJsonObject(), owner)); 31225 } 31226 } 31227 ; 31228 if (json.has("filter")) { 31229 JsonArray array = json.getAsJsonArray("filter"); 31230 for (int i = 0; i < array.size(); i++) { 31231 res.getFilter().add(parseValueSetConceptSetFilterComponent(array.get(i).getAsJsonObject(), owner)); 31232 } 31233 } 31234 ; 31235 if (json.has("valueSet")) { 31236 JsonArray array = json.getAsJsonArray("valueSet"); 31237 for (int i = 0; i < array.size(); i++) { 31238 if (array.get(i).isJsonNull()) { 31239 res.getValueSet().add(new CanonicalType()); 31240 } else { 31241 res.getValueSet().add(parseCanonical(array.get(i).getAsString())); 31242 } 31243 } 31244 } 31245 ; 31246 if (json.has("_valueSet")) { 31247 JsonArray array = json.getAsJsonArray("_valueSet"); 31248 for (int i = 0; i < array.size(); i++) { 31249 if (i == res.getValueSet().size()) 31250 res.getValueSet().add(parseCanonical(null)); 31251 if (array.get(i) instanceof JsonObject) 31252 parseElementProperties(array.get(i).getAsJsonObject(), res.getValueSet().get(i)); 31253 } 31254 } 31255 ; 31256 } 31257 31258 protected ValueSet.ConceptReferenceComponent parseValueSetConceptReferenceComponent(JsonObject json, ValueSet owner) 31259 throws IOException, FHIRFormatError { 31260 ValueSet.ConceptReferenceComponent res = new ValueSet.ConceptReferenceComponent(); 31261 parseValueSetConceptReferenceComponentProperties(json, owner, res); 31262 return res; 31263 } 31264 31265 protected void parseValueSetConceptReferenceComponentProperties(JsonObject json, ValueSet owner, 31266 ValueSet.ConceptReferenceComponent res) throws IOException, FHIRFormatError { 31267 parseBackboneElementProperties(json, res); 31268 if (json.has("code")) 31269 res.setCodeElement(parseCode(json.get("code").getAsString())); 31270 if (json.has("_code")) 31271 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 31272 if (json.has("display")) 31273 res.setDisplayElement(parseString(json.get("display").getAsString())); 31274 if (json.has("_display")) 31275 parseElementProperties(getJObject(json, "_display"), res.getDisplayElement()); 31276 if (json.has("designation")) { 31277 JsonArray array = json.getAsJsonArray("designation"); 31278 for (int i = 0; i < array.size(); i++) { 31279 res.getDesignation() 31280 .add(parseValueSetConceptReferenceDesignationComponent(array.get(i).getAsJsonObject(), owner)); 31281 } 31282 } 31283 ; 31284 } 31285 31286 protected ValueSet.ConceptReferenceDesignationComponent parseValueSetConceptReferenceDesignationComponent( 31287 JsonObject json, ValueSet owner) throws IOException, FHIRFormatError { 31288 ValueSet.ConceptReferenceDesignationComponent res = new ValueSet.ConceptReferenceDesignationComponent(); 31289 parseValueSetConceptReferenceDesignationComponentProperties(json, owner, res); 31290 return res; 31291 } 31292 31293 protected void parseValueSetConceptReferenceDesignationComponentProperties(JsonObject json, ValueSet owner, 31294 ValueSet.ConceptReferenceDesignationComponent res) throws IOException, FHIRFormatError { 31295 parseBackboneElementProperties(json, res); 31296 if (json.has("language")) 31297 res.setLanguageElement(parseCode(json.get("language").getAsString())); 31298 if (json.has("_language")) 31299 parseElementProperties(getJObject(json, "_language"), res.getLanguageElement()); 31300 if (json.has("use")) 31301 res.setUse(parseCoding(getJObject(json, "use"))); 31302 if (json.has("value")) 31303 res.setValueElement(parseString(json.get("value").getAsString())); 31304 if (json.has("_value")) 31305 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 31306 } 31307 31308 protected ValueSet.ConceptSetFilterComponent parseValueSetConceptSetFilterComponent(JsonObject json, ValueSet owner) 31309 throws IOException, FHIRFormatError { 31310 ValueSet.ConceptSetFilterComponent res = new ValueSet.ConceptSetFilterComponent(); 31311 parseValueSetConceptSetFilterComponentProperties(json, owner, res); 31312 return res; 31313 } 31314 31315 protected void parseValueSetConceptSetFilterComponentProperties(JsonObject json, ValueSet owner, 31316 ValueSet.ConceptSetFilterComponent res) throws IOException, FHIRFormatError { 31317 parseBackboneElementProperties(json, res); 31318 if (json.has("property")) 31319 res.setPropertyElement(parseCode(json.get("property").getAsString())); 31320 if (json.has("_property")) 31321 parseElementProperties(getJObject(json, "_property"), res.getPropertyElement()); 31322 if (json.has("op")) 31323 res.setOpElement(parseEnumeration(json.get("op").getAsString(), ValueSet.FilterOperator.NULL, 31324 new ValueSet.FilterOperatorEnumFactory())); 31325 if (json.has("_op")) 31326 parseElementProperties(getJObject(json, "_op"), res.getOpElement()); 31327 if (json.has("value")) 31328 res.setValueElement(parseString(json.get("value").getAsString())); 31329 if (json.has("_value")) 31330 parseElementProperties(getJObject(json, "_value"), res.getValueElement()); 31331 } 31332 31333 protected ValueSet.ValueSetExpansionComponent parseValueSetValueSetExpansionComponent(JsonObject json, ValueSet owner) 31334 throws IOException, FHIRFormatError { 31335 ValueSet.ValueSetExpansionComponent res = new ValueSet.ValueSetExpansionComponent(); 31336 parseValueSetValueSetExpansionComponentProperties(json, owner, res); 31337 return res; 31338 } 31339 31340 protected void parseValueSetValueSetExpansionComponentProperties(JsonObject json, ValueSet owner, 31341 ValueSet.ValueSetExpansionComponent res) throws IOException, FHIRFormatError { 31342 parseBackboneElementProperties(json, res); 31343 if (json.has("identifier")) 31344 res.setIdentifierElement(parseUri(json.get("identifier").getAsString())); 31345 if (json.has("_identifier")) 31346 parseElementProperties(getJObject(json, "_identifier"), res.getIdentifierElement()); 31347 if (json.has("timestamp")) 31348 res.setTimestampElement(parseDateTime(json.get("timestamp").getAsString())); 31349 if (json.has("_timestamp")) 31350 parseElementProperties(getJObject(json, "_timestamp"), res.getTimestampElement()); 31351 if (json.has("total")) 31352 res.setTotalElement(parseInteger(json.get("total").getAsLong())); 31353 if (json.has("_total")) 31354 parseElementProperties(getJObject(json, "_total"), res.getTotalElement()); 31355 if (json.has("offset")) 31356 res.setOffsetElement(parseInteger(json.get("offset").getAsLong())); 31357 if (json.has("_offset")) 31358 parseElementProperties(getJObject(json, "_offset"), res.getOffsetElement()); 31359 if (json.has("parameter")) { 31360 JsonArray array = json.getAsJsonArray("parameter"); 31361 for (int i = 0; i < array.size(); i++) { 31362 res.getParameter().add(parseValueSetValueSetExpansionParameterComponent(array.get(i).getAsJsonObject(), owner)); 31363 } 31364 } 31365 ; 31366 if (json.has("contains")) { 31367 JsonArray array = json.getAsJsonArray("contains"); 31368 for (int i = 0; i < array.size(); i++) { 31369 res.getContains().add(parseValueSetValueSetExpansionContainsComponent(array.get(i).getAsJsonObject(), owner)); 31370 } 31371 } 31372 ; 31373 } 31374 31375 protected ValueSet.ValueSetExpansionParameterComponent parseValueSetValueSetExpansionParameterComponent( 31376 JsonObject json, ValueSet owner) throws IOException, FHIRFormatError { 31377 ValueSet.ValueSetExpansionParameterComponent res = new ValueSet.ValueSetExpansionParameterComponent(); 31378 parseValueSetValueSetExpansionParameterComponentProperties(json, owner, res); 31379 return res; 31380 } 31381 31382 protected void parseValueSetValueSetExpansionParameterComponentProperties(JsonObject json, ValueSet owner, 31383 ValueSet.ValueSetExpansionParameterComponent res) throws IOException, FHIRFormatError { 31384 parseBackboneElementProperties(json, res); 31385 if (json.has("name")) 31386 res.setNameElement(parseString(json.get("name").getAsString())); 31387 if (json.has("_name")) 31388 parseElementProperties(getJObject(json, "_name"), res.getNameElement()); 31389 Type value = parseType("value", json); 31390 if (value != null) 31391 res.setValue(value); 31392 } 31393 31394 protected ValueSet.ValueSetExpansionContainsComponent parseValueSetValueSetExpansionContainsComponent(JsonObject json, 31395 ValueSet owner) throws IOException, FHIRFormatError { 31396 ValueSet.ValueSetExpansionContainsComponent res = new ValueSet.ValueSetExpansionContainsComponent(); 31397 parseValueSetValueSetExpansionContainsComponentProperties(json, owner, res); 31398 return res; 31399 } 31400 31401 protected void parseValueSetValueSetExpansionContainsComponentProperties(JsonObject json, ValueSet owner, 31402 ValueSet.ValueSetExpansionContainsComponent res) throws IOException, FHIRFormatError { 31403 parseBackboneElementProperties(json, res); 31404 if (json.has("system")) 31405 res.setSystemElement(parseUri(json.get("system").getAsString())); 31406 if (json.has("_system")) 31407 parseElementProperties(getJObject(json, "_system"), res.getSystemElement()); 31408 if (json.has("abstract")) 31409 res.setAbstractElement(parseBoolean(json.get("abstract").getAsBoolean())); 31410 if (json.has("_abstract")) 31411 parseElementProperties(getJObject(json, "_abstract"), res.getAbstractElement()); 31412 if (json.has("inactive")) 31413 res.setInactiveElement(parseBoolean(json.get("inactive").getAsBoolean())); 31414 if (json.has("_inactive")) 31415 parseElementProperties(getJObject(json, "_inactive"), res.getInactiveElement()); 31416 if (json.has("version")) 31417 res.setVersionElement(parseString(json.get("version").getAsString())); 31418 if (json.has("_version")) 31419 parseElementProperties(getJObject(json, "_version"), res.getVersionElement()); 31420 if (json.has("code")) 31421 res.setCodeElement(parseCode(json.get("code").getAsString())); 31422 if (json.has("_code")) 31423 parseElementProperties(getJObject(json, "_code"), res.getCodeElement()); 31424 if (json.has("display")) 31425 res.setDisplayElement(parseString(json.get("display").getAsString())); 31426 if (json.has("_display")) 31427 parseElementProperties(getJObject(json, "_display"), res.getDisplayElement()); 31428 if (json.has("designation")) { 31429 JsonArray array = json.getAsJsonArray("designation"); 31430 for (int i = 0; i < array.size(); i++) { 31431 res.getDesignation() 31432 .add(parseValueSetConceptReferenceDesignationComponent(array.get(i).getAsJsonObject(), owner)); 31433 } 31434 } 31435 ; 31436 if (json.has("contains")) { 31437 JsonArray array = json.getAsJsonArray("contains"); 31438 for (int i = 0; i < array.size(); i++) { 31439 res.getContains().add(parseValueSetValueSetExpansionContainsComponent(array.get(i).getAsJsonObject(), owner)); 31440 } 31441 } 31442 ; 31443 } 31444 31445 protected VerificationResult parseVerificationResult(JsonObject json) throws IOException, FHIRFormatError { 31446 VerificationResult res = new VerificationResult(); 31447 parseVerificationResultProperties(json, res); 31448 return res; 31449 } 31450 31451 protected void parseVerificationResultProperties(JsonObject json, VerificationResult res) 31452 throws IOException, FHIRFormatError { 31453 parseDomainResourceProperties(json, res); 31454 if (json.has("target")) { 31455 JsonArray array = json.getAsJsonArray("target"); 31456 for (int i = 0; i < array.size(); i++) { 31457 res.getTarget().add(parseReference(array.get(i).getAsJsonObject())); 31458 } 31459 } 31460 ; 31461 if (json.has("targetLocation")) { 31462 JsonArray array = json.getAsJsonArray("targetLocation"); 31463 for (int i = 0; i < array.size(); i++) { 31464 if (array.get(i).isJsonNull()) { 31465 res.getTargetLocation().add(new StringType()); 31466 } else { 31467 res.getTargetLocation().add(parseString(array.get(i).getAsString())); 31468 } 31469 } 31470 } 31471 ; 31472 if (json.has("_targetLocation")) { 31473 JsonArray array = json.getAsJsonArray("_targetLocation"); 31474 for (int i = 0; i < array.size(); i++) { 31475 if (i == res.getTargetLocation().size()) 31476 res.getTargetLocation().add(parseString(null)); 31477 if (array.get(i) instanceof JsonObject) 31478 parseElementProperties(array.get(i).getAsJsonObject(), res.getTargetLocation().get(i)); 31479 } 31480 } 31481 ; 31482 if (json.has("need")) 31483 res.setNeed(parseCodeableConcept(getJObject(json, "need"))); 31484 if (json.has("status")) 31485 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), VerificationResult.Status.NULL, 31486 new VerificationResult.StatusEnumFactory())); 31487 if (json.has("_status")) 31488 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 31489 if (json.has("statusDate")) 31490 res.setStatusDateElement(parseDateTime(json.get("statusDate").getAsString())); 31491 if (json.has("_statusDate")) 31492 parseElementProperties(getJObject(json, "_statusDate"), res.getStatusDateElement()); 31493 if (json.has("validationType")) 31494 res.setValidationType(parseCodeableConcept(getJObject(json, "validationType"))); 31495 if (json.has("validationProcess")) { 31496 JsonArray array = json.getAsJsonArray("validationProcess"); 31497 for (int i = 0; i < array.size(); i++) { 31498 res.getValidationProcess().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 31499 } 31500 } 31501 ; 31502 if (json.has("frequency")) 31503 res.setFrequency(parseTiming(getJObject(json, "frequency"))); 31504 if (json.has("lastPerformed")) 31505 res.setLastPerformedElement(parseDateTime(json.get("lastPerformed").getAsString())); 31506 if (json.has("_lastPerformed")) 31507 parseElementProperties(getJObject(json, "_lastPerformed"), res.getLastPerformedElement()); 31508 if (json.has("nextScheduled")) 31509 res.setNextScheduledElement(parseDate(json.get("nextScheduled").getAsString())); 31510 if (json.has("_nextScheduled")) 31511 parseElementProperties(getJObject(json, "_nextScheduled"), res.getNextScheduledElement()); 31512 if (json.has("failureAction")) 31513 res.setFailureAction(parseCodeableConcept(getJObject(json, "failureAction"))); 31514 if (json.has("primarySource")) { 31515 JsonArray array = json.getAsJsonArray("primarySource"); 31516 for (int i = 0; i < array.size(); i++) { 31517 res.getPrimarySource() 31518 .add(parseVerificationResultVerificationResultPrimarySourceComponent(array.get(i).getAsJsonObject(), res)); 31519 } 31520 } 31521 ; 31522 if (json.has("attestation")) 31523 res.setAttestation( 31524 parseVerificationResultVerificationResultAttestationComponent(getJObject(json, "attestation"), res)); 31525 if (json.has("validator")) { 31526 JsonArray array = json.getAsJsonArray("validator"); 31527 for (int i = 0; i < array.size(); i++) { 31528 res.getValidator() 31529 .add(parseVerificationResultVerificationResultValidatorComponent(array.get(i).getAsJsonObject(), res)); 31530 } 31531 } 31532 ; 31533 } 31534 31535 protected VerificationResult.VerificationResultPrimarySourceComponent parseVerificationResultVerificationResultPrimarySourceComponent( 31536 JsonObject json, VerificationResult owner) throws IOException, FHIRFormatError { 31537 VerificationResult.VerificationResultPrimarySourceComponent res = new VerificationResult.VerificationResultPrimarySourceComponent(); 31538 parseVerificationResultVerificationResultPrimarySourceComponentProperties(json, owner, res); 31539 return res; 31540 } 31541 31542 protected void parseVerificationResultVerificationResultPrimarySourceComponentProperties(JsonObject json, 31543 VerificationResult owner, VerificationResult.VerificationResultPrimarySourceComponent res) 31544 throws IOException, FHIRFormatError { 31545 parseBackboneElementProperties(json, res); 31546 if (json.has("who")) 31547 res.setWho(parseReference(getJObject(json, "who"))); 31548 if (json.has("type")) { 31549 JsonArray array = json.getAsJsonArray("type"); 31550 for (int i = 0; i < array.size(); i++) { 31551 res.getType().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 31552 } 31553 } 31554 ; 31555 if (json.has("communicationMethod")) { 31556 JsonArray array = json.getAsJsonArray("communicationMethod"); 31557 for (int i = 0; i < array.size(); i++) { 31558 res.getCommunicationMethod().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 31559 } 31560 } 31561 ; 31562 if (json.has("validationStatus")) 31563 res.setValidationStatus(parseCodeableConcept(getJObject(json, "validationStatus"))); 31564 if (json.has("validationDate")) 31565 res.setValidationDateElement(parseDateTime(json.get("validationDate").getAsString())); 31566 if (json.has("_validationDate")) 31567 parseElementProperties(getJObject(json, "_validationDate"), res.getValidationDateElement()); 31568 if (json.has("canPushUpdates")) 31569 res.setCanPushUpdates(parseCodeableConcept(getJObject(json, "canPushUpdates"))); 31570 if (json.has("pushTypeAvailable")) { 31571 JsonArray array = json.getAsJsonArray("pushTypeAvailable"); 31572 for (int i = 0; i < array.size(); i++) { 31573 res.getPushTypeAvailable().add(parseCodeableConcept(array.get(i).getAsJsonObject())); 31574 } 31575 } 31576 ; 31577 } 31578 31579 protected VerificationResult.VerificationResultAttestationComponent parseVerificationResultVerificationResultAttestationComponent( 31580 JsonObject json, VerificationResult owner) throws IOException, FHIRFormatError { 31581 VerificationResult.VerificationResultAttestationComponent res = new VerificationResult.VerificationResultAttestationComponent(); 31582 parseVerificationResultVerificationResultAttestationComponentProperties(json, owner, res); 31583 return res; 31584 } 31585 31586 protected void parseVerificationResultVerificationResultAttestationComponentProperties(JsonObject json, 31587 VerificationResult owner, VerificationResult.VerificationResultAttestationComponent res) 31588 throws IOException, FHIRFormatError { 31589 parseBackboneElementProperties(json, res); 31590 if (json.has("who")) 31591 res.setWho(parseReference(getJObject(json, "who"))); 31592 if (json.has("onBehalfOf")) 31593 res.setOnBehalfOf(parseReference(getJObject(json, "onBehalfOf"))); 31594 if (json.has("communicationMethod")) 31595 res.setCommunicationMethod(parseCodeableConcept(getJObject(json, "communicationMethod"))); 31596 if (json.has("date")) 31597 res.setDateElement(parseDate(json.get("date").getAsString())); 31598 if (json.has("_date")) 31599 parseElementProperties(getJObject(json, "_date"), res.getDateElement()); 31600 if (json.has("sourceIdentityCertificate")) 31601 res.setSourceIdentityCertificateElement(parseString(json.get("sourceIdentityCertificate").getAsString())); 31602 if (json.has("_sourceIdentityCertificate")) 31603 parseElementProperties(getJObject(json, "_sourceIdentityCertificate"), res.getSourceIdentityCertificateElement()); 31604 if (json.has("proxyIdentityCertificate")) 31605 res.setProxyIdentityCertificateElement(parseString(json.get("proxyIdentityCertificate").getAsString())); 31606 if (json.has("_proxyIdentityCertificate")) 31607 parseElementProperties(getJObject(json, "_proxyIdentityCertificate"), res.getProxyIdentityCertificateElement()); 31608 if (json.has("proxySignature")) 31609 res.setProxySignature(parseSignature(getJObject(json, "proxySignature"))); 31610 if (json.has("sourceSignature")) 31611 res.setSourceSignature(parseSignature(getJObject(json, "sourceSignature"))); 31612 } 31613 31614 protected VerificationResult.VerificationResultValidatorComponent parseVerificationResultVerificationResultValidatorComponent( 31615 JsonObject json, VerificationResult owner) throws IOException, FHIRFormatError { 31616 VerificationResult.VerificationResultValidatorComponent res = new VerificationResult.VerificationResultValidatorComponent(); 31617 parseVerificationResultVerificationResultValidatorComponentProperties(json, owner, res); 31618 return res; 31619 } 31620 31621 protected void parseVerificationResultVerificationResultValidatorComponentProperties(JsonObject json, 31622 VerificationResult owner, VerificationResult.VerificationResultValidatorComponent res) 31623 throws IOException, FHIRFormatError { 31624 parseBackboneElementProperties(json, res); 31625 if (json.has("organization")) 31626 res.setOrganization(parseReference(getJObject(json, "organization"))); 31627 if (json.has("identityCertificate")) 31628 res.setIdentityCertificateElement(parseString(json.get("identityCertificate").getAsString())); 31629 if (json.has("_identityCertificate")) 31630 parseElementProperties(getJObject(json, "_identityCertificate"), res.getIdentityCertificateElement()); 31631 if (json.has("attestationSignature")) 31632 res.setAttestationSignature(parseSignature(getJObject(json, "attestationSignature"))); 31633 } 31634 31635 protected VisionPrescription parseVisionPrescription(JsonObject json) throws IOException, FHIRFormatError { 31636 VisionPrescription res = new VisionPrescription(); 31637 parseVisionPrescriptionProperties(json, res); 31638 return res; 31639 } 31640 31641 protected void parseVisionPrescriptionProperties(JsonObject json, VisionPrescription res) 31642 throws IOException, FHIRFormatError { 31643 parseDomainResourceProperties(json, res); 31644 if (json.has("identifier")) { 31645 JsonArray array = json.getAsJsonArray("identifier"); 31646 for (int i = 0; i < array.size(); i++) { 31647 res.getIdentifier().add(parseIdentifier(array.get(i).getAsJsonObject())); 31648 } 31649 } 31650 ; 31651 if (json.has("status")) 31652 res.setStatusElement(parseEnumeration(json.get("status").getAsString(), VisionPrescription.VisionStatus.NULL, 31653 new VisionPrescription.VisionStatusEnumFactory())); 31654 if (json.has("_status")) 31655 parseElementProperties(getJObject(json, "_status"), res.getStatusElement()); 31656 if (json.has("created")) 31657 res.setCreatedElement(parseDateTime(json.get("created").getAsString())); 31658 if (json.has("_created")) 31659 parseElementProperties(getJObject(json, "_created"), res.getCreatedElement()); 31660 if (json.has("patient")) 31661 res.setPatient(parseReference(getJObject(json, "patient"))); 31662 if (json.has("encounter")) 31663 res.setEncounter(parseReference(getJObject(json, "encounter"))); 31664 if (json.has("dateWritten")) 31665 res.setDateWrittenElement(parseDateTime(json.get("dateWritten").getAsString())); 31666 if (json.has("_dateWritten")) 31667 parseElementProperties(getJObject(json, "_dateWritten"), res.getDateWrittenElement()); 31668 if (json.has("prescriber")) 31669 res.setPrescriber(parseReference(getJObject(json, "prescriber"))); 31670 if (json.has("lensSpecification")) { 31671 JsonArray array = json.getAsJsonArray("lensSpecification"); 31672 for (int i = 0; i < array.size(); i++) { 31673 res.getLensSpecification().add( 31674 parseVisionPrescriptionVisionPrescriptionLensSpecificationComponent(array.get(i).getAsJsonObject(), res)); 31675 } 31676 } 31677 ; 31678 } 31679 31680 protected VisionPrescription.VisionPrescriptionLensSpecificationComponent parseVisionPrescriptionVisionPrescriptionLensSpecificationComponent( 31681 JsonObject json, VisionPrescription owner) throws IOException, FHIRFormatError { 31682 VisionPrescription.VisionPrescriptionLensSpecificationComponent res = new VisionPrescription.VisionPrescriptionLensSpecificationComponent(); 31683 parseVisionPrescriptionVisionPrescriptionLensSpecificationComponentProperties(json, owner, res); 31684 return res; 31685 } 31686 31687 protected void parseVisionPrescriptionVisionPrescriptionLensSpecificationComponentProperties(JsonObject json, 31688 VisionPrescription owner, VisionPrescription.VisionPrescriptionLensSpecificationComponent res) 31689 throws IOException, FHIRFormatError { 31690 parseBackboneElementProperties(json, res); 31691 if (json.has("product")) 31692 res.setProduct(parseCodeableConcept(getJObject(json, "product"))); 31693 if (json.has("eye")) 31694 res.setEyeElement(parseEnumeration(json.get("eye").getAsString(), VisionPrescription.VisionEyes.NULL, 31695 new VisionPrescription.VisionEyesEnumFactory())); 31696 if (json.has("_eye")) 31697 parseElementProperties(getJObject(json, "_eye"), res.getEyeElement()); 31698 if (json.has("sphere")) 31699 res.setSphereElement(parseDecimal(json.get("sphere").getAsBigDecimal())); 31700 if (json.has("_sphere")) 31701 parseElementProperties(getJObject(json, "_sphere"), res.getSphereElement()); 31702 if (json.has("cylinder")) 31703 res.setCylinderElement(parseDecimal(json.get("cylinder").getAsBigDecimal())); 31704 if (json.has("_cylinder")) 31705 parseElementProperties(getJObject(json, "_cylinder"), res.getCylinderElement()); 31706 if (json.has("axis")) 31707 res.setAxisElement(parseInteger(json.get("axis").getAsLong())); 31708 if (json.has("_axis")) 31709 parseElementProperties(getJObject(json, "_axis"), res.getAxisElement()); 31710 if (json.has("prism")) { 31711 JsonArray array = json.getAsJsonArray("prism"); 31712 for (int i = 0; i < array.size(); i++) { 31713 res.getPrism().add(parseVisionPrescriptionPrismComponent(array.get(i).getAsJsonObject(), owner)); 31714 } 31715 } 31716 ; 31717 if (json.has("add")) 31718 res.setAddElement(parseDecimal(json.get("add").getAsBigDecimal())); 31719 if (json.has("_add")) 31720 parseElementProperties(getJObject(json, "_add"), res.getAddElement()); 31721 if (json.has("power")) 31722 res.setPowerElement(parseDecimal(json.get("power").getAsBigDecimal())); 31723 if (json.has("_power")) 31724 parseElementProperties(getJObject(json, "_power"), res.getPowerElement()); 31725 if (json.has("backCurve")) 31726 res.setBackCurveElement(parseDecimal(json.get("backCurve").getAsBigDecimal())); 31727 if (json.has("_backCurve")) 31728 parseElementProperties(getJObject(json, "_backCurve"), res.getBackCurveElement()); 31729 if (json.has("diameter")) 31730 res.setDiameterElement(parseDecimal(json.get("diameter").getAsBigDecimal())); 31731 if (json.has("_diameter")) 31732 parseElementProperties(getJObject(json, "_diameter"), res.getDiameterElement()); 31733 if (json.has("duration")) 31734 res.setDuration(parseQuantity(getJObject(json, "duration"))); 31735 if (json.has("color")) 31736 res.setColorElement(parseString(json.get("color").getAsString())); 31737 if (json.has("_color")) 31738 parseElementProperties(getJObject(json, "_color"), res.getColorElement()); 31739 if (json.has("brand")) 31740 res.setBrandElement(parseString(json.get("brand").getAsString())); 31741 if (json.has("_brand")) 31742 parseElementProperties(getJObject(json, "_brand"), res.getBrandElement()); 31743 if (json.has("note")) { 31744 JsonArray array = json.getAsJsonArray("note"); 31745 for (int i = 0; i < array.size(); i++) { 31746 res.getNote().add(parseAnnotation(array.get(i).getAsJsonObject())); 31747 } 31748 } 31749 ; 31750 } 31751 31752 protected VisionPrescription.PrismComponent parseVisionPrescriptionPrismComponent(JsonObject json, 31753 VisionPrescription owner) throws IOException, FHIRFormatError { 31754 VisionPrescription.PrismComponent res = new VisionPrescription.PrismComponent(); 31755 parseVisionPrescriptionPrismComponentProperties(json, owner, res); 31756 return res; 31757 } 31758 31759 protected void parseVisionPrescriptionPrismComponentProperties(JsonObject json, VisionPrescription owner, 31760 VisionPrescription.PrismComponent res) throws IOException, FHIRFormatError { 31761 parseBackboneElementProperties(json, res); 31762 if (json.has("amount")) 31763 res.setAmountElement(parseDecimal(json.get("amount").getAsBigDecimal())); 31764 if (json.has("_amount")) 31765 parseElementProperties(getJObject(json, "_amount"), res.getAmountElement()); 31766 if (json.has("base")) 31767 res.setBaseElement(parseEnumeration(json.get("base").getAsString(), VisionPrescription.VisionBase.NULL, 31768 new VisionPrescription.VisionBaseEnumFactory())); 31769 if (json.has("_base")) 31770 parseElementProperties(getJObject(json, "_base"), res.getBaseElement()); 31771 } 31772 31773 @Override 31774 protected Resource parseResource(JsonObject json) throws IOException, FHIRFormatError { 31775 if (!json.has("resourceType")) { 31776 throw new FHIRFormatError("Unable to find resource type - maybe not a FHIR resource?"); 31777 } 31778 String t = json.get("resourceType").getAsString(); 31779 if (Utilities.noString(t)) 31780 throw new FHIRFormatError("Unable to find resource type - maybe not a FHIR resource?"); 31781 if (t.equals("Parameters")) 31782 return parseParameters(json); 31783 else if (t.equals("Account")) 31784 return parseAccount(json); 31785 else if (t.equals("ActivityDefinition")) 31786 return parseActivityDefinition(json); 31787 else if (t.equals("AdverseEvent")) 31788 return parseAdverseEvent(json); 31789 else if (t.equals("AllergyIntolerance")) 31790 return parseAllergyIntolerance(json); 31791 else if (t.equals("Appointment")) 31792 return parseAppointment(json); 31793 else if (t.equals("AppointmentResponse")) 31794 return parseAppointmentResponse(json); 31795 else if (t.equals("AuditEvent")) 31796 return parseAuditEvent(json); 31797 else if (t.equals("Basic")) 31798 return parseBasic(json); 31799 else if (t.equals("Binary")) 31800 return parseBinary(json); 31801 else if (t.equals("BiologicallyDerivedProduct")) 31802 return parseBiologicallyDerivedProduct(json); 31803 else if (t.equals("BodyStructure")) 31804 return parseBodyStructure(json); 31805 else if (t.equals("Bundle")) 31806 return parseBundle(json); 31807 else if (t.equals("CapabilityStatement")) 31808 return parseCapabilityStatement(json); 31809 else if (t.equals("CarePlan")) 31810 return parseCarePlan(json); 31811 else if (t.equals("CareTeam")) 31812 return parseCareTeam(json); 31813 else if (t.equals("CatalogEntry")) 31814 return parseCatalogEntry(json); 31815 else if (t.equals("ChargeItem")) 31816 return parseChargeItem(json); 31817 else if (t.equals("ChargeItemDefinition")) 31818 return parseChargeItemDefinition(json); 31819 else if (t.equals("Claim")) 31820 return parseClaim(json); 31821 else if (t.equals("ClaimResponse")) 31822 return parseClaimResponse(json); 31823 else if (t.equals("ClinicalImpression")) 31824 return parseClinicalImpression(json); 31825 else if (t.equals("CodeSystem")) 31826 return parseCodeSystem(json); 31827 else if (t.equals("Communication")) 31828 return parseCommunication(json); 31829 else if (t.equals("CommunicationRequest")) 31830 return parseCommunicationRequest(json); 31831 else if (t.equals("CompartmentDefinition")) 31832 return parseCompartmentDefinition(json); 31833 else if (t.equals("Composition")) 31834 return parseComposition(json); 31835 else if (t.equals("ConceptMap")) 31836 return parseConceptMap(json); 31837 else if (t.equals("Condition")) 31838 return parseCondition(json); 31839 else if (t.equals("Consent")) 31840 return parseConsent(json); 31841 else if (t.equals("Contract")) 31842 return parseContract(json); 31843 else if (t.equals("Coverage")) 31844 return parseCoverage(json); 31845 else if (t.equals("CoverageEligibilityRequest")) 31846 return parseCoverageEligibilityRequest(json); 31847 else if (t.equals("CoverageEligibilityResponse")) 31848 return parseCoverageEligibilityResponse(json); 31849 else if (t.equals("DetectedIssue")) 31850 return parseDetectedIssue(json); 31851 else if (t.equals("Device")) 31852 return parseDevice(json); 31853 else if (t.equals("DeviceDefinition")) 31854 return parseDeviceDefinition(json); 31855 else if (t.equals("DeviceMetric")) 31856 return parseDeviceMetric(json); 31857 else if (t.equals("DeviceRequest")) 31858 return parseDeviceRequest(json); 31859 else if (t.equals("DeviceUseStatement")) 31860 return parseDeviceUseStatement(json); 31861 else if (t.equals("DiagnosticReport")) 31862 return parseDiagnosticReport(json); 31863 else if (t.equals("DocumentManifest")) 31864 return parseDocumentManifest(json); 31865 else if (t.equals("DocumentReference")) 31866 return parseDocumentReference(json); 31867 else if (t.equals("EffectEvidenceSynthesis")) 31868 return parseEffectEvidenceSynthesis(json); 31869 else if (t.equals("Encounter")) 31870 return parseEncounter(json); 31871 else if (t.equals("Endpoint")) 31872 return parseEndpoint(json); 31873 else if (t.equals("EnrollmentRequest")) 31874 return parseEnrollmentRequest(json); 31875 else if (t.equals("EnrollmentResponse")) 31876 return parseEnrollmentResponse(json); 31877 else if (t.equals("EpisodeOfCare")) 31878 return parseEpisodeOfCare(json); 31879 else if (t.equals("EventDefinition")) 31880 return parseEventDefinition(json); 31881 else if (t.equals("Evidence")) 31882 return parseEvidence(json); 31883 else if (t.equals("EvidenceVariable")) 31884 return parseEvidenceVariable(json); 31885 else if (t.equals("ExampleScenario")) 31886 return parseExampleScenario(json); 31887 else if (t.equals("ExplanationOfBenefit")) 31888 return parseExplanationOfBenefit(json); 31889 else if (t.equals("FamilyMemberHistory")) 31890 return parseFamilyMemberHistory(json); 31891 else if (t.equals("Flag")) 31892 return parseFlag(json); 31893 else if (t.equals("Goal")) 31894 return parseGoal(json); 31895 else if (t.equals("GraphDefinition")) 31896 return parseGraphDefinition(json); 31897 else if (t.equals("Group")) 31898 return parseGroup(json); 31899 else if (t.equals("GuidanceResponse")) 31900 return parseGuidanceResponse(json); 31901 else if (t.equals("HealthcareService")) 31902 return parseHealthcareService(json); 31903 else if (t.equals("ImagingStudy")) 31904 return parseImagingStudy(json); 31905 else if (t.equals("Immunization")) 31906 return parseImmunization(json); 31907 else if (t.equals("ImmunizationEvaluation")) 31908 return parseImmunizationEvaluation(json); 31909 else if (t.equals("ImmunizationRecommendation")) 31910 return parseImmunizationRecommendation(json); 31911 else if (t.equals("ImplementationGuide")) 31912 return parseImplementationGuide(json); 31913 else if (t.equals("InsurancePlan")) 31914 return parseInsurancePlan(json); 31915 else if (t.equals("Invoice")) 31916 return parseInvoice(json); 31917 else if (t.equals("Library")) 31918 return parseLibrary(json); 31919 else if (t.equals("Linkage")) 31920 return parseLinkage(json); 31921 else if (t.equals("List")) 31922 return parseListResource(json); 31923 else if (t.equals("Location")) 31924 return parseLocation(json); 31925 else if (t.equals("Measure")) 31926 return parseMeasure(json); 31927 else if (t.equals("MeasureReport")) 31928 return parseMeasureReport(json); 31929 else if (t.equals("Media")) 31930 return parseMedia(json); 31931 else if (t.equals("Medication")) 31932 return parseMedication(json); 31933 else if (t.equals("MedicationAdministration")) 31934 return parseMedicationAdministration(json); 31935 else if (t.equals("MedicationDispense")) 31936 return parseMedicationDispense(json); 31937 else if (t.equals("MedicationKnowledge")) 31938 return parseMedicationKnowledge(json); 31939 else if (t.equals("MedicationRequest")) 31940 return parseMedicationRequest(json); 31941 else if (t.equals("MedicationStatement")) 31942 return parseMedicationStatement(json); 31943 else if (t.equals("MedicinalProduct")) 31944 return parseMedicinalProduct(json); 31945 else if (t.equals("MedicinalProductAuthorization")) 31946 return parseMedicinalProductAuthorization(json); 31947 else if (t.equals("MedicinalProductContraindication")) 31948 return parseMedicinalProductContraindication(json); 31949 else if (t.equals("MedicinalProductIndication")) 31950 return parseMedicinalProductIndication(json); 31951 else if (t.equals("MedicinalProductIngredient")) 31952 return parseMedicinalProductIngredient(json); 31953 else if (t.equals("MedicinalProductInteraction")) 31954 return parseMedicinalProductInteraction(json); 31955 else if (t.equals("MedicinalProductManufactured")) 31956 return parseMedicinalProductManufactured(json); 31957 else if (t.equals("MedicinalProductPackaged")) 31958 return parseMedicinalProductPackaged(json); 31959 else if (t.equals("MedicinalProductPharmaceutical")) 31960 return parseMedicinalProductPharmaceutical(json); 31961 else if (t.equals("MedicinalProductUndesirableEffect")) 31962 return parseMedicinalProductUndesirableEffect(json); 31963 else if (t.equals("MessageDefinition")) 31964 return parseMessageDefinition(json); 31965 else if (t.equals("MessageHeader")) 31966 return parseMessageHeader(json); 31967 else if (t.equals("MolecularSequence")) 31968 return parseMolecularSequence(json); 31969 else if (t.equals("NamingSystem")) 31970 return parseNamingSystem(json); 31971 else if (t.equals("NutritionOrder")) 31972 return parseNutritionOrder(json); 31973 else if (t.equals("Observation")) 31974 return parseObservation(json); 31975 else if (t.equals("ObservationDefinition")) 31976 return parseObservationDefinition(json); 31977 else if (t.equals("OperationDefinition")) 31978 return parseOperationDefinition(json); 31979 else if (t.equals("OperationOutcome")) 31980 return parseOperationOutcome(json); 31981 else if (t.equals("Organization")) 31982 return parseOrganization(json); 31983 else if (t.equals("OrganizationAffiliation")) 31984 return parseOrganizationAffiliation(json); 31985 else if (t.equals("Patient")) 31986 return parsePatient(json); 31987 else if (t.equals("PaymentNotice")) 31988 return parsePaymentNotice(json); 31989 else if (t.equals("PaymentReconciliation")) 31990 return parsePaymentReconciliation(json); 31991 else if (t.equals("Person")) 31992 return parsePerson(json); 31993 else if (t.equals("PlanDefinition")) 31994 return parsePlanDefinition(json); 31995 else if (t.equals("Practitioner")) 31996 return parsePractitioner(json); 31997 else if (t.equals("PractitionerRole")) 31998 return parsePractitionerRole(json); 31999 else if (t.equals("Procedure")) 32000 return parseProcedure(json); 32001 else if (t.equals("Provenance")) 32002 return parseProvenance(json); 32003 else if (t.equals("Questionnaire")) 32004 return parseQuestionnaire(json); 32005 else if (t.equals("QuestionnaireResponse")) 32006 return parseQuestionnaireResponse(json); 32007 else if (t.equals("RelatedPerson")) 32008 return parseRelatedPerson(json); 32009 else if (t.equals("RequestGroup")) 32010 return parseRequestGroup(json); 32011 else if (t.equals("ResearchDefinition")) 32012 return parseResearchDefinition(json); 32013 else if (t.equals("ResearchElementDefinition")) 32014 return parseResearchElementDefinition(json); 32015 else if (t.equals("ResearchStudy")) 32016 return parseResearchStudy(json); 32017 else if (t.equals("ResearchSubject")) 32018 return parseResearchSubject(json); 32019 else if (t.equals("RiskAssessment")) 32020 return parseRiskAssessment(json); 32021 else if (t.equals("RiskEvidenceSynthesis")) 32022 return parseRiskEvidenceSynthesis(json); 32023 else if (t.equals("Schedule")) 32024 return parseSchedule(json); 32025 else if (t.equals("SearchParameter")) 32026 return parseSearchParameter(json); 32027 else if (t.equals("ServiceRequest")) 32028 return parseServiceRequest(json); 32029 else if (t.equals("Slot")) 32030 return parseSlot(json); 32031 else if (t.equals("Specimen")) 32032 return parseSpecimen(json); 32033 else if (t.equals("SpecimenDefinition")) 32034 return parseSpecimenDefinition(json); 32035 else if (t.equals("StructureDefinition")) 32036 return parseStructureDefinition(json); 32037 else if (t.equals("StructureMap")) 32038 return parseStructureMap(json); 32039 else if (t.equals("Subscription")) 32040 return parseSubscription(json); 32041 else if (t.equals("Substance")) 32042 return parseSubstance(json); 32043 else if (t.equals("SubstanceNucleicAcid")) 32044 return parseSubstanceNucleicAcid(json); 32045 else if (t.equals("SubstancePolymer")) 32046 return parseSubstancePolymer(json); 32047 else if (t.equals("SubstanceProtein")) 32048 return parseSubstanceProtein(json); 32049 else if (t.equals("SubstanceReferenceInformation")) 32050 return parseSubstanceReferenceInformation(json); 32051 else if (t.equals("SubstanceSourceMaterial")) 32052 return parseSubstanceSourceMaterial(json); 32053 else if (t.equals("SubstanceSpecification")) 32054 return parseSubstanceSpecification(json); 32055 else if (t.equals("SupplyDelivery")) 32056 return parseSupplyDelivery(json); 32057 else if (t.equals("SupplyRequest")) 32058 return parseSupplyRequest(json); 32059 else if (t.equals("Task")) 32060 return parseTask(json); 32061 else if (t.equals("TerminologyCapabilities")) 32062 return parseTerminologyCapabilities(json); 32063 else if (t.equals("TestReport")) 32064 return parseTestReport(json); 32065 else if (t.equals("TestScript")) 32066 return parseTestScript(json); 32067 else if (t.equals("ValueSet")) 32068 return parseValueSet(json); 32069 else if (t.equals("VerificationResult")) 32070 return parseVerificationResult(json); 32071 else if (t.equals("VisionPrescription")) 32072 return parseVisionPrescription(json); 32073 else if (t.equals("Binary")) 32074 return parseBinary(json); 32075 throw new FHIRFormatError("Unknown.Unrecognised resource type '" + t + "' (in property 'resourceType')"); 32076 } 32077 32078 protected Type parseType(String prefix, JsonObject json) throws IOException, FHIRFormatError { 32079 if (json.has(prefix + "Extension")) 32080 return parseExtension(getJObject(json, prefix + "Extension")); 32081 else if (json.has(prefix + "Narrative")) 32082 return parseNarrative(getJObject(json, prefix + "Narrative")); 32083 else if (json.has(prefix + "Meta")) 32084 return parseMeta(getJObject(json, prefix + "Meta")); 32085 else if (json.has(prefix + "Address")) 32086 return parseAddress(getJObject(json, prefix + "Address")); 32087 else if (json.has(prefix + "Contributor")) 32088 return parseContributor(getJObject(json, prefix + "Contributor")); 32089 else if (json.has(prefix + "Attachment")) 32090 return parseAttachment(getJObject(json, prefix + "Attachment")); 32091 else if (json.has(prefix + "Count")) 32092 return parseCount(getJObject(json, prefix + "Count")); 32093 else if (json.has(prefix + "DataRequirement")) 32094 return parseDataRequirement(getJObject(json, prefix + "DataRequirement")); 32095 else if (json.has(prefix + "Dosage")) 32096 return parseDosage(getJObject(json, prefix + "Dosage")); 32097 else if (json.has(prefix + "Money")) 32098 return parseMoney(getJObject(json, prefix + "Money")); 32099 else if (json.has(prefix + "HumanName")) 32100 return parseHumanName(getJObject(json, prefix + "HumanName")); 32101 else if (json.has(prefix + "ContactPoint")) 32102 return parseContactPoint(getJObject(json, prefix + "ContactPoint")); 32103 else if (json.has(prefix + "MarketingStatus")) 32104 return parseMarketingStatus(getJObject(json, prefix + "MarketingStatus")); 32105 else if (json.has(prefix + "Identifier")) 32106 return parseIdentifier(getJObject(json, prefix + "Identifier")); 32107 else if (json.has(prefix + "SubstanceAmount")) 32108 return parseSubstanceAmount(getJObject(json, prefix + "SubstanceAmount")); 32109 else if (json.has(prefix + "Coding")) 32110 return parseCoding(getJObject(json, prefix + "Coding")); 32111 else if (json.has(prefix + "SampledData")) 32112 return parseSampledData(getJObject(json, prefix + "SampledData")); 32113 else if (json.has(prefix + "Population")) 32114 return parsePopulation(getJObject(json, prefix + "Population")); 32115 else if (json.has(prefix + "Ratio")) 32116 return parseRatio(getJObject(json, prefix + "Ratio")); 32117 else if (json.has(prefix + "Distance")) 32118 return parseDistance(getJObject(json, prefix + "Distance")); 32119 else if (json.has(prefix + "Age")) 32120 return parseAge(getJObject(json, prefix + "Age")); 32121 else if (json.has(prefix + "Reference")) 32122 return parseReference(getJObject(json, prefix + "Reference")); 32123 else if (json.has(prefix + "TriggerDefinition")) 32124 return parseTriggerDefinition(getJObject(json, prefix + "TriggerDefinition")); 32125 else if (json.has(prefix + "Quantity")) 32126 return parseQuantity(getJObject(json, prefix + "Quantity")); 32127 else if (json.has(prefix + "Period")) 32128 return parsePeriod(getJObject(json, prefix + "Period")); 32129 else if (json.has(prefix + "Duration")) 32130 return parseDuration(getJObject(json, prefix + "Duration")); 32131 else if (json.has(prefix + "Range")) 32132 return parseRange(getJObject(json, prefix + "Range")); 32133 else if (json.has(prefix + "RelatedArtifact")) 32134 return parseRelatedArtifact(getJObject(json, prefix + "RelatedArtifact")); 32135 else if (json.has(prefix + "Annotation")) 32136 return parseAnnotation(getJObject(json, prefix + "Annotation")); 32137 else if (json.has(prefix + "ProductShelfLife")) 32138 return parseProductShelfLife(getJObject(json, prefix + "ProductShelfLife")); 32139 else if (json.has(prefix + "ContactDetail")) 32140 return parseContactDetail(getJObject(json, prefix + "ContactDetail")); 32141 else if (json.has(prefix + "UsageContext")) 32142 return parseUsageContext(getJObject(json, prefix + "UsageContext")); 32143 else if (json.has(prefix + "Expression")) 32144 return parseExpression(getJObject(json, prefix + "Expression")); 32145 else if (json.has(prefix + "Signature")) 32146 return parseSignature(getJObject(json, prefix + "Signature")); 32147 else if (json.has(prefix + "Timing")) 32148 return parseTiming(getJObject(json, prefix + "Timing")); 32149 else if (json.has(prefix + "ProdCharacteristic")) 32150 return parseProdCharacteristic(getJObject(json, prefix + "ProdCharacteristic")); 32151 else if (json.has(prefix + "CodeableConcept")) 32152 return parseCodeableConcept(getJObject(json, prefix + "CodeableConcept")); 32153 else if (json.has(prefix + "ParameterDefinition")) 32154 return parseParameterDefinition(getJObject(json, prefix + "ParameterDefinition")); 32155 else if (json.has(prefix + "Date") || json.has("_" + prefix + "Date")) { 32156 Type t = json.has(prefix + "Date") ? parseDate(json.get(prefix + "Date").getAsString()) : new DateType(); 32157 if (json.has("_" + prefix + "Date")) 32158 parseElementProperties(getJObject(json, "_" + prefix + "Date"), t); 32159 return t; 32160 } else if (json.has(prefix + "DateTime") || json.has("_" + prefix + "DateTime")) { 32161 Type t = json.has(prefix + "DateTime") ? parseDateTime(json.get(prefix + "DateTime").getAsString()) 32162 : new DateTimeType(); 32163 if (json.has("_" + prefix + "DateTime")) 32164 parseElementProperties(getJObject(json, "_" + prefix + "DateTime"), t); 32165 return t; 32166 } else if (json.has(prefix + "Code") || json.has("_" + prefix + "Code")) { 32167 Type t = json.has(prefix + "Code") ? parseCode(json.get(prefix + "Code").getAsString()) : new CodeType(); 32168 if (json.has("_" + prefix + "Code")) 32169 parseElementProperties(getJObject(json, "_" + prefix + "Code"), t); 32170 return t; 32171 } else if (json.has(prefix + "String") || json.has("_" + prefix + "String")) { 32172 Type t = json.has(prefix + "String") ? parseString(json.get(prefix + "String").getAsString()) : new StringType(); 32173 if (json.has("_" + prefix + "String")) 32174 parseElementProperties(getJObject(json, "_" + prefix + "String"), t); 32175 return t; 32176 } else if (json.has(prefix + "Integer") || json.has("_" + prefix + "Integer")) { 32177 Type t = json.has(prefix + "Integer") ? parseInteger(json.get(prefix + "Integer").getAsLong()) 32178 : new IntegerType(); 32179 if (json.has("_" + prefix + "Integer")) 32180 parseElementProperties(getJObject(json, "_" + prefix + "Integer"), t); 32181 return t; 32182 } else if (json.has(prefix + "Oid") || json.has("_" + prefix + "Oid")) { 32183 Type t = json.has(prefix + "Oid") ? parseOid(json.get(prefix + "Oid").getAsString()) : new OidType(); 32184 if (json.has("_" + prefix + "Oid")) 32185 parseElementProperties(getJObject(json, "_" + prefix + "Oid"), t); 32186 return t; 32187 } else if (json.has(prefix + "Canonical") || json.has("_" + prefix + "Canonical")) { 32188 Type t = json.has(prefix + "Canonical") ? parseCanonical(json.get(prefix + "Canonical").getAsString()) 32189 : new CanonicalType(); 32190 if (json.has("_" + prefix + "Canonical")) 32191 parseElementProperties(getJObject(json, "_" + prefix + "Canonical"), t); 32192 return t; 32193 } else if (json.has(prefix + "Uri") || json.has("_" + prefix + "Uri")) { 32194 Type t = json.has(prefix + "Uri") ? parseUri(json.get(prefix + "Uri").getAsString()) : new UriType(); 32195 if (json.has("_" + prefix + "Uri")) 32196 parseElementProperties(getJObject(json, "_" + prefix + "Uri"), t); 32197 return t; 32198 } else if (json.has(prefix + "Uuid") || json.has("_" + prefix + "Uuid")) { 32199 Type t = json.has(prefix + "Uuid") ? parseUuid(json.get(prefix + "Uuid").getAsString()) : new UuidType(); 32200 if (json.has("_" + prefix + "Uuid")) 32201 parseElementProperties(getJObject(json, "_" + prefix + "Uuid"), t); 32202 return t; 32203 } else if (json.has(prefix + "Url") || json.has("_" + prefix + "Url")) { 32204 Type t = json.has(prefix + "Url") ? parseUrl(json.get(prefix + "Url").getAsString()) : new UrlType(); 32205 if (json.has("_" + prefix + "Url")) 32206 parseElementProperties(getJObject(json, "_" + prefix + "Url"), t); 32207 return t; 32208 } else if (json.has(prefix + "Instant") || json.has("_" + prefix + "Instant")) { 32209 Type t = json.has(prefix + "Instant") ? parseInstant(json.get(prefix + "Instant").getAsString()) 32210 : new InstantType(); 32211 if (json.has("_" + prefix + "Instant")) 32212 parseElementProperties(getJObject(json, "_" + prefix + "Instant"), t); 32213 return t; 32214 } else if (json.has(prefix + "Boolean") || json.has("_" + prefix + "Boolean")) { 32215 Type t = json.has(prefix + "Boolean") ? parseBoolean(json.get(prefix + "Boolean").getAsBoolean()) 32216 : new BooleanType(); 32217 if (json.has("_" + prefix + "Boolean")) 32218 parseElementProperties(getJObject(json, "_" + prefix + "Boolean"), t); 32219 return t; 32220 } else if (json.has(prefix + "Base64Binary") || json.has("_" + prefix + "Base64Binary")) { 32221 Type t = json.has(prefix + "Base64Binary") ? parseBase64Binary(json.get(prefix + "Base64Binary").getAsString()) 32222 : new Base64BinaryType(); 32223 if (json.has("_" + prefix + "Base64Binary")) 32224 parseElementProperties(getJObject(json, "_" + prefix + "Base64Binary"), t); 32225 return t; 32226 } else if (json.has(prefix + "UnsignedInt") || json.has("_" + prefix + "UnsignedInt")) { 32227 Type t = json.has(prefix + "UnsignedInt") ? parseUnsignedInt(json.get(prefix + "UnsignedInt").getAsString()) 32228 : new UnsignedIntType(); 32229 if (json.has("_" + prefix + "UnsignedInt")) 32230 parseElementProperties(getJObject(json, "_" + prefix + "UnsignedInt"), t); 32231 return t; 32232 } else if (json.has(prefix + "Markdown") || json.has("_" + prefix + "Markdown")) { 32233 Type t = json.has(prefix + "Markdown") ? parseMarkdown(json.get(prefix + "Markdown").getAsString()) 32234 : new MarkdownType(); 32235 if (json.has("_" + prefix + "Markdown")) 32236 parseElementProperties(getJObject(json, "_" + prefix + "Markdown"), t); 32237 return t; 32238 } else if (json.has(prefix + "Time") || json.has("_" + prefix + "Time")) { 32239 Type t = json.has(prefix + "Time") ? parseTime(json.get(prefix + "Time").getAsString()) : new TimeType(); 32240 if (json.has("_" + prefix + "Time")) 32241 parseElementProperties(getJObject(json, "_" + prefix + "Time"), t); 32242 return t; 32243 } else if (json.has(prefix + "Id") || json.has("_" + prefix + "Id")) { 32244 Type t = json.has(prefix + "Id") ? parseId(json.get(prefix + "Id").getAsString()) : new IdType(); 32245 if (json.has("_" + prefix + "Id")) 32246 parseElementProperties(getJObject(json, "_" + prefix + "Id"), t); 32247 return t; 32248 } else if (json.has(prefix + "PositiveInt") || json.has("_" + prefix + "PositiveInt")) { 32249 Type t = json.has(prefix + "PositiveInt") ? parsePositiveInt(json.get(prefix + "PositiveInt").getAsString()) 32250 : new PositiveIntType(); 32251 if (json.has("_" + prefix + "PositiveInt")) 32252 parseElementProperties(getJObject(json, "_" + prefix + "PositiveInt"), t); 32253 return t; 32254 } else if (json.has(prefix + "Decimal") || json.has("_" + prefix + "Decimal")) { 32255 Type t = json.has(prefix + "Decimal") ? parseDecimal(json.get(prefix + "Decimal").getAsBigDecimal()) 32256 : new DecimalType(); 32257 if (json.has("_" + prefix + "Decimal")) 32258 parseElementProperties(getJObject(json, "_" + prefix + "Decimal"), t); 32259 return t; 32260 } 32261 return null; 32262 } 32263 32264 protected Type parseType(JsonObject json, String type) throws IOException, FHIRFormatError { 32265 if (type.equals("Extension")) 32266 return parseExtension(json); 32267 else if (type.equals("Narrative")) 32268 return parseNarrative(json); 32269 else if (type.equals("Meta")) 32270 return parseMeta(json); 32271 else if (type.equals("Address")) 32272 return parseAddress(json); 32273 else if (type.equals("Contributor")) 32274 return parseContributor(json); 32275 else if (type.equals("Attachment")) 32276 return parseAttachment(json); 32277 else if (type.equals("Count")) 32278 return parseCount(json); 32279 else if (type.equals("DataRequirement")) 32280 return parseDataRequirement(json); 32281 else if (type.equals("Dosage")) 32282 return parseDosage(json); 32283 else if (type.equals("Money")) 32284 return parseMoney(json); 32285 else if (type.equals("HumanName")) 32286 return parseHumanName(json); 32287 else if (type.equals("ContactPoint")) 32288 return parseContactPoint(json); 32289 else if (type.equals("MarketingStatus")) 32290 return parseMarketingStatus(json); 32291 else if (type.equals("Identifier")) 32292 return parseIdentifier(json); 32293 else if (type.equals("SubstanceAmount")) 32294 return parseSubstanceAmount(json); 32295 else if (type.equals("Coding")) 32296 return parseCoding(json); 32297 else if (type.equals("SampledData")) 32298 return parseSampledData(json); 32299 else if (type.equals("Population")) 32300 return parsePopulation(json); 32301 else if (type.equals("Ratio")) 32302 return parseRatio(json); 32303 else if (type.equals("Distance")) 32304 return parseDistance(json); 32305 else if (type.equals("Age")) 32306 return parseAge(json); 32307 else if (type.equals("Reference")) 32308 return parseReference(json); 32309 else if (type.equals("TriggerDefinition")) 32310 return parseTriggerDefinition(json); 32311 else if (type.equals("Quantity")) 32312 return parseQuantity(json); 32313 else if (type.equals("Period")) 32314 return parsePeriod(json); 32315 else if (type.equals("Duration")) 32316 return parseDuration(json); 32317 else if (type.equals("Range")) 32318 return parseRange(json); 32319 else if (type.equals("RelatedArtifact")) 32320 return parseRelatedArtifact(json); 32321 else if (type.equals("Annotation")) 32322 return parseAnnotation(json); 32323 else if (type.equals("ProductShelfLife")) 32324 return parseProductShelfLife(json); 32325 else if (type.equals("ContactDetail")) 32326 return parseContactDetail(json); 32327 else if (type.equals("UsageContext")) 32328 return parseUsageContext(json); 32329 else if (type.equals("Expression")) 32330 return parseExpression(json); 32331 else if (type.equals("Signature")) 32332 return parseSignature(json); 32333 else if (type.equals("Timing")) 32334 return parseTiming(json); 32335 else if (type.equals("ProdCharacteristic")) 32336 return parseProdCharacteristic(json); 32337 else if (type.equals("CodeableConcept")) 32338 return parseCodeableConcept(json); 32339 else if (type.equals("ParameterDefinition")) 32340 return parseParameterDefinition(json); 32341 throw new FHIRFormatError("Unknown Type " + type); 32342 } 32343 32344 protected boolean hasTypeName(JsonObject json, String prefix) { 32345 if (json.has(prefix + "Extension")) 32346 return true; 32347 if (json.has(prefix + "Narrative")) 32348 return true; 32349 if (json.has(prefix + "Meta")) 32350 return true; 32351 if (json.has(prefix + "Address")) 32352 return true; 32353 if (json.has(prefix + "Contributor")) 32354 return true; 32355 if (json.has(prefix + "Attachment")) 32356 return true; 32357 if (json.has(prefix + "Count")) 32358 return true; 32359 if (json.has(prefix + "DataRequirement")) 32360 return true; 32361 if (json.has(prefix + "Dosage")) 32362 return true; 32363 if (json.has(prefix + "Money")) 32364 return true; 32365 if (json.has(prefix + "HumanName")) 32366 return true; 32367 if (json.has(prefix + "ContactPoint")) 32368 return true; 32369 if (json.has(prefix + "MarketingStatus")) 32370 return true; 32371 if (json.has(prefix + "Identifier")) 32372 return true; 32373 if (json.has(prefix + "SubstanceAmount")) 32374 return true; 32375 if (json.has(prefix + "Coding")) 32376 return true; 32377 if (json.has(prefix + "SampledData")) 32378 return true; 32379 if (json.has(prefix + "Population")) 32380 return true; 32381 if (json.has(prefix + "Ratio")) 32382 return true; 32383 if (json.has(prefix + "Distance")) 32384 return true; 32385 if (json.has(prefix + "Age")) 32386 return true; 32387 if (json.has(prefix + "Reference")) 32388 return true; 32389 if (json.has(prefix + "TriggerDefinition")) 32390 return true; 32391 if (json.has(prefix + "Quantity")) 32392 return true; 32393 if (json.has(prefix + "Period")) 32394 return true; 32395 if (json.has(prefix + "Duration")) 32396 return true; 32397 if (json.has(prefix + "Range")) 32398 return true; 32399 if (json.has(prefix + "RelatedArtifact")) 32400 return true; 32401 if (json.has(prefix + "Annotation")) 32402 return true; 32403 if (json.has(prefix + "ProductShelfLife")) 32404 return true; 32405 if (json.has(prefix + "ContactDetail")) 32406 return true; 32407 if (json.has(prefix + "UsageContext")) 32408 return true; 32409 if (json.has(prefix + "Expression")) 32410 return true; 32411 if (json.has(prefix + "Signature")) 32412 return true; 32413 if (json.has(prefix + "Timing")) 32414 return true; 32415 if (json.has(prefix + "ProdCharacteristic")) 32416 return true; 32417 if (json.has(prefix + "CodeableConcept")) 32418 return true; 32419 if (json.has(prefix + "ParameterDefinition")) 32420 return true; 32421 if (json.has(prefix + "Parameters")) 32422 return true; 32423 if (json.has(prefix + "Account")) 32424 return true; 32425 if (json.has(prefix + "ActivityDefinition")) 32426 return true; 32427 if (json.has(prefix + "AdverseEvent")) 32428 return true; 32429 if (json.has(prefix + "AllergyIntolerance")) 32430 return true; 32431 if (json.has(prefix + "Appointment")) 32432 return true; 32433 if (json.has(prefix + "AppointmentResponse")) 32434 return true; 32435 if (json.has(prefix + "AuditEvent")) 32436 return true; 32437 if (json.has(prefix + "Basic")) 32438 return true; 32439 if (json.has(prefix + "Binary")) 32440 return true; 32441 if (json.has(prefix + "BiologicallyDerivedProduct")) 32442 return true; 32443 if (json.has(prefix + "BodyStructure")) 32444 return true; 32445 if (json.has(prefix + "Bundle")) 32446 return true; 32447 if (json.has(prefix + "CapabilityStatement")) 32448 return true; 32449 if (json.has(prefix + "CarePlan")) 32450 return true; 32451 if (json.has(prefix + "CareTeam")) 32452 return true; 32453 if (json.has(prefix + "CatalogEntry")) 32454 return true; 32455 if (json.has(prefix + "ChargeItem")) 32456 return true; 32457 if (json.has(prefix + "ChargeItemDefinition")) 32458 return true; 32459 if (json.has(prefix + "Claim")) 32460 return true; 32461 if (json.has(prefix + "ClaimResponse")) 32462 return true; 32463 if (json.has(prefix + "ClinicalImpression")) 32464 return true; 32465 if (json.has(prefix + "CodeSystem")) 32466 return true; 32467 if (json.has(prefix + "Communication")) 32468 return true; 32469 if (json.has(prefix + "CommunicationRequest")) 32470 return true; 32471 if (json.has(prefix + "CompartmentDefinition")) 32472 return true; 32473 if (json.has(prefix + "Composition")) 32474 return true; 32475 if (json.has(prefix + "ConceptMap")) 32476 return true; 32477 if (json.has(prefix + "Condition")) 32478 return true; 32479 if (json.has(prefix + "Consent")) 32480 return true; 32481 if (json.has(prefix + "Contract")) 32482 return true; 32483 if (json.has(prefix + "Coverage")) 32484 return true; 32485 if (json.has(prefix + "CoverageEligibilityRequest")) 32486 return true; 32487 if (json.has(prefix + "CoverageEligibilityResponse")) 32488 return true; 32489 if (json.has(prefix + "DetectedIssue")) 32490 return true; 32491 if (json.has(prefix + "Device")) 32492 return true; 32493 if (json.has(prefix + "DeviceDefinition")) 32494 return true; 32495 if (json.has(prefix + "DeviceMetric")) 32496 return true; 32497 if (json.has(prefix + "DeviceRequest")) 32498 return true; 32499 if (json.has(prefix + "DeviceUseStatement")) 32500 return true; 32501 if (json.has(prefix + "DiagnosticReport")) 32502 return true; 32503 if (json.has(prefix + "DocumentManifest")) 32504 return true; 32505 if (json.has(prefix + "DocumentReference")) 32506 return true; 32507 if (json.has(prefix + "EffectEvidenceSynthesis")) 32508 return true; 32509 if (json.has(prefix + "Encounter")) 32510 return true; 32511 if (json.has(prefix + "Endpoint")) 32512 return true; 32513 if (json.has(prefix + "EnrollmentRequest")) 32514 return true; 32515 if (json.has(prefix + "EnrollmentResponse")) 32516 return true; 32517 if (json.has(prefix + "EpisodeOfCare")) 32518 return true; 32519 if (json.has(prefix + "EventDefinition")) 32520 return true; 32521 if (json.has(prefix + "Evidence")) 32522 return true; 32523 if (json.has(prefix + "EvidenceVariable")) 32524 return true; 32525 if (json.has(prefix + "ExampleScenario")) 32526 return true; 32527 if (json.has(prefix + "ExplanationOfBenefit")) 32528 return true; 32529 if (json.has(prefix + "FamilyMemberHistory")) 32530 return true; 32531 if (json.has(prefix + "Flag")) 32532 return true; 32533 if (json.has(prefix + "Goal")) 32534 return true; 32535 if (json.has(prefix + "GraphDefinition")) 32536 return true; 32537 if (json.has(prefix + "Group")) 32538 return true; 32539 if (json.has(prefix + "GuidanceResponse")) 32540 return true; 32541 if (json.has(prefix + "HealthcareService")) 32542 return true; 32543 if (json.has(prefix + "ImagingStudy")) 32544 return true; 32545 if (json.has(prefix + "Immunization")) 32546 return true; 32547 if (json.has(prefix + "ImmunizationEvaluation")) 32548 return true; 32549 if (json.has(prefix + "ImmunizationRecommendation")) 32550 return true; 32551 if (json.has(prefix + "ImplementationGuide")) 32552 return true; 32553 if (json.has(prefix + "InsurancePlan")) 32554 return true; 32555 if (json.has(prefix + "Invoice")) 32556 return true; 32557 if (json.has(prefix + "Library")) 32558 return true; 32559 if (json.has(prefix + "Linkage")) 32560 return true; 32561 if (json.has(prefix + "List")) 32562 return true; 32563 if (json.has(prefix + "Location")) 32564 return true; 32565 if (json.has(prefix + "Measure")) 32566 return true; 32567 if (json.has(prefix + "MeasureReport")) 32568 return true; 32569 if (json.has(prefix + "Media")) 32570 return true; 32571 if (json.has(prefix + "Medication")) 32572 return true; 32573 if (json.has(prefix + "MedicationAdministration")) 32574 return true; 32575 if (json.has(prefix + "MedicationDispense")) 32576 return true; 32577 if (json.has(prefix + "MedicationKnowledge")) 32578 return true; 32579 if (json.has(prefix + "MedicationRequest")) 32580 return true; 32581 if (json.has(prefix + "MedicationStatement")) 32582 return true; 32583 if (json.has(prefix + "MedicinalProduct")) 32584 return true; 32585 if (json.has(prefix + "MedicinalProductAuthorization")) 32586 return true; 32587 if (json.has(prefix + "MedicinalProductContraindication")) 32588 return true; 32589 if (json.has(prefix + "MedicinalProductIndication")) 32590 return true; 32591 if (json.has(prefix + "MedicinalProductIngredient")) 32592 return true; 32593 if (json.has(prefix + "MedicinalProductInteraction")) 32594 return true; 32595 if (json.has(prefix + "MedicinalProductManufactured")) 32596 return true; 32597 if (json.has(prefix + "MedicinalProductPackaged")) 32598 return true; 32599 if (json.has(prefix + "MedicinalProductPharmaceutical")) 32600 return true; 32601 if (json.has(prefix + "MedicinalProductUndesirableEffect")) 32602 return true; 32603 if (json.has(prefix + "MessageDefinition")) 32604 return true; 32605 if (json.has(prefix + "MessageHeader")) 32606 return true; 32607 if (json.has(prefix + "MolecularSequence")) 32608 return true; 32609 if (json.has(prefix + "NamingSystem")) 32610 return true; 32611 if (json.has(prefix + "NutritionOrder")) 32612 return true; 32613 if (json.has(prefix + "Observation")) 32614 return true; 32615 if (json.has(prefix + "ObservationDefinition")) 32616 return true; 32617 if (json.has(prefix + "OperationDefinition")) 32618 return true; 32619 if (json.has(prefix + "OperationOutcome")) 32620 return true; 32621 if (json.has(prefix + "Organization")) 32622 return true; 32623 if (json.has(prefix + "OrganizationAffiliation")) 32624 return true; 32625 if (json.has(prefix + "Patient")) 32626 return true; 32627 if (json.has(prefix + "PaymentNotice")) 32628 return true; 32629 if (json.has(prefix + "PaymentReconciliation")) 32630 return true; 32631 if (json.has(prefix + "Person")) 32632 return true; 32633 if (json.has(prefix + "PlanDefinition")) 32634 return true; 32635 if (json.has(prefix + "Practitioner")) 32636 return true; 32637 if (json.has(prefix + "PractitionerRole")) 32638 return true; 32639 if (json.has(prefix + "Procedure")) 32640 return true; 32641 if (json.has(prefix + "Provenance")) 32642 return true; 32643 if (json.has(prefix + "Questionnaire")) 32644 return true; 32645 if (json.has(prefix + "QuestionnaireResponse")) 32646 return true; 32647 if (json.has(prefix + "RelatedPerson")) 32648 return true; 32649 if (json.has(prefix + "RequestGroup")) 32650 return true; 32651 if (json.has(prefix + "ResearchDefinition")) 32652 return true; 32653 if (json.has(prefix + "ResearchElementDefinition")) 32654 return true; 32655 if (json.has(prefix + "ResearchStudy")) 32656 return true; 32657 if (json.has(prefix + "ResearchSubject")) 32658 return true; 32659 if (json.has(prefix + "RiskAssessment")) 32660 return true; 32661 if (json.has(prefix + "RiskEvidenceSynthesis")) 32662 return true; 32663 if (json.has(prefix + "Schedule")) 32664 return true; 32665 if (json.has(prefix + "SearchParameter")) 32666 return true; 32667 if (json.has(prefix + "ServiceRequest")) 32668 return true; 32669 if (json.has(prefix + "Slot")) 32670 return true; 32671 if (json.has(prefix + "Specimen")) 32672 return true; 32673 if (json.has(prefix + "SpecimenDefinition")) 32674 return true; 32675 if (json.has(prefix + "StructureDefinition")) 32676 return true; 32677 if (json.has(prefix + "StructureMap")) 32678 return true; 32679 if (json.has(prefix + "Subscription")) 32680 return true; 32681 if (json.has(prefix + "Substance")) 32682 return true; 32683 if (json.has(prefix + "SubstanceNucleicAcid")) 32684 return true; 32685 if (json.has(prefix + "SubstancePolymer")) 32686 return true; 32687 if (json.has(prefix + "SubstanceProtein")) 32688 return true; 32689 if (json.has(prefix + "SubstanceReferenceInformation")) 32690 return true; 32691 if (json.has(prefix + "SubstanceSourceMaterial")) 32692 return true; 32693 if (json.has(prefix + "SubstanceSpecification")) 32694 return true; 32695 if (json.has(prefix + "SupplyDelivery")) 32696 return true; 32697 if (json.has(prefix + "SupplyRequest")) 32698 return true; 32699 if (json.has(prefix + "Task")) 32700 return true; 32701 if (json.has(prefix + "TerminologyCapabilities")) 32702 return true; 32703 if (json.has(prefix + "TestReport")) 32704 return true; 32705 if (json.has(prefix + "TestScript")) 32706 return true; 32707 if (json.has(prefix + "ValueSet")) 32708 return true; 32709 if (json.has(prefix + "VerificationResult")) 32710 return true; 32711 if (json.has(prefix + "VisionPrescription")) 32712 return true; 32713 if (json.has(prefix + "Date") || json.has("_" + prefix + "Date")) 32714 return true; 32715 if (json.has(prefix + "DateTime") || json.has("_" + prefix + "DateTime")) 32716 return true; 32717 if (json.has(prefix + "Code") || json.has("_" + prefix + "Code")) 32718 return true; 32719 if (json.has(prefix + "String") || json.has("_" + prefix + "String")) 32720 return true; 32721 if (json.has(prefix + "Integer") || json.has("_" + prefix + "Integer")) 32722 return true; 32723 if (json.has(prefix + "Oid") || json.has("_" + prefix + "Oid")) 32724 return true; 32725 if (json.has(prefix + "Canonical") || json.has("_" + prefix + "Canonical")) 32726 return true; 32727 if (json.has(prefix + "Uri") || json.has("_" + prefix + "Uri")) 32728 return true; 32729 if (json.has(prefix + "Uuid") || json.has("_" + prefix + "Uuid")) 32730 return true; 32731 if (json.has(prefix + "Url") || json.has("_" + prefix + "Url")) 32732 return true; 32733 if (json.has(prefix + "Instant") || json.has("_" + prefix + "Instant")) 32734 return true; 32735 if (json.has(prefix + "Boolean") || json.has("_" + prefix + "Boolean")) 32736 return true; 32737 if (json.has(prefix + "Base64Binary") || json.has("_" + prefix + "Base64Binary")) 32738 return true; 32739 if (json.has(prefix + "UnsignedInt") || json.has("_" + prefix + "UnsignedInt")) 32740 return true; 32741 if (json.has(prefix + "Markdown") || json.has("_" + prefix + "Markdown")) 32742 return true; 32743 if (json.has(prefix + "Time") || json.has("_" + prefix + "Time")) 32744 return true; 32745 if (json.has(prefix + "Id") || json.has("_" + prefix + "Id")) 32746 return true; 32747 if (json.has(prefix + "PositiveInt") || json.has("_" + prefix + "PositiveInt")) 32748 return true; 32749 if (json.has(prefix + "Decimal") || json.has("_" + prefix + "Decimal")) 32750 return true; 32751 return false; 32752 } 32753 32754 protected Type parseAnyType(JsonObject json, String type) throws IOException, FHIRFormatError { 32755 if (type.equals("ElementDefinition")) 32756 return parseElementDefinition(json); 32757 else if (type.equals("DataRequirement")) 32758 return parseDataRequirement(json); 32759 else 32760 return parseType(json, type); 32761 } 32762 32763 protected void composeElement(Element element) throws IOException { 32764 if (element.hasId()) 32765 prop("id", element.getId()); 32766 if (makeComments(element)) { 32767 openArray("fhir_comments"); 32768 for (String s : element.getFormatCommentsPre()) 32769 prop(null, s); 32770 for (String s : element.getFormatCommentsPost()) 32771 prop(null, s); 32772 closeArray(); 32773 } 32774 if (element.hasExtension()) { 32775 openArray("extension"); 32776 for (Extension e : element.getExtension()) 32777 composeExtension(null, e); 32778 closeArray(); 32779 } 32780 } 32781 32782 protected void composeBackboneElementInner(BackboneElement element) throws IOException { 32783 composeBackbone(element); 32784 } 32785 32786 protected void composeBackbone(BackboneElement element) throws IOException { 32787 composeElement(element); 32788 if (element.hasModifierExtension()) { 32789 openArray("modifierExtension"); 32790 for (Extension e : element.getModifierExtension()) 32791 composeExtension(null, e); 32792 closeArray(); 32793 } 32794 } 32795 32796 protected void composeBackbone(BackboneType element) throws IOException { 32797 composeElement(element); 32798 if (element.hasModifierExtension()) { 32799 openArray("modifierExtension"); 32800 for (Extension e : element.getModifierExtension()) 32801 composeExtension(null, e); 32802 closeArray(); 32803 } 32804 } 32805 32806 protected <E extends Enum<E>> void composeEnumerationCore(String name, Enumeration<E> value, EnumFactory e, 32807 boolean inArray) throws IOException { 32808 if (value != null && value.getValue() != null) { 32809 prop(name, e.toCode(value.getValue())); 32810 } else if (inArray) 32811 writeNull(name); 32812 } 32813 32814 protected <E extends Enum<E>> void composeEnumerationExtras(String name, Enumeration<E> value, EnumFactory e, 32815 boolean inArray) throws IOException { 32816 if (value != null 32817 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 32818 open(inArray ? null : "_" + name); 32819 composeElement(value); 32820 close(); 32821 } else if (inArray) 32822 writeNull(name); 32823 } 32824 32825 protected void composeDateCore(String name, DateType value, boolean inArray) throws IOException { 32826 if (value != null && value.hasValue()) { 32827 prop(name, value.asStringValue()); 32828 } else if (inArray) 32829 writeNull(name); 32830 } 32831 32832 protected void composeDateExtras(String name, DateType value, boolean inArray) throws IOException { 32833 if (value != null 32834 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 32835 open(inArray ? null : "_" + name); 32836 composeElement(value); 32837 close(); 32838 } else if (inArray) 32839 writeNull(name); 32840 } 32841 32842 protected void composeDateTimeCore(String name, DateTimeType value, boolean inArray) throws IOException { 32843 if (value != null && value.hasValue()) { 32844 prop(name, value.asStringValue()); 32845 } else if (inArray) 32846 writeNull(name); 32847 } 32848 32849 protected void composeDateTimeExtras(String name, DateTimeType value, boolean inArray) throws IOException { 32850 if (value != null 32851 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 32852 open(inArray ? null : "_" + name); 32853 composeElement(value); 32854 close(); 32855 } else if (inArray) 32856 writeNull(name); 32857 } 32858 32859 protected void composeCodeCore(String name, CodeType value, boolean inArray) throws IOException { 32860 if (value != null && value.hasValue()) { 32861 prop(name, toString(value.getValue())); 32862 } else if (inArray) 32863 writeNull(name); 32864 } 32865 32866 protected void composeCodeExtras(String name, CodeType value, boolean inArray) throws IOException { 32867 if (value != null 32868 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 32869 open(inArray ? null : "_" + name); 32870 composeElement(value); 32871 close(); 32872 } else if (inArray) 32873 writeNull(name); 32874 } 32875 32876 protected void composeStringCore(String name, StringType value, boolean inArray) throws IOException { 32877 if (value != null && value.hasValue()) { 32878 prop(name, toString(value.getValue())); 32879 } else if (inArray) 32880 writeNull(name); 32881 } 32882 32883 protected void composeStringExtras(String name, StringType value, boolean inArray) throws IOException { 32884 if (value != null 32885 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 32886 open(inArray ? null : "_" + name); 32887 composeElement(value); 32888 close(); 32889 } else if (inArray) 32890 writeNull(name); 32891 } 32892 32893 protected void composeIntegerCore(String name, IntegerType value, boolean inArray) throws IOException { 32894 if (value != null && value.hasValue()) { 32895 prop(name, Integer.valueOf(value.getValue())); 32896 } else if (inArray) 32897 writeNull(name); 32898 } 32899 32900 protected void composeIntegerExtras(String name, IntegerType value, boolean inArray) throws IOException { 32901 if (value != null 32902 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 32903 open(inArray ? null : "_" + name); 32904 composeElement(value); 32905 close(); 32906 } else if (inArray) 32907 writeNull(name); 32908 } 32909 32910 protected void composeOidCore(String name, OidType value, boolean inArray) throws IOException { 32911 if (value != null && value.hasValue()) { 32912 prop(name, toString(value.getValue())); 32913 } else if (inArray) 32914 writeNull(name); 32915 } 32916 32917 protected void composeOidExtras(String name, OidType value, boolean inArray) throws IOException { 32918 if (value != null 32919 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 32920 open(inArray ? null : "_" + name); 32921 composeElement(value); 32922 close(); 32923 } else if (inArray) 32924 writeNull(name); 32925 } 32926 32927 protected void composeCanonicalCore(String name, CanonicalType value, boolean inArray) throws IOException { 32928 if (value != null && value.hasValue()) { 32929 prop(name, toString(value.getValue())); 32930 } else if (inArray) 32931 writeNull(name); 32932 } 32933 32934 protected void composeCanonicalExtras(String name, CanonicalType value, boolean inArray) throws IOException { 32935 if (value != null 32936 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 32937 open(inArray ? null : "_" + name); 32938 composeElement(value); 32939 close(); 32940 } else if (inArray) 32941 writeNull(name); 32942 } 32943 32944 protected void composeUriCore(String name, UriType value, boolean inArray) throws IOException { 32945 if (value != null && value.hasValue()) { 32946 prop(name, toString(value.getValue())); 32947 } else if (inArray) 32948 writeNull(name); 32949 } 32950 32951 protected void composeUriExtras(String name, UriType value, boolean inArray) throws IOException { 32952 if (value != null 32953 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 32954 open(inArray ? null : "_" + name); 32955 composeElement(value); 32956 close(); 32957 } else if (inArray) 32958 writeNull(name); 32959 } 32960 32961 protected void composeUuidCore(String name, UuidType value, boolean inArray) throws IOException { 32962 if (value != null && value.hasValue()) { 32963 prop(name, toString(value.getValue())); 32964 } else if (inArray) 32965 writeNull(name); 32966 } 32967 32968 protected void composeUuidExtras(String name, UuidType value, boolean inArray) throws IOException { 32969 if (value != null 32970 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 32971 open(inArray ? null : "_" + name); 32972 composeElement(value); 32973 close(); 32974 } else if (inArray) 32975 writeNull(name); 32976 } 32977 32978 protected void composeUrlCore(String name, UrlType value, boolean inArray) throws IOException { 32979 if (value != null && value.hasValue()) { 32980 prop(name, toString(value.getValue())); 32981 } else if (inArray) 32982 writeNull(name); 32983 } 32984 32985 protected void composeUrlExtras(String name, UrlType value, boolean inArray) throws IOException { 32986 if (value != null 32987 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 32988 open(inArray ? null : "_" + name); 32989 composeElement(value); 32990 close(); 32991 } else if (inArray) 32992 writeNull(name); 32993 } 32994 32995 protected void composeInstantCore(String name, InstantType value, boolean inArray) throws IOException { 32996 if (value != null && value.hasValue()) { 32997 prop(name, value.asStringValue()); 32998 } else if (inArray) 32999 writeNull(name); 33000 } 33001 33002 protected void composeInstantExtras(String name, InstantType value, boolean inArray) throws IOException { 33003 if (value != null 33004 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 33005 open(inArray ? null : "_" + name); 33006 composeElement(value); 33007 close(); 33008 } else if (inArray) 33009 writeNull(name); 33010 } 33011 33012 protected void composeBooleanCore(String name, BooleanType value, boolean inArray) throws IOException { 33013 if (value != null && value.hasValue()) { 33014 prop(name, value.getValue()); 33015 } else if (inArray) 33016 writeNull(name); 33017 } 33018 33019 protected void composeBooleanExtras(String name, BooleanType value, boolean inArray) throws IOException { 33020 if (value != null 33021 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 33022 open(inArray ? null : "_" + name); 33023 composeElement(value); 33024 close(); 33025 } else if (inArray) 33026 writeNull(name); 33027 } 33028 33029 protected void composeBase64BinaryCore(String name, Base64BinaryType value, boolean inArray) throws IOException { 33030 if (value != null && value.hasValue()) { 33031 prop(name, toString(value.getValue())); 33032 } else if (inArray) 33033 writeNull(name); 33034 } 33035 33036 protected void composeBase64BinaryExtras(String name, Base64BinaryType value, boolean inArray) throws IOException { 33037 if (value != null 33038 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 33039 open(inArray ? null : "_" + name); 33040 composeElement(value); 33041 close(); 33042 } else if (inArray) 33043 writeNull(name); 33044 } 33045 33046 protected void composeUnsignedIntCore(String name, UnsignedIntType value, boolean inArray) throws IOException { 33047 if (value != null && value.hasValue()) { 33048 prop(name, Integer.valueOf(value.getValue())); 33049 } else if (inArray) 33050 writeNull(name); 33051 } 33052 33053 protected void composeUnsignedIntExtras(String name, UnsignedIntType value, boolean inArray) throws IOException { 33054 if (value != null 33055 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 33056 open(inArray ? null : "_" + name); 33057 composeElement(value); 33058 close(); 33059 } else if (inArray) 33060 writeNull(name); 33061 } 33062 33063 protected void composeMarkdownCore(String name, MarkdownType value, boolean inArray) throws IOException { 33064 if (value != null && value.hasValue()) { 33065 prop(name, toString(value.getValue())); 33066 } else if (inArray) 33067 writeNull(name); 33068 } 33069 33070 protected void composeMarkdownExtras(String name, MarkdownType value, boolean inArray) throws IOException { 33071 if (value != null 33072 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 33073 open(inArray ? null : "_" + name); 33074 composeElement(value); 33075 close(); 33076 } else if (inArray) 33077 writeNull(name); 33078 } 33079 33080 protected void composeTimeCore(String name, TimeType value, boolean inArray) throws IOException { 33081 if (value != null && value.hasValue()) { 33082 prop(name, value.asStringValue()); 33083 } else if (inArray) 33084 writeNull(name); 33085 } 33086 33087 protected void composeTimeExtras(String name, TimeType value, boolean inArray) throws IOException { 33088 if (value != null 33089 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 33090 open(inArray ? null : "_" + name); 33091 composeElement(value); 33092 close(); 33093 } else if (inArray) 33094 writeNull(name); 33095 } 33096 33097 protected void composeIdCore(String name, IdType value, boolean inArray) throws IOException { 33098 if (value != null && value.hasValue()) { 33099 prop(name, toString(value.getValue())); 33100 } else if (inArray) 33101 writeNull(name); 33102 } 33103 33104 protected void composeIdExtras(String name, IdType value, boolean inArray) throws IOException { 33105 if (value != null 33106 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 33107 open(inArray ? null : "_" + name); 33108 composeElement(value); 33109 close(); 33110 } else if (inArray) 33111 writeNull(name); 33112 } 33113 33114 protected void composePositiveIntCore(String name, PositiveIntType value, boolean inArray) throws IOException { 33115 if (value != null && value.hasValue()) { 33116 prop(name, Integer.valueOf(value.getValue())); 33117 } else if (inArray) 33118 writeNull(name); 33119 } 33120 33121 protected void composePositiveIntExtras(String name, PositiveIntType value, boolean inArray) throws IOException { 33122 if (value != null 33123 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 33124 open(inArray ? null : "_" + name); 33125 composeElement(value); 33126 close(); 33127 } else if (inArray) 33128 writeNull(name); 33129 } 33130 33131 protected void composeDecimalCore(String name, DecimalType value, boolean inArray) throws IOException { 33132 if (value != null && value.hasValue()) { 33133 prop(name, value.getValue()); 33134 } else if (inArray) 33135 writeNull(name); 33136 } 33137 33138 protected void composeDecimalExtras(String name, DecimalType value, boolean inArray) throws IOException { 33139 if (value != null 33140 && (!Utilities.noString(value.getId()) || ExtensionHelper.hasExtensions(value) || makeComments(value))) { 33141 open(inArray ? null : "_" + name); 33142 composeElement(value); 33143 close(); 33144 } else if (inArray) 33145 writeNull(name); 33146 } 33147 33148 protected void composeExtension(String name, Extension element) throws IOException { 33149 if (element != null) { 33150 open(name); 33151 composeExtensionInner(element); 33152 close(); 33153 } 33154 } 33155 33156 protected void composeExtensionInner(Extension element) throws IOException { 33157 composeElement(element); 33158 if (element.hasUrlElement()) { 33159 composeUriCore("url", element.getUrlElement(), false); 33160 composeUriExtras("url", element.getUrlElement(), false); 33161 } 33162 if (element.hasValue()) { 33163 composeType("value", element.getValue()); 33164 } 33165 } 33166 33167 protected void composeNarrative(String name, Narrative element) throws IOException { 33168 if (element != null) { 33169 open(name); 33170 composeNarrativeInner(element); 33171 close(); 33172 } 33173 } 33174 33175 protected void composeNarrativeInner(Narrative element) throws IOException { 33176 composeElement(element); 33177 if (element.hasStatusElement()) { 33178 composeEnumerationCore("status", element.getStatusElement(), new Narrative.NarrativeStatusEnumFactory(), false); 33179 composeEnumerationExtras("status", element.getStatusElement(), new Narrative.NarrativeStatusEnumFactory(), false); 33180 } 33181 if (element.hasDiv()) { 33182 XhtmlNode node = element.getDiv(); 33183 if (node.getNsDecl() == null) { 33184 node.attribute("xmlns", XHTML_NS); 33185 } 33186 composeXhtml("div", node); 33187 } 33188 } 33189 33190 protected void composeCount(String name, Count element) throws IOException { 33191 if (element != null) { 33192 open(name); 33193 composeCountInner(element); 33194 close(); 33195 } 33196 } 33197 33198 protected void composeCountInner(Count element) throws IOException { 33199 composeQuantityInner(element); 33200 } 33201 33202 protected void composeDosage(String name, Dosage element) throws IOException { 33203 if (element != null) { 33204 open(name); 33205 composeDosageInner(element); 33206 close(); 33207 } 33208 } 33209 33210 protected void composeDosageInner(Dosage element) throws IOException { 33211 composeBackbone(element); 33212 if (element.hasSequenceElement()) { 33213 composeIntegerCore("sequence", element.getSequenceElement(), false); 33214 composeIntegerExtras("sequence", element.getSequenceElement(), false); 33215 } 33216 if (element.hasTextElement()) { 33217 composeStringCore("text", element.getTextElement(), false); 33218 composeStringExtras("text", element.getTextElement(), false); 33219 } 33220 if (element.hasAdditionalInstruction()) { 33221 openArray("additionalInstruction"); 33222 for (CodeableConcept e : element.getAdditionalInstruction()) 33223 composeCodeableConcept(null, e); 33224 closeArray(); 33225 } 33226 ; 33227 if (element.hasPatientInstructionElement()) { 33228 composeStringCore("patientInstruction", element.getPatientInstructionElement(), false); 33229 composeStringExtras("patientInstruction", element.getPatientInstructionElement(), false); 33230 } 33231 if (element.hasTiming()) { 33232 composeTiming("timing", element.getTiming()); 33233 } 33234 if (element.hasAsNeeded()) { 33235 composeType("asNeeded", element.getAsNeeded()); 33236 } 33237 if (element.hasSite()) { 33238 composeCodeableConcept("site", element.getSite()); 33239 } 33240 if (element.hasRoute()) { 33241 composeCodeableConcept("route", element.getRoute()); 33242 } 33243 if (element.hasMethod()) { 33244 composeCodeableConcept("method", element.getMethod()); 33245 } 33246 if (element.hasDoseAndRate()) { 33247 openArray("doseAndRate"); 33248 for (Dosage.DosageDoseAndRateComponent e : element.getDoseAndRate()) 33249 composeDosageDosageDoseAndRateComponent(null, e); 33250 closeArray(); 33251 } 33252 ; 33253 if (element.hasMaxDosePerPeriod()) { 33254 composeRatio("maxDosePerPeriod", element.getMaxDosePerPeriod()); 33255 } 33256 if (element.hasMaxDosePerAdministration()) { 33257 composeQuantity("maxDosePerAdministration", element.getMaxDosePerAdministration()); 33258 } 33259 if (element.hasMaxDosePerLifetime()) { 33260 composeQuantity("maxDosePerLifetime", element.getMaxDosePerLifetime()); 33261 } 33262 } 33263 33264 protected void composeDosageDosageDoseAndRateComponent(String name, Dosage.DosageDoseAndRateComponent element) 33265 throws IOException { 33266 if (element != null) { 33267 open(name); 33268 composeDosageDosageDoseAndRateComponentInner(element); 33269 close(); 33270 } 33271 } 33272 33273 protected void composeDosageDosageDoseAndRateComponentInner(Dosage.DosageDoseAndRateComponent element) 33274 throws IOException { 33275 composeElement(element); 33276 if (element.hasType()) { 33277 composeCodeableConcept("type", element.getType()); 33278 } 33279 if (element.hasDose()) { 33280 composeType("dose", element.getDose()); 33281 } 33282 if (element.hasRate()) { 33283 composeType("rate", element.getRate()); 33284 } 33285 } 33286 33287 protected void composeMarketingStatus(String name, MarketingStatus element) throws IOException { 33288 if (element != null) { 33289 open(name); 33290 composeMarketingStatusInner(element); 33291 close(); 33292 } 33293 } 33294 33295 protected void composeMarketingStatusInner(MarketingStatus element) throws IOException { 33296 composeBackbone(element); 33297 if (element.hasCountry()) { 33298 composeCodeableConcept("country", element.getCountry()); 33299 } 33300 if (element.hasJurisdiction()) { 33301 composeCodeableConcept("jurisdiction", element.getJurisdiction()); 33302 } 33303 if (element.hasStatus()) { 33304 composeCodeableConcept("status", element.getStatus()); 33305 } 33306 if (element.hasDateRange()) { 33307 composePeriod("dateRange", element.getDateRange()); 33308 } 33309 if (element.hasRestoreDateElement()) { 33310 composeDateTimeCore("restoreDate", element.getRestoreDateElement(), false); 33311 composeDateTimeExtras("restoreDate", element.getRestoreDateElement(), false); 33312 } 33313 } 33314 33315 protected void composeSubstanceAmount(String name, SubstanceAmount element) throws IOException { 33316 if (element != null) { 33317 open(name); 33318 composeSubstanceAmountInner(element); 33319 close(); 33320 } 33321 } 33322 33323 protected void composeSubstanceAmountInner(SubstanceAmount element) throws IOException { 33324 composeBackbone(element); 33325 if (element.hasAmount()) { 33326 composeType("amount", element.getAmount()); 33327 } 33328 if (element.hasAmountType()) { 33329 composeCodeableConcept("amountType", element.getAmountType()); 33330 } 33331 if (element.hasAmountTextElement()) { 33332 composeStringCore("amountText", element.getAmountTextElement(), false); 33333 composeStringExtras("amountText", element.getAmountTextElement(), false); 33334 } 33335 if (element.hasReferenceRange()) { 33336 composeSubstanceAmountSubstanceAmountReferenceRangeComponent("referenceRange", element.getReferenceRange()); 33337 } 33338 } 33339 33340 protected void composeSubstanceAmountSubstanceAmountReferenceRangeComponent(String name, 33341 SubstanceAmount.SubstanceAmountReferenceRangeComponent element) throws IOException { 33342 if (element != null) { 33343 open(name); 33344 composeSubstanceAmountSubstanceAmountReferenceRangeComponentInner(element); 33345 close(); 33346 } 33347 } 33348 33349 protected void composeSubstanceAmountSubstanceAmountReferenceRangeComponentInner( 33350 SubstanceAmount.SubstanceAmountReferenceRangeComponent element) throws IOException { 33351 composeElement(element); 33352 if (element.hasLowLimit()) { 33353 composeQuantity("lowLimit", element.getLowLimit()); 33354 } 33355 if (element.hasHighLimit()) { 33356 composeQuantity("highLimit", element.getHighLimit()); 33357 } 33358 } 33359 33360 protected void composePopulation(String name, Population element) throws IOException { 33361 if (element != null) { 33362 open(name); 33363 composePopulationInner(element); 33364 close(); 33365 } 33366 } 33367 33368 protected void composePopulationInner(Population element) throws IOException { 33369 composeBackbone(element); 33370 if (element.hasAge()) { 33371 composeType("age", element.getAge()); 33372 } 33373 if (element.hasGender()) { 33374 composeCodeableConcept("gender", element.getGender()); 33375 } 33376 if (element.hasRace()) { 33377 composeCodeableConcept("race", element.getRace()); 33378 } 33379 if (element.hasPhysiologicalCondition()) { 33380 composeCodeableConcept("physiologicalCondition", element.getPhysiologicalCondition()); 33381 } 33382 } 33383 33384 protected void composeDistance(String name, Distance element) throws IOException { 33385 if (element != null) { 33386 open(name); 33387 composeDistanceInner(element); 33388 close(); 33389 } 33390 } 33391 33392 protected void composeDistanceInner(Distance element) throws IOException { 33393 composeQuantityInner(element); 33394 } 33395 33396 protected void composeAge(String name, Age element) throws IOException { 33397 if (element != null) { 33398 open(name); 33399 composeAgeInner(element); 33400 close(); 33401 } 33402 } 33403 33404 protected void composeAgeInner(Age element) throws IOException { 33405 composeQuantityInner(element); 33406 } 33407 33408 protected void composeDuration(String name, Duration element) throws IOException { 33409 if (element != null) { 33410 open(name); 33411 composeDurationInner(element); 33412 close(); 33413 } 33414 } 33415 33416 protected void composeDurationInner(Duration element) throws IOException { 33417 composeQuantityInner(element); 33418 } 33419 33420 protected void composeProductShelfLife(String name, ProductShelfLife element) throws IOException { 33421 if (element != null) { 33422 open(name); 33423 composeProductShelfLifeInner(element); 33424 close(); 33425 } 33426 } 33427 33428 protected void composeProductShelfLifeInner(ProductShelfLife element) throws IOException { 33429 composeBackbone(element); 33430 if (element.hasIdentifier()) { 33431 composeIdentifier("identifier", element.getIdentifier()); 33432 } 33433 if (element.hasType()) { 33434 composeCodeableConcept("type", element.getType()); 33435 } 33436 if (element.hasPeriod()) { 33437 composeQuantity("period", element.getPeriod()); 33438 } 33439 if (element.hasSpecialPrecautionsForStorage()) { 33440 openArray("specialPrecautionsForStorage"); 33441 for (CodeableConcept e : element.getSpecialPrecautionsForStorage()) 33442 composeCodeableConcept(null, e); 33443 closeArray(); 33444 } 33445 ; 33446 } 33447 33448 protected void composeTiming(String name, Timing element) throws IOException { 33449 if (element != null) { 33450 open(name); 33451 composeTimingInner(element); 33452 close(); 33453 } 33454 } 33455 33456 protected void composeTimingInner(Timing element) throws IOException { 33457 composeBackbone(element); 33458 if (element.hasEvent()) { 33459 openArray("event"); 33460 for (DateTimeType e : element.getEvent()) 33461 composeDateTimeCore(null, e, true); 33462 closeArray(); 33463 if (anyHasExtras(element.getEvent())) { 33464 openArray("_event"); 33465 for (DateTimeType e : element.getEvent()) 33466 composeDateTimeExtras(null, e, true); 33467 closeArray(); 33468 } 33469 } 33470 ; 33471 if (element.hasRepeat()) { 33472 composeTimingTimingRepeatComponent("repeat", element.getRepeat()); 33473 } 33474 if (element.hasCode()) { 33475 composeCodeableConcept("code", element.getCode()); 33476 } 33477 } 33478 33479 protected void composeTimingTimingRepeatComponent(String name, Timing.TimingRepeatComponent element) 33480 throws IOException { 33481 if (element != null) { 33482 open(name); 33483 composeTimingTimingRepeatComponentInner(element); 33484 close(); 33485 } 33486 } 33487 33488 protected void composeTimingTimingRepeatComponentInner(Timing.TimingRepeatComponent element) throws IOException { 33489 composeElement(element); 33490 if (element.hasBounds()) { 33491 composeType("bounds", element.getBounds()); 33492 } 33493 if (element.hasCountElement()) { 33494 composePositiveIntCore("count", element.getCountElement(), false); 33495 composePositiveIntExtras("count", element.getCountElement(), false); 33496 } 33497 if (element.hasCountMaxElement()) { 33498 composePositiveIntCore("countMax", element.getCountMaxElement(), false); 33499 composePositiveIntExtras("countMax", element.getCountMaxElement(), false); 33500 } 33501 if (element.hasDurationElement()) { 33502 composeDecimalCore("duration", element.getDurationElement(), false); 33503 composeDecimalExtras("duration", element.getDurationElement(), false); 33504 } 33505 if (element.hasDurationMaxElement()) { 33506 composeDecimalCore("durationMax", element.getDurationMaxElement(), false); 33507 composeDecimalExtras("durationMax", element.getDurationMaxElement(), false); 33508 } 33509 if (element.hasDurationUnitElement()) { 33510 composeEnumerationCore("durationUnit", element.getDurationUnitElement(), new Timing.UnitsOfTimeEnumFactory(), 33511 false); 33512 composeEnumerationExtras("durationUnit", element.getDurationUnitElement(), new Timing.UnitsOfTimeEnumFactory(), 33513 false); 33514 } 33515 if (element.hasFrequencyElement()) { 33516 composePositiveIntCore("frequency", element.getFrequencyElement(), false); 33517 composePositiveIntExtras("frequency", element.getFrequencyElement(), false); 33518 } 33519 if (element.hasFrequencyMaxElement()) { 33520 composePositiveIntCore("frequencyMax", element.getFrequencyMaxElement(), false); 33521 composePositiveIntExtras("frequencyMax", element.getFrequencyMaxElement(), false); 33522 } 33523 if (element.hasPeriodElement()) { 33524 composeDecimalCore("period", element.getPeriodElement(), false); 33525 composeDecimalExtras("period", element.getPeriodElement(), false); 33526 } 33527 if (element.hasPeriodMaxElement()) { 33528 composeDecimalCore("periodMax", element.getPeriodMaxElement(), false); 33529 composeDecimalExtras("periodMax", element.getPeriodMaxElement(), false); 33530 } 33531 if (element.hasPeriodUnitElement()) { 33532 composeEnumerationCore("periodUnit", element.getPeriodUnitElement(), new Timing.UnitsOfTimeEnumFactory(), false); 33533 composeEnumerationExtras("periodUnit", element.getPeriodUnitElement(), new Timing.UnitsOfTimeEnumFactory(), 33534 false); 33535 } 33536 if (element.hasDayOfWeek()) { 33537 openArray("dayOfWeek"); 33538 for (Enumeration<Timing.DayOfWeek> e : element.getDayOfWeek()) 33539 composeEnumerationCore(null, e, new Timing.DayOfWeekEnumFactory(), true); 33540 closeArray(); 33541 if (anyHasExtras(element.getDayOfWeek())) { 33542 openArray("_dayOfWeek"); 33543 for (Enumeration<Timing.DayOfWeek> e : element.getDayOfWeek()) 33544 composeEnumerationExtras(null, e, new Timing.DayOfWeekEnumFactory(), true); 33545 closeArray(); 33546 } 33547 } 33548 ; 33549 if (element.hasTimeOfDay()) { 33550 openArray("timeOfDay"); 33551 for (TimeType e : element.getTimeOfDay()) 33552 composeTimeCore(null, e, true); 33553 closeArray(); 33554 if (anyHasExtras(element.getTimeOfDay())) { 33555 openArray("_timeOfDay"); 33556 for (TimeType e : element.getTimeOfDay()) 33557 composeTimeExtras(null, e, true); 33558 closeArray(); 33559 } 33560 } 33561 ; 33562 if (element.hasWhen()) { 33563 openArray("when"); 33564 for (Enumeration<Timing.EventTiming> e : element.getWhen()) 33565 composeEnumerationCore(null, e, new Timing.EventTimingEnumFactory(), true); 33566 closeArray(); 33567 if (anyHasExtras(element.getWhen())) { 33568 openArray("_when"); 33569 for (Enumeration<Timing.EventTiming> e : element.getWhen()) 33570 composeEnumerationExtras(null, e, new Timing.EventTimingEnumFactory(), true); 33571 closeArray(); 33572 } 33573 } 33574 ; 33575 if (element.hasOffsetElement()) { 33576 composeUnsignedIntCore("offset", element.getOffsetElement(), false); 33577 composeUnsignedIntExtras("offset", element.getOffsetElement(), false); 33578 } 33579 } 33580 33581 protected void composeProdCharacteristic(String name, ProdCharacteristic element) throws IOException { 33582 if (element != null) { 33583 open(name); 33584 composeProdCharacteristicInner(element); 33585 close(); 33586 } 33587 } 33588 33589 protected void composeProdCharacteristicInner(ProdCharacteristic element) throws IOException { 33590 composeBackbone(element); 33591 if (element.hasHeight()) { 33592 composeQuantity("height", element.getHeight()); 33593 } 33594 if (element.hasWidth()) { 33595 composeQuantity("width", element.getWidth()); 33596 } 33597 if (element.hasDepth()) { 33598 composeQuantity("depth", element.getDepth()); 33599 } 33600 if (element.hasWeight()) { 33601 composeQuantity("weight", element.getWeight()); 33602 } 33603 if (element.hasNominalVolume()) { 33604 composeQuantity("nominalVolume", element.getNominalVolume()); 33605 } 33606 if (element.hasExternalDiameter()) { 33607 composeQuantity("externalDiameter", element.getExternalDiameter()); 33608 } 33609 if (element.hasShapeElement()) { 33610 composeStringCore("shape", element.getShapeElement(), false); 33611 composeStringExtras("shape", element.getShapeElement(), false); 33612 } 33613 if (element.hasColor()) { 33614 openArray("color"); 33615 for (StringType e : element.getColor()) 33616 composeStringCore(null, e, true); 33617 closeArray(); 33618 if (anyHasExtras(element.getColor())) { 33619 openArray("_color"); 33620 for (StringType e : element.getColor()) 33621 composeStringExtras(null, e, true); 33622 closeArray(); 33623 } 33624 } 33625 ; 33626 if (element.hasImprint()) { 33627 openArray("imprint"); 33628 for (StringType e : element.getImprint()) 33629 composeStringCore(null, e, true); 33630 closeArray(); 33631 if (anyHasExtras(element.getImprint())) { 33632 openArray("_imprint"); 33633 for (StringType e : element.getImprint()) 33634 composeStringExtras(null, e, true); 33635 closeArray(); 33636 } 33637 } 33638 ; 33639 if (element.hasImage()) { 33640 openArray("image"); 33641 for (Attachment e : element.getImage()) 33642 composeAttachment(null, e); 33643 closeArray(); 33644 } 33645 ; 33646 if (element.hasScoring()) { 33647 composeCodeableConcept("scoring", element.getScoring()); 33648 } 33649 } 33650 33651 protected void composeMeta(String name, Meta element) throws IOException { 33652 if (element != null) { 33653 open(name); 33654 composeMetaInner(element); 33655 close(); 33656 } 33657 } 33658 33659 protected void composeMetaInner(Meta element) throws IOException { 33660 composeElement(element); 33661 if (element.hasVersionIdElement()) { 33662 composeIdCore("versionId", element.getVersionIdElement(), false); 33663 composeIdExtras("versionId", element.getVersionIdElement(), false); 33664 } 33665 if (element.hasLastUpdatedElement()) { 33666 composeInstantCore("lastUpdated", element.getLastUpdatedElement(), false); 33667 composeInstantExtras("lastUpdated", element.getLastUpdatedElement(), false); 33668 } 33669 if (element.hasSourceElement()) { 33670 composeUriCore("source", element.getSourceElement(), false); 33671 composeUriExtras("source", element.getSourceElement(), false); 33672 } 33673 if (element.hasProfile()) { 33674 openArray("profile"); 33675 for (CanonicalType e : element.getProfile()) 33676 composeCanonicalCore(null, e, true); 33677 closeArray(); 33678 if (anyHasExtras(element.getProfile())) { 33679 openArray("_profile"); 33680 for (CanonicalType e : element.getProfile()) 33681 composeCanonicalExtras(null, e, true); 33682 closeArray(); 33683 } 33684 } 33685 ; 33686 if (element.hasSecurity()) { 33687 openArray("security"); 33688 for (Coding e : element.getSecurity()) 33689 composeCoding(null, e); 33690 closeArray(); 33691 } 33692 ; 33693 if (element.hasTag()) { 33694 openArray("tag"); 33695 for (Coding e : element.getTag()) 33696 composeCoding(null, e); 33697 closeArray(); 33698 } 33699 ; 33700 } 33701 33702 protected void composeAddress(String name, Address element) throws IOException { 33703 if (element != null) { 33704 open(name); 33705 composeAddressInner(element); 33706 close(); 33707 } 33708 } 33709 33710 protected void composeAddressInner(Address element) throws IOException { 33711 composeElement(element); 33712 if (element.hasUseElement()) { 33713 composeEnumerationCore("use", element.getUseElement(), new Address.AddressUseEnumFactory(), false); 33714 composeEnumerationExtras("use", element.getUseElement(), new Address.AddressUseEnumFactory(), false); 33715 } 33716 if (element.hasTypeElement()) { 33717 composeEnumerationCore("type", element.getTypeElement(), new Address.AddressTypeEnumFactory(), false); 33718 composeEnumerationExtras("type", element.getTypeElement(), new Address.AddressTypeEnumFactory(), false); 33719 } 33720 if (element.hasTextElement()) { 33721 composeStringCore("text", element.getTextElement(), false); 33722 composeStringExtras("text", element.getTextElement(), false); 33723 } 33724 if (element.hasLine()) { 33725 openArray("line"); 33726 for (StringType e : element.getLine()) 33727 composeStringCore(null, e, true); 33728 closeArray(); 33729 if (anyHasExtras(element.getLine())) { 33730 openArray("_line"); 33731 for (StringType e : element.getLine()) 33732 composeStringExtras(null, e, true); 33733 closeArray(); 33734 } 33735 } 33736 ; 33737 if (element.hasCityElement()) { 33738 composeStringCore("city", element.getCityElement(), false); 33739 composeStringExtras("city", element.getCityElement(), false); 33740 } 33741 if (element.hasDistrictElement()) { 33742 composeStringCore("district", element.getDistrictElement(), false); 33743 composeStringExtras("district", element.getDistrictElement(), false); 33744 } 33745 if (element.hasStateElement()) { 33746 composeStringCore("state", element.getStateElement(), false); 33747 composeStringExtras("state", element.getStateElement(), false); 33748 } 33749 if (element.hasPostalCodeElement()) { 33750 composeStringCore("postalCode", element.getPostalCodeElement(), false); 33751 composeStringExtras("postalCode", element.getPostalCodeElement(), false); 33752 } 33753 if (element.hasCountryElement()) { 33754 composeStringCore("country", element.getCountryElement(), false); 33755 composeStringExtras("country", element.getCountryElement(), false); 33756 } 33757 if (element.hasPeriod()) { 33758 composePeriod("period", element.getPeriod()); 33759 } 33760 } 33761 33762 protected void composeContributor(String name, Contributor element) throws IOException { 33763 if (element != null) { 33764 open(name); 33765 composeContributorInner(element); 33766 close(); 33767 } 33768 } 33769 33770 protected void composeContributorInner(Contributor element) throws IOException { 33771 composeElement(element); 33772 if (element.hasTypeElement()) { 33773 composeEnumerationCore("type", element.getTypeElement(), new Contributor.ContributorTypeEnumFactory(), false); 33774 composeEnumerationExtras("type", element.getTypeElement(), new Contributor.ContributorTypeEnumFactory(), false); 33775 } 33776 if (element.hasNameElement()) { 33777 composeStringCore("name", element.getNameElement(), false); 33778 composeStringExtras("name", element.getNameElement(), false); 33779 } 33780 if (element.hasContact()) { 33781 openArray("contact"); 33782 for (ContactDetail e : element.getContact()) 33783 composeContactDetail(null, e); 33784 closeArray(); 33785 } 33786 ; 33787 } 33788 33789 protected void composeAttachment(String name, Attachment element) throws IOException { 33790 if (element != null) { 33791 open(name); 33792 composeAttachmentInner(element); 33793 close(); 33794 } 33795 } 33796 33797 protected void composeAttachmentInner(Attachment element) throws IOException { 33798 composeElement(element); 33799 if (element.hasContentTypeElement()) { 33800 composeCodeCore("contentType", element.getContentTypeElement(), false); 33801 composeCodeExtras("contentType", element.getContentTypeElement(), false); 33802 } 33803 if (element.hasLanguageElement()) { 33804 composeCodeCore("language", element.getLanguageElement(), false); 33805 composeCodeExtras("language", element.getLanguageElement(), false); 33806 } 33807 if (element.hasDataElement()) { 33808 composeBase64BinaryCore("data", element.getDataElement(), false); 33809 composeBase64BinaryExtras("data", element.getDataElement(), false); 33810 } 33811 if (element.hasUrlElement()) { 33812 composeUrlCore("url", element.getUrlElement(), false); 33813 composeUrlExtras("url", element.getUrlElement(), false); 33814 } 33815 if (element.hasSizeElement()) { 33816 composeUnsignedIntCore("size", element.getSizeElement(), false); 33817 composeUnsignedIntExtras("size", element.getSizeElement(), false); 33818 } 33819 if (element.hasHashElement()) { 33820 composeBase64BinaryCore("hash", element.getHashElement(), false); 33821 composeBase64BinaryExtras("hash", element.getHashElement(), false); 33822 } 33823 if (element.hasTitleElement()) { 33824 composeStringCore("title", element.getTitleElement(), false); 33825 composeStringExtras("title", element.getTitleElement(), false); 33826 } 33827 if (element.hasCreationElement()) { 33828 composeDateTimeCore("creation", element.getCreationElement(), false); 33829 composeDateTimeExtras("creation", element.getCreationElement(), false); 33830 } 33831 } 33832 33833 protected void composeDataRequirement(String name, DataRequirement element) throws IOException { 33834 if (element != null) { 33835 open(name); 33836 composeDataRequirementInner(element); 33837 close(); 33838 } 33839 } 33840 33841 protected void composeDataRequirementInner(DataRequirement element) throws IOException { 33842 composeElement(element); 33843 if (element.hasTypeElement()) { 33844 composeCodeCore("type", element.getTypeElement(), false); 33845 composeCodeExtras("type", element.getTypeElement(), false); 33846 } 33847 if (element.hasProfile()) { 33848 openArray("profile"); 33849 for (CanonicalType e : element.getProfile()) 33850 composeCanonicalCore(null, e, true); 33851 closeArray(); 33852 if (anyHasExtras(element.getProfile())) { 33853 openArray("_profile"); 33854 for (CanonicalType e : element.getProfile()) 33855 composeCanonicalExtras(null, e, true); 33856 closeArray(); 33857 } 33858 } 33859 ; 33860 if (element.hasSubject()) { 33861 composeType("subject", element.getSubject()); 33862 } 33863 if (element.hasMustSupport()) { 33864 openArray("mustSupport"); 33865 for (StringType e : element.getMustSupport()) 33866 composeStringCore(null, e, true); 33867 closeArray(); 33868 if (anyHasExtras(element.getMustSupport())) { 33869 openArray("_mustSupport"); 33870 for (StringType e : element.getMustSupport()) 33871 composeStringExtras(null, e, true); 33872 closeArray(); 33873 } 33874 } 33875 ; 33876 if (element.hasCodeFilter()) { 33877 openArray("codeFilter"); 33878 for (DataRequirement.DataRequirementCodeFilterComponent e : element.getCodeFilter()) 33879 composeDataRequirementDataRequirementCodeFilterComponent(null, e); 33880 closeArray(); 33881 } 33882 ; 33883 if (element.hasDateFilter()) { 33884 openArray("dateFilter"); 33885 for (DataRequirement.DataRequirementDateFilterComponent e : element.getDateFilter()) 33886 composeDataRequirementDataRequirementDateFilterComponent(null, e); 33887 closeArray(); 33888 } 33889 ; 33890 if (element.hasLimitElement()) { 33891 composePositiveIntCore("limit", element.getLimitElement(), false); 33892 composePositiveIntExtras("limit", element.getLimitElement(), false); 33893 } 33894 if (element.hasSort()) { 33895 openArray("sort"); 33896 for (DataRequirement.DataRequirementSortComponent e : element.getSort()) 33897 composeDataRequirementDataRequirementSortComponent(null, e); 33898 closeArray(); 33899 } 33900 ; 33901 } 33902 33903 protected void composeDataRequirementDataRequirementCodeFilterComponent(String name, 33904 DataRequirement.DataRequirementCodeFilterComponent element) throws IOException { 33905 if (element != null) { 33906 open(name); 33907 composeDataRequirementDataRequirementCodeFilterComponentInner(element); 33908 close(); 33909 } 33910 } 33911 33912 protected void composeDataRequirementDataRequirementCodeFilterComponentInner( 33913 DataRequirement.DataRequirementCodeFilterComponent element) throws IOException { 33914 composeElement(element); 33915 if (element.hasPathElement()) { 33916 composeStringCore("path", element.getPathElement(), false); 33917 composeStringExtras("path", element.getPathElement(), false); 33918 } 33919 if (element.hasSearchParamElement()) { 33920 composeStringCore("searchParam", element.getSearchParamElement(), false); 33921 composeStringExtras("searchParam", element.getSearchParamElement(), false); 33922 } 33923 if (element.hasValueSetElement()) { 33924 composeCanonicalCore("valueSet", element.getValueSetElement(), false); 33925 composeCanonicalExtras("valueSet", element.getValueSetElement(), false); 33926 } 33927 if (element.hasCode()) { 33928 openArray("code"); 33929 for (Coding e : element.getCode()) 33930 composeCoding(null, e); 33931 closeArray(); 33932 } 33933 ; 33934 } 33935 33936 protected void composeDataRequirementDataRequirementDateFilterComponent(String name, 33937 DataRequirement.DataRequirementDateFilterComponent element) throws IOException { 33938 if (element != null) { 33939 open(name); 33940 composeDataRequirementDataRequirementDateFilterComponentInner(element); 33941 close(); 33942 } 33943 } 33944 33945 protected void composeDataRequirementDataRequirementDateFilterComponentInner( 33946 DataRequirement.DataRequirementDateFilterComponent element) throws IOException { 33947 composeElement(element); 33948 if (element.hasPathElement()) { 33949 composeStringCore("path", element.getPathElement(), false); 33950 composeStringExtras("path", element.getPathElement(), false); 33951 } 33952 if (element.hasSearchParamElement()) { 33953 composeStringCore("searchParam", element.getSearchParamElement(), false); 33954 composeStringExtras("searchParam", element.getSearchParamElement(), false); 33955 } 33956 if (element.hasValue()) { 33957 composeType("value", element.getValue()); 33958 } 33959 } 33960 33961 protected void composeDataRequirementDataRequirementSortComponent(String name, 33962 DataRequirement.DataRequirementSortComponent element) throws IOException { 33963 if (element != null) { 33964 open(name); 33965 composeDataRequirementDataRequirementSortComponentInner(element); 33966 close(); 33967 } 33968 } 33969 33970 protected void composeDataRequirementDataRequirementSortComponentInner( 33971 DataRequirement.DataRequirementSortComponent element) throws IOException { 33972 composeElement(element); 33973 if (element.hasPathElement()) { 33974 composeStringCore("path", element.getPathElement(), false); 33975 composeStringExtras("path", element.getPathElement(), false); 33976 } 33977 if (element.hasDirectionElement()) { 33978 composeEnumerationCore("direction", element.getDirectionElement(), new DataRequirement.SortDirectionEnumFactory(), 33979 false); 33980 composeEnumerationExtras("direction", element.getDirectionElement(), 33981 new DataRequirement.SortDirectionEnumFactory(), false); 33982 } 33983 } 33984 33985 protected void composeMoney(String name, Money element) throws IOException { 33986 if (element != null) { 33987 open(name); 33988 composeMoneyInner(element); 33989 close(); 33990 } 33991 } 33992 33993 protected void composeMoneyInner(Money element) throws IOException { 33994 composeElement(element); 33995 if (element.hasValueElement()) { 33996 composeDecimalCore("value", element.getValueElement(), false); 33997 composeDecimalExtras("value", element.getValueElement(), false); 33998 } 33999 if (element.hasCurrencyElement()) { 34000 composeCodeCore("currency", element.getCurrencyElement(), false); 34001 composeCodeExtras("currency", element.getCurrencyElement(), false); 34002 } 34003 } 34004 34005 protected void composeHumanName(String name, HumanName element) throws IOException { 34006 if (element != null) { 34007 open(name); 34008 composeHumanNameInner(element); 34009 close(); 34010 } 34011 } 34012 34013 protected void composeHumanNameInner(HumanName element) throws IOException { 34014 composeElement(element); 34015 if (element.hasUseElement()) { 34016 composeEnumerationCore("use", element.getUseElement(), new HumanName.NameUseEnumFactory(), false); 34017 composeEnumerationExtras("use", element.getUseElement(), new HumanName.NameUseEnumFactory(), false); 34018 } 34019 if (element.hasTextElement()) { 34020 composeStringCore("text", element.getTextElement(), false); 34021 composeStringExtras("text", element.getTextElement(), false); 34022 } 34023 if (element.hasFamilyElement()) { 34024 composeStringCore("family", element.getFamilyElement(), false); 34025 composeStringExtras("family", element.getFamilyElement(), false); 34026 } 34027 if (element.hasGiven()) { 34028 openArray("given"); 34029 for (StringType e : element.getGiven()) 34030 composeStringCore(null, e, true); 34031 closeArray(); 34032 if (anyHasExtras(element.getGiven())) { 34033 openArray("_given"); 34034 for (StringType e : element.getGiven()) 34035 composeStringExtras(null, e, true); 34036 closeArray(); 34037 } 34038 } 34039 ; 34040 if (element.hasPrefix()) { 34041 openArray("prefix"); 34042 for (StringType e : element.getPrefix()) 34043 composeStringCore(null, e, true); 34044 closeArray(); 34045 if (anyHasExtras(element.getPrefix())) { 34046 openArray("_prefix"); 34047 for (StringType e : element.getPrefix()) 34048 composeStringExtras(null, e, true); 34049 closeArray(); 34050 } 34051 } 34052 ; 34053 if (element.hasSuffix()) { 34054 openArray("suffix"); 34055 for (StringType e : element.getSuffix()) 34056 composeStringCore(null, e, true); 34057 closeArray(); 34058 if (anyHasExtras(element.getSuffix())) { 34059 openArray("_suffix"); 34060 for (StringType e : element.getSuffix()) 34061 composeStringExtras(null, e, true); 34062 closeArray(); 34063 } 34064 } 34065 ; 34066 if (element.hasPeriod()) { 34067 composePeriod("period", element.getPeriod()); 34068 } 34069 } 34070 34071 protected void composeContactPoint(String name, ContactPoint element) throws IOException { 34072 if (element != null) { 34073 open(name); 34074 composeContactPointInner(element); 34075 close(); 34076 } 34077 } 34078 34079 protected void composeContactPointInner(ContactPoint element) throws IOException { 34080 composeElement(element); 34081 if (element.hasSystemElement()) { 34082 composeEnumerationCore("system", element.getSystemElement(), new ContactPoint.ContactPointSystemEnumFactory(), 34083 false); 34084 composeEnumerationExtras("system", element.getSystemElement(), new ContactPoint.ContactPointSystemEnumFactory(), 34085 false); 34086 } 34087 if (element.hasValueElement()) { 34088 composeStringCore("value", element.getValueElement(), false); 34089 composeStringExtras("value", element.getValueElement(), false); 34090 } 34091 if (element.hasUseElement()) { 34092 composeEnumerationCore("use", element.getUseElement(), new ContactPoint.ContactPointUseEnumFactory(), false); 34093 composeEnumerationExtras("use", element.getUseElement(), new ContactPoint.ContactPointUseEnumFactory(), false); 34094 } 34095 if (element.hasRankElement()) { 34096 composePositiveIntCore("rank", element.getRankElement(), false); 34097 composePositiveIntExtras("rank", element.getRankElement(), false); 34098 } 34099 if (element.hasPeriod()) { 34100 composePeriod("period", element.getPeriod()); 34101 } 34102 } 34103 34104 protected void composeIdentifier(String name, Identifier element) throws IOException { 34105 if (element != null) { 34106 open(name); 34107 composeIdentifierInner(element); 34108 close(); 34109 } 34110 } 34111 34112 protected void composeIdentifierInner(Identifier element) throws IOException { 34113 composeElement(element); 34114 if (element.hasUseElement()) { 34115 composeEnumerationCore("use", element.getUseElement(), new Identifier.IdentifierUseEnumFactory(), false); 34116 composeEnumerationExtras("use", element.getUseElement(), new Identifier.IdentifierUseEnumFactory(), false); 34117 } 34118 if (element.hasType()) { 34119 composeCodeableConcept("type", element.getType()); 34120 } 34121 if (element.hasSystemElement()) { 34122 composeUriCore("system", element.getSystemElement(), false); 34123 composeUriExtras("system", element.getSystemElement(), false); 34124 } 34125 if (element.hasValueElement()) { 34126 composeStringCore("value", element.getValueElement(), false); 34127 composeStringExtras("value", element.getValueElement(), false); 34128 } 34129 if (element.hasPeriod()) { 34130 composePeriod("period", element.getPeriod()); 34131 } 34132 if (element.hasAssigner()) { 34133 composeReference("assigner", element.getAssigner()); 34134 } 34135 } 34136 34137 protected void composeCoding(String name, Coding element) throws IOException { 34138 if (element != null) { 34139 open(name); 34140 composeCodingInner(element); 34141 close(); 34142 } 34143 } 34144 34145 protected void composeCodingInner(Coding element) throws IOException { 34146 composeElement(element); 34147 if (element.hasSystemElement()) { 34148 composeUriCore("system", element.getSystemElement(), false); 34149 composeUriExtras("system", element.getSystemElement(), false); 34150 } 34151 if (element.hasVersionElement()) { 34152 composeStringCore("version", element.getVersionElement(), false); 34153 composeStringExtras("version", element.getVersionElement(), false); 34154 } 34155 if (element.hasCodeElement()) { 34156 composeCodeCore("code", element.getCodeElement(), false); 34157 composeCodeExtras("code", element.getCodeElement(), false); 34158 } 34159 if (element.hasDisplayElement()) { 34160 composeStringCore("display", element.getDisplayElement(), false); 34161 composeStringExtras("display", element.getDisplayElement(), false); 34162 } 34163 if (element.hasUserSelectedElement()) { 34164 composeBooleanCore("userSelected", element.getUserSelectedElement(), false); 34165 composeBooleanExtras("userSelected", element.getUserSelectedElement(), false); 34166 } 34167 } 34168 34169 protected void composeSampledData(String name, SampledData element) throws IOException { 34170 if (element != null) { 34171 open(name); 34172 composeSampledDataInner(element); 34173 close(); 34174 } 34175 } 34176 34177 protected void composeSampledDataInner(SampledData element) throws IOException { 34178 composeElement(element); 34179 if (element.hasOrigin()) { 34180 composeQuantity("origin", element.getOrigin()); 34181 } 34182 if (element.hasPeriodElement()) { 34183 composeDecimalCore("period", element.getPeriodElement(), false); 34184 composeDecimalExtras("period", element.getPeriodElement(), false); 34185 } 34186 if (element.hasFactorElement()) { 34187 composeDecimalCore("factor", element.getFactorElement(), false); 34188 composeDecimalExtras("factor", element.getFactorElement(), false); 34189 } 34190 if (element.hasLowerLimitElement()) { 34191 composeDecimalCore("lowerLimit", element.getLowerLimitElement(), false); 34192 composeDecimalExtras("lowerLimit", element.getLowerLimitElement(), false); 34193 } 34194 if (element.hasUpperLimitElement()) { 34195 composeDecimalCore("upperLimit", element.getUpperLimitElement(), false); 34196 composeDecimalExtras("upperLimit", element.getUpperLimitElement(), false); 34197 } 34198 if (element.hasDimensionsElement()) { 34199 composePositiveIntCore("dimensions", element.getDimensionsElement(), false); 34200 composePositiveIntExtras("dimensions", element.getDimensionsElement(), false); 34201 } 34202 if (element.hasDataElement()) { 34203 composeStringCore("data", element.getDataElement(), false); 34204 composeStringExtras("data", element.getDataElement(), false); 34205 } 34206 } 34207 34208 protected void composeRatio(String name, Ratio element) throws IOException { 34209 if (element != null) { 34210 open(name); 34211 composeRatioInner(element); 34212 close(); 34213 } 34214 } 34215 34216 protected void composeRatioInner(Ratio element) throws IOException { 34217 composeElement(element); 34218 if (element.hasNumerator()) { 34219 composeQuantity("numerator", element.getNumerator()); 34220 } 34221 if (element.hasDenominator()) { 34222 composeQuantity("denominator", element.getDenominator()); 34223 } 34224 } 34225 34226 protected void composeReference(String name, Reference element) throws IOException { 34227 if (element != null) { 34228 open(name); 34229 composeReferenceInner(element); 34230 close(); 34231 } 34232 } 34233 34234 protected void composeReferenceInner(Reference element) throws IOException { 34235 composeElement(element); 34236 if (element.hasReferenceElement()) { 34237 composeStringCore("reference", element.getReferenceElement(), false); 34238 composeStringExtras("reference", element.getReferenceElement(), false); 34239 } 34240 if (element.hasTypeElement()) { 34241 composeUriCore("type", element.getTypeElement(), false); 34242 composeUriExtras("type", element.getTypeElement(), false); 34243 } 34244 if (element.hasIdentifier()) { 34245 composeIdentifier("identifier", element.getIdentifier()); 34246 } 34247 if (element.hasDisplayElement()) { 34248 composeStringCore("display", element.getDisplayElement(), false); 34249 composeStringExtras("display", element.getDisplayElement(), false); 34250 } 34251 } 34252 34253 protected void composeTriggerDefinition(String name, TriggerDefinition element) throws IOException { 34254 if (element != null) { 34255 open(name); 34256 composeTriggerDefinitionInner(element); 34257 close(); 34258 } 34259 } 34260 34261 protected void composeTriggerDefinitionInner(TriggerDefinition element) throws IOException { 34262 composeElement(element); 34263 if (element.hasTypeElement()) { 34264 composeEnumerationCore("type", element.getTypeElement(), new TriggerDefinition.TriggerTypeEnumFactory(), false); 34265 composeEnumerationExtras("type", element.getTypeElement(), new TriggerDefinition.TriggerTypeEnumFactory(), false); 34266 } 34267 if (element.hasNameElement()) { 34268 composeStringCore("name", element.getNameElement(), false); 34269 composeStringExtras("name", element.getNameElement(), false); 34270 } 34271 if (element.hasTiming()) { 34272 composeType("timing", element.getTiming()); 34273 } 34274 if (element.hasData()) { 34275 openArray("data"); 34276 for (DataRequirement e : element.getData()) 34277 composeDataRequirement(null, e); 34278 closeArray(); 34279 } 34280 ; 34281 if (element.hasCondition()) { 34282 composeExpression("condition", element.getCondition()); 34283 } 34284 } 34285 34286 protected void composeQuantity(String name, Quantity element) throws IOException { 34287 if (element != null) { 34288 open(name); 34289 composeQuantityInner(element); 34290 close(); 34291 } 34292 } 34293 34294 protected void composeQuantityInner(Quantity element) throws IOException { 34295 composeElement(element); 34296 if (element.hasValueElement()) { 34297 composeDecimalCore("value", element.getValueElement(), false); 34298 composeDecimalExtras("value", element.getValueElement(), false); 34299 } 34300 if (element.hasComparatorElement()) { 34301 composeEnumerationCore("comparator", element.getComparatorElement(), new Quantity.QuantityComparatorEnumFactory(), 34302 false); 34303 composeEnumerationExtras("comparator", element.getComparatorElement(), 34304 new Quantity.QuantityComparatorEnumFactory(), false); 34305 } 34306 if (element.hasUnitElement()) { 34307 composeStringCore("unit", element.getUnitElement(), false); 34308 composeStringExtras("unit", element.getUnitElement(), false); 34309 } 34310 if (element.hasSystemElement()) { 34311 composeUriCore("system", element.getSystemElement(), false); 34312 composeUriExtras("system", element.getSystemElement(), false); 34313 } 34314 if (element.hasCodeElement()) { 34315 composeCodeCore("code", element.getCodeElement(), false); 34316 composeCodeExtras("code", element.getCodeElement(), false); 34317 } 34318 } 34319 34320 protected void composePeriod(String name, Period element) throws IOException { 34321 if (element != null) { 34322 open(name); 34323 composePeriodInner(element); 34324 close(); 34325 } 34326 } 34327 34328 protected void composePeriodInner(Period element) throws IOException { 34329 composeElement(element); 34330 if (element.hasStartElement()) { 34331 composeDateTimeCore("start", element.getStartElement(), false); 34332 composeDateTimeExtras("start", element.getStartElement(), false); 34333 } 34334 if (element.hasEndElement()) { 34335 composeDateTimeCore("end", element.getEndElement(), false); 34336 composeDateTimeExtras("end", element.getEndElement(), false); 34337 } 34338 } 34339 34340 protected void composeRange(String name, Range element) throws IOException { 34341 if (element != null) { 34342 open(name); 34343 composeRangeInner(element); 34344 close(); 34345 } 34346 } 34347 34348 protected void composeRangeInner(Range element) throws IOException { 34349 composeElement(element); 34350 if (element.hasLow()) { 34351 composeQuantity("low", element.getLow()); 34352 } 34353 if (element.hasHigh()) { 34354 composeQuantity("high", element.getHigh()); 34355 } 34356 } 34357 34358 protected void composeRelatedArtifact(String name, RelatedArtifact element) throws IOException { 34359 if (element != null) { 34360 open(name); 34361 composeRelatedArtifactInner(element); 34362 close(); 34363 } 34364 } 34365 34366 protected void composeRelatedArtifactInner(RelatedArtifact element) throws IOException { 34367 composeElement(element); 34368 if (element.hasTypeElement()) { 34369 composeEnumerationCore("type", element.getTypeElement(), new RelatedArtifact.RelatedArtifactTypeEnumFactory(), 34370 false); 34371 composeEnumerationExtras("type", element.getTypeElement(), new RelatedArtifact.RelatedArtifactTypeEnumFactory(), 34372 false); 34373 } 34374 if (element.hasLabelElement()) { 34375 composeStringCore("label", element.getLabelElement(), false); 34376 composeStringExtras("label", element.getLabelElement(), false); 34377 } 34378 if (element.hasDisplayElement()) { 34379 composeStringCore("display", element.getDisplayElement(), false); 34380 composeStringExtras("display", element.getDisplayElement(), false); 34381 } 34382 if (element.hasCitationElement()) { 34383 composeMarkdownCore("citation", element.getCitationElement(), false); 34384 composeMarkdownExtras("citation", element.getCitationElement(), false); 34385 } 34386 if (element.hasUrlElement()) { 34387 composeUrlCore("url", element.getUrlElement(), false); 34388 composeUrlExtras("url", element.getUrlElement(), false); 34389 } 34390 if (element.hasDocument()) { 34391 composeAttachment("document", element.getDocument()); 34392 } 34393 if (element.hasResourceElement()) { 34394 composeCanonicalCore("resource", element.getResourceElement(), false); 34395 composeCanonicalExtras("resource", element.getResourceElement(), false); 34396 } 34397 } 34398 34399 protected void composeAnnotation(String name, Annotation element) throws IOException { 34400 if (element != null) { 34401 open(name); 34402 composeAnnotationInner(element); 34403 close(); 34404 } 34405 } 34406 34407 protected void composeAnnotationInner(Annotation element) throws IOException { 34408 composeElement(element); 34409 if (element.hasAuthor()) { 34410 composeType("author", element.getAuthor()); 34411 } 34412 if (element.hasTimeElement()) { 34413 composeDateTimeCore("time", element.getTimeElement(), false); 34414 composeDateTimeExtras("time", element.getTimeElement(), false); 34415 } 34416 if (element.hasTextElement()) { 34417 composeMarkdownCore("text", element.getTextElement(), false); 34418 composeMarkdownExtras("text", element.getTextElement(), false); 34419 } 34420 } 34421 34422 protected void composeContactDetail(String name, ContactDetail element) throws IOException { 34423 if (element != null) { 34424 open(name); 34425 composeContactDetailInner(element); 34426 close(); 34427 } 34428 } 34429 34430 protected void composeContactDetailInner(ContactDetail element) throws IOException { 34431 composeElement(element); 34432 if (element.hasNameElement()) { 34433 composeStringCore("name", element.getNameElement(), false); 34434 composeStringExtras("name", element.getNameElement(), false); 34435 } 34436 if (element.hasTelecom()) { 34437 openArray("telecom"); 34438 for (ContactPoint e : element.getTelecom()) 34439 composeContactPoint(null, e); 34440 closeArray(); 34441 } 34442 ; 34443 } 34444 34445 protected void composeUsageContext(String name, UsageContext element) throws IOException { 34446 if (element != null) { 34447 open(name); 34448 composeUsageContextInner(element); 34449 close(); 34450 } 34451 } 34452 34453 protected void composeUsageContextInner(UsageContext element) throws IOException { 34454 composeElement(element); 34455 if (element.hasCode()) { 34456 composeCoding("code", element.getCode()); 34457 } 34458 if (element.hasValue()) { 34459 composeType("value", element.getValue()); 34460 } 34461 } 34462 34463 protected void composeExpression(String name, Expression element) throws IOException { 34464 if (element != null) { 34465 open(name); 34466 composeExpressionInner(element); 34467 close(); 34468 } 34469 } 34470 34471 protected void composeExpressionInner(Expression element) throws IOException { 34472 composeElement(element); 34473 if (element.hasDescriptionElement()) { 34474 composeStringCore("description", element.getDescriptionElement(), false); 34475 composeStringExtras("description", element.getDescriptionElement(), false); 34476 } 34477 if (element.hasNameElement()) { 34478 composeIdCore("name", element.getNameElement(), false); 34479 composeIdExtras("name", element.getNameElement(), false); 34480 } 34481 if (element.hasLanguageElement()) { 34482 composeCodeCore("language", element.getLanguageElement(), false); 34483 composeCodeExtras("language", element.getLanguageElement(), false); 34484 } 34485 if (element.hasExpressionElement()) { 34486 composeStringCore("expression", element.getExpressionElement(), false); 34487 composeStringExtras("expression", element.getExpressionElement(), false); 34488 } 34489 if (element.hasReferenceElement()) { 34490 composeUriCore("reference", element.getReferenceElement(), false); 34491 composeUriExtras("reference", element.getReferenceElement(), false); 34492 } 34493 } 34494 34495 protected void composeSignature(String name, Signature element) throws IOException { 34496 if (element != null) { 34497 open(name); 34498 composeSignatureInner(element); 34499 close(); 34500 } 34501 } 34502 34503 protected void composeSignatureInner(Signature element) throws IOException { 34504 composeElement(element); 34505 if (element.hasType()) { 34506 openArray("type"); 34507 for (Coding e : element.getType()) 34508 composeCoding(null, e); 34509 closeArray(); 34510 } 34511 ; 34512 if (element.hasWhenElement()) { 34513 composeInstantCore("when", element.getWhenElement(), false); 34514 composeInstantExtras("when", element.getWhenElement(), false); 34515 } 34516 if (element.hasWho()) { 34517 composeReference("who", element.getWho()); 34518 } 34519 if (element.hasOnBehalfOf()) { 34520 composeReference("onBehalfOf", element.getOnBehalfOf()); 34521 } 34522 if (element.hasTargetFormatElement()) { 34523 composeCodeCore("targetFormat", element.getTargetFormatElement(), false); 34524 composeCodeExtras("targetFormat", element.getTargetFormatElement(), false); 34525 } 34526 if (element.hasSigFormatElement()) { 34527 composeCodeCore("sigFormat", element.getSigFormatElement(), false); 34528 composeCodeExtras("sigFormat", element.getSigFormatElement(), false); 34529 } 34530 if (element.hasDataElement()) { 34531 composeBase64BinaryCore("data", element.getDataElement(), false); 34532 composeBase64BinaryExtras("data", element.getDataElement(), false); 34533 } 34534 } 34535 34536 protected void composeCodeableConcept(String name, CodeableConcept element) throws IOException { 34537 if (element != null) { 34538 open(name); 34539 composeCodeableConceptInner(element); 34540 close(); 34541 } 34542 } 34543 34544 protected void composeCodeableConceptInner(CodeableConcept element) throws IOException { 34545 composeElement(element); 34546 if (element.hasCoding()) { 34547 openArray("coding"); 34548 for (Coding e : element.getCoding()) 34549 composeCoding(null, e); 34550 closeArray(); 34551 } 34552 ; 34553 if (element.hasTextElement()) { 34554 composeStringCore("text", element.getTextElement(), false); 34555 composeStringExtras("text", element.getTextElement(), false); 34556 } 34557 } 34558 34559 protected void composeParameterDefinition(String name, ParameterDefinition element) throws IOException { 34560 if (element != null) { 34561 open(name); 34562 composeParameterDefinitionInner(element); 34563 close(); 34564 } 34565 } 34566 34567 protected void composeParameterDefinitionInner(ParameterDefinition element) throws IOException { 34568 composeElement(element); 34569 if (element.hasNameElement()) { 34570 composeCodeCore("name", element.getNameElement(), false); 34571 composeCodeExtras("name", element.getNameElement(), false); 34572 } 34573 if (element.hasUseElement()) { 34574 composeEnumerationCore("use", element.getUseElement(), new ParameterDefinition.ParameterUseEnumFactory(), false); 34575 composeEnumerationExtras("use", element.getUseElement(), new ParameterDefinition.ParameterUseEnumFactory(), 34576 false); 34577 } 34578 if (element.hasMinElement()) { 34579 composeIntegerCore("min", element.getMinElement(), false); 34580 composeIntegerExtras("min", element.getMinElement(), false); 34581 } 34582 if (element.hasMaxElement()) { 34583 composeStringCore("max", element.getMaxElement(), false); 34584 composeStringExtras("max", element.getMaxElement(), false); 34585 } 34586 if (element.hasDocumentationElement()) { 34587 composeStringCore("documentation", element.getDocumentationElement(), false); 34588 composeStringExtras("documentation", element.getDocumentationElement(), false); 34589 } 34590 if (element.hasTypeElement()) { 34591 composeCodeCore("type", element.getTypeElement(), false); 34592 composeCodeExtras("type", element.getTypeElement(), false); 34593 } 34594 if (element.hasProfileElement()) { 34595 composeCanonicalCore("profile", element.getProfileElement(), false); 34596 composeCanonicalExtras("profile", element.getProfileElement(), false); 34597 } 34598 } 34599 34600 protected void composeElementDefinition(String name, ElementDefinition element) throws IOException { 34601 if (element != null) { 34602 open(name); 34603 composeElementDefinitionInner(element); 34604 close(); 34605 } 34606 } 34607 34608 protected void composeElementDefinitionInner(ElementDefinition element) throws IOException { 34609 composeBackbone(element); 34610 if (element.hasPathElement()) { 34611 composeStringCore("path", element.getPathElement(), false); 34612 composeStringExtras("path", element.getPathElement(), false); 34613 } 34614 if (element.hasRepresentation()) { 34615 openArray("representation"); 34616 for (Enumeration<ElementDefinition.PropertyRepresentation> e : element.getRepresentation()) 34617 composeEnumerationCore(null, e, new ElementDefinition.PropertyRepresentationEnumFactory(), true); 34618 closeArray(); 34619 if (anyHasExtras(element.getRepresentation())) { 34620 openArray("_representation"); 34621 for (Enumeration<ElementDefinition.PropertyRepresentation> e : element.getRepresentation()) 34622 composeEnumerationExtras(null, e, new ElementDefinition.PropertyRepresentationEnumFactory(), true); 34623 closeArray(); 34624 } 34625 } 34626 ; 34627 if (element.hasSliceNameElement()) { 34628 composeStringCore("sliceName", element.getSliceNameElement(), false); 34629 composeStringExtras("sliceName", element.getSliceNameElement(), false); 34630 } 34631 if (element.hasSliceIsConstrainingElement()) { 34632 composeBooleanCore("sliceIsConstraining", element.getSliceIsConstrainingElement(), false); 34633 composeBooleanExtras("sliceIsConstraining", element.getSliceIsConstrainingElement(), false); 34634 } 34635 if (element.hasLabelElement()) { 34636 composeStringCore("label", element.getLabelElement(), false); 34637 composeStringExtras("label", element.getLabelElement(), false); 34638 } 34639 if (element.hasCode()) { 34640 openArray("code"); 34641 for (Coding e : element.getCode()) 34642 composeCoding(null, e); 34643 closeArray(); 34644 } 34645 ; 34646 if (element.hasSlicing()) { 34647 composeElementDefinitionElementDefinitionSlicingComponent("slicing", element.getSlicing()); 34648 } 34649 if (element.hasShortElement()) { 34650 composeStringCore("short", element.getShortElement(), false); 34651 composeStringExtras("short", element.getShortElement(), false); 34652 } 34653 if (element.hasDefinitionElement()) { 34654 composeMarkdownCore("definition", element.getDefinitionElement(), false); 34655 composeMarkdownExtras("definition", element.getDefinitionElement(), false); 34656 } 34657 if (element.hasCommentElement()) { 34658 composeMarkdownCore("comment", element.getCommentElement(), false); 34659 composeMarkdownExtras("comment", element.getCommentElement(), false); 34660 } 34661 if (element.hasRequirementsElement()) { 34662 composeMarkdownCore("requirements", element.getRequirementsElement(), false); 34663 composeMarkdownExtras("requirements", element.getRequirementsElement(), false); 34664 } 34665 if (element.hasAlias()) { 34666 openArray("alias"); 34667 for (StringType e : element.getAlias()) 34668 composeStringCore(null, e, true); 34669 closeArray(); 34670 if (anyHasExtras(element.getAlias())) { 34671 openArray("_alias"); 34672 for (StringType e : element.getAlias()) 34673 composeStringExtras(null, e, true); 34674 closeArray(); 34675 } 34676 } 34677 ; 34678 if (element.hasMinElement()) { 34679 composeUnsignedIntCore("min", element.getMinElement(), false); 34680 composeUnsignedIntExtras("min", element.getMinElement(), false); 34681 } 34682 if (element.hasMaxElement()) { 34683 composeStringCore("max", element.getMaxElement(), false); 34684 composeStringExtras("max", element.getMaxElement(), false); 34685 } 34686 if (element.hasBase()) { 34687 composeElementDefinitionElementDefinitionBaseComponent("base", element.getBase()); 34688 } 34689 if (element.hasContentReferenceElement()) { 34690 composeUriCore("contentReference", element.getContentReferenceElement(), false); 34691 composeUriExtras("contentReference", element.getContentReferenceElement(), false); 34692 } 34693 if (element.hasType()) { 34694 openArray("type"); 34695 for (ElementDefinition.TypeRefComponent e : element.getType()) 34696 composeElementDefinitionTypeRefComponent(null, e); 34697 closeArray(); 34698 } 34699 ; 34700 if (element.hasDefaultValue()) { 34701 composeType("defaultValue", element.getDefaultValue()); 34702 } 34703 if (element.hasMeaningWhenMissingElement()) { 34704 composeMarkdownCore("meaningWhenMissing", element.getMeaningWhenMissingElement(), false); 34705 composeMarkdownExtras("meaningWhenMissing", element.getMeaningWhenMissingElement(), false); 34706 } 34707 if (element.hasOrderMeaningElement()) { 34708 composeStringCore("orderMeaning", element.getOrderMeaningElement(), false); 34709 composeStringExtras("orderMeaning", element.getOrderMeaningElement(), false); 34710 } 34711 if (element.hasFixed()) { 34712 composeType("fixed", element.getFixed()); 34713 } 34714 if (element.hasPattern()) { 34715 composeType("pattern", element.getPattern()); 34716 } 34717 if (element.hasExample()) { 34718 openArray("example"); 34719 for (ElementDefinition.ElementDefinitionExampleComponent e : element.getExample()) 34720 composeElementDefinitionElementDefinitionExampleComponent(null, e); 34721 closeArray(); 34722 } 34723 ; 34724 if (element.hasMinValue()) { 34725 composeType("minValue", element.getMinValue()); 34726 } 34727 if (element.hasMaxValue()) { 34728 composeType("maxValue", element.getMaxValue()); 34729 } 34730 if (element.hasMaxLengthElement()) { 34731 composeIntegerCore("maxLength", element.getMaxLengthElement(), false); 34732 composeIntegerExtras("maxLength", element.getMaxLengthElement(), false); 34733 } 34734 if (element.hasCondition()) { 34735 openArray("condition"); 34736 for (IdType e : element.getCondition()) 34737 composeIdCore(null, e, true); 34738 closeArray(); 34739 if (anyHasExtras(element.getCondition())) { 34740 openArray("_condition"); 34741 for (IdType e : element.getCondition()) 34742 composeIdExtras(null, e, true); 34743 closeArray(); 34744 } 34745 } 34746 ; 34747 if (element.hasConstraint()) { 34748 openArray("constraint"); 34749 for (ElementDefinition.ElementDefinitionConstraintComponent e : element.getConstraint()) 34750 composeElementDefinitionElementDefinitionConstraintComponent(null, e); 34751 closeArray(); 34752 } 34753 ; 34754 if (element.hasMustSupportElement()) { 34755 composeBooleanCore("mustSupport", element.getMustSupportElement(), false); 34756 composeBooleanExtras("mustSupport", element.getMustSupportElement(), false); 34757 } 34758 if (element.hasIsModifierElement()) { 34759 composeBooleanCore("isModifier", element.getIsModifierElement(), false); 34760 composeBooleanExtras("isModifier", element.getIsModifierElement(), false); 34761 } 34762 if (element.hasIsModifierReasonElement()) { 34763 composeStringCore("isModifierReason", element.getIsModifierReasonElement(), false); 34764 composeStringExtras("isModifierReason", element.getIsModifierReasonElement(), false); 34765 } 34766 if (element.hasIsSummaryElement()) { 34767 composeBooleanCore("isSummary", element.getIsSummaryElement(), false); 34768 composeBooleanExtras("isSummary", element.getIsSummaryElement(), false); 34769 } 34770 if (element.hasBinding()) { 34771 composeElementDefinitionElementDefinitionBindingComponent("binding", element.getBinding()); 34772 } 34773 if (element.hasMapping()) { 34774 openArray("mapping"); 34775 for (ElementDefinition.ElementDefinitionMappingComponent e : element.getMapping()) 34776 composeElementDefinitionElementDefinitionMappingComponent(null, e); 34777 closeArray(); 34778 } 34779 ; 34780 } 34781 34782 protected void composeElementDefinitionElementDefinitionSlicingComponent(String name, 34783 ElementDefinition.ElementDefinitionSlicingComponent element) throws IOException { 34784 if (element != null) { 34785 open(name); 34786 composeElementDefinitionElementDefinitionSlicingComponentInner(element); 34787 close(); 34788 } 34789 } 34790 34791 protected void composeElementDefinitionElementDefinitionSlicingComponentInner( 34792 ElementDefinition.ElementDefinitionSlicingComponent element) throws IOException { 34793 composeElement(element); 34794 if (element.hasDiscriminator()) { 34795 openArray("discriminator"); 34796 for (ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent e : element.getDiscriminator()) 34797 composeElementDefinitionElementDefinitionSlicingDiscriminatorComponent(null, e); 34798 closeArray(); 34799 } 34800 ; 34801 if (element.hasDescriptionElement()) { 34802 composeStringCore("description", element.getDescriptionElement(), false); 34803 composeStringExtras("description", element.getDescriptionElement(), false); 34804 } 34805 if (element.hasOrderedElement()) { 34806 composeBooleanCore("ordered", element.getOrderedElement(), false); 34807 composeBooleanExtras("ordered", element.getOrderedElement(), false); 34808 } 34809 if (element.hasRulesElement()) { 34810 composeEnumerationCore("rules", element.getRulesElement(), new ElementDefinition.SlicingRulesEnumFactory(), 34811 false); 34812 composeEnumerationExtras("rules", element.getRulesElement(), new ElementDefinition.SlicingRulesEnumFactory(), 34813 false); 34814 } 34815 } 34816 34817 protected void composeElementDefinitionElementDefinitionSlicingDiscriminatorComponent(String name, 34818 ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent element) throws IOException { 34819 if (element != null) { 34820 open(name); 34821 composeElementDefinitionElementDefinitionSlicingDiscriminatorComponentInner(element); 34822 close(); 34823 } 34824 } 34825 34826 protected void composeElementDefinitionElementDefinitionSlicingDiscriminatorComponentInner( 34827 ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent element) throws IOException { 34828 composeElement(element); 34829 if (element.hasTypeElement()) { 34830 composeEnumerationCore("type", element.getTypeElement(), new ElementDefinition.DiscriminatorTypeEnumFactory(), 34831 false); 34832 composeEnumerationExtras("type", element.getTypeElement(), new ElementDefinition.DiscriminatorTypeEnumFactory(), 34833 false); 34834 } 34835 if (element.hasPathElement()) { 34836 composeStringCore("path", element.getPathElement(), false); 34837 composeStringExtras("path", element.getPathElement(), false); 34838 } 34839 } 34840 34841 protected void composeElementDefinitionElementDefinitionBaseComponent(String name, 34842 ElementDefinition.ElementDefinitionBaseComponent element) throws IOException { 34843 if (element != null) { 34844 open(name); 34845 composeElementDefinitionElementDefinitionBaseComponentInner(element); 34846 close(); 34847 } 34848 } 34849 34850 protected void composeElementDefinitionElementDefinitionBaseComponentInner( 34851 ElementDefinition.ElementDefinitionBaseComponent element) throws IOException { 34852 composeElement(element); 34853 if (element.hasPathElement()) { 34854 composeStringCore("path", element.getPathElement(), false); 34855 composeStringExtras("path", element.getPathElement(), false); 34856 } 34857 if (element.hasMinElement()) { 34858 composeUnsignedIntCore("min", element.getMinElement(), false); 34859 composeUnsignedIntExtras("min", element.getMinElement(), false); 34860 } 34861 if (element.hasMaxElement()) { 34862 composeStringCore("max", element.getMaxElement(), false); 34863 composeStringExtras("max", element.getMaxElement(), false); 34864 } 34865 } 34866 34867 protected void composeElementDefinitionTypeRefComponent(String name, ElementDefinition.TypeRefComponent element) 34868 throws IOException { 34869 if (element != null) { 34870 open(name); 34871 composeElementDefinitionTypeRefComponentInner(element); 34872 close(); 34873 } 34874 } 34875 34876 protected void composeElementDefinitionTypeRefComponentInner(ElementDefinition.TypeRefComponent element) 34877 throws IOException { 34878 composeElement(element); 34879 if (element.hasCodeElement()) { 34880 composeUriCore("code", element.getCodeElement(), false); 34881 composeUriExtras("code", element.getCodeElement(), false); 34882 } 34883 if (element.hasProfile()) { 34884 openArray("profile"); 34885 for (CanonicalType e : element.getProfile()) 34886 composeCanonicalCore(null, e, true); 34887 closeArray(); 34888 if (anyHasExtras(element.getProfile())) { 34889 openArray("_profile"); 34890 for (CanonicalType e : element.getProfile()) 34891 composeCanonicalExtras(null, e, true); 34892 closeArray(); 34893 } 34894 } 34895 ; 34896 if (element.hasTargetProfile()) { 34897 openArray("targetProfile"); 34898 for (CanonicalType e : element.getTargetProfile()) 34899 composeCanonicalCore(null, e, true); 34900 closeArray(); 34901 if (anyHasExtras(element.getTargetProfile())) { 34902 openArray("_targetProfile"); 34903 for (CanonicalType e : element.getTargetProfile()) 34904 composeCanonicalExtras(null, e, true); 34905 closeArray(); 34906 } 34907 } 34908 ; 34909 if (element.hasAggregation()) { 34910 openArray("aggregation"); 34911 for (Enumeration<ElementDefinition.AggregationMode> e : element.getAggregation()) 34912 composeEnumerationCore(null, e, new ElementDefinition.AggregationModeEnumFactory(), true); 34913 closeArray(); 34914 if (anyHasExtras(element.getAggregation())) { 34915 openArray("_aggregation"); 34916 for (Enumeration<ElementDefinition.AggregationMode> e : element.getAggregation()) 34917 composeEnumerationExtras(null, e, new ElementDefinition.AggregationModeEnumFactory(), true); 34918 closeArray(); 34919 } 34920 } 34921 ; 34922 if (element.hasVersioningElement()) { 34923 composeEnumerationCore("versioning", element.getVersioningElement(), 34924 new ElementDefinition.ReferenceVersionRulesEnumFactory(), false); 34925 composeEnumerationExtras("versioning", element.getVersioningElement(), 34926 new ElementDefinition.ReferenceVersionRulesEnumFactory(), false); 34927 } 34928 } 34929 34930 protected void composeElementDefinitionElementDefinitionExampleComponent(String name, 34931 ElementDefinition.ElementDefinitionExampleComponent element) throws IOException { 34932 if (element != null) { 34933 open(name); 34934 composeElementDefinitionElementDefinitionExampleComponentInner(element); 34935 close(); 34936 } 34937 } 34938 34939 protected void composeElementDefinitionElementDefinitionExampleComponentInner( 34940 ElementDefinition.ElementDefinitionExampleComponent element) throws IOException { 34941 composeElement(element); 34942 if (element.hasLabelElement()) { 34943 composeStringCore("label", element.getLabelElement(), false); 34944 composeStringExtras("label", element.getLabelElement(), false); 34945 } 34946 if (element.hasValue()) { 34947 composeType("value", element.getValue()); 34948 } 34949 } 34950 34951 protected void composeElementDefinitionElementDefinitionConstraintComponent(String name, 34952 ElementDefinition.ElementDefinitionConstraintComponent element) throws IOException { 34953 if (element != null) { 34954 open(name); 34955 composeElementDefinitionElementDefinitionConstraintComponentInner(element); 34956 close(); 34957 } 34958 } 34959 34960 protected void composeElementDefinitionElementDefinitionConstraintComponentInner( 34961 ElementDefinition.ElementDefinitionConstraintComponent element) throws IOException { 34962 composeElement(element); 34963 if (element.hasKeyElement()) { 34964 composeIdCore("key", element.getKeyElement(), false); 34965 composeIdExtras("key", element.getKeyElement(), false); 34966 } 34967 if (element.hasRequirementsElement()) { 34968 composeStringCore("requirements", element.getRequirementsElement(), false); 34969 composeStringExtras("requirements", element.getRequirementsElement(), false); 34970 } 34971 if (element.hasSeverityElement()) { 34972 composeEnumerationCore("severity", element.getSeverityElement(), 34973 new ElementDefinition.ConstraintSeverityEnumFactory(), false); 34974 composeEnumerationExtras("severity", element.getSeverityElement(), 34975 new ElementDefinition.ConstraintSeverityEnumFactory(), false); 34976 } 34977 if (element.hasHumanElement()) { 34978 composeStringCore("human", element.getHumanElement(), false); 34979 composeStringExtras("human", element.getHumanElement(), false); 34980 } 34981 if (element.hasExpressionElement()) { 34982 composeStringCore("expression", element.getExpressionElement(), false); 34983 composeStringExtras("expression", element.getExpressionElement(), false); 34984 } 34985 if (element.hasXpathElement()) { 34986 composeStringCore("xpath", element.getXpathElement(), false); 34987 composeStringExtras("xpath", element.getXpathElement(), false); 34988 } 34989 if (element.hasSourceElement()) { 34990 composeCanonicalCore("source", element.getSourceElement(), false); 34991 composeCanonicalExtras("source", element.getSourceElement(), false); 34992 } 34993 } 34994 34995 protected void composeElementDefinitionElementDefinitionBindingComponent(String name, 34996 ElementDefinition.ElementDefinitionBindingComponent element) throws IOException { 34997 if (element != null) { 34998 open(name); 34999 composeElementDefinitionElementDefinitionBindingComponentInner(element); 35000 close(); 35001 } 35002 } 35003 35004 protected void composeElementDefinitionElementDefinitionBindingComponentInner( 35005 ElementDefinition.ElementDefinitionBindingComponent element) throws IOException { 35006 composeElement(element); 35007 if (element.hasStrengthElement()) { 35008 composeEnumerationCore("strength", element.getStrengthElement(), new Enumerations.BindingStrengthEnumFactory(), 35009 false); 35010 composeEnumerationExtras("strength", element.getStrengthElement(), new Enumerations.BindingStrengthEnumFactory(), 35011 false); 35012 } 35013 if (element.hasDescriptionElement()) { 35014 composeStringCore("description", element.getDescriptionElement(), false); 35015 composeStringExtras("description", element.getDescriptionElement(), false); 35016 } 35017 if (element.hasValueSetElement()) { 35018 composeCanonicalCore("valueSet", element.getValueSetElement(), false); 35019 composeCanonicalExtras("valueSet", element.getValueSetElement(), false); 35020 } 35021 } 35022 35023 protected void composeElementDefinitionElementDefinitionMappingComponent(String name, 35024 ElementDefinition.ElementDefinitionMappingComponent element) throws IOException { 35025 if (element != null) { 35026 open(name); 35027 composeElementDefinitionElementDefinitionMappingComponentInner(element); 35028 close(); 35029 } 35030 } 35031 35032 protected void composeElementDefinitionElementDefinitionMappingComponentInner( 35033 ElementDefinition.ElementDefinitionMappingComponent element) throws IOException { 35034 composeElement(element); 35035 if (element.hasIdentityElement()) { 35036 composeIdCore("identity", element.getIdentityElement(), false); 35037 composeIdExtras("identity", element.getIdentityElement(), false); 35038 } 35039 if (element.hasLanguageElement()) { 35040 composeCodeCore("language", element.getLanguageElement(), false); 35041 composeCodeExtras("language", element.getLanguageElement(), false); 35042 } 35043 if (element.hasMapElement()) { 35044 composeStringCore("map", element.getMapElement(), false); 35045 composeStringExtras("map", element.getMapElement(), false); 35046 } 35047 if (element.hasCommentElement()) { 35048 composeStringCore("comment", element.getCommentElement(), false); 35049 composeStringExtras("comment", element.getCommentElement(), false); 35050 } 35051 } 35052 35053 protected void composeDomainResourceElements(DomainResource element) throws IOException { 35054 composeResourceElements(element); 35055 if (element.hasText()) { 35056 composeNarrative("text", element.getText()); 35057 } 35058 if (element.hasContained()) { 35059 openArray("contained"); 35060 for (Resource e : element.getContained()) { 35061 open(null); 35062 composeResource(e); 35063 close(); 35064 } 35065 closeArray(); 35066 } 35067 ; 35068 if (element.hasExtension()) { 35069 openArray("extension"); 35070 for (Extension e : element.getExtension()) 35071 composeExtension(null, e); 35072 closeArray(); 35073 } 35074 ; 35075 if (element.hasModifierExtension()) { 35076 openArray("modifierExtension"); 35077 for (Extension e : element.getModifierExtension()) 35078 composeExtension(null, e); 35079 closeArray(); 35080 } 35081 ; 35082 } 35083 35084 protected void composeParameters(String name, Parameters element) throws IOException { 35085 if (element != null) { 35086 prop("resourceType", name); 35087 composeParametersInner(element); 35088 } 35089 } 35090 35091 protected void composeParametersInner(Parameters element) throws IOException { 35092 composeResourceElements(element); 35093 if (element.hasParameter()) { 35094 openArray("parameter"); 35095 for (Parameters.ParametersParameterComponent e : element.getParameter()) 35096 composeParametersParametersParameterComponent(null, e); 35097 closeArray(); 35098 } 35099 ; 35100 } 35101 35102 protected void composeParametersParametersParameterComponent(String name, 35103 Parameters.ParametersParameterComponent element) throws IOException { 35104 if (element != null) { 35105 open(name); 35106 composeParametersParametersParameterComponentInner(element); 35107 close(); 35108 } 35109 } 35110 35111 protected void composeParametersParametersParameterComponentInner(Parameters.ParametersParameterComponent element) 35112 throws IOException { 35113 composeBackbone(element); 35114 if (element.hasNameElement()) { 35115 composeStringCore("name", element.getNameElement(), false); 35116 composeStringExtras("name", element.getNameElement(), false); 35117 } 35118 if (element.hasValue()) { 35119 composeType("value", element.getValue()); 35120 } 35121 if (element.hasResource()) { 35122 open("resource"); 35123 composeResource(element.getResource()); 35124 close(); 35125 } 35126 if (element.hasPart()) { 35127 openArray("part"); 35128 for (Parameters.ParametersParameterComponent e : element.getPart()) 35129 composeParametersParametersParameterComponent(null, e); 35130 closeArray(); 35131 } 35132 ; 35133 } 35134 35135 protected void composeResourceElements(Resource element) throws IOException { 35136 if (element.hasIdElement()) { 35137 composeIdCore("id", element.getIdElement(), false); 35138 composeIdExtras("id", element.getIdElement(), false); 35139 } 35140 if (element.hasMeta()) { 35141 composeMeta("meta", element.getMeta()); 35142 } 35143 if (element.hasImplicitRulesElement()) { 35144 composeUriCore("implicitRules", element.getImplicitRulesElement(), false); 35145 composeUriExtras("implicitRules", element.getImplicitRulesElement(), false); 35146 } 35147 if (element.hasLanguageElement()) { 35148 composeCodeCore("language", element.getLanguageElement(), false); 35149 composeCodeExtras("language", element.getLanguageElement(), false); 35150 } 35151 } 35152 35153 protected void composeAccount(String name, Account element) throws IOException { 35154 if (element != null) { 35155 prop("resourceType", name); 35156 composeAccountInner(element); 35157 } 35158 } 35159 35160 protected void composeAccountInner(Account element) throws IOException { 35161 composeDomainResourceElements(element); 35162 if (element.hasIdentifier()) { 35163 openArray("identifier"); 35164 for (Identifier e : element.getIdentifier()) 35165 composeIdentifier(null, e); 35166 closeArray(); 35167 } 35168 ; 35169 if (element.hasStatusElement()) { 35170 composeEnumerationCore("status", element.getStatusElement(), new Account.AccountStatusEnumFactory(), false); 35171 composeEnumerationExtras("status", element.getStatusElement(), new Account.AccountStatusEnumFactory(), false); 35172 } 35173 if (element.hasType()) { 35174 composeCodeableConcept("type", element.getType()); 35175 } 35176 if (element.hasNameElement()) { 35177 composeStringCore("name", element.getNameElement(), false); 35178 composeStringExtras("name", element.getNameElement(), false); 35179 } 35180 if (element.hasSubject()) { 35181 openArray("subject"); 35182 for (Reference e : element.getSubject()) 35183 composeReference(null, e); 35184 closeArray(); 35185 } 35186 ; 35187 if (element.hasServicePeriod()) { 35188 composePeriod("servicePeriod", element.getServicePeriod()); 35189 } 35190 if (element.hasCoverage()) { 35191 openArray("coverage"); 35192 for (Account.CoverageComponent e : element.getCoverage()) 35193 composeAccountCoverageComponent(null, e); 35194 closeArray(); 35195 } 35196 ; 35197 if (element.hasOwner()) { 35198 composeReference("owner", element.getOwner()); 35199 } 35200 if (element.hasDescriptionElement()) { 35201 composeStringCore("description", element.getDescriptionElement(), false); 35202 composeStringExtras("description", element.getDescriptionElement(), false); 35203 } 35204 if (element.hasGuarantor()) { 35205 openArray("guarantor"); 35206 for (Account.GuarantorComponent e : element.getGuarantor()) 35207 composeAccountGuarantorComponent(null, e); 35208 closeArray(); 35209 } 35210 ; 35211 if (element.hasPartOf()) { 35212 composeReference("partOf", element.getPartOf()); 35213 } 35214 } 35215 35216 protected void composeAccountCoverageComponent(String name, Account.CoverageComponent element) throws IOException { 35217 if (element != null) { 35218 open(name); 35219 composeAccountCoverageComponentInner(element); 35220 close(); 35221 } 35222 } 35223 35224 protected void composeAccountCoverageComponentInner(Account.CoverageComponent element) throws IOException { 35225 composeBackbone(element); 35226 if (element.hasCoverage()) { 35227 composeReference("coverage", element.getCoverage()); 35228 } 35229 if (element.hasPriorityElement()) { 35230 composePositiveIntCore("priority", element.getPriorityElement(), false); 35231 composePositiveIntExtras("priority", element.getPriorityElement(), false); 35232 } 35233 } 35234 35235 protected void composeAccountGuarantorComponent(String name, Account.GuarantorComponent element) throws IOException { 35236 if (element != null) { 35237 open(name); 35238 composeAccountGuarantorComponentInner(element); 35239 close(); 35240 } 35241 } 35242 35243 protected void composeAccountGuarantorComponentInner(Account.GuarantorComponent element) throws IOException { 35244 composeBackbone(element); 35245 if (element.hasParty()) { 35246 composeReference("party", element.getParty()); 35247 } 35248 if (element.hasOnHoldElement()) { 35249 composeBooleanCore("onHold", element.getOnHoldElement(), false); 35250 composeBooleanExtras("onHold", element.getOnHoldElement(), false); 35251 } 35252 if (element.hasPeriod()) { 35253 composePeriod("period", element.getPeriod()); 35254 } 35255 } 35256 35257 protected void composeActivityDefinition(String name, ActivityDefinition element) throws IOException { 35258 if (element != null) { 35259 prop("resourceType", name); 35260 composeActivityDefinitionInner(element); 35261 } 35262 } 35263 35264 protected void composeActivityDefinitionInner(ActivityDefinition element) throws IOException { 35265 composeDomainResourceElements(element); 35266 if (element.hasUrlElement()) { 35267 composeUriCore("url", element.getUrlElement(), false); 35268 composeUriExtras("url", element.getUrlElement(), false); 35269 } 35270 if (element.hasIdentifier()) { 35271 openArray("identifier"); 35272 for (Identifier e : element.getIdentifier()) 35273 composeIdentifier(null, e); 35274 closeArray(); 35275 } 35276 ; 35277 if (element.hasVersionElement()) { 35278 composeStringCore("version", element.getVersionElement(), false); 35279 composeStringExtras("version", element.getVersionElement(), false); 35280 } 35281 if (element.hasNameElement()) { 35282 composeStringCore("name", element.getNameElement(), false); 35283 composeStringExtras("name", element.getNameElement(), false); 35284 } 35285 if (element.hasTitleElement()) { 35286 composeStringCore("title", element.getTitleElement(), false); 35287 composeStringExtras("title", element.getTitleElement(), false); 35288 } 35289 if (element.hasSubtitleElement()) { 35290 composeStringCore("subtitle", element.getSubtitleElement(), false); 35291 composeStringExtras("subtitle", element.getSubtitleElement(), false); 35292 } 35293 if (element.hasStatusElement()) { 35294 composeEnumerationCore("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 35295 false); 35296 composeEnumerationExtras("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 35297 false); 35298 } 35299 if (element.hasExperimentalElement()) { 35300 composeBooleanCore("experimental", element.getExperimentalElement(), false); 35301 composeBooleanExtras("experimental", element.getExperimentalElement(), false); 35302 } 35303 if (element.hasSubject()) { 35304 composeType("subject", element.getSubject()); 35305 } 35306 if (element.hasDateElement()) { 35307 composeDateTimeCore("date", element.getDateElement(), false); 35308 composeDateTimeExtras("date", element.getDateElement(), false); 35309 } 35310 if (element.hasPublisherElement()) { 35311 composeStringCore("publisher", element.getPublisherElement(), false); 35312 composeStringExtras("publisher", element.getPublisherElement(), false); 35313 } 35314 if (element.hasContact()) { 35315 openArray("contact"); 35316 for (ContactDetail e : element.getContact()) 35317 composeContactDetail(null, e); 35318 closeArray(); 35319 } 35320 ; 35321 if (element.hasDescriptionElement()) { 35322 composeMarkdownCore("description", element.getDescriptionElement(), false); 35323 composeMarkdownExtras("description", element.getDescriptionElement(), false); 35324 } 35325 if (element.hasUseContext()) { 35326 openArray("useContext"); 35327 for (UsageContext e : element.getUseContext()) 35328 composeUsageContext(null, e); 35329 closeArray(); 35330 } 35331 ; 35332 if (element.hasJurisdiction()) { 35333 openArray("jurisdiction"); 35334 for (CodeableConcept e : element.getJurisdiction()) 35335 composeCodeableConcept(null, e); 35336 closeArray(); 35337 } 35338 ; 35339 if (element.hasPurposeElement()) { 35340 composeMarkdownCore("purpose", element.getPurposeElement(), false); 35341 composeMarkdownExtras("purpose", element.getPurposeElement(), false); 35342 } 35343 if (element.hasUsageElement()) { 35344 composeStringCore("usage", element.getUsageElement(), false); 35345 composeStringExtras("usage", element.getUsageElement(), false); 35346 } 35347 if (element.hasCopyrightElement()) { 35348 composeMarkdownCore("copyright", element.getCopyrightElement(), false); 35349 composeMarkdownExtras("copyright", element.getCopyrightElement(), false); 35350 } 35351 if (element.hasApprovalDateElement()) { 35352 composeDateCore("approvalDate", element.getApprovalDateElement(), false); 35353 composeDateExtras("approvalDate", element.getApprovalDateElement(), false); 35354 } 35355 if (element.hasLastReviewDateElement()) { 35356 composeDateCore("lastReviewDate", element.getLastReviewDateElement(), false); 35357 composeDateExtras("lastReviewDate", element.getLastReviewDateElement(), false); 35358 } 35359 if (element.hasEffectivePeriod()) { 35360 composePeriod("effectivePeriod", element.getEffectivePeriod()); 35361 } 35362 if (element.hasTopic()) { 35363 openArray("topic"); 35364 for (CodeableConcept e : element.getTopic()) 35365 composeCodeableConcept(null, e); 35366 closeArray(); 35367 } 35368 ; 35369 if (element.hasAuthor()) { 35370 openArray("author"); 35371 for (ContactDetail e : element.getAuthor()) 35372 composeContactDetail(null, e); 35373 closeArray(); 35374 } 35375 ; 35376 if (element.hasEditor()) { 35377 openArray("editor"); 35378 for (ContactDetail e : element.getEditor()) 35379 composeContactDetail(null, e); 35380 closeArray(); 35381 } 35382 ; 35383 if (element.hasReviewer()) { 35384 openArray("reviewer"); 35385 for (ContactDetail e : element.getReviewer()) 35386 composeContactDetail(null, e); 35387 closeArray(); 35388 } 35389 ; 35390 if (element.hasEndorser()) { 35391 openArray("endorser"); 35392 for (ContactDetail e : element.getEndorser()) 35393 composeContactDetail(null, e); 35394 closeArray(); 35395 } 35396 ; 35397 if (element.hasRelatedArtifact()) { 35398 openArray("relatedArtifact"); 35399 for (RelatedArtifact e : element.getRelatedArtifact()) 35400 composeRelatedArtifact(null, e); 35401 closeArray(); 35402 } 35403 ; 35404 if (element.hasLibrary()) { 35405 openArray("library"); 35406 for (CanonicalType e : element.getLibrary()) 35407 composeCanonicalCore(null, e, true); 35408 closeArray(); 35409 if (anyHasExtras(element.getLibrary())) { 35410 openArray("_library"); 35411 for (CanonicalType e : element.getLibrary()) 35412 composeCanonicalExtras(null, e, true); 35413 closeArray(); 35414 } 35415 } 35416 ; 35417 if (element.hasKindElement()) { 35418 composeEnumerationCore("kind", element.getKindElement(), 35419 new ActivityDefinition.ActivityDefinitionKindEnumFactory(), false); 35420 composeEnumerationExtras("kind", element.getKindElement(), 35421 new ActivityDefinition.ActivityDefinitionKindEnumFactory(), false); 35422 } 35423 if (element.hasProfileElement()) { 35424 composeCanonicalCore("profile", element.getProfileElement(), false); 35425 composeCanonicalExtras("profile", element.getProfileElement(), false); 35426 } 35427 if (element.hasCode()) { 35428 composeCodeableConcept("code", element.getCode()); 35429 } 35430 if (element.hasIntentElement()) { 35431 composeEnumerationCore("intent", element.getIntentElement(), new ActivityDefinition.RequestIntentEnumFactory(), 35432 false); 35433 composeEnumerationExtras("intent", element.getIntentElement(), new ActivityDefinition.RequestIntentEnumFactory(), 35434 false); 35435 } 35436 if (element.hasPriorityElement()) { 35437 composeEnumerationCore("priority", element.getPriorityElement(), 35438 new ActivityDefinition.RequestPriorityEnumFactory(), false); 35439 composeEnumerationExtras("priority", element.getPriorityElement(), 35440 new ActivityDefinition.RequestPriorityEnumFactory(), false); 35441 } 35442 if (element.hasDoNotPerformElement()) { 35443 composeBooleanCore("doNotPerform", element.getDoNotPerformElement(), false); 35444 composeBooleanExtras("doNotPerform", element.getDoNotPerformElement(), false); 35445 } 35446 if (element.hasTiming()) { 35447 composeType("timing", element.getTiming()); 35448 } 35449 if (element.hasLocation()) { 35450 composeReference("location", element.getLocation()); 35451 } 35452 if (element.hasParticipant()) { 35453 openArray("participant"); 35454 for (ActivityDefinition.ActivityDefinitionParticipantComponent e : element.getParticipant()) 35455 composeActivityDefinitionActivityDefinitionParticipantComponent(null, e); 35456 closeArray(); 35457 } 35458 ; 35459 if (element.hasProduct()) { 35460 composeType("product", element.getProduct()); 35461 } 35462 if (element.hasQuantity()) { 35463 composeQuantity("quantity", element.getQuantity()); 35464 } 35465 if (element.hasDosage()) { 35466 openArray("dosage"); 35467 for (Dosage e : element.getDosage()) 35468 composeDosage(null, e); 35469 closeArray(); 35470 } 35471 ; 35472 if (element.hasBodySite()) { 35473 openArray("bodySite"); 35474 for (CodeableConcept e : element.getBodySite()) 35475 composeCodeableConcept(null, e); 35476 closeArray(); 35477 } 35478 ; 35479 if (element.hasSpecimenRequirement()) { 35480 openArray("specimenRequirement"); 35481 for (Reference e : element.getSpecimenRequirement()) 35482 composeReference(null, e); 35483 closeArray(); 35484 } 35485 ; 35486 if (element.hasObservationRequirement()) { 35487 openArray("observationRequirement"); 35488 for (Reference e : element.getObservationRequirement()) 35489 composeReference(null, e); 35490 closeArray(); 35491 } 35492 ; 35493 if (element.hasObservationResultRequirement()) { 35494 openArray("observationResultRequirement"); 35495 for (Reference e : element.getObservationResultRequirement()) 35496 composeReference(null, e); 35497 closeArray(); 35498 } 35499 ; 35500 if (element.hasTransformElement()) { 35501 composeCanonicalCore("transform", element.getTransformElement(), false); 35502 composeCanonicalExtras("transform", element.getTransformElement(), false); 35503 } 35504 if (element.hasDynamicValue()) { 35505 openArray("dynamicValue"); 35506 for (ActivityDefinition.ActivityDefinitionDynamicValueComponent e : element.getDynamicValue()) 35507 composeActivityDefinitionActivityDefinitionDynamicValueComponent(null, e); 35508 closeArray(); 35509 } 35510 ; 35511 } 35512 35513 protected void composeActivityDefinitionActivityDefinitionParticipantComponent(String name, 35514 ActivityDefinition.ActivityDefinitionParticipantComponent element) throws IOException { 35515 if (element != null) { 35516 open(name); 35517 composeActivityDefinitionActivityDefinitionParticipantComponentInner(element); 35518 close(); 35519 } 35520 } 35521 35522 protected void composeActivityDefinitionActivityDefinitionParticipantComponentInner( 35523 ActivityDefinition.ActivityDefinitionParticipantComponent element) throws IOException { 35524 composeBackbone(element); 35525 if (element.hasTypeElement()) { 35526 composeEnumerationCore("type", element.getTypeElement(), 35527 new ActivityDefinition.ActivityParticipantTypeEnumFactory(), false); 35528 composeEnumerationExtras("type", element.getTypeElement(), 35529 new ActivityDefinition.ActivityParticipantTypeEnumFactory(), false); 35530 } 35531 if (element.hasRole()) { 35532 composeCodeableConcept("role", element.getRole()); 35533 } 35534 } 35535 35536 protected void composeActivityDefinitionActivityDefinitionDynamicValueComponent(String name, 35537 ActivityDefinition.ActivityDefinitionDynamicValueComponent element) throws IOException { 35538 if (element != null) { 35539 open(name); 35540 composeActivityDefinitionActivityDefinitionDynamicValueComponentInner(element); 35541 close(); 35542 } 35543 } 35544 35545 protected void composeActivityDefinitionActivityDefinitionDynamicValueComponentInner( 35546 ActivityDefinition.ActivityDefinitionDynamicValueComponent element) throws IOException { 35547 composeBackbone(element); 35548 if (element.hasPathElement()) { 35549 composeStringCore("path", element.getPathElement(), false); 35550 composeStringExtras("path", element.getPathElement(), false); 35551 } 35552 if (element.hasExpression()) { 35553 composeExpression("expression", element.getExpression()); 35554 } 35555 } 35556 35557 protected void composeAdverseEvent(String name, AdverseEvent element) throws IOException { 35558 if (element != null) { 35559 prop("resourceType", name); 35560 composeAdverseEventInner(element); 35561 } 35562 } 35563 35564 protected void composeAdverseEventInner(AdverseEvent element) throws IOException { 35565 composeDomainResourceElements(element); 35566 if (element.hasIdentifier()) { 35567 composeIdentifier("identifier", element.getIdentifier()); 35568 } 35569 if (element.hasActualityElement()) { 35570 composeEnumerationCore("actuality", element.getActualityElement(), 35571 new AdverseEvent.AdverseEventActualityEnumFactory(), false); 35572 composeEnumerationExtras("actuality", element.getActualityElement(), 35573 new AdverseEvent.AdverseEventActualityEnumFactory(), false); 35574 } 35575 if (element.hasCategory()) { 35576 openArray("category"); 35577 for (CodeableConcept e : element.getCategory()) 35578 composeCodeableConcept(null, e); 35579 closeArray(); 35580 } 35581 ; 35582 if (element.hasEvent()) { 35583 composeCodeableConcept("event", element.getEvent()); 35584 } 35585 if (element.hasSubject()) { 35586 composeReference("subject", element.getSubject()); 35587 } 35588 if (element.hasEncounter()) { 35589 composeReference("encounter", element.getEncounter()); 35590 } 35591 if (element.hasDateElement()) { 35592 composeDateTimeCore("date", element.getDateElement(), false); 35593 composeDateTimeExtras("date", element.getDateElement(), false); 35594 } 35595 if (element.hasDetectedElement()) { 35596 composeDateTimeCore("detected", element.getDetectedElement(), false); 35597 composeDateTimeExtras("detected", element.getDetectedElement(), false); 35598 } 35599 if (element.hasRecordedDateElement()) { 35600 composeDateTimeCore("recordedDate", element.getRecordedDateElement(), false); 35601 composeDateTimeExtras("recordedDate", element.getRecordedDateElement(), false); 35602 } 35603 if (element.hasResultingCondition()) { 35604 openArray("resultingCondition"); 35605 for (Reference e : element.getResultingCondition()) 35606 composeReference(null, e); 35607 closeArray(); 35608 } 35609 ; 35610 if (element.hasLocation()) { 35611 composeReference("location", element.getLocation()); 35612 } 35613 if (element.hasSeriousness()) { 35614 composeCodeableConcept("seriousness", element.getSeriousness()); 35615 } 35616 if (element.hasSeverity()) { 35617 composeCodeableConcept("severity", element.getSeverity()); 35618 } 35619 if (element.hasOutcome()) { 35620 composeCodeableConcept("outcome", element.getOutcome()); 35621 } 35622 if (element.hasRecorder()) { 35623 composeReference("recorder", element.getRecorder()); 35624 } 35625 if (element.hasContributor()) { 35626 openArray("contributor"); 35627 for (Reference e : element.getContributor()) 35628 composeReference(null, e); 35629 closeArray(); 35630 } 35631 ; 35632 if (element.hasSuspectEntity()) { 35633 openArray("suspectEntity"); 35634 for (AdverseEvent.AdverseEventSuspectEntityComponent e : element.getSuspectEntity()) 35635 composeAdverseEventAdverseEventSuspectEntityComponent(null, e); 35636 closeArray(); 35637 } 35638 ; 35639 if (element.hasSubjectMedicalHistory()) { 35640 openArray("subjectMedicalHistory"); 35641 for (Reference e : element.getSubjectMedicalHistory()) 35642 composeReference(null, e); 35643 closeArray(); 35644 } 35645 ; 35646 if (element.hasReferenceDocument()) { 35647 openArray("referenceDocument"); 35648 for (Reference e : element.getReferenceDocument()) 35649 composeReference(null, e); 35650 closeArray(); 35651 } 35652 ; 35653 if (element.hasStudy()) { 35654 openArray("study"); 35655 for (Reference e : element.getStudy()) 35656 composeReference(null, e); 35657 closeArray(); 35658 } 35659 ; 35660 } 35661 35662 protected void composeAdverseEventAdverseEventSuspectEntityComponent(String name, 35663 AdverseEvent.AdverseEventSuspectEntityComponent element) throws IOException { 35664 if (element != null) { 35665 open(name); 35666 composeAdverseEventAdverseEventSuspectEntityComponentInner(element); 35667 close(); 35668 } 35669 } 35670 35671 protected void composeAdverseEventAdverseEventSuspectEntityComponentInner( 35672 AdverseEvent.AdverseEventSuspectEntityComponent element) throws IOException { 35673 composeBackbone(element); 35674 if (element.hasInstance()) { 35675 composeReference("instance", element.getInstance()); 35676 } 35677 if (element.hasCausality()) { 35678 openArray("causality"); 35679 for (AdverseEvent.AdverseEventSuspectEntityCausalityComponent e : element.getCausality()) 35680 composeAdverseEventAdverseEventSuspectEntityCausalityComponent(null, e); 35681 closeArray(); 35682 } 35683 ; 35684 } 35685 35686 protected void composeAdverseEventAdverseEventSuspectEntityCausalityComponent(String name, 35687 AdverseEvent.AdverseEventSuspectEntityCausalityComponent element) throws IOException { 35688 if (element != null) { 35689 open(name); 35690 composeAdverseEventAdverseEventSuspectEntityCausalityComponentInner(element); 35691 close(); 35692 } 35693 } 35694 35695 protected void composeAdverseEventAdverseEventSuspectEntityCausalityComponentInner( 35696 AdverseEvent.AdverseEventSuspectEntityCausalityComponent element) throws IOException { 35697 composeBackbone(element); 35698 if (element.hasAssessment()) { 35699 composeCodeableConcept("assessment", element.getAssessment()); 35700 } 35701 if (element.hasProductRelatednessElement()) { 35702 composeStringCore("productRelatedness", element.getProductRelatednessElement(), false); 35703 composeStringExtras("productRelatedness", element.getProductRelatednessElement(), false); 35704 } 35705 if (element.hasAuthor()) { 35706 composeReference("author", element.getAuthor()); 35707 } 35708 if (element.hasMethod()) { 35709 composeCodeableConcept("method", element.getMethod()); 35710 } 35711 } 35712 35713 protected void composeAllergyIntolerance(String name, AllergyIntolerance element) throws IOException { 35714 if (element != null) { 35715 prop("resourceType", name); 35716 composeAllergyIntoleranceInner(element); 35717 } 35718 } 35719 35720 protected void composeAllergyIntoleranceInner(AllergyIntolerance element) throws IOException { 35721 composeDomainResourceElements(element); 35722 if (element.hasIdentifier()) { 35723 openArray("identifier"); 35724 for (Identifier e : element.getIdentifier()) 35725 composeIdentifier(null, e); 35726 closeArray(); 35727 } 35728 ; 35729 if (element.hasClinicalStatus()) { 35730 composeCodeableConcept("clinicalStatus", element.getClinicalStatus()); 35731 } 35732 if (element.hasVerificationStatus()) { 35733 composeCodeableConcept("verificationStatus", element.getVerificationStatus()); 35734 } 35735 if (element.hasTypeElement()) { 35736 composeEnumerationCore("type", element.getTypeElement(), 35737 new AllergyIntolerance.AllergyIntoleranceTypeEnumFactory(), false); 35738 composeEnumerationExtras("type", element.getTypeElement(), 35739 new AllergyIntolerance.AllergyIntoleranceTypeEnumFactory(), false); 35740 } 35741 if (element.hasCategory()) { 35742 openArray("category"); 35743 for (Enumeration<AllergyIntolerance.AllergyIntoleranceCategory> e : element.getCategory()) 35744 composeEnumerationCore(null, e, new AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory(), true); 35745 closeArray(); 35746 if (anyHasExtras(element.getCategory())) { 35747 openArray("_category"); 35748 for (Enumeration<AllergyIntolerance.AllergyIntoleranceCategory> e : element.getCategory()) 35749 composeEnumerationExtras(null, e, new AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory(), true); 35750 closeArray(); 35751 } 35752 } 35753 ; 35754 if (element.hasCriticalityElement()) { 35755 composeEnumerationCore("criticality", element.getCriticalityElement(), 35756 new AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory(), false); 35757 composeEnumerationExtras("criticality", element.getCriticalityElement(), 35758 new AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory(), false); 35759 } 35760 if (element.hasCode()) { 35761 composeCodeableConcept("code", element.getCode()); 35762 } 35763 if (element.hasPatient()) { 35764 composeReference("patient", element.getPatient()); 35765 } 35766 if (element.hasEncounter()) { 35767 composeReference("encounter", element.getEncounter()); 35768 } 35769 if (element.hasOnset()) { 35770 composeType("onset", element.getOnset()); 35771 } 35772 if (element.hasRecordedDateElement()) { 35773 composeDateTimeCore("recordedDate", element.getRecordedDateElement(), false); 35774 composeDateTimeExtras("recordedDate", element.getRecordedDateElement(), false); 35775 } 35776 if (element.hasRecorder()) { 35777 composeReference("recorder", element.getRecorder()); 35778 } 35779 if (element.hasAsserter()) { 35780 composeReference("asserter", element.getAsserter()); 35781 } 35782 if (element.hasLastOccurrenceElement()) { 35783 composeDateTimeCore("lastOccurrence", element.getLastOccurrenceElement(), false); 35784 composeDateTimeExtras("lastOccurrence", element.getLastOccurrenceElement(), false); 35785 } 35786 if (element.hasNote()) { 35787 openArray("note"); 35788 for (Annotation e : element.getNote()) 35789 composeAnnotation(null, e); 35790 closeArray(); 35791 } 35792 ; 35793 if (element.hasReaction()) { 35794 openArray("reaction"); 35795 for (AllergyIntolerance.AllergyIntoleranceReactionComponent e : element.getReaction()) 35796 composeAllergyIntoleranceAllergyIntoleranceReactionComponent(null, e); 35797 closeArray(); 35798 } 35799 ; 35800 } 35801 35802 protected void composeAllergyIntoleranceAllergyIntoleranceReactionComponent(String name, 35803 AllergyIntolerance.AllergyIntoleranceReactionComponent element) throws IOException { 35804 if (element != null) { 35805 open(name); 35806 composeAllergyIntoleranceAllergyIntoleranceReactionComponentInner(element); 35807 close(); 35808 } 35809 } 35810 35811 protected void composeAllergyIntoleranceAllergyIntoleranceReactionComponentInner( 35812 AllergyIntolerance.AllergyIntoleranceReactionComponent element) throws IOException { 35813 composeBackbone(element); 35814 if (element.hasSubstance()) { 35815 composeCodeableConcept("substance", element.getSubstance()); 35816 } 35817 if (element.hasManifestation()) { 35818 openArray("manifestation"); 35819 for (CodeableConcept e : element.getManifestation()) 35820 composeCodeableConcept(null, e); 35821 closeArray(); 35822 } 35823 ; 35824 if (element.hasDescriptionElement()) { 35825 composeStringCore("description", element.getDescriptionElement(), false); 35826 composeStringExtras("description", element.getDescriptionElement(), false); 35827 } 35828 if (element.hasOnsetElement()) { 35829 composeDateTimeCore("onset", element.getOnsetElement(), false); 35830 composeDateTimeExtras("onset", element.getOnsetElement(), false); 35831 } 35832 if (element.hasSeverityElement()) { 35833 composeEnumerationCore("severity", element.getSeverityElement(), 35834 new AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory(), false); 35835 composeEnumerationExtras("severity", element.getSeverityElement(), 35836 new AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory(), false); 35837 } 35838 if (element.hasExposureRoute()) { 35839 composeCodeableConcept("exposureRoute", element.getExposureRoute()); 35840 } 35841 if (element.hasNote()) { 35842 openArray("note"); 35843 for (Annotation e : element.getNote()) 35844 composeAnnotation(null, e); 35845 closeArray(); 35846 } 35847 ; 35848 } 35849 35850 protected void composeAppointment(String name, Appointment element) throws IOException { 35851 if (element != null) { 35852 prop("resourceType", name); 35853 composeAppointmentInner(element); 35854 } 35855 } 35856 35857 protected void composeAppointmentInner(Appointment element) throws IOException { 35858 composeDomainResourceElements(element); 35859 if (element.hasIdentifier()) { 35860 openArray("identifier"); 35861 for (Identifier e : element.getIdentifier()) 35862 composeIdentifier(null, e); 35863 closeArray(); 35864 } 35865 ; 35866 if (element.hasStatusElement()) { 35867 composeEnumerationCore("status", element.getStatusElement(), new Appointment.AppointmentStatusEnumFactory(), 35868 false); 35869 composeEnumerationExtras("status", element.getStatusElement(), new Appointment.AppointmentStatusEnumFactory(), 35870 false); 35871 } 35872 if (element.hasCancelationReason()) { 35873 composeCodeableConcept("cancelationReason", element.getCancelationReason()); 35874 } 35875 if (element.hasServiceCategory()) { 35876 openArray("serviceCategory"); 35877 for (CodeableConcept e : element.getServiceCategory()) 35878 composeCodeableConcept(null, e); 35879 closeArray(); 35880 } 35881 ; 35882 if (element.hasServiceType()) { 35883 openArray("serviceType"); 35884 for (CodeableConcept e : element.getServiceType()) 35885 composeCodeableConcept(null, e); 35886 closeArray(); 35887 } 35888 ; 35889 if (element.hasSpecialty()) { 35890 openArray("specialty"); 35891 for (CodeableConcept e : element.getSpecialty()) 35892 composeCodeableConcept(null, e); 35893 closeArray(); 35894 } 35895 ; 35896 if (element.hasAppointmentType()) { 35897 composeCodeableConcept("appointmentType", element.getAppointmentType()); 35898 } 35899 if (element.hasReasonCode()) { 35900 openArray("reasonCode"); 35901 for (CodeableConcept e : element.getReasonCode()) 35902 composeCodeableConcept(null, e); 35903 closeArray(); 35904 } 35905 ; 35906 if (element.hasReasonReference()) { 35907 openArray("reasonReference"); 35908 for (Reference e : element.getReasonReference()) 35909 composeReference(null, e); 35910 closeArray(); 35911 } 35912 ; 35913 if (element.hasPriorityElement()) { 35914 composeUnsignedIntCore("priority", element.getPriorityElement(), false); 35915 composeUnsignedIntExtras("priority", element.getPriorityElement(), false); 35916 } 35917 if (element.hasDescriptionElement()) { 35918 composeStringCore("description", element.getDescriptionElement(), false); 35919 composeStringExtras("description", element.getDescriptionElement(), false); 35920 } 35921 if (element.hasSupportingInformation()) { 35922 openArray("supportingInformation"); 35923 for (Reference e : element.getSupportingInformation()) 35924 composeReference(null, e); 35925 closeArray(); 35926 } 35927 ; 35928 if (element.hasStartElement()) { 35929 composeInstantCore("start", element.getStartElement(), false); 35930 composeInstantExtras("start", element.getStartElement(), false); 35931 } 35932 if (element.hasEndElement()) { 35933 composeInstantCore("end", element.getEndElement(), false); 35934 composeInstantExtras("end", element.getEndElement(), false); 35935 } 35936 if (element.hasMinutesDurationElement()) { 35937 composePositiveIntCore("minutesDuration", element.getMinutesDurationElement(), false); 35938 composePositiveIntExtras("minutesDuration", element.getMinutesDurationElement(), false); 35939 } 35940 if (element.hasSlot()) { 35941 openArray("slot"); 35942 for (Reference e : element.getSlot()) 35943 composeReference(null, e); 35944 closeArray(); 35945 } 35946 ; 35947 if (element.hasCreatedElement()) { 35948 composeDateTimeCore("created", element.getCreatedElement(), false); 35949 composeDateTimeExtras("created", element.getCreatedElement(), false); 35950 } 35951 if (element.hasCommentElement()) { 35952 composeStringCore("comment", element.getCommentElement(), false); 35953 composeStringExtras("comment", element.getCommentElement(), false); 35954 } 35955 if (element.hasPatientInstructionElement()) { 35956 composeStringCore("patientInstruction", element.getPatientInstructionElement(), false); 35957 composeStringExtras("patientInstruction", element.getPatientInstructionElement(), false); 35958 } 35959 if (element.hasBasedOn()) { 35960 openArray("basedOn"); 35961 for (Reference e : element.getBasedOn()) 35962 composeReference(null, e); 35963 closeArray(); 35964 } 35965 ; 35966 if (element.hasParticipant()) { 35967 openArray("participant"); 35968 for (Appointment.AppointmentParticipantComponent e : element.getParticipant()) 35969 composeAppointmentAppointmentParticipantComponent(null, e); 35970 closeArray(); 35971 } 35972 ; 35973 if (element.hasRequestedPeriod()) { 35974 openArray("requestedPeriod"); 35975 for (Period e : element.getRequestedPeriod()) 35976 composePeriod(null, e); 35977 closeArray(); 35978 } 35979 ; 35980 } 35981 35982 protected void composeAppointmentAppointmentParticipantComponent(String name, 35983 Appointment.AppointmentParticipantComponent element) throws IOException { 35984 if (element != null) { 35985 open(name); 35986 composeAppointmentAppointmentParticipantComponentInner(element); 35987 close(); 35988 } 35989 } 35990 35991 protected void composeAppointmentAppointmentParticipantComponentInner( 35992 Appointment.AppointmentParticipantComponent element) throws IOException { 35993 composeBackbone(element); 35994 if (element.hasType()) { 35995 openArray("type"); 35996 for (CodeableConcept e : element.getType()) 35997 composeCodeableConcept(null, e); 35998 closeArray(); 35999 } 36000 ; 36001 if (element.hasActor()) { 36002 composeReference("actor", element.getActor()); 36003 } 36004 if (element.hasRequiredElement()) { 36005 composeEnumerationCore("required", element.getRequiredElement(), new Appointment.ParticipantRequiredEnumFactory(), 36006 false); 36007 composeEnumerationExtras("required", element.getRequiredElement(), 36008 new Appointment.ParticipantRequiredEnumFactory(), false); 36009 } 36010 if (element.hasStatusElement()) { 36011 composeEnumerationCore("status", element.getStatusElement(), new Appointment.ParticipationStatusEnumFactory(), 36012 false); 36013 composeEnumerationExtras("status", element.getStatusElement(), new Appointment.ParticipationStatusEnumFactory(), 36014 false); 36015 } 36016 if (element.hasPeriod()) { 36017 composePeriod("period", element.getPeriod()); 36018 } 36019 } 36020 36021 protected void composeAppointmentResponse(String name, AppointmentResponse element) throws IOException { 36022 if (element != null) { 36023 prop("resourceType", name); 36024 composeAppointmentResponseInner(element); 36025 } 36026 } 36027 36028 protected void composeAppointmentResponseInner(AppointmentResponse element) throws IOException { 36029 composeDomainResourceElements(element); 36030 if (element.hasIdentifier()) { 36031 openArray("identifier"); 36032 for (Identifier e : element.getIdentifier()) 36033 composeIdentifier(null, e); 36034 closeArray(); 36035 } 36036 ; 36037 if (element.hasAppointment()) { 36038 composeReference("appointment", element.getAppointment()); 36039 } 36040 if (element.hasStartElement()) { 36041 composeInstantCore("start", element.getStartElement(), false); 36042 composeInstantExtras("start", element.getStartElement(), false); 36043 } 36044 if (element.hasEndElement()) { 36045 composeInstantCore("end", element.getEndElement(), false); 36046 composeInstantExtras("end", element.getEndElement(), false); 36047 } 36048 if (element.hasParticipantType()) { 36049 openArray("participantType"); 36050 for (CodeableConcept e : element.getParticipantType()) 36051 composeCodeableConcept(null, e); 36052 closeArray(); 36053 } 36054 ; 36055 if (element.hasActor()) { 36056 composeReference("actor", element.getActor()); 36057 } 36058 if (element.hasParticipantStatusElement()) { 36059 composeEnumerationCore("participantStatus", element.getParticipantStatusElement(), 36060 new AppointmentResponse.ParticipantStatusEnumFactory(), false); 36061 composeEnumerationExtras("participantStatus", element.getParticipantStatusElement(), 36062 new AppointmentResponse.ParticipantStatusEnumFactory(), false); 36063 } 36064 if (element.hasCommentElement()) { 36065 composeStringCore("comment", element.getCommentElement(), false); 36066 composeStringExtras("comment", element.getCommentElement(), false); 36067 } 36068 } 36069 36070 protected void composeAuditEvent(String name, AuditEvent element) throws IOException { 36071 if (element != null) { 36072 prop("resourceType", name); 36073 composeAuditEventInner(element); 36074 } 36075 } 36076 36077 protected void composeAuditEventInner(AuditEvent element) throws IOException { 36078 composeDomainResourceElements(element); 36079 if (element.hasType()) { 36080 composeCoding("type", element.getType()); 36081 } 36082 if (element.hasSubtype()) { 36083 openArray("subtype"); 36084 for (Coding e : element.getSubtype()) 36085 composeCoding(null, e); 36086 closeArray(); 36087 } 36088 ; 36089 if (element.hasActionElement()) { 36090 composeEnumerationCore("action", element.getActionElement(), new AuditEvent.AuditEventActionEnumFactory(), false); 36091 composeEnumerationExtras("action", element.getActionElement(), new AuditEvent.AuditEventActionEnumFactory(), 36092 false); 36093 } 36094 if (element.hasPeriod()) { 36095 composePeriod("period", element.getPeriod()); 36096 } 36097 if (element.hasRecordedElement()) { 36098 composeInstantCore("recorded", element.getRecordedElement(), false); 36099 composeInstantExtras("recorded", element.getRecordedElement(), false); 36100 } 36101 if (element.hasOutcomeElement()) { 36102 composeEnumerationCore("outcome", element.getOutcomeElement(), new AuditEvent.AuditEventOutcomeEnumFactory(), 36103 false); 36104 composeEnumerationExtras("outcome", element.getOutcomeElement(), new AuditEvent.AuditEventOutcomeEnumFactory(), 36105 false); 36106 } 36107 if (element.hasOutcomeDescElement()) { 36108 composeStringCore("outcomeDesc", element.getOutcomeDescElement(), false); 36109 composeStringExtras("outcomeDesc", element.getOutcomeDescElement(), false); 36110 } 36111 if (element.hasPurposeOfEvent()) { 36112 openArray("purposeOfEvent"); 36113 for (CodeableConcept e : element.getPurposeOfEvent()) 36114 composeCodeableConcept(null, e); 36115 closeArray(); 36116 } 36117 ; 36118 if (element.hasAgent()) { 36119 openArray("agent"); 36120 for (AuditEvent.AuditEventAgentComponent e : element.getAgent()) 36121 composeAuditEventAuditEventAgentComponent(null, e); 36122 closeArray(); 36123 } 36124 ; 36125 if (element.hasSource()) { 36126 composeAuditEventAuditEventSourceComponent("source", element.getSource()); 36127 } 36128 if (element.hasEntity()) { 36129 openArray("entity"); 36130 for (AuditEvent.AuditEventEntityComponent e : element.getEntity()) 36131 composeAuditEventAuditEventEntityComponent(null, e); 36132 closeArray(); 36133 } 36134 ; 36135 } 36136 36137 protected void composeAuditEventAuditEventAgentComponent(String name, AuditEvent.AuditEventAgentComponent element) 36138 throws IOException { 36139 if (element != null) { 36140 open(name); 36141 composeAuditEventAuditEventAgentComponentInner(element); 36142 close(); 36143 } 36144 } 36145 36146 protected void composeAuditEventAuditEventAgentComponentInner(AuditEvent.AuditEventAgentComponent element) 36147 throws IOException { 36148 composeBackbone(element); 36149 if (element.hasType()) { 36150 composeCodeableConcept("type", element.getType()); 36151 } 36152 if (element.hasRole()) { 36153 openArray("role"); 36154 for (CodeableConcept e : element.getRole()) 36155 composeCodeableConcept(null, e); 36156 closeArray(); 36157 } 36158 ; 36159 if (element.hasWho()) { 36160 composeReference("who", element.getWho()); 36161 } 36162 if (element.hasAltIdElement()) { 36163 composeStringCore("altId", element.getAltIdElement(), false); 36164 composeStringExtras("altId", element.getAltIdElement(), false); 36165 } 36166 if (element.hasNameElement()) { 36167 composeStringCore("name", element.getNameElement(), false); 36168 composeStringExtras("name", element.getNameElement(), false); 36169 } 36170 if (element.hasRequestorElement()) { 36171 composeBooleanCore("requestor", element.getRequestorElement(), false); 36172 composeBooleanExtras("requestor", element.getRequestorElement(), false); 36173 } 36174 if (element.hasLocation()) { 36175 composeReference("location", element.getLocation()); 36176 } 36177 if (element.hasPolicy()) { 36178 openArray("policy"); 36179 for (UriType e : element.getPolicy()) 36180 composeUriCore(null, e, true); 36181 closeArray(); 36182 if (anyHasExtras(element.getPolicy())) { 36183 openArray("_policy"); 36184 for (UriType e : element.getPolicy()) 36185 composeUriExtras(null, e, true); 36186 closeArray(); 36187 } 36188 } 36189 ; 36190 if (element.hasMedia()) { 36191 composeCoding("media", element.getMedia()); 36192 } 36193 if (element.hasNetwork()) { 36194 composeAuditEventAuditEventAgentNetworkComponent("network", element.getNetwork()); 36195 } 36196 if (element.hasPurposeOfUse()) { 36197 openArray("purposeOfUse"); 36198 for (CodeableConcept e : element.getPurposeOfUse()) 36199 composeCodeableConcept(null, e); 36200 closeArray(); 36201 } 36202 ; 36203 } 36204 36205 protected void composeAuditEventAuditEventAgentNetworkComponent(String name, 36206 AuditEvent.AuditEventAgentNetworkComponent element) throws IOException { 36207 if (element != null) { 36208 open(name); 36209 composeAuditEventAuditEventAgentNetworkComponentInner(element); 36210 close(); 36211 } 36212 } 36213 36214 protected void composeAuditEventAuditEventAgentNetworkComponentInner( 36215 AuditEvent.AuditEventAgentNetworkComponent element) throws IOException { 36216 composeBackbone(element); 36217 if (element.hasAddressElement()) { 36218 composeStringCore("address", element.getAddressElement(), false); 36219 composeStringExtras("address", element.getAddressElement(), false); 36220 } 36221 if (element.hasTypeElement()) { 36222 composeEnumerationCore("type", element.getTypeElement(), new AuditEvent.AuditEventAgentNetworkTypeEnumFactory(), 36223 false); 36224 composeEnumerationExtras("type", element.getTypeElement(), new AuditEvent.AuditEventAgentNetworkTypeEnumFactory(), 36225 false); 36226 } 36227 } 36228 36229 protected void composeAuditEventAuditEventSourceComponent(String name, AuditEvent.AuditEventSourceComponent element) 36230 throws IOException { 36231 if (element != null) { 36232 open(name); 36233 composeAuditEventAuditEventSourceComponentInner(element); 36234 close(); 36235 } 36236 } 36237 36238 protected void composeAuditEventAuditEventSourceComponentInner(AuditEvent.AuditEventSourceComponent element) 36239 throws IOException { 36240 composeBackbone(element); 36241 if (element.hasSiteElement()) { 36242 composeStringCore("site", element.getSiteElement(), false); 36243 composeStringExtras("site", element.getSiteElement(), false); 36244 } 36245 if (element.hasObserver()) { 36246 composeReference("observer", element.getObserver()); 36247 } 36248 if (element.hasType()) { 36249 openArray("type"); 36250 for (Coding e : element.getType()) 36251 composeCoding(null, e); 36252 closeArray(); 36253 } 36254 ; 36255 } 36256 36257 protected void composeAuditEventAuditEventEntityComponent(String name, AuditEvent.AuditEventEntityComponent element) 36258 throws IOException { 36259 if (element != null) { 36260 open(name); 36261 composeAuditEventAuditEventEntityComponentInner(element); 36262 close(); 36263 } 36264 } 36265 36266 protected void composeAuditEventAuditEventEntityComponentInner(AuditEvent.AuditEventEntityComponent element) 36267 throws IOException { 36268 composeBackbone(element); 36269 if (element.hasWhat()) { 36270 composeReference("what", element.getWhat()); 36271 } 36272 if (element.hasType()) { 36273 composeCoding("type", element.getType()); 36274 } 36275 if (element.hasRole()) { 36276 composeCoding("role", element.getRole()); 36277 } 36278 if (element.hasLifecycle()) { 36279 composeCoding("lifecycle", element.getLifecycle()); 36280 } 36281 if (element.hasSecurityLabel()) { 36282 openArray("securityLabel"); 36283 for (Coding e : element.getSecurityLabel()) 36284 composeCoding(null, e); 36285 closeArray(); 36286 } 36287 ; 36288 if (element.hasNameElement()) { 36289 composeStringCore("name", element.getNameElement(), false); 36290 composeStringExtras("name", element.getNameElement(), false); 36291 } 36292 if (element.hasDescriptionElement()) { 36293 composeStringCore("description", element.getDescriptionElement(), false); 36294 composeStringExtras("description", element.getDescriptionElement(), false); 36295 } 36296 if (element.hasQueryElement()) { 36297 composeBase64BinaryCore("query", element.getQueryElement(), false); 36298 composeBase64BinaryExtras("query", element.getQueryElement(), false); 36299 } 36300 if (element.hasDetail()) { 36301 openArray("detail"); 36302 for (AuditEvent.AuditEventEntityDetailComponent e : element.getDetail()) 36303 composeAuditEventAuditEventEntityDetailComponent(null, e); 36304 closeArray(); 36305 } 36306 ; 36307 } 36308 36309 protected void composeAuditEventAuditEventEntityDetailComponent(String name, 36310 AuditEvent.AuditEventEntityDetailComponent element) throws IOException { 36311 if (element != null) { 36312 open(name); 36313 composeAuditEventAuditEventEntityDetailComponentInner(element); 36314 close(); 36315 } 36316 } 36317 36318 protected void composeAuditEventAuditEventEntityDetailComponentInner( 36319 AuditEvent.AuditEventEntityDetailComponent element) throws IOException { 36320 composeBackbone(element); 36321 if (element.hasTypeElement()) { 36322 composeStringCore("type", element.getTypeElement(), false); 36323 composeStringExtras("type", element.getTypeElement(), false); 36324 } 36325 if (element.hasValue()) { 36326 composeType("value", element.getValue()); 36327 } 36328 } 36329 36330 protected void composeBasic(String name, Basic element) throws IOException { 36331 if (element != null) { 36332 prop("resourceType", name); 36333 composeBasicInner(element); 36334 } 36335 } 36336 36337 protected void composeBasicInner(Basic element) throws IOException { 36338 composeDomainResourceElements(element); 36339 if (element.hasIdentifier()) { 36340 openArray("identifier"); 36341 for (Identifier e : element.getIdentifier()) 36342 composeIdentifier(null, e); 36343 closeArray(); 36344 } 36345 ; 36346 if (element.hasCode()) { 36347 composeCodeableConcept("code", element.getCode()); 36348 } 36349 if (element.hasSubject()) { 36350 composeReference("subject", element.getSubject()); 36351 } 36352 if (element.hasCreatedElement()) { 36353 composeDateCore("created", element.getCreatedElement(), false); 36354 composeDateExtras("created", element.getCreatedElement(), false); 36355 } 36356 if (element.hasAuthor()) { 36357 composeReference("author", element.getAuthor()); 36358 } 36359 } 36360 36361 protected void composeBinary(String name, Binary element) throws IOException { 36362 if (element != null) { 36363 prop("resourceType", name); 36364 composeBinaryInner(element); 36365 } 36366 } 36367 36368 protected void composeBinaryInner(Binary element) throws IOException { 36369 composeResourceElements(element); 36370 if (element.hasContentTypeElement()) { 36371 composeCodeCore("contentType", element.getContentTypeElement(), false); 36372 composeCodeExtras("contentType", element.getContentTypeElement(), false); 36373 } 36374 if (element.hasSecurityContext()) { 36375 composeReference("securityContext", element.getSecurityContext()); 36376 } 36377 if (element.hasDataElement()) { 36378 composeBase64BinaryCore("data", element.getDataElement(), false); 36379 composeBase64BinaryExtras("data", element.getDataElement(), false); 36380 } 36381 } 36382 36383 protected void composeBiologicallyDerivedProduct(String name, BiologicallyDerivedProduct element) throws IOException { 36384 if (element != null) { 36385 prop("resourceType", name); 36386 composeBiologicallyDerivedProductInner(element); 36387 } 36388 } 36389 36390 protected void composeBiologicallyDerivedProductInner(BiologicallyDerivedProduct element) throws IOException { 36391 composeDomainResourceElements(element); 36392 if (element.hasIdentifier()) { 36393 openArray("identifier"); 36394 for (Identifier e : element.getIdentifier()) 36395 composeIdentifier(null, e); 36396 closeArray(); 36397 } 36398 ; 36399 if (element.hasProductCategoryElement()) { 36400 composeEnumerationCore("productCategory", element.getProductCategoryElement(), 36401 new BiologicallyDerivedProduct.BiologicallyDerivedProductCategoryEnumFactory(), false); 36402 composeEnumerationExtras("productCategory", element.getProductCategoryElement(), 36403 new BiologicallyDerivedProduct.BiologicallyDerivedProductCategoryEnumFactory(), false); 36404 } 36405 if (element.hasProductCode()) { 36406 composeCodeableConcept("productCode", element.getProductCode()); 36407 } 36408 if (element.hasStatusElement()) { 36409 composeEnumerationCore("status", element.getStatusElement(), 36410 new BiologicallyDerivedProduct.BiologicallyDerivedProductStatusEnumFactory(), false); 36411 composeEnumerationExtras("status", element.getStatusElement(), 36412 new BiologicallyDerivedProduct.BiologicallyDerivedProductStatusEnumFactory(), false); 36413 } 36414 if (element.hasRequest()) { 36415 openArray("request"); 36416 for (Reference e : element.getRequest()) 36417 composeReference(null, e); 36418 closeArray(); 36419 } 36420 ; 36421 if (element.hasQuantityElement()) { 36422 composeIntegerCore("quantity", element.getQuantityElement(), false); 36423 composeIntegerExtras("quantity", element.getQuantityElement(), false); 36424 } 36425 if (element.hasParent()) { 36426 openArray("parent"); 36427 for (Reference e : element.getParent()) 36428 composeReference(null, e); 36429 closeArray(); 36430 } 36431 ; 36432 if (element.hasCollection()) { 36433 composeBiologicallyDerivedProductBiologicallyDerivedProductCollectionComponent("collection", 36434 element.getCollection()); 36435 } 36436 if (element.hasProcessing()) { 36437 openArray("processing"); 36438 for (BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent e : element.getProcessing()) 36439 composeBiologicallyDerivedProductBiologicallyDerivedProductProcessingComponent(null, e); 36440 closeArray(); 36441 } 36442 ; 36443 if (element.hasManipulation()) { 36444 composeBiologicallyDerivedProductBiologicallyDerivedProductManipulationComponent("manipulation", 36445 element.getManipulation()); 36446 } 36447 if (element.hasStorage()) { 36448 openArray("storage"); 36449 for (BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent e : element.getStorage()) 36450 composeBiologicallyDerivedProductBiologicallyDerivedProductStorageComponent(null, e); 36451 closeArray(); 36452 } 36453 ; 36454 } 36455 36456 protected void composeBiologicallyDerivedProductBiologicallyDerivedProductCollectionComponent(String name, 36457 BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent element) throws IOException { 36458 if (element != null) { 36459 open(name); 36460 composeBiologicallyDerivedProductBiologicallyDerivedProductCollectionComponentInner(element); 36461 close(); 36462 } 36463 } 36464 36465 protected void composeBiologicallyDerivedProductBiologicallyDerivedProductCollectionComponentInner( 36466 BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent element) throws IOException { 36467 composeBackbone(element); 36468 if (element.hasCollector()) { 36469 composeReference("collector", element.getCollector()); 36470 } 36471 if (element.hasSource()) { 36472 composeReference("source", element.getSource()); 36473 } 36474 if (element.hasCollected()) { 36475 composeType("collected", element.getCollected()); 36476 } 36477 } 36478 36479 protected void composeBiologicallyDerivedProductBiologicallyDerivedProductProcessingComponent(String name, 36480 BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent element) throws IOException { 36481 if (element != null) { 36482 open(name); 36483 composeBiologicallyDerivedProductBiologicallyDerivedProductProcessingComponentInner(element); 36484 close(); 36485 } 36486 } 36487 36488 protected void composeBiologicallyDerivedProductBiologicallyDerivedProductProcessingComponentInner( 36489 BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent element) throws IOException { 36490 composeBackbone(element); 36491 if (element.hasDescriptionElement()) { 36492 composeStringCore("description", element.getDescriptionElement(), false); 36493 composeStringExtras("description", element.getDescriptionElement(), false); 36494 } 36495 if (element.hasProcedure()) { 36496 composeCodeableConcept("procedure", element.getProcedure()); 36497 } 36498 if (element.hasAdditive()) { 36499 composeReference("additive", element.getAdditive()); 36500 } 36501 if (element.hasTime()) { 36502 composeType("time", element.getTime()); 36503 } 36504 } 36505 36506 protected void composeBiologicallyDerivedProductBiologicallyDerivedProductManipulationComponent(String name, 36507 BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent element) throws IOException { 36508 if (element != null) { 36509 open(name); 36510 composeBiologicallyDerivedProductBiologicallyDerivedProductManipulationComponentInner(element); 36511 close(); 36512 } 36513 } 36514 36515 protected void composeBiologicallyDerivedProductBiologicallyDerivedProductManipulationComponentInner( 36516 BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent element) throws IOException { 36517 composeBackbone(element); 36518 if (element.hasDescriptionElement()) { 36519 composeStringCore("description", element.getDescriptionElement(), false); 36520 composeStringExtras("description", element.getDescriptionElement(), false); 36521 } 36522 if (element.hasTime()) { 36523 composeType("time", element.getTime()); 36524 } 36525 } 36526 36527 protected void composeBiologicallyDerivedProductBiologicallyDerivedProductStorageComponent(String name, 36528 BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent element) throws IOException { 36529 if (element != null) { 36530 open(name); 36531 composeBiologicallyDerivedProductBiologicallyDerivedProductStorageComponentInner(element); 36532 close(); 36533 } 36534 } 36535 36536 protected void composeBiologicallyDerivedProductBiologicallyDerivedProductStorageComponentInner( 36537 BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent element) throws IOException { 36538 composeBackbone(element); 36539 if (element.hasDescriptionElement()) { 36540 composeStringCore("description", element.getDescriptionElement(), false); 36541 composeStringExtras("description", element.getDescriptionElement(), false); 36542 } 36543 if (element.hasTemperatureElement()) { 36544 composeDecimalCore("temperature", element.getTemperatureElement(), false); 36545 composeDecimalExtras("temperature", element.getTemperatureElement(), false); 36546 } 36547 if (element.hasScaleElement()) { 36548 composeEnumerationCore("scale", element.getScaleElement(), 36549 new BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScaleEnumFactory(), false); 36550 composeEnumerationExtras("scale", element.getScaleElement(), 36551 new BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScaleEnumFactory(), false); 36552 } 36553 if (element.hasDuration()) { 36554 composePeriod("duration", element.getDuration()); 36555 } 36556 } 36557 36558 protected void composeBodyStructure(String name, BodyStructure element) throws IOException { 36559 if (element != null) { 36560 prop("resourceType", name); 36561 composeBodyStructureInner(element); 36562 } 36563 } 36564 36565 protected void composeBodyStructureInner(BodyStructure element) throws IOException { 36566 composeDomainResourceElements(element); 36567 if (element.hasIdentifier()) { 36568 openArray("identifier"); 36569 for (Identifier e : element.getIdentifier()) 36570 composeIdentifier(null, e); 36571 closeArray(); 36572 } 36573 ; 36574 if (element.hasActiveElement()) { 36575 composeBooleanCore("active", element.getActiveElement(), false); 36576 composeBooleanExtras("active", element.getActiveElement(), false); 36577 } 36578 if (element.hasMorphology()) { 36579 composeCodeableConcept("morphology", element.getMorphology()); 36580 } 36581 if (element.hasLocation()) { 36582 composeCodeableConcept("location", element.getLocation()); 36583 } 36584 if (element.hasLocationQualifier()) { 36585 openArray("locationQualifier"); 36586 for (CodeableConcept e : element.getLocationQualifier()) 36587 composeCodeableConcept(null, e); 36588 closeArray(); 36589 } 36590 ; 36591 if (element.hasDescriptionElement()) { 36592 composeStringCore("description", element.getDescriptionElement(), false); 36593 composeStringExtras("description", element.getDescriptionElement(), false); 36594 } 36595 if (element.hasImage()) { 36596 openArray("image"); 36597 for (Attachment e : element.getImage()) 36598 composeAttachment(null, e); 36599 closeArray(); 36600 } 36601 ; 36602 if (element.hasPatient()) { 36603 composeReference("patient", element.getPatient()); 36604 } 36605 } 36606 36607 protected void composeBundle(String name, Bundle element) throws IOException { 36608 if (element != null) { 36609 prop("resourceType", name); 36610 composeBundleInner(element); 36611 } 36612 } 36613 36614 protected void composeBundleInner(Bundle element) throws IOException { 36615 composeResourceElements(element); 36616 if (element.hasIdentifier()) { 36617 composeIdentifier("identifier", element.getIdentifier()); 36618 } 36619 if (element.hasTypeElement()) { 36620 composeEnumerationCore("type", element.getTypeElement(), new Bundle.BundleTypeEnumFactory(), false); 36621 composeEnumerationExtras("type", element.getTypeElement(), new Bundle.BundleTypeEnumFactory(), false); 36622 } 36623 if (element.hasTimestampElement()) { 36624 composeInstantCore("timestamp", element.getTimestampElement(), false); 36625 composeInstantExtras("timestamp", element.getTimestampElement(), false); 36626 } 36627 if (element.hasTotalElement()) { 36628 composeUnsignedIntCore("total", element.getTotalElement(), false); 36629 composeUnsignedIntExtras("total", element.getTotalElement(), false); 36630 } 36631 if (element.hasLink()) { 36632 openArray("link"); 36633 for (Bundle.BundleLinkComponent e : element.getLink()) 36634 composeBundleBundleLinkComponent(null, e); 36635 closeArray(); 36636 } 36637 ; 36638 if (element.hasEntry()) { 36639 openArray("entry"); 36640 for (Bundle.BundleEntryComponent e : element.getEntry()) 36641 composeBundleBundleEntryComponent(null, e); 36642 closeArray(); 36643 } 36644 ; 36645 if (element.hasSignature()) { 36646 composeSignature("signature", element.getSignature()); 36647 } 36648 } 36649 36650 protected void composeBundleBundleLinkComponent(String name, Bundle.BundleLinkComponent element) throws IOException { 36651 if (element != null) { 36652 open(name); 36653 composeBundleBundleLinkComponentInner(element); 36654 close(); 36655 } 36656 } 36657 36658 protected void composeBundleBundleLinkComponentInner(Bundle.BundleLinkComponent element) throws IOException { 36659 composeBackbone(element); 36660 if (element.hasRelationElement()) { 36661 composeStringCore("relation", element.getRelationElement(), false); 36662 composeStringExtras("relation", element.getRelationElement(), false); 36663 } 36664 if (element.hasUrlElement()) { 36665 composeUriCore("url", element.getUrlElement(), false); 36666 composeUriExtras("url", element.getUrlElement(), false); 36667 } 36668 } 36669 36670 protected void composeBundleBundleEntryComponent(String name, Bundle.BundleEntryComponent element) 36671 throws IOException { 36672 if (element != null) { 36673 open(name); 36674 composeBundleBundleEntryComponentInner(element); 36675 close(); 36676 } 36677 } 36678 36679 protected void composeBundleBundleEntryComponentInner(Bundle.BundleEntryComponent element) throws IOException { 36680 composeBackbone(element); 36681 if (element.hasLink()) { 36682 openArray("link"); 36683 for (Bundle.BundleLinkComponent e : element.getLink()) 36684 composeBundleBundleLinkComponent(null, e); 36685 closeArray(); 36686 } 36687 ; 36688 if (element.hasFullUrlElement()) { 36689 composeUriCore("fullUrl", element.getFullUrlElement(), false); 36690 composeUriExtras("fullUrl", element.getFullUrlElement(), false); 36691 } 36692 if (element.hasResource()) { 36693 open("resource"); 36694 composeResource(element.getResource()); 36695 close(); 36696 } 36697 if (element.hasSearch()) { 36698 composeBundleBundleEntrySearchComponent("search", element.getSearch()); 36699 } 36700 if (element.hasRequest()) { 36701 composeBundleBundleEntryRequestComponent("request", element.getRequest()); 36702 } 36703 if (element.hasResponse()) { 36704 composeBundleBundleEntryResponseComponent("response", element.getResponse()); 36705 } 36706 } 36707 36708 protected void composeBundleBundleEntrySearchComponent(String name, Bundle.BundleEntrySearchComponent element) 36709 throws IOException { 36710 if (element != null) { 36711 open(name); 36712 composeBundleBundleEntrySearchComponentInner(element); 36713 close(); 36714 } 36715 } 36716 36717 protected void composeBundleBundleEntrySearchComponentInner(Bundle.BundleEntrySearchComponent element) 36718 throws IOException { 36719 composeBackbone(element); 36720 if (element.hasModeElement()) { 36721 composeEnumerationCore("mode", element.getModeElement(), new Bundle.SearchEntryModeEnumFactory(), false); 36722 composeEnumerationExtras("mode", element.getModeElement(), new Bundle.SearchEntryModeEnumFactory(), false); 36723 } 36724 if (element.hasScoreElement()) { 36725 composeDecimalCore("score", element.getScoreElement(), false); 36726 composeDecimalExtras("score", element.getScoreElement(), false); 36727 } 36728 } 36729 36730 protected void composeBundleBundleEntryRequestComponent(String name, Bundle.BundleEntryRequestComponent element) 36731 throws IOException { 36732 if (element != null) { 36733 open(name); 36734 composeBundleBundleEntryRequestComponentInner(element); 36735 close(); 36736 } 36737 } 36738 36739 protected void composeBundleBundleEntryRequestComponentInner(Bundle.BundleEntryRequestComponent element) 36740 throws IOException { 36741 composeBackbone(element); 36742 if (element.hasMethodElement()) { 36743 composeEnumerationCore("method", element.getMethodElement(), new Bundle.HTTPVerbEnumFactory(), false); 36744 composeEnumerationExtras("method", element.getMethodElement(), new Bundle.HTTPVerbEnumFactory(), false); 36745 } 36746 if (element.hasUrlElement()) { 36747 composeUriCore("url", element.getUrlElement(), false); 36748 composeUriExtras("url", element.getUrlElement(), false); 36749 } 36750 if (element.hasIfNoneMatchElement()) { 36751 composeStringCore("ifNoneMatch", element.getIfNoneMatchElement(), false); 36752 composeStringExtras("ifNoneMatch", element.getIfNoneMatchElement(), false); 36753 } 36754 if (element.hasIfModifiedSinceElement()) { 36755 composeInstantCore("ifModifiedSince", element.getIfModifiedSinceElement(), false); 36756 composeInstantExtras("ifModifiedSince", element.getIfModifiedSinceElement(), false); 36757 } 36758 if (element.hasIfMatchElement()) { 36759 composeStringCore("ifMatch", element.getIfMatchElement(), false); 36760 composeStringExtras("ifMatch", element.getIfMatchElement(), false); 36761 } 36762 if (element.hasIfNoneExistElement()) { 36763 composeStringCore("ifNoneExist", element.getIfNoneExistElement(), false); 36764 composeStringExtras("ifNoneExist", element.getIfNoneExistElement(), false); 36765 } 36766 } 36767 36768 protected void composeBundleBundleEntryResponseComponent(String name, Bundle.BundleEntryResponseComponent element) 36769 throws IOException { 36770 if (element != null) { 36771 open(name); 36772 composeBundleBundleEntryResponseComponentInner(element); 36773 close(); 36774 } 36775 } 36776 36777 protected void composeBundleBundleEntryResponseComponentInner(Bundle.BundleEntryResponseComponent element) 36778 throws IOException { 36779 composeBackbone(element); 36780 if (element.hasStatusElement()) { 36781 composeStringCore("status", element.getStatusElement(), false); 36782 composeStringExtras("status", element.getStatusElement(), false); 36783 } 36784 if (element.hasLocationElement()) { 36785 composeUriCore("location", element.getLocationElement(), false); 36786 composeUriExtras("location", element.getLocationElement(), false); 36787 } 36788 if (element.hasEtagElement()) { 36789 composeStringCore("etag", element.getEtagElement(), false); 36790 composeStringExtras("etag", element.getEtagElement(), false); 36791 } 36792 if (element.hasLastModifiedElement()) { 36793 composeInstantCore("lastModified", element.getLastModifiedElement(), false); 36794 composeInstantExtras("lastModified", element.getLastModifiedElement(), false); 36795 } 36796 if (element.hasOutcome()) { 36797 open("outcome"); 36798 composeResource(element.getOutcome()); 36799 close(); 36800 } 36801 } 36802 36803 protected void composeCapabilityStatement(String name, CapabilityStatement element) throws IOException { 36804 if (element != null) { 36805 prop("resourceType", name); 36806 composeCapabilityStatementInner(element); 36807 } 36808 } 36809 36810 protected void composeCapabilityStatementInner(CapabilityStatement element) throws IOException { 36811 composeDomainResourceElements(element); 36812 if (element.hasUrlElement()) { 36813 composeUriCore("url", element.getUrlElement(), false); 36814 composeUriExtras("url", element.getUrlElement(), false); 36815 } 36816 if (element.hasVersionElement()) { 36817 composeStringCore("version", element.getVersionElement(), false); 36818 composeStringExtras("version", element.getVersionElement(), false); 36819 } 36820 if (element.hasNameElement()) { 36821 composeStringCore("name", element.getNameElement(), false); 36822 composeStringExtras("name", element.getNameElement(), false); 36823 } 36824 if (element.hasTitleElement()) { 36825 composeStringCore("title", element.getTitleElement(), false); 36826 composeStringExtras("title", element.getTitleElement(), false); 36827 } 36828 if (element.hasStatusElement()) { 36829 composeEnumerationCore("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 36830 false); 36831 composeEnumerationExtras("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 36832 false); 36833 } 36834 if (element.hasExperimentalElement()) { 36835 composeBooleanCore("experimental", element.getExperimentalElement(), false); 36836 composeBooleanExtras("experimental", element.getExperimentalElement(), false); 36837 } 36838 if (element.hasDateElement()) { 36839 composeDateTimeCore("date", element.getDateElement(), false); 36840 composeDateTimeExtras("date", element.getDateElement(), false); 36841 } 36842 if (element.hasPublisherElement()) { 36843 composeStringCore("publisher", element.getPublisherElement(), false); 36844 composeStringExtras("publisher", element.getPublisherElement(), false); 36845 } 36846 if (element.hasContact()) { 36847 openArray("contact"); 36848 for (ContactDetail e : element.getContact()) 36849 composeContactDetail(null, e); 36850 closeArray(); 36851 } 36852 ; 36853 if (element.hasDescriptionElement()) { 36854 composeMarkdownCore("description", element.getDescriptionElement(), false); 36855 composeMarkdownExtras("description", element.getDescriptionElement(), false); 36856 } 36857 if (element.hasUseContext()) { 36858 openArray("useContext"); 36859 for (UsageContext e : element.getUseContext()) 36860 composeUsageContext(null, e); 36861 closeArray(); 36862 } 36863 ; 36864 if (element.hasJurisdiction()) { 36865 openArray("jurisdiction"); 36866 for (CodeableConcept e : element.getJurisdiction()) 36867 composeCodeableConcept(null, e); 36868 closeArray(); 36869 } 36870 ; 36871 if (element.hasPurposeElement()) { 36872 composeMarkdownCore("purpose", element.getPurposeElement(), false); 36873 composeMarkdownExtras("purpose", element.getPurposeElement(), false); 36874 } 36875 if (element.hasCopyrightElement()) { 36876 composeMarkdownCore("copyright", element.getCopyrightElement(), false); 36877 composeMarkdownExtras("copyright", element.getCopyrightElement(), false); 36878 } 36879 if (element.hasKindElement()) { 36880 composeEnumerationCore("kind", element.getKindElement(), 36881 new CapabilityStatement.CapabilityStatementKindEnumFactory(), false); 36882 composeEnumerationExtras("kind", element.getKindElement(), 36883 new CapabilityStatement.CapabilityStatementKindEnumFactory(), false); 36884 } 36885 if (element.hasInstantiates()) { 36886 openArray("instantiates"); 36887 for (CanonicalType e : element.getInstantiates()) 36888 composeCanonicalCore(null, e, true); 36889 closeArray(); 36890 if (anyHasExtras(element.getInstantiates())) { 36891 openArray("_instantiates"); 36892 for (CanonicalType e : element.getInstantiates()) 36893 composeCanonicalExtras(null, e, true); 36894 closeArray(); 36895 } 36896 } 36897 ; 36898 if (element.hasImports()) { 36899 openArray("imports"); 36900 for (CanonicalType e : element.getImports()) 36901 composeCanonicalCore(null, e, true); 36902 closeArray(); 36903 if (anyHasExtras(element.getImports())) { 36904 openArray("_imports"); 36905 for (CanonicalType e : element.getImports()) 36906 composeCanonicalExtras(null, e, true); 36907 closeArray(); 36908 } 36909 } 36910 ; 36911 if (element.hasSoftware()) { 36912 composeCapabilityStatementCapabilityStatementSoftwareComponent("software", element.getSoftware()); 36913 } 36914 if (element.hasImplementation()) { 36915 composeCapabilityStatementCapabilityStatementImplementationComponent("implementation", 36916 element.getImplementation()); 36917 } 36918 if (element.hasFhirVersionElement()) { 36919 composeEnumerationCore("fhirVersion", element.getFhirVersionElement(), new Enumerations.FHIRVersionEnumFactory(), 36920 false); 36921 composeEnumerationExtras("fhirVersion", element.getFhirVersionElement(), 36922 new Enumerations.FHIRVersionEnumFactory(), false); 36923 } 36924 if (element.hasFormat()) { 36925 openArray("format"); 36926 for (CodeType e : element.getFormat()) 36927 composeCodeCore(null, e, true); 36928 closeArray(); 36929 if (anyHasExtras(element.getFormat())) { 36930 openArray("_format"); 36931 for (CodeType e : element.getFormat()) 36932 composeCodeExtras(null, e, true); 36933 closeArray(); 36934 } 36935 } 36936 ; 36937 if (element.hasPatchFormat()) { 36938 openArray("patchFormat"); 36939 for (CodeType e : element.getPatchFormat()) 36940 composeCodeCore(null, e, true); 36941 closeArray(); 36942 if (anyHasExtras(element.getPatchFormat())) { 36943 openArray("_patchFormat"); 36944 for (CodeType e : element.getPatchFormat()) 36945 composeCodeExtras(null, e, true); 36946 closeArray(); 36947 } 36948 } 36949 ; 36950 if (element.hasImplementationGuide()) { 36951 openArray("implementationGuide"); 36952 for (CanonicalType e : element.getImplementationGuide()) 36953 composeCanonicalCore(null, e, true); 36954 closeArray(); 36955 if (anyHasExtras(element.getImplementationGuide())) { 36956 openArray("_implementationGuide"); 36957 for (CanonicalType e : element.getImplementationGuide()) 36958 composeCanonicalExtras(null, e, true); 36959 closeArray(); 36960 } 36961 } 36962 ; 36963 if (element.hasRest()) { 36964 openArray("rest"); 36965 for (CapabilityStatement.CapabilityStatementRestComponent e : element.getRest()) 36966 composeCapabilityStatementCapabilityStatementRestComponent(null, e); 36967 closeArray(); 36968 } 36969 ; 36970 if (element.hasMessaging()) { 36971 openArray("messaging"); 36972 for (CapabilityStatement.CapabilityStatementMessagingComponent e : element.getMessaging()) 36973 composeCapabilityStatementCapabilityStatementMessagingComponent(null, e); 36974 closeArray(); 36975 } 36976 ; 36977 if (element.hasDocument()) { 36978 openArray("document"); 36979 for (CapabilityStatement.CapabilityStatementDocumentComponent e : element.getDocument()) 36980 composeCapabilityStatementCapabilityStatementDocumentComponent(null, e); 36981 closeArray(); 36982 } 36983 ; 36984 } 36985 36986 protected void composeCapabilityStatementCapabilityStatementSoftwareComponent(String name, 36987 CapabilityStatement.CapabilityStatementSoftwareComponent element) throws IOException { 36988 if (element != null) { 36989 open(name); 36990 composeCapabilityStatementCapabilityStatementSoftwareComponentInner(element); 36991 close(); 36992 } 36993 } 36994 36995 protected void composeCapabilityStatementCapabilityStatementSoftwareComponentInner( 36996 CapabilityStatement.CapabilityStatementSoftwareComponent element) throws IOException { 36997 composeBackbone(element); 36998 if (element.hasNameElement()) { 36999 composeStringCore("name", element.getNameElement(), false); 37000 composeStringExtras("name", element.getNameElement(), false); 37001 } 37002 if (element.hasVersionElement()) { 37003 composeStringCore("version", element.getVersionElement(), false); 37004 composeStringExtras("version", element.getVersionElement(), false); 37005 } 37006 if (element.hasReleaseDateElement()) { 37007 composeDateTimeCore("releaseDate", element.getReleaseDateElement(), false); 37008 composeDateTimeExtras("releaseDate", element.getReleaseDateElement(), false); 37009 } 37010 } 37011 37012 protected void composeCapabilityStatementCapabilityStatementImplementationComponent(String name, 37013 CapabilityStatement.CapabilityStatementImplementationComponent element) throws IOException { 37014 if (element != null) { 37015 open(name); 37016 composeCapabilityStatementCapabilityStatementImplementationComponentInner(element); 37017 close(); 37018 } 37019 } 37020 37021 protected void composeCapabilityStatementCapabilityStatementImplementationComponentInner( 37022 CapabilityStatement.CapabilityStatementImplementationComponent element) throws IOException { 37023 composeBackbone(element); 37024 if (element.hasDescriptionElement()) { 37025 composeStringCore("description", element.getDescriptionElement(), false); 37026 composeStringExtras("description", element.getDescriptionElement(), false); 37027 } 37028 if (element.hasUrlElement()) { 37029 composeUrlCore("url", element.getUrlElement(), false); 37030 composeUrlExtras("url", element.getUrlElement(), false); 37031 } 37032 if (element.hasCustodian()) { 37033 composeReference("custodian", element.getCustodian()); 37034 } 37035 } 37036 37037 protected void composeCapabilityStatementCapabilityStatementRestComponent(String name, 37038 CapabilityStatement.CapabilityStatementRestComponent element) throws IOException { 37039 if (element != null) { 37040 open(name); 37041 composeCapabilityStatementCapabilityStatementRestComponentInner(element); 37042 close(); 37043 } 37044 } 37045 37046 protected void composeCapabilityStatementCapabilityStatementRestComponentInner( 37047 CapabilityStatement.CapabilityStatementRestComponent element) throws IOException { 37048 composeBackbone(element); 37049 if (element.hasModeElement()) { 37050 composeEnumerationCore("mode", element.getModeElement(), 37051 new CapabilityStatement.RestfulCapabilityModeEnumFactory(), false); 37052 composeEnumerationExtras("mode", element.getModeElement(), 37053 new CapabilityStatement.RestfulCapabilityModeEnumFactory(), false); 37054 } 37055 if (element.hasDocumentationElement()) { 37056 composeMarkdownCore("documentation", element.getDocumentationElement(), false); 37057 composeMarkdownExtras("documentation", element.getDocumentationElement(), false); 37058 } 37059 if (element.hasSecurity()) { 37060 composeCapabilityStatementCapabilityStatementRestSecurityComponent("security", element.getSecurity()); 37061 } 37062 if (element.hasResource()) { 37063 openArray("resource"); 37064 for (CapabilityStatement.CapabilityStatementRestResourceComponent e : element.getResource()) 37065 composeCapabilityStatementCapabilityStatementRestResourceComponent(null, e); 37066 closeArray(); 37067 } 37068 ; 37069 if (element.hasInteraction()) { 37070 openArray("interaction"); 37071 for (CapabilityStatement.SystemInteractionComponent e : element.getInteraction()) 37072 composeCapabilityStatementSystemInteractionComponent(null, e); 37073 closeArray(); 37074 } 37075 ; 37076 if (element.hasSearchParam()) { 37077 openArray("searchParam"); 37078 for (CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent e : element.getSearchParam()) 37079 composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(null, e); 37080 closeArray(); 37081 } 37082 ; 37083 if (element.hasOperation()) { 37084 openArray("operation"); 37085 for (CapabilityStatement.CapabilityStatementRestResourceOperationComponent e : element.getOperation()) 37086 composeCapabilityStatementCapabilityStatementRestResourceOperationComponent(null, e); 37087 closeArray(); 37088 } 37089 ; 37090 if (element.hasCompartment()) { 37091 openArray("compartment"); 37092 for (CanonicalType e : element.getCompartment()) 37093 composeCanonicalCore(null, e, true); 37094 closeArray(); 37095 if (anyHasExtras(element.getCompartment())) { 37096 openArray("_compartment"); 37097 for (CanonicalType e : element.getCompartment()) 37098 composeCanonicalExtras(null, e, true); 37099 closeArray(); 37100 } 37101 } 37102 ; 37103 } 37104 37105 protected void composeCapabilityStatementCapabilityStatementRestSecurityComponent(String name, 37106 CapabilityStatement.CapabilityStatementRestSecurityComponent element) throws IOException { 37107 if (element != null) { 37108 open(name); 37109 composeCapabilityStatementCapabilityStatementRestSecurityComponentInner(element); 37110 close(); 37111 } 37112 } 37113 37114 protected void composeCapabilityStatementCapabilityStatementRestSecurityComponentInner( 37115 CapabilityStatement.CapabilityStatementRestSecurityComponent element) throws IOException { 37116 composeBackbone(element); 37117 if (element.hasCorsElement()) { 37118 composeBooleanCore("cors", element.getCorsElement(), false); 37119 composeBooleanExtras("cors", element.getCorsElement(), false); 37120 } 37121 if (element.hasService()) { 37122 openArray("service"); 37123 for (CodeableConcept e : element.getService()) 37124 composeCodeableConcept(null, e); 37125 closeArray(); 37126 } 37127 ; 37128 if (element.hasDescriptionElement()) { 37129 composeMarkdownCore("description", element.getDescriptionElement(), false); 37130 composeMarkdownExtras("description", element.getDescriptionElement(), false); 37131 } 37132 } 37133 37134 protected void composeCapabilityStatementCapabilityStatementRestResourceComponent(String name, 37135 CapabilityStatement.CapabilityStatementRestResourceComponent element) throws IOException { 37136 if (element != null) { 37137 open(name); 37138 composeCapabilityStatementCapabilityStatementRestResourceComponentInner(element); 37139 close(); 37140 } 37141 } 37142 37143 protected void composeCapabilityStatementCapabilityStatementRestResourceComponentInner( 37144 CapabilityStatement.CapabilityStatementRestResourceComponent element) throws IOException { 37145 composeBackbone(element); 37146 if (element.hasTypeElement()) { 37147 composeCodeCore("type", element.getTypeElement(), false); 37148 composeCodeExtras("type", element.getTypeElement(), false); 37149 } 37150 if (element.hasProfileElement()) { 37151 composeCanonicalCore("profile", element.getProfileElement(), false); 37152 composeCanonicalExtras("profile", element.getProfileElement(), false); 37153 } 37154 if (element.hasSupportedProfile()) { 37155 openArray("supportedProfile"); 37156 for (CanonicalType e : element.getSupportedProfile()) 37157 composeCanonicalCore(null, e, true); 37158 closeArray(); 37159 if (anyHasExtras(element.getSupportedProfile())) { 37160 openArray("_supportedProfile"); 37161 for (CanonicalType e : element.getSupportedProfile()) 37162 composeCanonicalExtras(null, e, true); 37163 closeArray(); 37164 } 37165 } 37166 ; 37167 if (element.hasDocumentationElement()) { 37168 composeMarkdownCore("documentation", element.getDocumentationElement(), false); 37169 composeMarkdownExtras("documentation", element.getDocumentationElement(), false); 37170 } 37171 if (element.hasInteraction()) { 37172 openArray("interaction"); 37173 for (CapabilityStatement.ResourceInteractionComponent e : element.getInteraction()) 37174 composeCapabilityStatementResourceInteractionComponent(null, e); 37175 closeArray(); 37176 } 37177 ; 37178 if (element.hasVersioningElement()) { 37179 composeEnumerationCore("versioning", element.getVersioningElement(), 37180 new CapabilityStatement.ResourceVersionPolicyEnumFactory(), false); 37181 composeEnumerationExtras("versioning", element.getVersioningElement(), 37182 new CapabilityStatement.ResourceVersionPolicyEnumFactory(), false); 37183 } 37184 if (element.hasReadHistoryElement()) { 37185 composeBooleanCore("readHistory", element.getReadHistoryElement(), false); 37186 composeBooleanExtras("readHistory", element.getReadHistoryElement(), false); 37187 } 37188 if (element.hasUpdateCreateElement()) { 37189 composeBooleanCore("updateCreate", element.getUpdateCreateElement(), false); 37190 composeBooleanExtras("updateCreate", element.getUpdateCreateElement(), false); 37191 } 37192 if (element.hasConditionalCreateElement()) { 37193 composeBooleanCore("conditionalCreate", element.getConditionalCreateElement(), false); 37194 composeBooleanExtras("conditionalCreate", element.getConditionalCreateElement(), false); 37195 } 37196 if (element.hasConditionalReadElement()) { 37197 composeEnumerationCore("conditionalRead", element.getConditionalReadElement(), 37198 new CapabilityStatement.ConditionalReadStatusEnumFactory(), false); 37199 composeEnumerationExtras("conditionalRead", element.getConditionalReadElement(), 37200 new CapabilityStatement.ConditionalReadStatusEnumFactory(), false); 37201 } 37202 if (element.hasConditionalUpdateElement()) { 37203 composeBooleanCore("conditionalUpdate", element.getConditionalUpdateElement(), false); 37204 composeBooleanExtras("conditionalUpdate", element.getConditionalUpdateElement(), false); 37205 } 37206 if (element.hasConditionalDeleteElement()) { 37207 composeEnumerationCore("conditionalDelete", element.getConditionalDeleteElement(), 37208 new CapabilityStatement.ConditionalDeleteStatusEnumFactory(), false); 37209 composeEnumerationExtras("conditionalDelete", element.getConditionalDeleteElement(), 37210 new CapabilityStatement.ConditionalDeleteStatusEnumFactory(), false); 37211 } 37212 if (element.hasReferencePolicy()) { 37213 openArray("referencePolicy"); 37214 for (Enumeration<CapabilityStatement.ReferenceHandlingPolicy> e : element.getReferencePolicy()) 37215 composeEnumerationCore(null, e, new CapabilityStatement.ReferenceHandlingPolicyEnumFactory(), true); 37216 closeArray(); 37217 if (anyHasExtras(element.getReferencePolicy())) { 37218 openArray("_referencePolicy"); 37219 for (Enumeration<CapabilityStatement.ReferenceHandlingPolicy> e : element.getReferencePolicy()) 37220 composeEnumerationExtras(null, e, new CapabilityStatement.ReferenceHandlingPolicyEnumFactory(), true); 37221 closeArray(); 37222 } 37223 } 37224 ; 37225 if (element.hasSearchInclude()) { 37226 openArray("searchInclude"); 37227 for (StringType e : element.getSearchInclude()) 37228 composeStringCore(null, e, true); 37229 closeArray(); 37230 if (anyHasExtras(element.getSearchInclude())) { 37231 openArray("_searchInclude"); 37232 for (StringType e : element.getSearchInclude()) 37233 composeStringExtras(null, e, true); 37234 closeArray(); 37235 } 37236 } 37237 ; 37238 if (element.hasSearchRevInclude()) { 37239 openArray("searchRevInclude"); 37240 for (StringType e : element.getSearchRevInclude()) 37241 composeStringCore(null, e, true); 37242 closeArray(); 37243 if (anyHasExtras(element.getSearchRevInclude())) { 37244 openArray("_searchRevInclude"); 37245 for (StringType e : element.getSearchRevInclude()) 37246 composeStringExtras(null, e, true); 37247 closeArray(); 37248 } 37249 } 37250 ; 37251 if (element.hasSearchParam()) { 37252 openArray("searchParam"); 37253 for (CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent e : element.getSearchParam()) 37254 composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(null, e); 37255 closeArray(); 37256 } 37257 ; 37258 if (element.hasOperation()) { 37259 openArray("operation"); 37260 for (CapabilityStatement.CapabilityStatementRestResourceOperationComponent e : element.getOperation()) 37261 composeCapabilityStatementCapabilityStatementRestResourceOperationComponent(null, e); 37262 closeArray(); 37263 } 37264 ; 37265 } 37266 37267 protected void composeCapabilityStatementResourceInteractionComponent(String name, 37268 CapabilityStatement.ResourceInteractionComponent element) throws IOException { 37269 if (element != null) { 37270 open(name); 37271 composeCapabilityStatementResourceInteractionComponentInner(element); 37272 close(); 37273 } 37274 } 37275 37276 protected void composeCapabilityStatementResourceInteractionComponentInner( 37277 CapabilityStatement.ResourceInteractionComponent element) throws IOException { 37278 composeBackbone(element); 37279 if (element.hasCodeElement()) { 37280 composeEnumerationCore("code", element.getCodeElement(), 37281 new CapabilityStatement.TypeRestfulInteractionEnumFactory(), false); 37282 composeEnumerationExtras("code", element.getCodeElement(), 37283 new CapabilityStatement.TypeRestfulInteractionEnumFactory(), false); 37284 } 37285 if (element.hasDocumentationElement()) { 37286 composeMarkdownCore("documentation", element.getDocumentationElement(), false); 37287 composeMarkdownExtras("documentation", element.getDocumentationElement(), false); 37288 } 37289 } 37290 37291 protected void composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(String name, 37292 CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent element) throws IOException { 37293 if (element != null) { 37294 open(name); 37295 composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponentInner(element); 37296 close(); 37297 } 37298 } 37299 37300 protected void composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponentInner( 37301 CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent element) throws IOException { 37302 composeBackbone(element); 37303 if (element.hasNameElement()) { 37304 composeStringCore("name", element.getNameElement(), false); 37305 composeStringExtras("name", element.getNameElement(), false); 37306 } 37307 if (element.hasDefinitionElement()) { 37308 composeCanonicalCore("definition", element.getDefinitionElement(), false); 37309 composeCanonicalExtras("definition", element.getDefinitionElement(), false); 37310 } 37311 if (element.hasTypeElement()) { 37312 composeEnumerationCore("type", element.getTypeElement(), new Enumerations.SearchParamTypeEnumFactory(), false); 37313 composeEnumerationExtras("type", element.getTypeElement(), new Enumerations.SearchParamTypeEnumFactory(), false); 37314 } 37315 if (element.hasDocumentationElement()) { 37316 composeMarkdownCore("documentation", element.getDocumentationElement(), false); 37317 composeMarkdownExtras("documentation", element.getDocumentationElement(), false); 37318 } 37319 } 37320 37321 protected void composeCapabilityStatementCapabilityStatementRestResourceOperationComponent(String name, 37322 CapabilityStatement.CapabilityStatementRestResourceOperationComponent element) throws IOException { 37323 if (element != null) { 37324 open(name); 37325 composeCapabilityStatementCapabilityStatementRestResourceOperationComponentInner(element); 37326 close(); 37327 } 37328 } 37329 37330 protected void composeCapabilityStatementCapabilityStatementRestResourceOperationComponentInner( 37331 CapabilityStatement.CapabilityStatementRestResourceOperationComponent element) throws IOException { 37332 composeBackbone(element); 37333 if (element.hasNameElement()) { 37334 composeStringCore("name", element.getNameElement(), false); 37335 composeStringExtras("name", element.getNameElement(), false); 37336 } 37337 if (element.hasDefinitionElement()) { 37338 composeCanonicalCore("definition", element.getDefinitionElement(), false); 37339 composeCanonicalExtras("definition", element.getDefinitionElement(), false); 37340 } 37341 if (element.hasDocumentationElement()) { 37342 composeMarkdownCore("documentation", element.getDocumentationElement(), false); 37343 composeMarkdownExtras("documentation", element.getDocumentationElement(), false); 37344 } 37345 } 37346 37347 protected void composeCapabilityStatementSystemInteractionComponent(String name, 37348 CapabilityStatement.SystemInteractionComponent element) throws IOException { 37349 if (element != null) { 37350 open(name); 37351 composeCapabilityStatementSystemInteractionComponentInner(element); 37352 close(); 37353 } 37354 } 37355 37356 protected void composeCapabilityStatementSystemInteractionComponentInner( 37357 CapabilityStatement.SystemInteractionComponent element) throws IOException { 37358 composeBackbone(element); 37359 if (element.hasCodeElement()) { 37360 composeEnumerationCore("code", element.getCodeElement(), 37361 new CapabilityStatement.SystemRestfulInteractionEnumFactory(), false); 37362 composeEnumerationExtras("code", element.getCodeElement(), 37363 new CapabilityStatement.SystemRestfulInteractionEnumFactory(), false); 37364 } 37365 if (element.hasDocumentationElement()) { 37366 composeMarkdownCore("documentation", element.getDocumentationElement(), false); 37367 composeMarkdownExtras("documentation", element.getDocumentationElement(), false); 37368 } 37369 } 37370 37371 protected void composeCapabilityStatementCapabilityStatementMessagingComponent(String name, 37372 CapabilityStatement.CapabilityStatementMessagingComponent element) throws IOException { 37373 if (element != null) { 37374 open(name); 37375 composeCapabilityStatementCapabilityStatementMessagingComponentInner(element); 37376 close(); 37377 } 37378 } 37379 37380 protected void composeCapabilityStatementCapabilityStatementMessagingComponentInner( 37381 CapabilityStatement.CapabilityStatementMessagingComponent element) throws IOException { 37382 composeBackbone(element); 37383 if (element.hasEndpoint()) { 37384 openArray("endpoint"); 37385 for (CapabilityStatement.CapabilityStatementMessagingEndpointComponent e : element.getEndpoint()) 37386 composeCapabilityStatementCapabilityStatementMessagingEndpointComponent(null, e); 37387 closeArray(); 37388 } 37389 ; 37390 if (element.hasReliableCacheElement()) { 37391 composeUnsignedIntCore("reliableCache", element.getReliableCacheElement(), false); 37392 composeUnsignedIntExtras("reliableCache", element.getReliableCacheElement(), false); 37393 } 37394 if (element.hasDocumentationElement()) { 37395 composeMarkdownCore("documentation", element.getDocumentationElement(), false); 37396 composeMarkdownExtras("documentation", element.getDocumentationElement(), false); 37397 } 37398 if (element.hasSupportedMessage()) { 37399 openArray("supportedMessage"); 37400 for (CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent e : element.getSupportedMessage()) 37401 composeCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent(null, e); 37402 closeArray(); 37403 } 37404 ; 37405 } 37406 37407 protected void composeCapabilityStatementCapabilityStatementMessagingEndpointComponent(String name, 37408 CapabilityStatement.CapabilityStatementMessagingEndpointComponent element) throws IOException { 37409 if (element != null) { 37410 open(name); 37411 composeCapabilityStatementCapabilityStatementMessagingEndpointComponentInner(element); 37412 close(); 37413 } 37414 } 37415 37416 protected void composeCapabilityStatementCapabilityStatementMessagingEndpointComponentInner( 37417 CapabilityStatement.CapabilityStatementMessagingEndpointComponent element) throws IOException { 37418 composeBackbone(element); 37419 if (element.hasProtocol()) { 37420 composeCoding("protocol", element.getProtocol()); 37421 } 37422 if (element.hasAddressElement()) { 37423 composeUrlCore("address", element.getAddressElement(), false); 37424 composeUrlExtras("address", element.getAddressElement(), false); 37425 } 37426 } 37427 37428 protected void composeCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent(String name, 37429 CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent element) throws IOException { 37430 if (element != null) { 37431 open(name); 37432 composeCapabilityStatementCapabilityStatementMessagingSupportedMessageComponentInner(element); 37433 close(); 37434 } 37435 } 37436 37437 protected void composeCapabilityStatementCapabilityStatementMessagingSupportedMessageComponentInner( 37438 CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent element) throws IOException { 37439 composeBackbone(element); 37440 if (element.hasModeElement()) { 37441 composeEnumerationCore("mode", element.getModeElement(), new CapabilityStatement.EventCapabilityModeEnumFactory(), 37442 false); 37443 composeEnumerationExtras("mode", element.getModeElement(), 37444 new CapabilityStatement.EventCapabilityModeEnumFactory(), false); 37445 } 37446 if (element.hasDefinitionElement()) { 37447 composeCanonicalCore("definition", element.getDefinitionElement(), false); 37448 composeCanonicalExtras("definition", element.getDefinitionElement(), false); 37449 } 37450 } 37451 37452 protected void composeCapabilityStatementCapabilityStatementDocumentComponent(String name, 37453 CapabilityStatement.CapabilityStatementDocumentComponent element) throws IOException { 37454 if (element != null) { 37455 open(name); 37456 composeCapabilityStatementCapabilityStatementDocumentComponentInner(element); 37457 close(); 37458 } 37459 } 37460 37461 protected void composeCapabilityStatementCapabilityStatementDocumentComponentInner( 37462 CapabilityStatement.CapabilityStatementDocumentComponent element) throws IOException { 37463 composeBackbone(element); 37464 if (element.hasModeElement()) { 37465 composeEnumerationCore("mode", element.getModeElement(), new CapabilityStatement.DocumentModeEnumFactory(), 37466 false); 37467 composeEnumerationExtras("mode", element.getModeElement(), new CapabilityStatement.DocumentModeEnumFactory(), 37468 false); 37469 } 37470 if (element.hasDocumentationElement()) { 37471 composeMarkdownCore("documentation", element.getDocumentationElement(), false); 37472 composeMarkdownExtras("documentation", element.getDocumentationElement(), false); 37473 } 37474 if (element.hasProfileElement()) { 37475 composeCanonicalCore("profile", element.getProfileElement(), false); 37476 composeCanonicalExtras("profile", element.getProfileElement(), false); 37477 } 37478 } 37479 37480 protected void composeCarePlan(String name, CarePlan element) throws IOException { 37481 if (element != null) { 37482 prop("resourceType", name); 37483 composeCarePlanInner(element); 37484 } 37485 } 37486 37487 protected void composeCarePlanInner(CarePlan element) throws IOException { 37488 composeDomainResourceElements(element); 37489 if (element.hasIdentifier()) { 37490 openArray("identifier"); 37491 for (Identifier e : element.getIdentifier()) 37492 composeIdentifier(null, e); 37493 closeArray(); 37494 } 37495 ; 37496 if (element.hasInstantiatesCanonical()) { 37497 openArray("instantiatesCanonical"); 37498 for (CanonicalType e : element.getInstantiatesCanonical()) 37499 composeCanonicalCore(null, e, true); 37500 closeArray(); 37501 if (anyHasExtras(element.getInstantiatesCanonical())) { 37502 openArray("_instantiatesCanonical"); 37503 for (CanonicalType e : element.getInstantiatesCanonical()) 37504 composeCanonicalExtras(null, e, true); 37505 closeArray(); 37506 } 37507 } 37508 ; 37509 if (element.hasInstantiatesUri()) { 37510 openArray("instantiatesUri"); 37511 for (UriType e : element.getInstantiatesUri()) 37512 composeUriCore(null, e, true); 37513 closeArray(); 37514 if (anyHasExtras(element.getInstantiatesUri())) { 37515 openArray("_instantiatesUri"); 37516 for (UriType e : element.getInstantiatesUri()) 37517 composeUriExtras(null, e, true); 37518 closeArray(); 37519 } 37520 } 37521 ; 37522 if (element.hasBasedOn()) { 37523 openArray("basedOn"); 37524 for (Reference e : element.getBasedOn()) 37525 composeReference(null, e); 37526 closeArray(); 37527 } 37528 ; 37529 if (element.hasReplaces()) { 37530 openArray("replaces"); 37531 for (Reference e : element.getReplaces()) 37532 composeReference(null, e); 37533 closeArray(); 37534 } 37535 ; 37536 if (element.hasPartOf()) { 37537 openArray("partOf"); 37538 for (Reference e : element.getPartOf()) 37539 composeReference(null, e); 37540 closeArray(); 37541 } 37542 ; 37543 if (element.hasStatusElement()) { 37544 composeEnumerationCore("status", element.getStatusElement(), new CarePlan.CarePlanStatusEnumFactory(), false); 37545 composeEnumerationExtras("status", element.getStatusElement(), new CarePlan.CarePlanStatusEnumFactory(), false); 37546 } 37547 if (element.hasIntentElement()) { 37548 composeEnumerationCore("intent", element.getIntentElement(), new CarePlan.CarePlanIntentEnumFactory(), false); 37549 composeEnumerationExtras("intent", element.getIntentElement(), new CarePlan.CarePlanIntentEnumFactory(), false); 37550 } 37551 if (element.hasCategory()) { 37552 openArray("category"); 37553 for (CodeableConcept e : element.getCategory()) 37554 composeCodeableConcept(null, e); 37555 closeArray(); 37556 } 37557 ; 37558 if (element.hasTitleElement()) { 37559 composeStringCore("title", element.getTitleElement(), false); 37560 composeStringExtras("title", element.getTitleElement(), false); 37561 } 37562 if (element.hasDescriptionElement()) { 37563 composeStringCore("description", element.getDescriptionElement(), false); 37564 composeStringExtras("description", element.getDescriptionElement(), false); 37565 } 37566 if (element.hasSubject()) { 37567 composeReference("subject", element.getSubject()); 37568 } 37569 if (element.hasEncounter()) { 37570 composeReference("encounter", element.getEncounter()); 37571 } 37572 if (element.hasPeriod()) { 37573 composePeriod("period", element.getPeriod()); 37574 } 37575 if (element.hasCreatedElement()) { 37576 composeDateTimeCore("created", element.getCreatedElement(), false); 37577 composeDateTimeExtras("created", element.getCreatedElement(), false); 37578 } 37579 if (element.hasAuthor()) { 37580 composeReference("author", element.getAuthor()); 37581 } 37582 if (element.hasContributor()) { 37583 openArray("contributor"); 37584 for (Reference e : element.getContributor()) 37585 composeReference(null, e); 37586 closeArray(); 37587 } 37588 ; 37589 if (element.hasCareTeam()) { 37590 openArray("careTeam"); 37591 for (Reference e : element.getCareTeam()) 37592 composeReference(null, e); 37593 closeArray(); 37594 } 37595 ; 37596 if (element.hasAddresses()) { 37597 openArray("addresses"); 37598 for (Reference e : element.getAddresses()) 37599 composeReference(null, e); 37600 closeArray(); 37601 } 37602 ; 37603 if (element.hasSupportingInfo()) { 37604 openArray("supportingInfo"); 37605 for (Reference e : element.getSupportingInfo()) 37606 composeReference(null, e); 37607 closeArray(); 37608 } 37609 ; 37610 if (element.hasGoal()) { 37611 openArray("goal"); 37612 for (Reference e : element.getGoal()) 37613 composeReference(null, e); 37614 closeArray(); 37615 } 37616 ; 37617 if (element.hasActivity()) { 37618 openArray("activity"); 37619 for (CarePlan.CarePlanActivityComponent e : element.getActivity()) 37620 composeCarePlanCarePlanActivityComponent(null, e); 37621 closeArray(); 37622 } 37623 ; 37624 if (element.hasNote()) { 37625 openArray("note"); 37626 for (Annotation e : element.getNote()) 37627 composeAnnotation(null, e); 37628 closeArray(); 37629 } 37630 ; 37631 } 37632 37633 protected void composeCarePlanCarePlanActivityComponent(String name, CarePlan.CarePlanActivityComponent element) 37634 throws IOException { 37635 if (element != null) { 37636 open(name); 37637 composeCarePlanCarePlanActivityComponentInner(element); 37638 close(); 37639 } 37640 } 37641 37642 protected void composeCarePlanCarePlanActivityComponentInner(CarePlan.CarePlanActivityComponent element) 37643 throws IOException { 37644 composeBackbone(element); 37645 if (element.hasOutcomeCodeableConcept()) { 37646 openArray("outcomeCodeableConcept"); 37647 for (CodeableConcept e : element.getOutcomeCodeableConcept()) 37648 composeCodeableConcept(null, e); 37649 closeArray(); 37650 } 37651 ; 37652 if (element.hasOutcomeReference()) { 37653 openArray("outcomeReference"); 37654 for (Reference e : element.getOutcomeReference()) 37655 composeReference(null, e); 37656 closeArray(); 37657 } 37658 ; 37659 if (element.hasProgress()) { 37660 openArray("progress"); 37661 for (Annotation e : element.getProgress()) 37662 composeAnnotation(null, e); 37663 closeArray(); 37664 } 37665 ; 37666 if (element.hasReference()) { 37667 composeReference("reference", element.getReference()); 37668 } 37669 if (element.hasDetail()) { 37670 composeCarePlanCarePlanActivityDetailComponent("detail", element.getDetail()); 37671 } 37672 } 37673 37674 protected void composeCarePlanCarePlanActivityDetailComponent(String name, 37675 CarePlan.CarePlanActivityDetailComponent element) throws IOException { 37676 if (element != null) { 37677 open(name); 37678 composeCarePlanCarePlanActivityDetailComponentInner(element); 37679 close(); 37680 } 37681 } 37682 37683 protected void composeCarePlanCarePlanActivityDetailComponentInner(CarePlan.CarePlanActivityDetailComponent element) 37684 throws IOException { 37685 composeBackbone(element); 37686 if (element.hasKindElement()) { 37687 composeEnumerationCore("kind", element.getKindElement(), new CarePlan.CarePlanActivityKindEnumFactory(), false); 37688 composeEnumerationExtras("kind", element.getKindElement(), new CarePlan.CarePlanActivityKindEnumFactory(), false); 37689 } 37690 if (element.hasInstantiatesCanonical()) { 37691 openArray("instantiatesCanonical"); 37692 for (CanonicalType e : element.getInstantiatesCanonical()) 37693 composeCanonicalCore(null, e, true); 37694 closeArray(); 37695 if (anyHasExtras(element.getInstantiatesCanonical())) { 37696 openArray("_instantiatesCanonical"); 37697 for (CanonicalType e : element.getInstantiatesCanonical()) 37698 composeCanonicalExtras(null, e, true); 37699 closeArray(); 37700 } 37701 } 37702 ; 37703 if (element.hasInstantiatesUri()) { 37704 openArray("instantiatesUri"); 37705 for (UriType e : element.getInstantiatesUri()) 37706 composeUriCore(null, e, true); 37707 closeArray(); 37708 if (anyHasExtras(element.getInstantiatesUri())) { 37709 openArray("_instantiatesUri"); 37710 for (UriType e : element.getInstantiatesUri()) 37711 composeUriExtras(null, e, true); 37712 closeArray(); 37713 } 37714 } 37715 ; 37716 if (element.hasCode()) { 37717 composeCodeableConcept("code", element.getCode()); 37718 } 37719 if (element.hasReasonCode()) { 37720 openArray("reasonCode"); 37721 for (CodeableConcept e : element.getReasonCode()) 37722 composeCodeableConcept(null, e); 37723 closeArray(); 37724 } 37725 ; 37726 if (element.hasReasonReference()) { 37727 openArray("reasonReference"); 37728 for (Reference e : element.getReasonReference()) 37729 composeReference(null, e); 37730 closeArray(); 37731 } 37732 ; 37733 if (element.hasGoal()) { 37734 openArray("goal"); 37735 for (Reference e : element.getGoal()) 37736 composeReference(null, e); 37737 closeArray(); 37738 } 37739 ; 37740 if (element.hasStatusElement()) { 37741 composeEnumerationCore("status", element.getStatusElement(), new CarePlan.CarePlanActivityStatusEnumFactory(), 37742 false); 37743 composeEnumerationExtras("status", element.getStatusElement(), new CarePlan.CarePlanActivityStatusEnumFactory(), 37744 false); 37745 } 37746 if (element.hasStatusReason()) { 37747 composeCodeableConcept("statusReason", element.getStatusReason()); 37748 } 37749 if (element.hasDoNotPerformElement()) { 37750 composeBooleanCore("doNotPerform", element.getDoNotPerformElement(), false); 37751 composeBooleanExtras("doNotPerform", element.getDoNotPerformElement(), false); 37752 } 37753 if (element.hasScheduled()) { 37754 composeType("scheduled", element.getScheduled()); 37755 } 37756 if (element.hasLocation()) { 37757 composeReference("location", element.getLocation()); 37758 } 37759 if (element.hasPerformer()) { 37760 openArray("performer"); 37761 for (Reference e : element.getPerformer()) 37762 composeReference(null, e); 37763 closeArray(); 37764 } 37765 ; 37766 if (element.hasProduct()) { 37767 composeType("product", element.getProduct()); 37768 } 37769 if (element.hasDailyAmount()) { 37770 composeQuantity("dailyAmount", element.getDailyAmount()); 37771 } 37772 if (element.hasQuantity()) { 37773 composeQuantity("quantity", element.getQuantity()); 37774 } 37775 if (element.hasDescriptionElement()) { 37776 composeStringCore("description", element.getDescriptionElement(), false); 37777 composeStringExtras("description", element.getDescriptionElement(), false); 37778 } 37779 } 37780 37781 protected void composeCareTeam(String name, CareTeam element) throws IOException { 37782 if (element != null) { 37783 prop("resourceType", name); 37784 composeCareTeamInner(element); 37785 } 37786 } 37787 37788 protected void composeCareTeamInner(CareTeam element) throws IOException { 37789 composeDomainResourceElements(element); 37790 if (element.hasIdentifier()) { 37791 openArray("identifier"); 37792 for (Identifier e : element.getIdentifier()) 37793 composeIdentifier(null, e); 37794 closeArray(); 37795 } 37796 ; 37797 if (element.hasStatusElement()) { 37798 composeEnumerationCore("status", element.getStatusElement(), new CareTeam.CareTeamStatusEnumFactory(), false); 37799 composeEnumerationExtras("status", element.getStatusElement(), new CareTeam.CareTeamStatusEnumFactory(), false); 37800 } 37801 if (element.hasCategory()) { 37802 openArray("category"); 37803 for (CodeableConcept e : element.getCategory()) 37804 composeCodeableConcept(null, e); 37805 closeArray(); 37806 } 37807 ; 37808 if (element.hasNameElement()) { 37809 composeStringCore("name", element.getNameElement(), false); 37810 composeStringExtras("name", element.getNameElement(), false); 37811 } 37812 if (element.hasSubject()) { 37813 composeReference("subject", element.getSubject()); 37814 } 37815 if (element.hasEncounter()) { 37816 composeReference("encounter", element.getEncounter()); 37817 } 37818 if (element.hasPeriod()) { 37819 composePeriod("period", element.getPeriod()); 37820 } 37821 if (element.hasParticipant()) { 37822 openArray("participant"); 37823 for (CareTeam.CareTeamParticipantComponent e : element.getParticipant()) 37824 composeCareTeamCareTeamParticipantComponent(null, e); 37825 closeArray(); 37826 } 37827 ; 37828 if (element.hasReasonCode()) { 37829 openArray("reasonCode"); 37830 for (CodeableConcept e : element.getReasonCode()) 37831 composeCodeableConcept(null, e); 37832 closeArray(); 37833 } 37834 ; 37835 if (element.hasReasonReference()) { 37836 openArray("reasonReference"); 37837 for (Reference e : element.getReasonReference()) 37838 composeReference(null, e); 37839 closeArray(); 37840 } 37841 ; 37842 if (element.hasManagingOrganization()) { 37843 openArray("managingOrganization"); 37844 for (Reference e : element.getManagingOrganization()) 37845 composeReference(null, e); 37846 closeArray(); 37847 } 37848 ; 37849 if (element.hasTelecom()) { 37850 openArray("telecom"); 37851 for (ContactPoint e : element.getTelecom()) 37852 composeContactPoint(null, e); 37853 closeArray(); 37854 } 37855 ; 37856 if (element.hasNote()) { 37857 openArray("note"); 37858 for (Annotation e : element.getNote()) 37859 composeAnnotation(null, e); 37860 closeArray(); 37861 } 37862 ; 37863 } 37864 37865 protected void composeCareTeamCareTeamParticipantComponent(String name, CareTeam.CareTeamParticipantComponent element) 37866 throws IOException { 37867 if (element != null) { 37868 open(name); 37869 composeCareTeamCareTeamParticipantComponentInner(element); 37870 close(); 37871 } 37872 } 37873 37874 protected void composeCareTeamCareTeamParticipantComponentInner(CareTeam.CareTeamParticipantComponent element) 37875 throws IOException { 37876 composeBackbone(element); 37877 if (element.hasRole()) { 37878 openArray("role"); 37879 for (CodeableConcept e : element.getRole()) 37880 composeCodeableConcept(null, e); 37881 closeArray(); 37882 } 37883 ; 37884 if (element.hasMember()) { 37885 composeReference("member", element.getMember()); 37886 } 37887 if (element.hasOnBehalfOf()) { 37888 composeReference("onBehalfOf", element.getOnBehalfOf()); 37889 } 37890 if (element.hasPeriod()) { 37891 composePeriod("period", element.getPeriod()); 37892 } 37893 } 37894 37895 protected void composeCatalogEntry(String name, CatalogEntry element) throws IOException { 37896 if (element != null) { 37897 prop("resourceType", name); 37898 composeCatalogEntryInner(element); 37899 } 37900 } 37901 37902 protected void composeCatalogEntryInner(CatalogEntry element) throws IOException { 37903 composeDomainResourceElements(element); 37904 if (element.hasIdentifier()) { 37905 openArray("identifier"); 37906 for (Identifier e : element.getIdentifier()) 37907 composeIdentifier(null, e); 37908 closeArray(); 37909 } 37910 ; 37911 if (element.hasType()) { 37912 composeCodeableConcept("type", element.getType()); 37913 } 37914 if (element.hasOrderableElement()) { 37915 composeBooleanCore("orderable", element.getOrderableElement(), false); 37916 composeBooleanExtras("orderable", element.getOrderableElement(), false); 37917 } 37918 if (element.hasReferencedItem()) { 37919 composeReference("referencedItem", element.getReferencedItem()); 37920 } 37921 if (element.hasAdditionalIdentifier()) { 37922 openArray("additionalIdentifier"); 37923 for (Identifier e : element.getAdditionalIdentifier()) 37924 composeIdentifier(null, e); 37925 closeArray(); 37926 } 37927 ; 37928 if (element.hasClassification()) { 37929 openArray("classification"); 37930 for (CodeableConcept e : element.getClassification()) 37931 composeCodeableConcept(null, e); 37932 closeArray(); 37933 } 37934 ; 37935 if (element.hasStatusElement()) { 37936 composeEnumerationCore("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 37937 false); 37938 composeEnumerationExtras("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 37939 false); 37940 } 37941 if (element.hasValidityPeriod()) { 37942 composePeriod("validityPeriod", element.getValidityPeriod()); 37943 } 37944 if (element.hasValidToElement()) { 37945 composeDateTimeCore("validTo", element.getValidToElement(), false); 37946 composeDateTimeExtras("validTo", element.getValidToElement(), false); 37947 } 37948 if (element.hasLastUpdatedElement()) { 37949 composeDateTimeCore("lastUpdated", element.getLastUpdatedElement(), false); 37950 composeDateTimeExtras("lastUpdated", element.getLastUpdatedElement(), false); 37951 } 37952 if (element.hasAdditionalCharacteristic()) { 37953 openArray("additionalCharacteristic"); 37954 for (CodeableConcept e : element.getAdditionalCharacteristic()) 37955 composeCodeableConcept(null, e); 37956 closeArray(); 37957 } 37958 ; 37959 if (element.hasAdditionalClassification()) { 37960 openArray("additionalClassification"); 37961 for (CodeableConcept e : element.getAdditionalClassification()) 37962 composeCodeableConcept(null, e); 37963 closeArray(); 37964 } 37965 ; 37966 if (element.hasRelatedEntry()) { 37967 openArray("relatedEntry"); 37968 for (CatalogEntry.CatalogEntryRelatedEntryComponent e : element.getRelatedEntry()) 37969 composeCatalogEntryCatalogEntryRelatedEntryComponent(null, e); 37970 closeArray(); 37971 } 37972 ; 37973 } 37974 37975 protected void composeCatalogEntryCatalogEntryRelatedEntryComponent(String name, 37976 CatalogEntry.CatalogEntryRelatedEntryComponent element) throws IOException { 37977 if (element != null) { 37978 open(name); 37979 composeCatalogEntryCatalogEntryRelatedEntryComponentInner(element); 37980 close(); 37981 } 37982 } 37983 37984 protected void composeCatalogEntryCatalogEntryRelatedEntryComponentInner( 37985 CatalogEntry.CatalogEntryRelatedEntryComponent element) throws IOException { 37986 composeBackbone(element); 37987 if (element.hasRelationtypeElement()) { 37988 composeEnumerationCore("relationtype", element.getRelationtypeElement(), 37989 new CatalogEntry.CatalogEntryRelationTypeEnumFactory(), false); 37990 composeEnumerationExtras("relationtype", element.getRelationtypeElement(), 37991 new CatalogEntry.CatalogEntryRelationTypeEnumFactory(), false); 37992 } 37993 if (element.hasItem()) { 37994 composeReference("item", element.getItem()); 37995 } 37996 } 37997 37998 protected void composeChargeItem(String name, ChargeItem element) throws IOException { 37999 if (element != null) { 38000 prop("resourceType", name); 38001 composeChargeItemInner(element); 38002 } 38003 } 38004 38005 protected void composeChargeItemInner(ChargeItem element) throws IOException { 38006 composeDomainResourceElements(element); 38007 if (element.hasIdentifier()) { 38008 openArray("identifier"); 38009 for (Identifier e : element.getIdentifier()) 38010 composeIdentifier(null, e); 38011 closeArray(); 38012 } 38013 ; 38014 if (element.hasDefinitionUri()) { 38015 openArray("definitionUri"); 38016 for (UriType e : element.getDefinitionUri()) 38017 composeUriCore(null, e, true); 38018 closeArray(); 38019 if (anyHasExtras(element.getDefinitionUri())) { 38020 openArray("_definitionUri"); 38021 for (UriType e : element.getDefinitionUri()) 38022 composeUriExtras(null, e, true); 38023 closeArray(); 38024 } 38025 } 38026 ; 38027 if (element.hasDefinitionCanonical()) { 38028 openArray("definitionCanonical"); 38029 for (CanonicalType e : element.getDefinitionCanonical()) 38030 composeCanonicalCore(null, e, true); 38031 closeArray(); 38032 if (anyHasExtras(element.getDefinitionCanonical())) { 38033 openArray("_definitionCanonical"); 38034 for (CanonicalType e : element.getDefinitionCanonical()) 38035 composeCanonicalExtras(null, e, true); 38036 closeArray(); 38037 } 38038 } 38039 ; 38040 if (element.hasStatusElement()) { 38041 composeEnumerationCore("status", element.getStatusElement(), new ChargeItem.ChargeItemStatusEnumFactory(), false); 38042 composeEnumerationExtras("status", element.getStatusElement(), new ChargeItem.ChargeItemStatusEnumFactory(), 38043 false); 38044 } 38045 if (element.hasPartOf()) { 38046 openArray("partOf"); 38047 for (Reference e : element.getPartOf()) 38048 composeReference(null, e); 38049 closeArray(); 38050 } 38051 ; 38052 if (element.hasCode()) { 38053 composeCodeableConcept("code", element.getCode()); 38054 } 38055 if (element.hasSubject()) { 38056 composeReference("subject", element.getSubject()); 38057 } 38058 if (element.hasContext()) { 38059 composeReference("context", element.getContext()); 38060 } 38061 if (element.hasOccurrence()) { 38062 composeType("occurrence", element.getOccurrence()); 38063 } 38064 if (element.hasPerformer()) { 38065 openArray("performer"); 38066 for (ChargeItem.ChargeItemPerformerComponent e : element.getPerformer()) 38067 composeChargeItemChargeItemPerformerComponent(null, e); 38068 closeArray(); 38069 } 38070 ; 38071 if (element.hasPerformingOrganization()) { 38072 composeReference("performingOrganization", element.getPerformingOrganization()); 38073 } 38074 if (element.hasRequestingOrganization()) { 38075 composeReference("requestingOrganization", element.getRequestingOrganization()); 38076 } 38077 if (element.hasCostCenter()) { 38078 composeReference("costCenter", element.getCostCenter()); 38079 } 38080 if (element.hasQuantity()) { 38081 composeQuantity("quantity", element.getQuantity()); 38082 } 38083 if (element.hasBodysite()) { 38084 openArray("bodysite"); 38085 for (CodeableConcept e : element.getBodysite()) 38086 composeCodeableConcept(null, e); 38087 closeArray(); 38088 } 38089 ; 38090 if (element.hasFactorOverrideElement()) { 38091 composeDecimalCore("factorOverride", element.getFactorOverrideElement(), false); 38092 composeDecimalExtras("factorOverride", element.getFactorOverrideElement(), false); 38093 } 38094 if (element.hasPriceOverride()) { 38095 composeMoney("priceOverride", element.getPriceOverride()); 38096 } 38097 if (element.hasOverrideReasonElement()) { 38098 composeStringCore("overrideReason", element.getOverrideReasonElement(), false); 38099 composeStringExtras("overrideReason", element.getOverrideReasonElement(), false); 38100 } 38101 if (element.hasEnterer()) { 38102 composeReference("enterer", element.getEnterer()); 38103 } 38104 if (element.hasEnteredDateElement()) { 38105 composeDateTimeCore("enteredDate", element.getEnteredDateElement(), false); 38106 composeDateTimeExtras("enteredDate", element.getEnteredDateElement(), false); 38107 } 38108 if (element.hasReason()) { 38109 openArray("reason"); 38110 for (CodeableConcept e : element.getReason()) 38111 composeCodeableConcept(null, e); 38112 closeArray(); 38113 } 38114 ; 38115 if (element.hasService()) { 38116 openArray("service"); 38117 for (Reference e : element.getService()) 38118 composeReference(null, e); 38119 closeArray(); 38120 } 38121 ; 38122 if (element.hasProduct()) { 38123 composeType("product", element.getProduct()); 38124 } 38125 if (element.hasAccount()) { 38126 openArray("account"); 38127 for (Reference e : element.getAccount()) 38128 composeReference(null, e); 38129 closeArray(); 38130 } 38131 ; 38132 if (element.hasNote()) { 38133 openArray("note"); 38134 for (Annotation e : element.getNote()) 38135 composeAnnotation(null, e); 38136 closeArray(); 38137 } 38138 ; 38139 if (element.hasSupportingInformation()) { 38140 openArray("supportingInformation"); 38141 for (Reference e : element.getSupportingInformation()) 38142 composeReference(null, e); 38143 closeArray(); 38144 } 38145 ; 38146 } 38147 38148 protected void composeChargeItemChargeItemPerformerComponent(String name, 38149 ChargeItem.ChargeItemPerformerComponent element) throws IOException { 38150 if (element != null) { 38151 open(name); 38152 composeChargeItemChargeItemPerformerComponentInner(element); 38153 close(); 38154 } 38155 } 38156 38157 protected void composeChargeItemChargeItemPerformerComponentInner(ChargeItem.ChargeItemPerformerComponent element) 38158 throws IOException { 38159 composeBackbone(element); 38160 if (element.hasFunction()) { 38161 composeCodeableConcept("function", element.getFunction()); 38162 } 38163 if (element.hasActor()) { 38164 composeReference("actor", element.getActor()); 38165 } 38166 } 38167 38168 protected void composeChargeItemDefinition(String name, ChargeItemDefinition element) throws IOException { 38169 if (element != null) { 38170 prop("resourceType", name); 38171 composeChargeItemDefinitionInner(element); 38172 } 38173 } 38174 38175 protected void composeChargeItemDefinitionInner(ChargeItemDefinition element) throws IOException { 38176 composeDomainResourceElements(element); 38177 if (element.hasUrlElement()) { 38178 composeUriCore("url", element.getUrlElement(), false); 38179 composeUriExtras("url", element.getUrlElement(), false); 38180 } 38181 if (element.hasIdentifier()) { 38182 openArray("identifier"); 38183 for (Identifier e : element.getIdentifier()) 38184 composeIdentifier(null, e); 38185 closeArray(); 38186 } 38187 ; 38188 if (element.hasVersionElement()) { 38189 composeStringCore("version", element.getVersionElement(), false); 38190 composeStringExtras("version", element.getVersionElement(), false); 38191 } 38192 if (element.hasTitleElement()) { 38193 composeStringCore("title", element.getTitleElement(), false); 38194 composeStringExtras("title", element.getTitleElement(), false); 38195 } 38196 if (element.hasDerivedFromUri()) { 38197 openArray("derivedFromUri"); 38198 for (UriType e : element.getDerivedFromUri()) 38199 composeUriCore(null, e, true); 38200 closeArray(); 38201 if (anyHasExtras(element.getDerivedFromUri())) { 38202 openArray("_derivedFromUri"); 38203 for (UriType e : element.getDerivedFromUri()) 38204 composeUriExtras(null, e, true); 38205 closeArray(); 38206 } 38207 } 38208 ; 38209 if (element.hasPartOf()) { 38210 openArray("partOf"); 38211 for (CanonicalType e : element.getPartOf()) 38212 composeCanonicalCore(null, e, true); 38213 closeArray(); 38214 if (anyHasExtras(element.getPartOf())) { 38215 openArray("_partOf"); 38216 for (CanonicalType e : element.getPartOf()) 38217 composeCanonicalExtras(null, e, true); 38218 closeArray(); 38219 } 38220 } 38221 ; 38222 if (element.hasReplaces()) { 38223 openArray("replaces"); 38224 for (CanonicalType e : element.getReplaces()) 38225 composeCanonicalCore(null, e, true); 38226 closeArray(); 38227 if (anyHasExtras(element.getReplaces())) { 38228 openArray("_replaces"); 38229 for (CanonicalType e : element.getReplaces()) 38230 composeCanonicalExtras(null, e, true); 38231 closeArray(); 38232 } 38233 } 38234 ; 38235 if (element.hasStatusElement()) { 38236 composeEnumerationCore("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 38237 false); 38238 composeEnumerationExtras("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 38239 false); 38240 } 38241 if (element.hasExperimentalElement()) { 38242 composeBooleanCore("experimental", element.getExperimentalElement(), false); 38243 composeBooleanExtras("experimental", element.getExperimentalElement(), false); 38244 } 38245 if (element.hasDateElement()) { 38246 composeDateTimeCore("date", element.getDateElement(), false); 38247 composeDateTimeExtras("date", element.getDateElement(), false); 38248 } 38249 if (element.hasPublisherElement()) { 38250 composeStringCore("publisher", element.getPublisherElement(), false); 38251 composeStringExtras("publisher", element.getPublisherElement(), false); 38252 } 38253 if (element.hasContact()) { 38254 openArray("contact"); 38255 for (ContactDetail e : element.getContact()) 38256 composeContactDetail(null, e); 38257 closeArray(); 38258 } 38259 ; 38260 if (element.hasDescriptionElement()) { 38261 composeMarkdownCore("description", element.getDescriptionElement(), false); 38262 composeMarkdownExtras("description", element.getDescriptionElement(), false); 38263 } 38264 if (element.hasUseContext()) { 38265 openArray("useContext"); 38266 for (UsageContext e : element.getUseContext()) 38267 composeUsageContext(null, e); 38268 closeArray(); 38269 } 38270 ; 38271 if (element.hasJurisdiction()) { 38272 openArray("jurisdiction"); 38273 for (CodeableConcept e : element.getJurisdiction()) 38274 composeCodeableConcept(null, e); 38275 closeArray(); 38276 } 38277 ; 38278 if (element.hasCopyrightElement()) { 38279 composeMarkdownCore("copyright", element.getCopyrightElement(), false); 38280 composeMarkdownExtras("copyright", element.getCopyrightElement(), false); 38281 } 38282 if (element.hasApprovalDateElement()) { 38283 composeDateCore("approvalDate", element.getApprovalDateElement(), false); 38284 composeDateExtras("approvalDate", element.getApprovalDateElement(), false); 38285 } 38286 if (element.hasLastReviewDateElement()) { 38287 composeDateCore("lastReviewDate", element.getLastReviewDateElement(), false); 38288 composeDateExtras("lastReviewDate", element.getLastReviewDateElement(), false); 38289 } 38290 if (element.hasEffectivePeriod()) { 38291 composePeriod("effectivePeriod", element.getEffectivePeriod()); 38292 } 38293 if (element.hasCode()) { 38294 composeCodeableConcept("code", element.getCode()); 38295 } 38296 if (element.hasInstance()) { 38297 openArray("instance"); 38298 for (Reference e : element.getInstance()) 38299 composeReference(null, e); 38300 closeArray(); 38301 } 38302 ; 38303 if (element.hasApplicability()) { 38304 openArray("applicability"); 38305 for (ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent e : element.getApplicability()) 38306 composeChargeItemDefinitionChargeItemDefinitionApplicabilityComponent(null, e); 38307 closeArray(); 38308 } 38309 ; 38310 if (element.hasPropertyGroup()) { 38311 openArray("propertyGroup"); 38312 for (ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent e : element.getPropertyGroup()) 38313 composeChargeItemDefinitionChargeItemDefinitionPropertyGroupComponent(null, e); 38314 closeArray(); 38315 } 38316 ; 38317 } 38318 38319 protected void composeChargeItemDefinitionChargeItemDefinitionApplicabilityComponent(String name, 38320 ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent element) throws IOException { 38321 if (element != null) { 38322 open(name); 38323 composeChargeItemDefinitionChargeItemDefinitionApplicabilityComponentInner(element); 38324 close(); 38325 } 38326 } 38327 38328 protected void composeChargeItemDefinitionChargeItemDefinitionApplicabilityComponentInner( 38329 ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent element) throws IOException { 38330 composeBackbone(element); 38331 if (element.hasDescriptionElement()) { 38332 composeStringCore("description", element.getDescriptionElement(), false); 38333 composeStringExtras("description", element.getDescriptionElement(), false); 38334 } 38335 if (element.hasLanguageElement()) { 38336 composeStringCore("language", element.getLanguageElement(), false); 38337 composeStringExtras("language", element.getLanguageElement(), false); 38338 } 38339 if (element.hasExpressionElement()) { 38340 composeStringCore("expression", element.getExpressionElement(), false); 38341 composeStringExtras("expression", element.getExpressionElement(), false); 38342 } 38343 } 38344 38345 protected void composeChargeItemDefinitionChargeItemDefinitionPropertyGroupComponent(String name, 38346 ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent element) throws IOException { 38347 if (element != null) { 38348 open(name); 38349 composeChargeItemDefinitionChargeItemDefinitionPropertyGroupComponentInner(element); 38350 close(); 38351 } 38352 } 38353 38354 protected void composeChargeItemDefinitionChargeItemDefinitionPropertyGroupComponentInner( 38355 ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent element) throws IOException { 38356 composeBackbone(element); 38357 if (element.hasApplicability()) { 38358 openArray("applicability"); 38359 for (ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent e : element.getApplicability()) 38360 composeChargeItemDefinitionChargeItemDefinitionApplicabilityComponent(null, e); 38361 closeArray(); 38362 } 38363 ; 38364 if (element.hasPriceComponent()) { 38365 openArray("priceComponent"); 38366 for (ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent e : element 38367 .getPriceComponent()) 38368 composeChargeItemDefinitionChargeItemDefinitionPropertyGroupPriceComponentComponent(null, e); 38369 closeArray(); 38370 } 38371 ; 38372 } 38373 38374 protected void composeChargeItemDefinitionChargeItemDefinitionPropertyGroupPriceComponentComponent(String name, 38375 ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent element) throws IOException { 38376 if (element != null) { 38377 open(name); 38378 composeChargeItemDefinitionChargeItemDefinitionPropertyGroupPriceComponentComponentInner(element); 38379 close(); 38380 } 38381 } 38382 38383 protected void composeChargeItemDefinitionChargeItemDefinitionPropertyGroupPriceComponentComponentInner( 38384 ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent element) throws IOException { 38385 composeBackbone(element); 38386 if (element.hasTypeElement()) { 38387 composeEnumerationCore("type", element.getTypeElement(), 38388 new ChargeItemDefinition.ChargeItemDefinitionPriceComponentTypeEnumFactory(), false); 38389 composeEnumerationExtras("type", element.getTypeElement(), 38390 new ChargeItemDefinition.ChargeItemDefinitionPriceComponentTypeEnumFactory(), false); 38391 } 38392 if (element.hasCode()) { 38393 composeCodeableConcept("code", element.getCode()); 38394 } 38395 if (element.hasFactorElement()) { 38396 composeDecimalCore("factor", element.getFactorElement(), false); 38397 composeDecimalExtras("factor", element.getFactorElement(), false); 38398 } 38399 if (element.hasAmount()) { 38400 composeMoney("amount", element.getAmount()); 38401 } 38402 } 38403 38404 protected void composeClaim(String name, Claim element) throws IOException { 38405 if (element != null) { 38406 prop("resourceType", name); 38407 composeClaimInner(element); 38408 } 38409 } 38410 38411 protected void composeClaimInner(Claim element) throws IOException { 38412 composeDomainResourceElements(element); 38413 if (element.hasIdentifier()) { 38414 openArray("identifier"); 38415 for (Identifier e : element.getIdentifier()) 38416 composeIdentifier(null, e); 38417 closeArray(); 38418 } 38419 ; 38420 if (element.hasStatusElement()) { 38421 composeEnumerationCore("status", element.getStatusElement(), new Claim.ClaimStatusEnumFactory(), false); 38422 composeEnumerationExtras("status", element.getStatusElement(), new Claim.ClaimStatusEnumFactory(), false); 38423 } 38424 if (element.hasType()) { 38425 composeCodeableConcept("type", element.getType()); 38426 } 38427 if (element.hasSubType()) { 38428 composeCodeableConcept("subType", element.getSubType()); 38429 } 38430 if (element.hasUseElement()) { 38431 composeEnumerationCore("use", element.getUseElement(), new Claim.UseEnumFactory(), false); 38432 composeEnumerationExtras("use", element.getUseElement(), new Claim.UseEnumFactory(), false); 38433 } 38434 if (element.hasPatient()) { 38435 composeReference("patient", element.getPatient()); 38436 } 38437 if (element.hasBillablePeriod()) { 38438 composePeriod("billablePeriod", element.getBillablePeriod()); 38439 } 38440 if (element.hasCreatedElement()) { 38441 composeDateTimeCore("created", element.getCreatedElement(), false); 38442 composeDateTimeExtras("created", element.getCreatedElement(), false); 38443 } 38444 if (element.hasEnterer()) { 38445 composeReference("enterer", element.getEnterer()); 38446 } 38447 if (element.hasInsurer()) { 38448 composeReference("insurer", element.getInsurer()); 38449 } 38450 if (element.hasProvider()) { 38451 composeReference("provider", element.getProvider()); 38452 } 38453 if (element.hasPriority()) { 38454 composeCodeableConcept("priority", element.getPriority()); 38455 } 38456 if (element.hasFundsReserve()) { 38457 composeCodeableConcept("fundsReserve", element.getFundsReserve()); 38458 } 38459 if (element.hasRelated()) { 38460 openArray("related"); 38461 for (Claim.RelatedClaimComponent e : element.getRelated()) 38462 composeClaimRelatedClaimComponent(null, e); 38463 closeArray(); 38464 } 38465 ; 38466 if (element.hasPrescription()) { 38467 composeReference("prescription", element.getPrescription()); 38468 } 38469 if (element.hasOriginalPrescription()) { 38470 composeReference("originalPrescription", element.getOriginalPrescription()); 38471 } 38472 if (element.hasPayee()) { 38473 composeClaimPayeeComponent("payee", element.getPayee()); 38474 } 38475 if (element.hasReferral()) { 38476 composeReference("referral", element.getReferral()); 38477 } 38478 if (element.hasFacility()) { 38479 composeReference("facility", element.getFacility()); 38480 } 38481 if (element.hasCareTeam()) { 38482 openArray("careTeam"); 38483 for (Claim.CareTeamComponent e : element.getCareTeam()) 38484 composeClaimCareTeamComponent(null, e); 38485 closeArray(); 38486 } 38487 ; 38488 if (element.hasSupportingInfo()) { 38489 openArray("supportingInfo"); 38490 for (Claim.SupportingInformationComponent e : element.getSupportingInfo()) 38491 composeClaimSupportingInformationComponent(null, e); 38492 closeArray(); 38493 } 38494 ; 38495 if (element.hasDiagnosis()) { 38496 openArray("diagnosis"); 38497 for (Claim.DiagnosisComponent e : element.getDiagnosis()) 38498 composeClaimDiagnosisComponent(null, e); 38499 closeArray(); 38500 } 38501 ; 38502 if (element.hasProcedure()) { 38503 openArray("procedure"); 38504 for (Claim.ProcedureComponent e : element.getProcedure()) 38505 composeClaimProcedureComponent(null, e); 38506 closeArray(); 38507 } 38508 ; 38509 if (element.hasInsurance()) { 38510 openArray("insurance"); 38511 for (Claim.InsuranceComponent e : element.getInsurance()) 38512 composeClaimInsuranceComponent(null, e); 38513 closeArray(); 38514 } 38515 ; 38516 if (element.hasAccident()) { 38517 composeClaimAccidentComponent("accident", element.getAccident()); 38518 } 38519 if (element.hasItem()) { 38520 openArray("item"); 38521 for (Claim.ItemComponent e : element.getItem()) 38522 composeClaimItemComponent(null, e); 38523 closeArray(); 38524 } 38525 ; 38526 if (element.hasTotal()) { 38527 composeMoney("total", element.getTotal()); 38528 } 38529 } 38530 38531 protected void composeClaimRelatedClaimComponent(String name, Claim.RelatedClaimComponent element) 38532 throws IOException { 38533 if (element != null) { 38534 open(name); 38535 composeClaimRelatedClaimComponentInner(element); 38536 close(); 38537 } 38538 } 38539 38540 protected void composeClaimRelatedClaimComponentInner(Claim.RelatedClaimComponent element) throws IOException { 38541 composeBackbone(element); 38542 if (element.hasClaim()) { 38543 composeReference("claim", element.getClaim()); 38544 } 38545 if (element.hasRelationship()) { 38546 composeCodeableConcept("relationship", element.getRelationship()); 38547 } 38548 if (element.hasReference()) { 38549 composeIdentifier("reference", element.getReference()); 38550 } 38551 } 38552 38553 protected void composeClaimPayeeComponent(String name, Claim.PayeeComponent element) throws IOException { 38554 if (element != null) { 38555 open(name); 38556 composeClaimPayeeComponentInner(element); 38557 close(); 38558 } 38559 } 38560 38561 protected void composeClaimPayeeComponentInner(Claim.PayeeComponent element) throws IOException { 38562 composeBackbone(element); 38563 if (element.hasType()) { 38564 composeCodeableConcept("type", element.getType()); 38565 } 38566 if (element.hasParty()) { 38567 composeReference("party", element.getParty()); 38568 } 38569 } 38570 38571 protected void composeClaimCareTeamComponent(String name, Claim.CareTeamComponent element) throws IOException { 38572 if (element != null) { 38573 open(name); 38574 composeClaimCareTeamComponentInner(element); 38575 close(); 38576 } 38577 } 38578 38579 protected void composeClaimCareTeamComponentInner(Claim.CareTeamComponent element) throws IOException { 38580 composeBackbone(element); 38581 if (element.hasSequenceElement()) { 38582 composePositiveIntCore("sequence", element.getSequenceElement(), false); 38583 composePositiveIntExtras("sequence", element.getSequenceElement(), false); 38584 } 38585 if (element.hasProvider()) { 38586 composeReference("provider", element.getProvider()); 38587 } 38588 if (element.hasResponsibleElement()) { 38589 composeBooleanCore("responsible", element.getResponsibleElement(), false); 38590 composeBooleanExtras("responsible", element.getResponsibleElement(), false); 38591 } 38592 if (element.hasRole()) { 38593 composeCodeableConcept("role", element.getRole()); 38594 } 38595 if (element.hasQualification()) { 38596 composeCodeableConcept("qualification", element.getQualification()); 38597 } 38598 } 38599 38600 protected void composeClaimSupportingInformationComponent(String name, Claim.SupportingInformationComponent element) 38601 throws IOException { 38602 if (element != null) { 38603 open(name); 38604 composeClaimSupportingInformationComponentInner(element); 38605 close(); 38606 } 38607 } 38608 38609 protected void composeClaimSupportingInformationComponentInner(Claim.SupportingInformationComponent element) 38610 throws IOException { 38611 composeBackbone(element); 38612 if (element.hasSequenceElement()) { 38613 composePositiveIntCore("sequence", element.getSequenceElement(), false); 38614 composePositiveIntExtras("sequence", element.getSequenceElement(), false); 38615 } 38616 if (element.hasCategory()) { 38617 composeCodeableConcept("category", element.getCategory()); 38618 } 38619 if (element.hasCode()) { 38620 composeCodeableConcept("code", element.getCode()); 38621 } 38622 if (element.hasTiming()) { 38623 composeType("timing", element.getTiming()); 38624 } 38625 if (element.hasValue()) { 38626 composeType("value", element.getValue()); 38627 } 38628 if (element.hasReason()) { 38629 composeCodeableConcept("reason", element.getReason()); 38630 } 38631 } 38632 38633 protected void composeClaimDiagnosisComponent(String name, Claim.DiagnosisComponent element) throws IOException { 38634 if (element != null) { 38635 open(name); 38636 composeClaimDiagnosisComponentInner(element); 38637 close(); 38638 } 38639 } 38640 38641 protected void composeClaimDiagnosisComponentInner(Claim.DiagnosisComponent element) throws IOException { 38642 composeBackbone(element); 38643 if (element.hasSequenceElement()) { 38644 composePositiveIntCore("sequence", element.getSequenceElement(), false); 38645 composePositiveIntExtras("sequence", element.getSequenceElement(), false); 38646 } 38647 if (element.hasDiagnosis()) { 38648 composeType("diagnosis", element.getDiagnosis()); 38649 } 38650 if (element.hasType()) { 38651 openArray("type"); 38652 for (CodeableConcept e : element.getType()) 38653 composeCodeableConcept(null, e); 38654 closeArray(); 38655 } 38656 ; 38657 if (element.hasOnAdmission()) { 38658 composeCodeableConcept("onAdmission", element.getOnAdmission()); 38659 } 38660 if (element.hasPackageCode()) { 38661 composeCodeableConcept("packageCode", element.getPackageCode()); 38662 } 38663 } 38664 38665 protected void composeClaimProcedureComponent(String name, Claim.ProcedureComponent element) throws IOException { 38666 if (element != null) { 38667 open(name); 38668 composeClaimProcedureComponentInner(element); 38669 close(); 38670 } 38671 } 38672 38673 protected void composeClaimProcedureComponentInner(Claim.ProcedureComponent element) throws IOException { 38674 composeBackbone(element); 38675 if (element.hasSequenceElement()) { 38676 composePositiveIntCore("sequence", element.getSequenceElement(), false); 38677 composePositiveIntExtras("sequence", element.getSequenceElement(), false); 38678 } 38679 if (element.hasType()) { 38680 openArray("type"); 38681 for (CodeableConcept e : element.getType()) 38682 composeCodeableConcept(null, e); 38683 closeArray(); 38684 } 38685 ; 38686 if (element.hasDateElement()) { 38687 composeDateTimeCore("date", element.getDateElement(), false); 38688 composeDateTimeExtras("date", element.getDateElement(), false); 38689 } 38690 if (element.hasProcedure()) { 38691 composeType("procedure", element.getProcedure()); 38692 } 38693 if (element.hasUdi()) { 38694 openArray("udi"); 38695 for (Reference e : element.getUdi()) 38696 composeReference(null, e); 38697 closeArray(); 38698 } 38699 ; 38700 } 38701 38702 protected void composeClaimInsuranceComponent(String name, Claim.InsuranceComponent element) throws IOException { 38703 if (element != null) { 38704 open(name); 38705 composeClaimInsuranceComponentInner(element); 38706 close(); 38707 } 38708 } 38709 38710 protected void composeClaimInsuranceComponentInner(Claim.InsuranceComponent element) throws IOException { 38711 composeBackbone(element); 38712 if (element.hasSequenceElement()) { 38713 composePositiveIntCore("sequence", element.getSequenceElement(), false); 38714 composePositiveIntExtras("sequence", element.getSequenceElement(), false); 38715 } 38716 if (element.hasFocalElement()) { 38717 composeBooleanCore("focal", element.getFocalElement(), false); 38718 composeBooleanExtras("focal", element.getFocalElement(), false); 38719 } 38720 if (element.hasIdentifier()) { 38721 composeIdentifier("identifier", element.getIdentifier()); 38722 } 38723 if (element.hasCoverage()) { 38724 composeReference("coverage", element.getCoverage()); 38725 } 38726 if (element.hasBusinessArrangementElement()) { 38727 composeStringCore("businessArrangement", element.getBusinessArrangementElement(), false); 38728 composeStringExtras("businessArrangement", element.getBusinessArrangementElement(), false); 38729 } 38730 if (element.hasPreAuthRef()) { 38731 openArray("preAuthRef"); 38732 for (StringType e : element.getPreAuthRef()) 38733 composeStringCore(null, e, true); 38734 closeArray(); 38735 if (anyHasExtras(element.getPreAuthRef())) { 38736 openArray("_preAuthRef"); 38737 for (StringType e : element.getPreAuthRef()) 38738 composeStringExtras(null, e, true); 38739 closeArray(); 38740 } 38741 } 38742 ; 38743 if (element.hasClaimResponse()) { 38744 composeReference("claimResponse", element.getClaimResponse()); 38745 } 38746 } 38747 38748 protected void composeClaimAccidentComponent(String name, Claim.AccidentComponent element) throws IOException { 38749 if (element != null) { 38750 open(name); 38751 composeClaimAccidentComponentInner(element); 38752 close(); 38753 } 38754 } 38755 38756 protected void composeClaimAccidentComponentInner(Claim.AccidentComponent element) throws IOException { 38757 composeBackbone(element); 38758 if (element.hasDateElement()) { 38759 composeDateCore("date", element.getDateElement(), false); 38760 composeDateExtras("date", element.getDateElement(), false); 38761 } 38762 if (element.hasType()) { 38763 composeCodeableConcept("type", element.getType()); 38764 } 38765 if (element.hasLocation()) { 38766 composeType("location", element.getLocation()); 38767 } 38768 } 38769 38770 protected void composeClaimItemComponent(String name, Claim.ItemComponent element) throws IOException { 38771 if (element != null) { 38772 open(name); 38773 composeClaimItemComponentInner(element); 38774 close(); 38775 } 38776 } 38777 38778 protected void composeClaimItemComponentInner(Claim.ItemComponent element) throws IOException { 38779 composeBackbone(element); 38780 if (element.hasSequenceElement()) { 38781 composePositiveIntCore("sequence", element.getSequenceElement(), false); 38782 composePositiveIntExtras("sequence", element.getSequenceElement(), false); 38783 } 38784 if (element.hasCareTeamSequence()) { 38785 openArray("careTeamSequence"); 38786 for (PositiveIntType e : element.getCareTeamSequence()) 38787 composePositiveIntCore(null, e, true); 38788 closeArray(); 38789 if (anyHasExtras(element.getCareTeamSequence())) { 38790 openArray("_careTeamSequence"); 38791 for (PositiveIntType e : element.getCareTeamSequence()) 38792 composePositiveIntExtras(null, e, true); 38793 closeArray(); 38794 } 38795 } 38796 ; 38797 if (element.hasDiagnosisSequence()) { 38798 openArray("diagnosisSequence"); 38799 for (PositiveIntType e : element.getDiagnosisSequence()) 38800 composePositiveIntCore(null, e, true); 38801 closeArray(); 38802 if (anyHasExtras(element.getDiagnosisSequence())) { 38803 openArray("_diagnosisSequence"); 38804 for (PositiveIntType e : element.getDiagnosisSequence()) 38805 composePositiveIntExtras(null, e, true); 38806 closeArray(); 38807 } 38808 } 38809 ; 38810 if (element.hasProcedureSequence()) { 38811 openArray("procedureSequence"); 38812 for (PositiveIntType e : element.getProcedureSequence()) 38813 composePositiveIntCore(null, e, true); 38814 closeArray(); 38815 if (anyHasExtras(element.getProcedureSequence())) { 38816 openArray("_procedureSequence"); 38817 for (PositiveIntType e : element.getProcedureSequence()) 38818 composePositiveIntExtras(null, e, true); 38819 closeArray(); 38820 } 38821 } 38822 ; 38823 if (element.hasInformationSequence()) { 38824 openArray("informationSequence"); 38825 for (PositiveIntType e : element.getInformationSequence()) 38826 composePositiveIntCore(null, e, true); 38827 closeArray(); 38828 if (anyHasExtras(element.getInformationSequence())) { 38829 openArray("_informationSequence"); 38830 for (PositiveIntType e : element.getInformationSequence()) 38831 composePositiveIntExtras(null, e, true); 38832 closeArray(); 38833 } 38834 } 38835 ; 38836 if (element.hasRevenue()) { 38837 composeCodeableConcept("revenue", element.getRevenue()); 38838 } 38839 if (element.hasCategory()) { 38840 composeCodeableConcept("category", element.getCategory()); 38841 } 38842 if (element.hasProductOrService()) { 38843 composeCodeableConcept("productOrService", element.getProductOrService()); 38844 } 38845 if (element.hasModifier()) { 38846 openArray("modifier"); 38847 for (CodeableConcept e : element.getModifier()) 38848 composeCodeableConcept(null, e); 38849 closeArray(); 38850 } 38851 ; 38852 if (element.hasProgramCode()) { 38853 openArray("programCode"); 38854 for (CodeableConcept e : element.getProgramCode()) 38855 composeCodeableConcept(null, e); 38856 closeArray(); 38857 } 38858 ; 38859 if (element.hasServiced()) { 38860 composeType("serviced", element.getServiced()); 38861 } 38862 if (element.hasLocation()) { 38863 composeType("location", element.getLocation()); 38864 } 38865 if (element.hasQuantity()) { 38866 composeQuantity("quantity", element.getQuantity()); 38867 } 38868 if (element.hasUnitPrice()) { 38869 composeMoney("unitPrice", element.getUnitPrice()); 38870 } 38871 if (element.hasFactorElement()) { 38872 composeDecimalCore("factor", element.getFactorElement(), false); 38873 composeDecimalExtras("factor", element.getFactorElement(), false); 38874 } 38875 if (element.hasNet()) { 38876 composeMoney("net", element.getNet()); 38877 } 38878 if (element.hasUdi()) { 38879 openArray("udi"); 38880 for (Reference e : element.getUdi()) 38881 composeReference(null, e); 38882 closeArray(); 38883 } 38884 ; 38885 if (element.hasBodySite()) { 38886 composeCodeableConcept("bodySite", element.getBodySite()); 38887 } 38888 if (element.hasSubSite()) { 38889 openArray("subSite"); 38890 for (CodeableConcept e : element.getSubSite()) 38891 composeCodeableConcept(null, e); 38892 closeArray(); 38893 } 38894 ; 38895 if (element.hasEncounter()) { 38896 openArray("encounter"); 38897 for (Reference e : element.getEncounter()) 38898 composeReference(null, e); 38899 closeArray(); 38900 } 38901 ; 38902 if (element.hasDetail()) { 38903 openArray("detail"); 38904 for (Claim.DetailComponent e : element.getDetail()) 38905 composeClaimDetailComponent(null, e); 38906 closeArray(); 38907 } 38908 ; 38909 } 38910 38911 protected void composeClaimDetailComponent(String name, Claim.DetailComponent element) throws IOException { 38912 if (element != null) { 38913 open(name); 38914 composeClaimDetailComponentInner(element); 38915 close(); 38916 } 38917 } 38918 38919 protected void composeClaimDetailComponentInner(Claim.DetailComponent element) throws IOException { 38920 composeBackbone(element); 38921 if (element.hasSequenceElement()) { 38922 composePositiveIntCore("sequence", element.getSequenceElement(), false); 38923 composePositiveIntExtras("sequence", element.getSequenceElement(), false); 38924 } 38925 if (element.hasRevenue()) { 38926 composeCodeableConcept("revenue", element.getRevenue()); 38927 } 38928 if (element.hasCategory()) { 38929 composeCodeableConcept("category", element.getCategory()); 38930 } 38931 if (element.hasProductOrService()) { 38932 composeCodeableConcept("productOrService", element.getProductOrService()); 38933 } 38934 if (element.hasModifier()) { 38935 openArray("modifier"); 38936 for (CodeableConcept e : element.getModifier()) 38937 composeCodeableConcept(null, e); 38938 closeArray(); 38939 } 38940 ; 38941 if (element.hasProgramCode()) { 38942 openArray("programCode"); 38943 for (CodeableConcept e : element.getProgramCode()) 38944 composeCodeableConcept(null, e); 38945 closeArray(); 38946 } 38947 ; 38948 if (element.hasQuantity()) { 38949 composeQuantity("quantity", element.getQuantity()); 38950 } 38951 if (element.hasUnitPrice()) { 38952 composeMoney("unitPrice", element.getUnitPrice()); 38953 } 38954 if (element.hasFactorElement()) { 38955 composeDecimalCore("factor", element.getFactorElement(), false); 38956 composeDecimalExtras("factor", element.getFactorElement(), false); 38957 } 38958 if (element.hasNet()) { 38959 composeMoney("net", element.getNet()); 38960 } 38961 if (element.hasUdi()) { 38962 openArray("udi"); 38963 for (Reference e : element.getUdi()) 38964 composeReference(null, e); 38965 closeArray(); 38966 } 38967 ; 38968 if (element.hasSubDetail()) { 38969 openArray("subDetail"); 38970 for (Claim.SubDetailComponent e : element.getSubDetail()) 38971 composeClaimSubDetailComponent(null, e); 38972 closeArray(); 38973 } 38974 ; 38975 } 38976 38977 protected void composeClaimSubDetailComponent(String name, Claim.SubDetailComponent element) throws IOException { 38978 if (element != null) { 38979 open(name); 38980 composeClaimSubDetailComponentInner(element); 38981 close(); 38982 } 38983 } 38984 38985 protected void composeClaimSubDetailComponentInner(Claim.SubDetailComponent element) throws IOException { 38986 composeBackbone(element); 38987 if (element.hasSequenceElement()) { 38988 composePositiveIntCore("sequence", element.getSequenceElement(), false); 38989 composePositiveIntExtras("sequence", element.getSequenceElement(), false); 38990 } 38991 if (element.hasRevenue()) { 38992 composeCodeableConcept("revenue", element.getRevenue()); 38993 } 38994 if (element.hasCategory()) { 38995 composeCodeableConcept("category", element.getCategory()); 38996 } 38997 if (element.hasProductOrService()) { 38998 composeCodeableConcept("productOrService", element.getProductOrService()); 38999 } 39000 if (element.hasModifier()) { 39001 openArray("modifier"); 39002 for (CodeableConcept e : element.getModifier()) 39003 composeCodeableConcept(null, e); 39004 closeArray(); 39005 } 39006 ; 39007 if (element.hasProgramCode()) { 39008 openArray("programCode"); 39009 for (CodeableConcept e : element.getProgramCode()) 39010 composeCodeableConcept(null, e); 39011 closeArray(); 39012 } 39013 ; 39014 if (element.hasQuantity()) { 39015 composeQuantity("quantity", element.getQuantity()); 39016 } 39017 if (element.hasUnitPrice()) { 39018 composeMoney("unitPrice", element.getUnitPrice()); 39019 } 39020 if (element.hasFactorElement()) { 39021 composeDecimalCore("factor", element.getFactorElement(), false); 39022 composeDecimalExtras("factor", element.getFactorElement(), false); 39023 } 39024 if (element.hasNet()) { 39025 composeMoney("net", element.getNet()); 39026 } 39027 if (element.hasUdi()) { 39028 openArray("udi"); 39029 for (Reference e : element.getUdi()) 39030 composeReference(null, e); 39031 closeArray(); 39032 } 39033 ; 39034 } 39035 39036 protected void composeClaimResponse(String name, ClaimResponse element) throws IOException { 39037 if (element != null) { 39038 prop("resourceType", name); 39039 composeClaimResponseInner(element); 39040 } 39041 } 39042 39043 protected void composeClaimResponseInner(ClaimResponse element) throws IOException { 39044 composeDomainResourceElements(element); 39045 if (element.hasIdentifier()) { 39046 openArray("identifier"); 39047 for (Identifier e : element.getIdentifier()) 39048 composeIdentifier(null, e); 39049 closeArray(); 39050 } 39051 ; 39052 if (element.hasStatusElement()) { 39053 composeEnumerationCore("status", element.getStatusElement(), new ClaimResponse.ClaimResponseStatusEnumFactory(), 39054 false); 39055 composeEnumerationExtras("status", element.getStatusElement(), new ClaimResponse.ClaimResponseStatusEnumFactory(), 39056 false); 39057 } 39058 if (element.hasType()) { 39059 composeCodeableConcept("type", element.getType()); 39060 } 39061 if (element.hasSubType()) { 39062 composeCodeableConcept("subType", element.getSubType()); 39063 } 39064 if (element.hasUseElement()) { 39065 composeEnumerationCore("use", element.getUseElement(), new ClaimResponse.UseEnumFactory(), false); 39066 composeEnumerationExtras("use", element.getUseElement(), new ClaimResponse.UseEnumFactory(), false); 39067 } 39068 if (element.hasPatient()) { 39069 composeReference("patient", element.getPatient()); 39070 } 39071 if (element.hasCreatedElement()) { 39072 composeDateTimeCore("created", element.getCreatedElement(), false); 39073 composeDateTimeExtras("created", element.getCreatedElement(), false); 39074 } 39075 if (element.hasInsurer()) { 39076 composeReference("insurer", element.getInsurer()); 39077 } 39078 if (element.hasRequestor()) { 39079 composeReference("requestor", element.getRequestor()); 39080 } 39081 if (element.hasRequest()) { 39082 composeReference("request", element.getRequest()); 39083 } 39084 if (element.hasOutcomeElement()) { 39085 composeEnumerationCore("outcome", element.getOutcomeElement(), new ClaimResponse.RemittanceOutcomeEnumFactory(), 39086 false); 39087 composeEnumerationExtras("outcome", element.getOutcomeElement(), new ClaimResponse.RemittanceOutcomeEnumFactory(), 39088 false); 39089 } 39090 if (element.hasDispositionElement()) { 39091 composeStringCore("disposition", element.getDispositionElement(), false); 39092 composeStringExtras("disposition", element.getDispositionElement(), false); 39093 } 39094 if (element.hasPreAuthRefElement()) { 39095 composeStringCore("preAuthRef", element.getPreAuthRefElement(), false); 39096 composeStringExtras("preAuthRef", element.getPreAuthRefElement(), false); 39097 } 39098 if (element.hasPreAuthPeriod()) { 39099 composePeriod("preAuthPeriod", element.getPreAuthPeriod()); 39100 } 39101 if (element.hasPayeeType()) { 39102 composeCodeableConcept("payeeType", element.getPayeeType()); 39103 } 39104 if (element.hasItem()) { 39105 openArray("item"); 39106 for (ClaimResponse.ItemComponent e : element.getItem()) 39107 composeClaimResponseItemComponent(null, e); 39108 closeArray(); 39109 } 39110 ; 39111 if (element.hasAddItem()) { 39112 openArray("addItem"); 39113 for (ClaimResponse.AddedItemComponent e : element.getAddItem()) 39114 composeClaimResponseAddedItemComponent(null, e); 39115 closeArray(); 39116 } 39117 ; 39118 if (element.hasAdjudication()) { 39119 openArray("adjudication"); 39120 for (ClaimResponse.AdjudicationComponent e : element.getAdjudication()) 39121 composeClaimResponseAdjudicationComponent(null, e); 39122 closeArray(); 39123 } 39124 ; 39125 if (element.hasTotal()) { 39126 openArray("total"); 39127 for (ClaimResponse.TotalComponent e : element.getTotal()) 39128 composeClaimResponseTotalComponent(null, e); 39129 closeArray(); 39130 } 39131 ; 39132 if (element.hasPayment()) { 39133 composeClaimResponsePaymentComponent("payment", element.getPayment()); 39134 } 39135 if (element.hasFundsReserve()) { 39136 composeCodeableConcept("fundsReserve", element.getFundsReserve()); 39137 } 39138 if (element.hasFormCode()) { 39139 composeCodeableConcept("formCode", element.getFormCode()); 39140 } 39141 if (element.hasForm()) { 39142 composeAttachment("form", element.getForm()); 39143 } 39144 if (element.hasProcessNote()) { 39145 openArray("processNote"); 39146 for (ClaimResponse.NoteComponent e : element.getProcessNote()) 39147 composeClaimResponseNoteComponent(null, e); 39148 closeArray(); 39149 } 39150 ; 39151 if (element.hasCommunicationRequest()) { 39152 openArray("communicationRequest"); 39153 for (Reference e : element.getCommunicationRequest()) 39154 composeReference(null, e); 39155 closeArray(); 39156 } 39157 ; 39158 if (element.hasInsurance()) { 39159 openArray("insurance"); 39160 for (ClaimResponse.InsuranceComponent e : element.getInsurance()) 39161 composeClaimResponseInsuranceComponent(null, e); 39162 closeArray(); 39163 } 39164 ; 39165 if (element.hasError()) { 39166 openArray("error"); 39167 for (ClaimResponse.ErrorComponent e : element.getError()) 39168 composeClaimResponseErrorComponent(null, e); 39169 closeArray(); 39170 } 39171 ; 39172 } 39173 39174 protected void composeClaimResponseItemComponent(String name, ClaimResponse.ItemComponent element) 39175 throws IOException { 39176 if (element != null) { 39177 open(name); 39178 composeClaimResponseItemComponentInner(element); 39179 close(); 39180 } 39181 } 39182 39183 protected void composeClaimResponseItemComponentInner(ClaimResponse.ItemComponent element) throws IOException { 39184 composeBackbone(element); 39185 if (element.hasItemSequenceElement()) { 39186 composePositiveIntCore("itemSequence", element.getItemSequenceElement(), false); 39187 composePositiveIntExtras("itemSequence", element.getItemSequenceElement(), false); 39188 } 39189 if (element.hasNoteNumber()) { 39190 openArray("noteNumber"); 39191 for (PositiveIntType e : element.getNoteNumber()) 39192 composePositiveIntCore(null, e, true); 39193 closeArray(); 39194 if (anyHasExtras(element.getNoteNumber())) { 39195 openArray("_noteNumber"); 39196 for (PositiveIntType e : element.getNoteNumber()) 39197 composePositiveIntExtras(null, e, true); 39198 closeArray(); 39199 } 39200 } 39201 ; 39202 if (element.hasAdjudication()) { 39203 openArray("adjudication"); 39204 for (ClaimResponse.AdjudicationComponent e : element.getAdjudication()) 39205 composeClaimResponseAdjudicationComponent(null, e); 39206 closeArray(); 39207 } 39208 ; 39209 if (element.hasDetail()) { 39210 openArray("detail"); 39211 for (ClaimResponse.ItemDetailComponent e : element.getDetail()) 39212 composeClaimResponseItemDetailComponent(null, e); 39213 closeArray(); 39214 } 39215 ; 39216 } 39217 39218 protected void composeClaimResponseAdjudicationComponent(String name, ClaimResponse.AdjudicationComponent element) 39219 throws IOException { 39220 if (element != null) { 39221 open(name); 39222 composeClaimResponseAdjudicationComponentInner(element); 39223 close(); 39224 } 39225 } 39226 39227 protected void composeClaimResponseAdjudicationComponentInner(ClaimResponse.AdjudicationComponent element) 39228 throws IOException { 39229 composeBackbone(element); 39230 if (element.hasCategory()) { 39231 composeCodeableConcept("category", element.getCategory()); 39232 } 39233 if (element.hasReason()) { 39234 composeCodeableConcept("reason", element.getReason()); 39235 } 39236 if (element.hasAmount()) { 39237 composeMoney("amount", element.getAmount()); 39238 } 39239 if (element.hasValueElement()) { 39240 composeDecimalCore("value", element.getValueElement(), false); 39241 composeDecimalExtras("value", element.getValueElement(), false); 39242 } 39243 } 39244 39245 protected void composeClaimResponseItemDetailComponent(String name, ClaimResponse.ItemDetailComponent element) 39246 throws IOException { 39247 if (element != null) { 39248 open(name); 39249 composeClaimResponseItemDetailComponentInner(element); 39250 close(); 39251 } 39252 } 39253 39254 protected void composeClaimResponseItemDetailComponentInner(ClaimResponse.ItemDetailComponent element) 39255 throws IOException { 39256 composeBackbone(element); 39257 if (element.hasDetailSequenceElement()) { 39258 composePositiveIntCore("detailSequence", element.getDetailSequenceElement(), false); 39259 composePositiveIntExtras("detailSequence", element.getDetailSequenceElement(), false); 39260 } 39261 if (element.hasNoteNumber()) { 39262 openArray("noteNumber"); 39263 for (PositiveIntType e : element.getNoteNumber()) 39264 composePositiveIntCore(null, e, true); 39265 closeArray(); 39266 if (anyHasExtras(element.getNoteNumber())) { 39267 openArray("_noteNumber"); 39268 for (PositiveIntType e : element.getNoteNumber()) 39269 composePositiveIntExtras(null, e, true); 39270 closeArray(); 39271 } 39272 } 39273 ; 39274 if (element.hasAdjudication()) { 39275 openArray("adjudication"); 39276 for (ClaimResponse.AdjudicationComponent e : element.getAdjudication()) 39277 composeClaimResponseAdjudicationComponent(null, e); 39278 closeArray(); 39279 } 39280 ; 39281 if (element.hasSubDetail()) { 39282 openArray("subDetail"); 39283 for (ClaimResponse.SubDetailComponent e : element.getSubDetail()) 39284 composeClaimResponseSubDetailComponent(null, e); 39285 closeArray(); 39286 } 39287 ; 39288 } 39289 39290 protected void composeClaimResponseSubDetailComponent(String name, ClaimResponse.SubDetailComponent element) 39291 throws IOException { 39292 if (element != null) { 39293 open(name); 39294 composeClaimResponseSubDetailComponentInner(element); 39295 close(); 39296 } 39297 } 39298 39299 protected void composeClaimResponseSubDetailComponentInner(ClaimResponse.SubDetailComponent element) 39300 throws IOException { 39301 composeBackbone(element); 39302 if (element.hasSubDetailSequenceElement()) { 39303 composePositiveIntCore("subDetailSequence", element.getSubDetailSequenceElement(), false); 39304 composePositiveIntExtras("subDetailSequence", element.getSubDetailSequenceElement(), false); 39305 } 39306 if (element.hasNoteNumber()) { 39307 openArray("noteNumber"); 39308 for (PositiveIntType e : element.getNoteNumber()) 39309 composePositiveIntCore(null, e, true); 39310 closeArray(); 39311 if (anyHasExtras(element.getNoteNumber())) { 39312 openArray("_noteNumber"); 39313 for (PositiveIntType e : element.getNoteNumber()) 39314 composePositiveIntExtras(null, e, true); 39315 closeArray(); 39316 } 39317 } 39318 ; 39319 if (element.hasAdjudication()) { 39320 openArray("adjudication"); 39321 for (ClaimResponse.AdjudicationComponent e : element.getAdjudication()) 39322 composeClaimResponseAdjudicationComponent(null, e); 39323 closeArray(); 39324 } 39325 ; 39326 } 39327 39328 protected void composeClaimResponseAddedItemComponent(String name, ClaimResponse.AddedItemComponent element) 39329 throws IOException { 39330 if (element != null) { 39331 open(name); 39332 composeClaimResponseAddedItemComponentInner(element); 39333 close(); 39334 } 39335 } 39336 39337 protected void composeClaimResponseAddedItemComponentInner(ClaimResponse.AddedItemComponent element) 39338 throws IOException { 39339 composeBackbone(element); 39340 if (element.hasItemSequence()) { 39341 openArray("itemSequence"); 39342 for (PositiveIntType e : element.getItemSequence()) 39343 composePositiveIntCore(null, e, true); 39344 closeArray(); 39345 if (anyHasExtras(element.getItemSequence())) { 39346 openArray("_itemSequence"); 39347 for (PositiveIntType e : element.getItemSequence()) 39348 composePositiveIntExtras(null, e, true); 39349 closeArray(); 39350 } 39351 } 39352 ; 39353 if (element.hasDetailSequence()) { 39354 openArray("detailSequence"); 39355 for (PositiveIntType e : element.getDetailSequence()) 39356 composePositiveIntCore(null, e, true); 39357 closeArray(); 39358 if (anyHasExtras(element.getDetailSequence())) { 39359 openArray("_detailSequence"); 39360 for (PositiveIntType e : element.getDetailSequence()) 39361 composePositiveIntExtras(null, e, true); 39362 closeArray(); 39363 } 39364 } 39365 ; 39366 if (element.hasSubdetailSequence()) { 39367 openArray("subdetailSequence"); 39368 for (PositiveIntType e : element.getSubdetailSequence()) 39369 composePositiveIntCore(null, e, true); 39370 closeArray(); 39371 if (anyHasExtras(element.getSubdetailSequence())) { 39372 openArray("_subdetailSequence"); 39373 for (PositiveIntType e : element.getSubdetailSequence()) 39374 composePositiveIntExtras(null, e, true); 39375 closeArray(); 39376 } 39377 } 39378 ; 39379 if (element.hasProvider()) { 39380 openArray("provider"); 39381 for (Reference e : element.getProvider()) 39382 composeReference(null, e); 39383 closeArray(); 39384 } 39385 ; 39386 if (element.hasProductOrService()) { 39387 composeCodeableConcept("productOrService", element.getProductOrService()); 39388 } 39389 if (element.hasModifier()) { 39390 openArray("modifier"); 39391 for (CodeableConcept e : element.getModifier()) 39392 composeCodeableConcept(null, e); 39393 closeArray(); 39394 } 39395 ; 39396 if (element.hasProgramCode()) { 39397 openArray("programCode"); 39398 for (CodeableConcept e : element.getProgramCode()) 39399 composeCodeableConcept(null, e); 39400 closeArray(); 39401 } 39402 ; 39403 if (element.hasServiced()) { 39404 composeType("serviced", element.getServiced()); 39405 } 39406 if (element.hasLocation()) { 39407 composeType("location", element.getLocation()); 39408 } 39409 if (element.hasQuantity()) { 39410 composeQuantity("quantity", element.getQuantity()); 39411 } 39412 if (element.hasUnitPrice()) { 39413 composeMoney("unitPrice", element.getUnitPrice()); 39414 } 39415 if (element.hasFactorElement()) { 39416 composeDecimalCore("factor", element.getFactorElement(), false); 39417 composeDecimalExtras("factor", element.getFactorElement(), false); 39418 } 39419 if (element.hasNet()) { 39420 composeMoney("net", element.getNet()); 39421 } 39422 if (element.hasBodySite()) { 39423 composeCodeableConcept("bodySite", element.getBodySite()); 39424 } 39425 if (element.hasSubSite()) { 39426 openArray("subSite"); 39427 for (CodeableConcept e : element.getSubSite()) 39428 composeCodeableConcept(null, e); 39429 closeArray(); 39430 } 39431 ; 39432 if (element.hasNoteNumber()) { 39433 openArray("noteNumber"); 39434 for (PositiveIntType e : element.getNoteNumber()) 39435 composePositiveIntCore(null, e, true); 39436 closeArray(); 39437 if (anyHasExtras(element.getNoteNumber())) { 39438 openArray("_noteNumber"); 39439 for (PositiveIntType e : element.getNoteNumber()) 39440 composePositiveIntExtras(null, e, true); 39441 closeArray(); 39442 } 39443 } 39444 ; 39445 if (element.hasAdjudication()) { 39446 openArray("adjudication"); 39447 for (ClaimResponse.AdjudicationComponent e : element.getAdjudication()) 39448 composeClaimResponseAdjudicationComponent(null, e); 39449 closeArray(); 39450 } 39451 ; 39452 if (element.hasDetail()) { 39453 openArray("detail"); 39454 for (ClaimResponse.AddedItemDetailComponent e : element.getDetail()) 39455 composeClaimResponseAddedItemDetailComponent(null, e); 39456 closeArray(); 39457 } 39458 ; 39459 } 39460 39461 protected void composeClaimResponseAddedItemDetailComponent(String name, 39462 ClaimResponse.AddedItemDetailComponent element) throws IOException { 39463 if (element != null) { 39464 open(name); 39465 composeClaimResponseAddedItemDetailComponentInner(element); 39466 close(); 39467 } 39468 } 39469 39470 protected void composeClaimResponseAddedItemDetailComponentInner(ClaimResponse.AddedItemDetailComponent element) 39471 throws IOException { 39472 composeBackbone(element); 39473 if (element.hasProductOrService()) { 39474 composeCodeableConcept("productOrService", element.getProductOrService()); 39475 } 39476 if (element.hasModifier()) { 39477 openArray("modifier"); 39478 for (CodeableConcept e : element.getModifier()) 39479 composeCodeableConcept(null, e); 39480 closeArray(); 39481 } 39482 ; 39483 if (element.hasQuantity()) { 39484 composeQuantity("quantity", element.getQuantity()); 39485 } 39486 if (element.hasUnitPrice()) { 39487 composeMoney("unitPrice", element.getUnitPrice()); 39488 } 39489 if (element.hasFactorElement()) { 39490 composeDecimalCore("factor", element.getFactorElement(), false); 39491 composeDecimalExtras("factor", element.getFactorElement(), false); 39492 } 39493 if (element.hasNet()) { 39494 composeMoney("net", element.getNet()); 39495 } 39496 if (element.hasNoteNumber()) { 39497 openArray("noteNumber"); 39498 for (PositiveIntType e : element.getNoteNumber()) 39499 composePositiveIntCore(null, e, true); 39500 closeArray(); 39501 if (anyHasExtras(element.getNoteNumber())) { 39502 openArray("_noteNumber"); 39503 for (PositiveIntType e : element.getNoteNumber()) 39504 composePositiveIntExtras(null, e, true); 39505 closeArray(); 39506 } 39507 } 39508 ; 39509 if (element.hasAdjudication()) { 39510 openArray("adjudication"); 39511 for (ClaimResponse.AdjudicationComponent e : element.getAdjudication()) 39512 composeClaimResponseAdjudicationComponent(null, e); 39513 closeArray(); 39514 } 39515 ; 39516 if (element.hasSubDetail()) { 39517 openArray("subDetail"); 39518 for (ClaimResponse.AddedItemSubDetailComponent e : element.getSubDetail()) 39519 composeClaimResponseAddedItemSubDetailComponent(null, e); 39520 closeArray(); 39521 } 39522 ; 39523 } 39524 39525 protected void composeClaimResponseAddedItemSubDetailComponent(String name, 39526 ClaimResponse.AddedItemSubDetailComponent element) throws IOException { 39527 if (element != null) { 39528 open(name); 39529 composeClaimResponseAddedItemSubDetailComponentInner(element); 39530 close(); 39531 } 39532 } 39533 39534 protected void composeClaimResponseAddedItemSubDetailComponentInner(ClaimResponse.AddedItemSubDetailComponent element) 39535 throws IOException { 39536 composeBackbone(element); 39537 if (element.hasProductOrService()) { 39538 composeCodeableConcept("productOrService", element.getProductOrService()); 39539 } 39540 if (element.hasModifier()) { 39541 openArray("modifier"); 39542 for (CodeableConcept e : element.getModifier()) 39543 composeCodeableConcept(null, e); 39544 closeArray(); 39545 } 39546 ; 39547 if (element.hasQuantity()) { 39548 composeQuantity("quantity", element.getQuantity()); 39549 } 39550 if (element.hasUnitPrice()) { 39551 composeMoney("unitPrice", element.getUnitPrice()); 39552 } 39553 if (element.hasFactorElement()) { 39554 composeDecimalCore("factor", element.getFactorElement(), false); 39555 composeDecimalExtras("factor", element.getFactorElement(), false); 39556 } 39557 if (element.hasNet()) { 39558 composeMoney("net", element.getNet()); 39559 } 39560 if (element.hasNoteNumber()) { 39561 openArray("noteNumber"); 39562 for (PositiveIntType e : element.getNoteNumber()) 39563 composePositiveIntCore(null, e, true); 39564 closeArray(); 39565 if (anyHasExtras(element.getNoteNumber())) { 39566 openArray("_noteNumber"); 39567 for (PositiveIntType e : element.getNoteNumber()) 39568 composePositiveIntExtras(null, e, true); 39569 closeArray(); 39570 } 39571 } 39572 ; 39573 if (element.hasAdjudication()) { 39574 openArray("adjudication"); 39575 for (ClaimResponse.AdjudicationComponent e : element.getAdjudication()) 39576 composeClaimResponseAdjudicationComponent(null, e); 39577 closeArray(); 39578 } 39579 ; 39580 } 39581 39582 protected void composeClaimResponseTotalComponent(String name, ClaimResponse.TotalComponent element) 39583 throws IOException { 39584 if (element != null) { 39585 open(name); 39586 composeClaimResponseTotalComponentInner(element); 39587 close(); 39588 } 39589 } 39590 39591 protected void composeClaimResponseTotalComponentInner(ClaimResponse.TotalComponent element) throws IOException { 39592 composeBackbone(element); 39593 if (element.hasCategory()) { 39594 composeCodeableConcept("category", element.getCategory()); 39595 } 39596 if (element.hasAmount()) { 39597 composeMoney("amount", element.getAmount()); 39598 } 39599 } 39600 39601 protected void composeClaimResponsePaymentComponent(String name, ClaimResponse.PaymentComponent element) 39602 throws IOException { 39603 if (element != null) { 39604 open(name); 39605 composeClaimResponsePaymentComponentInner(element); 39606 close(); 39607 } 39608 } 39609 39610 protected void composeClaimResponsePaymentComponentInner(ClaimResponse.PaymentComponent element) throws IOException { 39611 composeBackbone(element); 39612 if (element.hasType()) { 39613 composeCodeableConcept("type", element.getType()); 39614 } 39615 if (element.hasAdjustment()) { 39616 composeMoney("adjustment", element.getAdjustment()); 39617 } 39618 if (element.hasAdjustmentReason()) { 39619 composeCodeableConcept("adjustmentReason", element.getAdjustmentReason()); 39620 } 39621 if (element.hasDateElement()) { 39622 composeDateCore("date", element.getDateElement(), false); 39623 composeDateExtras("date", element.getDateElement(), false); 39624 } 39625 if (element.hasAmount()) { 39626 composeMoney("amount", element.getAmount()); 39627 } 39628 if (element.hasIdentifier()) { 39629 composeIdentifier("identifier", element.getIdentifier()); 39630 } 39631 } 39632 39633 protected void composeClaimResponseNoteComponent(String name, ClaimResponse.NoteComponent element) 39634 throws IOException { 39635 if (element != null) { 39636 open(name); 39637 composeClaimResponseNoteComponentInner(element); 39638 close(); 39639 } 39640 } 39641 39642 protected void composeClaimResponseNoteComponentInner(ClaimResponse.NoteComponent element) throws IOException { 39643 composeBackbone(element); 39644 if (element.hasNumberElement()) { 39645 composePositiveIntCore("number", element.getNumberElement(), false); 39646 composePositiveIntExtras("number", element.getNumberElement(), false); 39647 } 39648 if (element.hasTypeElement()) { 39649 composeEnumerationCore("type", element.getTypeElement(), new Enumerations.NoteTypeEnumFactory(), false); 39650 composeEnumerationExtras("type", element.getTypeElement(), new Enumerations.NoteTypeEnumFactory(), false); 39651 } 39652 if (element.hasTextElement()) { 39653 composeStringCore("text", element.getTextElement(), false); 39654 composeStringExtras("text", element.getTextElement(), false); 39655 } 39656 if (element.hasLanguage()) { 39657 composeCodeableConcept("language", element.getLanguage()); 39658 } 39659 } 39660 39661 protected void composeClaimResponseInsuranceComponent(String name, ClaimResponse.InsuranceComponent element) 39662 throws IOException { 39663 if (element != null) { 39664 open(name); 39665 composeClaimResponseInsuranceComponentInner(element); 39666 close(); 39667 } 39668 } 39669 39670 protected void composeClaimResponseInsuranceComponentInner(ClaimResponse.InsuranceComponent element) 39671 throws IOException { 39672 composeBackbone(element); 39673 if (element.hasSequenceElement()) { 39674 composePositiveIntCore("sequence", element.getSequenceElement(), false); 39675 composePositiveIntExtras("sequence", element.getSequenceElement(), false); 39676 } 39677 if (element.hasFocalElement()) { 39678 composeBooleanCore("focal", element.getFocalElement(), false); 39679 composeBooleanExtras("focal", element.getFocalElement(), false); 39680 } 39681 if (element.hasCoverage()) { 39682 composeReference("coverage", element.getCoverage()); 39683 } 39684 if (element.hasBusinessArrangementElement()) { 39685 composeStringCore("businessArrangement", element.getBusinessArrangementElement(), false); 39686 composeStringExtras("businessArrangement", element.getBusinessArrangementElement(), false); 39687 } 39688 if (element.hasClaimResponse()) { 39689 composeReference("claimResponse", element.getClaimResponse()); 39690 } 39691 } 39692 39693 protected void composeClaimResponseErrorComponent(String name, ClaimResponse.ErrorComponent element) 39694 throws IOException { 39695 if (element != null) { 39696 open(name); 39697 composeClaimResponseErrorComponentInner(element); 39698 close(); 39699 } 39700 } 39701 39702 protected void composeClaimResponseErrorComponentInner(ClaimResponse.ErrorComponent element) throws IOException { 39703 composeBackbone(element); 39704 if (element.hasItemSequenceElement()) { 39705 composePositiveIntCore("itemSequence", element.getItemSequenceElement(), false); 39706 composePositiveIntExtras("itemSequence", element.getItemSequenceElement(), false); 39707 } 39708 if (element.hasDetailSequenceElement()) { 39709 composePositiveIntCore("detailSequence", element.getDetailSequenceElement(), false); 39710 composePositiveIntExtras("detailSequence", element.getDetailSequenceElement(), false); 39711 } 39712 if (element.hasSubDetailSequenceElement()) { 39713 composePositiveIntCore("subDetailSequence", element.getSubDetailSequenceElement(), false); 39714 composePositiveIntExtras("subDetailSequence", element.getSubDetailSequenceElement(), false); 39715 } 39716 if (element.hasCode()) { 39717 composeCodeableConcept("code", element.getCode()); 39718 } 39719 } 39720 39721 protected void composeClinicalImpression(String name, ClinicalImpression element) throws IOException { 39722 if (element != null) { 39723 prop("resourceType", name); 39724 composeClinicalImpressionInner(element); 39725 } 39726 } 39727 39728 protected void composeClinicalImpressionInner(ClinicalImpression element) throws IOException { 39729 composeDomainResourceElements(element); 39730 if (element.hasIdentifier()) { 39731 openArray("identifier"); 39732 for (Identifier e : element.getIdentifier()) 39733 composeIdentifier(null, e); 39734 closeArray(); 39735 } 39736 ; 39737 if (element.hasStatusElement()) { 39738 composeEnumerationCore("status", element.getStatusElement(), 39739 new ClinicalImpression.ClinicalImpressionStatusEnumFactory(), false); 39740 composeEnumerationExtras("status", element.getStatusElement(), 39741 new ClinicalImpression.ClinicalImpressionStatusEnumFactory(), false); 39742 } 39743 if (element.hasStatusReason()) { 39744 composeCodeableConcept("statusReason", element.getStatusReason()); 39745 } 39746 if (element.hasCode()) { 39747 composeCodeableConcept("code", element.getCode()); 39748 } 39749 if (element.hasDescriptionElement()) { 39750 composeStringCore("description", element.getDescriptionElement(), false); 39751 composeStringExtras("description", element.getDescriptionElement(), false); 39752 } 39753 if (element.hasSubject()) { 39754 composeReference("subject", element.getSubject()); 39755 } 39756 if (element.hasEncounter()) { 39757 composeReference("encounter", element.getEncounter()); 39758 } 39759 if (element.hasEffective()) { 39760 composeType("effective", element.getEffective()); 39761 } 39762 if (element.hasDateElement()) { 39763 composeDateTimeCore("date", element.getDateElement(), false); 39764 composeDateTimeExtras("date", element.getDateElement(), false); 39765 } 39766 if (element.hasAssessor()) { 39767 composeReference("assessor", element.getAssessor()); 39768 } 39769 if (element.hasPrevious()) { 39770 composeReference("previous", element.getPrevious()); 39771 } 39772 if (element.hasProblem()) { 39773 openArray("problem"); 39774 for (Reference e : element.getProblem()) 39775 composeReference(null, e); 39776 closeArray(); 39777 } 39778 ; 39779 if (element.hasInvestigation()) { 39780 openArray("investigation"); 39781 for (ClinicalImpression.ClinicalImpressionInvestigationComponent e : element.getInvestigation()) 39782 composeClinicalImpressionClinicalImpressionInvestigationComponent(null, e); 39783 closeArray(); 39784 } 39785 ; 39786 if (element.hasProtocol()) { 39787 openArray("protocol"); 39788 for (UriType e : element.getProtocol()) 39789 composeUriCore(null, e, true); 39790 closeArray(); 39791 if (anyHasExtras(element.getProtocol())) { 39792 openArray("_protocol"); 39793 for (UriType e : element.getProtocol()) 39794 composeUriExtras(null, e, true); 39795 closeArray(); 39796 } 39797 } 39798 ; 39799 if (element.hasSummaryElement()) { 39800 composeStringCore("summary", element.getSummaryElement(), false); 39801 composeStringExtras("summary", element.getSummaryElement(), false); 39802 } 39803 if (element.hasFinding()) { 39804 openArray("finding"); 39805 for (ClinicalImpression.ClinicalImpressionFindingComponent e : element.getFinding()) 39806 composeClinicalImpressionClinicalImpressionFindingComponent(null, e); 39807 closeArray(); 39808 } 39809 ; 39810 if (element.hasPrognosisCodeableConcept()) { 39811 openArray("prognosisCodeableConcept"); 39812 for (CodeableConcept e : element.getPrognosisCodeableConcept()) 39813 composeCodeableConcept(null, e); 39814 closeArray(); 39815 } 39816 ; 39817 if (element.hasPrognosisReference()) { 39818 openArray("prognosisReference"); 39819 for (Reference e : element.getPrognosisReference()) 39820 composeReference(null, e); 39821 closeArray(); 39822 } 39823 ; 39824 if (element.hasSupportingInfo()) { 39825 openArray("supportingInfo"); 39826 for (Reference e : element.getSupportingInfo()) 39827 composeReference(null, e); 39828 closeArray(); 39829 } 39830 ; 39831 if (element.hasNote()) { 39832 openArray("note"); 39833 for (Annotation e : element.getNote()) 39834 composeAnnotation(null, e); 39835 closeArray(); 39836 } 39837 ; 39838 } 39839 39840 protected void composeClinicalImpressionClinicalImpressionInvestigationComponent(String name, 39841 ClinicalImpression.ClinicalImpressionInvestigationComponent element) throws IOException { 39842 if (element != null) { 39843 open(name); 39844 composeClinicalImpressionClinicalImpressionInvestigationComponentInner(element); 39845 close(); 39846 } 39847 } 39848 39849 protected void composeClinicalImpressionClinicalImpressionInvestigationComponentInner( 39850 ClinicalImpression.ClinicalImpressionInvestigationComponent element) throws IOException { 39851 composeBackbone(element); 39852 if (element.hasCode()) { 39853 composeCodeableConcept("code", element.getCode()); 39854 } 39855 if (element.hasItem()) { 39856 openArray("item"); 39857 for (Reference e : element.getItem()) 39858 composeReference(null, e); 39859 closeArray(); 39860 } 39861 ; 39862 } 39863 39864 protected void composeClinicalImpressionClinicalImpressionFindingComponent(String name, 39865 ClinicalImpression.ClinicalImpressionFindingComponent element) throws IOException { 39866 if (element != null) { 39867 open(name); 39868 composeClinicalImpressionClinicalImpressionFindingComponentInner(element); 39869 close(); 39870 } 39871 } 39872 39873 protected void composeClinicalImpressionClinicalImpressionFindingComponentInner( 39874 ClinicalImpression.ClinicalImpressionFindingComponent element) throws IOException { 39875 composeBackbone(element); 39876 if (element.hasItemCodeableConcept()) { 39877 composeCodeableConcept("itemCodeableConcept", element.getItemCodeableConcept()); 39878 } 39879 if (element.hasItemReference()) { 39880 composeReference("itemReference", element.getItemReference()); 39881 } 39882 if (element.hasBasisElement()) { 39883 composeStringCore("basis", element.getBasisElement(), false); 39884 composeStringExtras("basis", element.getBasisElement(), false); 39885 } 39886 } 39887 39888 protected void composeCodeSystem(String name, CodeSystem element) throws IOException { 39889 if (element != null) { 39890 prop("resourceType", name); 39891 composeCodeSystemInner(element); 39892 } 39893 } 39894 39895 protected void composeCodeSystemInner(CodeSystem element) throws IOException { 39896 composeDomainResourceElements(element); 39897 if (element.hasUrlElement()) { 39898 composeUriCore("url", element.getUrlElement(), false); 39899 composeUriExtras("url", element.getUrlElement(), false); 39900 } 39901 if (element.hasIdentifier()) { 39902 openArray("identifier"); 39903 for (Identifier e : element.getIdentifier()) 39904 composeIdentifier(null, e); 39905 closeArray(); 39906 } 39907 ; 39908 if (element.hasVersionElement()) { 39909 composeStringCore("version", element.getVersionElement(), false); 39910 composeStringExtras("version", element.getVersionElement(), false); 39911 } 39912 if (element.hasNameElement()) { 39913 composeStringCore("name", element.getNameElement(), false); 39914 composeStringExtras("name", element.getNameElement(), false); 39915 } 39916 if (element.hasTitleElement()) { 39917 composeStringCore("title", element.getTitleElement(), false); 39918 composeStringExtras("title", element.getTitleElement(), false); 39919 } 39920 if (element.hasStatusElement()) { 39921 composeEnumerationCore("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 39922 false); 39923 composeEnumerationExtras("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 39924 false); 39925 } 39926 if (element.hasExperimentalElement()) { 39927 composeBooleanCore("experimental", element.getExperimentalElement(), false); 39928 composeBooleanExtras("experimental", element.getExperimentalElement(), false); 39929 } 39930 if (element.hasDateElement()) { 39931 composeDateTimeCore("date", element.getDateElement(), false); 39932 composeDateTimeExtras("date", element.getDateElement(), false); 39933 } 39934 if (element.hasPublisherElement()) { 39935 composeStringCore("publisher", element.getPublisherElement(), false); 39936 composeStringExtras("publisher", element.getPublisherElement(), false); 39937 } 39938 if (element.hasContact()) { 39939 openArray("contact"); 39940 for (ContactDetail e : element.getContact()) 39941 composeContactDetail(null, e); 39942 closeArray(); 39943 } 39944 ; 39945 if (element.hasDescriptionElement()) { 39946 composeMarkdownCore("description", element.getDescriptionElement(), false); 39947 composeMarkdownExtras("description", element.getDescriptionElement(), false); 39948 } 39949 if (element.hasUseContext()) { 39950 openArray("useContext"); 39951 for (UsageContext e : element.getUseContext()) 39952 composeUsageContext(null, e); 39953 closeArray(); 39954 } 39955 ; 39956 if (element.hasJurisdiction()) { 39957 openArray("jurisdiction"); 39958 for (CodeableConcept e : element.getJurisdiction()) 39959 composeCodeableConcept(null, e); 39960 closeArray(); 39961 } 39962 ; 39963 if (element.hasPurposeElement()) { 39964 composeMarkdownCore("purpose", element.getPurposeElement(), false); 39965 composeMarkdownExtras("purpose", element.getPurposeElement(), false); 39966 } 39967 if (element.hasCopyrightElement()) { 39968 composeMarkdownCore("copyright", element.getCopyrightElement(), false); 39969 composeMarkdownExtras("copyright", element.getCopyrightElement(), false); 39970 } 39971 if (element.hasCaseSensitiveElement()) { 39972 composeBooleanCore("caseSensitive", element.getCaseSensitiveElement(), false); 39973 composeBooleanExtras("caseSensitive", element.getCaseSensitiveElement(), false); 39974 } 39975 if (element.hasValueSetElement()) { 39976 composeCanonicalCore("valueSet", element.getValueSetElement(), false); 39977 composeCanonicalExtras("valueSet", element.getValueSetElement(), false); 39978 } 39979 if (element.hasHierarchyMeaningElement()) { 39980 composeEnumerationCore("hierarchyMeaning", element.getHierarchyMeaningElement(), 39981 new CodeSystem.CodeSystemHierarchyMeaningEnumFactory(), false); 39982 composeEnumerationExtras("hierarchyMeaning", element.getHierarchyMeaningElement(), 39983 new CodeSystem.CodeSystemHierarchyMeaningEnumFactory(), false); 39984 } 39985 if (element.hasCompositionalElement()) { 39986 composeBooleanCore("compositional", element.getCompositionalElement(), false); 39987 composeBooleanExtras("compositional", element.getCompositionalElement(), false); 39988 } 39989 if (element.hasVersionNeededElement()) { 39990 composeBooleanCore("versionNeeded", element.getVersionNeededElement(), false); 39991 composeBooleanExtras("versionNeeded", element.getVersionNeededElement(), false); 39992 } 39993 if (element.hasContentElement()) { 39994 composeEnumerationCore("content", element.getContentElement(), new CodeSystem.CodeSystemContentModeEnumFactory(), 39995 false); 39996 composeEnumerationExtras("content", element.getContentElement(), 39997 new CodeSystem.CodeSystemContentModeEnumFactory(), false); 39998 } 39999 if (element.hasSupplementsElement()) { 40000 composeCanonicalCore("supplements", element.getSupplementsElement(), false); 40001 composeCanonicalExtras("supplements", element.getSupplementsElement(), false); 40002 } 40003 if (element.hasCountElement()) { 40004 composeUnsignedIntCore("count", element.getCountElement(), false); 40005 composeUnsignedIntExtras("count", element.getCountElement(), false); 40006 } 40007 if (element.hasFilter()) { 40008 openArray("filter"); 40009 for (CodeSystem.CodeSystemFilterComponent e : element.getFilter()) 40010 composeCodeSystemCodeSystemFilterComponent(null, e); 40011 closeArray(); 40012 } 40013 ; 40014 if (element.hasProperty()) { 40015 openArray("property"); 40016 for (CodeSystem.PropertyComponent e : element.getProperty()) 40017 composeCodeSystemPropertyComponent(null, e); 40018 closeArray(); 40019 } 40020 ; 40021 if (element.hasConcept()) { 40022 openArray("concept"); 40023 for (CodeSystem.ConceptDefinitionComponent e : element.getConcept()) 40024 composeCodeSystemConceptDefinitionComponent(null, e); 40025 closeArray(); 40026 } 40027 ; 40028 } 40029 40030 protected void composeCodeSystemCodeSystemFilterComponent(String name, CodeSystem.CodeSystemFilterComponent element) 40031 throws IOException { 40032 if (element != null) { 40033 open(name); 40034 composeCodeSystemCodeSystemFilterComponentInner(element); 40035 close(); 40036 } 40037 } 40038 40039 protected void composeCodeSystemCodeSystemFilterComponentInner(CodeSystem.CodeSystemFilterComponent element) 40040 throws IOException { 40041 composeBackbone(element); 40042 if (element.hasCodeElement()) { 40043 composeCodeCore("code", element.getCodeElement(), false); 40044 composeCodeExtras("code", element.getCodeElement(), false); 40045 } 40046 if (element.hasDescriptionElement()) { 40047 composeStringCore("description", element.getDescriptionElement(), false); 40048 composeStringExtras("description", element.getDescriptionElement(), false); 40049 } 40050 if (element.hasOperator()) { 40051 openArray("operator"); 40052 for (Enumeration<CodeSystem.FilterOperator> e : element.getOperator()) 40053 composeEnumerationCore(null, e, new CodeSystem.FilterOperatorEnumFactory(), true); 40054 closeArray(); 40055 if (anyHasExtras(element.getOperator())) { 40056 openArray("_operator"); 40057 for (Enumeration<CodeSystem.FilterOperator> e : element.getOperator()) 40058 composeEnumerationExtras(null, e, new CodeSystem.FilterOperatorEnumFactory(), true); 40059 closeArray(); 40060 } 40061 } 40062 ; 40063 if (element.hasValueElement()) { 40064 composeStringCore("value", element.getValueElement(), false); 40065 composeStringExtras("value", element.getValueElement(), false); 40066 } 40067 } 40068 40069 protected void composeCodeSystemPropertyComponent(String name, CodeSystem.PropertyComponent element) 40070 throws IOException { 40071 if (element != null) { 40072 open(name); 40073 composeCodeSystemPropertyComponentInner(element); 40074 close(); 40075 } 40076 } 40077 40078 protected void composeCodeSystemPropertyComponentInner(CodeSystem.PropertyComponent element) throws IOException { 40079 composeBackbone(element); 40080 if (element.hasCodeElement()) { 40081 composeCodeCore("code", element.getCodeElement(), false); 40082 composeCodeExtras("code", element.getCodeElement(), false); 40083 } 40084 if (element.hasUriElement()) { 40085 composeUriCore("uri", element.getUriElement(), false); 40086 composeUriExtras("uri", element.getUriElement(), false); 40087 } 40088 if (element.hasDescriptionElement()) { 40089 composeStringCore("description", element.getDescriptionElement(), false); 40090 composeStringExtras("description", element.getDescriptionElement(), false); 40091 } 40092 if (element.hasTypeElement()) { 40093 composeEnumerationCore("type", element.getTypeElement(), new CodeSystem.PropertyTypeEnumFactory(), false); 40094 composeEnumerationExtras("type", element.getTypeElement(), new CodeSystem.PropertyTypeEnumFactory(), false); 40095 } 40096 } 40097 40098 protected void composeCodeSystemConceptDefinitionComponent(String name, CodeSystem.ConceptDefinitionComponent element) 40099 throws IOException { 40100 if (element != null) { 40101 open(name); 40102 composeCodeSystemConceptDefinitionComponentInner(element); 40103 close(); 40104 } 40105 } 40106 40107 protected void composeCodeSystemConceptDefinitionComponentInner(CodeSystem.ConceptDefinitionComponent element) 40108 throws IOException { 40109 composeBackbone(element); 40110 if (element.hasCodeElement()) { 40111 composeCodeCore("code", element.getCodeElement(), false); 40112 composeCodeExtras("code", element.getCodeElement(), false); 40113 } 40114 if (element.hasDisplayElement()) { 40115 composeStringCore("display", element.getDisplayElement(), false); 40116 composeStringExtras("display", element.getDisplayElement(), false); 40117 } 40118 if (element.hasDefinitionElement()) { 40119 composeStringCore("definition", element.getDefinitionElement(), false); 40120 composeStringExtras("definition", element.getDefinitionElement(), false); 40121 } 40122 if (element.hasDesignation()) { 40123 openArray("designation"); 40124 for (CodeSystem.ConceptDefinitionDesignationComponent e : element.getDesignation()) 40125 composeCodeSystemConceptDefinitionDesignationComponent(null, e); 40126 closeArray(); 40127 } 40128 ; 40129 if (element.hasProperty()) { 40130 openArray("property"); 40131 for (CodeSystem.ConceptPropertyComponent e : element.getProperty()) 40132 composeCodeSystemConceptPropertyComponent(null, e); 40133 closeArray(); 40134 } 40135 ; 40136 if (element.hasConcept()) { 40137 openArray("concept"); 40138 for (CodeSystem.ConceptDefinitionComponent e : element.getConcept()) 40139 composeCodeSystemConceptDefinitionComponent(null, e); 40140 closeArray(); 40141 } 40142 ; 40143 } 40144 40145 protected void composeCodeSystemConceptDefinitionDesignationComponent(String name, 40146 CodeSystem.ConceptDefinitionDesignationComponent element) throws IOException { 40147 if (element != null) { 40148 open(name); 40149 composeCodeSystemConceptDefinitionDesignationComponentInner(element); 40150 close(); 40151 } 40152 } 40153 40154 protected void composeCodeSystemConceptDefinitionDesignationComponentInner( 40155 CodeSystem.ConceptDefinitionDesignationComponent element) throws IOException { 40156 composeBackbone(element); 40157 if (element.hasLanguageElement()) { 40158 composeCodeCore("language", element.getLanguageElement(), false); 40159 composeCodeExtras("language", element.getLanguageElement(), false); 40160 } 40161 if (element.hasUse()) { 40162 composeCoding("use", element.getUse()); 40163 } 40164 if (element.hasValueElement()) { 40165 composeStringCore("value", element.getValueElement(), false); 40166 composeStringExtras("value", element.getValueElement(), false); 40167 } 40168 } 40169 40170 protected void composeCodeSystemConceptPropertyComponent(String name, CodeSystem.ConceptPropertyComponent element) 40171 throws IOException { 40172 if (element != null) { 40173 open(name); 40174 composeCodeSystemConceptPropertyComponentInner(element); 40175 close(); 40176 } 40177 } 40178 40179 protected void composeCodeSystemConceptPropertyComponentInner(CodeSystem.ConceptPropertyComponent element) 40180 throws IOException { 40181 composeBackbone(element); 40182 if (element.hasCodeElement()) { 40183 composeCodeCore("code", element.getCodeElement(), false); 40184 composeCodeExtras("code", element.getCodeElement(), false); 40185 } 40186 if (element.hasValue()) { 40187 composeType("value", element.getValue()); 40188 } 40189 } 40190 40191 protected void composeCommunication(String name, Communication element) throws IOException { 40192 if (element != null) { 40193 prop("resourceType", name); 40194 composeCommunicationInner(element); 40195 } 40196 } 40197 40198 protected void composeCommunicationInner(Communication element) throws IOException { 40199 composeDomainResourceElements(element); 40200 if (element.hasIdentifier()) { 40201 openArray("identifier"); 40202 for (Identifier e : element.getIdentifier()) 40203 composeIdentifier(null, e); 40204 closeArray(); 40205 } 40206 ; 40207 if (element.hasInstantiatesCanonical()) { 40208 openArray("instantiatesCanonical"); 40209 for (CanonicalType e : element.getInstantiatesCanonical()) 40210 composeCanonicalCore(null, e, true); 40211 closeArray(); 40212 if (anyHasExtras(element.getInstantiatesCanonical())) { 40213 openArray("_instantiatesCanonical"); 40214 for (CanonicalType e : element.getInstantiatesCanonical()) 40215 composeCanonicalExtras(null, e, true); 40216 closeArray(); 40217 } 40218 } 40219 ; 40220 if (element.hasInstantiatesUri()) { 40221 openArray("instantiatesUri"); 40222 for (UriType e : element.getInstantiatesUri()) 40223 composeUriCore(null, e, true); 40224 closeArray(); 40225 if (anyHasExtras(element.getInstantiatesUri())) { 40226 openArray("_instantiatesUri"); 40227 for (UriType e : element.getInstantiatesUri()) 40228 composeUriExtras(null, e, true); 40229 closeArray(); 40230 } 40231 } 40232 ; 40233 if (element.hasBasedOn()) { 40234 openArray("basedOn"); 40235 for (Reference e : element.getBasedOn()) 40236 composeReference(null, e); 40237 closeArray(); 40238 } 40239 ; 40240 if (element.hasPartOf()) { 40241 openArray("partOf"); 40242 for (Reference e : element.getPartOf()) 40243 composeReference(null, e); 40244 closeArray(); 40245 } 40246 ; 40247 if (element.hasInResponseTo()) { 40248 openArray("inResponseTo"); 40249 for (Reference e : element.getInResponseTo()) 40250 composeReference(null, e); 40251 closeArray(); 40252 } 40253 ; 40254 if (element.hasStatusElement()) { 40255 composeEnumerationCore("status", element.getStatusElement(), new Communication.CommunicationStatusEnumFactory(), 40256 false); 40257 composeEnumerationExtras("status", element.getStatusElement(), new Communication.CommunicationStatusEnumFactory(), 40258 false); 40259 } 40260 if (element.hasStatusReason()) { 40261 composeCodeableConcept("statusReason", element.getStatusReason()); 40262 } 40263 if (element.hasCategory()) { 40264 openArray("category"); 40265 for (CodeableConcept e : element.getCategory()) 40266 composeCodeableConcept(null, e); 40267 closeArray(); 40268 } 40269 ; 40270 if (element.hasPriorityElement()) { 40271 composeEnumerationCore("priority", element.getPriorityElement(), 40272 new Communication.CommunicationPriorityEnumFactory(), false); 40273 composeEnumerationExtras("priority", element.getPriorityElement(), 40274 new Communication.CommunicationPriorityEnumFactory(), false); 40275 } 40276 if (element.hasMedium()) { 40277 openArray("medium"); 40278 for (CodeableConcept e : element.getMedium()) 40279 composeCodeableConcept(null, e); 40280 closeArray(); 40281 } 40282 ; 40283 if (element.hasSubject()) { 40284 composeReference("subject", element.getSubject()); 40285 } 40286 if (element.hasTopic()) { 40287 composeCodeableConcept("topic", element.getTopic()); 40288 } 40289 if (element.hasAbout()) { 40290 openArray("about"); 40291 for (Reference e : element.getAbout()) 40292 composeReference(null, e); 40293 closeArray(); 40294 } 40295 ; 40296 if (element.hasEncounter()) { 40297 composeReference("encounter", element.getEncounter()); 40298 } 40299 if (element.hasSentElement()) { 40300 composeDateTimeCore("sent", element.getSentElement(), false); 40301 composeDateTimeExtras("sent", element.getSentElement(), false); 40302 } 40303 if (element.hasReceivedElement()) { 40304 composeDateTimeCore("received", element.getReceivedElement(), false); 40305 composeDateTimeExtras("received", element.getReceivedElement(), false); 40306 } 40307 if (element.hasRecipient()) { 40308 openArray("recipient"); 40309 for (Reference e : element.getRecipient()) 40310 composeReference(null, e); 40311 closeArray(); 40312 } 40313 ; 40314 if (element.hasSender()) { 40315 composeReference("sender", element.getSender()); 40316 } 40317 if (element.hasReasonCode()) { 40318 openArray("reasonCode"); 40319 for (CodeableConcept e : element.getReasonCode()) 40320 composeCodeableConcept(null, e); 40321 closeArray(); 40322 } 40323 ; 40324 if (element.hasReasonReference()) { 40325 openArray("reasonReference"); 40326 for (Reference e : element.getReasonReference()) 40327 composeReference(null, e); 40328 closeArray(); 40329 } 40330 ; 40331 if (element.hasPayload()) { 40332 openArray("payload"); 40333 for (Communication.CommunicationPayloadComponent e : element.getPayload()) 40334 composeCommunicationCommunicationPayloadComponent(null, e); 40335 closeArray(); 40336 } 40337 ; 40338 if (element.hasNote()) { 40339 openArray("note"); 40340 for (Annotation e : element.getNote()) 40341 composeAnnotation(null, e); 40342 closeArray(); 40343 } 40344 ; 40345 } 40346 40347 protected void composeCommunicationCommunicationPayloadComponent(String name, 40348 Communication.CommunicationPayloadComponent element) throws IOException { 40349 if (element != null) { 40350 open(name); 40351 composeCommunicationCommunicationPayloadComponentInner(element); 40352 close(); 40353 } 40354 } 40355 40356 protected void composeCommunicationCommunicationPayloadComponentInner( 40357 Communication.CommunicationPayloadComponent element) throws IOException { 40358 composeBackbone(element); 40359 if (element.hasContent()) { 40360 composeType("content", element.getContent()); 40361 } 40362 } 40363 40364 protected void composeCommunicationRequest(String name, CommunicationRequest element) throws IOException { 40365 if (element != null) { 40366 prop("resourceType", name); 40367 composeCommunicationRequestInner(element); 40368 } 40369 } 40370 40371 protected void composeCommunicationRequestInner(CommunicationRequest element) throws IOException { 40372 composeDomainResourceElements(element); 40373 if (element.hasIdentifier()) { 40374 openArray("identifier"); 40375 for (Identifier e : element.getIdentifier()) 40376 composeIdentifier(null, e); 40377 closeArray(); 40378 } 40379 ; 40380 if (element.hasBasedOn()) { 40381 openArray("basedOn"); 40382 for (Reference e : element.getBasedOn()) 40383 composeReference(null, e); 40384 closeArray(); 40385 } 40386 ; 40387 if (element.hasReplaces()) { 40388 openArray("replaces"); 40389 for (Reference e : element.getReplaces()) 40390 composeReference(null, e); 40391 closeArray(); 40392 } 40393 ; 40394 if (element.hasGroupIdentifier()) { 40395 composeIdentifier("groupIdentifier", element.getGroupIdentifier()); 40396 } 40397 if (element.hasStatusElement()) { 40398 composeEnumerationCore("status", element.getStatusElement(), 40399 new CommunicationRequest.CommunicationRequestStatusEnumFactory(), false); 40400 composeEnumerationExtras("status", element.getStatusElement(), 40401 new CommunicationRequest.CommunicationRequestStatusEnumFactory(), false); 40402 } 40403 if (element.hasStatusReason()) { 40404 composeCodeableConcept("statusReason", element.getStatusReason()); 40405 } 40406 if (element.hasCategory()) { 40407 openArray("category"); 40408 for (CodeableConcept e : element.getCategory()) 40409 composeCodeableConcept(null, e); 40410 closeArray(); 40411 } 40412 ; 40413 if (element.hasPriorityElement()) { 40414 composeEnumerationCore("priority", element.getPriorityElement(), 40415 new CommunicationRequest.CommunicationPriorityEnumFactory(), false); 40416 composeEnumerationExtras("priority", element.getPriorityElement(), 40417 new CommunicationRequest.CommunicationPriorityEnumFactory(), false); 40418 } 40419 if (element.hasDoNotPerformElement()) { 40420 composeBooleanCore("doNotPerform", element.getDoNotPerformElement(), false); 40421 composeBooleanExtras("doNotPerform", element.getDoNotPerformElement(), false); 40422 } 40423 if (element.hasMedium()) { 40424 openArray("medium"); 40425 for (CodeableConcept e : element.getMedium()) 40426 composeCodeableConcept(null, e); 40427 closeArray(); 40428 } 40429 ; 40430 if (element.hasSubject()) { 40431 composeReference("subject", element.getSubject()); 40432 } 40433 if (element.hasAbout()) { 40434 openArray("about"); 40435 for (Reference e : element.getAbout()) 40436 composeReference(null, e); 40437 closeArray(); 40438 } 40439 ; 40440 if (element.hasEncounter()) { 40441 composeReference("encounter", element.getEncounter()); 40442 } 40443 if (element.hasPayload()) { 40444 openArray("payload"); 40445 for (CommunicationRequest.CommunicationRequestPayloadComponent e : element.getPayload()) 40446 composeCommunicationRequestCommunicationRequestPayloadComponent(null, e); 40447 closeArray(); 40448 } 40449 ; 40450 if (element.hasOccurrence()) { 40451 composeType("occurrence", element.getOccurrence()); 40452 } 40453 if (element.hasAuthoredOnElement()) { 40454 composeDateTimeCore("authoredOn", element.getAuthoredOnElement(), false); 40455 composeDateTimeExtras("authoredOn", element.getAuthoredOnElement(), false); 40456 } 40457 if (element.hasRequester()) { 40458 composeReference("requester", element.getRequester()); 40459 } 40460 if (element.hasRecipient()) { 40461 openArray("recipient"); 40462 for (Reference e : element.getRecipient()) 40463 composeReference(null, e); 40464 closeArray(); 40465 } 40466 ; 40467 if (element.hasSender()) { 40468 composeReference("sender", element.getSender()); 40469 } 40470 if (element.hasReasonCode()) { 40471 openArray("reasonCode"); 40472 for (CodeableConcept e : element.getReasonCode()) 40473 composeCodeableConcept(null, e); 40474 closeArray(); 40475 } 40476 ; 40477 if (element.hasReasonReference()) { 40478 openArray("reasonReference"); 40479 for (Reference e : element.getReasonReference()) 40480 composeReference(null, e); 40481 closeArray(); 40482 } 40483 ; 40484 if (element.hasNote()) { 40485 openArray("note"); 40486 for (Annotation e : element.getNote()) 40487 composeAnnotation(null, e); 40488 closeArray(); 40489 } 40490 ; 40491 } 40492 40493 protected void composeCommunicationRequestCommunicationRequestPayloadComponent(String name, 40494 CommunicationRequest.CommunicationRequestPayloadComponent element) throws IOException { 40495 if (element != null) { 40496 open(name); 40497 composeCommunicationRequestCommunicationRequestPayloadComponentInner(element); 40498 close(); 40499 } 40500 } 40501 40502 protected void composeCommunicationRequestCommunicationRequestPayloadComponentInner( 40503 CommunicationRequest.CommunicationRequestPayloadComponent element) throws IOException { 40504 composeBackbone(element); 40505 if (element.hasContent()) { 40506 composeType("content", element.getContent()); 40507 } 40508 } 40509 40510 protected void composeCompartmentDefinition(String name, CompartmentDefinition element) throws IOException { 40511 if (element != null) { 40512 prop("resourceType", name); 40513 composeCompartmentDefinitionInner(element); 40514 } 40515 } 40516 40517 protected void composeCompartmentDefinitionInner(CompartmentDefinition element) throws IOException { 40518 composeDomainResourceElements(element); 40519 if (element.hasUrlElement()) { 40520 composeUriCore("url", element.getUrlElement(), false); 40521 composeUriExtras("url", element.getUrlElement(), false); 40522 } 40523 if (element.hasVersionElement()) { 40524 composeStringCore("version", element.getVersionElement(), false); 40525 composeStringExtras("version", element.getVersionElement(), false); 40526 } 40527 if (element.hasNameElement()) { 40528 composeStringCore("name", element.getNameElement(), false); 40529 composeStringExtras("name", element.getNameElement(), false); 40530 } 40531 if (element.hasStatusElement()) { 40532 composeEnumerationCore("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 40533 false); 40534 composeEnumerationExtras("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 40535 false); 40536 } 40537 if (element.hasExperimentalElement()) { 40538 composeBooleanCore("experimental", element.getExperimentalElement(), false); 40539 composeBooleanExtras("experimental", element.getExperimentalElement(), false); 40540 } 40541 if (element.hasDateElement()) { 40542 composeDateTimeCore("date", element.getDateElement(), false); 40543 composeDateTimeExtras("date", element.getDateElement(), false); 40544 } 40545 if (element.hasPublisherElement()) { 40546 composeStringCore("publisher", element.getPublisherElement(), false); 40547 composeStringExtras("publisher", element.getPublisherElement(), false); 40548 } 40549 if (element.hasContact()) { 40550 openArray("contact"); 40551 for (ContactDetail e : element.getContact()) 40552 composeContactDetail(null, e); 40553 closeArray(); 40554 } 40555 ; 40556 if (element.hasDescriptionElement()) { 40557 composeMarkdownCore("description", element.getDescriptionElement(), false); 40558 composeMarkdownExtras("description", element.getDescriptionElement(), false); 40559 } 40560 if (element.hasUseContext()) { 40561 openArray("useContext"); 40562 for (UsageContext e : element.getUseContext()) 40563 composeUsageContext(null, e); 40564 closeArray(); 40565 } 40566 ; 40567 if (element.hasPurposeElement()) { 40568 composeMarkdownCore("purpose", element.getPurposeElement(), false); 40569 composeMarkdownExtras("purpose", element.getPurposeElement(), false); 40570 } 40571 if (element.hasCodeElement()) { 40572 composeEnumerationCore("code", element.getCodeElement(), new CompartmentDefinition.CompartmentTypeEnumFactory(), 40573 false); 40574 composeEnumerationExtras("code", element.getCodeElement(), new CompartmentDefinition.CompartmentTypeEnumFactory(), 40575 false); 40576 } 40577 if (element.hasSearchElement()) { 40578 composeBooleanCore("search", element.getSearchElement(), false); 40579 composeBooleanExtras("search", element.getSearchElement(), false); 40580 } 40581 if (element.hasResource()) { 40582 openArray("resource"); 40583 for (CompartmentDefinition.CompartmentDefinitionResourceComponent e : element.getResource()) 40584 composeCompartmentDefinitionCompartmentDefinitionResourceComponent(null, e); 40585 closeArray(); 40586 } 40587 ; 40588 } 40589 40590 protected void composeCompartmentDefinitionCompartmentDefinitionResourceComponent(String name, 40591 CompartmentDefinition.CompartmentDefinitionResourceComponent element) throws IOException { 40592 if (element != null) { 40593 open(name); 40594 composeCompartmentDefinitionCompartmentDefinitionResourceComponentInner(element); 40595 close(); 40596 } 40597 } 40598 40599 protected void composeCompartmentDefinitionCompartmentDefinitionResourceComponentInner( 40600 CompartmentDefinition.CompartmentDefinitionResourceComponent element) throws IOException { 40601 composeBackbone(element); 40602 if (element.hasCodeElement()) { 40603 composeCodeCore("code", element.getCodeElement(), false); 40604 composeCodeExtras("code", element.getCodeElement(), false); 40605 } 40606 if (element.hasParam()) { 40607 openArray("param"); 40608 for (StringType e : element.getParam()) 40609 composeStringCore(null, e, true); 40610 closeArray(); 40611 if (anyHasExtras(element.getParam())) { 40612 openArray("_param"); 40613 for (StringType e : element.getParam()) 40614 composeStringExtras(null, e, true); 40615 closeArray(); 40616 } 40617 } 40618 ; 40619 if (element.hasDocumentationElement()) { 40620 composeStringCore("documentation", element.getDocumentationElement(), false); 40621 composeStringExtras("documentation", element.getDocumentationElement(), false); 40622 } 40623 } 40624 40625 protected void composeComposition(String name, Composition element) throws IOException { 40626 if (element != null) { 40627 prop("resourceType", name); 40628 composeCompositionInner(element); 40629 } 40630 } 40631 40632 protected void composeCompositionInner(Composition element) throws IOException { 40633 composeDomainResourceElements(element); 40634 if (element.hasIdentifier()) { 40635 composeIdentifier("identifier", element.getIdentifier()); 40636 } 40637 if (element.hasStatusElement()) { 40638 composeEnumerationCore("status", element.getStatusElement(), new Composition.CompositionStatusEnumFactory(), 40639 false); 40640 composeEnumerationExtras("status", element.getStatusElement(), new Composition.CompositionStatusEnumFactory(), 40641 false); 40642 } 40643 if (element.hasType()) { 40644 composeCodeableConcept("type", element.getType()); 40645 } 40646 if (element.hasCategory()) { 40647 openArray("category"); 40648 for (CodeableConcept e : element.getCategory()) 40649 composeCodeableConcept(null, e); 40650 closeArray(); 40651 } 40652 ; 40653 if (element.hasSubject()) { 40654 composeReference("subject", element.getSubject()); 40655 } 40656 if (element.hasEncounter()) { 40657 composeReference("encounter", element.getEncounter()); 40658 } 40659 if (element.hasDateElement()) { 40660 composeDateTimeCore("date", element.getDateElement(), false); 40661 composeDateTimeExtras("date", element.getDateElement(), false); 40662 } 40663 if (element.hasAuthor()) { 40664 openArray("author"); 40665 for (Reference e : element.getAuthor()) 40666 composeReference(null, e); 40667 closeArray(); 40668 } 40669 ; 40670 if (element.hasTitleElement()) { 40671 composeStringCore("title", element.getTitleElement(), false); 40672 composeStringExtras("title", element.getTitleElement(), false); 40673 } 40674 if (element.hasConfidentialityElement()) { 40675 composeEnumerationCore("confidentiality", element.getConfidentialityElement(), 40676 new Composition.DocumentConfidentialityEnumFactory(), false); 40677 composeEnumerationExtras("confidentiality", element.getConfidentialityElement(), 40678 new Composition.DocumentConfidentialityEnumFactory(), false); 40679 } 40680 if (element.hasAttester()) { 40681 openArray("attester"); 40682 for (Composition.CompositionAttesterComponent e : element.getAttester()) 40683 composeCompositionCompositionAttesterComponent(null, e); 40684 closeArray(); 40685 } 40686 ; 40687 if (element.hasCustodian()) { 40688 composeReference("custodian", element.getCustodian()); 40689 } 40690 if (element.hasRelatesTo()) { 40691 openArray("relatesTo"); 40692 for (Composition.CompositionRelatesToComponent e : element.getRelatesTo()) 40693 composeCompositionCompositionRelatesToComponent(null, e); 40694 closeArray(); 40695 } 40696 ; 40697 if (element.hasEvent()) { 40698 openArray("event"); 40699 for (Composition.CompositionEventComponent e : element.getEvent()) 40700 composeCompositionCompositionEventComponent(null, e); 40701 closeArray(); 40702 } 40703 ; 40704 if (element.hasSection()) { 40705 openArray("section"); 40706 for (Composition.SectionComponent e : element.getSection()) 40707 composeCompositionSectionComponent(null, e); 40708 closeArray(); 40709 } 40710 ; 40711 } 40712 40713 protected void composeCompositionCompositionAttesterComponent(String name, 40714 Composition.CompositionAttesterComponent element) throws IOException { 40715 if (element != null) { 40716 open(name); 40717 composeCompositionCompositionAttesterComponentInner(element); 40718 close(); 40719 } 40720 } 40721 40722 protected void composeCompositionCompositionAttesterComponentInner(Composition.CompositionAttesterComponent element) 40723 throws IOException { 40724 composeBackbone(element); 40725 if (element.hasModeElement()) { 40726 composeEnumerationCore("mode", element.getModeElement(), new Composition.CompositionAttestationModeEnumFactory(), 40727 false); 40728 composeEnumerationExtras("mode", element.getModeElement(), 40729 new Composition.CompositionAttestationModeEnumFactory(), false); 40730 } 40731 if (element.hasTimeElement()) { 40732 composeDateTimeCore("time", element.getTimeElement(), false); 40733 composeDateTimeExtras("time", element.getTimeElement(), false); 40734 } 40735 if (element.hasParty()) { 40736 composeReference("party", element.getParty()); 40737 } 40738 } 40739 40740 protected void composeCompositionCompositionRelatesToComponent(String name, 40741 Composition.CompositionRelatesToComponent element) throws IOException { 40742 if (element != null) { 40743 open(name); 40744 composeCompositionCompositionRelatesToComponentInner(element); 40745 close(); 40746 } 40747 } 40748 40749 protected void composeCompositionCompositionRelatesToComponentInner(Composition.CompositionRelatesToComponent element) 40750 throws IOException { 40751 composeBackbone(element); 40752 if (element.hasCodeElement()) { 40753 composeEnumerationCore("code", element.getCodeElement(), new Composition.DocumentRelationshipTypeEnumFactory(), 40754 false); 40755 composeEnumerationExtras("code", element.getCodeElement(), new Composition.DocumentRelationshipTypeEnumFactory(), 40756 false); 40757 } 40758 if (element.hasTarget()) { 40759 composeType("target", element.getTarget()); 40760 } 40761 } 40762 40763 protected void composeCompositionCompositionEventComponent(String name, Composition.CompositionEventComponent element) 40764 throws IOException { 40765 if (element != null) { 40766 open(name); 40767 composeCompositionCompositionEventComponentInner(element); 40768 close(); 40769 } 40770 } 40771 40772 protected void composeCompositionCompositionEventComponentInner(Composition.CompositionEventComponent element) 40773 throws IOException { 40774 composeBackbone(element); 40775 if (element.hasCode()) { 40776 openArray("code"); 40777 for (CodeableConcept e : element.getCode()) 40778 composeCodeableConcept(null, e); 40779 closeArray(); 40780 } 40781 ; 40782 if (element.hasPeriod()) { 40783 composePeriod("period", element.getPeriod()); 40784 } 40785 if (element.hasDetail()) { 40786 openArray("detail"); 40787 for (Reference e : element.getDetail()) 40788 composeReference(null, e); 40789 closeArray(); 40790 } 40791 ; 40792 } 40793 40794 protected void composeCompositionSectionComponent(String name, Composition.SectionComponent element) 40795 throws IOException { 40796 if (element != null) { 40797 open(name); 40798 composeCompositionSectionComponentInner(element); 40799 close(); 40800 } 40801 } 40802 40803 protected void composeCompositionSectionComponentInner(Composition.SectionComponent element) throws IOException { 40804 composeBackbone(element); 40805 if (element.hasTitleElement()) { 40806 composeStringCore("title", element.getTitleElement(), false); 40807 composeStringExtras("title", element.getTitleElement(), false); 40808 } 40809 if (element.hasCode()) { 40810 composeCodeableConcept("code", element.getCode()); 40811 } 40812 if (element.hasAuthor()) { 40813 openArray("author"); 40814 for (Reference e : element.getAuthor()) 40815 composeReference(null, e); 40816 closeArray(); 40817 } 40818 ; 40819 if (element.hasFocus()) { 40820 composeReference("focus", element.getFocus()); 40821 } 40822 if (element.hasText()) { 40823 composeNarrative("text", element.getText()); 40824 } 40825 if (element.hasModeElement()) { 40826 composeEnumerationCore("mode", element.getModeElement(), new Composition.SectionModeEnumFactory(), false); 40827 composeEnumerationExtras("mode", element.getModeElement(), new Composition.SectionModeEnumFactory(), false); 40828 } 40829 if (element.hasOrderedBy()) { 40830 composeCodeableConcept("orderedBy", element.getOrderedBy()); 40831 } 40832 if (element.hasEntry()) { 40833 openArray("entry"); 40834 for (Reference e : element.getEntry()) 40835 composeReference(null, e); 40836 closeArray(); 40837 } 40838 ; 40839 if (element.hasEmptyReason()) { 40840 composeCodeableConcept("emptyReason", element.getEmptyReason()); 40841 } 40842 if (element.hasSection()) { 40843 openArray("section"); 40844 for (Composition.SectionComponent e : element.getSection()) 40845 composeCompositionSectionComponent(null, e); 40846 closeArray(); 40847 } 40848 ; 40849 } 40850 40851 protected void composeConceptMap(String name, ConceptMap element) throws IOException { 40852 if (element != null) { 40853 prop("resourceType", name); 40854 composeConceptMapInner(element); 40855 } 40856 } 40857 40858 protected void composeConceptMapInner(ConceptMap element) throws IOException { 40859 composeDomainResourceElements(element); 40860 if (element.hasUrlElement()) { 40861 composeUriCore("url", element.getUrlElement(), false); 40862 composeUriExtras("url", element.getUrlElement(), false); 40863 } 40864 if (element.hasIdentifier()) { 40865 composeIdentifier("identifier", element.getIdentifier()); 40866 } 40867 if (element.hasVersionElement()) { 40868 composeStringCore("version", element.getVersionElement(), false); 40869 composeStringExtras("version", element.getVersionElement(), false); 40870 } 40871 if (element.hasNameElement()) { 40872 composeStringCore("name", element.getNameElement(), false); 40873 composeStringExtras("name", element.getNameElement(), false); 40874 } 40875 if (element.hasTitleElement()) { 40876 composeStringCore("title", element.getTitleElement(), false); 40877 composeStringExtras("title", element.getTitleElement(), false); 40878 } 40879 if (element.hasStatusElement()) { 40880 composeEnumerationCore("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 40881 false); 40882 composeEnumerationExtras("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 40883 false); 40884 } 40885 if (element.hasExperimentalElement()) { 40886 composeBooleanCore("experimental", element.getExperimentalElement(), false); 40887 composeBooleanExtras("experimental", element.getExperimentalElement(), false); 40888 } 40889 if (element.hasDateElement()) { 40890 composeDateTimeCore("date", element.getDateElement(), false); 40891 composeDateTimeExtras("date", element.getDateElement(), false); 40892 } 40893 if (element.hasPublisherElement()) { 40894 composeStringCore("publisher", element.getPublisherElement(), false); 40895 composeStringExtras("publisher", element.getPublisherElement(), false); 40896 } 40897 if (element.hasContact()) { 40898 openArray("contact"); 40899 for (ContactDetail e : element.getContact()) 40900 composeContactDetail(null, e); 40901 closeArray(); 40902 } 40903 ; 40904 if (element.hasDescriptionElement()) { 40905 composeMarkdownCore("description", element.getDescriptionElement(), false); 40906 composeMarkdownExtras("description", element.getDescriptionElement(), false); 40907 } 40908 if (element.hasUseContext()) { 40909 openArray("useContext"); 40910 for (UsageContext e : element.getUseContext()) 40911 composeUsageContext(null, e); 40912 closeArray(); 40913 } 40914 ; 40915 if (element.hasJurisdiction()) { 40916 openArray("jurisdiction"); 40917 for (CodeableConcept e : element.getJurisdiction()) 40918 composeCodeableConcept(null, e); 40919 closeArray(); 40920 } 40921 ; 40922 if (element.hasPurposeElement()) { 40923 composeMarkdownCore("purpose", element.getPurposeElement(), false); 40924 composeMarkdownExtras("purpose", element.getPurposeElement(), false); 40925 } 40926 if (element.hasCopyrightElement()) { 40927 composeMarkdownCore("copyright", element.getCopyrightElement(), false); 40928 composeMarkdownExtras("copyright", element.getCopyrightElement(), false); 40929 } 40930 if (element.hasSource()) { 40931 composeType("source", element.getSource()); 40932 } 40933 if (element.hasTarget()) { 40934 composeType("target", element.getTarget()); 40935 } 40936 if (element.hasGroup()) { 40937 openArray("group"); 40938 for (ConceptMap.ConceptMapGroupComponent e : element.getGroup()) 40939 composeConceptMapConceptMapGroupComponent(null, e); 40940 closeArray(); 40941 } 40942 ; 40943 } 40944 40945 protected void composeConceptMapConceptMapGroupComponent(String name, ConceptMap.ConceptMapGroupComponent element) 40946 throws IOException { 40947 if (element != null) { 40948 open(name); 40949 composeConceptMapConceptMapGroupComponentInner(element); 40950 close(); 40951 } 40952 } 40953 40954 protected void composeConceptMapConceptMapGroupComponentInner(ConceptMap.ConceptMapGroupComponent element) 40955 throws IOException { 40956 composeBackbone(element); 40957 if (element.hasSourceElement()) { 40958 composeUriCore("source", element.getSourceElement(), false); 40959 composeUriExtras("source", element.getSourceElement(), false); 40960 } 40961 if (element.hasSourceVersionElement()) { 40962 composeStringCore("sourceVersion", element.getSourceVersionElement(), false); 40963 composeStringExtras("sourceVersion", element.getSourceVersionElement(), false); 40964 } 40965 if (element.hasTargetElement()) { 40966 composeUriCore("target", element.getTargetElement(), false); 40967 composeUriExtras("target", element.getTargetElement(), false); 40968 } 40969 if (element.hasTargetVersionElement()) { 40970 composeStringCore("targetVersion", element.getTargetVersionElement(), false); 40971 composeStringExtras("targetVersion", element.getTargetVersionElement(), false); 40972 } 40973 if (element.hasElement()) { 40974 openArray("element"); 40975 for (ConceptMap.SourceElementComponent e : element.getElement()) 40976 composeConceptMapSourceElementComponent(null, e); 40977 closeArray(); 40978 } 40979 ; 40980 if (element.hasUnmapped()) { 40981 composeConceptMapConceptMapGroupUnmappedComponent("unmapped", element.getUnmapped()); 40982 } 40983 } 40984 40985 protected void composeConceptMapSourceElementComponent(String name, ConceptMap.SourceElementComponent element) 40986 throws IOException { 40987 if (element != null) { 40988 open(name); 40989 composeConceptMapSourceElementComponentInner(element); 40990 close(); 40991 } 40992 } 40993 40994 protected void composeConceptMapSourceElementComponentInner(ConceptMap.SourceElementComponent element) 40995 throws IOException { 40996 composeBackbone(element); 40997 if (element.hasCodeElement()) { 40998 composeCodeCore("code", element.getCodeElement(), false); 40999 composeCodeExtras("code", element.getCodeElement(), false); 41000 } 41001 if (element.hasDisplayElement()) { 41002 composeStringCore("display", element.getDisplayElement(), false); 41003 composeStringExtras("display", element.getDisplayElement(), false); 41004 } 41005 if (element.hasTarget()) { 41006 openArray("target"); 41007 for (ConceptMap.TargetElementComponent e : element.getTarget()) 41008 composeConceptMapTargetElementComponent(null, e); 41009 closeArray(); 41010 } 41011 ; 41012 } 41013 41014 protected void composeConceptMapTargetElementComponent(String name, ConceptMap.TargetElementComponent element) 41015 throws IOException { 41016 if (element != null) { 41017 open(name); 41018 composeConceptMapTargetElementComponentInner(element); 41019 close(); 41020 } 41021 } 41022 41023 protected void composeConceptMapTargetElementComponentInner(ConceptMap.TargetElementComponent element) 41024 throws IOException { 41025 composeBackbone(element); 41026 if (element.hasCodeElement()) { 41027 composeCodeCore("code", element.getCodeElement(), false); 41028 composeCodeExtras("code", element.getCodeElement(), false); 41029 } 41030 if (element.hasDisplayElement()) { 41031 composeStringCore("display", element.getDisplayElement(), false); 41032 composeStringExtras("display", element.getDisplayElement(), false); 41033 } 41034 if (element.hasEquivalenceElement()) { 41035 composeEnumerationCore("equivalence", element.getEquivalenceElement(), 41036 new Enumerations.ConceptMapEquivalenceEnumFactory(), false); 41037 composeEnumerationExtras("equivalence", element.getEquivalenceElement(), 41038 new Enumerations.ConceptMapEquivalenceEnumFactory(), false); 41039 } 41040 if (element.hasCommentElement()) { 41041 composeStringCore("comment", element.getCommentElement(), false); 41042 composeStringExtras("comment", element.getCommentElement(), false); 41043 } 41044 if (element.hasDependsOn()) { 41045 openArray("dependsOn"); 41046 for (ConceptMap.OtherElementComponent e : element.getDependsOn()) 41047 composeConceptMapOtherElementComponent(null, e); 41048 closeArray(); 41049 } 41050 ; 41051 if (element.hasProduct()) { 41052 openArray("product"); 41053 for (ConceptMap.OtherElementComponent e : element.getProduct()) 41054 composeConceptMapOtherElementComponent(null, e); 41055 closeArray(); 41056 } 41057 ; 41058 } 41059 41060 protected void composeConceptMapOtherElementComponent(String name, ConceptMap.OtherElementComponent element) 41061 throws IOException { 41062 if (element != null) { 41063 open(name); 41064 composeConceptMapOtherElementComponentInner(element); 41065 close(); 41066 } 41067 } 41068 41069 protected void composeConceptMapOtherElementComponentInner(ConceptMap.OtherElementComponent element) 41070 throws IOException { 41071 composeBackbone(element); 41072 if (element.hasPropertyElement()) { 41073 composeUriCore("property", element.getPropertyElement(), false); 41074 composeUriExtras("property", element.getPropertyElement(), false); 41075 } 41076 if (element.hasSystemElement()) { 41077 composeCanonicalCore("system", element.getSystemElement(), false); 41078 composeCanonicalExtras("system", element.getSystemElement(), false); 41079 } 41080 if (element.hasValueElement()) { 41081 composeStringCore("value", element.getValueElement(), false); 41082 composeStringExtras("value", element.getValueElement(), false); 41083 } 41084 if (element.hasDisplayElement()) { 41085 composeStringCore("display", element.getDisplayElement(), false); 41086 composeStringExtras("display", element.getDisplayElement(), false); 41087 } 41088 } 41089 41090 protected void composeConceptMapConceptMapGroupUnmappedComponent(String name, 41091 ConceptMap.ConceptMapGroupUnmappedComponent element) throws IOException { 41092 if (element != null) { 41093 open(name); 41094 composeConceptMapConceptMapGroupUnmappedComponentInner(element); 41095 close(); 41096 } 41097 } 41098 41099 protected void composeConceptMapConceptMapGroupUnmappedComponentInner( 41100 ConceptMap.ConceptMapGroupUnmappedComponent element) throws IOException { 41101 composeBackbone(element); 41102 if (element.hasModeElement()) { 41103 composeEnumerationCore("mode", element.getModeElement(), new ConceptMap.ConceptMapGroupUnmappedModeEnumFactory(), 41104 false); 41105 composeEnumerationExtras("mode", element.getModeElement(), 41106 new ConceptMap.ConceptMapGroupUnmappedModeEnumFactory(), false); 41107 } 41108 if (element.hasCodeElement()) { 41109 composeCodeCore("code", element.getCodeElement(), false); 41110 composeCodeExtras("code", element.getCodeElement(), false); 41111 } 41112 if (element.hasDisplayElement()) { 41113 composeStringCore("display", element.getDisplayElement(), false); 41114 composeStringExtras("display", element.getDisplayElement(), false); 41115 } 41116 if (element.hasUrlElement()) { 41117 composeCanonicalCore("url", element.getUrlElement(), false); 41118 composeCanonicalExtras("url", element.getUrlElement(), false); 41119 } 41120 } 41121 41122 protected void composeCondition(String name, Condition element) throws IOException { 41123 if (element != null) { 41124 prop("resourceType", name); 41125 composeConditionInner(element); 41126 } 41127 } 41128 41129 protected void composeConditionInner(Condition element) throws IOException { 41130 composeDomainResourceElements(element); 41131 if (element.hasIdentifier()) { 41132 openArray("identifier"); 41133 for (Identifier e : element.getIdentifier()) 41134 composeIdentifier(null, e); 41135 closeArray(); 41136 } 41137 ; 41138 if (element.hasClinicalStatus()) { 41139 composeCodeableConcept("clinicalStatus", element.getClinicalStatus()); 41140 } 41141 if (element.hasVerificationStatus()) { 41142 composeCodeableConcept("verificationStatus", element.getVerificationStatus()); 41143 } 41144 if (element.hasCategory()) { 41145 openArray("category"); 41146 for (CodeableConcept e : element.getCategory()) 41147 composeCodeableConcept(null, e); 41148 closeArray(); 41149 } 41150 ; 41151 if (element.hasSeverity()) { 41152 composeCodeableConcept("severity", element.getSeverity()); 41153 } 41154 if (element.hasCode()) { 41155 composeCodeableConcept("code", element.getCode()); 41156 } 41157 if (element.hasBodySite()) { 41158 openArray("bodySite"); 41159 for (CodeableConcept e : element.getBodySite()) 41160 composeCodeableConcept(null, e); 41161 closeArray(); 41162 } 41163 ; 41164 if (element.hasSubject()) { 41165 composeReference("subject", element.getSubject()); 41166 } 41167 if (element.hasEncounter()) { 41168 composeReference("encounter", element.getEncounter()); 41169 } 41170 if (element.hasOnset()) { 41171 composeType("onset", element.getOnset()); 41172 } 41173 if (element.hasAbatement()) { 41174 composeType("abatement", element.getAbatement()); 41175 } 41176 if (element.hasRecordedDateElement()) { 41177 composeDateTimeCore("recordedDate", element.getRecordedDateElement(), false); 41178 composeDateTimeExtras("recordedDate", element.getRecordedDateElement(), false); 41179 } 41180 if (element.hasRecorder()) { 41181 composeReference("recorder", element.getRecorder()); 41182 } 41183 if (element.hasAsserter()) { 41184 composeReference("asserter", element.getAsserter()); 41185 } 41186 if (element.hasStage()) { 41187 openArray("stage"); 41188 for (Condition.ConditionStageComponent e : element.getStage()) 41189 composeConditionConditionStageComponent(null, e); 41190 closeArray(); 41191 } 41192 ; 41193 if (element.hasEvidence()) { 41194 openArray("evidence"); 41195 for (Condition.ConditionEvidenceComponent e : element.getEvidence()) 41196 composeConditionConditionEvidenceComponent(null, e); 41197 closeArray(); 41198 } 41199 ; 41200 if (element.hasNote()) { 41201 openArray("note"); 41202 for (Annotation e : element.getNote()) 41203 composeAnnotation(null, e); 41204 closeArray(); 41205 } 41206 ; 41207 } 41208 41209 protected void composeConditionConditionStageComponent(String name, Condition.ConditionStageComponent element) 41210 throws IOException { 41211 if (element != null) { 41212 open(name); 41213 composeConditionConditionStageComponentInner(element); 41214 close(); 41215 } 41216 } 41217 41218 protected void composeConditionConditionStageComponentInner(Condition.ConditionStageComponent element) 41219 throws IOException { 41220 composeBackbone(element); 41221 if (element.hasSummary()) { 41222 composeCodeableConcept("summary", element.getSummary()); 41223 } 41224 if (element.hasAssessment()) { 41225 openArray("assessment"); 41226 for (Reference e : element.getAssessment()) 41227 composeReference(null, e); 41228 closeArray(); 41229 } 41230 ; 41231 if (element.hasType()) { 41232 composeCodeableConcept("type", element.getType()); 41233 } 41234 } 41235 41236 protected void composeConditionConditionEvidenceComponent(String name, Condition.ConditionEvidenceComponent element) 41237 throws IOException { 41238 if (element != null) { 41239 open(name); 41240 composeConditionConditionEvidenceComponentInner(element); 41241 close(); 41242 } 41243 } 41244 41245 protected void composeConditionConditionEvidenceComponentInner(Condition.ConditionEvidenceComponent element) 41246 throws IOException { 41247 composeBackbone(element); 41248 if (element.hasCode()) { 41249 openArray("code"); 41250 for (CodeableConcept e : element.getCode()) 41251 composeCodeableConcept(null, e); 41252 closeArray(); 41253 } 41254 ; 41255 if (element.hasDetail()) { 41256 openArray("detail"); 41257 for (Reference e : element.getDetail()) 41258 composeReference(null, e); 41259 closeArray(); 41260 } 41261 ; 41262 } 41263 41264 protected void composeConsent(String name, Consent element) throws IOException { 41265 if (element != null) { 41266 prop("resourceType", name); 41267 composeConsentInner(element); 41268 } 41269 } 41270 41271 protected void composeConsentInner(Consent element) throws IOException { 41272 composeDomainResourceElements(element); 41273 if (element.hasIdentifier()) { 41274 openArray("identifier"); 41275 for (Identifier e : element.getIdentifier()) 41276 composeIdentifier(null, e); 41277 closeArray(); 41278 } 41279 ; 41280 if (element.hasStatusElement()) { 41281 composeEnumerationCore("status", element.getStatusElement(), new Consent.ConsentStateEnumFactory(), false); 41282 composeEnumerationExtras("status", element.getStatusElement(), new Consent.ConsentStateEnumFactory(), false); 41283 } 41284 if (element.hasScope()) { 41285 composeCodeableConcept("scope", element.getScope()); 41286 } 41287 if (element.hasCategory()) { 41288 openArray("category"); 41289 for (CodeableConcept e : element.getCategory()) 41290 composeCodeableConcept(null, e); 41291 closeArray(); 41292 } 41293 ; 41294 if (element.hasPatient()) { 41295 composeReference("patient", element.getPatient()); 41296 } 41297 if (element.hasDateTimeElement()) { 41298 composeDateTimeCore("dateTime", element.getDateTimeElement(), false); 41299 composeDateTimeExtras("dateTime", element.getDateTimeElement(), false); 41300 } 41301 if (element.hasPerformer()) { 41302 openArray("performer"); 41303 for (Reference e : element.getPerformer()) 41304 composeReference(null, e); 41305 closeArray(); 41306 } 41307 ; 41308 if (element.hasOrganization()) { 41309 openArray("organization"); 41310 for (Reference e : element.getOrganization()) 41311 composeReference(null, e); 41312 closeArray(); 41313 } 41314 ; 41315 if (element.hasSource()) { 41316 composeType("source", element.getSource()); 41317 } 41318 if (element.hasPolicy()) { 41319 openArray("policy"); 41320 for (Consent.ConsentPolicyComponent e : element.getPolicy()) 41321 composeConsentConsentPolicyComponent(null, e); 41322 closeArray(); 41323 } 41324 ; 41325 if (element.hasPolicyRule()) { 41326 composeCodeableConcept("policyRule", element.getPolicyRule()); 41327 } 41328 if (element.hasVerification()) { 41329 openArray("verification"); 41330 for (Consent.ConsentVerificationComponent e : element.getVerification()) 41331 composeConsentConsentVerificationComponent(null, e); 41332 closeArray(); 41333 } 41334 ; 41335 if (element.hasProvision()) { 41336 composeConsentprovisionComponent("provision", element.getProvision()); 41337 } 41338 } 41339 41340 protected void composeConsentConsentPolicyComponent(String name, Consent.ConsentPolicyComponent element) 41341 throws IOException { 41342 if (element != null) { 41343 open(name); 41344 composeConsentConsentPolicyComponentInner(element); 41345 close(); 41346 } 41347 } 41348 41349 protected void composeConsentConsentPolicyComponentInner(Consent.ConsentPolicyComponent element) throws IOException { 41350 composeBackbone(element); 41351 if (element.hasAuthorityElement()) { 41352 composeUriCore("authority", element.getAuthorityElement(), false); 41353 composeUriExtras("authority", element.getAuthorityElement(), false); 41354 } 41355 if (element.hasUriElement()) { 41356 composeUriCore("uri", element.getUriElement(), false); 41357 composeUriExtras("uri", element.getUriElement(), false); 41358 } 41359 } 41360 41361 protected void composeConsentConsentVerificationComponent(String name, Consent.ConsentVerificationComponent element) 41362 throws IOException { 41363 if (element != null) { 41364 open(name); 41365 composeConsentConsentVerificationComponentInner(element); 41366 close(); 41367 } 41368 } 41369 41370 protected void composeConsentConsentVerificationComponentInner(Consent.ConsentVerificationComponent element) 41371 throws IOException { 41372 composeBackbone(element); 41373 if (element.hasVerifiedElement()) { 41374 composeBooleanCore("verified", element.getVerifiedElement(), false); 41375 composeBooleanExtras("verified", element.getVerifiedElement(), false); 41376 } 41377 if (element.hasVerifiedWith()) { 41378 composeReference("verifiedWith", element.getVerifiedWith()); 41379 } 41380 if (element.hasVerificationDateElement()) { 41381 composeDateTimeCore("verificationDate", element.getVerificationDateElement(), false); 41382 composeDateTimeExtras("verificationDate", element.getVerificationDateElement(), false); 41383 } 41384 } 41385 41386 protected void composeConsentprovisionComponent(String name, Consent.ProvisionComponent element) throws IOException { 41387 if (element != null) { 41388 open(name); 41389 composeConsentprovisionComponentInner(element); 41390 close(); 41391 } 41392 } 41393 41394 protected void composeConsentprovisionComponentInner(Consent.ProvisionComponent element) throws IOException { 41395 composeBackbone(element); 41396 if (element.hasTypeElement()) { 41397 composeEnumerationCore("type", element.getTypeElement(), new Consent.ConsentProvisionTypeEnumFactory(), false); 41398 composeEnumerationExtras("type", element.getTypeElement(), new Consent.ConsentProvisionTypeEnumFactory(), false); 41399 } 41400 if (element.hasPeriod()) { 41401 composePeriod("period", element.getPeriod()); 41402 } 41403 if (element.hasActor()) { 41404 openArray("actor"); 41405 for (Consent.provisionActorComponent e : element.getActor()) 41406 composeConsentprovisionActorComponent(null, e); 41407 closeArray(); 41408 } 41409 ; 41410 if (element.hasAction()) { 41411 openArray("action"); 41412 for (CodeableConcept e : element.getAction()) 41413 composeCodeableConcept(null, e); 41414 closeArray(); 41415 } 41416 ; 41417 if (element.hasSecurityLabel()) { 41418 openArray("securityLabel"); 41419 for (Coding e : element.getSecurityLabel()) 41420 composeCoding(null, e); 41421 closeArray(); 41422 } 41423 ; 41424 if (element.hasPurpose()) { 41425 openArray("purpose"); 41426 for (Coding e : element.getPurpose()) 41427 composeCoding(null, e); 41428 closeArray(); 41429 } 41430 ; 41431 if (element.hasClass_()) { 41432 openArray("class"); 41433 for (Coding e : element.getClass_()) 41434 composeCoding(null, e); 41435 closeArray(); 41436 } 41437 ; 41438 if (element.hasCode()) { 41439 openArray("code"); 41440 for (CodeableConcept e : element.getCode()) 41441 composeCodeableConcept(null, e); 41442 closeArray(); 41443 } 41444 ; 41445 if (element.hasDataPeriod()) { 41446 composePeriod("dataPeriod", element.getDataPeriod()); 41447 } 41448 if (element.hasData()) { 41449 openArray("data"); 41450 for (Consent.provisionDataComponent e : element.getData()) 41451 composeConsentprovisionDataComponent(null, e); 41452 closeArray(); 41453 } 41454 ; 41455 if (element.hasProvision()) { 41456 openArray("provision"); 41457 for (Consent.ProvisionComponent e : element.getProvision()) 41458 composeConsentprovisionComponent(null, e); 41459 closeArray(); 41460 } 41461 ; 41462 } 41463 41464 protected void composeConsentprovisionActorComponent(String name, Consent.provisionActorComponent element) 41465 throws IOException { 41466 if (element != null) { 41467 open(name); 41468 composeConsentprovisionActorComponentInner(element); 41469 close(); 41470 } 41471 } 41472 41473 protected void composeConsentprovisionActorComponentInner(Consent.provisionActorComponent element) 41474 throws IOException { 41475 composeBackbone(element); 41476 if (element.hasRole()) { 41477 composeCodeableConcept("role", element.getRole()); 41478 } 41479 if (element.hasReference()) { 41480 composeReference("reference", element.getReference()); 41481 } 41482 } 41483 41484 protected void composeConsentprovisionDataComponent(String name, Consent.provisionDataComponent element) 41485 throws IOException { 41486 if (element != null) { 41487 open(name); 41488 composeConsentprovisionDataComponentInner(element); 41489 close(); 41490 } 41491 } 41492 41493 protected void composeConsentprovisionDataComponentInner(Consent.provisionDataComponent element) throws IOException { 41494 composeBackbone(element); 41495 if (element.hasMeaningElement()) { 41496 composeEnumerationCore("meaning", element.getMeaningElement(), new Consent.ConsentDataMeaningEnumFactory(), 41497 false); 41498 composeEnumerationExtras("meaning", element.getMeaningElement(), new Consent.ConsentDataMeaningEnumFactory(), 41499 false); 41500 } 41501 if (element.hasReference()) { 41502 composeReference("reference", element.getReference()); 41503 } 41504 } 41505 41506 protected void composeContract(String name, Contract element) throws IOException { 41507 if (element != null) { 41508 prop("resourceType", name); 41509 composeContractInner(element); 41510 } 41511 } 41512 41513 protected void composeContractInner(Contract element) throws IOException { 41514 composeDomainResourceElements(element); 41515 if (element.hasIdentifier()) { 41516 openArray("identifier"); 41517 for (Identifier e : element.getIdentifier()) 41518 composeIdentifier(null, e); 41519 closeArray(); 41520 } 41521 ; 41522 if (element.hasUrlElement()) { 41523 composeUriCore("url", element.getUrlElement(), false); 41524 composeUriExtras("url", element.getUrlElement(), false); 41525 } 41526 if (element.hasVersionElement()) { 41527 composeStringCore("version", element.getVersionElement(), false); 41528 composeStringExtras("version", element.getVersionElement(), false); 41529 } 41530 if (element.hasStatusElement()) { 41531 composeEnumerationCore("status", element.getStatusElement(), new Contract.ContractStatusEnumFactory(), false); 41532 composeEnumerationExtras("status", element.getStatusElement(), new Contract.ContractStatusEnumFactory(), false); 41533 } 41534 if (element.hasLegalState()) { 41535 composeCodeableConcept("legalState", element.getLegalState()); 41536 } 41537 if (element.hasInstantiatesCanonical()) { 41538 composeReference("instantiatesCanonical", element.getInstantiatesCanonical()); 41539 } 41540 if (element.hasInstantiatesUriElement()) { 41541 composeUriCore("instantiatesUri", element.getInstantiatesUriElement(), false); 41542 composeUriExtras("instantiatesUri", element.getInstantiatesUriElement(), false); 41543 } 41544 if (element.hasContentDerivative()) { 41545 composeCodeableConcept("contentDerivative", element.getContentDerivative()); 41546 } 41547 if (element.hasIssuedElement()) { 41548 composeDateTimeCore("issued", element.getIssuedElement(), false); 41549 composeDateTimeExtras("issued", element.getIssuedElement(), false); 41550 } 41551 if (element.hasApplies()) { 41552 composePeriod("applies", element.getApplies()); 41553 } 41554 if (element.hasExpirationType()) { 41555 composeCodeableConcept("expirationType", element.getExpirationType()); 41556 } 41557 if (element.hasSubject()) { 41558 openArray("subject"); 41559 for (Reference e : element.getSubject()) 41560 composeReference(null, e); 41561 closeArray(); 41562 } 41563 ; 41564 if (element.hasAuthority()) { 41565 openArray("authority"); 41566 for (Reference e : element.getAuthority()) 41567 composeReference(null, e); 41568 closeArray(); 41569 } 41570 ; 41571 if (element.hasDomain()) { 41572 openArray("domain"); 41573 for (Reference e : element.getDomain()) 41574 composeReference(null, e); 41575 closeArray(); 41576 } 41577 ; 41578 if (element.hasSite()) { 41579 openArray("site"); 41580 for (Reference e : element.getSite()) 41581 composeReference(null, e); 41582 closeArray(); 41583 } 41584 ; 41585 if (element.hasNameElement()) { 41586 composeStringCore("name", element.getNameElement(), false); 41587 composeStringExtras("name", element.getNameElement(), false); 41588 } 41589 if (element.hasTitleElement()) { 41590 composeStringCore("title", element.getTitleElement(), false); 41591 composeStringExtras("title", element.getTitleElement(), false); 41592 } 41593 if (element.hasSubtitleElement()) { 41594 composeStringCore("subtitle", element.getSubtitleElement(), false); 41595 composeStringExtras("subtitle", element.getSubtitleElement(), false); 41596 } 41597 if (element.hasAlias()) { 41598 openArray("alias"); 41599 for (StringType e : element.getAlias()) 41600 composeStringCore(null, e, true); 41601 closeArray(); 41602 if (anyHasExtras(element.getAlias())) { 41603 openArray("_alias"); 41604 for (StringType e : element.getAlias()) 41605 composeStringExtras(null, e, true); 41606 closeArray(); 41607 } 41608 } 41609 ; 41610 if (element.hasAuthor()) { 41611 composeReference("author", element.getAuthor()); 41612 } 41613 if (element.hasScope()) { 41614 composeCodeableConcept("scope", element.getScope()); 41615 } 41616 if (element.hasTopic()) { 41617 composeType("topic", element.getTopic()); 41618 } 41619 if (element.hasType()) { 41620 composeCodeableConcept("type", element.getType()); 41621 } 41622 if (element.hasSubType()) { 41623 openArray("subType"); 41624 for (CodeableConcept e : element.getSubType()) 41625 composeCodeableConcept(null, e); 41626 closeArray(); 41627 } 41628 ; 41629 if (element.hasContentDefinition()) { 41630 composeContractContentDefinitionComponent("contentDefinition", element.getContentDefinition()); 41631 } 41632 if (element.hasTerm()) { 41633 openArray("term"); 41634 for (Contract.TermComponent e : element.getTerm()) 41635 composeContractTermComponent(null, e); 41636 closeArray(); 41637 } 41638 ; 41639 if (element.hasSupportingInfo()) { 41640 openArray("supportingInfo"); 41641 for (Reference e : element.getSupportingInfo()) 41642 composeReference(null, e); 41643 closeArray(); 41644 } 41645 ; 41646 if (element.hasRelevantHistory()) { 41647 openArray("relevantHistory"); 41648 for (Reference e : element.getRelevantHistory()) 41649 composeReference(null, e); 41650 closeArray(); 41651 } 41652 ; 41653 if (element.hasSigner()) { 41654 openArray("signer"); 41655 for (Contract.SignatoryComponent e : element.getSigner()) 41656 composeContractSignatoryComponent(null, e); 41657 closeArray(); 41658 } 41659 ; 41660 if (element.hasFriendly()) { 41661 openArray("friendly"); 41662 for (Contract.FriendlyLanguageComponent e : element.getFriendly()) 41663 composeContractFriendlyLanguageComponent(null, e); 41664 closeArray(); 41665 } 41666 ; 41667 if (element.hasLegal()) { 41668 openArray("legal"); 41669 for (Contract.LegalLanguageComponent e : element.getLegal()) 41670 composeContractLegalLanguageComponent(null, e); 41671 closeArray(); 41672 } 41673 ; 41674 if (element.hasRule()) { 41675 openArray("rule"); 41676 for (Contract.ComputableLanguageComponent e : element.getRule()) 41677 composeContractComputableLanguageComponent(null, e); 41678 closeArray(); 41679 } 41680 ; 41681 if (element.hasLegallyBinding()) { 41682 composeType("legallyBinding", element.getLegallyBinding()); 41683 } 41684 } 41685 41686 protected void composeContractContentDefinitionComponent(String name, Contract.ContentDefinitionComponent element) 41687 throws IOException { 41688 if (element != null) { 41689 open(name); 41690 composeContractContentDefinitionComponentInner(element); 41691 close(); 41692 } 41693 } 41694 41695 protected void composeContractContentDefinitionComponentInner(Contract.ContentDefinitionComponent element) 41696 throws IOException { 41697 composeBackbone(element); 41698 if (element.hasType()) { 41699 composeCodeableConcept("type", element.getType()); 41700 } 41701 if (element.hasSubType()) { 41702 composeCodeableConcept("subType", element.getSubType()); 41703 } 41704 if (element.hasPublisher()) { 41705 composeReference("publisher", element.getPublisher()); 41706 } 41707 if (element.hasPublicationDateElement()) { 41708 composeDateTimeCore("publicationDate", element.getPublicationDateElement(), false); 41709 composeDateTimeExtras("publicationDate", element.getPublicationDateElement(), false); 41710 } 41711 if (element.hasPublicationStatusElement()) { 41712 composeEnumerationCore("publicationStatus", element.getPublicationStatusElement(), 41713 new Contract.ContractPublicationStatusEnumFactory(), false); 41714 composeEnumerationExtras("publicationStatus", element.getPublicationStatusElement(), 41715 new Contract.ContractPublicationStatusEnumFactory(), false); 41716 } 41717 if (element.hasCopyrightElement()) { 41718 composeMarkdownCore("copyright", element.getCopyrightElement(), false); 41719 composeMarkdownExtras("copyright", element.getCopyrightElement(), false); 41720 } 41721 } 41722 41723 protected void composeContractTermComponent(String name, Contract.TermComponent element) throws IOException { 41724 if (element != null) { 41725 open(name); 41726 composeContractTermComponentInner(element); 41727 close(); 41728 } 41729 } 41730 41731 protected void composeContractTermComponentInner(Contract.TermComponent element) throws IOException { 41732 composeBackbone(element); 41733 if (element.hasIdentifier()) { 41734 composeIdentifier("identifier", element.getIdentifier()); 41735 } 41736 if (element.hasIssuedElement()) { 41737 composeDateTimeCore("issued", element.getIssuedElement(), false); 41738 composeDateTimeExtras("issued", element.getIssuedElement(), false); 41739 } 41740 if (element.hasApplies()) { 41741 composePeriod("applies", element.getApplies()); 41742 } 41743 if (element.hasTopic()) { 41744 composeType("topic", element.getTopic()); 41745 } 41746 if (element.hasType()) { 41747 composeCodeableConcept("type", element.getType()); 41748 } 41749 if (element.hasSubType()) { 41750 composeCodeableConcept("subType", element.getSubType()); 41751 } 41752 if (element.hasTextElement()) { 41753 composeStringCore("text", element.getTextElement(), false); 41754 composeStringExtras("text", element.getTextElement(), false); 41755 } 41756 if (element.hasSecurityLabel()) { 41757 openArray("securityLabel"); 41758 for (Contract.SecurityLabelComponent e : element.getSecurityLabel()) 41759 composeContractSecurityLabelComponent(null, e); 41760 closeArray(); 41761 } 41762 ; 41763 if (element.hasOffer()) { 41764 composeContractContractOfferComponent("offer", element.getOffer()); 41765 } 41766 if (element.hasAsset()) { 41767 openArray("asset"); 41768 for (Contract.ContractAssetComponent e : element.getAsset()) 41769 composeContractContractAssetComponent(null, e); 41770 closeArray(); 41771 } 41772 ; 41773 if (element.hasAction()) { 41774 openArray("action"); 41775 for (Contract.ActionComponent e : element.getAction()) 41776 composeContractActionComponent(null, e); 41777 closeArray(); 41778 } 41779 ; 41780 if (element.hasGroup()) { 41781 openArray("group"); 41782 for (Contract.TermComponent e : element.getGroup()) 41783 composeContractTermComponent(null, e); 41784 closeArray(); 41785 } 41786 ; 41787 } 41788 41789 protected void composeContractSecurityLabelComponent(String name, Contract.SecurityLabelComponent element) 41790 throws IOException { 41791 if (element != null) { 41792 open(name); 41793 composeContractSecurityLabelComponentInner(element); 41794 close(); 41795 } 41796 } 41797 41798 protected void composeContractSecurityLabelComponentInner(Contract.SecurityLabelComponent element) 41799 throws IOException { 41800 composeBackbone(element); 41801 if (element.hasNumber()) { 41802 openArray("number"); 41803 for (UnsignedIntType e : element.getNumber()) 41804 composeUnsignedIntCore(null, e, true); 41805 closeArray(); 41806 if (anyHasExtras(element.getNumber())) { 41807 openArray("_number"); 41808 for (UnsignedIntType e : element.getNumber()) 41809 composeUnsignedIntExtras(null, e, true); 41810 closeArray(); 41811 } 41812 } 41813 ; 41814 if (element.hasClassification()) { 41815 composeCoding("classification", element.getClassification()); 41816 } 41817 if (element.hasCategory()) { 41818 openArray("category"); 41819 for (Coding e : element.getCategory()) 41820 composeCoding(null, e); 41821 closeArray(); 41822 } 41823 ; 41824 if (element.hasControl()) { 41825 openArray("control"); 41826 for (Coding e : element.getControl()) 41827 composeCoding(null, e); 41828 closeArray(); 41829 } 41830 ; 41831 } 41832 41833 protected void composeContractContractOfferComponent(String name, Contract.ContractOfferComponent element) 41834 throws IOException { 41835 if (element != null) { 41836 open(name); 41837 composeContractContractOfferComponentInner(element); 41838 close(); 41839 } 41840 } 41841 41842 protected void composeContractContractOfferComponentInner(Contract.ContractOfferComponent element) 41843 throws IOException { 41844 composeBackbone(element); 41845 if (element.hasIdentifier()) { 41846 openArray("identifier"); 41847 for (Identifier e : element.getIdentifier()) 41848 composeIdentifier(null, e); 41849 closeArray(); 41850 } 41851 ; 41852 if (element.hasParty()) { 41853 openArray("party"); 41854 for (Contract.ContractPartyComponent e : element.getParty()) 41855 composeContractContractPartyComponent(null, e); 41856 closeArray(); 41857 } 41858 ; 41859 if (element.hasTopic()) { 41860 composeReference("topic", element.getTopic()); 41861 } 41862 if (element.hasType()) { 41863 composeCodeableConcept("type", element.getType()); 41864 } 41865 if (element.hasDecision()) { 41866 composeCodeableConcept("decision", element.getDecision()); 41867 } 41868 if (element.hasDecisionMode()) { 41869 openArray("decisionMode"); 41870 for (CodeableConcept e : element.getDecisionMode()) 41871 composeCodeableConcept(null, e); 41872 closeArray(); 41873 } 41874 ; 41875 if (element.hasAnswer()) { 41876 openArray("answer"); 41877 for (Contract.AnswerComponent e : element.getAnswer()) 41878 composeContractAnswerComponent(null, e); 41879 closeArray(); 41880 } 41881 ; 41882 if (element.hasTextElement()) { 41883 composeStringCore("text", element.getTextElement(), false); 41884 composeStringExtras("text", element.getTextElement(), false); 41885 } 41886 if (element.hasLinkId()) { 41887 openArray("linkId"); 41888 for (StringType e : element.getLinkId()) 41889 composeStringCore(null, e, true); 41890 closeArray(); 41891 if (anyHasExtras(element.getLinkId())) { 41892 openArray("_linkId"); 41893 for (StringType e : element.getLinkId()) 41894 composeStringExtras(null, e, true); 41895 closeArray(); 41896 } 41897 } 41898 ; 41899 if (element.hasSecurityLabelNumber()) { 41900 openArray("securityLabelNumber"); 41901 for (UnsignedIntType e : element.getSecurityLabelNumber()) 41902 composeUnsignedIntCore(null, e, true); 41903 closeArray(); 41904 if (anyHasExtras(element.getSecurityLabelNumber())) { 41905 openArray("_securityLabelNumber"); 41906 for (UnsignedIntType e : element.getSecurityLabelNumber()) 41907 composeUnsignedIntExtras(null, e, true); 41908 closeArray(); 41909 } 41910 } 41911 ; 41912 } 41913 41914 protected void composeContractContractPartyComponent(String name, Contract.ContractPartyComponent element) 41915 throws IOException { 41916 if (element != null) { 41917 open(name); 41918 composeContractContractPartyComponentInner(element); 41919 close(); 41920 } 41921 } 41922 41923 protected void composeContractContractPartyComponentInner(Contract.ContractPartyComponent element) 41924 throws IOException { 41925 composeBackbone(element); 41926 if (element.hasReference()) { 41927 openArray("reference"); 41928 for (Reference e : element.getReference()) 41929 composeReference(null, e); 41930 closeArray(); 41931 } 41932 ; 41933 if (element.hasRole()) { 41934 composeCodeableConcept("role", element.getRole()); 41935 } 41936 } 41937 41938 protected void composeContractAnswerComponent(String name, Contract.AnswerComponent element) throws IOException { 41939 if (element != null) { 41940 open(name); 41941 composeContractAnswerComponentInner(element); 41942 close(); 41943 } 41944 } 41945 41946 protected void composeContractAnswerComponentInner(Contract.AnswerComponent element) throws IOException { 41947 composeBackbone(element); 41948 if (element.hasValue()) { 41949 composeType("value", element.getValue()); 41950 } 41951 } 41952 41953 protected void composeContractContractAssetComponent(String name, Contract.ContractAssetComponent element) 41954 throws IOException { 41955 if (element != null) { 41956 open(name); 41957 composeContractContractAssetComponentInner(element); 41958 close(); 41959 } 41960 } 41961 41962 protected void composeContractContractAssetComponentInner(Contract.ContractAssetComponent element) 41963 throws IOException { 41964 composeBackbone(element); 41965 if (element.hasScope()) { 41966 composeCodeableConcept("scope", element.getScope()); 41967 } 41968 if (element.hasType()) { 41969 openArray("type"); 41970 for (CodeableConcept e : element.getType()) 41971 composeCodeableConcept(null, e); 41972 closeArray(); 41973 } 41974 ; 41975 if (element.hasTypeReference()) { 41976 openArray("typeReference"); 41977 for (Reference e : element.getTypeReference()) 41978 composeReference(null, e); 41979 closeArray(); 41980 } 41981 ; 41982 if (element.hasSubtype()) { 41983 openArray("subtype"); 41984 for (CodeableConcept e : element.getSubtype()) 41985 composeCodeableConcept(null, e); 41986 closeArray(); 41987 } 41988 ; 41989 if (element.hasRelationship()) { 41990 composeCoding("relationship", element.getRelationship()); 41991 } 41992 if (element.hasContext()) { 41993 openArray("context"); 41994 for (Contract.AssetContextComponent e : element.getContext()) 41995 composeContractAssetContextComponent(null, e); 41996 closeArray(); 41997 } 41998 ; 41999 if (element.hasConditionElement()) { 42000 composeStringCore("condition", element.getConditionElement(), false); 42001 composeStringExtras("condition", element.getConditionElement(), false); 42002 } 42003 if (element.hasPeriodType()) { 42004 openArray("periodType"); 42005 for (CodeableConcept e : element.getPeriodType()) 42006 composeCodeableConcept(null, e); 42007 closeArray(); 42008 } 42009 ; 42010 if (element.hasPeriod()) { 42011 openArray("period"); 42012 for (Period e : element.getPeriod()) 42013 composePeriod(null, e); 42014 closeArray(); 42015 } 42016 ; 42017 if (element.hasUsePeriod()) { 42018 openArray("usePeriod"); 42019 for (Period e : element.getUsePeriod()) 42020 composePeriod(null, e); 42021 closeArray(); 42022 } 42023 ; 42024 if (element.hasTextElement()) { 42025 composeStringCore("text", element.getTextElement(), false); 42026 composeStringExtras("text", element.getTextElement(), false); 42027 } 42028 if (element.hasLinkId()) { 42029 openArray("linkId"); 42030 for (StringType e : element.getLinkId()) 42031 composeStringCore(null, e, true); 42032 closeArray(); 42033 if (anyHasExtras(element.getLinkId())) { 42034 openArray("_linkId"); 42035 for (StringType e : element.getLinkId()) 42036 composeStringExtras(null, e, true); 42037 closeArray(); 42038 } 42039 } 42040 ; 42041 if (element.hasAnswer()) { 42042 openArray("answer"); 42043 for (Contract.AnswerComponent e : element.getAnswer()) 42044 composeContractAnswerComponent(null, e); 42045 closeArray(); 42046 } 42047 ; 42048 if (element.hasSecurityLabelNumber()) { 42049 openArray("securityLabelNumber"); 42050 for (UnsignedIntType e : element.getSecurityLabelNumber()) 42051 composeUnsignedIntCore(null, e, true); 42052 closeArray(); 42053 if (anyHasExtras(element.getSecurityLabelNumber())) { 42054 openArray("_securityLabelNumber"); 42055 for (UnsignedIntType e : element.getSecurityLabelNumber()) 42056 composeUnsignedIntExtras(null, e, true); 42057 closeArray(); 42058 } 42059 } 42060 ; 42061 if (element.hasValuedItem()) { 42062 openArray("valuedItem"); 42063 for (Contract.ValuedItemComponent e : element.getValuedItem()) 42064 composeContractValuedItemComponent(null, e); 42065 closeArray(); 42066 } 42067 ; 42068 } 42069 42070 protected void composeContractAssetContextComponent(String name, Contract.AssetContextComponent element) 42071 throws IOException { 42072 if (element != null) { 42073 open(name); 42074 composeContractAssetContextComponentInner(element); 42075 close(); 42076 } 42077 } 42078 42079 protected void composeContractAssetContextComponentInner(Contract.AssetContextComponent element) throws IOException { 42080 composeBackbone(element); 42081 if (element.hasReference()) { 42082 composeReference("reference", element.getReference()); 42083 } 42084 if (element.hasCode()) { 42085 openArray("code"); 42086 for (CodeableConcept e : element.getCode()) 42087 composeCodeableConcept(null, e); 42088 closeArray(); 42089 } 42090 ; 42091 if (element.hasTextElement()) { 42092 composeStringCore("text", element.getTextElement(), false); 42093 composeStringExtras("text", element.getTextElement(), false); 42094 } 42095 } 42096 42097 protected void composeContractValuedItemComponent(String name, Contract.ValuedItemComponent element) 42098 throws IOException { 42099 if (element != null) { 42100 open(name); 42101 composeContractValuedItemComponentInner(element); 42102 close(); 42103 } 42104 } 42105 42106 protected void composeContractValuedItemComponentInner(Contract.ValuedItemComponent element) throws IOException { 42107 composeBackbone(element); 42108 if (element.hasEntity()) { 42109 composeType("entity", element.getEntity()); 42110 } 42111 if (element.hasIdentifier()) { 42112 composeIdentifier("identifier", element.getIdentifier()); 42113 } 42114 if (element.hasEffectiveTimeElement()) { 42115 composeDateTimeCore("effectiveTime", element.getEffectiveTimeElement(), false); 42116 composeDateTimeExtras("effectiveTime", element.getEffectiveTimeElement(), false); 42117 } 42118 if (element.hasQuantity()) { 42119 composeQuantity("quantity", element.getQuantity()); 42120 } 42121 if (element.hasUnitPrice()) { 42122 composeMoney("unitPrice", element.getUnitPrice()); 42123 } 42124 if (element.hasFactorElement()) { 42125 composeDecimalCore("factor", element.getFactorElement(), false); 42126 composeDecimalExtras("factor", element.getFactorElement(), false); 42127 } 42128 if (element.hasPointsElement()) { 42129 composeDecimalCore("points", element.getPointsElement(), false); 42130 composeDecimalExtras("points", element.getPointsElement(), false); 42131 } 42132 if (element.hasNet()) { 42133 composeMoney("net", element.getNet()); 42134 } 42135 if (element.hasPaymentElement()) { 42136 composeStringCore("payment", element.getPaymentElement(), false); 42137 composeStringExtras("payment", element.getPaymentElement(), false); 42138 } 42139 if (element.hasPaymentDateElement()) { 42140 composeDateTimeCore("paymentDate", element.getPaymentDateElement(), false); 42141 composeDateTimeExtras("paymentDate", element.getPaymentDateElement(), false); 42142 } 42143 if (element.hasResponsible()) { 42144 composeReference("responsible", element.getResponsible()); 42145 } 42146 if (element.hasRecipient()) { 42147 composeReference("recipient", element.getRecipient()); 42148 } 42149 if (element.hasLinkId()) { 42150 openArray("linkId"); 42151 for (StringType e : element.getLinkId()) 42152 composeStringCore(null, e, true); 42153 closeArray(); 42154 if (anyHasExtras(element.getLinkId())) { 42155 openArray("_linkId"); 42156 for (StringType e : element.getLinkId()) 42157 composeStringExtras(null, e, true); 42158 closeArray(); 42159 } 42160 } 42161 ; 42162 if (element.hasSecurityLabelNumber()) { 42163 openArray("securityLabelNumber"); 42164 for (UnsignedIntType e : element.getSecurityLabelNumber()) 42165 composeUnsignedIntCore(null, e, true); 42166 closeArray(); 42167 if (anyHasExtras(element.getSecurityLabelNumber())) { 42168 openArray("_securityLabelNumber"); 42169 for (UnsignedIntType e : element.getSecurityLabelNumber()) 42170 composeUnsignedIntExtras(null, e, true); 42171 closeArray(); 42172 } 42173 } 42174 ; 42175 } 42176 42177 protected void composeContractActionComponent(String name, Contract.ActionComponent element) throws IOException { 42178 if (element != null) { 42179 open(name); 42180 composeContractActionComponentInner(element); 42181 close(); 42182 } 42183 } 42184 42185 protected void composeContractActionComponentInner(Contract.ActionComponent element) throws IOException { 42186 composeBackbone(element); 42187 if (element.hasDoNotPerformElement()) { 42188 composeBooleanCore("doNotPerform", element.getDoNotPerformElement(), false); 42189 composeBooleanExtras("doNotPerform", element.getDoNotPerformElement(), false); 42190 } 42191 if (element.hasType()) { 42192 composeCodeableConcept("type", element.getType()); 42193 } 42194 if (element.hasSubject()) { 42195 openArray("subject"); 42196 for (Contract.ActionSubjectComponent e : element.getSubject()) 42197 composeContractActionSubjectComponent(null, e); 42198 closeArray(); 42199 } 42200 ; 42201 if (element.hasIntent()) { 42202 composeCodeableConcept("intent", element.getIntent()); 42203 } 42204 if (element.hasLinkId()) { 42205 openArray("linkId"); 42206 for (StringType e : element.getLinkId()) 42207 composeStringCore(null, e, true); 42208 closeArray(); 42209 if (anyHasExtras(element.getLinkId())) { 42210 openArray("_linkId"); 42211 for (StringType e : element.getLinkId()) 42212 composeStringExtras(null, e, true); 42213 closeArray(); 42214 } 42215 } 42216 ; 42217 if (element.hasStatus()) { 42218 composeCodeableConcept("status", element.getStatus()); 42219 } 42220 if (element.hasContext()) { 42221 composeReference("context", element.getContext()); 42222 } 42223 if (element.hasContextLinkId()) { 42224 openArray("contextLinkId"); 42225 for (StringType e : element.getContextLinkId()) 42226 composeStringCore(null, e, true); 42227 closeArray(); 42228 if (anyHasExtras(element.getContextLinkId())) { 42229 openArray("_contextLinkId"); 42230 for (StringType e : element.getContextLinkId()) 42231 composeStringExtras(null, e, true); 42232 closeArray(); 42233 } 42234 } 42235 ; 42236 if (element.hasOccurrence()) { 42237 composeType("occurrence", element.getOccurrence()); 42238 } 42239 if (element.hasRequester()) { 42240 openArray("requester"); 42241 for (Reference e : element.getRequester()) 42242 composeReference(null, e); 42243 closeArray(); 42244 } 42245 ; 42246 if (element.hasRequesterLinkId()) { 42247 openArray("requesterLinkId"); 42248 for (StringType e : element.getRequesterLinkId()) 42249 composeStringCore(null, e, true); 42250 closeArray(); 42251 if (anyHasExtras(element.getRequesterLinkId())) { 42252 openArray("_requesterLinkId"); 42253 for (StringType e : element.getRequesterLinkId()) 42254 composeStringExtras(null, e, true); 42255 closeArray(); 42256 } 42257 } 42258 ; 42259 if (element.hasPerformerType()) { 42260 openArray("performerType"); 42261 for (CodeableConcept e : element.getPerformerType()) 42262 composeCodeableConcept(null, e); 42263 closeArray(); 42264 } 42265 ; 42266 if (element.hasPerformerRole()) { 42267 composeCodeableConcept("performerRole", element.getPerformerRole()); 42268 } 42269 if (element.hasPerformer()) { 42270 composeReference("performer", element.getPerformer()); 42271 } 42272 if (element.hasPerformerLinkId()) { 42273 openArray("performerLinkId"); 42274 for (StringType e : element.getPerformerLinkId()) 42275 composeStringCore(null, e, true); 42276 closeArray(); 42277 if (anyHasExtras(element.getPerformerLinkId())) { 42278 openArray("_performerLinkId"); 42279 for (StringType e : element.getPerformerLinkId()) 42280 composeStringExtras(null, e, true); 42281 closeArray(); 42282 } 42283 } 42284 ; 42285 if (element.hasReasonCode()) { 42286 openArray("reasonCode"); 42287 for (CodeableConcept e : element.getReasonCode()) 42288 composeCodeableConcept(null, e); 42289 closeArray(); 42290 } 42291 ; 42292 if (element.hasReasonReference()) { 42293 openArray("reasonReference"); 42294 for (Reference e : element.getReasonReference()) 42295 composeReference(null, e); 42296 closeArray(); 42297 } 42298 ; 42299 if (element.hasReason()) { 42300 openArray("reason"); 42301 for (StringType e : element.getReason()) 42302 composeStringCore(null, e, true); 42303 closeArray(); 42304 if (anyHasExtras(element.getReason())) { 42305 openArray("_reason"); 42306 for (StringType e : element.getReason()) 42307 composeStringExtras(null, e, true); 42308 closeArray(); 42309 } 42310 } 42311 ; 42312 if (element.hasReasonLinkId()) { 42313 openArray("reasonLinkId"); 42314 for (StringType e : element.getReasonLinkId()) 42315 composeStringCore(null, e, true); 42316 closeArray(); 42317 if (anyHasExtras(element.getReasonLinkId())) { 42318 openArray("_reasonLinkId"); 42319 for (StringType e : element.getReasonLinkId()) 42320 composeStringExtras(null, e, true); 42321 closeArray(); 42322 } 42323 } 42324 ; 42325 if (element.hasNote()) { 42326 openArray("note"); 42327 for (Annotation e : element.getNote()) 42328 composeAnnotation(null, e); 42329 closeArray(); 42330 } 42331 ; 42332 if (element.hasSecurityLabelNumber()) { 42333 openArray("securityLabelNumber"); 42334 for (UnsignedIntType e : element.getSecurityLabelNumber()) 42335 composeUnsignedIntCore(null, e, true); 42336 closeArray(); 42337 if (anyHasExtras(element.getSecurityLabelNumber())) { 42338 openArray("_securityLabelNumber"); 42339 for (UnsignedIntType e : element.getSecurityLabelNumber()) 42340 composeUnsignedIntExtras(null, e, true); 42341 closeArray(); 42342 } 42343 } 42344 ; 42345 } 42346 42347 protected void composeContractActionSubjectComponent(String name, Contract.ActionSubjectComponent element) 42348 throws IOException { 42349 if (element != null) { 42350 open(name); 42351 composeContractActionSubjectComponentInner(element); 42352 close(); 42353 } 42354 } 42355 42356 protected void composeContractActionSubjectComponentInner(Contract.ActionSubjectComponent element) 42357 throws IOException { 42358 composeBackbone(element); 42359 if (element.hasReference()) { 42360 openArray("reference"); 42361 for (Reference e : element.getReference()) 42362 composeReference(null, e); 42363 closeArray(); 42364 } 42365 ; 42366 if (element.hasRole()) { 42367 composeCodeableConcept("role", element.getRole()); 42368 } 42369 } 42370 42371 protected void composeContractSignatoryComponent(String name, Contract.SignatoryComponent element) 42372 throws IOException { 42373 if (element != null) { 42374 open(name); 42375 composeContractSignatoryComponentInner(element); 42376 close(); 42377 } 42378 } 42379 42380 protected void composeContractSignatoryComponentInner(Contract.SignatoryComponent element) throws IOException { 42381 composeBackbone(element); 42382 if (element.hasType()) { 42383 composeCoding("type", element.getType()); 42384 } 42385 if (element.hasParty()) { 42386 composeReference("party", element.getParty()); 42387 } 42388 if (element.hasSignature()) { 42389 openArray("signature"); 42390 for (Signature e : element.getSignature()) 42391 composeSignature(null, e); 42392 closeArray(); 42393 } 42394 ; 42395 } 42396 42397 protected void composeContractFriendlyLanguageComponent(String name, Contract.FriendlyLanguageComponent element) 42398 throws IOException { 42399 if (element != null) { 42400 open(name); 42401 composeContractFriendlyLanguageComponentInner(element); 42402 close(); 42403 } 42404 } 42405 42406 protected void composeContractFriendlyLanguageComponentInner(Contract.FriendlyLanguageComponent element) 42407 throws IOException { 42408 composeBackbone(element); 42409 if (element.hasContent()) { 42410 composeType("content", element.getContent()); 42411 } 42412 } 42413 42414 protected void composeContractLegalLanguageComponent(String name, Contract.LegalLanguageComponent element) 42415 throws IOException { 42416 if (element != null) { 42417 open(name); 42418 composeContractLegalLanguageComponentInner(element); 42419 close(); 42420 } 42421 } 42422 42423 protected void composeContractLegalLanguageComponentInner(Contract.LegalLanguageComponent element) 42424 throws IOException { 42425 composeBackbone(element); 42426 if (element.hasContent()) { 42427 composeType("content", element.getContent()); 42428 } 42429 } 42430 42431 protected void composeContractComputableLanguageComponent(String name, Contract.ComputableLanguageComponent element) 42432 throws IOException { 42433 if (element != null) { 42434 open(name); 42435 composeContractComputableLanguageComponentInner(element); 42436 close(); 42437 } 42438 } 42439 42440 protected void composeContractComputableLanguageComponentInner(Contract.ComputableLanguageComponent element) 42441 throws IOException { 42442 composeBackbone(element); 42443 if (element.hasContent()) { 42444 composeType("content", element.getContent()); 42445 } 42446 } 42447 42448 protected void composeCoverage(String name, Coverage element) throws IOException { 42449 if (element != null) { 42450 prop("resourceType", name); 42451 composeCoverageInner(element); 42452 } 42453 } 42454 42455 protected void composeCoverageInner(Coverage element) throws IOException { 42456 composeDomainResourceElements(element); 42457 if (element.hasIdentifier()) { 42458 openArray("identifier"); 42459 for (Identifier e : element.getIdentifier()) 42460 composeIdentifier(null, e); 42461 closeArray(); 42462 } 42463 ; 42464 if (element.hasStatusElement()) { 42465 composeEnumerationCore("status", element.getStatusElement(), new Coverage.CoverageStatusEnumFactory(), false); 42466 composeEnumerationExtras("status", element.getStatusElement(), new Coverage.CoverageStatusEnumFactory(), false); 42467 } 42468 if (element.hasType()) { 42469 composeCodeableConcept("type", element.getType()); 42470 } 42471 if (element.hasPolicyHolder()) { 42472 composeReference("policyHolder", element.getPolicyHolder()); 42473 } 42474 if (element.hasSubscriber()) { 42475 composeReference("subscriber", element.getSubscriber()); 42476 } 42477 if (element.hasSubscriberIdElement()) { 42478 composeStringCore("subscriberId", element.getSubscriberIdElement(), false); 42479 composeStringExtras("subscriberId", element.getSubscriberIdElement(), false); 42480 } 42481 if (element.hasBeneficiary()) { 42482 composeReference("beneficiary", element.getBeneficiary()); 42483 } 42484 if (element.hasDependentElement()) { 42485 composeStringCore("dependent", element.getDependentElement(), false); 42486 composeStringExtras("dependent", element.getDependentElement(), false); 42487 } 42488 if (element.hasRelationship()) { 42489 composeCodeableConcept("relationship", element.getRelationship()); 42490 } 42491 if (element.hasPeriod()) { 42492 composePeriod("period", element.getPeriod()); 42493 } 42494 if (element.hasPayor()) { 42495 openArray("payor"); 42496 for (Reference e : element.getPayor()) 42497 composeReference(null, e); 42498 closeArray(); 42499 } 42500 ; 42501 if (element.hasClass_()) { 42502 openArray("class"); 42503 for (Coverage.ClassComponent e : element.getClass_()) 42504 composeCoverageClassComponent(null, e); 42505 closeArray(); 42506 } 42507 ; 42508 if (element.hasOrderElement()) { 42509 composePositiveIntCore("order", element.getOrderElement(), false); 42510 composePositiveIntExtras("order", element.getOrderElement(), false); 42511 } 42512 if (element.hasNetworkElement()) { 42513 composeStringCore("network", element.getNetworkElement(), false); 42514 composeStringExtras("network", element.getNetworkElement(), false); 42515 } 42516 if (element.hasCostToBeneficiary()) { 42517 openArray("costToBeneficiary"); 42518 for (Coverage.CostToBeneficiaryComponent e : element.getCostToBeneficiary()) 42519 composeCoverageCostToBeneficiaryComponent(null, e); 42520 closeArray(); 42521 } 42522 ; 42523 if (element.hasSubrogationElement()) { 42524 composeBooleanCore("subrogation", element.getSubrogationElement(), false); 42525 composeBooleanExtras("subrogation", element.getSubrogationElement(), false); 42526 } 42527 if (element.hasContract()) { 42528 openArray("contract"); 42529 for (Reference e : element.getContract()) 42530 composeReference(null, e); 42531 closeArray(); 42532 } 42533 ; 42534 } 42535 42536 protected void composeCoverageClassComponent(String name, Coverage.ClassComponent element) throws IOException { 42537 if (element != null) { 42538 open(name); 42539 composeCoverageClassComponentInner(element); 42540 close(); 42541 } 42542 } 42543 42544 protected void composeCoverageClassComponentInner(Coverage.ClassComponent element) throws IOException { 42545 composeBackbone(element); 42546 if (element.hasType()) { 42547 composeCodeableConcept("type", element.getType()); 42548 } 42549 if (element.hasValueElement()) { 42550 composeStringCore("value", element.getValueElement(), false); 42551 composeStringExtras("value", element.getValueElement(), false); 42552 } 42553 if (element.hasNameElement()) { 42554 composeStringCore("name", element.getNameElement(), false); 42555 composeStringExtras("name", element.getNameElement(), false); 42556 } 42557 } 42558 42559 protected void composeCoverageCostToBeneficiaryComponent(String name, Coverage.CostToBeneficiaryComponent element) 42560 throws IOException { 42561 if (element != null) { 42562 open(name); 42563 composeCoverageCostToBeneficiaryComponentInner(element); 42564 close(); 42565 } 42566 } 42567 42568 protected void composeCoverageCostToBeneficiaryComponentInner(Coverage.CostToBeneficiaryComponent element) 42569 throws IOException { 42570 composeBackbone(element); 42571 if (element.hasType()) { 42572 composeCodeableConcept("type", element.getType()); 42573 } 42574 if (element.hasValue()) { 42575 composeType("value", element.getValue()); 42576 } 42577 if (element.hasException()) { 42578 openArray("exception"); 42579 for (Coverage.ExemptionComponent e : element.getException()) 42580 composeCoverageExemptionComponent(null, e); 42581 closeArray(); 42582 } 42583 ; 42584 } 42585 42586 protected void composeCoverageExemptionComponent(String name, Coverage.ExemptionComponent element) 42587 throws IOException { 42588 if (element != null) { 42589 open(name); 42590 composeCoverageExemptionComponentInner(element); 42591 close(); 42592 } 42593 } 42594 42595 protected void composeCoverageExemptionComponentInner(Coverage.ExemptionComponent element) throws IOException { 42596 composeBackbone(element); 42597 if (element.hasType()) { 42598 composeCodeableConcept("type", element.getType()); 42599 } 42600 if (element.hasPeriod()) { 42601 composePeriod("period", element.getPeriod()); 42602 } 42603 } 42604 42605 protected void composeCoverageEligibilityRequest(String name, CoverageEligibilityRequest element) throws IOException { 42606 if (element != null) { 42607 prop("resourceType", name); 42608 composeCoverageEligibilityRequestInner(element); 42609 } 42610 } 42611 42612 protected void composeCoverageEligibilityRequestInner(CoverageEligibilityRequest element) throws IOException { 42613 composeDomainResourceElements(element); 42614 if (element.hasIdentifier()) { 42615 openArray("identifier"); 42616 for (Identifier e : element.getIdentifier()) 42617 composeIdentifier(null, e); 42618 closeArray(); 42619 } 42620 ; 42621 if (element.hasStatusElement()) { 42622 composeEnumerationCore("status", element.getStatusElement(), 42623 new CoverageEligibilityRequest.EligibilityRequestStatusEnumFactory(), false); 42624 composeEnumerationExtras("status", element.getStatusElement(), 42625 new CoverageEligibilityRequest.EligibilityRequestStatusEnumFactory(), false); 42626 } 42627 if (element.hasPriority()) { 42628 composeCodeableConcept("priority", element.getPriority()); 42629 } 42630 if (element.hasPurpose()) { 42631 openArray("purpose"); 42632 for (Enumeration<CoverageEligibilityRequest.EligibilityRequestPurpose> e : element.getPurpose()) 42633 composeEnumerationCore(null, e, new CoverageEligibilityRequest.EligibilityRequestPurposeEnumFactory(), true); 42634 closeArray(); 42635 if (anyHasExtras(element.getPurpose())) { 42636 openArray("_purpose"); 42637 for (Enumeration<CoverageEligibilityRequest.EligibilityRequestPurpose> e : element.getPurpose()) 42638 composeEnumerationExtras(null, e, new CoverageEligibilityRequest.EligibilityRequestPurposeEnumFactory(), 42639 true); 42640 closeArray(); 42641 } 42642 } 42643 ; 42644 if (element.hasPatient()) { 42645 composeReference("patient", element.getPatient()); 42646 } 42647 if (element.hasServiced()) { 42648 composeType("serviced", element.getServiced()); 42649 } 42650 if (element.hasCreatedElement()) { 42651 composeDateTimeCore("created", element.getCreatedElement(), false); 42652 composeDateTimeExtras("created", element.getCreatedElement(), false); 42653 } 42654 if (element.hasEnterer()) { 42655 composeReference("enterer", element.getEnterer()); 42656 } 42657 if (element.hasProvider()) { 42658 composeReference("provider", element.getProvider()); 42659 } 42660 if (element.hasInsurer()) { 42661 composeReference("insurer", element.getInsurer()); 42662 } 42663 if (element.hasFacility()) { 42664 composeReference("facility", element.getFacility()); 42665 } 42666 if (element.hasSupportingInfo()) { 42667 openArray("supportingInfo"); 42668 for (CoverageEligibilityRequest.SupportingInformationComponent e : element.getSupportingInfo()) 42669 composeCoverageEligibilityRequestSupportingInformationComponent(null, e); 42670 closeArray(); 42671 } 42672 ; 42673 if (element.hasInsurance()) { 42674 openArray("insurance"); 42675 for (CoverageEligibilityRequest.InsuranceComponent e : element.getInsurance()) 42676 composeCoverageEligibilityRequestInsuranceComponent(null, e); 42677 closeArray(); 42678 } 42679 ; 42680 if (element.hasItem()) { 42681 openArray("item"); 42682 for (CoverageEligibilityRequest.DetailsComponent e : element.getItem()) 42683 composeCoverageEligibilityRequestDetailsComponent(null, e); 42684 closeArray(); 42685 } 42686 ; 42687 } 42688 42689 protected void composeCoverageEligibilityRequestSupportingInformationComponent(String name, 42690 CoverageEligibilityRequest.SupportingInformationComponent element) throws IOException { 42691 if (element != null) { 42692 open(name); 42693 composeCoverageEligibilityRequestSupportingInformationComponentInner(element); 42694 close(); 42695 } 42696 } 42697 42698 protected void composeCoverageEligibilityRequestSupportingInformationComponentInner( 42699 CoverageEligibilityRequest.SupportingInformationComponent element) throws IOException { 42700 composeBackbone(element); 42701 if (element.hasSequenceElement()) { 42702 composePositiveIntCore("sequence", element.getSequenceElement(), false); 42703 composePositiveIntExtras("sequence", element.getSequenceElement(), false); 42704 } 42705 if (element.hasInformation()) { 42706 composeReference("information", element.getInformation()); 42707 } 42708 if (element.hasAppliesToAllElement()) { 42709 composeBooleanCore("appliesToAll", element.getAppliesToAllElement(), false); 42710 composeBooleanExtras("appliesToAll", element.getAppliesToAllElement(), false); 42711 } 42712 } 42713 42714 protected void composeCoverageEligibilityRequestInsuranceComponent(String name, 42715 CoverageEligibilityRequest.InsuranceComponent element) throws IOException { 42716 if (element != null) { 42717 open(name); 42718 composeCoverageEligibilityRequestInsuranceComponentInner(element); 42719 close(); 42720 } 42721 } 42722 42723 protected void composeCoverageEligibilityRequestInsuranceComponentInner( 42724 CoverageEligibilityRequest.InsuranceComponent element) throws IOException { 42725 composeBackbone(element); 42726 if (element.hasFocalElement()) { 42727 composeBooleanCore("focal", element.getFocalElement(), false); 42728 composeBooleanExtras("focal", element.getFocalElement(), false); 42729 } 42730 if (element.hasCoverage()) { 42731 composeReference("coverage", element.getCoverage()); 42732 } 42733 if (element.hasBusinessArrangementElement()) { 42734 composeStringCore("businessArrangement", element.getBusinessArrangementElement(), false); 42735 composeStringExtras("businessArrangement", element.getBusinessArrangementElement(), false); 42736 } 42737 } 42738 42739 protected void composeCoverageEligibilityRequestDetailsComponent(String name, 42740 CoverageEligibilityRequest.DetailsComponent element) throws IOException { 42741 if (element != null) { 42742 open(name); 42743 composeCoverageEligibilityRequestDetailsComponentInner(element); 42744 close(); 42745 } 42746 } 42747 42748 protected void composeCoverageEligibilityRequestDetailsComponentInner( 42749 CoverageEligibilityRequest.DetailsComponent element) throws IOException { 42750 composeBackbone(element); 42751 if (element.hasSupportingInfoSequence()) { 42752 openArray("supportingInfoSequence"); 42753 for (PositiveIntType e : element.getSupportingInfoSequence()) 42754 composePositiveIntCore(null, e, true); 42755 closeArray(); 42756 if (anyHasExtras(element.getSupportingInfoSequence())) { 42757 openArray("_supportingInfoSequence"); 42758 for (PositiveIntType e : element.getSupportingInfoSequence()) 42759 composePositiveIntExtras(null, e, true); 42760 closeArray(); 42761 } 42762 } 42763 ; 42764 if (element.hasCategory()) { 42765 composeCodeableConcept("category", element.getCategory()); 42766 } 42767 if (element.hasProductOrService()) { 42768 composeCodeableConcept("productOrService", element.getProductOrService()); 42769 } 42770 if (element.hasModifier()) { 42771 openArray("modifier"); 42772 for (CodeableConcept e : element.getModifier()) 42773 composeCodeableConcept(null, e); 42774 closeArray(); 42775 } 42776 ; 42777 if (element.hasProvider()) { 42778 composeReference("provider", element.getProvider()); 42779 } 42780 if (element.hasQuantity()) { 42781 composeQuantity("quantity", element.getQuantity()); 42782 } 42783 if (element.hasUnitPrice()) { 42784 composeMoney("unitPrice", element.getUnitPrice()); 42785 } 42786 if (element.hasFacility()) { 42787 composeReference("facility", element.getFacility()); 42788 } 42789 if (element.hasDiagnosis()) { 42790 openArray("diagnosis"); 42791 for (CoverageEligibilityRequest.DiagnosisComponent e : element.getDiagnosis()) 42792 composeCoverageEligibilityRequestDiagnosisComponent(null, e); 42793 closeArray(); 42794 } 42795 ; 42796 if (element.hasDetail()) { 42797 openArray("detail"); 42798 for (Reference e : element.getDetail()) 42799 composeReference(null, e); 42800 closeArray(); 42801 } 42802 ; 42803 } 42804 42805 protected void composeCoverageEligibilityRequestDiagnosisComponent(String name, 42806 CoverageEligibilityRequest.DiagnosisComponent element) throws IOException { 42807 if (element != null) { 42808 open(name); 42809 composeCoverageEligibilityRequestDiagnosisComponentInner(element); 42810 close(); 42811 } 42812 } 42813 42814 protected void composeCoverageEligibilityRequestDiagnosisComponentInner( 42815 CoverageEligibilityRequest.DiagnosisComponent element) throws IOException { 42816 composeBackbone(element); 42817 if (element.hasDiagnosis()) { 42818 composeType("diagnosis", element.getDiagnosis()); 42819 } 42820 } 42821 42822 protected void composeCoverageEligibilityResponse(String name, CoverageEligibilityResponse element) 42823 throws IOException { 42824 if (element != null) { 42825 prop("resourceType", name); 42826 composeCoverageEligibilityResponseInner(element); 42827 } 42828 } 42829 42830 protected void composeCoverageEligibilityResponseInner(CoverageEligibilityResponse element) throws IOException { 42831 composeDomainResourceElements(element); 42832 if (element.hasIdentifier()) { 42833 openArray("identifier"); 42834 for (Identifier e : element.getIdentifier()) 42835 composeIdentifier(null, e); 42836 closeArray(); 42837 } 42838 ; 42839 if (element.hasStatusElement()) { 42840 composeEnumerationCore("status", element.getStatusElement(), 42841 new CoverageEligibilityResponse.EligibilityResponseStatusEnumFactory(), false); 42842 composeEnumerationExtras("status", element.getStatusElement(), 42843 new CoverageEligibilityResponse.EligibilityResponseStatusEnumFactory(), false); 42844 } 42845 if (element.hasPurpose()) { 42846 openArray("purpose"); 42847 for (Enumeration<CoverageEligibilityResponse.EligibilityResponsePurpose> e : element.getPurpose()) 42848 composeEnumerationCore(null, e, new CoverageEligibilityResponse.EligibilityResponsePurposeEnumFactory(), true); 42849 closeArray(); 42850 if (anyHasExtras(element.getPurpose())) { 42851 openArray("_purpose"); 42852 for (Enumeration<CoverageEligibilityResponse.EligibilityResponsePurpose> e : element.getPurpose()) 42853 composeEnumerationExtras(null, e, new CoverageEligibilityResponse.EligibilityResponsePurposeEnumFactory(), 42854 true); 42855 closeArray(); 42856 } 42857 } 42858 ; 42859 if (element.hasPatient()) { 42860 composeReference("patient", element.getPatient()); 42861 } 42862 if (element.hasServiced()) { 42863 composeType("serviced", element.getServiced()); 42864 } 42865 if (element.hasCreatedElement()) { 42866 composeDateTimeCore("created", element.getCreatedElement(), false); 42867 composeDateTimeExtras("created", element.getCreatedElement(), false); 42868 } 42869 if (element.hasRequestor()) { 42870 composeReference("requestor", element.getRequestor()); 42871 } 42872 if (element.hasRequest()) { 42873 composeReference("request", element.getRequest()); 42874 } 42875 if (element.hasOutcomeElement()) { 42876 composeEnumerationCore("outcome", element.getOutcomeElement(), new Enumerations.RemittanceOutcomeEnumFactory(), 42877 false); 42878 composeEnumerationExtras("outcome", element.getOutcomeElement(), new Enumerations.RemittanceOutcomeEnumFactory(), 42879 false); 42880 } 42881 if (element.hasDispositionElement()) { 42882 composeStringCore("disposition", element.getDispositionElement(), false); 42883 composeStringExtras("disposition", element.getDispositionElement(), false); 42884 } 42885 if (element.hasInsurer()) { 42886 composeReference("insurer", element.getInsurer()); 42887 } 42888 if (element.hasInsurance()) { 42889 openArray("insurance"); 42890 for (CoverageEligibilityResponse.InsuranceComponent e : element.getInsurance()) 42891 composeCoverageEligibilityResponseInsuranceComponent(null, e); 42892 closeArray(); 42893 } 42894 ; 42895 if (element.hasPreAuthRefElement()) { 42896 composeStringCore("preAuthRef", element.getPreAuthRefElement(), false); 42897 composeStringExtras("preAuthRef", element.getPreAuthRefElement(), false); 42898 } 42899 if (element.hasForm()) { 42900 composeCodeableConcept("form", element.getForm()); 42901 } 42902 if (element.hasError()) { 42903 openArray("error"); 42904 for (CoverageEligibilityResponse.ErrorsComponent e : element.getError()) 42905 composeCoverageEligibilityResponseErrorsComponent(null, e); 42906 closeArray(); 42907 } 42908 ; 42909 } 42910 42911 protected void composeCoverageEligibilityResponseInsuranceComponent(String name, 42912 CoverageEligibilityResponse.InsuranceComponent element) throws IOException { 42913 if (element != null) { 42914 open(name); 42915 composeCoverageEligibilityResponseInsuranceComponentInner(element); 42916 close(); 42917 } 42918 } 42919 42920 protected void composeCoverageEligibilityResponseInsuranceComponentInner( 42921 CoverageEligibilityResponse.InsuranceComponent element) throws IOException { 42922 composeBackbone(element); 42923 if (element.hasCoverage()) { 42924 composeReference("coverage", element.getCoverage()); 42925 } 42926 if (element.hasInforceElement()) { 42927 composeBooleanCore("inforce", element.getInforceElement(), false); 42928 composeBooleanExtras("inforce", element.getInforceElement(), false); 42929 } 42930 if (element.hasBenefitPeriod()) { 42931 composePeriod("benefitPeriod", element.getBenefitPeriod()); 42932 } 42933 if (element.hasItem()) { 42934 openArray("item"); 42935 for (CoverageEligibilityResponse.ItemsComponent e : element.getItem()) 42936 composeCoverageEligibilityResponseItemsComponent(null, e); 42937 closeArray(); 42938 } 42939 ; 42940 } 42941 42942 protected void composeCoverageEligibilityResponseItemsComponent(String name, 42943 CoverageEligibilityResponse.ItemsComponent element) throws IOException { 42944 if (element != null) { 42945 open(name); 42946 composeCoverageEligibilityResponseItemsComponentInner(element); 42947 close(); 42948 } 42949 } 42950 42951 protected void composeCoverageEligibilityResponseItemsComponentInner( 42952 CoverageEligibilityResponse.ItemsComponent element) throws IOException { 42953 composeBackbone(element); 42954 if (element.hasCategory()) { 42955 composeCodeableConcept("category", element.getCategory()); 42956 } 42957 if (element.hasProductOrService()) { 42958 composeCodeableConcept("productOrService", element.getProductOrService()); 42959 } 42960 if (element.hasModifier()) { 42961 openArray("modifier"); 42962 for (CodeableConcept e : element.getModifier()) 42963 composeCodeableConcept(null, e); 42964 closeArray(); 42965 } 42966 ; 42967 if (element.hasProvider()) { 42968 composeReference("provider", element.getProvider()); 42969 } 42970 if (element.hasExcludedElement()) { 42971 composeBooleanCore("excluded", element.getExcludedElement(), false); 42972 composeBooleanExtras("excluded", element.getExcludedElement(), false); 42973 } 42974 if (element.hasNameElement()) { 42975 composeStringCore("name", element.getNameElement(), false); 42976 composeStringExtras("name", element.getNameElement(), false); 42977 } 42978 if (element.hasDescriptionElement()) { 42979 composeStringCore("description", element.getDescriptionElement(), false); 42980 composeStringExtras("description", element.getDescriptionElement(), false); 42981 } 42982 if (element.hasNetwork()) { 42983 composeCodeableConcept("network", element.getNetwork()); 42984 } 42985 if (element.hasUnit()) { 42986 composeCodeableConcept("unit", element.getUnit()); 42987 } 42988 if (element.hasTerm()) { 42989 composeCodeableConcept("term", element.getTerm()); 42990 } 42991 if (element.hasBenefit()) { 42992 openArray("benefit"); 42993 for (CoverageEligibilityResponse.BenefitComponent e : element.getBenefit()) 42994 composeCoverageEligibilityResponseBenefitComponent(null, e); 42995 closeArray(); 42996 } 42997 ; 42998 if (element.hasAuthorizationRequiredElement()) { 42999 composeBooleanCore("authorizationRequired", element.getAuthorizationRequiredElement(), false); 43000 composeBooleanExtras("authorizationRequired", element.getAuthorizationRequiredElement(), false); 43001 } 43002 if (element.hasAuthorizationSupporting()) { 43003 openArray("authorizationSupporting"); 43004 for (CodeableConcept e : element.getAuthorizationSupporting()) 43005 composeCodeableConcept(null, e); 43006 closeArray(); 43007 } 43008 ; 43009 if (element.hasAuthorizationUrlElement()) { 43010 composeUriCore("authorizationUrl", element.getAuthorizationUrlElement(), false); 43011 composeUriExtras("authorizationUrl", element.getAuthorizationUrlElement(), false); 43012 } 43013 } 43014 43015 protected void composeCoverageEligibilityResponseBenefitComponent(String name, 43016 CoverageEligibilityResponse.BenefitComponent element) throws IOException { 43017 if (element != null) { 43018 open(name); 43019 composeCoverageEligibilityResponseBenefitComponentInner(element); 43020 close(); 43021 } 43022 } 43023 43024 protected void composeCoverageEligibilityResponseBenefitComponentInner( 43025 CoverageEligibilityResponse.BenefitComponent element) throws IOException { 43026 composeBackbone(element); 43027 if (element.hasType()) { 43028 composeCodeableConcept("type", element.getType()); 43029 } 43030 if (element.hasAllowed()) { 43031 composeType("allowed", element.getAllowed()); 43032 } 43033 if (element.hasUsed()) { 43034 composeType("used", element.getUsed()); 43035 } 43036 } 43037 43038 protected void composeCoverageEligibilityResponseErrorsComponent(String name, 43039 CoverageEligibilityResponse.ErrorsComponent element) throws IOException { 43040 if (element != null) { 43041 open(name); 43042 composeCoverageEligibilityResponseErrorsComponentInner(element); 43043 close(); 43044 } 43045 } 43046 43047 protected void composeCoverageEligibilityResponseErrorsComponentInner( 43048 CoverageEligibilityResponse.ErrorsComponent element) throws IOException { 43049 composeBackbone(element); 43050 if (element.hasCode()) { 43051 composeCodeableConcept("code", element.getCode()); 43052 } 43053 } 43054 43055 protected void composeDetectedIssue(String name, DetectedIssue element) throws IOException { 43056 if (element != null) { 43057 prop("resourceType", name); 43058 composeDetectedIssueInner(element); 43059 } 43060 } 43061 43062 protected void composeDetectedIssueInner(DetectedIssue element) throws IOException { 43063 composeDomainResourceElements(element); 43064 if (element.hasIdentifier()) { 43065 openArray("identifier"); 43066 for (Identifier e : element.getIdentifier()) 43067 composeIdentifier(null, e); 43068 closeArray(); 43069 } 43070 ; 43071 if (element.hasStatusElement()) { 43072 composeEnumerationCore("status", element.getStatusElement(), new DetectedIssue.DetectedIssueStatusEnumFactory(), 43073 false); 43074 composeEnumerationExtras("status", element.getStatusElement(), new DetectedIssue.DetectedIssueStatusEnumFactory(), 43075 false); 43076 } 43077 if (element.hasCode()) { 43078 composeCodeableConcept("code", element.getCode()); 43079 } 43080 if (element.hasSeverityElement()) { 43081 composeEnumerationCore("severity", element.getSeverityElement(), 43082 new DetectedIssue.DetectedIssueSeverityEnumFactory(), false); 43083 composeEnumerationExtras("severity", element.getSeverityElement(), 43084 new DetectedIssue.DetectedIssueSeverityEnumFactory(), false); 43085 } 43086 if (element.hasPatient()) { 43087 composeReference("patient", element.getPatient()); 43088 } 43089 if (element.hasIdentified()) { 43090 composeType("identified", element.getIdentified()); 43091 } 43092 if (element.hasAuthor()) { 43093 composeReference("author", element.getAuthor()); 43094 } 43095 if (element.hasImplicated()) { 43096 openArray("implicated"); 43097 for (Reference e : element.getImplicated()) 43098 composeReference(null, e); 43099 closeArray(); 43100 } 43101 ; 43102 if (element.hasEvidence()) { 43103 openArray("evidence"); 43104 for (DetectedIssue.DetectedIssueEvidenceComponent e : element.getEvidence()) 43105 composeDetectedIssueDetectedIssueEvidenceComponent(null, e); 43106 closeArray(); 43107 } 43108 ; 43109 if (element.hasDetailElement()) { 43110 composeStringCore("detail", element.getDetailElement(), false); 43111 composeStringExtras("detail", element.getDetailElement(), false); 43112 } 43113 if (element.hasReferenceElement()) { 43114 composeUriCore("reference", element.getReferenceElement(), false); 43115 composeUriExtras("reference", element.getReferenceElement(), false); 43116 } 43117 if (element.hasMitigation()) { 43118 openArray("mitigation"); 43119 for (DetectedIssue.DetectedIssueMitigationComponent e : element.getMitigation()) 43120 composeDetectedIssueDetectedIssueMitigationComponent(null, e); 43121 closeArray(); 43122 } 43123 ; 43124 } 43125 43126 protected void composeDetectedIssueDetectedIssueEvidenceComponent(String name, 43127 DetectedIssue.DetectedIssueEvidenceComponent element) throws IOException { 43128 if (element != null) { 43129 open(name); 43130 composeDetectedIssueDetectedIssueEvidenceComponentInner(element); 43131 close(); 43132 } 43133 } 43134 43135 protected void composeDetectedIssueDetectedIssueEvidenceComponentInner( 43136 DetectedIssue.DetectedIssueEvidenceComponent element) throws IOException { 43137 composeBackbone(element); 43138 if (element.hasCode()) { 43139 openArray("code"); 43140 for (CodeableConcept e : element.getCode()) 43141 composeCodeableConcept(null, e); 43142 closeArray(); 43143 } 43144 ; 43145 if (element.hasDetail()) { 43146 openArray("detail"); 43147 for (Reference e : element.getDetail()) 43148 composeReference(null, e); 43149 closeArray(); 43150 } 43151 ; 43152 } 43153 43154 protected void composeDetectedIssueDetectedIssueMitigationComponent(String name, 43155 DetectedIssue.DetectedIssueMitigationComponent element) throws IOException { 43156 if (element != null) { 43157 open(name); 43158 composeDetectedIssueDetectedIssueMitigationComponentInner(element); 43159 close(); 43160 } 43161 } 43162 43163 protected void composeDetectedIssueDetectedIssueMitigationComponentInner( 43164 DetectedIssue.DetectedIssueMitigationComponent element) throws IOException { 43165 composeBackbone(element); 43166 if (element.hasAction()) { 43167 composeCodeableConcept("action", element.getAction()); 43168 } 43169 if (element.hasDateElement()) { 43170 composeDateTimeCore("date", element.getDateElement(), false); 43171 composeDateTimeExtras("date", element.getDateElement(), false); 43172 } 43173 if (element.hasAuthor()) { 43174 composeReference("author", element.getAuthor()); 43175 } 43176 } 43177 43178 protected void composeDevice(String name, Device element) throws IOException { 43179 if (element != null) { 43180 prop("resourceType", name); 43181 composeDeviceInner(element); 43182 } 43183 } 43184 43185 protected void composeDeviceInner(Device element) throws IOException { 43186 composeDomainResourceElements(element); 43187 if (element.hasIdentifier()) { 43188 openArray("identifier"); 43189 for (Identifier e : element.getIdentifier()) 43190 composeIdentifier(null, e); 43191 closeArray(); 43192 } 43193 ; 43194 if (element.hasDefinition()) { 43195 composeReference("definition", element.getDefinition()); 43196 } 43197 if (element.hasUdiCarrier()) { 43198 openArray("udiCarrier"); 43199 for (Device.DeviceUdiCarrierComponent e : element.getUdiCarrier()) 43200 composeDeviceDeviceUdiCarrierComponent(null, e); 43201 closeArray(); 43202 } 43203 ; 43204 if (element.hasStatusElement()) { 43205 composeEnumerationCore("status", element.getStatusElement(), new Device.FHIRDeviceStatusEnumFactory(), false); 43206 composeEnumerationExtras("status", element.getStatusElement(), new Device.FHIRDeviceStatusEnumFactory(), false); 43207 } 43208 if (element.hasStatusReason()) { 43209 openArray("statusReason"); 43210 for (CodeableConcept e : element.getStatusReason()) 43211 composeCodeableConcept(null, e); 43212 closeArray(); 43213 } 43214 ; 43215 if (element.hasDistinctIdentifierElement()) { 43216 composeStringCore("distinctIdentifier", element.getDistinctIdentifierElement(), false); 43217 composeStringExtras("distinctIdentifier", element.getDistinctIdentifierElement(), false); 43218 } 43219 if (element.hasManufacturerElement()) { 43220 composeStringCore("manufacturer", element.getManufacturerElement(), false); 43221 composeStringExtras("manufacturer", element.getManufacturerElement(), false); 43222 } 43223 if (element.hasManufactureDateElement()) { 43224 composeDateTimeCore("manufactureDate", element.getManufactureDateElement(), false); 43225 composeDateTimeExtras("manufactureDate", element.getManufactureDateElement(), false); 43226 } 43227 if (element.hasExpirationDateElement()) { 43228 composeDateTimeCore("expirationDate", element.getExpirationDateElement(), false); 43229 composeDateTimeExtras("expirationDate", element.getExpirationDateElement(), false); 43230 } 43231 if (element.hasLotNumberElement()) { 43232 composeStringCore("lotNumber", element.getLotNumberElement(), false); 43233 composeStringExtras("lotNumber", element.getLotNumberElement(), false); 43234 } 43235 if (element.hasSerialNumberElement()) { 43236 composeStringCore("serialNumber", element.getSerialNumberElement(), false); 43237 composeStringExtras("serialNumber", element.getSerialNumberElement(), false); 43238 } 43239 if (element.hasDeviceName()) { 43240 openArray("deviceName"); 43241 for (Device.DeviceDeviceNameComponent e : element.getDeviceName()) 43242 composeDeviceDeviceDeviceNameComponent(null, e); 43243 closeArray(); 43244 } 43245 ; 43246 if (element.hasModelNumberElement()) { 43247 composeStringCore("modelNumber", element.getModelNumberElement(), false); 43248 composeStringExtras("modelNumber", element.getModelNumberElement(), false); 43249 } 43250 if (element.hasPartNumberElement()) { 43251 composeStringCore("partNumber", element.getPartNumberElement(), false); 43252 composeStringExtras("partNumber", element.getPartNumberElement(), false); 43253 } 43254 if (element.hasType()) { 43255 composeCodeableConcept("type", element.getType()); 43256 } 43257 if (element.hasSpecialization()) { 43258 openArray("specialization"); 43259 for (Device.DeviceSpecializationComponent e : element.getSpecialization()) 43260 composeDeviceDeviceSpecializationComponent(null, e); 43261 closeArray(); 43262 } 43263 ; 43264 if (element.hasVersion()) { 43265 openArray("version"); 43266 for (Device.DeviceVersionComponent e : element.getVersion()) 43267 composeDeviceDeviceVersionComponent(null, e); 43268 closeArray(); 43269 } 43270 ; 43271 if (element.hasProperty()) { 43272 openArray("property"); 43273 for (Device.DevicePropertyComponent e : element.getProperty()) 43274 composeDeviceDevicePropertyComponent(null, e); 43275 closeArray(); 43276 } 43277 ; 43278 if (element.hasPatient()) { 43279 composeReference("patient", element.getPatient()); 43280 } 43281 if (element.hasOwner()) { 43282 composeReference("owner", element.getOwner()); 43283 } 43284 if (element.hasContact()) { 43285 openArray("contact"); 43286 for (ContactPoint e : element.getContact()) 43287 composeContactPoint(null, e); 43288 closeArray(); 43289 } 43290 ; 43291 if (element.hasLocation()) { 43292 composeReference("location", element.getLocation()); 43293 } 43294 if (element.hasUrlElement()) { 43295 composeUriCore("url", element.getUrlElement(), false); 43296 composeUriExtras("url", element.getUrlElement(), false); 43297 } 43298 if (element.hasNote()) { 43299 openArray("note"); 43300 for (Annotation e : element.getNote()) 43301 composeAnnotation(null, e); 43302 closeArray(); 43303 } 43304 ; 43305 if (element.hasSafety()) { 43306 openArray("safety"); 43307 for (CodeableConcept e : element.getSafety()) 43308 composeCodeableConcept(null, e); 43309 closeArray(); 43310 } 43311 ; 43312 if (element.hasParent()) { 43313 composeReference("parent", element.getParent()); 43314 } 43315 } 43316 43317 protected void composeDeviceDeviceUdiCarrierComponent(String name, Device.DeviceUdiCarrierComponent element) 43318 throws IOException { 43319 if (element != null) { 43320 open(name); 43321 composeDeviceDeviceUdiCarrierComponentInner(element); 43322 close(); 43323 } 43324 } 43325 43326 protected void composeDeviceDeviceUdiCarrierComponentInner(Device.DeviceUdiCarrierComponent element) 43327 throws IOException { 43328 composeBackbone(element); 43329 if (element.hasDeviceIdentifierElement()) { 43330 composeStringCore("deviceIdentifier", element.getDeviceIdentifierElement(), false); 43331 composeStringExtras("deviceIdentifier", element.getDeviceIdentifierElement(), false); 43332 } 43333 if (element.hasIssuerElement()) { 43334 composeUriCore("issuer", element.getIssuerElement(), false); 43335 composeUriExtras("issuer", element.getIssuerElement(), false); 43336 } 43337 if (element.hasJurisdictionElement()) { 43338 composeUriCore("jurisdiction", element.getJurisdictionElement(), false); 43339 composeUriExtras("jurisdiction", element.getJurisdictionElement(), false); 43340 } 43341 if (element.hasCarrierAIDCElement()) { 43342 composeBase64BinaryCore("carrierAIDC", element.getCarrierAIDCElement(), false); 43343 composeBase64BinaryExtras("carrierAIDC", element.getCarrierAIDCElement(), false); 43344 } 43345 if (element.hasCarrierHRFElement()) { 43346 composeStringCore("carrierHRF", element.getCarrierHRFElement(), false); 43347 composeStringExtras("carrierHRF", element.getCarrierHRFElement(), false); 43348 } 43349 if (element.hasEntryTypeElement()) { 43350 composeEnumerationCore("entryType", element.getEntryTypeElement(), new Device.UDIEntryTypeEnumFactory(), false); 43351 composeEnumerationExtras("entryType", element.getEntryTypeElement(), new Device.UDIEntryTypeEnumFactory(), false); 43352 } 43353 } 43354 43355 protected void composeDeviceDeviceDeviceNameComponent(String name, Device.DeviceDeviceNameComponent element) 43356 throws IOException { 43357 if (element != null) { 43358 open(name); 43359 composeDeviceDeviceDeviceNameComponentInner(element); 43360 close(); 43361 } 43362 } 43363 43364 protected void composeDeviceDeviceDeviceNameComponentInner(Device.DeviceDeviceNameComponent element) 43365 throws IOException { 43366 composeBackbone(element); 43367 if (element.hasNameElement()) { 43368 composeStringCore("name", element.getNameElement(), false); 43369 composeStringExtras("name", element.getNameElement(), false); 43370 } 43371 if (element.hasTypeElement()) { 43372 composeEnumerationCore("type", element.getTypeElement(), new Device.DeviceNameTypeEnumFactory(), false); 43373 composeEnumerationExtras("type", element.getTypeElement(), new Device.DeviceNameTypeEnumFactory(), false); 43374 } 43375 } 43376 43377 protected void composeDeviceDeviceSpecializationComponent(String name, Device.DeviceSpecializationComponent element) 43378 throws IOException { 43379 if (element != null) { 43380 open(name); 43381 composeDeviceDeviceSpecializationComponentInner(element); 43382 close(); 43383 } 43384 } 43385 43386 protected void composeDeviceDeviceSpecializationComponentInner(Device.DeviceSpecializationComponent element) 43387 throws IOException { 43388 composeBackbone(element); 43389 if (element.hasSystemType()) { 43390 composeCodeableConcept("systemType", element.getSystemType()); 43391 } 43392 if (element.hasVersionElement()) { 43393 composeStringCore("version", element.getVersionElement(), false); 43394 composeStringExtras("version", element.getVersionElement(), false); 43395 } 43396 } 43397 43398 protected void composeDeviceDeviceVersionComponent(String name, Device.DeviceVersionComponent element) 43399 throws IOException { 43400 if (element != null) { 43401 open(name); 43402 composeDeviceDeviceVersionComponentInner(element); 43403 close(); 43404 } 43405 } 43406 43407 protected void composeDeviceDeviceVersionComponentInner(Device.DeviceVersionComponent element) throws IOException { 43408 composeBackbone(element); 43409 if (element.hasType()) { 43410 composeCodeableConcept("type", element.getType()); 43411 } 43412 if (element.hasComponent()) { 43413 composeIdentifier("component", element.getComponent()); 43414 } 43415 if (element.hasValueElement()) { 43416 composeStringCore("value", element.getValueElement(), false); 43417 composeStringExtras("value", element.getValueElement(), false); 43418 } 43419 } 43420 43421 protected void composeDeviceDevicePropertyComponent(String name, Device.DevicePropertyComponent element) 43422 throws IOException { 43423 if (element != null) { 43424 open(name); 43425 composeDeviceDevicePropertyComponentInner(element); 43426 close(); 43427 } 43428 } 43429 43430 protected void composeDeviceDevicePropertyComponentInner(Device.DevicePropertyComponent element) throws IOException { 43431 composeBackbone(element); 43432 if (element.hasType()) { 43433 composeCodeableConcept("type", element.getType()); 43434 } 43435 if (element.hasValueQuantity()) { 43436 openArray("valueQuantity"); 43437 for (Quantity e : element.getValueQuantity()) 43438 composeQuantity(null, e); 43439 closeArray(); 43440 } 43441 ; 43442 if (element.hasValueCode()) { 43443 openArray("valueCode"); 43444 for (CodeableConcept e : element.getValueCode()) 43445 composeCodeableConcept(null, e); 43446 closeArray(); 43447 } 43448 ; 43449 } 43450 43451 protected void composeDeviceDefinition(String name, DeviceDefinition element) throws IOException { 43452 if (element != null) { 43453 prop("resourceType", name); 43454 composeDeviceDefinitionInner(element); 43455 } 43456 } 43457 43458 protected void composeDeviceDefinitionInner(DeviceDefinition element) throws IOException { 43459 composeDomainResourceElements(element); 43460 if (element.hasIdentifier()) { 43461 openArray("identifier"); 43462 for (Identifier e : element.getIdentifier()) 43463 composeIdentifier(null, e); 43464 closeArray(); 43465 } 43466 ; 43467 if (element.hasUdiDeviceIdentifier()) { 43468 openArray("udiDeviceIdentifier"); 43469 for (DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent e : element.getUdiDeviceIdentifier()) 43470 composeDeviceDefinitionDeviceDefinitionUdiDeviceIdentifierComponent(null, e); 43471 closeArray(); 43472 } 43473 ; 43474 if (element.hasManufacturer()) { 43475 composeType("manufacturer", element.getManufacturer()); 43476 } 43477 if (element.hasDeviceName()) { 43478 openArray("deviceName"); 43479 for (DeviceDefinition.DeviceDefinitionDeviceNameComponent e : element.getDeviceName()) 43480 composeDeviceDefinitionDeviceDefinitionDeviceNameComponent(null, e); 43481 closeArray(); 43482 } 43483 ; 43484 if (element.hasModelNumberElement()) { 43485 composeStringCore("modelNumber", element.getModelNumberElement(), false); 43486 composeStringExtras("modelNumber", element.getModelNumberElement(), false); 43487 } 43488 if (element.hasType()) { 43489 composeCodeableConcept("type", element.getType()); 43490 } 43491 if (element.hasSpecialization()) { 43492 openArray("specialization"); 43493 for (DeviceDefinition.DeviceDefinitionSpecializationComponent e : element.getSpecialization()) 43494 composeDeviceDefinitionDeviceDefinitionSpecializationComponent(null, e); 43495 closeArray(); 43496 } 43497 ; 43498 if (element.hasVersion()) { 43499 openArray("version"); 43500 for (StringType e : element.getVersion()) 43501 composeStringCore(null, e, true); 43502 closeArray(); 43503 if (anyHasExtras(element.getVersion())) { 43504 openArray("_version"); 43505 for (StringType e : element.getVersion()) 43506 composeStringExtras(null, e, true); 43507 closeArray(); 43508 } 43509 } 43510 ; 43511 if (element.hasSafety()) { 43512 openArray("safety"); 43513 for (CodeableConcept e : element.getSafety()) 43514 composeCodeableConcept(null, e); 43515 closeArray(); 43516 } 43517 ; 43518 if (element.hasShelfLifeStorage()) { 43519 openArray("shelfLifeStorage"); 43520 for (ProductShelfLife e : element.getShelfLifeStorage()) 43521 composeProductShelfLife(null, e); 43522 closeArray(); 43523 } 43524 ; 43525 if (element.hasPhysicalCharacteristics()) { 43526 composeProdCharacteristic("physicalCharacteristics", element.getPhysicalCharacteristics()); 43527 } 43528 if (element.hasLanguageCode()) { 43529 openArray("languageCode"); 43530 for (CodeableConcept e : element.getLanguageCode()) 43531 composeCodeableConcept(null, e); 43532 closeArray(); 43533 } 43534 ; 43535 if (element.hasCapability()) { 43536 openArray("capability"); 43537 for (DeviceDefinition.DeviceDefinitionCapabilityComponent e : element.getCapability()) 43538 composeDeviceDefinitionDeviceDefinitionCapabilityComponent(null, e); 43539 closeArray(); 43540 } 43541 ; 43542 if (element.hasProperty()) { 43543 openArray("property"); 43544 for (DeviceDefinition.DeviceDefinitionPropertyComponent e : element.getProperty()) 43545 composeDeviceDefinitionDeviceDefinitionPropertyComponent(null, e); 43546 closeArray(); 43547 } 43548 ; 43549 if (element.hasOwner()) { 43550 composeReference("owner", element.getOwner()); 43551 } 43552 if (element.hasContact()) { 43553 openArray("contact"); 43554 for (ContactPoint e : element.getContact()) 43555 composeContactPoint(null, e); 43556 closeArray(); 43557 } 43558 ; 43559 if (element.hasUrlElement()) { 43560 composeUriCore("url", element.getUrlElement(), false); 43561 composeUriExtras("url", element.getUrlElement(), false); 43562 } 43563 if (element.hasOnlineInformationElement()) { 43564 composeUriCore("onlineInformation", element.getOnlineInformationElement(), false); 43565 composeUriExtras("onlineInformation", element.getOnlineInformationElement(), false); 43566 } 43567 if (element.hasNote()) { 43568 openArray("note"); 43569 for (Annotation e : element.getNote()) 43570 composeAnnotation(null, e); 43571 closeArray(); 43572 } 43573 ; 43574 if (element.hasQuantity()) { 43575 composeQuantity("quantity", element.getQuantity()); 43576 } 43577 if (element.hasParentDevice()) { 43578 composeReference("parentDevice", element.getParentDevice()); 43579 } 43580 if (element.hasMaterial()) { 43581 openArray("material"); 43582 for (DeviceDefinition.DeviceDefinitionMaterialComponent e : element.getMaterial()) 43583 composeDeviceDefinitionDeviceDefinitionMaterialComponent(null, e); 43584 closeArray(); 43585 } 43586 ; 43587 } 43588 43589 protected void composeDeviceDefinitionDeviceDefinitionUdiDeviceIdentifierComponent(String name, 43590 DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent element) throws IOException { 43591 if (element != null) { 43592 open(name); 43593 composeDeviceDefinitionDeviceDefinitionUdiDeviceIdentifierComponentInner(element); 43594 close(); 43595 } 43596 } 43597 43598 protected void composeDeviceDefinitionDeviceDefinitionUdiDeviceIdentifierComponentInner( 43599 DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent element) throws IOException { 43600 composeBackbone(element); 43601 if (element.hasDeviceIdentifierElement()) { 43602 composeStringCore("deviceIdentifier", element.getDeviceIdentifierElement(), false); 43603 composeStringExtras("deviceIdentifier", element.getDeviceIdentifierElement(), false); 43604 } 43605 if (element.hasIssuerElement()) { 43606 composeUriCore("issuer", element.getIssuerElement(), false); 43607 composeUriExtras("issuer", element.getIssuerElement(), false); 43608 } 43609 if (element.hasJurisdictionElement()) { 43610 composeUriCore("jurisdiction", element.getJurisdictionElement(), false); 43611 composeUriExtras("jurisdiction", element.getJurisdictionElement(), false); 43612 } 43613 } 43614 43615 protected void composeDeviceDefinitionDeviceDefinitionDeviceNameComponent(String name, 43616 DeviceDefinition.DeviceDefinitionDeviceNameComponent element) throws IOException { 43617 if (element != null) { 43618 open(name); 43619 composeDeviceDefinitionDeviceDefinitionDeviceNameComponentInner(element); 43620 close(); 43621 } 43622 } 43623 43624 protected void composeDeviceDefinitionDeviceDefinitionDeviceNameComponentInner( 43625 DeviceDefinition.DeviceDefinitionDeviceNameComponent element) throws IOException { 43626 composeBackbone(element); 43627 if (element.hasNameElement()) { 43628 composeStringCore("name", element.getNameElement(), false); 43629 composeStringExtras("name", element.getNameElement(), false); 43630 } 43631 if (element.hasTypeElement()) { 43632 composeEnumerationCore("type", element.getTypeElement(), new DeviceDefinition.DeviceNameTypeEnumFactory(), false); 43633 composeEnumerationExtras("type", element.getTypeElement(), new DeviceDefinition.DeviceNameTypeEnumFactory(), 43634 false); 43635 } 43636 } 43637 43638 protected void composeDeviceDefinitionDeviceDefinitionSpecializationComponent(String name, 43639 DeviceDefinition.DeviceDefinitionSpecializationComponent element) throws IOException { 43640 if (element != null) { 43641 open(name); 43642 composeDeviceDefinitionDeviceDefinitionSpecializationComponentInner(element); 43643 close(); 43644 } 43645 } 43646 43647 protected void composeDeviceDefinitionDeviceDefinitionSpecializationComponentInner( 43648 DeviceDefinition.DeviceDefinitionSpecializationComponent element) throws IOException { 43649 composeBackbone(element); 43650 if (element.hasSystemTypeElement()) { 43651 composeStringCore("systemType", element.getSystemTypeElement(), false); 43652 composeStringExtras("systemType", element.getSystemTypeElement(), false); 43653 } 43654 if (element.hasVersionElement()) { 43655 composeStringCore("version", element.getVersionElement(), false); 43656 composeStringExtras("version", element.getVersionElement(), false); 43657 } 43658 } 43659 43660 protected void composeDeviceDefinitionDeviceDefinitionCapabilityComponent(String name, 43661 DeviceDefinition.DeviceDefinitionCapabilityComponent element) throws IOException { 43662 if (element != null) { 43663 open(name); 43664 composeDeviceDefinitionDeviceDefinitionCapabilityComponentInner(element); 43665 close(); 43666 } 43667 } 43668 43669 protected void composeDeviceDefinitionDeviceDefinitionCapabilityComponentInner( 43670 DeviceDefinition.DeviceDefinitionCapabilityComponent element) throws IOException { 43671 composeBackbone(element); 43672 if (element.hasType()) { 43673 composeCodeableConcept("type", element.getType()); 43674 } 43675 if (element.hasDescription()) { 43676 openArray("description"); 43677 for (CodeableConcept e : element.getDescription()) 43678 composeCodeableConcept(null, e); 43679 closeArray(); 43680 } 43681 ; 43682 } 43683 43684 protected void composeDeviceDefinitionDeviceDefinitionPropertyComponent(String name, 43685 DeviceDefinition.DeviceDefinitionPropertyComponent element) throws IOException { 43686 if (element != null) { 43687 open(name); 43688 composeDeviceDefinitionDeviceDefinitionPropertyComponentInner(element); 43689 close(); 43690 } 43691 } 43692 43693 protected void composeDeviceDefinitionDeviceDefinitionPropertyComponentInner( 43694 DeviceDefinition.DeviceDefinitionPropertyComponent element) throws IOException { 43695 composeBackbone(element); 43696 if (element.hasType()) { 43697 composeCodeableConcept("type", element.getType()); 43698 } 43699 if (element.hasValueQuantity()) { 43700 openArray("valueQuantity"); 43701 for (Quantity e : element.getValueQuantity()) 43702 composeQuantity(null, e); 43703 closeArray(); 43704 } 43705 ; 43706 if (element.hasValueCode()) { 43707 openArray("valueCode"); 43708 for (CodeableConcept e : element.getValueCode()) 43709 composeCodeableConcept(null, e); 43710 closeArray(); 43711 } 43712 ; 43713 } 43714 43715 protected void composeDeviceDefinitionDeviceDefinitionMaterialComponent(String name, 43716 DeviceDefinition.DeviceDefinitionMaterialComponent element) throws IOException { 43717 if (element != null) { 43718 open(name); 43719 composeDeviceDefinitionDeviceDefinitionMaterialComponentInner(element); 43720 close(); 43721 } 43722 } 43723 43724 protected void composeDeviceDefinitionDeviceDefinitionMaterialComponentInner( 43725 DeviceDefinition.DeviceDefinitionMaterialComponent element) throws IOException { 43726 composeBackbone(element); 43727 if (element.hasSubstance()) { 43728 composeCodeableConcept("substance", element.getSubstance()); 43729 } 43730 if (element.hasAlternateElement()) { 43731 composeBooleanCore("alternate", element.getAlternateElement(), false); 43732 composeBooleanExtras("alternate", element.getAlternateElement(), false); 43733 } 43734 if (element.hasAllergenicIndicatorElement()) { 43735 composeBooleanCore("allergenicIndicator", element.getAllergenicIndicatorElement(), false); 43736 composeBooleanExtras("allergenicIndicator", element.getAllergenicIndicatorElement(), false); 43737 } 43738 } 43739 43740 protected void composeDeviceMetric(String name, DeviceMetric element) throws IOException { 43741 if (element != null) { 43742 prop("resourceType", name); 43743 composeDeviceMetricInner(element); 43744 } 43745 } 43746 43747 protected void composeDeviceMetricInner(DeviceMetric element) throws IOException { 43748 composeDomainResourceElements(element); 43749 if (element.hasIdentifier()) { 43750 openArray("identifier"); 43751 for (Identifier e : element.getIdentifier()) 43752 composeIdentifier(null, e); 43753 closeArray(); 43754 } 43755 ; 43756 if (element.hasType()) { 43757 composeCodeableConcept("type", element.getType()); 43758 } 43759 if (element.hasUnit()) { 43760 composeCodeableConcept("unit", element.getUnit()); 43761 } 43762 if (element.hasSource()) { 43763 composeReference("source", element.getSource()); 43764 } 43765 if (element.hasParent()) { 43766 composeReference("parent", element.getParent()); 43767 } 43768 if (element.hasOperationalStatusElement()) { 43769 composeEnumerationCore("operationalStatus", element.getOperationalStatusElement(), 43770 new DeviceMetric.DeviceMetricOperationalStatusEnumFactory(), false); 43771 composeEnumerationExtras("operationalStatus", element.getOperationalStatusElement(), 43772 new DeviceMetric.DeviceMetricOperationalStatusEnumFactory(), false); 43773 } 43774 if (element.hasColorElement()) { 43775 composeEnumerationCore("color", element.getColorElement(), new DeviceMetric.DeviceMetricColorEnumFactory(), 43776 false); 43777 composeEnumerationExtras("color", element.getColorElement(), new DeviceMetric.DeviceMetricColorEnumFactory(), 43778 false); 43779 } 43780 if (element.hasCategoryElement()) { 43781 composeEnumerationCore("category", element.getCategoryElement(), 43782 new DeviceMetric.DeviceMetricCategoryEnumFactory(), false); 43783 composeEnumerationExtras("category", element.getCategoryElement(), 43784 new DeviceMetric.DeviceMetricCategoryEnumFactory(), false); 43785 } 43786 if (element.hasMeasurementPeriod()) { 43787 composeTiming("measurementPeriod", element.getMeasurementPeriod()); 43788 } 43789 if (element.hasCalibration()) { 43790 openArray("calibration"); 43791 for (DeviceMetric.DeviceMetricCalibrationComponent e : element.getCalibration()) 43792 composeDeviceMetricDeviceMetricCalibrationComponent(null, e); 43793 closeArray(); 43794 } 43795 ; 43796 } 43797 43798 protected void composeDeviceMetricDeviceMetricCalibrationComponent(String name, 43799 DeviceMetric.DeviceMetricCalibrationComponent element) throws IOException { 43800 if (element != null) { 43801 open(name); 43802 composeDeviceMetricDeviceMetricCalibrationComponentInner(element); 43803 close(); 43804 } 43805 } 43806 43807 protected void composeDeviceMetricDeviceMetricCalibrationComponentInner( 43808 DeviceMetric.DeviceMetricCalibrationComponent element) throws IOException { 43809 composeBackbone(element); 43810 if (element.hasTypeElement()) { 43811 composeEnumerationCore("type", element.getTypeElement(), 43812 new DeviceMetric.DeviceMetricCalibrationTypeEnumFactory(), false); 43813 composeEnumerationExtras("type", element.getTypeElement(), 43814 new DeviceMetric.DeviceMetricCalibrationTypeEnumFactory(), false); 43815 } 43816 if (element.hasStateElement()) { 43817 composeEnumerationCore("state", element.getStateElement(), 43818 new DeviceMetric.DeviceMetricCalibrationStateEnumFactory(), false); 43819 composeEnumerationExtras("state", element.getStateElement(), 43820 new DeviceMetric.DeviceMetricCalibrationStateEnumFactory(), false); 43821 } 43822 if (element.hasTimeElement()) { 43823 composeInstantCore("time", element.getTimeElement(), false); 43824 composeInstantExtras("time", element.getTimeElement(), false); 43825 } 43826 } 43827 43828 protected void composeDeviceRequest(String name, DeviceRequest element) throws IOException { 43829 if (element != null) { 43830 prop("resourceType", name); 43831 composeDeviceRequestInner(element); 43832 } 43833 } 43834 43835 protected void composeDeviceRequestInner(DeviceRequest element) throws IOException { 43836 composeDomainResourceElements(element); 43837 if (element.hasIdentifier()) { 43838 openArray("identifier"); 43839 for (Identifier e : element.getIdentifier()) 43840 composeIdentifier(null, e); 43841 closeArray(); 43842 } 43843 ; 43844 if (element.hasInstantiatesCanonical()) { 43845 openArray("instantiatesCanonical"); 43846 for (CanonicalType e : element.getInstantiatesCanonical()) 43847 composeCanonicalCore(null, e, true); 43848 closeArray(); 43849 if (anyHasExtras(element.getInstantiatesCanonical())) { 43850 openArray("_instantiatesCanonical"); 43851 for (CanonicalType e : element.getInstantiatesCanonical()) 43852 composeCanonicalExtras(null, e, true); 43853 closeArray(); 43854 } 43855 } 43856 ; 43857 if (element.hasInstantiatesUri()) { 43858 openArray("instantiatesUri"); 43859 for (UriType e : element.getInstantiatesUri()) 43860 composeUriCore(null, e, true); 43861 closeArray(); 43862 if (anyHasExtras(element.getInstantiatesUri())) { 43863 openArray("_instantiatesUri"); 43864 for (UriType e : element.getInstantiatesUri()) 43865 composeUriExtras(null, e, true); 43866 closeArray(); 43867 } 43868 } 43869 ; 43870 if (element.hasBasedOn()) { 43871 openArray("basedOn"); 43872 for (Reference e : element.getBasedOn()) 43873 composeReference(null, e); 43874 closeArray(); 43875 } 43876 ; 43877 if (element.hasPriorRequest()) { 43878 openArray("priorRequest"); 43879 for (Reference e : element.getPriorRequest()) 43880 composeReference(null, e); 43881 closeArray(); 43882 } 43883 ; 43884 if (element.hasGroupIdentifier()) { 43885 composeIdentifier("groupIdentifier", element.getGroupIdentifier()); 43886 } 43887 if (element.hasStatusElement()) { 43888 composeEnumerationCore("status", element.getStatusElement(), new DeviceRequest.DeviceRequestStatusEnumFactory(), 43889 false); 43890 composeEnumerationExtras("status", element.getStatusElement(), new DeviceRequest.DeviceRequestStatusEnumFactory(), 43891 false); 43892 } 43893 if (element.hasIntentElement()) { 43894 composeEnumerationCore("intent", element.getIntentElement(), new DeviceRequest.RequestIntentEnumFactory(), false); 43895 composeEnumerationExtras("intent", element.getIntentElement(), new DeviceRequest.RequestIntentEnumFactory(), 43896 false); 43897 } 43898 if (element.hasPriorityElement()) { 43899 composeEnumerationCore("priority", element.getPriorityElement(), new DeviceRequest.RequestPriorityEnumFactory(), 43900 false); 43901 composeEnumerationExtras("priority", element.getPriorityElement(), new DeviceRequest.RequestPriorityEnumFactory(), 43902 false); 43903 } 43904 if (element.hasCode()) { 43905 composeType("code", element.getCode()); 43906 } 43907 if (element.hasParameter()) { 43908 openArray("parameter"); 43909 for (DeviceRequest.DeviceRequestParameterComponent e : element.getParameter()) 43910 composeDeviceRequestDeviceRequestParameterComponent(null, e); 43911 closeArray(); 43912 } 43913 ; 43914 if (element.hasSubject()) { 43915 composeReference("subject", element.getSubject()); 43916 } 43917 if (element.hasEncounter()) { 43918 composeReference("encounter", element.getEncounter()); 43919 } 43920 if (element.hasOccurrence()) { 43921 composeType("occurrence", element.getOccurrence()); 43922 } 43923 if (element.hasAuthoredOnElement()) { 43924 composeDateTimeCore("authoredOn", element.getAuthoredOnElement(), false); 43925 composeDateTimeExtras("authoredOn", element.getAuthoredOnElement(), false); 43926 } 43927 if (element.hasRequester()) { 43928 composeReference("requester", element.getRequester()); 43929 } 43930 if (element.hasPerformerType()) { 43931 composeCodeableConcept("performerType", element.getPerformerType()); 43932 } 43933 if (element.hasPerformer()) { 43934 composeReference("performer", element.getPerformer()); 43935 } 43936 if (element.hasReasonCode()) { 43937 openArray("reasonCode"); 43938 for (CodeableConcept e : element.getReasonCode()) 43939 composeCodeableConcept(null, e); 43940 closeArray(); 43941 } 43942 ; 43943 if (element.hasReasonReference()) { 43944 openArray("reasonReference"); 43945 for (Reference e : element.getReasonReference()) 43946 composeReference(null, e); 43947 closeArray(); 43948 } 43949 ; 43950 if (element.hasInsurance()) { 43951 openArray("insurance"); 43952 for (Reference e : element.getInsurance()) 43953 composeReference(null, e); 43954 closeArray(); 43955 } 43956 ; 43957 if (element.hasSupportingInfo()) { 43958 openArray("supportingInfo"); 43959 for (Reference e : element.getSupportingInfo()) 43960 composeReference(null, e); 43961 closeArray(); 43962 } 43963 ; 43964 if (element.hasNote()) { 43965 openArray("note"); 43966 for (Annotation e : element.getNote()) 43967 composeAnnotation(null, e); 43968 closeArray(); 43969 } 43970 ; 43971 if (element.hasRelevantHistory()) { 43972 openArray("relevantHistory"); 43973 for (Reference e : element.getRelevantHistory()) 43974 composeReference(null, e); 43975 closeArray(); 43976 } 43977 ; 43978 } 43979 43980 protected void composeDeviceRequestDeviceRequestParameterComponent(String name, 43981 DeviceRequest.DeviceRequestParameterComponent element) throws IOException { 43982 if (element != null) { 43983 open(name); 43984 composeDeviceRequestDeviceRequestParameterComponentInner(element); 43985 close(); 43986 } 43987 } 43988 43989 protected void composeDeviceRequestDeviceRequestParameterComponentInner( 43990 DeviceRequest.DeviceRequestParameterComponent element) throws IOException { 43991 composeBackbone(element); 43992 if (element.hasCode()) { 43993 composeCodeableConcept("code", element.getCode()); 43994 } 43995 if (element.hasValue()) { 43996 composeType("value", element.getValue()); 43997 } 43998 } 43999 44000 protected void composeDeviceUseStatement(String name, DeviceUseStatement element) throws IOException { 44001 if (element != null) { 44002 prop("resourceType", name); 44003 composeDeviceUseStatementInner(element); 44004 } 44005 } 44006 44007 protected void composeDeviceUseStatementInner(DeviceUseStatement element) throws IOException { 44008 composeDomainResourceElements(element); 44009 if (element.hasIdentifier()) { 44010 openArray("identifier"); 44011 for (Identifier e : element.getIdentifier()) 44012 composeIdentifier(null, e); 44013 closeArray(); 44014 } 44015 ; 44016 if (element.hasBasedOn()) { 44017 openArray("basedOn"); 44018 for (Reference e : element.getBasedOn()) 44019 composeReference(null, e); 44020 closeArray(); 44021 } 44022 ; 44023 if (element.hasStatusElement()) { 44024 composeEnumerationCore("status", element.getStatusElement(), 44025 new DeviceUseStatement.DeviceUseStatementStatusEnumFactory(), false); 44026 composeEnumerationExtras("status", element.getStatusElement(), 44027 new DeviceUseStatement.DeviceUseStatementStatusEnumFactory(), false); 44028 } 44029 if (element.hasSubject()) { 44030 composeReference("subject", element.getSubject()); 44031 } 44032 if (element.hasDerivedFrom()) { 44033 openArray("derivedFrom"); 44034 for (Reference e : element.getDerivedFrom()) 44035 composeReference(null, e); 44036 closeArray(); 44037 } 44038 ; 44039 if (element.hasTiming()) { 44040 composeType("timing", element.getTiming()); 44041 } 44042 if (element.hasRecordedOnElement()) { 44043 composeDateTimeCore("recordedOn", element.getRecordedOnElement(), false); 44044 composeDateTimeExtras("recordedOn", element.getRecordedOnElement(), false); 44045 } 44046 if (element.hasSource()) { 44047 composeReference("source", element.getSource()); 44048 } 44049 if (element.hasDevice()) { 44050 composeReference("device", element.getDevice()); 44051 } 44052 if (element.hasReasonCode()) { 44053 openArray("reasonCode"); 44054 for (CodeableConcept e : element.getReasonCode()) 44055 composeCodeableConcept(null, e); 44056 closeArray(); 44057 } 44058 ; 44059 if (element.hasReasonReference()) { 44060 openArray("reasonReference"); 44061 for (Reference e : element.getReasonReference()) 44062 composeReference(null, e); 44063 closeArray(); 44064 } 44065 ; 44066 if (element.hasBodySite()) { 44067 composeCodeableConcept("bodySite", element.getBodySite()); 44068 } 44069 if (element.hasNote()) { 44070 openArray("note"); 44071 for (Annotation e : element.getNote()) 44072 composeAnnotation(null, e); 44073 closeArray(); 44074 } 44075 ; 44076 } 44077 44078 protected void composeDiagnosticReport(String name, DiagnosticReport element) throws IOException { 44079 if (element != null) { 44080 prop("resourceType", name); 44081 composeDiagnosticReportInner(element); 44082 } 44083 } 44084 44085 protected void composeDiagnosticReportInner(DiagnosticReport element) throws IOException { 44086 composeDomainResourceElements(element); 44087 if (element.hasIdentifier()) { 44088 openArray("identifier"); 44089 for (Identifier e : element.getIdentifier()) 44090 composeIdentifier(null, e); 44091 closeArray(); 44092 } 44093 ; 44094 if (element.hasBasedOn()) { 44095 openArray("basedOn"); 44096 for (Reference e : element.getBasedOn()) 44097 composeReference(null, e); 44098 closeArray(); 44099 } 44100 ; 44101 if (element.hasStatusElement()) { 44102 composeEnumerationCore("status", element.getStatusElement(), 44103 new DiagnosticReport.DiagnosticReportStatusEnumFactory(), false); 44104 composeEnumerationExtras("status", element.getStatusElement(), 44105 new DiagnosticReport.DiagnosticReportStatusEnumFactory(), false); 44106 } 44107 if (element.hasCategory()) { 44108 openArray("category"); 44109 for (CodeableConcept e : element.getCategory()) 44110 composeCodeableConcept(null, e); 44111 closeArray(); 44112 } 44113 ; 44114 if (element.hasCode()) { 44115 composeCodeableConcept("code", element.getCode()); 44116 } 44117 if (element.hasSubject()) { 44118 composeReference("subject", element.getSubject()); 44119 } 44120 if (element.hasEncounter()) { 44121 composeReference("encounter", element.getEncounter()); 44122 } 44123 if (element.hasEffective()) { 44124 composeType("effective", element.getEffective()); 44125 } 44126 if (element.hasIssuedElement()) { 44127 composeInstantCore("issued", element.getIssuedElement(), false); 44128 composeInstantExtras("issued", element.getIssuedElement(), false); 44129 } 44130 if (element.hasPerformer()) { 44131 openArray("performer"); 44132 for (Reference e : element.getPerformer()) 44133 composeReference(null, e); 44134 closeArray(); 44135 } 44136 ; 44137 if (element.hasResultsInterpreter()) { 44138 openArray("resultsInterpreter"); 44139 for (Reference e : element.getResultsInterpreter()) 44140 composeReference(null, e); 44141 closeArray(); 44142 } 44143 ; 44144 if (element.hasSpecimen()) { 44145 openArray("specimen"); 44146 for (Reference e : element.getSpecimen()) 44147 composeReference(null, e); 44148 closeArray(); 44149 } 44150 ; 44151 if (element.hasResult()) { 44152 openArray("result"); 44153 for (Reference e : element.getResult()) 44154 composeReference(null, e); 44155 closeArray(); 44156 } 44157 ; 44158 if (element.hasImagingStudy()) { 44159 openArray("imagingStudy"); 44160 for (Reference e : element.getImagingStudy()) 44161 composeReference(null, e); 44162 closeArray(); 44163 } 44164 ; 44165 if (element.hasMedia()) { 44166 openArray("media"); 44167 for (DiagnosticReport.DiagnosticReportMediaComponent e : element.getMedia()) 44168 composeDiagnosticReportDiagnosticReportMediaComponent(null, e); 44169 closeArray(); 44170 } 44171 ; 44172 if (element.hasConclusionElement()) { 44173 composeStringCore("conclusion", element.getConclusionElement(), false); 44174 composeStringExtras("conclusion", element.getConclusionElement(), false); 44175 } 44176 if (element.hasConclusionCode()) { 44177 openArray("conclusionCode"); 44178 for (CodeableConcept e : element.getConclusionCode()) 44179 composeCodeableConcept(null, e); 44180 closeArray(); 44181 } 44182 ; 44183 if (element.hasPresentedForm()) { 44184 openArray("presentedForm"); 44185 for (Attachment e : element.getPresentedForm()) 44186 composeAttachment(null, e); 44187 closeArray(); 44188 } 44189 ; 44190 } 44191 44192 protected void composeDiagnosticReportDiagnosticReportMediaComponent(String name, 44193 DiagnosticReport.DiagnosticReportMediaComponent element) throws IOException { 44194 if (element != null) { 44195 open(name); 44196 composeDiagnosticReportDiagnosticReportMediaComponentInner(element); 44197 close(); 44198 } 44199 } 44200 44201 protected void composeDiagnosticReportDiagnosticReportMediaComponentInner( 44202 DiagnosticReport.DiagnosticReportMediaComponent element) throws IOException { 44203 composeBackbone(element); 44204 if (element.hasCommentElement()) { 44205 composeStringCore("comment", element.getCommentElement(), false); 44206 composeStringExtras("comment", element.getCommentElement(), false); 44207 } 44208 if (element.hasLink()) { 44209 composeReference("link", element.getLink()); 44210 } 44211 } 44212 44213 protected void composeDocumentManifest(String name, DocumentManifest element) throws IOException { 44214 if (element != null) { 44215 prop("resourceType", name); 44216 composeDocumentManifestInner(element); 44217 } 44218 } 44219 44220 protected void composeDocumentManifestInner(DocumentManifest element) throws IOException { 44221 composeDomainResourceElements(element); 44222 if (element.hasMasterIdentifier()) { 44223 composeIdentifier("masterIdentifier", element.getMasterIdentifier()); 44224 } 44225 if (element.hasIdentifier()) { 44226 openArray("identifier"); 44227 for (Identifier e : element.getIdentifier()) 44228 composeIdentifier(null, e); 44229 closeArray(); 44230 } 44231 ; 44232 if (element.hasStatusElement()) { 44233 composeEnumerationCore("status", element.getStatusElement(), 44234 new Enumerations.DocumentReferenceStatusEnumFactory(), false); 44235 composeEnumerationExtras("status", element.getStatusElement(), 44236 new Enumerations.DocumentReferenceStatusEnumFactory(), false); 44237 } 44238 if (element.hasType()) { 44239 composeCodeableConcept("type", element.getType()); 44240 } 44241 if (element.hasSubject()) { 44242 composeReference("subject", element.getSubject()); 44243 } 44244 if (element.hasCreatedElement()) { 44245 composeDateTimeCore("created", element.getCreatedElement(), false); 44246 composeDateTimeExtras("created", element.getCreatedElement(), false); 44247 } 44248 if (element.hasAuthor()) { 44249 openArray("author"); 44250 for (Reference e : element.getAuthor()) 44251 composeReference(null, e); 44252 closeArray(); 44253 } 44254 ; 44255 if (element.hasRecipient()) { 44256 openArray("recipient"); 44257 for (Reference e : element.getRecipient()) 44258 composeReference(null, e); 44259 closeArray(); 44260 } 44261 ; 44262 if (element.hasSourceElement()) { 44263 composeUriCore("source", element.getSourceElement(), false); 44264 composeUriExtras("source", element.getSourceElement(), false); 44265 } 44266 if (element.hasDescriptionElement()) { 44267 composeStringCore("description", element.getDescriptionElement(), false); 44268 composeStringExtras("description", element.getDescriptionElement(), false); 44269 } 44270 if (element.hasContent()) { 44271 openArray("content"); 44272 for (Reference e : element.getContent()) 44273 composeReference(null, e); 44274 closeArray(); 44275 } 44276 ; 44277 if (element.hasRelated()) { 44278 openArray("related"); 44279 for (DocumentManifest.DocumentManifestRelatedComponent e : element.getRelated()) 44280 composeDocumentManifestDocumentManifestRelatedComponent(null, e); 44281 closeArray(); 44282 } 44283 ; 44284 } 44285 44286 protected void composeDocumentManifestDocumentManifestRelatedComponent(String name, 44287 DocumentManifest.DocumentManifestRelatedComponent element) throws IOException { 44288 if (element != null) { 44289 open(name); 44290 composeDocumentManifestDocumentManifestRelatedComponentInner(element); 44291 close(); 44292 } 44293 } 44294 44295 protected void composeDocumentManifestDocumentManifestRelatedComponentInner( 44296 DocumentManifest.DocumentManifestRelatedComponent element) throws IOException { 44297 composeBackbone(element); 44298 if (element.hasIdentifier()) { 44299 composeIdentifier("identifier", element.getIdentifier()); 44300 } 44301 if (element.hasRef()) { 44302 composeReference("ref", element.getRef()); 44303 } 44304 } 44305 44306 protected void composeDocumentReference(String name, DocumentReference element) throws IOException { 44307 if (element != null) { 44308 prop("resourceType", name); 44309 composeDocumentReferenceInner(element); 44310 } 44311 } 44312 44313 protected void composeDocumentReferenceInner(DocumentReference element) throws IOException { 44314 composeDomainResourceElements(element); 44315 if (element.hasMasterIdentifier()) { 44316 composeIdentifier("masterIdentifier", element.getMasterIdentifier()); 44317 } 44318 if (element.hasIdentifier()) { 44319 openArray("identifier"); 44320 for (Identifier e : element.getIdentifier()) 44321 composeIdentifier(null, e); 44322 closeArray(); 44323 } 44324 ; 44325 if (element.hasStatusElement()) { 44326 composeEnumerationCore("status", element.getStatusElement(), 44327 new Enumerations.DocumentReferenceStatusEnumFactory(), false); 44328 composeEnumerationExtras("status", element.getStatusElement(), 44329 new Enumerations.DocumentReferenceStatusEnumFactory(), false); 44330 } 44331 if (element.hasDocStatusElement()) { 44332 composeEnumerationCore("docStatus", element.getDocStatusElement(), 44333 new DocumentReference.ReferredDocumentStatusEnumFactory(), false); 44334 composeEnumerationExtras("docStatus", element.getDocStatusElement(), 44335 new DocumentReference.ReferredDocumentStatusEnumFactory(), false); 44336 } 44337 if (element.hasType()) { 44338 composeCodeableConcept("type", element.getType()); 44339 } 44340 if (element.hasCategory()) { 44341 openArray("category"); 44342 for (CodeableConcept e : element.getCategory()) 44343 composeCodeableConcept(null, e); 44344 closeArray(); 44345 } 44346 ; 44347 if (element.hasSubject()) { 44348 composeReference("subject", element.getSubject()); 44349 } 44350 if (element.hasDateElement()) { 44351 composeInstantCore("date", element.getDateElement(), false); 44352 composeInstantExtras("date", element.getDateElement(), false); 44353 } 44354 if (element.hasAuthor()) { 44355 openArray("author"); 44356 for (Reference e : element.getAuthor()) 44357 composeReference(null, e); 44358 closeArray(); 44359 } 44360 ; 44361 if (element.hasAuthenticator()) { 44362 composeReference("authenticator", element.getAuthenticator()); 44363 } 44364 if (element.hasCustodian()) { 44365 composeReference("custodian", element.getCustodian()); 44366 } 44367 if (element.hasRelatesTo()) { 44368 openArray("relatesTo"); 44369 for (DocumentReference.DocumentReferenceRelatesToComponent e : element.getRelatesTo()) 44370 composeDocumentReferenceDocumentReferenceRelatesToComponent(null, e); 44371 closeArray(); 44372 } 44373 ; 44374 if (element.hasDescriptionElement()) { 44375 composeStringCore("description", element.getDescriptionElement(), false); 44376 composeStringExtras("description", element.getDescriptionElement(), false); 44377 } 44378 if (element.hasSecurityLabel()) { 44379 openArray("securityLabel"); 44380 for (CodeableConcept e : element.getSecurityLabel()) 44381 composeCodeableConcept(null, e); 44382 closeArray(); 44383 } 44384 ; 44385 if (element.hasContent()) { 44386 openArray("content"); 44387 for (DocumentReference.DocumentReferenceContentComponent e : element.getContent()) 44388 composeDocumentReferenceDocumentReferenceContentComponent(null, e); 44389 closeArray(); 44390 } 44391 ; 44392 if (element.hasContext()) { 44393 composeDocumentReferenceDocumentReferenceContextComponent("context", element.getContext()); 44394 } 44395 } 44396 44397 protected void composeDocumentReferenceDocumentReferenceRelatesToComponent(String name, 44398 DocumentReference.DocumentReferenceRelatesToComponent element) throws IOException { 44399 if (element != null) { 44400 open(name); 44401 composeDocumentReferenceDocumentReferenceRelatesToComponentInner(element); 44402 close(); 44403 } 44404 } 44405 44406 protected void composeDocumentReferenceDocumentReferenceRelatesToComponentInner( 44407 DocumentReference.DocumentReferenceRelatesToComponent element) throws IOException { 44408 composeBackbone(element); 44409 if (element.hasCodeElement()) { 44410 composeEnumerationCore("code", element.getCodeElement(), 44411 new DocumentReference.DocumentRelationshipTypeEnumFactory(), false); 44412 composeEnumerationExtras("code", element.getCodeElement(), 44413 new DocumentReference.DocumentRelationshipTypeEnumFactory(), false); 44414 } 44415 if (element.hasTarget()) { 44416 composeReference("target", element.getTarget()); 44417 } 44418 } 44419 44420 protected void composeDocumentReferenceDocumentReferenceContentComponent(String name, 44421 DocumentReference.DocumentReferenceContentComponent element) throws IOException { 44422 if (element != null) { 44423 open(name); 44424 composeDocumentReferenceDocumentReferenceContentComponentInner(element); 44425 close(); 44426 } 44427 } 44428 44429 protected void composeDocumentReferenceDocumentReferenceContentComponentInner( 44430 DocumentReference.DocumentReferenceContentComponent element) throws IOException { 44431 composeBackbone(element); 44432 if (element.hasAttachment()) { 44433 composeAttachment("attachment", element.getAttachment()); 44434 } 44435 if (element.hasFormat()) { 44436 composeCoding("format", element.getFormat()); 44437 } 44438 } 44439 44440 protected void composeDocumentReferenceDocumentReferenceContextComponent(String name, 44441 DocumentReference.DocumentReferenceContextComponent element) throws IOException { 44442 if (element != null) { 44443 open(name); 44444 composeDocumentReferenceDocumentReferenceContextComponentInner(element); 44445 close(); 44446 } 44447 } 44448 44449 protected void composeDocumentReferenceDocumentReferenceContextComponentInner( 44450 DocumentReference.DocumentReferenceContextComponent element) throws IOException { 44451 composeBackbone(element); 44452 if (element.hasEncounter()) { 44453 openArray("encounter"); 44454 for (Reference e : element.getEncounter()) 44455 composeReference(null, e); 44456 closeArray(); 44457 } 44458 ; 44459 if (element.hasEvent()) { 44460 openArray("event"); 44461 for (CodeableConcept e : element.getEvent()) 44462 composeCodeableConcept(null, e); 44463 closeArray(); 44464 } 44465 ; 44466 if (element.hasPeriod()) { 44467 composePeriod("period", element.getPeriod()); 44468 } 44469 if (element.hasFacilityType()) { 44470 composeCodeableConcept("facilityType", element.getFacilityType()); 44471 } 44472 if (element.hasPracticeSetting()) { 44473 composeCodeableConcept("practiceSetting", element.getPracticeSetting()); 44474 } 44475 if (element.hasSourcePatientInfo()) { 44476 composeReference("sourcePatientInfo", element.getSourcePatientInfo()); 44477 } 44478 if (element.hasRelated()) { 44479 openArray("related"); 44480 for (Reference e : element.getRelated()) 44481 composeReference(null, e); 44482 closeArray(); 44483 } 44484 ; 44485 } 44486 44487 protected void composeEffectEvidenceSynthesis(String name, EffectEvidenceSynthesis element) throws IOException { 44488 if (element != null) { 44489 prop("resourceType", name); 44490 composeEffectEvidenceSynthesisInner(element); 44491 } 44492 } 44493 44494 protected void composeEffectEvidenceSynthesisInner(EffectEvidenceSynthesis element) throws IOException { 44495 composeDomainResourceElements(element); 44496 if (element.hasUrlElement()) { 44497 composeUriCore("url", element.getUrlElement(), false); 44498 composeUriExtras("url", element.getUrlElement(), false); 44499 } 44500 if (element.hasIdentifier()) { 44501 openArray("identifier"); 44502 for (Identifier e : element.getIdentifier()) 44503 composeIdentifier(null, e); 44504 closeArray(); 44505 } 44506 ; 44507 if (element.hasVersionElement()) { 44508 composeStringCore("version", element.getVersionElement(), false); 44509 composeStringExtras("version", element.getVersionElement(), false); 44510 } 44511 if (element.hasNameElement()) { 44512 composeStringCore("name", element.getNameElement(), false); 44513 composeStringExtras("name", element.getNameElement(), false); 44514 } 44515 if (element.hasTitleElement()) { 44516 composeStringCore("title", element.getTitleElement(), false); 44517 composeStringExtras("title", element.getTitleElement(), false); 44518 } 44519 if (element.hasStatusElement()) { 44520 composeEnumerationCore("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 44521 false); 44522 composeEnumerationExtras("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 44523 false); 44524 } 44525 if (element.hasDateElement()) { 44526 composeDateTimeCore("date", element.getDateElement(), false); 44527 composeDateTimeExtras("date", element.getDateElement(), false); 44528 } 44529 if (element.hasPublisherElement()) { 44530 composeStringCore("publisher", element.getPublisherElement(), false); 44531 composeStringExtras("publisher", element.getPublisherElement(), false); 44532 } 44533 if (element.hasContact()) { 44534 openArray("contact"); 44535 for (ContactDetail e : element.getContact()) 44536 composeContactDetail(null, e); 44537 closeArray(); 44538 } 44539 ; 44540 if (element.hasDescriptionElement()) { 44541 composeMarkdownCore("description", element.getDescriptionElement(), false); 44542 composeMarkdownExtras("description", element.getDescriptionElement(), false); 44543 } 44544 if (element.hasNote()) { 44545 openArray("note"); 44546 for (Annotation e : element.getNote()) 44547 composeAnnotation(null, e); 44548 closeArray(); 44549 } 44550 ; 44551 if (element.hasUseContext()) { 44552 openArray("useContext"); 44553 for (UsageContext e : element.getUseContext()) 44554 composeUsageContext(null, e); 44555 closeArray(); 44556 } 44557 ; 44558 if (element.hasJurisdiction()) { 44559 openArray("jurisdiction"); 44560 for (CodeableConcept e : element.getJurisdiction()) 44561 composeCodeableConcept(null, e); 44562 closeArray(); 44563 } 44564 ; 44565 if (element.hasCopyrightElement()) { 44566 composeMarkdownCore("copyright", element.getCopyrightElement(), false); 44567 composeMarkdownExtras("copyright", element.getCopyrightElement(), false); 44568 } 44569 if (element.hasApprovalDateElement()) { 44570 composeDateCore("approvalDate", element.getApprovalDateElement(), false); 44571 composeDateExtras("approvalDate", element.getApprovalDateElement(), false); 44572 } 44573 if (element.hasLastReviewDateElement()) { 44574 composeDateCore("lastReviewDate", element.getLastReviewDateElement(), false); 44575 composeDateExtras("lastReviewDate", element.getLastReviewDateElement(), false); 44576 } 44577 if (element.hasEffectivePeriod()) { 44578 composePeriod("effectivePeriod", element.getEffectivePeriod()); 44579 } 44580 if (element.hasTopic()) { 44581 openArray("topic"); 44582 for (CodeableConcept e : element.getTopic()) 44583 composeCodeableConcept(null, e); 44584 closeArray(); 44585 } 44586 ; 44587 if (element.hasAuthor()) { 44588 openArray("author"); 44589 for (ContactDetail e : element.getAuthor()) 44590 composeContactDetail(null, e); 44591 closeArray(); 44592 } 44593 ; 44594 if (element.hasEditor()) { 44595 openArray("editor"); 44596 for (ContactDetail e : element.getEditor()) 44597 composeContactDetail(null, e); 44598 closeArray(); 44599 } 44600 ; 44601 if (element.hasReviewer()) { 44602 openArray("reviewer"); 44603 for (ContactDetail e : element.getReviewer()) 44604 composeContactDetail(null, e); 44605 closeArray(); 44606 } 44607 ; 44608 if (element.hasEndorser()) { 44609 openArray("endorser"); 44610 for (ContactDetail e : element.getEndorser()) 44611 composeContactDetail(null, e); 44612 closeArray(); 44613 } 44614 ; 44615 if (element.hasRelatedArtifact()) { 44616 openArray("relatedArtifact"); 44617 for (RelatedArtifact e : element.getRelatedArtifact()) 44618 composeRelatedArtifact(null, e); 44619 closeArray(); 44620 } 44621 ; 44622 if (element.hasSynthesisType()) { 44623 composeCodeableConcept("synthesisType", element.getSynthesisType()); 44624 } 44625 if (element.hasStudyType()) { 44626 composeCodeableConcept("studyType", element.getStudyType()); 44627 } 44628 if (element.hasPopulation()) { 44629 composeReference("population", element.getPopulation()); 44630 } 44631 if (element.hasExposure()) { 44632 composeReference("exposure", element.getExposure()); 44633 } 44634 if (element.hasExposureAlternative()) { 44635 composeReference("exposureAlternative", element.getExposureAlternative()); 44636 } 44637 if (element.hasOutcome()) { 44638 composeReference("outcome", element.getOutcome()); 44639 } 44640 if (element.hasSampleSize()) { 44641 composeEffectEvidenceSynthesisEffectEvidenceSynthesisSampleSizeComponent("sampleSize", element.getSampleSize()); 44642 } 44643 if (element.hasResultsByExposure()) { 44644 openArray("resultsByExposure"); 44645 for (EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent e : element.getResultsByExposure()) 44646 composeEffectEvidenceSynthesisEffectEvidenceSynthesisResultsByExposureComponent(null, e); 44647 closeArray(); 44648 } 44649 ; 44650 if (element.hasEffectEstimate()) { 44651 openArray("effectEstimate"); 44652 for (EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent e : element.getEffectEstimate()) 44653 composeEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimateComponent(null, e); 44654 closeArray(); 44655 } 44656 ; 44657 if (element.hasCertainty()) { 44658 openArray("certainty"); 44659 for (EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent e : element.getCertainty()) 44660 composeEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyComponent(null, e); 44661 closeArray(); 44662 } 44663 ; 44664 } 44665 44666 protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisSampleSizeComponent(String name, 44667 EffectEvidenceSynthesis.EffectEvidenceSynthesisSampleSizeComponent element) throws IOException { 44668 if (element != null) { 44669 open(name); 44670 composeEffectEvidenceSynthesisEffectEvidenceSynthesisSampleSizeComponentInner(element); 44671 close(); 44672 } 44673 } 44674 44675 protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisSampleSizeComponentInner( 44676 EffectEvidenceSynthesis.EffectEvidenceSynthesisSampleSizeComponent element) throws IOException { 44677 composeBackbone(element); 44678 if (element.hasDescriptionElement()) { 44679 composeStringCore("description", element.getDescriptionElement(), false); 44680 composeStringExtras("description", element.getDescriptionElement(), false); 44681 } 44682 if (element.hasNumberOfStudiesElement()) { 44683 composeIntegerCore("numberOfStudies", element.getNumberOfStudiesElement(), false); 44684 composeIntegerExtras("numberOfStudies", element.getNumberOfStudiesElement(), false); 44685 } 44686 if (element.hasNumberOfParticipantsElement()) { 44687 composeIntegerCore("numberOfParticipants", element.getNumberOfParticipantsElement(), false); 44688 composeIntegerExtras("numberOfParticipants", element.getNumberOfParticipantsElement(), false); 44689 } 44690 } 44691 44692 protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisResultsByExposureComponent(String name, 44693 EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent element) throws IOException { 44694 if (element != null) { 44695 open(name); 44696 composeEffectEvidenceSynthesisEffectEvidenceSynthesisResultsByExposureComponentInner(element); 44697 close(); 44698 } 44699 } 44700 44701 protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisResultsByExposureComponentInner( 44702 EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent element) throws IOException { 44703 composeBackbone(element); 44704 if (element.hasDescriptionElement()) { 44705 composeStringCore("description", element.getDescriptionElement(), false); 44706 composeStringExtras("description", element.getDescriptionElement(), false); 44707 } 44708 if (element.hasExposureStateElement()) { 44709 composeEnumerationCore("exposureState", element.getExposureStateElement(), 44710 new EffectEvidenceSynthesis.ExposureStateEnumFactory(), false); 44711 composeEnumerationExtras("exposureState", element.getExposureStateElement(), 44712 new EffectEvidenceSynthesis.ExposureStateEnumFactory(), false); 44713 } 44714 if (element.hasVariantState()) { 44715 composeCodeableConcept("variantState", element.getVariantState()); 44716 } 44717 if (element.hasRiskEvidenceSynthesis()) { 44718 composeReference("riskEvidenceSynthesis", element.getRiskEvidenceSynthesis()); 44719 } 44720 } 44721 44722 protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimateComponent(String name, 44723 EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent element) throws IOException { 44724 if (element != null) { 44725 open(name); 44726 composeEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimateComponentInner(element); 44727 close(); 44728 } 44729 } 44730 44731 protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimateComponentInner( 44732 EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent element) throws IOException { 44733 composeBackbone(element); 44734 if (element.hasDescriptionElement()) { 44735 composeStringCore("description", element.getDescriptionElement(), false); 44736 composeStringExtras("description", element.getDescriptionElement(), false); 44737 } 44738 if (element.hasType()) { 44739 composeCodeableConcept("type", element.getType()); 44740 } 44741 if (element.hasVariantState()) { 44742 composeCodeableConcept("variantState", element.getVariantState()); 44743 } 44744 if (element.hasValueElement()) { 44745 composeDecimalCore("value", element.getValueElement(), false); 44746 composeDecimalExtras("value", element.getValueElement(), false); 44747 } 44748 if (element.hasUnitOfMeasure()) { 44749 composeCodeableConcept("unitOfMeasure", element.getUnitOfMeasure()); 44750 } 44751 if (element.hasPrecisionEstimate()) { 44752 openArray("precisionEstimate"); 44753 for (EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent e : element 44754 .getPrecisionEstimate()) 44755 composeEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent(null, e); 44756 closeArray(); 44757 } 44758 ; 44759 } 44760 44761 protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent( 44762 String name, EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent element) 44763 throws IOException { 44764 if (element != null) { 44765 open(name); 44766 composeEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponentInner(element); 44767 close(); 44768 } 44769 } 44770 44771 protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponentInner( 44772 EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent element) 44773 throws IOException { 44774 composeBackbone(element); 44775 if (element.hasType()) { 44776 composeCodeableConcept("type", element.getType()); 44777 } 44778 if (element.hasLevelElement()) { 44779 composeDecimalCore("level", element.getLevelElement(), false); 44780 composeDecimalExtras("level", element.getLevelElement(), false); 44781 } 44782 if (element.hasFromElement()) { 44783 composeDecimalCore("from", element.getFromElement(), false); 44784 composeDecimalExtras("from", element.getFromElement(), false); 44785 } 44786 if (element.hasToElement()) { 44787 composeDecimalCore("to", element.getToElement(), false); 44788 composeDecimalExtras("to", element.getToElement(), false); 44789 } 44790 } 44791 44792 protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyComponent(String name, 44793 EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent element) throws IOException { 44794 if (element != null) { 44795 open(name); 44796 composeEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyComponentInner(element); 44797 close(); 44798 } 44799 } 44800 44801 protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyComponentInner( 44802 EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent element) throws IOException { 44803 composeBackbone(element); 44804 if (element.hasRating()) { 44805 openArray("rating"); 44806 for (CodeableConcept e : element.getRating()) 44807 composeCodeableConcept(null, e); 44808 closeArray(); 44809 } 44810 ; 44811 if (element.hasNote()) { 44812 openArray("note"); 44813 for (Annotation e : element.getNote()) 44814 composeAnnotation(null, e); 44815 closeArray(); 44816 } 44817 ; 44818 if (element.hasCertaintySubcomponent()) { 44819 openArray("certaintySubcomponent"); 44820 for (EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent e : element 44821 .getCertaintySubcomponent()) 44822 composeEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent(null, e); 44823 closeArray(); 44824 } 44825 ; 44826 } 44827 44828 protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent( 44829 String name, EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent element) 44830 throws IOException { 44831 if (element != null) { 44832 open(name); 44833 composeEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyCertaintySubcomponentComponentInner(element); 44834 close(); 44835 } 44836 } 44837 44838 protected void composeEffectEvidenceSynthesisEffectEvidenceSynthesisCertaintyCertaintySubcomponentComponentInner( 44839 EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent element) 44840 throws IOException { 44841 composeBackbone(element); 44842 if (element.hasType()) { 44843 composeCodeableConcept("type", element.getType()); 44844 } 44845 if (element.hasRating()) { 44846 openArray("rating"); 44847 for (CodeableConcept e : element.getRating()) 44848 composeCodeableConcept(null, e); 44849 closeArray(); 44850 } 44851 ; 44852 if (element.hasNote()) { 44853 openArray("note"); 44854 for (Annotation e : element.getNote()) 44855 composeAnnotation(null, e); 44856 closeArray(); 44857 } 44858 ; 44859 } 44860 44861 protected void composeEncounter(String name, Encounter element) throws IOException { 44862 if (element != null) { 44863 prop("resourceType", name); 44864 composeEncounterInner(element); 44865 } 44866 } 44867 44868 protected void composeEncounterInner(Encounter element) throws IOException { 44869 composeDomainResourceElements(element); 44870 if (element.hasIdentifier()) { 44871 openArray("identifier"); 44872 for (Identifier e : element.getIdentifier()) 44873 composeIdentifier(null, e); 44874 closeArray(); 44875 } 44876 ; 44877 if (element.hasStatusElement()) { 44878 composeEnumerationCore("status", element.getStatusElement(), new Encounter.EncounterStatusEnumFactory(), false); 44879 composeEnumerationExtras("status", element.getStatusElement(), new Encounter.EncounterStatusEnumFactory(), false); 44880 } 44881 if (element.hasStatusHistory()) { 44882 openArray("statusHistory"); 44883 for (Encounter.StatusHistoryComponent e : element.getStatusHistory()) 44884 composeEncounterStatusHistoryComponent(null, e); 44885 closeArray(); 44886 } 44887 ; 44888 if (element.hasClass_()) { 44889 composeCoding("class", element.getClass_()); 44890 } 44891 if (element.hasClassHistory()) { 44892 openArray("classHistory"); 44893 for (Encounter.ClassHistoryComponent e : element.getClassHistory()) 44894 composeEncounterClassHistoryComponent(null, e); 44895 closeArray(); 44896 } 44897 ; 44898 if (element.hasType()) { 44899 openArray("type"); 44900 for (CodeableConcept e : element.getType()) 44901 composeCodeableConcept(null, e); 44902 closeArray(); 44903 } 44904 ; 44905 if (element.hasServiceType()) { 44906 composeCodeableConcept("serviceType", element.getServiceType()); 44907 } 44908 if (element.hasPriority()) { 44909 composeCodeableConcept("priority", element.getPriority()); 44910 } 44911 if (element.hasSubject()) { 44912 composeReference("subject", element.getSubject()); 44913 } 44914 if (element.hasEpisodeOfCare()) { 44915 openArray("episodeOfCare"); 44916 for (Reference e : element.getEpisodeOfCare()) 44917 composeReference(null, e); 44918 closeArray(); 44919 } 44920 ; 44921 if (element.hasBasedOn()) { 44922 openArray("basedOn"); 44923 for (Reference e : element.getBasedOn()) 44924 composeReference(null, e); 44925 closeArray(); 44926 } 44927 ; 44928 if (element.hasParticipant()) { 44929 openArray("participant"); 44930 for (Encounter.EncounterParticipantComponent e : element.getParticipant()) 44931 composeEncounterEncounterParticipantComponent(null, e); 44932 closeArray(); 44933 } 44934 ; 44935 if (element.hasAppointment()) { 44936 openArray("appointment"); 44937 for (Reference e : element.getAppointment()) 44938 composeReference(null, e); 44939 closeArray(); 44940 } 44941 ; 44942 if (element.hasPeriod()) { 44943 composePeriod("period", element.getPeriod()); 44944 } 44945 if (element.hasLength()) { 44946 composeDuration("length", element.getLength()); 44947 } 44948 if (element.hasReasonCode()) { 44949 openArray("reasonCode"); 44950 for (CodeableConcept e : element.getReasonCode()) 44951 composeCodeableConcept(null, e); 44952 closeArray(); 44953 } 44954 ; 44955 if (element.hasReasonReference()) { 44956 openArray("reasonReference"); 44957 for (Reference e : element.getReasonReference()) 44958 composeReference(null, e); 44959 closeArray(); 44960 } 44961 ; 44962 if (element.hasDiagnosis()) { 44963 openArray("diagnosis"); 44964 for (Encounter.DiagnosisComponent e : element.getDiagnosis()) 44965 composeEncounterDiagnosisComponent(null, e); 44966 closeArray(); 44967 } 44968 ; 44969 if (element.hasAccount()) { 44970 openArray("account"); 44971 for (Reference e : element.getAccount()) 44972 composeReference(null, e); 44973 closeArray(); 44974 } 44975 ; 44976 if (element.hasHospitalization()) { 44977 composeEncounterEncounterHospitalizationComponent("hospitalization", element.getHospitalization()); 44978 } 44979 if (element.hasLocation()) { 44980 openArray("location"); 44981 for (Encounter.EncounterLocationComponent e : element.getLocation()) 44982 composeEncounterEncounterLocationComponent(null, e); 44983 closeArray(); 44984 } 44985 ; 44986 if (element.hasServiceProvider()) { 44987 composeReference("serviceProvider", element.getServiceProvider()); 44988 } 44989 if (element.hasPartOf()) { 44990 composeReference("partOf", element.getPartOf()); 44991 } 44992 } 44993 44994 protected void composeEncounterStatusHistoryComponent(String name, Encounter.StatusHistoryComponent element) 44995 throws IOException { 44996 if (element != null) { 44997 open(name); 44998 composeEncounterStatusHistoryComponentInner(element); 44999 close(); 45000 } 45001 } 45002 45003 protected void composeEncounterStatusHistoryComponentInner(Encounter.StatusHistoryComponent element) 45004 throws IOException { 45005 composeBackbone(element); 45006 if (element.hasStatusElement()) { 45007 composeEnumerationCore("status", element.getStatusElement(), new Encounter.EncounterStatusEnumFactory(), false); 45008 composeEnumerationExtras("status", element.getStatusElement(), new Encounter.EncounterStatusEnumFactory(), false); 45009 } 45010 if (element.hasPeriod()) { 45011 composePeriod("period", element.getPeriod()); 45012 } 45013 } 45014 45015 protected void composeEncounterClassHistoryComponent(String name, Encounter.ClassHistoryComponent element) 45016 throws IOException { 45017 if (element != null) { 45018 open(name); 45019 composeEncounterClassHistoryComponentInner(element); 45020 close(); 45021 } 45022 } 45023 45024 protected void composeEncounterClassHistoryComponentInner(Encounter.ClassHistoryComponent element) 45025 throws IOException { 45026 composeBackbone(element); 45027 if (element.hasClass_()) { 45028 composeCoding("class", element.getClass_()); 45029 } 45030 if (element.hasPeriod()) { 45031 composePeriod("period", element.getPeriod()); 45032 } 45033 } 45034 45035 protected void composeEncounterEncounterParticipantComponent(String name, 45036 Encounter.EncounterParticipantComponent element) throws IOException { 45037 if (element != null) { 45038 open(name); 45039 composeEncounterEncounterParticipantComponentInner(element); 45040 close(); 45041 } 45042 } 45043 45044 protected void composeEncounterEncounterParticipantComponentInner(Encounter.EncounterParticipantComponent element) 45045 throws IOException { 45046 composeBackbone(element); 45047 if (element.hasType()) { 45048 openArray("type"); 45049 for (CodeableConcept e : element.getType()) 45050 composeCodeableConcept(null, e); 45051 closeArray(); 45052 } 45053 ; 45054 if (element.hasPeriod()) { 45055 composePeriod("period", element.getPeriod()); 45056 } 45057 if (element.hasIndividual()) { 45058 composeReference("individual", element.getIndividual()); 45059 } 45060 } 45061 45062 protected void composeEncounterDiagnosisComponent(String name, Encounter.DiagnosisComponent element) 45063 throws IOException { 45064 if (element != null) { 45065 open(name); 45066 composeEncounterDiagnosisComponentInner(element); 45067 close(); 45068 } 45069 } 45070 45071 protected void composeEncounterDiagnosisComponentInner(Encounter.DiagnosisComponent element) throws IOException { 45072 composeBackbone(element); 45073 if (element.hasCondition()) { 45074 composeReference("condition", element.getCondition()); 45075 } 45076 if (element.hasUse()) { 45077 composeCodeableConcept("use", element.getUse()); 45078 } 45079 if (element.hasRankElement()) { 45080 composePositiveIntCore("rank", element.getRankElement(), false); 45081 composePositiveIntExtras("rank", element.getRankElement(), false); 45082 } 45083 } 45084 45085 protected void composeEncounterEncounterHospitalizationComponent(String name, 45086 Encounter.EncounterHospitalizationComponent element) throws IOException { 45087 if (element != null) { 45088 open(name); 45089 composeEncounterEncounterHospitalizationComponentInner(element); 45090 close(); 45091 } 45092 } 45093 45094 protected void composeEncounterEncounterHospitalizationComponentInner( 45095 Encounter.EncounterHospitalizationComponent element) throws IOException { 45096 composeBackbone(element); 45097 if (element.hasPreAdmissionIdentifier()) { 45098 composeIdentifier("preAdmissionIdentifier", element.getPreAdmissionIdentifier()); 45099 } 45100 if (element.hasOrigin()) { 45101 composeReference("origin", element.getOrigin()); 45102 } 45103 if (element.hasAdmitSource()) { 45104 composeCodeableConcept("admitSource", element.getAdmitSource()); 45105 } 45106 if (element.hasReAdmission()) { 45107 composeCodeableConcept("reAdmission", element.getReAdmission()); 45108 } 45109 if (element.hasDietPreference()) { 45110 openArray("dietPreference"); 45111 for (CodeableConcept e : element.getDietPreference()) 45112 composeCodeableConcept(null, e); 45113 closeArray(); 45114 } 45115 ; 45116 if (element.hasSpecialCourtesy()) { 45117 openArray("specialCourtesy"); 45118 for (CodeableConcept e : element.getSpecialCourtesy()) 45119 composeCodeableConcept(null, e); 45120 closeArray(); 45121 } 45122 ; 45123 if (element.hasSpecialArrangement()) { 45124 openArray("specialArrangement"); 45125 for (CodeableConcept e : element.getSpecialArrangement()) 45126 composeCodeableConcept(null, e); 45127 closeArray(); 45128 } 45129 ; 45130 if (element.hasDestination()) { 45131 composeReference("destination", element.getDestination()); 45132 } 45133 if (element.hasDischargeDisposition()) { 45134 composeCodeableConcept("dischargeDisposition", element.getDischargeDisposition()); 45135 } 45136 } 45137 45138 protected void composeEncounterEncounterLocationComponent(String name, Encounter.EncounterLocationComponent element) 45139 throws IOException { 45140 if (element != null) { 45141 open(name); 45142 composeEncounterEncounterLocationComponentInner(element); 45143 close(); 45144 } 45145 } 45146 45147 protected void composeEncounterEncounterLocationComponentInner(Encounter.EncounterLocationComponent element) 45148 throws IOException { 45149 composeBackbone(element); 45150 if (element.hasLocation()) { 45151 composeReference("location", element.getLocation()); 45152 } 45153 if (element.hasStatusElement()) { 45154 composeEnumerationCore("status", element.getStatusElement(), new Encounter.EncounterLocationStatusEnumFactory(), 45155 false); 45156 composeEnumerationExtras("status", element.getStatusElement(), new Encounter.EncounterLocationStatusEnumFactory(), 45157 false); 45158 } 45159 if (element.hasPhysicalType()) { 45160 composeCodeableConcept("physicalType", element.getPhysicalType()); 45161 } 45162 if (element.hasPeriod()) { 45163 composePeriod("period", element.getPeriod()); 45164 } 45165 } 45166 45167 protected void composeEndpoint(String name, Endpoint element) throws IOException { 45168 if (element != null) { 45169 prop("resourceType", name); 45170 composeEndpointInner(element); 45171 } 45172 } 45173 45174 protected void composeEndpointInner(Endpoint element) throws IOException { 45175 composeDomainResourceElements(element); 45176 if (element.hasIdentifier()) { 45177 openArray("identifier"); 45178 for (Identifier e : element.getIdentifier()) 45179 composeIdentifier(null, e); 45180 closeArray(); 45181 } 45182 ; 45183 if (element.hasStatusElement()) { 45184 composeEnumerationCore("status", element.getStatusElement(), new Endpoint.EndpointStatusEnumFactory(), false); 45185 composeEnumerationExtras("status", element.getStatusElement(), new Endpoint.EndpointStatusEnumFactory(), false); 45186 } 45187 if (element.hasConnectionType()) { 45188 composeCoding("connectionType", element.getConnectionType()); 45189 } 45190 if (element.hasNameElement()) { 45191 composeStringCore("name", element.getNameElement(), false); 45192 composeStringExtras("name", element.getNameElement(), false); 45193 } 45194 if (element.hasManagingOrganization()) { 45195 composeReference("managingOrganization", element.getManagingOrganization()); 45196 } 45197 if (element.hasContact()) { 45198 openArray("contact"); 45199 for (ContactPoint e : element.getContact()) 45200 composeContactPoint(null, e); 45201 closeArray(); 45202 } 45203 ; 45204 if (element.hasPeriod()) { 45205 composePeriod("period", element.getPeriod()); 45206 } 45207 if (element.hasPayloadType()) { 45208 openArray("payloadType"); 45209 for (CodeableConcept e : element.getPayloadType()) 45210 composeCodeableConcept(null, e); 45211 closeArray(); 45212 } 45213 ; 45214 if (element.hasPayloadMimeType()) { 45215 openArray("payloadMimeType"); 45216 for (CodeType e : element.getPayloadMimeType()) 45217 composeCodeCore(null, e, true); 45218 closeArray(); 45219 if (anyHasExtras(element.getPayloadMimeType())) { 45220 openArray("_payloadMimeType"); 45221 for (CodeType e : element.getPayloadMimeType()) 45222 composeCodeExtras(null, e, true); 45223 closeArray(); 45224 } 45225 } 45226 ; 45227 if (element.hasAddressElement()) { 45228 composeUrlCore("address", element.getAddressElement(), false); 45229 composeUrlExtras("address", element.getAddressElement(), false); 45230 } 45231 if (element.hasHeader()) { 45232 openArray("header"); 45233 for (StringType e : element.getHeader()) 45234 composeStringCore(null, e, true); 45235 closeArray(); 45236 if (anyHasExtras(element.getHeader())) { 45237 openArray("_header"); 45238 for (StringType e : element.getHeader()) 45239 composeStringExtras(null, e, true); 45240 closeArray(); 45241 } 45242 } 45243 ; 45244 } 45245 45246 protected void composeEnrollmentRequest(String name, EnrollmentRequest element) throws IOException { 45247 if (element != null) { 45248 prop("resourceType", name); 45249 composeEnrollmentRequestInner(element); 45250 } 45251 } 45252 45253 protected void composeEnrollmentRequestInner(EnrollmentRequest element) throws IOException { 45254 composeDomainResourceElements(element); 45255 if (element.hasIdentifier()) { 45256 openArray("identifier"); 45257 for (Identifier e : element.getIdentifier()) 45258 composeIdentifier(null, e); 45259 closeArray(); 45260 } 45261 ; 45262 if (element.hasStatusElement()) { 45263 composeEnumerationCore("status", element.getStatusElement(), 45264 new EnrollmentRequest.EnrollmentRequestStatusEnumFactory(), false); 45265 composeEnumerationExtras("status", element.getStatusElement(), 45266 new EnrollmentRequest.EnrollmentRequestStatusEnumFactory(), false); 45267 } 45268 if (element.hasCreatedElement()) { 45269 composeDateTimeCore("created", element.getCreatedElement(), false); 45270 composeDateTimeExtras("created", element.getCreatedElement(), false); 45271 } 45272 if (element.hasInsurer()) { 45273 composeReference("insurer", element.getInsurer()); 45274 } 45275 if (element.hasProvider()) { 45276 composeReference("provider", element.getProvider()); 45277 } 45278 if (element.hasCandidate()) { 45279 composeReference("candidate", element.getCandidate()); 45280 } 45281 if (element.hasCoverage()) { 45282 composeReference("coverage", element.getCoverage()); 45283 } 45284 } 45285 45286 protected void composeEnrollmentResponse(String name, EnrollmentResponse element) throws IOException { 45287 if (element != null) { 45288 prop("resourceType", name); 45289 composeEnrollmentResponseInner(element); 45290 } 45291 } 45292 45293 protected void composeEnrollmentResponseInner(EnrollmentResponse element) throws IOException { 45294 composeDomainResourceElements(element); 45295 if (element.hasIdentifier()) { 45296 openArray("identifier"); 45297 for (Identifier e : element.getIdentifier()) 45298 composeIdentifier(null, e); 45299 closeArray(); 45300 } 45301 ; 45302 if (element.hasStatusElement()) { 45303 composeEnumerationCore("status", element.getStatusElement(), 45304 new EnrollmentResponse.EnrollmentResponseStatusEnumFactory(), false); 45305 composeEnumerationExtras("status", element.getStatusElement(), 45306 new EnrollmentResponse.EnrollmentResponseStatusEnumFactory(), false); 45307 } 45308 if (element.hasRequest()) { 45309 composeReference("request", element.getRequest()); 45310 } 45311 if (element.hasOutcomeElement()) { 45312 composeEnumerationCore("outcome", element.getOutcomeElement(), new Enumerations.RemittanceOutcomeEnumFactory(), 45313 false); 45314 composeEnumerationExtras("outcome", element.getOutcomeElement(), new Enumerations.RemittanceOutcomeEnumFactory(), 45315 false); 45316 } 45317 if (element.hasDispositionElement()) { 45318 composeStringCore("disposition", element.getDispositionElement(), false); 45319 composeStringExtras("disposition", element.getDispositionElement(), false); 45320 } 45321 if (element.hasCreatedElement()) { 45322 composeDateTimeCore("created", element.getCreatedElement(), false); 45323 composeDateTimeExtras("created", element.getCreatedElement(), false); 45324 } 45325 if (element.hasOrganization()) { 45326 composeReference("organization", element.getOrganization()); 45327 } 45328 if (element.hasRequestProvider()) { 45329 composeReference("requestProvider", element.getRequestProvider()); 45330 } 45331 } 45332 45333 protected void composeEpisodeOfCare(String name, EpisodeOfCare element) throws IOException { 45334 if (element != null) { 45335 prop("resourceType", name); 45336 composeEpisodeOfCareInner(element); 45337 } 45338 } 45339 45340 protected void composeEpisodeOfCareInner(EpisodeOfCare element) throws IOException { 45341 composeDomainResourceElements(element); 45342 if (element.hasIdentifier()) { 45343 openArray("identifier"); 45344 for (Identifier e : element.getIdentifier()) 45345 composeIdentifier(null, e); 45346 closeArray(); 45347 } 45348 ; 45349 if (element.hasStatusElement()) { 45350 composeEnumerationCore("status", element.getStatusElement(), new EpisodeOfCare.EpisodeOfCareStatusEnumFactory(), 45351 false); 45352 composeEnumerationExtras("status", element.getStatusElement(), new EpisodeOfCare.EpisodeOfCareStatusEnumFactory(), 45353 false); 45354 } 45355 if (element.hasStatusHistory()) { 45356 openArray("statusHistory"); 45357 for (EpisodeOfCare.EpisodeOfCareStatusHistoryComponent e : element.getStatusHistory()) 45358 composeEpisodeOfCareEpisodeOfCareStatusHistoryComponent(null, e); 45359 closeArray(); 45360 } 45361 ; 45362 if (element.hasType()) { 45363 openArray("type"); 45364 for (CodeableConcept e : element.getType()) 45365 composeCodeableConcept(null, e); 45366 closeArray(); 45367 } 45368 ; 45369 if (element.hasDiagnosis()) { 45370 openArray("diagnosis"); 45371 for (EpisodeOfCare.DiagnosisComponent e : element.getDiagnosis()) 45372 composeEpisodeOfCareDiagnosisComponent(null, e); 45373 closeArray(); 45374 } 45375 ; 45376 if (element.hasPatient()) { 45377 composeReference("patient", element.getPatient()); 45378 } 45379 if (element.hasManagingOrganization()) { 45380 composeReference("managingOrganization", element.getManagingOrganization()); 45381 } 45382 if (element.hasPeriod()) { 45383 composePeriod("period", element.getPeriod()); 45384 } 45385 if (element.hasReferralRequest()) { 45386 openArray("referralRequest"); 45387 for (Reference e : element.getReferralRequest()) 45388 composeReference(null, e); 45389 closeArray(); 45390 } 45391 ; 45392 if (element.hasCareManager()) { 45393 composeReference("careManager", element.getCareManager()); 45394 } 45395 if (element.hasTeam()) { 45396 openArray("team"); 45397 for (Reference e : element.getTeam()) 45398 composeReference(null, e); 45399 closeArray(); 45400 } 45401 ; 45402 if (element.hasAccount()) { 45403 openArray("account"); 45404 for (Reference e : element.getAccount()) 45405 composeReference(null, e); 45406 closeArray(); 45407 } 45408 ; 45409 } 45410 45411 protected void composeEpisodeOfCareEpisodeOfCareStatusHistoryComponent(String name, 45412 EpisodeOfCare.EpisodeOfCareStatusHistoryComponent element) throws IOException { 45413 if (element != null) { 45414 open(name); 45415 composeEpisodeOfCareEpisodeOfCareStatusHistoryComponentInner(element); 45416 close(); 45417 } 45418 } 45419 45420 protected void composeEpisodeOfCareEpisodeOfCareStatusHistoryComponentInner( 45421 EpisodeOfCare.EpisodeOfCareStatusHistoryComponent element) throws IOException { 45422 composeBackbone(element); 45423 if (element.hasStatusElement()) { 45424 composeEnumerationCore("status", element.getStatusElement(), new EpisodeOfCare.EpisodeOfCareStatusEnumFactory(), 45425 false); 45426 composeEnumerationExtras("status", element.getStatusElement(), new EpisodeOfCare.EpisodeOfCareStatusEnumFactory(), 45427 false); 45428 } 45429 if (element.hasPeriod()) { 45430 composePeriod("period", element.getPeriod()); 45431 } 45432 } 45433 45434 protected void composeEpisodeOfCareDiagnosisComponent(String name, EpisodeOfCare.DiagnosisComponent element) 45435 throws IOException { 45436 if (element != null) { 45437 open(name); 45438 composeEpisodeOfCareDiagnosisComponentInner(element); 45439 close(); 45440 } 45441 } 45442 45443 protected void composeEpisodeOfCareDiagnosisComponentInner(EpisodeOfCare.DiagnosisComponent element) 45444 throws IOException { 45445 composeBackbone(element); 45446 if (element.hasCondition()) { 45447 composeReference("condition", element.getCondition()); 45448 } 45449 if (element.hasRole()) { 45450 composeCodeableConcept("role", element.getRole()); 45451 } 45452 if (element.hasRankElement()) { 45453 composePositiveIntCore("rank", element.getRankElement(), false); 45454 composePositiveIntExtras("rank", element.getRankElement(), false); 45455 } 45456 } 45457 45458 protected void composeEventDefinition(String name, EventDefinition element) throws IOException { 45459 if (element != null) { 45460 prop("resourceType", name); 45461 composeEventDefinitionInner(element); 45462 } 45463 } 45464 45465 protected void composeEventDefinitionInner(EventDefinition element) throws IOException { 45466 composeDomainResourceElements(element); 45467 if (element.hasUrlElement()) { 45468 composeUriCore("url", element.getUrlElement(), false); 45469 composeUriExtras("url", element.getUrlElement(), false); 45470 } 45471 if (element.hasIdentifier()) { 45472 openArray("identifier"); 45473 for (Identifier e : element.getIdentifier()) 45474 composeIdentifier(null, e); 45475 closeArray(); 45476 } 45477 ; 45478 if (element.hasVersionElement()) { 45479 composeStringCore("version", element.getVersionElement(), false); 45480 composeStringExtras("version", element.getVersionElement(), false); 45481 } 45482 if (element.hasNameElement()) { 45483 composeStringCore("name", element.getNameElement(), false); 45484 composeStringExtras("name", element.getNameElement(), false); 45485 } 45486 if (element.hasTitleElement()) { 45487 composeStringCore("title", element.getTitleElement(), false); 45488 composeStringExtras("title", element.getTitleElement(), false); 45489 } 45490 if (element.hasSubtitleElement()) { 45491 composeStringCore("subtitle", element.getSubtitleElement(), false); 45492 composeStringExtras("subtitle", element.getSubtitleElement(), false); 45493 } 45494 if (element.hasStatusElement()) { 45495 composeEnumerationCore("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 45496 false); 45497 composeEnumerationExtras("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 45498 false); 45499 } 45500 if (element.hasExperimentalElement()) { 45501 composeBooleanCore("experimental", element.getExperimentalElement(), false); 45502 composeBooleanExtras("experimental", element.getExperimentalElement(), false); 45503 } 45504 if (element.hasSubject()) { 45505 composeType("subject", element.getSubject()); 45506 } 45507 if (element.hasDateElement()) { 45508 composeDateTimeCore("date", element.getDateElement(), false); 45509 composeDateTimeExtras("date", element.getDateElement(), false); 45510 } 45511 if (element.hasPublisherElement()) { 45512 composeStringCore("publisher", element.getPublisherElement(), false); 45513 composeStringExtras("publisher", element.getPublisherElement(), false); 45514 } 45515 if (element.hasContact()) { 45516 openArray("contact"); 45517 for (ContactDetail e : element.getContact()) 45518 composeContactDetail(null, e); 45519 closeArray(); 45520 } 45521 ; 45522 if (element.hasDescriptionElement()) { 45523 composeMarkdownCore("description", element.getDescriptionElement(), false); 45524 composeMarkdownExtras("description", element.getDescriptionElement(), false); 45525 } 45526 if (element.hasUseContext()) { 45527 openArray("useContext"); 45528 for (UsageContext e : element.getUseContext()) 45529 composeUsageContext(null, e); 45530 closeArray(); 45531 } 45532 ; 45533 if (element.hasJurisdiction()) { 45534 openArray("jurisdiction"); 45535 for (CodeableConcept e : element.getJurisdiction()) 45536 composeCodeableConcept(null, e); 45537 closeArray(); 45538 } 45539 ; 45540 if (element.hasPurposeElement()) { 45541 composeMarkdownCore("purpose", element.getPurposeElement(), false); 45542 composeMarkdownExtras("purpose", element.getPurposeElement(), false); 45543 } 45544 if (element.hasUsageElement()) { 45545 composeStringCore("usage", element.getUsageElement(), false); 45546 composeStringExtras("usage", element.getUsageElement(), false); 45547 } 45548 if (element.hasCopyrightElement()) { 45549 composeMarkdownCore("copyright", element.getCopyrightElement(), false); 45550 composeMarkdownExtras("copyright", element.getCopyrightElement(), false); 45551 } 45552 if (element.hasApprovalDateElement()) { 45553 composeDateCore("approvalDate", element.getApprovalDateElement(), false); 45554 composeDateExtras("approvalDate", element.getApprovalDateElement(), false); 45555 } 45556 if (element.hasLastReviewDateElement()) { 45557 composeDateCore("lastReviewDate", element.getLastReviewDateElement(), false); 45558 composeDateExtras("lastReviewDate", element.getLastReviewDateElement(), false); 45559 } 45560 if (element.hasEffectivePeriod()) { 45561 composePeriod("effectivePeriod", element.getEffectivePeriod()); 45562 } 45563 if (element.hasTopic()) { 45564 openArray("topic"); 45565 for (CodeableConcept e : element.getTopic()) 45566 composeCodeableConcept(null, e); 45567 closeArray(); 45568 } 45569 ; 45570 if (element.hasAuthor()) { 45571 openArray("author"); 45572 for (ContactDetail e : element.getAuthor()) 45573 composeContactDetail(null, e); 45574 closeArray(); 45575 } 45576 ; 45577 if (element.hasEditor()) { 45578 openArray("editor"); 45579 for (ContactDetail e : element.getEditor()) 45580 composeContactDetail(null, e); 45581 closeArray(); 45582 } 45583 ; 45584 if (element.hasReviewer()) { 45585 openArray("reviewer"); 45586 for (ContactDetail e : element.getReviewer()) 45587 composeContactDetail(null, e); 45588 closeArray(); 45589 } 45590 ; 45591 if (element.hasEndorser()) { 45592 openArray("endorser"); 45593 for (ContactDetail e : element.getEndorser()) 45594 composeContactDetail(null, e); 45595 closeArray(); 45596 } 45597 ; 45598 if (element.hasRelatedArtifact()) { 45599 openArray("relatedArtifact"); 45600 for (RelatedArtifact e : element.getRelatedArtifact()) 45601 composeRelatedArtifact(null, e); 45602 closeArray(); 45603 } 45604 ; 45605 if (element.hasTrigger()) { 45606 openArray("trigger"); 45607 for (TriggerDefinition e : element.getTrigger()) 45608 composeTriggerDefinition(null, e); 45609 closeArray(); 45610 } 45611 ; 45612 } 45613 45614 protected void composeEvidence(String name, Evidence element) throws IOException { 45615 if (element != null) { 45616 prop("resourceType", name); 45617 composeEvidenceInner(element); 45618 } 45619 } 45620 45621 protected void composeEvidenceInner(Evidence element) throws IOException { 45622 composeDomainResourceElements(element); 45623 if (element.hasUrlElement()) { 45624 composeUriCore("url", element.getUrlElement(), false); 45625 composeUriExtras("url", element.getUrlElement(), false); 45626 } 45627 if (element.hasIdentifier()) { 45628 openArray("identifier"); 45629 for (Identifier e : element.getIdentifier()) 45630 composeIdentifier(null, e); 45631 closeArray(); 45632 } 45633 ; 45634 if (element.hasVersionElement()) { 45635 composeStringCore("version", element.getVersionElement(), false); 45636 composeStringExtras("version", element.getVersionElement(), false); 45637 } 45638 if (element.hasNameElement()) { 45639 composeStringCore("name", element.getNameElement(), false); 45640 composeStringExtras("name", element.getNameElement(), false); 45641 } 45642 if (element.hasTitleElement()) { 45643 composeStringCore("title", element.getTitleElement(), false); 45644 composeStringExtras("title", element.getTitleElement(), false); 45645 } 45646 if (element.hasShortTitleElement()) { 45647 composeStringCore("shortTitle", element.getShortTitleElement(), false); 45648 composeStringExtras("shortTitle", element.getShortTitleElement(), false); 45649 } 45650 if (element.hasSubtitleElement()) { 45651 composeStringCore("subtitle", element.getSubtitleElement(), false); 45652 composeStringExtras("subtitle", element.getSubtitleElement(), false); 45653 } 45654 if (element.hasStatusElement()) { 45655 composeEnumerationCore("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 45656 false); 45657 composeEnumerationExtras("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 45658 false); 45659 } 45660 if (element.hasDateElement()) { 45661 composeDateTimeCore("date", element.getDateElement(), false); 45662 composeDateTimeExtras("date", element.getDateElement(), false); 45663 } 45664 if (element.hasPublisherElement()) { 45665 composeStringCore("publisher", element.getPublisherElement(), false); 45666 composeStringExtras("publisher", element.getPublisherElement(), false); 45667 } 45668 if (element.hasContact()) { 45669 openArray("contact"); 45670 for (ContactDetail e : element.getContact()) 45671 composeContactDetail(null, e); 45672 closeArray(); 45673 } 45674 ; 45675 if (element.hasDescriptionElement()) { 45676 composeMarkdownCore("description", element.getDescriptionElement(), false); 45677 composeMarkdownExtras("description", element.getDescriptionElement(), false); 45678 } 45679 if (element.hasNote()) { 45680 openArray("note"); 45681 for (Annotation e : element.getNote()) 45682 composeAnnotation(null, e); 45683 closeArray(); 45684 } 45685 ; 45686 if (element.hasUseContext()) { 45687 openArray("useContext"); 45688 for (UsageContext e : element.getUseContext()) 45689 composeUsageContext(null, e); 45690 closeArray(); 45691 } 45692 ; 45693 if (element.hasJurisdiction()) { 45694 openArray("jurisdiction"); 45695 for (CodeableConcept e : element.getJurisdiction()) 45696 composeCodeableConcept(null, e); 45697 closeArray(); 45698 } 45699 ; 45700 if (element.hasCopyrightElement()) { 45701 composeMarkdownCore("copyright", element.getCopyrightElement(), false); 45702 composeMarkdownExtras("copyright", element.getCopyrightElement(), false); 45703 } 45704 if (element.hasApprovalDateElement()) { 45705 composeDateCore("approvalDate", element.getApprovalDateElement(), false); 45706 composeDateExtras("approvalDate", element.getApprovalDateElement(), false); 45707 } 45708 if (element.hasLastReviewDateElement()) { 45709 composeDateCore("lastReviewDate", element.getLastReviewDateElement(), false); 45710 composeDateExtras("lastReviewDate", element.getLastReviewDateElement(), false); 45711 } 45712 if (element.hasEffectivePeriod()) { 45713 composePeriod("effectivePeriod", element.getEffectivePeriod()); 45714 } 45715 if (element.hasTopic()) { 45716 openArray("topic"); 45717 for (CodeableConcept e : element.getTopic()) 45718 composeCodeableConcept(null, e); 45719 closeArray(); 45720 } 45721 ; 45722 if (element.hasAuthor()) { 45723 openArray("author"); 45724 for (ContactDetail e : element.getAuthor()) 45725 composeContactDetail(null, e); 45726 closeArray(); 45727 } 45728 ; 45729 if (element.hasEditor()) { 45730 openArray("editor"); 45731 for (ContactDetail e : element.getEditor()) 45732 composeContactDetail(null, e); 45733 closeArray(); 45734 } 45735 ; 45736 if (element.hasReviewer()) { 45737 openArray("reviewer"); 45738 for (ContactDetail e : element.getReviewer()) 45739 composeContactDetail(null, e); 45740 closeArray(); 45741 } 45742 ; 45743 if (element.hasEndorser()) { 45744 openArray("endorser"); 45745 for (ContactDetail e : element.getEndorser()) 45746 composeContactDetail(null, e); 45747 closeArray(); 45748 } 45749 ; 45750 if (element.hasRelatedArtifact()) { 45751 openArray("relatedArtifact"); 45752 for (RelatedArtifact e : element.getRelatedArtifact()) 45753 composeRelatedArtifact(null, e); 45754 closeArray(); 45755 } 45756 ; 45757 if (element.hasExposureBackground()) { 45758 composeReference("exposureBackground", element.getExposureBackground()); 45759 } 45760 if (element.hasExposureVariant()) { 45761 openArray("exposureVariant"); 45762 for (Reference e : element.getExposureVariant()) 45763 composeReference(null, e); 45764 closeArray(); 45765 } 45766 ; 45767 if (element.hasOutcome()) { 45768 openArray("outcome"); 45769 for (Reference e : element.getOutcome()) 45770 composeReference(null, e); 45771 closeArray(); 45772 } 45773 ; 45774 } 45775 45776 protected void composeEvidenceVariable(String name, EvidenceVariable element) throws IOException { 45777 if (element != null) { 45778 prop("resourceType", name); 45779 composeEvidenceVariableInner(element); 45780 } 45781 } 45782 45783 protected void composeEvidenceVariableInner(EvidenceVariable element) throws IOException { 45784 composeDomainResourceElements(element); 45785 if (element.hasUrlElement()) { 45786 composeUriCore("url", element.getUrlElement(), false); 45787 composeUriExtras("url", element.getUrlElement(), false); 45788 } 45789 if (element.hasIdentifier()) { 45790 openArray("identifier"); 45791 for (Identifier e : element.getIdentifier()) 45792 composeIdentifier(null, e); 45793 closeArray(); 45794 } 45795 ; 45796 if (element.hasVersionElement()) { 45797 composeStringCore("version", element.getVersionElement(), false); 45798 composeStringExtras("version", element.getVersionElement(), false); 45799 } 45800 if (element.hasNameElement()) { 45801 composeStringCore("name", element.getNameElement(), false); 45802 composeStringExtras("name", element.getNameElement(), false); 45803 } 45804 if (element.hasTitleElement()) { 45805 composeStringCore("title", element.getTitleElement(), false); 45806 composeStringExtras("title", element.getTitleElement(), false); 45807 } 45808 if (element.hasShortTitleElement()) { 45809 composeStringCore("shortTitle", element.getShortTitleElement(), false); 45810 composeStringExtras("shortTitle", element.getShortTitleElement(), false); 45811 } 45812 if (element.hasSubtitleElement()) { 45813 composeStringCore("subtitle", element.getSubtitleElement(), false); 45814 composeStringExtras("subtitle", element.getSubtitleElement(), false); 45815 } 45816 if (element.hasStatusElement()) { 45817 composeEnumerationCore("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 45818 false); 45819 composeEnumerationExtras("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 45820 false); 45821 } 45822 if (element.hasDateElement()) { 45823 composeDateTimeCore("date", element.getDateElement(), false); 45824 composeDateTimeExtras("date", element.getDateElement(), false); 45825 } 45826 if (element.hasPublisherElement()) { 45827 composeStringCore("publisher", element.getPublisherElement(), false); 45828 composeStringExtras("publisher", element.getPublisherElement(), false); 45829 } 45830 if (element.hasContact()) { 45831 openArray("contact"); 45832 for (ContactDetail e : element.getContact()) 45833 composeContactDetail(null, e); 45834 closeArray(); 45835 } 45836 ; 45837 if (element.hasDescriptionElement()) { 45838 composeMarkdownCore("description", element.getDescriptionElement(), false); 45839 composeMarkdownExtras("description", element.getDescriptionElement(), false); 45840 } 45841 if (element.hasNote()) { 45842 openArray("note"); 45843 for (Annotation e : element.getNote()) 45844 composeAnnotation(null, e); 45845 closeArray(); 45846 } 45847 ; 45848 if (element.hasUseContext()) { 45849 openArray("useContext"); 45850 for (UsageContext e : element.getUseContext()) 45851 composeUsageContext(null, e); 45852 closeArray(); 45853 } 45854 ; 45855 if (element.hasJurisdiction()) { 45856 openArray("jurisdiction"); 45857 for (CodeableConcept e : element.getJurisdiction()) 45858 composeCodeableConcept(null, e); 45859 closeArray(); 45860 } 45861 ; 45862 if (element.hasCopyrightElement()) { 45863 composeMarkdownCore("copyright", element.getCopyrightElement(), false); 45864 composeMarkdownExtras("copyright", element.getCopyrightElement(), false); 45865 } 45866 if (element.hasApprovalDateElement()) { 45867 composeDateCore("approvalDate", element.getApprovalDateElement(), false); 45868 composeDateExtras("approvalDate", element.getApprovalDateElement(), false); 45869 } 45870 if (element.hasLastReviewDateElement()) { 45871 composeDateCore("lastReviewDate", element.getLastReviewDateElement(), false); 45872 composeDateExtras("lastReviewDate", element.getLastReviewDateElement(), false); 45873 } 45874 if (element.hasEffectivePeriod()) { 45875 composePeriod("effectivePeriod", element.getEffectivePeriod()); 45876 } 45877 if (element.hasTopic()) { 45878 openArray("topic"); 45879 for (CodeableConcept e : element.getTopic()) 45880 composeCodeableConcept(null, e); 45881 closeArray(); 45882 } 45883 ; 45884 if (element.hasAuthor()) { 45885 openArray("author"); 45886 for (ContactDetail e : element.getAuthor()) 45887 composeContactDetail(null, e); 45888 closeArray(); 45889 } 45890 ; 45891 if (element.hasEditor()) { 45892 openArray("editor"); 45893 for (ContactDetail e : element.getEditor()) 45894 composeContactDetail(null, e); 45895 closeArray(); 45896 } 45897 ; 45898 if (element.hasReviewer()) { 45899 openArray("reviewer"); 45900 for (ContactDetail e : element.getReviewer()) 45901 composeContactDetail(null, e); 45902 closeArray(); 45903 } 45904 ; 45905 if (element.hasEndorser()) { 45906 openArray("endorser"); 45907 for (ContactDetail e : element.getEndorser()) 45908 composeContactDetail(null, e); 45909 closeArray(); 45910 } 45911 ; 45912 if (element.hasRelatedArtifact()) { 45913 openArray("relatedArtifact"); 45914 for (RelatedArtifact e : element.getRelatedArtifact()) 45915 composeRelatedArtifact(null, e); 45916 closeArray(); 45917 } 45918 ; 45919 if (element.hasTypeElement()) { 45920 composeEnumerationCore("type", element.getTypeElement(), new EvidenceVariable.EvidenceVariableTypeEnumFactory(), 45921 false); 45922 composeEnumerationExtras("type", element.getTypeElement(), new EvidenceVariable.EvidenceVariableTypeEnumFactory(), 45923 false); 45924 } 45925 if (element.hasCharacteristic()) { 45926 openArray("characteristic"); 45927 for (EvidenceVariable.EvidenceVariableCharacteristicComponent e : element.getCharacteristic()) 45928 composeEvidenceVariableEvidenceVariableCharacteristicComponent(null, e); 45929 closeArray(); 45930 } 45931 ; 45932 } 45933 45934 protected void composeEvidenceVariableEvidenceVariableCharacteristicComponent(String name, 45935 EvidenceVariable.EvidenceVariableCharacteristicComponent element) throws IOException { 45936 if (element != null) { 45937 open(name); 45938 composeEvidenceVariableEvidenceVariableCharacteristicComponentInner(element); 45939 close(); 45940 } 45941 } 45942 45943 protected void composeEvidenceVariableEvidenceVariableCharacteristicComponentInner( 45944 EvidenceVariable.EvidenceVariableCharacteristicComponent element) throws IOException { 45945 composeBackbone(element); 45946 if (element.hasDescriptionElement()) { 45947 composeStringCore("description", element.getDescriptionElement(), false); 45948 composeStringExtras("description", element.getDescriptionElement(), false); 45949 } 45950 if (element.hasDefinition()) { 45951 composeType("definition", element.getDefinition()); 45952 } 45953 if (element.hasUsageContext()) { 45954 openArray("usageContext"); 45955 for (UsageContext e : element.getUsageContext()) 45956 composeUsageContext(null, e); 45957 closeArray(); 45958 } 45959 ; 45960 if (element.hasExcludeElement()) { 45961 composeBooleanCore("exclude", element.getExcludeElement(), false); 45962 composeBooleanExtras("exclude", element.getExcludeElement(), false); 45963 } 45964 if (element.hasParticipantEffective()) { 45965 composeType("participantEffective", element.getParticipantEffective()); 45966 } 45967 if (element.hasTimeFromStart()) { 45968 composeDuration("timeFromStart", element.getTimeFromStart()); 45969 } 45970 if (element.hasGroupMeasureElement()) { 45971 composeEnumerationCore("groupMeasure", element.getGroupMeasureElement(), 45972 new EvidenceVariable.GroupMeasureEnumFactory(), false); 45973 composeEnumerationExtras("groupMeasure", element.getGroupMeasureElement(), 45974 new EvidenceVariable.GroupMeasureEnumFactory(), false); 45975 } 45976 } 45977 45978 protected void composeExampleScenario(String name, ExampleScenario element) throws IOException { 45979 if (element != null) { 45980 prop("resourceType", name); 45981 composeExampleScenarioInner(element); 45982 } 45983 } 45984 45985 protected void composeExampleScenarioInner(ExampleScenario element) throws IOException { 45986 composeDomainResourceElements(element); 45987 if (element.hasUrlElement()) { 45988 composeUriCore("url", element.getUrlElement(), false); 45989 composeUriExtras("url", element.getUrlElement(), false); 45990 } 45991 if (element.hasIdentifier()) { 45992 openArray("identifier"); 45993 for (Identifier e : element.getIdentifier()) 45994 composeIdentifier(null, e); 45995 closeArray(); 45996 } 45997 ; 45998 if (element.hasVersionElement()) { 45999 composeStringCore("version", element.getVersionElement(), false); 46000 composeStringExtras("version", element.getVersionElement(), false); 46001 } 46002 if (element.hasNameElement()) { 46003 composeStringCore("name", element.getNameElement(), false); 46004 composeStringExtras("name", element.getNameElement(), false); 46005 } 46006 if (element.hasStatusElement()) { 46007 composeEnumerationCore("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 46008 false); 46009 composeEnumerationExtras("status", element.getStatusElement(), new Enumerations.PublicationStatusEnumFactory(), 46010 false); 46011 } 46012 if (element.hasExperimentalElement()) { 46013 composeBooleanCore("experimental", element.getExperimentalElement(), false); 46014 composeBooleanExtras("experimental", element.getExperimentalElement(), false); 46015 } 46016 if (element.hasDateElement()) { 46017 composeDateTimeCore("date", element.getDateElement(), false); 46018 composeDateTimeExtras("date", element.getDateElement(), false); 46019 } 46020 if (element.hasPublisherElement()) { 46021 composeStringCore("publisher", element.getPublisherElement(), false); 46022 composeStringExtras("publisher", element.getPublisherElement(), false); 46023 } 46024 if (element.hasContact()) { 46025 openArray("contact"); 46026 for (ContactDetail e : element.getContact()) 46027 composeContactDetail(null, e); 46028 closeArray(); 46029 } 46030 ; 46031 if (element.hasUseContext()) { 46032 openArray("useContext"); 46033 for (UsageContext e : element.getUseContext()) 46034 composeUsageContext(null, e); 46035 closeArray(); 46036 } 46037 ; 46038 if (element.hasJurisdiction()) { 46039 openArray("jurisdiction"); 46040 for (CodeableConcept e : element.getJurisdiction()) 46041 composeCodeableConcept(null, e); 46042 closeArray(); 46043 } 46044 ; 46045 if (element.hasCopyrightElement()) { 46046 composeMarkdownCore("copyright", element.getCopyrightElement(), false); 46047 composeMarkdownExtras("copyright", element.getCopyrightElement(), false); 46048 } 46049 if (element.hasPurposeElement()) { 46050 composeMarkdownCore("purpose", element.getPurposeElement(), false); 46051 composeMarkdownExtras("purpose", element.getPurposeElement(), false); 46052 } 46053 if (element.hasActor()) { 46054 openArray("actor"); 46055 for (ExampleScenario.ExampleScenarioActorComponent e : element.getActor()) 46056 composeExampleScenarioExampleScenarioActorComponent(null, e); 46057 closeArray(); 46058 } 46059 ; 46060 if (element.hasInstance()) { 46061 openArray("instance"); 46062 for (ExampleScenario.ExampleScenarioInstanceComponent e : element.getInstance()) 46063 composeExampleScenarioExampleScenarioInstanceComponent(null, e); 46064 closeArray(); 46065 } 46066 ; 46067 if (element.hasProcess()) { 46068 openArray("process"); 46069 for (ExampleScenario.ExampleScenarioProcessComponent e : element.getProcess()) 46070 composeExampleScenarioExampleScenarioProcessComponent(null, e); 46071 closeArray(); 46072 } 46073 ; 46074 if (element.hasWorkflow()) { 46075 openArray("workflow"); 46076 for (CanonicalType e : element.getWorkflow()) 46077 composeCanonicalCore(null, e, true); 46078 closeArray(); 46079 if (anyHasExtras(element.getWorkflow())) { 46080 openArray("_workflow"); 46081 for (CanonicalType e : element.getWorkflow()) 46082 composeCanonicalExtras(null, e, true); 46083 closeArray(); 46084 } 46085 } 46086 ; 46087 } 46088 46089 protected void composeExampleScenarioExampleScenarioActorComponent(String name, 46090 ExampleScenario.ExampleScenarioActorComponent element) throws IOException { 46091 if (element != null) { 46092 open(name); 46093 composeExampleScenarioExampleScenarioActorComponentInner(element); 46094 close(); 46095 } 46096 } 46097 46098 protected void composeExampleScenarioExampleScenarioActorComponentInner( 46099 ExampleScenario.ExampleScenarioActorComponent element) throws IOException { 46100 composeBackbone(element); 46101 if (element.hasActorIdElement()) { 46102 composeStringCore("actorId", element.getActorIdElement(), false); 46103 composeStringExtras("actorId", element.getActorIdElement(), false); 46104 } 46105 if (element.hasTypeElement()) { 46106 composeEnumerationCore("type", element.getTypeElement(), 46107 new ExampleScenario.ExampleScenarioActorTypeEnumFactory(), false); 46108 composeEnumerationExtras("type", element.getTypeElement(), 46109 new ExampleScenario.ExampleScenarioActorTypeEnumFactory(), false); 46110 } 46111 if (element.hasNameElement()) { 46112 composeStringCore("name", element.getNameElement(), false); 46113 composeStringExtras("name", element.getNameElement(), false); 46114 } 46115 if (element.hasDescriptionElement()) { 46116 composeMarkdownCore("description", element.getDescriptionElement(), false); 46117 composeMarkdownExtras("description", element.getDescriptionElement(), false); 46118 } 46119 } 46120 46121 protected void composeExampleScenarioExampleScenarioInstanceComponent(String name, 46122 ExampleScenario.ExampleScenarioInstanceComponent element) throws IOException { 46123 if (element != null) { 46124 open(name); 46125 composeExampleScenarioExampleScenarioInstanceComponentInner(element); 46126 close(); 46127 } 46128 } 46129 46130 protected void composeExampleScenarioExampleScenarioInstanceComponentInner( 46131 ExampleScenario.ExampleScenarioInstanceComponent element) throws IOException { 46132 composeBackbone(element); 46133 if (element.hasResourceIdElement()) { 46134 composeStringCore("resourceId", element.getResourceIdElement(), false); 46135 composeStringExtras("resourceId", element.getResourceIdElement(), false); 46136 } 46137 if (element.hasResourceTypeElement()) { 46138 composeEnumerationCore("resourceType", element.getResourceTypeElement(), 46139 new ExampleScenario.FHIRResourceTypeEnumFactory(), false); 46140 composeEnumerationExtras("resourceType", element.getResourceTypeElement(), 46141 new ExampleScenario.FHIRResourceTypeEnumFactory(), false); 46142 } 46143 if (element.hasNameElement()) { 46144 composeStringCore("name", element.getNameElement(), false); 46145 composeStringExtras("name", element.getNameElement(), false); 46146 } 46147 if (element.hasDescriptionElement()) { 46148 composeMarkdownCore("description", element.getDescriptionElement(), false); 46149 composeMarkdownExtras("description", element.getDescriptionElement(), false); 46150 } 46151 if (element.hasVersion()) { 46152 openArray("version"); 46153 for (ExampleScenario.ExampleScenarioInstanceVersionComponent e : element.getVersion()) 46154 composeExampleScenarioExampleScenarioInstanceVersionComponent(null, e); 46155 closeArray(); 46156 } 46157 ; 46158 if (element.hasContainedInstance()) { 46159 openArray("containedInstance"); 46160 for (ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent e : element.getContainedInstance()) 46161 composeExampleScenarioExampleScenarioInstanceContainedInstanceComponent(null, e); 46162 closeArray(); 46163 } 46164 ; 46165 } 46166 46167 protected void composeExampleScenarioExampleScenarioInstanceVersionComponent(String name, 46168 ExampleScenario.ExampleScenarioInstanceVersionComponent element) throws IOException { 46169 if (element != null) { 46170 open(name); 46171 composeExampleScenarioExampleScenarioInstanceVersionComponentInner(element); 46172 close(); 46173 } 46174 } 46175 46176 protected void composeExampleScenarioExampleScenarioInstanceVersionComponentInner( 46177 ExampleScenario.ExampleScenarioInstanceVersionComponent element) throws IOException { 46178 composeBackbone(element); 46179 if (element.hasVersionIdElement()) { 46180 composeStringCore("versionId", element.getVersionIdElement(), false); 46181 composeStringExtras("versionId", element.getVersionIdElement(), false); 46182 } 46183 if (element.hasDescriptionElement()) { 46184 composeMarkdownCore("description", element.getDescriptionElement(), false); 46185 composeMarkdownExtras("description", element.getDescriptionElement(), false); 46186 } 46187 } 46188 46189 protected void composeExampleScenarioExampleScenarioInstanceContainedInstanceComponent(String name, 46190 ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent element) throws IOException { 46191 if (element != null) { 46192 open(name); 46193 composeExampleScenarioExampleScenarioInstanceContainedInstanceComponentInner(element); 46194 close(); 46195 } 46196 } 46197 46198 protected void composeExampleScenarioExampleScenarioInstanceContainedInstanceComponentInner( 46199 ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent element) throws IOException { 46200 composeBackbone(element); 46201 if (element.hasResourceIdElement()) { 46202 composeStringCore("resourceId", element.getResourceIdElement(), false); 46203 composeStringExtras("resourceId", element.getResourceIdElement(), false); 46204 } 46205 if (element.hasVersionIdElement()) { 46206 composeStringCore("versionId", element.getVersionIdElement(), false); 46207 composeStringExtras("versionId", element.getVersionIdElement(), false); 46208 } 46209 } 46210 46211 protected void composeExampleScenarioExampleScenarioProcessComponent(String name, 46212 ExampleScenario.ExampleScenarioProcessComponent element) throws IOException { 46213 if (element != null) { 46214 open(name); 46215 composeExampleScenarioExampleScenarioProcessComponentInner(element); 46216 close(); 46217 } 46218 } 46219 46220 protected void composeExampleScenarioExampleScenarioProcessComponentInner( 46221 ExampleScenario.ExampleScenarioProcessComponent element) throws IOException { 46222 composeBackbone(element); 46223 if (element.hasTitleElement()) { 46224 composeStringCore("title", element.getTitleElement(), false); 46225 composeStringExtras("title", element.getTitleElement(), false); 46226 } 46227 if (element.hasDescriptionElement()) { 46228 composeMarkdownCore("description", element.getDescriptionElement(), false); 46229 composeMarkdownExtras("description", element.getDescriptionElement(), false); 46230 } 46231 if (element.hasPreConditionsElement()) { 46232 composeMarkdownCore("preConditions", element.getPreConditionsElement(), false); 46233 composeMarkdownExtras("preConditions", element.getPreConditionsElement(), false); 46234 } 46235 if (element.hasPostConditionsElement()) { 46236 composeMarkdownCore("postConditions", element.getPostConditionsElement(), false); 46237 composeMarkdownExtras("postConditions", element.getPostConditionsElement(), false); 46238 } 46239 if (element.hasStep()) { 46240 openArray("step"); 46241 for (ExampleScenario.ExampleScenarioProcessStepComponent e : element.getStep()) 46242 composeExampleScenarioExampleScenarioProcessStepComponent(null, e); 46243 closeArray(); 46244 } 46245 ; 46246 } 46247 46248 protected void composeExampleScenarioExampleScenarioProcessStepComponent(String name, 46249 ExampleScenario.ExampleScenarioProcessStepComponent element) throws IOException { 46250 if (element != null) { 46251 open(name); 46252 composeExampleScenarioExampleScenarioProcessStepComponentInner(element); 46253 close(); 46254 } 46255 } 46256 46257 protected void composeExampleScenarioExampleScenarioProcessStepComponentInner( 46258 ExampleScenario.ExampleScenarioProcessStepComponent element) throws IOException { 46259 composeBackbone(element); 46260 if (element.hasProcess()) { 46261 openArray("process"); 46262 for (ExampleScenario.ExampleScenarioProcessComponent e : element.getProcess()) 46263 composeExampleScenarioExampleScenarioProcessComponent(null, e); 46264 closeArray(); 46265 } 46266 ; 46267 if (element.hasPauseElement()) { 46268 composeBooleanCore("pause", element.getPauseElement(), false); 46269 composeBooleanExtras("pause", element.getPauseElement(), false); 46270 } 46271 if (element.hasOperation()) { 46272 composeExampleScenarioExampleScenarioProcessStepOperationComponent("operation", element.getOperation()); 46273 } 46274 if (element.hasAlternative()) { 46275 openArray("alternative"); 46276 for (ExampleScenario.ExampleScenarioProcessStepAlternativeComponent e : element.getAlternative()) 46277 composeExampleScenarioExampleScenarioProcessStepAlternativeComponent(null, e); 46278 closeArray(); 46279 } 46280 ; 46281 } 46282 46283 protected void composeExampleScenarioExampleScenarioProcessStepOperationComponent(String name, 46284 ExampleScenario.ExampleScenarioProcessStepOperationComponent element) throws IOException { 46285 if (element != null) { 46286 open(name); 46287 composeExampleScenarioExampleScenarioProcessStepOperationComponentInner(element); 46288 close(); 46289 } 46290 } 46291 46292 protected void composeExampleScenarioExampleScenarioProcessStepOperationComponentInner( 46293 ExampleScenario.ExampleScenarioProcessStepOperationComponent element) throws IOException { 46294 composeBackbone(element); 46295 if (element.hasNumberElement()) { 46296 composeStringCore("number", element.getNumberElement(), false); 46297 composeStringExtras("number", element.getNumberElement(), false); 46298 } 46299 if (element.hasTypeElement()) { 46300 composeStringCore("type", element.getTypeElement(), false); 46301 composeStringExtras("type", element.getTypeElement(), false); 46302 } 46303 if (element.hasNameElement()) { 46304 composeStringCore("name", element.getNameElement(), false); 46305 composeStringExtras("name", element.getNameElement(), false); 46306 } 46307 if (element.hasInitiatorElement()) { 46308 composeStringCore("initiator", element.getInitiatorElement(), false); 46309 composeStringExtras("initiator", element.getInitiatorElement(), false); 46310 } 46311 if (element.hasReceiverElement()) { 46312 composeStringCore("receiver", element.getReceiverElement(), false); 46313 composeStringExtras("receiver", element.getReceiverElement(), false); 46314 } 46315 if (element.hasDescriptionElement()) { 46316 composeMarkdownCore("description", element.getDescriptionElement(), false); 46317 composeMarkdownExtras("description", element.getDescriptionElement(), false); 46318 } 46319 if (element.hasInitiatorActiveElement()) { 46320 composeBooleanCore("initiatorActive", element.getInitiatorActiveElement(), false); 46321 composeBooleanExtras("initiatorActive", element.getInitiatorActiveElement(), false); 46322 } 46323 if (element.hasReceiverActiveElement()) { 46324 composeBooleanCore("receiverActive", element.getReceiverActiveElement(), false); 46325 composeBooleanExtras("receiverActive", element.getReceiverActiveElement(), false); 46326 } 46327 if (element.hasRequest()) { 46328 composeExampleScenarioExampleScenarioInstanceContainedInstanceComponent("request", element.getRequest()); 46329 } 46330 if (element.hasResponse()) { 46331 composeExampleScenarioExampleScenarioInstanceContainedInstanceComponent("response", element.getResponse()); 46332 } 46333 } 46334 46335 protected void composeExampleScenarioExampleScenarioProcessStepAlternativeComponent(String name, 46336 ExampleScenario.ExampleScenarioProcessStepAlternativeComponent element) throws IOException { 46337 if (element != null) { 46338 open(name); 46339 composeExampleScenarioExampleScenarioProcessStepAlternativeComponentInner(element); 46340 close(); 46341 } 46342 } 46343 46344 protected void composeExampleScenarioExampleScenarioProcessStepAlternativeComponentInner( 46345 ExampleScenario.ExampleScenarioProcessStepAlternativeComponent element) throws IOException { 46346 composeBackbone(element); 46347 if (element.hasTitleElement()) { 46348 composeStringCore("title", element.getTitleElement(), false); 46349 composeStringExtras("title", element.getTitleElement(), false); 46350 } 46351 if (element.hasDescriptionElement()) { 46352 composeMarkdownCore("description", element.getDescriptionElement(), false); 46353 composeMarkdownExtras("description", element.getDescriptionElement(), false); 46354 } 46355 if (element.hasStep()) { 46356 openArray("step"); 46357 for (ExampleScenario.ExampleScenarioProcessStepComponent e : element.getStep()) 46358 composeExampleScenarioExampleScenarioProcessStepComponent(null, e); 46359 closeArray(); 46360 } 46361 ; 46362 } 46363 46364 protected void composeExplanationOfBenefit(String name, ExplanationOfBenefit element) throws IOException { 46365 if (element != null) { 46366 prop("resourceType", name); 46367 composeExplanationOfBenefitInner(element); 46368 } 46369 } 46370 46371 protected void composeExplanationOfBenefitInner(ExplanationOfBenefit element) throws IOException { 46372 composeDomainResourceElements(element); 46373 if (element.hasIdentifier()) { 46374 openArray("identifier"); 46375 for (Identifier e : element.getIdentifier()) 46376 composeIdentifier(null, e); 46377 closeArray(); 46378 } 46379 ;