示例#1
0
        private void MenuItemAcknowledge_Click(object sender, RoutedEventArgs e)
        {
            if (this.ListViewReportDistributionLog.SelectedItems.Count > 0)
            {
                JArray idList = new JArray();
                foreach (DistributionLog distributionLog in this.ListViewReportDistributionLog.SelectedItems)
                {
                    idList.Add(distributionLog.TestOrderReportDistributionId);
                }

                JObject   jsonRequest = APIRequestHelper.GetAcknowledgeDistributionsMessage(idList);
                APIResult apiResult   = APIRequestHelper.SubmitAPIRequestMessage(jsonRequest);

                MethodResult methodResult = DistributionLogCollection.GetByNotAcknowledged();
                if (methodResult.Success == true)
                {
                    this.m_DistributionLog = (DistributionLogCollection)methodResult.Result;
                    this.NotifyPropertyChanged(string.Empty);
                }
            }
        }
        public static MethodResult GetByPatientName(PatientName patientName)
        {
            string clientIdList = AuthenticatedUser.Instance.GetSQLClientIdInList();

            BillingLogCollection billingLogCollection = new BillingLogCollection();
            string commandText = FIELDLIST;

            commandText += "from tblAccessionOrder ao ";
            commandText += "join tblPanelSetOrder pso on ao.MasterAccessionNo = pso.MasterAccessionNo ";
            commandText += "join tblPanelSetOrderCPTCodeBill psoc on pso.ReportNo = psoc.ReportNo ";
            commandText += "where ao.ClientId in (" + clientIdList + ") ";

            if (patientName.LastName != null && patientName.FirstName != null)
            {
                commandText = commandText + "and PLastName like '" + patientName.LastName + "%' and pFirstName like '" + patientName.FirstName + "%' order by ao.AccessionDate desc";
            }

            if (patientName.LastName != null && patientName.FirstName == null)
            {
                commandText = $"{commandText} and PLastName like '{patientName.LastName}%' order by ao.AccessionDate desc;";
            }

            if (patientName.LastName != null)
            {
                JObject   jsonRequest = APIRequestHelper.CreateSubmitSQLCommandMessage(commandText);
                APIResult apiResult   = APIRequestHelper.SubmitAPIRequestMessage(jsonRequest);
                BillingLogCollection.Build(apiResult.JSONResult, billingLogCollection);

                MethodResult methodResult = new MethodResult();
                methodResult.AddResult(apiResult.JSONResult, billingLogCollection);
                return(methodResult);
            }
            else
            {
                MethodResult methodResult = new MethodResult();
                methodResult.Success = false;
                methodResult.Messages.Add("Invalid patient name.");
                return(methodResult);
            }
        }
        public static MethodResult GetByDateOfBirth(DateTime dateOfBirth)
        {
            string clientIdList = AuthenticatedUser.Instance.GetSQLClientIdInList();

            BillingLogCollection billingLogCollection = new BillingLogCollection();
            string commandText = FIELDLIST;

            commandText += "from tblAccessionOrder ao ";
            commandText += "join tblPanelSetOrder pso on ao.MasterAccessionNo = pso.MasterAccessionNo ";
            commandText += "join tblPanelSetOrderCPTCodeBill psoc on pso.ReportNo = psoc.ReportNo ";
            commandText += "where ao.ClientId in (" + clientIdList + ") and ao.PBirthDate = '" + dateOfBirth.ToString("yyyyMMdd") + "';";

            JObject   jsonRequest = APIRequestHelper.CreateSubmitSQLCommandMessage(commandText);
            APIResult apiResult   = APIRequestHelper.SubmitAPIRequestMessage(jsonRequest);

            BillingLogCollection.Build(apiResult.JSONResult, billingLogCollection);

            MethodResult methodResult = new MethodResult();

            methodResult.AddResult(apiResult.JSONResult, billingLogCollection);
            return(methodResult);
        }
