source: ccr/trunk/nhin-vista/projects/NHINC/Current/Product/Production/Gateway/SubscriptionDteEjb/src/java/gov/hhs/fha/nhinc/subscription/dte/CreateAgencyNotifyCdcBioPackageHelper.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.7 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.subscription.dte;
6
7//import gov.hhs.fha.nhinc.common.nhinccommonadapter.NotifySubscribersOfCdcBioPackageRequestType;
8
9import gov.hhs.fha.nhinc.common.nhinccommonadapter.NotifySubscribersOfCdcBioPackageRequestType;
10import gov.hhs.fha.nhinc.common.subscription.TopicExpressionType;
11import gov.hhs.fha.nhinc.common.subscriptionb2overrideforcdc.NotificationMessageHolderType;
12import gov.hhs.fha.nhinc.common.subscriptionb2overrideforcdc.NotificationMessageHolderType.Message;
13import gov.hhs.fha.nhinc.common.subscriptionb2overrideforcdc.NotifyCdcBioPackageType;
14import gov.hhs.fha.nhinc.common.subscriptiondte.CreateAgencyNotifyCdcBioPackageRequestType;
15
16//import gov.hhs.fha.nhinc.common.subscriptionb2overrideforcdc.NotifyCdcBioPackageType;
17import gov.hhs.fha.nhinc.common.subscriptiondte.CreateAgencyNotifyCdcBioPackageResponseType;
18//import gov.hhs.fha.nhinc.subscription.*;
19import java.util.List;
20//urn:gov:hhs:fha:nhinc:common:subscriptionb2overrideforcdc
21import javax.xml.bind.JAXBElement;
22//import gov.hhs.fha.nhinc.subscription_b_2_overrideforcdc.NotificationMessageHolderType;
23import javax.xml.ws.wsaddressing.W3CEndpointReference;
24//import gov.hhs.fha.nhinc.subscription_b_2_overrideforcdc.NotificationMessageHolderType.Message;
25//import gov.hhs.fha.nhinc.subscription_b_2_overrideforcdc.NotifyCdcBioPackageType;
26//import java.util.ArrayList;
27//import java.util.List;
28//import javax.xml.bind.JAXBElement;
29//import javax.xml.ws.wsaddressing.W3CEndpointReference;
30//import gov.hhs.fha.nhinc.common.subscriptiondte.CreateAgencyNotifyCdcBioPackageResponseType;
31//import gov.hhs.fha.nhinc.common.subscriptiondte.CreateAgencyNotifyCdcBioPackageRequestType;
32
33/**
34 *
35 * @author rayj
36 */
37public class CreateAgencyNotifyCdcBioPackageHelper {
38
39 public static CreateAgencyNotifyCdcBioPackageResponseType createAgencyNotifyCdcBioPackage(CreateAgencyNotifyCdcBioPackageRequestType createNotifyRequest) {
40 CreateAgencyNotifyCdcBioPackageResponseType result = new CreateAgencyNotifyCdcBioPackageResponseType();
41
42 NotifySubscribersOfCdcBioPackageRequestType notifySubscribers = new NotifySubscribersOfCdcBioPackageRequestType();
43 result.setNotifySubscribersOfCdcBioPackageRequest(notifySubscribers);
44
45 NotifyCdcBioPackageType notify =new NotifyCdcBioPackageType();
46 notifySubscribers.setNotify(notify);
47
48 List< NotificationMessageHolderType> notificationMessageList = notify.getNotificationMessage();
49
50 NotificationMessageHolderType notificationMessage = new NotificationMessageHolderType();
51 notificationMessageList.add(notificationMessage);
52 Message message = new Message();
53 notificationMessage.setMessage(message);
54
55 org.oasis_open.docs.wsn.b_2.NotificationMessageHolderType.Message nhinNotificationMessage = NotifyHelper.getMessage(createNotifyRequest.getNotify());
56 Object any = nhinNotificationMessage.getAny();
57 if ((any != null) && (any instanceof JAXBElement)) {
58 Object anyvalue = ((JAXBElement) any).getValue();
59 if (anyvalue instanceof byte[]) {
60 byte[] bytearray = (byte[]) anyvalue;
61 message.setCdcBioPackagePayload(bytearray);
62 }
63 }
64
65 W3CEndpointReference nhinSubscriptionReference = SubscriptionReferenceHelper.createNhinSubscriptionReference(createNotifyRequest.getSubscriptionReference());
66 notificationMessage.setSubscriptionReference(nhinSubscriptionReference);
67
68 org.oasis_open.docs.wsn.b_2.TopicExpressionType topic = TopicHelper.GetTopic(createNotifyRequest.getNotify());
69 notificationMessage.setTopic(topic);
70
71
72 return result;
73 }
74}
Note: See TracBrowser for help on using the repository browser.