for (IBaseResource next : getContainedResources().getContainedResources()) { IIdType resourceId = getContainedResources().getResourceId(next); theEventWriter.writeStartElement("contained"); encodeResourceToXmlStreamWriter(next, theEventWriter, true, false, fixContainedResourceId(resourceId.getValue()));
public void assignIdsToContainedResources() { if (getResourceList() != null) { for (IBaseResource nextResource : getResourceList()) { if (getResourceToIdMap().get(nextResource) != null) { ids.add(getResourceToIdMap().get(nextResource).getValue()); continue; for (IBaseResource nextResource : getResourceList()) { while (getResourceToIdMap().get(nextResource) == null) { String nextCandidate = "#" + myNextContainedId; myNextContainedId++; getResourceToIdMap().put(nextResource, new IdDt(nextCandidate));
if (theContainedResource || getContainedResources().isEmpty()) { continue;
if (theContainedResource || getContainedResources().isEmpty()) { continue;
List<IBaseResource> containedResources = getContainedResources().getContainedResources(); if (containedResources.size() > 0) { beginArray(theEventWriter, theChildName); IIdType resourceId = getContainedResources().getResourceId(next); encodeResourceToJsonStreamWriter(theResDef, next, theEventWriter, null, true, fixContainedResourceId(resourceId.getValue()), theEncodeContext);
for (IBaseResource next : getContainedResources().getContainedResources()) { IIdType resourceId = getContainedResources().getResourceId(next); theEventWriter.writeStartElement("contained"); encodeResourceToXmlStreamWriter(next, theEventWriter, true, fixContainedResourceId(resourceId.getValue()), theEncodeContext);
String reference = ref.getValue(); if (theRef.getResource() != null) { IIdType containedId = getContainedResources().getResourceId(theRef.getResource()); if (containedId != null && !containedId.isEmpty()) { if (containedId.isLocal()) {
nextId = '#' + nextId; theContained.getExistingIdToContainedResource().put(nextId, next); nextId = '#' + nextId; theContained.getExistingIdToContainedResource().put(nextId, next); IBaseResource resource = next.getResource(); if (resource == null && next.getReferenceElement().isLocal()) { if (theContained.hasExistingIdToContainedResource()) { IBaseResource potentialTarget = theContained.getExistingIdToContainedResource().remove(next.getReferenceElement().getValue()); if (potentialTarget != null) { theContained.addContained(next.getReferenceElement(), potentialTarget); containResourcesForEncoding(theContained, potentialTarget, theTarget); if (resource != null) { if (resource.getIdElement().isEmpty() || resource.getIdElement().isLocal()) { if (theContained.getResourceId(resource) != null) { theContained.addContained(resource); if (resource.getIdElement().isLocal() && theContained.hasExistingIdToContainedResource()) { theContained.getExistingIdToContainedResource().remove(resource.getIdElement().getValue());
public void assignIdsToContainedResources() { if (getResourceList() != null) { for (IBaseResource nextResource : getResourceList()) { if (getResourceToIdMap().get(nextResource) != null) { ids.add(getResourceToIdMap().get(nextResource).getValue()); for (IBaseResource nextResource : getResourceList()) { while (getResourceToIdMap().get(nextResource) == null) { String nextCandidate = "#" + myNextContainedId; myNextContainedId++; getResourceToIdMap().put(nextResource, new IdDt(nextCandidate));
protected boolean isChildContained(BaseRuntimeElementDefinition<?> childDef, boolean theIncludedResource) { return (childDef.getChildType() == ChildTypeEnum.CONTAINED_RESOURCES || childDef.getChildType() == ChildTypeEnum.CONTAINED_RESOURCE_LIST) && getContainedResources().isEmpty() == false && theIncludedResource == false; }
public void addContained(IBaseResource theResource) { if (getResourceToIdMap().containsKey(theResource)) { return; } IIdType newId; if (theResource.getIdElement().isLocal()) { newId = theResource.getIdElement(); } else { newId = null; } getResourceToIdMap().put(theResource, newId); getResourceList().add(theResource); }
public List<IBaseResource> getContainedResources() { if (getResourceToIdMap() == null) { return Collections.emptyList(); } return getResourceList(); }
public IIdType getResourceId(IBaseResource theNext) { if (getResourceToIdMap() == null) { return null; } return getResourceToIdMap().get(theNext); }
public void addContained(IIdType theId, IBaseResource theResource) { if (!getResourceToIdMap().containsKey(theResource)) { getResourceToIdMap().put(theResource, theId); getResourceList().add(theResource); } }
protected void containResourcesForEncoding(IBaseResource theResource) { ContainedResources contained = new ContainedResources(); containResourcesForEncoding(contained, theResource, theResource); contained.assignIdsToContainedResources(); myContainedResources = contained; }
List<IBaseResource> containedResources = getContainedResources().getContainedResources(); if (containedResources.size() > 0) { beginArray(theEventWriter, theChildName); IIdType resourceId = getContainedResources().getResourceId(next); encodeResourceToJsonStreamWriter(theResDef, next, theEventWriter, null, true, false, fixContainedResourceId(resourceId.getValue()));
nextId = '#' + nextId; theContained.getExistingIdToContainedResource().put(nextId, next); nextId = '#' + nextId; theContained.getExistingIdToContainedResource().put(nextId, next); IBaseResource resource = next.getResource(); if (resource == null && next.getReferenceElement().isLocal()) { if (theContained.hasExistingIdToContainedResource()) { IBaseResource potentialTarget = theContained.getExistingIdToContainedResource().remove(next.getReferenceElement().getValue()); if (potentialTarget != null) { theContained.addContained(next.getReferenceElement(), potentialTarget); containResourcesForEncoding(theContained, potentialTarget, theTarget); if (resource != null) { if (resource.getIdElement().isEmpty() || resource.getIdElement().isLocal()) { if (theContained.getResourceId(resource) != null) { theContained.addContained(resource); if (resource.getIdElement().isLocal() && theContained.hasExistingIdToContainedResource()) { theContained.getExistingIdToContainedResource().remove(resource.getIdElement().getValue());
String reference = ref.getValue(); if (theRef.getResource() != null) { IIdType containedId = getContainedResources().getResourceId(theRef.getResource()); if (containedId != null && !containedId.isEmpty()) { if (containedId.isLocal()) {
protected boolean isChildContained(BaseRuntimeElementDefinition<?> childDef, boolean theIncludedResource) { return (childDef.getChildType() == ChildTypeEnum.CONTAINED_RESOURCES || childDef.getChildType() == ChildTypeEnum.CONTAINED_RESOURCE_LIST) && getContainedResources().isEmpty() == false && theIncludedResource == false; }
public void addContained(IBaseResource theResource) { if (getResourceToIdMap().containsKey(theResource)) { return; } IIdType newId; if (theResource.getIdElement().isLocal()) { newId = theResource.getIdElement(); } else { newId = null; } getResourceToIdMap().put(theResource, newId); getResourceList().add(theResource); }