示例#4
0
        public static MethodResult GetByNotAcknowledged()
        {
            string clientIdList = AuthenticatedUser.Instance.GetSQLClientIdInList();

            DistributionLogCollection distributionLogCollection = new DistributionLogCollection();
            string commandText = FIELDLIST;

            commandText += "from tblTestOrderReportDistribution tord ";
            commandText += "join tblPanelSetOrder pso on tord.ReportNo = pso.ReportNo ";
            commandText += "join tblAccessionOrder ao on pso.MasterAccessionNo = ao.MasterAccessionNo ";
            commandText += "where tord.ClientId in (" + clientIdList + ") and tord.DistributionType = 'Web Service' and tord.Distributed = 1 and tord.Acknowledged = 0 limit 500;";

            JObject   jsonRequest = APIRequestHelper.CreateSubmitSQLCommandMessage(commandText);
            APIResult apiResult   = APIRequestHelper.SubmitAPIRequestMessage(jsonRequest);

            DistributionLogCollection.Build(apiResult.JSONResult, distributionLogCollection);

            MethodResult methodResult = new MethodResult();

            methodResult.AddResult(apiResult.JSONResult, distributionLogCollection);
            return(methodResult);
        }
        private void DoPatientNameSearch()
        {
            PatientName patientName = null;
            bool        result      = PatientName.TryParse(this.m_PatientNameSearch, out patientName);

            if (result)
            {
                MethodResult methodResult = BillingLogCollection.GetByPatientName(patientName);
                if (methodResult.Success == true)
                {
                    this.m_BillingLogCollection = (BillingLogCollection)methodResult.Result;
                    this.NotifyPropertyChanged(string.Empty);
                }
                else
                {
                    methodResult.ShowMethodResult();
                }
            }
            else
            {
                MessageBox.Show("Must have at least 2 characters for a patient name search.");
            }
        }
        public static MethodResult GetByRecentPostedCases()
        {
            string clientIdList = AuthenticatedUser.Instance.GetSQLClientIdInList();

            BillingLogCollection billingLogCollection = new BillingLogCollection();
            string commandText = FIELDLIST;

            commandText += "from tblAccessionOrder ao ";
            commandText += "join tblPanelSetOrder pso on ao.MasterAccessionNo = pso.MasterAccessionNo ";
            commandText += "join tblPanelSetOrderCPTCodeBill psoc on pso.ReportNo = psoc.ReportNo ";
            commandText += $"where ao.ClientId in ({clientIdList}) ";
            commandText += $"and psoc.PostDate >= '{DateTime.Today.AddDays(-45).ToString("yyyy-MM-dd")}' order by ao.AccessionDate desc;";

            JObject   jsonRequest = APIRequestHelper.CreateSubmitSQLCommandMessage(commandText);
            APIResult apiResult   = APIRequestHelper.SubmitAPIRequestMessage(jsonRequest);

            BillingLogCollection.Build(apiResult.JSONResult, billingLogCollection);

            MethodResult methodResult = new MethodResult();

            methodResult.AddResult(apiResult.JSONResult, billingLogCollection);
            return(methodResult);
        }
示例#7
0
        public MethodResult IsOkToInsert()
        {
            MethodResult result  = new MethodResult();
            bool         success = true;

            if (string.IsNullOrEmpty(this.PFirstName) == true)
            {
                success = false;
            }
            if (string.IsNullOrEmpty(this.PLastName) == true)
            {
                success = false;
            }
            if (this.PBirthdate.HasValue == false)
            {
                success = false;
            }

            if (success == false)
            {
                result.AddResult("We can't save your order because the First Name, Last Name and Birthdate cannot be blank. Would you like to continue without saving?", false);
            }
            return(result);
        }
示例#8
0
        public static MethodResult GetByRecentPostedCases()
        {
            string clientIdList = AuthenticatedUser.Instance.GetSQLClientIdInList();

            DistributionLogCollection distributionLogCollection = new DistributionLogCollection();
            string commandText = FIELDLIST;

            commandText += "from tblTestOrderReportDistribution tord ";
            commandText += "join tblPanelSetOrder pso on tord.ReportNo = pso.ReportNo ";
            commandText += "join tblAccessionOrder ao on pso.MasterAccessionNo = ao.MasterAccessionNo ";
            commandText += $"where tord.ClientId in ({clientIdList}) and tord.Distributed = 1 ";
            commandText += "and tord.DistributionType = 'Web Service' ";
            commandText += $"and tord.timeOfLastDistribution >= '{DateTime.Today.AddDays(-45).ToString("yyyy-MM-dd")}' order by tord.timeOfLastDistribution desc;";

            JObject   jsonRequest = APIRequestHelper.CreateSubmitSQLCommandMessage(commandText);
            APIResult apiResult   = APIRequestHelper.SubmitAPIRequestMessage(jsonRequest);

            DistributionLogCollection.Build(apiResult.JSONResult, distributionLogCollection);

            MethodResult methodResult = new MethodResult();

            methodResult.AddResult(apiResult.JSONResult, distributionLogCollection);
            return(methodResult);
        }