source: ccr/trunk/nhin-vista/projects/NHINC/Current/Product/Production/Gateway/PatientCorrelationDAO/test/gov/hhs/fha/nhinc/patientcorrelation/dao/CorrelatedIdentifiersDaoTest.java@ 507

Last change on this file since 507 was 507, checked in by George Lilly, 15 years ago

NHIN gateway and adaptor for use on linux with VistA EHR and RPMS

File size: 3.8 KB
Line 
1/*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
5
6package gov.hhs.fha.nhinc.patientcorrelation.dao;
7
8import gov.hhs.fha.nhinc.patientcorrelation.model.CorrelatedIdentifiers;
9import java.util.List;
10import org.junit.After;
11import org.junit.AfterClass;
12import org.junit.Before;
13import org.junit.BeforeClass;
14import org.junit.Test;
15import static org.junit.Assert.*;
16
17/**
18 *
19 * @author svalluripalli
20 */
21public 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}
Note: See TracBrowser for help on using the repository browser.