source: ccr/trunk/nhin-vista/projects/NHINC/Current/Product/Production/Gateway/AuditRepositoryEJB/test/gov/hhs/fha/nhinc/auditrepository/AuditRepositoryTest.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: 5.0 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.auditrepository;
7
8import javax.xml.bind.JAXBElement;
9
10import gov.hhs.fha.nhinc.common.nhinccommonadapter.FindCommunitiesAndAuditEventsResponseType;
11import gov.hhs.fha.nhinc.common.nhinccommon.ResponseType;
12import gov.hhs.fha.nhinc.common.nhinccommonadapter.FindAuditEventsRequestType;
13import gov.hhs.fha.nhinc.common.nhinccommonadapter.RespondingGatewayCrossGatewayQueryRequestType;
14import gov.hhs.fha.nhinc.common.nhinccommonadapter.RespondingGatewayCrossGatewayQueryResponseType;
15import gov.hhs.fha.nhinc.common.nhinccommonadapter.RespondingGatewayCrossGatewayRetrieveRequestType;
16import gov.hhs.fha.nhinc.common.nhinccommonadapter.RespondingGatewayCrossGatewayRetrieveResponseType;
17import ihe.iti.xds_b._2007.RetrieveDocumentSetRequestType;
18import ihe.iti.xds_b._2007.RetrieveDocumentSetResponseType;
19import ihe.iti.xds_b._2007.ProvideAndRegisterDocumentSetRequestType;
20import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryResponse;
21import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryRequest;
22import org.hl7.v3.PIXConsumerMCCIIN000002UV01RequestType;
23import org.hl7.v3.PIXConsumerPRPAIN201301UVRequestType;
24import org.hl7.v3.PIXConsumerPRPAIN201302UVRequestType;
25import org.hl7.v3.PIXConsumerPRPAIN201303UVRequestType;
26
27import org.hl7.v3.PRPAIN201301UV;
28import org.hl7.v3.PRPAIN201302UV;
29import org.hl7.v3.PRPAIN201303UV;
30import org.hl7.v3.MCCIIN000002UV01;
31import org.hl7.v3.MCCIMT000200UV01Receiver;
32import org.hl7.v3.MCCIMT000200UV01Device;
33import org.hl7.v3.II;
34
35import gov.hhs.fha.nhinc.common.nhinccommonadapter.FindAuditEventsRequestType;
36import gov.hhs.fha.nhinc.common.nhinccommonadapter.FindCommunitiesAndAuditEventsResponseType;
37import gov.hhs.fha.nhinc.common.nhinccommonadapter.FindCommunitiesAndAuditEventsRequestType;
38import com.services.nhinc.schema.auditmessage.FindAuditEventsType;
39
40import org.apache.commons.logging.Log;
41import org.apache.commons.logging.LogFactory;
42
43
44import org.junit.After;
45import org.junit.AfterClass;
46import org.junit.Before;
47import org.junit.BeforeClass;
48import org.junit.Test;
49import static org.junit.Assert.*;
50
51import gov.hhs.fha.nhinc.common.nhinccommon.AssertionType;
52import gov.hhs.fha.nhinc.common.nhinccommon.PersonNameType;
53import gov.hhs.fha.nhinc.common.nhinccommon.UserType;
54import gov.hhs.fha.nhinc.common.nhinccommon.HomeCommunityType;
55/**
56 *
57 * @author mflynn02
58 */
59public class AuditRepositoryTest {
60 private static Log log = LogFactory.getLog(AuditRepositoryTest.class);
61
62 public AuditRepositoryTest() {
63 }
64
65 @BeforeClass
66 public static void setUpClass() throws Exception {
67 }
68
69 @AfterClass
70 public static void tearDownClass() throws Exception {
71 }
72
73 @Before
74 public void setUp() {
75 }
76
77 @After
78 public void tearDown() {
79 }
80
81 /**
82 * Test of queryAuditEvents method, of class AuditRepository.
83 */
84 @Test
85 public void testQueryAuditEvents() {
86 log.debug("Begin - testQueryAuditEvents");
87
88 FindCommunitiesAndAuditEventsRequestType queryAuditEventsRequest = new FindCommunitiesAndAuditEventsRequestType();
89 FindAuditEventsType event = new FindAuditEventsType();
90 event.setPatientId("3333333^^^&2.16.840.1.113883.13.25&ISO");
91 queryAuditEventsRequest.setFindAuditEvents(event);
92 AuditRepository instance = new AuditRepository();
93 FindCommunitiesAndAuditEventsResponseType expResult = new FindCommunitiesAndAuditEventsResponseType();
94 FindCommunitiesAndAuditEventsResponseType result = instance.queryAuditEvents(queryAuditEventsRequest);
95
96 log.debug("result. : " + result.getFindAuditEventResponse().getFindAuditEventsReturn().size());
97
98// assertEquals(expResult, result);
99
100 log.debug("Begin - testQueryAuditEvents");
101 }
102
103 public II createII(String root, String extension) {
104 II newII = new II();
105
106 newII.setRoot(root);
107 newII.setExtension(extension);
108
109 return newII;
110 }
111
112 public PersonNameType createPersonName (String givenName, String familyName) {
113 PersonNameType newPerson = new PersonNameType();
114
115 newPerson.setFamilyName(familyName);
116 newPerson.setGivenName(givenName);
117
118 return newPerson;
119 }
120 public HomeCommunityType createHomeCommunity (String homeCommunityId, String homeCommunityName) {
121 HomeCommunityType newHC = new HomeCommunityType();
122
123 newHC.setHomeCommunityId(homeCommunityId);
124 newHC.setName(homeCommunityName);
125
126 return newHC;
127 }
128
129 public UserType createUserType (String given, String family, String homeCommunityId, String homeCommunityName) {
130 UserType newUser = new UserType();
131
132 newUser.setPersonName(createPersonName(given, family));
133 newUser.setUserName(given + " " + family);
134 newUser.setOrg(createHomeCommunity(homeCommunityId, homeCommunityName));
135
136 return newUser;
137 }
138
139}
Note: See TracBrowser for help on using the repository browser.