[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.subscription.dte;
|
---|
| 6 |
|
---|
| 7 | //import gov.hhs.fha.nhinc.NHINCLib.NullChecker;
|
---|
| 8 | import gov.hhs.fha.nhinc.common.nhinccommon.QualifiedSubjectIdentifierType;
|
---|
| 9 | import gov.hhs.fha.nhinc.common.subscription.SubscriptionItemType;
|
---|
| 10 |
|
---|
| 11 | //import gov.hhs.fha.nhinc.subscription.ReferenceParameterType;
|
---|
| 12 | import gov.hhs.fha.nhinc.util.format.PatientIdFormatUtil;
|
---|
| 13 | //import gov.hhs.fha.nhinc.subscription.SubscriptionCriteriaType;
|
---|
| 14 | //import gov.hhs.fha.nhinc.subscription.SubscriptionItemType;
|
---|
| 15 | //import gov.hhs.fha.nhinc.util.format.PatientIdFormatUtil;
|
---|
| 16 | //import org.netbeans.xml.schema.qualifiedsubjectid.QualifiedSubjectId;
|
---|
| 17 | /**
|
---|
| 18 | *
|
---|
| 19 | * @author rayj
|
---|
| 20 | */
|
---|
| 21 | public class SubscriptionItemHelper {
|
---|
| 22 |
|
---|
| 23 | public static String getNotificationConsumerEndpointAddress(SubscriptionItemType subscriptionItem) {
|
---|
| 24 | return subscriptionItem.getSubscriber().getNotificationConsumerEndpointAddress();
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | public static String getSubscriberUserAddress(SubscriptionItemType subscriptionItem) {
|
---|
| 28 | String userAddress = null;
|
---|
| 29 | if (subscriptionItem != null && subscriptionItem.getSubscriber() != null) {
|
---|
| 30 | userAddress = subscriptionItem.getSubscriber().getUserAddress();
|
---|
| 31 | }
|
---|
| 32 | return userAddress;
|
---|
| 33 | }
|
---|
| 34 |
|
---|
| 35 | public static QualifiedSubjectIdentifierType getSubscriptionCriteriaSubscribeePatient(SubscriptionItemType subscriptionItem) {
|
---|
| 36 | QualifiedSubjectIdentifierType subscribeePatient = null;
|
---|
| 37 | if (subscriptionItem != null && subscriptionItem.getSubscriptionCriteria() != null) {
|
---|
| 38 | subscribeePatient = subscriptionItem.getSubscriptionCriteria().getSubscribeePatient();
|
---|
| 39 | }
|
---|
| 40 | return subscribeePatient;
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | public static String getSubscriptionCriteriaSubscribeePatientInAdhocQueryFormat(SubscriptionItemType subscriptionItem) {
|
---|
| 44 | QualifiedSubjectIdentifierType patient = getSubscriptionCriteriaSubscribeePatient(subscriptionItem);
|
---|
| 45 | String formattedPatientId = null;
|
---|
| 46 | if ((patient != null) && (patient.getSubjectIdentifier() != null) && (patient.getAssigningAuthorityIdentifier() != null)) {
|
---|
| 47 | formattedPatientId = PatientIdFormatUtil.hl7EncodePatientId(patient.getSubjectIdentifier(), patient.getAssigningAuthorityIdentifier());
|
---|
| 48 | }
|
---|
| 49 | return formattedPatientId;
|
---|
| 50 | }
|
---|
| 51 | }
|
---|