/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package gov.hhs.fha.nhinc.subscription.dte; import gov.hhs.fha.nhinc.common.subscriptionb2overrideforcdc.NotifyCdcBioPackageType; import gov.hhs.fha.nhinc.common.subscriptiondte.CreateNhinNotifyCdcBioPackageResponseType; import javax.xml.bind.JAXBElement; import org.oasis_open.docs.wsn.b_2.NotificationMessageHolderType.Message; import org.oasis_open.docs.wsn.b_2.Notify; /** * * @author rayj */ public class createNhinNotifyCdcBioPackageHelper { public static gov.hhs.fha.nhinc.common.subscriptiondte.CreateNhinNotifyCdcBioPackageResponseType createNhinNotifyCdcBioPackage(gov.hhs.fha.nhinc.common.subscriptiondte.CreateNhinNotifyCdcBioPackageRequestType request) { CreateNhinNotifyCdcBioPackageResponseType response = new CreateNhinNotifyCdcBioPackageResponseType(); Notify nhinNotify = transformInternalSubscriptionItemToNhinNotifyHelper.transformInternalSubscriptionItemToNhinNotify(request.getSubscriptionItem()); NotifyCdcBioPackageType entityNotify = request.getNotify(); if (entityNotify != null && entityNotify.getNotificationMessage() != null && entityNotify.getNotificationMessage().size() >= 1 && entityNotify.getNotificationMessage().get(0).getMessage() != null) { byte[] cdcBioPackage = entityNotify.getNotificationMessage().get(0).getMessage().getCdcBioPackagePayload(); Message nhinNotifyMessage = NotifyHelper.getMessage(nhinNotify); NotifyHelper.AppendCdcBioPackage(nhinNotifyMessage, cdcBioPackage); } response.setNotify(nhinNotify); return response; } }