1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.openehealth.ipf.platform.camel.ihe.continua.hrn;
17
18 import org.junit.Test;
19 import org.openehealth.ipf.modules.cda.CDAR2Validator;
20 import org.openhealthtools.mdht.uml.cda.ClinicalDocument;
21 import org.openhealthtools.mdht.uml.cda.util.CDAUtil;
22
23 import java.io.InputStream;
24
25
26
27
28
29
30 public class DocumentsValidationTest {
31
32 @Test
33 public void testDocumentsValidation() throws Exception {
34 doTest("12AB78.xml");
35
36 doTest("HL7_CDA_PHMR_Rich_Rodgers.xml");
37 }
38
39 private void doTest(String fileName) throws Exception {
40 InputStream stream = getClass().getClassLoader().getResourceAsStream("continua-hrn/" + fileName);
41 ClinicalDocument document = CDAUtil.load(stream);
42 new CDAR2Validator().validate(document, null);
43 }
44 }