Пример #1
0
        public void Submit(Fill fill)
        {
            //Process Submit button
            var queueState = fill.QueueState;

            // Process Adjudication
            if (!fill.IsAdjudicated && !fill.Prescription.Patient.IsBillingMethodCash)
            {
                fill.QueueState = QueueStates.ThirdPartyRejects;
            }
            else
            {
                fill.IsAdjudicated = true;
            }

            if (fill.IsAdjudicated)
            {
                if (fill.Prescription.Product.DrugClass > 0)
                {
                    fill.QueueState = QueueStates.DUE;
                }
                else
                {
                    fill.IsDUEApproved = true;
                    fill.QueueState = QueueStates.PrintLabel;
                }
            }
            new FillRepository().Update(fill);
        }
Пример #2
0
        public QueueSnapshot GetQueueSnapShot(int queueId)
        {
            QueueSnapshot snapShot = new QueueSnapshot();

                List<PDSFill> selectedPDSFillList = new List<PDSFill>();

                 var pdsQueues = new List<PDSQueue>()
                            {
                                new PDSQueue { StateId = (int)QueueStates.DUE, Name="DUE", Code="DUE"},
                                new PDSQueue { StateId = (int)QueueStates.ThirdPartyRejects, Name="3RD PARTY REJECTS", Code="MAR"},
                                new PDSQueue { StateId = (int)QueueStates.PrintLabel, Name="PRINT LABEL", Code="PLABEL"},
                                new PDSQueue { StateId = (int)QueueStates.RPHVerificaiton, Name="RPH VERIFICATION", Code="RPH"},
                                new PDSQueue { StateId = (int)QueueStates.WillCall, Name="WILL CALL",  Code="WILLCALL"}
                            };

                 using (var context = new PDSEntities())
                 {
                     var groupedFills = context.PDSFills.GroupBy(p => p.State);

                     foreach (var fillGroup in groupedFills)
                     {
                         int stateId = fillGroup.Key.Value;

                         if (pdsQueues.Count(p => p.StateId == stateId) > 0)
                         {
                             pdsQueues.Single(p => p.StateId == stateId).Count = fillGroup.Count();
                         }
                         if (fillGroup.Key.Value == queueId)
                         {
                             selectedPDSFillList = fillGroup.ToList();
                         }
                     }
                 }

                List<Fill> selectedFills = new List<Fill>();
                foreach (var pdsFill in selectedPDSFillList)
                {
                    var fill = new Fill();
                    MapPDSFilltoFill(pdsFill, fill);
                    selectedFills.Add(fill);

                }

                snapShot.Queues = pdsQueues;
                snapShot.SelectedQueueFills = selectedFills;

                return snapShot;
        }
Пример #3
0
        public Fill Create(Fill fill)
        {
            PDSFill pdsFill = null;
                using (var context = new PDSEntities())
                {
                    pdsFill = new PDSFill();
                    MapFilltoPDSFill(fill, pdsFill);

                    context.AddToPDSFills(pdsFill);
                    context.SaveChanges();
                }

                if (pdsFill != null)
                {
                    fill.Id = pdsFill.ID;
                }
                return fill;
        }
Пример #4
0
        public Fill Load(int fillId)
        {
            Fill fill = new Fill { Id = fillId };
                PDSFill pdsFill = null;
                using (var context = new PDSEntities())
                {
                   pdsFill = context.PDSFills.SingleOrDefault(p => p.ID == fillId);
                   if (pdsFill != null)
                   {
                       MapPDSFilltoFill( pdsFill,fill);
                   }
                }

                if(pdsFill != null)
                {
                    fill.Prescription = new PrescriptionRepository().Load(pdsFill.RxID);
                }

                return fill;
        }
Пример #5
0
        private static void PrintLabel(Fill selectedFill)
        {
            var printControl = new PrintLabel(selectedFill);
            printControl.Width = 8.27 * 96;
            printControl.Height = 11.69 * 96;

            //Create a fixed Document and Print the document
            FixedDocument fixedDoc = new FixedDocument();
            PageContent pageContent = new PageContent();
            FixedPage fixedPage = new FixedPage();
            fixedPage.Height = 11.69 * 96;
            fixedPage.Width = 8.27 * 96;

            fixedPage.Children.Add(printControl);
            ((System.Windows.Markup.IAddChild)pageContent).AddChild(fixedPage);
            fixedDoc.Pages.Add(pageContent);

            PrintDialog dialog = new PrintDialog();
            if (dialog.ShowDialog() == true)
            {
                //dialog.PrintVisual(_PrintCanvas, "My Canvas");
                dialog.PrintDocument(fixedDoc.DocumentPaginator, "Print label");
            }
        }
Пример #6
0
 public MARPage(Fill selectedFill)
     : this()
 {
     SelectedFill = selectedFill;
 }
