/// <summary>
        /// This function returns the FacilityProviderRelationship object based on the database RelationshipID value.
        /// This is the Facility Provider Relationship/Profile data.
        /// </summary>
        /// <param name="relationshipID"></param>
        /// <returns></returns>
        public FacilityProviderRelationship GetFacilityProviderRelationshipByID(int relationshipID)
        {
            FacilityProviderRelationship relationship = new FacilityProviderRelationship();

            using (DataLayer dataLayer = new DataLayer())
            {
                relationship        = dataLayer.GetFacilityProviderRelationshipByID(relationshipID);
                relationship.Vendor = dataLayer.GetVendorByFacilityID(relationship.Facility.ID);
                relationship.BehavioralHealthAttributes = dataLayer.GetBHAttributeByRelationshipID(relationshipID);
            }

            return(relationship);
        }
 /// <summary>
 /// This function returns the RelationshipID after the FacilityProviderRelationship object data has been inserted/updated in the database.
 /// </summary>
 /// <param name="relationship"></param>
 /// <returns>Relationship ID being inserted/updated in the database</returns>
 public int SaveFacilityProviderRelationship(FacilityProviderRelationship relationship)
 {
     try
     {
         using (DataLayer dataLayer = new DataLayer())
         {
             return(dataLayer.SaveFacilityProviderRelationship(relationship));
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
        public static DataTable PopulateFacilityProviderRelationshipTable(FacilityProviderRelationship relationship)
        {
            DataTable dt = CreateFacilityProviderRelationshipTable();

            try
            {
                DataRow row = dt.NewRow();

                //Specify RelationshipID to update record
                if (relationship.RelationshipID > 0)
                {
                    row["FACILITY_PROVIDER_RELATIONSHIP_ID"] = relationship.RelationshipID;
                }

                row["FACILITY_ID"] = relationship.Facility.ID;
                row["PROVIDER_ID"] = relationship.Provider.ID;
                row["EXTERNAL_PROVIDER_INDICATOR"]     = relationship.ExternalProviderIndicator;
                row["ACCEPTING_NEW_PATIENT_INDICATOR"] = relationship.AcceptingNewPatientIndicator;
                row["PRESCRIBER_INDICATOR"]            = relationship.PrescriberIndicator;
                row["REFERRALL_INDICATOR"]             = relationship.ReferralIndicator;
                row["FLOAT_PROVIDER_INDICATOR"]        = relationship.FloatProviderIndicator;
                row["EFFECTIVE_DATE"]           = relationship.EffectiveDate;
                row["TERMINATION_DATE"]         = relationship.TerminationDate;
                row["PROVIDER_EMAIL"]           = relationship.ProviderEmail;
                row["PROVIDER_PHONE_NUMBER"]    = relationship.ProviderPhoneNumber;
                row["PROVIDER_PHONE_EXTENSION"] = relationship.ProviderExtensionNumber;
                row["INTERNAL_NOTES"]           = relationship.InternalNotes;
                row["LAST_UPDATED_BY"]          = relationship.LastUpdatedBy;

                dt.Rows.Add(row);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(dt);
        }