[507] | 1 | /*
|
---|
| 2 | * To change this template, choose Tools | Templates
|
---|
| 3 | * and open the template in the editor.
|
---|
| 4 | */
|
---|
| 5 | package gov.hhs.fha.nhinc.auditquery;
|
---|
| 6 |
|
---|
| 7 | import com.nhin.services.wsdl.auditlogquery.AuditLogQuery;
|
---|
| 8 | import com.services.nhinc.schema.auditmessage.FindAuditEventsResponseType;
|
---|
| 9 | import com.services.nhinc.schema.auditmessage.FindAuditEventsType;
|
---|
| 10 | import gov.hhs.fha.nhinc.common.nhinccommoninternalorch.FindAuditEventsRequestType;
|
---|
| 11 | import gov.hhs.fha.nhinc.nhinclib.NullChecker;
|
---|
| 12 | import javax.annotation.Resource;
|
---|
| 13 | import javax.ejb.Stateless;
|
---|
| 14 | import javax.jws.WebService;
|
---|
| 15 | import javax.xml.ws.WebServiceContext;
|
---|
| 16 | import org.apache.commons.logging.Log;
|
---|
| 17 | import 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
|
---|
| 25 | public 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 | }
|
---|