Пример #7
0
        private void MapPDSFilltoFill(PDSFill pdsFill, Fill fill)
        {
            fill.Id = pdsFill.ID;
                try
                {
                    fill.Prescription = new PrescriptionRepository().Load(pdsFill.RxID);
                }
                catch
                {

                }
                fill.DispensedQty = pdsFill.DispensedQty.Value;
                fill.DispensedDate = pdsFill.DispensedDate.Value;
                fill.IsAdjudicated = pdsFill.IsAdjudicated;
                fill.IsDUEApproved = pdsFill.IsDueApproved;
                fill.IsPrintLabelCompleted = pdsFill.IsLabelPrinted;
                fill.IsRPHApproved = pdsFill.IsRPHVerified;
                fill.WrittenQty = pdsFill.WrittenQty.Value;
                fill.DispensedQty = pdsFill.DispensedQty.Value;
                fill.IsSold = pdsFill.IsSold;
                fill.QueueState = (QueueStates)Enum.ToObject(typeof(QueueStates), pdsFill.State.Value);
        }
Пример #8
0
 public Fill Create(Fill fill)
 {
     return new FillRepository().Create(fill);
 }
Пример #9
0
 private void MapFilltoPDSFill(Fill fill, PDSFill pdsFill)
 {
     pdsFill.RxID = fill.Prescription.Id;
         pdsFill.DispensedQty = fill.DispensedQty;
         pdsFill.DispensedDate = fill.DispensedDate;
         pdsFill.IsAdjudicated = fill.IsAdjudicated;
         pdsFill.IsDueApproved = fill.IsDUEApproved;
         pdsFill.IsLabelPrinted = fill.IsPrintLabelCompleted;
         pdsFill.IsRPHVerified = fill.IsRPHApproved;
         pdsFill.WrittenQty = fill.WrittenQty;
         pdsFill.DispensedQty = fill.DispensedQty;
         pdsFill.IsSold = fill.IsSold;
         pdsFill.State = (int)fill.QueueState;
 }
Пример #10
0
 public void PerformRPHVerificaiton(Fill fill)
 {
     fill.IsRPHApproved = true;
     fill.QueueState = QueueStates.WillCall;
     new FillRepository().Update(fill);
 }
Пример #11
0
 public RPHVerificationPage(Fill selecetedFill)
     : this()
 {
     SelectedFill = selecetedFill;
 }
Пример #12
0
 public Fill Update(Fill fill)
 {
     using (var context = new PDSEntities())
         {
             var pdsFill = context.PDSFills.SingleOrDefault(p => p.ID == fill.Id);
             if (pdsFill != null)
             {
                 MapFilltoPDSFill(fill,pdsFill);
             }
             context.SaveChanges();
         }
         return fill;
 }
Пример #13
0
        private void btnSubmit_Click(object sender, RoutedEventArgs e)
        {
            Prescription prescription = new Prescription();
            prescription.Patient = SelectedPatient;
            prescription.Product = SelectedProduct;
            prescription.Prescriber = SelectedPrescriber;
            prescription.SIG = txtSig.Text;
            prescription.WrittenDate = txtWrittenDate.SelectedDate.Value;
            prescription.ExpirationDate = prescription.WrittenDate.Add(new TimeSpan(365,0,0,0));

            Int32 refills;
            Int32.TryParse(txtRefills.Text, out refills);

            prescription.RefillsAllowed = refills;
                            //Create the Fills
            prescription = new PrescriptionManager().Create(prescription);

            Fill fill = new Fill();
            fill.Prescription = prescription;
            fill.RefillsAllowed = refills;

            Int32 writtenQty;
            Int32.TryParse(txtWrittenQty.Text, out writtenQty);

            fill.WrittenQty = writtenQty;
            fill.DispensedQty = writtenQty;

            fill.QueueState = QueueStates.RxEntry;
            fill.DispensedDate = DateTime.Today;

            var createdFill = new FillManager().Create(fill);

            //Submit the Fill
            new FillManager().Submit(createdFill);

            NavigationService.GoBack();
        }
Пример #14
0
 public void ApproveDUE(Fill fill)
 {
     fill.IsDUEApproved = true;
     fill.QueueState = QueueStates.PrintLabel;
     new FillRepository().Update(fill);
 }
Пример #15
0
 public void PrintLabel(Fill fill)
 {
     fill.IsPrintLabelCompleted = true;
     fill.QueueState = QueueStates.RPHVerificaiton;
     new FillRepository().Update(fill);
 }
Пример #16
0
 public void Sell(Fill fill)
 {
     fill.IsSold = true;
     fill.QueueState = QueueStates.Sold;
     new FillRepository().Update(fill);
 }
Пример #17
0
 public void ReSubmit(Fill fill)
 {
     fill.IsAdjudicated = true;
     Submit(fill);
 }