@Test(expected = DS4PException.class) public void testExtractFactModel_Throws_DS4PException() { @SuppressWarnings("unused") final String factModel = documentFactModelExtractor.extractFactModel( "", xacmlResult); }
@Override public String extractFactModel(String document, String enforcementPolicies) { final String xslUrl = Thread.currentThread().getContextClassLoader() .getResource(EXTRACT_CLINICAL_FACTS_XSL).toString(); final String xacmlResult = enforcementPolicies.replace("<xacmlReslt>", "<xacmlReslt xmlns:\"urn:hl7-org:v3\">"); final Optional<URIResolver> uriResolver = Optional .of(new StringURIResolver() .put(PARAM_XACML_RESULT, xacmlResult)); String factModel = xmlTransformer.transform(document, xslUrl, Optional.empty(), uriResolver); factModel = factModel .replace( "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>", ""); logger.debug("FactModel:"); logger.debug(factModel); return factModel; }
DocumentFactModelExtractorImpl implements
		DocumentFactModelExtractor { @Override public String extractFactModel(String document, String enforcementPolicies) { final String xslUrl = Thread.currentThread().getContextClassLoader() .getResource(EXTRACT_CLINICAL_FACTS_XSL).toString(); final String xacmlResult = enforcementPolicies.replace("<xacmlReslt>", "<xacmlReslt xmlns:\"urn:hl7-org:v3\">"); final Optional<URIResolver> uriResolver = Optional .of(new StringURIResolver() .put(PARAM_XACML_RESULT, xacmlResult)); String factModel = xmlTransformer.transform(document, xslUrl, Optional.empty(), uriResolver); factModel = factModel .replace( "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>", ""); logger.debug("FactModel:"); logger.debug(factModel); return factModel; } }
DocumentFactModelExtractorImpl implements
		DocumentFactModelExtractor { @Override public String extractFactModel(String document, String enforcementPolicies) { final String xslUrl = Thread.currentThread().getContextClassLoader() .getResource(EXTRACT_CLINICAL_FACTS_XSL).toString(); final String xacmlResult = enforcementPolicies.replace("<xacmlReslt>", "<xacmlReslt xmlns:\"urn:hl7-org:v3\">"); final Optional<URIResolver> uriResolver = Optional .of(new StringURIResolver() .put(PARAM_XACML_RESULT, xacmlResult)); String factModel = xmlTransformer.transform(document, xslUrl, Optional.empty(), uriResolver); factModel = factModel .replace( "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>", ""); logger.debug("FactModel:"); logger.debug(factModel); return factModel; } DocumentFactModelExtractorImpl(XmlTransformer xmlTransformer); }
DocumentFactModelExtractorImpl implements
		DocumentFactModelExtractor { @Override public String extractFactModel(String document, String enforcementPolicies) { final String xslUrl = Thread.currentThread().getContextClassLoader() .getResource(EXTRACT_CLINICAL_FACTS_XSL).toString(); final String xacmlResult = enforcementPolicies.replace("<xacmlReslt>", "<xacmlReslt xmlns:\"urn:hl7-org:v3\">"); final Optional<URIResolver> uriResolver = Optional .of(new StringURIResolver() .put(PARAM_XACML_RESULT, xacmlResult)); String factModel = xmlTransformer.transform(document, xslUrl, Optional.empty(), uriResolver); factModel = factModel .replace( "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>", ""); logger.debug("FactModel:"); logger.debug(factModel); return factModel; } DocumentFactModelExtractorImpl(XmlTransformer xmlTransformer); @Override String extractFactModel(String document, String enforcementPolicies); }
DocumentFactModelExtractorImpl implements
		DocumentFactModelExtractor { @Override public String extractFactModel(String document, String enforcementPolicies) { final String xslUrl = Thread.currentThread().getContextClassLoader() .getResource(EXTRACT_CLINICAL_FACTS_XSL).toString(); final String xacmlResult = enforcementPolicies.replace("<xacmlReslt>", "<xacmlReslt xmlns:\"urn:hl7-org:v3\">"); final Optional<URIResolver> uriResolver = Optional .of(new StringURIResolver() .put(PARAM_XACML_RESULT, xacmlResult)); String factModel = xmlTransformer.transform(document, xslUrl, Optional.empty(), uriResolver); factModel = factModel .replace( "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>", ""); logger.debug("FactModel:"); logger.debug(factModel); return factModel; } DocumentFactModelExtractorImpl(XmlTransformer xmlTransformer); @Override String extractFactModel(String document, String enforcementPolicies);  }