@Test
public void testTagDocument_Entry_Level_Tagging() throws Exception {

	// Arrange
	logger.debug(c32);
	String factModelXml = documentFactModelExtractor.extractFactModel(c32,
			fileReader.readFile("testXacmlResultRedactHIV.xml"));
	c32 = embeddedClinicalDocumentExtractor
			.extractClinicalDocumentFromFactModel(factModelXml);
	factModelXml = removeEmbeddedClinicalDocument(factModelXml);
	final FactModel factModel = marshaller.unmarshalFromXml(
			FactModel.class, factModelXml);
	final String executionResponseContainer = ruleExecutionService
			.assertAndExecuteClinicalFacts(factModel)
			.getRuleExecutionResponseContainer();
	// Act
	final String taggedDocument = documentTagger.tagDocument(c32,
			executionResponseContainer);
	// Assert
	logger.debug(taggedDocument);
	assertTrue(!taggedDocument.contains("<confidentialityCode/>"));
	assertTrue(taggedDocument
			.contains("<confidentialityCode xmlns:ds4p=\"http://www.siframework.org/ds4p\""));
	assertTrue(taggedDocument.contains("code=\"R\""));
	assertTrue(taggedDocument.contains(DISCLAIMER_TEXT));
	assertTrue(taggedDocument
			.contains("codeSystem=\"2.16.840.1.113883.5.25\""));
	assertTrue(c32.contains("<confidentialityCode/>"));
	assertTrue(!c32
			.contains("<confidentialityCode xmlns:ds4p=\"http://www.siframework.org/ds4p\""));
	assertTrue(!c32.contains("code=\"R\""));
	assertTrue(!c32.contains("codeSystem=\"2.16.840.1.113883.5.25\""));
	final Document taggedDoc = documentXmlConverter
			.loadDocument(taggedDocument);
	verifyEntryLevelTags(taggedDoc, "d1e259",
			Arrays.asList(new String[] { "R", "NODSCLCD", "ENCRYPT" }));
	verifyEntryLevelTags(taggedDoc, "d1e220",
			Arrays.asList(new String[] { "V", "ENCRYPT", "NODSCLCD" }));
	verifyEntryLevelTags(taggedDoc, "d1e1261",
			Arrays.asList(new String[] { "R", "ENCRYPT", "NORDSCLCD" }));
}