source: ccr/trunk/nhin-vista/projects/NHINC/Current/Product/Production/Gateway/NhincAuditQueryEJB/src/java/gov/hhs/fha/nhinc/auditquery/AuditQuery.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: 2.4 KB
Line 
1/*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
5package gov.hhs.fha.nhinc.auditquery;
6
7import com.nhin.services.wsdl.auditlogquery.AuditLogQuery;
8import com.services.nhinc.schema.auditmessage.FindAuditEventsResponseType;
9import com.services.nhinc.schema.auditmessage.FindAuditEventsType;
10import gov.hhs.fha.nhinc.common.nhinccommoninternalorch.FindAuditEventsRequestType;
11import gov.hhs.fha.nhinc.nhinclib.NullChecker;
12import javax.annotation.Resource;
13import javax.ejb.Stateless;
14import javax.jws.WebService;
15import javax.xml.ws.WebServiceContext;
16import org.apache.commons.logging.Log;
17import org.apache.commons.logging.LogFactory;
18
19/**
20 *
21 * @author jhoppesc
22 */
23@WebService(serviceName = "findAuditEvents", portName = "AuditLogQuery", endpointInterface = "com.nhin.services.wsdl.auditlogquery.AuditLogQuery", targetNamespace = "http://services.nhin.com/wsdl/auditlogquery", wsdlLocation = "META-INF/wsdl/AuditQuery/NhinAuditLogQuery.wsdl")
24@Stateless
25public class AuditQuery implements AuditLogQuery {
26
27 @Resource
28 private WebServiceContext context;
29 private static Log log = LogFactory.getLog(AuditQuery.class);
30
31 public java.util.List<com.services.nhinc.schema.auditmessage.AuditMessageType> findAuditEvents(java.lang.String patientId, java.lang.String userId, javax.xml.datatype.XMLGregorianCalendar beginDateTime, javax.xml.datatype.XMLGregorianCalendar endDateTime) {
32 FindAuditEventsType query = new FindAuditEventsType();
33
34 if (NullChecker.isNotNullish(userId)) {
35 log.info("User: " + userId);
36 query.setUserId(userId);
37 }
38
39 if (NullChecker.isNotNullish(patientId)) {
40 log.info("Patient: " + patientId);
41 query.setPatientId(patientId);
42 }
43
44 if (beginDateTime != null) {
45 log.info("Begin Time: " + beginDateTime.toString());
46 query.setBeginDateTime(beginDateTime);
47 }
48
49 if (endDateTime != null) {
50 log.info("End Time: " + endDateTime.toString());
51 query.setEndDateTime(endDateTime);
52 }
53
54 FindAuditEventsResponseType resp = AuditQueryImpl.auditQuery(query, context);
55
56 if (resp != null &&
57 NullChecker.isNotNullish(resp.getFindAuditEventsReturn())) {
58 return resp.getFindAuditEventsReturn();
59 } else {
60 return null;
61 }
62 }
63}
Note: See TracBrowser for help on using the repository browser.