예제 #1
0
 public static void Build(JObject jsonResult, BillingLogCollection billingLogCollection)
 {
     if (jsonResult["result"]["results"] != null)
     {
         for (int i = 0; i < jsonResult["result"]["results"].Count(); i++)
         {
             BillingLog billingLog = new BillingLog();
             billingLog.FromSql((JObject)jsonResult["result"]["results"][i]);
             billingLogCollection.Add(billingLog);
         }
     }
 }
 private void DoCategoryTypeSearch()
 {
     if (this.m_CategorySearchType == "Recent Cases")
     {
         MethodResult methodResult = BillingLogCollection.GetByRecentPostedCases();
         if (methodResult.Success == true)
         {
             this.m_BillingLogCollection = (BillingLogCollection)methodResult.Result;
             this.NotifyPropertyChanged(string.Empty);
         }
         else
         {
             methodResult.ShowMethodResult();
         }
     }
 }
 private void DoDateOfBirthSearch()
 {
     if (this.m_DateOfBirthSearch.HasValue == true)
     {
         MethodResult methodResult = BillingLogCollection.GetByDateOfBirth(this.m_DateOfBirthSearch.Value);
         if (methodResult.Success == true)
         {
             this.m_BillingLogCollection = (BillingLogCollection)methodResult.Result;
             this.NotifyPropertyChanged(string.Empty);
         }
         else
         {
             methodResult.ShowMethodResult();
         }
     }
     else
     {
         MessageBox.Show("Please enter a valid Date Of Birth.");
     }
 }
예제 #4
0
        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);
            }
        }
예제 #5
0
        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);
        }
        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.");
            }
        }
예제 #7
0
        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);
        }