Пример #1
0
        private void InitializeEntityInformation(Client.Core.Entity.Entity entity)
        {
            switch (entity.EntityType)
            {
            case Mercury.Server.Application.EntityType.Member:

                WorkQueueItemInformationMember.Style.Clear();

                InitializeMemberInformationByEntityId(entity.Id);

                break;

            case Mercury.Server.Application.EntityType.Provider:

                WorkQueueItemInformationProvider.Style.Clear();

                Client.Core.Provider.Provider provider = MercuryApplication.ProviderGetByEntityId(entity.Id, true);

                if (provider != null)
                {
                    InitializeProviderInformation(provider.Id);
                }

                break;
            }

            return;
        }
Пример #2
0
        static public String ProviderProfileAnchor(Mercury.Client.Application application, Int64 providerId)
        {
            String anchor = String.Empty;

            String providerName = String.Empty;

            Client.Core.Provider.Provider provider = application.ProviderGet(providerId, true);

            if (provider != null)
            {
                providerName = provider.Name;
            }

            if (!String.IsNullOrWhiteSpace(providerName))
            {
                anchor = ProviderProfileAnchor(providerId, providerName);
            }

            return(anchor);
        }
Пример #3
0
        private void InitializeProviderInformation(Int64 providerId)
        {
            Client.Core.Provider.Provider provider = MercuryApplication.ProviderGet(providerId, true);

            if (provider == null)
            {
                return;
            }


            WorkQueueItemInformationProvider.Style.Clear();


            #region Note Alert Icons

            Dictionary <Mercury.Server.Application.NoteImportance, Client.Core.Entity.EntityNote> entityNotes;

            entityNotes = MercuryApplication.EntityNoteGetMostRecentByAllImportances(provider.EntityId, true);


            Client.Core.Entity.EntityNote entityNote = null;

            // entityNote = MercuryApplication.EntityNoteGetMostRecentByImportance (provider.EntityId, Mercury.Server.Application.NoteImportance.Warning, false);

            if (entityNotes.ContainsKey(Mercury.Server.Application.NoteImportance.Warning))
            {
                entityNote = entityNotes[Mercury.Server.Application.NoteImportance.Warning];
            }

            if (entityNote != null)
            {
                if (entityNote.TerminationDate >= DateTime.Today)
                {
                    UserInteractionEntityInformationProviderNoteWarning.Style.Clear();

                    UserInteractionEntityInformationProviderNoteWarning.Attributes.Add("title", "[" + entityNote.NoteTypeName + "] " + entityNote.Subject);

                    UserInteractionEntityInformationProviderNoteWarning.Visible = true;
                }
            }

            // entityNote = MercuryApplication.EntityNoteGetMostRecentByImportance (provider.EntityId, Mercury.Server.Application.NoteImportance.Critical, false);

            entityNote = null;

            if (entityNotes.ContainsKey(Mercury.Server.Application.NoteImportance.Critical))
            {
                entityNote = entityNotes[Mercury.Server.Application.NoteImportance.Critical];
            }

            if (entityNote != null)
            {
                if (entityNote.TerminationDate >= DateTime.Today)
                {
                    UserInteractionEntityInformationProviderNoteCritical.Style.Clear();

                    UserInteractionEntityInformationProviderNoteCritical.Attributes.Add("title", "[" + entityNote.NoteTypeName + "] " + entityNote.Subject);

                    UserInteractionEntityInformationProviderNoteCritical.Visible = true;
                }
            }

            #endregion


            UserInteractionEntityInformationProviderName.Text = Web.CommonFunctions.ProviderProfileAnchor(providerId, provider.Name);

            UserInteractionEntityInformationProviderNpi.Text = (String.IsNullOrEmpty(provider.NationalProviderId)) ? "** Not Assigned" : provider.NationalProviderId;

            UserInteractionEntityInformationProviderProgram.Text = "** Not Enrolled";

            UserInteractionEntityInformationProviderProgramProviderId.Text = "**Not Enrolled";

            if (provider.HasCurrentEnrollment)
            {
                UserInteractionEntityInformationProviderProgram.Text = provider.CurrentEnrollment.Program.Name;

                UserInteractionEntityInformationProviderProgramProviderId.Text = provider.CurrentEnrollment.ProgramProviderId;
            }

            return;
        }
        protected void GlobalSearchButton_OnClick(Object sender, EventArgs e)
        {
            Mercury.Server.Application.SearchResultsMemberResponse memberSearchResponse;

            Mercury.Server.Application.SearchResultsProviderResponse providerSearchResponse;


            memberSearchResponse = MercuryApplication.SearchMember(GlobalSearchText.Text, null, GlobalSearchText.Text);

            providerSearchResponse = MercuryApplication.SearchProvider(GlobalSearchText.Text, GlobalSearchText.Text);

            if ((memberSearchResponse.HasException) || (providerSearchResponse.HasException))
            {
                if (memberSearchResponse.HasException)
                {
                    TelerikAjaxManager.ResponseScripts.Add("alert ('" + memberSearchResponse.Exception.Message.Replace("'", "''") + "');");
                }

                else if (providerSearchResponse.HasException)
                {
                    TelerikAjaxManager.ResponseScripts.Add("alert ('" + providerSearchResponse.Exception.Message.Replace("'", "''") + "');");
                }

                else
                {
                    TelerikAjaxManager.ResponseScripts.Add("alert ('Unable to complete search.');");
                }
            }


            else
            {
                System.Data.DataTable resultsTable = SearchResultsTable;

                resultsTable.Rows.Clear();

                foreach (Mercury.Server.Application.SearchResultMember currentMemberResult in memberSearchResponse.Results)
                {
                    Client.Core.Member.Member member = MercuryApplication.MemberGet(currentMemberResult.MemberId, true);


                    String memberEffectiveDate = (member.MostRecentEnrollment != null) ? member.MostRecentEnrollment.EffectiveDate.ToString("MM/dd/yyyy") : "*";

                    String memberTerminationDate = "*";

                    if (member.MostRecentEnrollment != null)
                    {
                        if (member.MostRecentEnrollment.TerminationDate == new DateTime(9999, 12, 31))
                        {
                            memberTerminationDate = "< active >";
                        }

                        else
                        {
                            memberTerminationDate = member.MostRecentEnrollment.TerminationDate.ToString("MM/dd/yyyy");
                        }
                    }


                    String programMemberId = (member.MostRecentEnrollment != null) ? member.MostRecentEnrollment.ProgramMemberId : "&nbsp";


                    resultsTable.Rows.Add(

                        "Member",

                        programMemberId,

                        CommonFunctions.MemberProfileAnchor(currentMemberResult.MemberId, currentMemberResult.Name),

                        currentMemberResult.BirthDate.ToString("MM/dd/yyyy") + " (" + member.CurrentAge.ToString().PadLeft(2, ' ') + ") | " + currentMemberResult.Gender,

                        memberEffectiveDate,

                        memberTerminationDate

                        );
                }

                foreach (Mercury.Server.Application.SearchResultProvider currentProviderResult in providerSearchResponse.Results)
                {
                    Client.Core.Provider.Provider provider = MercuryApplication.ProviderGet(currentProviderResult.ProviderId, true);

                    String providerTerminationDate = "< active >";

                    if (!provider.HasCurrentEnrollment)
                    {
                        providerTerminationDate = String.Empty;
                    }

                    else if (provider.CurrentEnrollment.TerminationDate != new DateTime(9999, 12, 31))
                    {
                        providerTerminationDate = provider.CurrentEnrollment.TerminationDate.ToString("MM/dd/yyyy");
                    }

                    resultsTable.Rows.Add(

                        "Provider",

                        ((provider.HasCurrentEnrollment) ? provider.CurrentEnrollment.ProgramProviderId : String.Empty),

                        CommonFunctions.ProviderProfileAnchor(currentProviderResult.ProviderId, currentProviderResult.Name),

                        currentProviderResult.FederalTaxId + " | " + currentProviderResult.NationalProviderId + " | " + currentProviderResult.PrimarySpecialtyName,

                        ((provider.HasCurrentEnrollment) ? provider.CurrentEnrollment.EffectiveDate.ToString("MM/dd/yyyy") : String.Empty),

                        providerTerminationDate

                        );
                }

                SearchResultsTable = resultsTable;

                SearchResultsGrid.DataSource = resultsTable;

                SearchResultsGrid.DataBind();


                String showDialogScript = "$find(\"" + GlobalSearchResultsWindow.ClientID + "\").show ();";

                TelerikAjaxManager.ResponseScripts.Add(showDialogScript);
            }
        }
        protected void MemberClaimHistoryGrid_OnNeedDataSource(Object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs eventArgs)
        {
            #region Validate Call

            if (MercuryApplication == null)
            {
                return;
            }

            if (Member == null)
            {
                return;
            }

            #endregion


            Boolean needsData = false;

            needsData = needsData || (MemberClaimHistoryGrid_Count == 0);

            needsData = needsData || (MemberClaimHistoryGrid_DataTable.Rows.Count == 0);

            needsData = needsData || (MemberClaimHistoryGrid_PageSize != MemberClaimHistoryGrid.PageSize);

            needsData = needsData || (MemberClaimHistoryGrid_CurrentPage != MemberClaimHistoryGrid.CurrentPageIndex);



            System.Data.DataTable dataTable = MemberClaimHistoryGrid_DataTable;

            if (needsData)
            {
                MemberClaimHistoryGrid.PageSize = MemberClaimHistoryGrid_PageSize;

                dataTable.Rows.Clear();

                if (MemberClaimHistoryGrid_Count == 0)
                {
                    MemberClaimHistoryGrid_Count = Convert.ToInt32(MercuryApplication.MemberClaimsGetCount(Member.Id));

                    MemberClaimHistoryGrid.VirtualItemCount = Convert.ToInt32(MemberClaimHistoryGrid_Count);
                }

                MemberClaimHistoryGrid_CurrentPage = MemberClaimHistoryGrid.CurrentPageIndex;

                List <Server.Application.Claim> memberClaims;

                Int32 initialRow = MemberClaimHistoryGrid.CurrentPageIndex * MemberClaimHistoryGrid.PageSize + 1;

                memberClaims = MercuryApplication.MemberClaimsGetByPage(Member.Id, initialRow, MemberClaimHistoryGrid.PageSize);


                foreach (Server.Application.Claim currentClaim in memberClaims)
                {
                    // String diagnosisInformation = "<span title=\"" + currentClaim.PrimaryDiagnosisDescription + "\">" + currentClaim.PrimaryDiagnosisCode + "</span>";

                    String diagnosisInformation = CommonFunctions.DiagnosisDescription(MercuryApplication, currentClaim.PrincipalDiagnosisCode, currentClaim.PrincipalDiagnosisVersion);

                    String billTypeInformation = "<span title=\"" + MercuryApplication.BillTypeDescription(currentClaim.BillType) + "\">" + currentClaim.BillType + "</span>";

                    Client.Core.Provider.Provider billingProvider = MercuryApplication.ProviderGet(currentClaim.PayToProviderId, true);

                    Client.Core.Provider.Provider serviceProvider = MercuryApplication.ProviderGet(currentClaim.ServiceProviderId, true);

                    String billingProviderName = String.Empty;

                    String serviceProviderName = String.Empty;

                    if (billingProvider != null)
                    {
                        billingProviderName = Web.CommonFunctions.ProviderProfileAnchor(billingProvider.Id, billingProvider.Name);
                    }

                    if (serviceProvider != null)
                    {
                        serviceProviderName = Mercury.Web.CommonFunctions.ProviderProfileAnchor(serviceProvider.Id, serviceProvider.Name);
                    }


                    String claimStatusInformation = "<span title=\"" + currentClaim.DenialReason + "\">" + currentClaim.Status + ((!String.IsNullOrEmpty(currentClaim.DenialReason)) ? "*" : String.Empty) + "</span>";


                    dataTable.Rows.Add(

                        currentClaim.Id.ToString(),

                        currentClaim.ClaimNumber,

                        currentClaim.MemberId.ToString(),

                        currentClaim.ServiceProviderId.ToString(),

                        currentClaim.PayToProviderId.ToString(),

                        currentClaim.ClaimType.ToString(),

                        currentClaim.ClaimFromDate.ToString("MM/dd/yyyy"),

                        currentClaim.ClaimThruDate.ToString("MM/dd/yyyy"),

                        (currentClaim.AdmissionDate.HasValue) ? currentClaim.AdmissionDate.Value.ToString("MM/dd/yyyy") : "&nbsp",

                        claimStatusInformation,

                        billTypeInformation,

                        diagnosisInformation,

                        currentClaim.PrincipalDiagnosisDescription,

                        billingProviderName,

                        serviceProviderName,

                        currentClaim.BilledAmount.ToString("$###,###,##0.00"),

                        currentClaim.PaidAmount.ToString("$###,###,##0.00"),

                        (currentClaim.PaidDate.HasValue) ? currentClaim.PaidDate.Value.ToString("MM/dd/yyyy") : "&nbsp"

                        );
                }

                MemberClaimHistoryGrid_DataTable = dataTable;
            }

            MemberClaimHistoryGrid.DataSource = MemberClaimHistoryGrid_DataTable;

            MemberClaimHistoryGrid.MasterTableView.DetailTables[0].DataSource = MemberClaimHistoryGrid_ClaimLineTable;

            return;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Int64 forProviderId = 0;

            Int64 forEntityId = 0;


            if (MercuryApplication == null)
            {
                return;
            }


            if (!Page.IsPostBack)
            {
                #region Initial Page Load

                PageInstanceId.Text = Guid.NewGuid().ToString().Replace("-", "");


                if (Request.QueryString["ProviderId"] != null)
                {
                    if (Int64.TryParse((String)Request.QueryString["ProviderId"], out forProviderId))
                    {
                        Provider = MercuryApplication.ProviderGet(forProviderId, true);

                        if (Provider == null)
                        {
                            forProviderId = 0;
                        }
                    }
                }

                else if (Request.QueryString["EntityId"] != null)
                {
                    if (Int64.TryParse((String)Request.QueryString["EntityId"], out forEntityId))
                    {
                        Provider = MercuryApplication.ProviderGetByEntityId(forEntityId, true);

                        if (Provider == null)
                        {
                            forProviderId = 0;
                        }

                        else
                        {
                            forProviderId = Provider.Id;
                        }
                    }
                }


                if (forProviderId == 0)
                {
                    Server.Transfer("/PermissionDenied.aspx"); return;
                }

                Page.Title = "Provider Profile: " + Provider.Entity.Name;

                ProviderDemographicHeaderLabel.Text = Provider.Name;


                #region Note Alert Icons

                Client.Core.Entity.EntityNote entityNote;

                entityNote = MercuryApplication.EntityNoteGetMostRecentByImportance(Provider.EntityId, Mercury.Server.Application.NoteImportance.Warning, false);

                if (entityNote != null)
                {
                    if (entityNote.TerminationDate >= DateTime.Today)
                    {
                        EntityNoteWarning.Style.Clear();

                        EntityNoteWarning.Attributes.Add("title", "[" + entityNote.NoteTypeName + "] " + entityNote.Subject);

                        EntityNoteWarning.Visible = true;
                    }
                }

                entityNote = MercuryApplication.EntityNoteGetMostRecentByImportance(Provider.EntityId, Mercury.Server.Application.NoteImportance.Critical, false);

                if (entityNote != null)
                {
                    if (entityNote.TerminationDate >= DateTime.Today)
                    {
                        EntityNoteCritical.Style.Clear();

                        EntityNoteCritical.Attributes.Add("title", "[" + entityNote.NoteTypeName + "] " + entityNote.Subject);

                        EntityNoteCritical.Visible = true;
                    }
                }

                #endregion


                ProviderDemographicsControl.InstanceId = SessionCachePrefix + "ProviderDemographicsControl";

                ProviderDemographicsControl.AllowUserInteraction = true;

                ProviderDemographicsControl.InitializeProviderDemographics(Provider);


                ProviderAffiliationControl.InstanceId = SessionCachePrefix + "ProviderAffiliationControl";

                ProviderContractControl.InstanceId = SessionCachePrefix + "ProviderContractControl";

                // ProviderServiceLocationControl.InstanceId = SessionCachePrefix + "ProviderServiceLocationControl";


                EntityDocumentHistoryControl.InstanceId = SessionCachePrefix + "ProviderDocumentHistoryControl";

                EntityDocumentHistoryControl.AllowUserInteraction = true;

                // EntityDocumentHistoryControl.Entity = Provider.Entity;


                EntityContactHistoryControl.InstanceId = SessionCachePrefix + "EntityContactHistoryControl";

                // EntityContactHistoryControl.Entity = Provider.Entity;


                EntityNoteHistoryControl.InstanceId = SessionCachePrefix + "EntityNoteHistoryControl";

                // EntityNoteHistoryControl.Entity = Provider.Entity;


                InitializeAll();

                #endregion
            } // Initial Page Load

            else   // Postback

            {
                Page.Title = "Provider Profile: " + Provider.Entity.Name;
            }

            // ApplySecurity ();

            return;
        }