@Test public void testTagDocument_Confidentiality_R() throws Exception { final String responseContainer = remExecutionResponseContainer.replace( "@itemAction", REDACT); final String expectedDocumentLevelConfidentiality = R; final String expectedProblemsSectionLevelConfidentiality = R; final String taggedDocument = documentTagger.tagDocument(remC32, responseContainer); final Document doc = documentXmlConverter.loadDocument(taggedDocument); verifyDocumentLevelConfidentiality(doc, expectedDocumentLevelConfidentiality); verifySectionLevelConfidentiality(doc, PROBLEMS_SECTION, expectedProblemsSectionLevelConfidentiality); }
@Override public String tagDocument(String document, String executionResponseContainer) { executionResponseContainer = executionResponseContainer.replace( "<ruleExecutionContainer>", "<ruleExecutionContainer xmlns=\"urn:hl7-org:v3\">"); final String xslUrl = Thread.currentThread().getContextClassLoader() .getResource(TAG_XSL).toString(); final StringURIResolver stringURIResolver = new StringURIResolver(); stringURIResolver.put( URI_RESOLVER_HREF_RULE_EXECUTION_RESPONSE_CONTAINER, executionResponseContainer); stringURIResolver.put(URI_RESOLVER_HREF_DISCLAMER, disclaimerText); final Optional<URIResolver> uriResolver = Optional .of(stringURIResolver); final String taggedDocument = xmlTransformer.transform(document, xslUrl, Optional.empty(), uriResolver); logger.debug("Tagged Document:"); logger.debug(taggedDocument); return taggedDocument; }
DocumentTaggerImpl implements DocumentTagger { @Override public String tagDocument(String document, String executionResponseContainer) { executionResponseContainer = executionResponseContainer.replace( "<ruleExecutionContainer>", "<ruleExecutionContainer xmlns=\"urn:hl7-org:v3\">"); final String xslUrl = Thread.currentThread().getContextClassLoader() .getResource(TAG_XSL).toString(); final StringURIResolver stringURIResolver = new StringURIResolver(); stringURIResolver.put( URI_RESOLVER_HREF_RULE_EXECUTION_RESPONSE_CONTAINER, executionResponseContainer); stringURIResolver.put(URI_RESOLVER_HREF_DISCLAMER, disclaimerText); final Optional<URIResolver> uriResolver = Optional .of(stringURIResolver); final String taggedDocument = xmlTransformer.transform(document, xslUrl, Optional.empty(), uriResolver); logger.debug("Tagged Document:"); logger.debug(taggedDocument); return taggedDocument; } }
DocumentTaggerImpl implements DocumentTagger { @Override public String tagDocument(String document, String executionResponseContainer) { executionResponseContainer = executionResponseContainer.replace( "<ruleExecutionContainer>", "<ruleExecutionContainer xmlns=\"urn:hl7-org:v3\">"); final String xslUrl = Thread.currentThread().getContextClassLoader() .getResource(TAG_XSL).toString(); final StringURIResolver stringURIResolver = new StringURIResolver(); stringURIResolver.put( URI_RESOLVER_HREF_RULE_EXECUTION_RESPONSE_CONTAINER, executionResponseContainer); stringURIResolver.put(URI_RESOLVER_HREF_DISCLAMER, disclaimerText); final Optional<URIResolver> uriResolver = Optional .of(stringURIResolver); final String taggedDocument = xmlTransformer.transform(document, xslUrl, Optional.empty(), uriResolver); logger.debug("Tagged Document:"); logger.debug(taggedDocument); return taggedDocument; } DocumentTaggerImpl(String disclaimerText,
			XmlTransformer xmlTransformer); }
DocumentTaggerImpl implements DocumentTagger { @Override public String tagDocument(String document, String executionResponseContainer) { executionResponseContainer = executionResponseContainer.replace( "<ruleExecutionContainer>", "<ruleExecutionContainer xmlns=\"urn:hl7-org:v3\">"); final String xslUrl = Thread.currentThread().getContextClassLoader() .getResource(TAG_XSL).toString(); final StringURIResolver stringURIResolver = new StringURIResolver(); stringURIResolver.put( URI_RESOLVER_HREF_RULE_EXECUTION_RESPONSE_CONTAINER, executionResponseContainer); stringURIResolver.put(URI_RESOLVER_HREF_DISCLAMER, disclaimerText); final Optional<URIResolver> uriResolver = Optional .of(stringURIResolver); final String taggedDocument = xmlTransformer.transform(document, xslUrl, Optional.empty(), uriResolver); logger.debug("Tagged Document:"); logger.debug(taggedDocument); return taggedDocument; } DocumentTaggerImpl(String disclaimerText,
			XmlTransformer xmlTransformer); @Override String tagDocument(String document, String executionResponseContainer); }
DocumentTaggerImpl implements DocumentTagger { @Override public String tagDocument(String document, String executionResponseContainer) { executionResponseContainer = executionResponseContainer.replace( "<ruleExecutionContainer>", "<ruleExecutionContainer xmlns=\"urn:hl7-org:v3\">"); final String xslUrl = Thread.currentThread().getContextClassLoader() .getResource(TAG_XSL).toString(); final StringURIResolver stringURIResolver = new StringURIResolver(); stringURIResolver.put( URI_RESOLVER_HREF_RULE_EXECUTION_RESPONSE_CONTAINER, executionResponseContainer); stringURIResolver.put(URI_RESOLVER_HREF_DISCLAMER, disclaimerText); final Optional<URIResolver> uriResolver = Optional .of(stringURIResolver); final String taggedDocument = xmlTransformer.transform(document, xslUrl, Optional.empty(), uriResolver); logger.debug("Tagged Document:"); logger.debug(taggedDocument); return taggedDocument; } DocumentTaggerImpl(String disclaimerText,
			XmlTransformer xmlTransformer); @Override String tagDocument(String document, String executionResponseContainer);  }