コード例 #1
0
        public static MethodResult GetByPatientName(PatientName patientName)
        {
            string clientIdList = AuthenticatedUser.Instance.GetSQLClientIdInList();

            ClientOrderCollection clientOrderCollection = new ClientOrderCollection();
            string commandText = $"Select * from tblClientOrder where ClientId in ({clientIdList}) and PanelSetId = 400 ";

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

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

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

                MethodResult methodResult = new MethodResult();
                methodResult.AddResult(apiResult.JSONResult, clientOrderCollection);
                return(methodResult);
            }
            else
            {
                MethodResult methodResult = new MethodResult();
                methodResult.Success = false;
                methodResult.Messages.Add("Invalid patient name.");
                return(methodResult);
            }
        }
コード例 #2
0
 public static void Build(APIResult apiResult, ClientOrderCollection clientOrderCollection)
 {
     for (int i = 0; i < apiResult.JSONResult["result"]["results"].Count(); i++)
     {
         ClientOrder clientOrder = new ClientOrder();
         clientOrder.FromSql((JObject)apiResult.JSONResult["result"]["results"][i]);
         clientOrderCollection.Add(clientOrder);
     }
 }
コード例 #3
0
        public static ClientOrderCollection GetNotAccessionedOrders(string clientIdList)
        {
            string                commandText           = $"Select * from tblClientOrder where ClientId in ({clientIdList}) and PanelSetId = 400 and IsMasterOrder = 0 and Accessioned = 0 order by OrderTime desc limit 1000;";
            JObject               request               = APIRequestHelper.CreateSubmitSQLCommandMessage(commandText);
            APIResult             apiResult             = APIRequestHelper.SubmitAPIRequestMessage(request);
            ClientOrderCollection clientOrderCollection = new ClientOrderCollection();

            Build(apiResult, clientOrderCollection);
            return(clientOrderCollection);
        }
コード例 #4
0
 private void ToolBarButtonEdit_Click(object sender, RoutedEventArgs e)
 {
     if (this.ListViewOrderLog.SelectedItem != null)
     {
         ClientOrder stagnantClientOrder = (ClientOrder)this.ListViewOrderLog.SelectedItem;
         ClientOrder freshClientOrder    = ClientOrderCollection.GetByClientOrderId(stagnantClientOrder.ClientOrderId);
         freshClientOrder.RowOperationType = RowOperationTypeEnum.Update;
         ClientOrderEditDialog clientOrderEditDialog = new ClientOrderEditDialog(freshClientOrder);
         clientOrderEditDialog.Closed += ClientOrderEditDialog_Closed;
         clientOrderEditDialog.ShowDialog();
     }
 }
コード例 #5
0
 private void DoCategorySearchType()
 {
     if (this.m_CategorySearchType == "Recent Orders")
     {
         this.m_ClientOrderCollection = ClientOrderCollection.GetRecentOrdersByClientId(AuthenticatedUser.Instance.GetSQLClientIdInList());
         this.NotifyPropertyChanged("ClientOrderCollection");
     }
     else if (this.m_CategorySearchType == "Master Orders")
     {
         this.m_ClientOrderCollection = ClientOrderCollection.GetMasterOrders(AuthenticatedUser.Instance.GetSQLClientIdInList());
         this.NotifyPropertyChanged("ClientOrderCollection");
     }
     else if (this.m_CategorySearchType == "Not received at YPI")
     {
         this.m_ClientOrderCollection = ClientOrderCollection.GetNotAccessionedOrders(AuthenticatedUser.Instance.GetSQLClientIdInList());
         this.NotifyPropertyChanged("ClientOrderCollection");
     }
 }
コード例 #6
0
 private void MenuItemCreateOrderFromMaster_Click(object sender, RoutedEventArgs e)
 {
     if (this.ListViewOrderLog.SelectedItems.Count > 0)
     {
         foreach (ClientOrder clientOrder in this.ListViewOrderLog.SelectedItems)
         {
             if (clientOrder.IsMasterOrder == true)
             {
                 ClientOrder stagnantClientOrder = clientOrder;
                 ClientOrder freshClientOrder    = ClientOrderCollection.GetByClientOrderId(stagnantClientOrder.ClientOrderId);
                 ClientOrder cloned = freshClientOrder.CreateNewFromMaster();
                 cloned.Save();
             }
         }
         MessageBox.Show("Orders have been created.");
     }
     else
     {
         MessageBox.Show("Please select one or more orders to copy.");
     }
 }
コード例 #7
0
        private void DoPatientNameSearch()
        {
            PatientName patientName = null;
            bool        result      = PatientName.TryParse(this.m_PatientNameSearch, out patientName);

            if (result)
            {
                MethodResult methodResult = ClientOrderCollection.GetByPatientName(patientName);
                if (methodResult.Success == true)
                {
                    this.m_ClientOrderCollection = (ClientOrderCollection)methodResult.Result;
                    this.NotifyPropertyChanged(string.Empty);
                }
                else
                {
                    methodResult.ShowMethodResult();
                }
            }
            else
            {
                MessageBox.Show("Must have at least 2 characters for a patient name search.");
            }
        }