1 | /*
|
---|
2 | * To change this template, choose Tools | Templates
|
---|
3 | * and open the template in the editor.
|
---|
4 | */
|
---|
5 |
|
---|
6 | package gov.hhs.fha.nhinc.patientcorrelation.dao;
|
---|
7 |
|
---|
8 | import gov.hhs.fha.nhinc.patientcorrelation.model.CorrelatedIdentifiers;
|
---|
9 | import java.util.List;
|
---|
10 | import org.junit.After;
|
---|
11 | import org.junit.AfterClass;
|
---|
12 | import org.junit.Before;
|
---|
13 | import org.junit.BeforeClass;
|
---|
14 | import org.junit.Test;
|
---|
15 | import static org.junit.Assert.*;
|
---|
16 |
|
---|
17 | /**
|
---|
18 | *
|
---|
19 | * @author svalluripalli
|
---|
20 | */
|
---|
21 | public class CorrelatedIdentifiersDaoTest {
|
---|
22 |
|
---|
23 | public CorrelatedIdentifiersDaoTest() {
|
---|
24 | }
|
---|
25 |
|
---|
26 | @BeforeClass
|
---|
27 | public static void setUpClass() throws Exception {
|
---|
28 | }
|
---|
29 |
|
---|
30 | @AfterClass
|
---|
31 | public static void tearDownClass() throws Exception {
|
---|
32 | }
|
---|
33 |
|
---|
34 | @Before
|
---|
35 | public void setUp() {
|
---|
36 | }
|
---|
37 |
|
---|
38 | @After
|
---|
39 | public void tearDown() {
|
---|
40 | }
|
---|
41 |
|
---|
42 | @Test
|
---|
43 | public void testAddPatientCorrelation() {
|
---|
44 | CorrelatedIdentifiersDao dao = new CorrelatedIdentifiersDao();
|
---|
45 | CorrelatedIdentifiers ci = new CorrelatedIdentifiers();
|
---|
46 | ci.setCorrelatedPatientAssigningAuthorityId("2.16.840.1.113883.3.198");
|
---|
47 | ci.setCorrelatedPatientId("D123401");
|
---|
48 | ci.setPatientAssigningAuthorityId("2.16.840.1.113883.4.1");
|
---|
49 | ci.setPatientId("123456789");
|
---|
50 | dao.addPatientCorrelation(ci);
|
---|
51 | CorrelatedIdentifiers ci1 = new CorrelatedIdentifiers();
|
---|
52 | ci1.setCorrelatedPatientAssigningAuthorityId("2.16.840.1.113883.3.192");
|
---|
53 | ci1.setCorrelatedPatientId("1018");
|
---|
54 | ci1.setPatientAssigningAuthorityId("2.16.840.1.113883.3.200");
|
---|
55 | ci1.setPatientId("500000000");
|
---|
56 | dao.addPatientCorrelation(ci1);
|
---|
57 | CorrelatedIdentifiers ci2 = new CorrelatedIdentifiers();
|
---|
58 | ci2.setCorrelatedPatientAssigningAuthorityId("2.16.840.1.113883.3.200");
|
---|
59 | ci2.setCorrelatedPatientId("500000000");
|
---|
60 | ci2.setPatientAssigningAuthorityId("2.16.840.1.113883.3.192");
|
---|
61 | ci2.setPatientId("1018");
|
---|
62 | dao.addPatientCorrelation(ci2); CorrelatedIdentifiers ci3 = new CorrelatedIdentifiers();
|
---|
63 | ci3.setCorrelatedPatientAssigningAuthorityId("2.16.840.1.113883.4.1");
|
---|
64 | ci3.setCorrelatedPatientId("123456789");
|
---|
65 | ci3.setPatientAssigningAuthorityId("2.16.840.1.113883.3.200");
|
---|
66 | ci3.setPatientId("500000000");
|
---|
67 | dao.addPatientCorrelation(ci3); CorrelatedIdentifiers ci4 = new CorrelatedIdentifiers();
|
---|
68 | ci4.setCorrelatedPatientAssigningAuthorityId("2.16.840.1.113883.3.200");
|
---|
69 | ci4.setCorrelatedPatientId("500000000");
|
---|
70 | ci4.setPatientAssigningAuthorityId("2.16.840.1.113883.4.1");
|
---|
71 | ci4.setPatientId("123456789");
|
---|
72 | dao.addPatientCorrelation(ci4 ); }
|
---|
73 |
|
---|
74 | @Test
|
---|
75 | public void testRemovePatientCorrelation() {
|
---|
76 | // CorrelatedIdentifiersDao dao = new CorrelatedIdentifiersDao();
|
---|
77 | // CorrelatedIdentifiers ci = new CorrelatedIdentifiers();
|
---|
78 | // ci.setCorrelatedPatientAssigningAuthorityId("2.16.840.1.113883.3.192");
|
---|
79 | // ci.setCorrelatedPatientId("1018");
|
---|
80 | // ci.setPatientAssigningAuthorityId("2.16.840.1.113883.3.200");
|
---|
81 | // ci.setPatientId("500000000");
|
---|
82 | // assertTrue(dao.removePatientCorrelation(ci));
|
---|
83 | }
|
---|
84 |
|
---|
85 |
|
---|
86 |
|
---|
87 | // @Test
|
---|
88 | // public void testGetPatientCorrelation(){
|
---|
89 | // CorrelatedIdentifiersDao dao = new CorrelatedIdentifiersDao();
|
---|
90 | // CorrelatedIdentifiers ci = new CorrelatedIdentifiers();
|
---|
91 | // ci.setCorrelatedPatientAssigningAuthorityId("2.16.840.1.113883.3.198");
|
---|
92 | // ci.setCorrelatedPatientId("D123401");
|
---|
93 | // ci.setPatientAssigningAuthorityId("2.16.840.1.113883.4.1");
|
---|
94 | // ci.setPatientId("123456789");
|
---|
95 | // List<CorrelatedIdentifiers> resultList = dao.retrievePatientCorrelation(ci);
|
---|
96 | // assertNotNull(resultList);
|
---|
97 | // assertEquals(1, resultList.size());
|
---|
98 | // assertEquals("123456789", resultList.get(0).getPatientId());
|
---|
99 | // }
|
---|
100 | }
|
---|