source: ccr/trunk/nhin-vista/projects/NHINC/Current/Product/Production/Gateway/GatewayPolicyEngineTransformationEjb/src/java/gov/hhs/fha/nhinc/gateway/policyenginetransformation/NotifyTransformHelper.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: 1.7 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.gateway.policyenginetransformation;
7import gov.hhs.fha.nhinc.common.nhinccommonadapter.CheckPolicyRequestType;
8import gov.hhs.fha.nhinc.common.eventcommon.NotifyEventType;
9import gov.hhs.fha.nhinc.gateway.policyenginetransformation.Helpers.ActionHelper;
10import gov.hhs.fha.nhinc.gateway.policyenginetransformation.Helpers.InboundOutboundChecker;
11import gov.hhs.fha.nhinc.gateway.policyenginetransformation.Helpers.SubjectHelper;
12import oasis.names.tc.xacml._2_0.context.schema.os.RequestType;
13import oasis.names.tc.xacml._2_0.context.schema.os.SubjectType;
14/**
15 *
16 * @author svalluripalli
17 */
18public class NotifyTransformHelper {
19 private static final String ActionInValue = "HIEMNotifyIn";
20 private static final String ActionOutValue = "HIEMNotifyOut";
21
22 public static CheckPolicyRequestType transformNotifyToCheckPolicy(NotifyEventType event) {
23 CheckPolicyRequestType genericPolicyRequest = new CheckPolicyRequestType();
24 RequestType request = new RequestType();
25 if (InboundOutboundChecker.IsInbound(event.getDirection())) {
26 request.setAction(ActionHelper.actionFactory(ActionInValue));
27 }
28 if (InboundOutboundChecker.IsOutbound(event.getDirection())) {
29 request.setAction(ActionHelper.actionFactory(ActionOutValue));
30 }
31 SubjectType subject = SubjectHelper.subjectFactory(event.getSendingHomeCommunity(), event.getMessage().getAssertion());
32 request.getSubject().add(subject);
33 genericPolicyRequest.setRequest(request);
34 return genericPolicyRequest;
35 }
36}
Note: See TracBrowser for help on using the repository browser.