dss/src/main/java/gov/samhsa/c2s/dss/service/document/redact/impl/postredactionlevel/DocumentCleanupForNoEntryAndNoSection.java
private void addEmptySectionComponentIfNoneExists(Document xmlDocument)
            throws DocumentAccessorException {
        final Optional<Node> structuredBody = documentAccessor.getNode(
                xmlDocument, XPATH_NO_COMPONENT_IN_STRUCTURED_BODY);
        structuredBody.ifPresent(sb -> {
            final Element emptyComponent = xmlDocument.createElementNS(
                    URN_HL7_V3, TAG_COMPONENT);
            final Element emptySection = xmlDocument.createElementNS(
                    URN_HL7_V3, TAG_SECTION);
            emptyComponent.appendChild(emptySection);
            sb.appendChild(emptyComponent);
        });
    }
/**
     * Adds the empty section component if none exists.
     *
     * @param xmlDocument the xml document
     * @throws DocumentAccessorException the document accessor exception
     */
Adds the empty section component if none exists.
@param xmlDocument the xml document
@throws DocumentAccessorException the document accessor exception
Adds the empty section component if none exists . @param xmlDocument the xml document @throws DocumentAccessorException the document accessor exception
private void addEmptySectionComponentIfNoneExists(Document xmlDocument)
            throws DocumentAccessorException {
        final Optional<Node> structuredBody = documentAccessor.getNode(
                xmlDocument, XPATH_NO_COMPONENT_IN_STRUCTURED_BODY);
        structuredBody.ifPresent(sb -> {
            final Element emptyComponent = xmlDocument.createElementNS(
                    URN_HL7_V3, TAG_COMPONENT);
            final Element emptySection = xmlDocument.createElementNS(
                    URN_HL7_V3, TAG_SECTION);
            emptyComponent.appendChild(emptySection);
            sb.appendChild(emptyComponent);
        });
    }
private void addEmptySectionComponentIfNoneExists ( Document xmlDocument ) throws DocumentAccessorException { final Optional < Node > structuredBody = documentAccessor . getNode ( xmlDocument , XPATH_NO_COMPONENT_IN_STRUCTURED_BODY ) ; structuredBody . ifPresent ( sb -> { final Element emptyComponent = xmlDocument . createElementNS ( URN_HL7_V3 , TAG_COMPONENT ) ; final Element emptySection = xmlDocument . createElementNS ( URN_HL7_V3 , TAG_SECTION ) ; emptyComponent . appendChild ( emptySection ) ; sb . appendChild ( emptyComponent ) ; } ) ; }
Adds the empty section component if none exists.
Adds the empty section component if none exists .