예제 #1
0
        private static void ReResolveResearchChecks(string uploadedFile, string disposition)
        {
            CheckManager.Init();

            List <Check> researchChecks = CheckManager.GetResearchChecks();
            List <Check> excelChecks    = CheckManager.GetExcelChecks(uploadedFile, disposition);

            CheckManager.DetermineReResolvedChecks(excelChecks, researchChecks);

            // Remove the set of resolved checks determined above from the Research Table.
            // CheckManager.RemoveReResolvedChecks();
        }
예제 #2
0
        public static void UpdateResearchTableFromOrigenBankFile(string uploadedFile, string disposition)
        {
            CheckManager.Init();

            List <Check> excelChecks    = CheckManager.GetExcelChecks(uploadedFile, disposition);
            List <Check> researchChecks = CheckManager.GetResearchChecks();

            List <CheckViewModel> resolvedChecks = CheckManager.GetResolvedChecks(excelChecks, disposition, researchChecks);

            CheckManager.ResolveResearchChecks(resolvedChecks);

            // Resolving pocket checks is simply a matter of deleting any pocket check
            // whose corresponding research check has been resolved by the preceding call.
            CheckManager.ResolvePocketChecks(resolvedChecks);
        }
예제 #3
0
        public static List <ImportRow> GetImportRows()
        {
            List <Check>     researchChecks = CheckManager.GetResearchChecks();
            List <ImportRow> importRows     = new List <ImportRow>();

            // Each resolved check creates a new import row or updates an existing one.
            foreach (CheckViewModel resolvedCheck in CheckManager.GetResolvedChecksAsList())
            {
                string disposition = resolvedCheck.Disposition;   //GetDispositionFromCheck(resolvedCheck);

                if (disposition != null && !disposition.Equals("Unknown"))
                {
                    List <ImportRow> irows = (from irow in importRows
                                              where irow.LBVDCheckNum == resolvedCheck.Num ||
                                              irow.LBVDCheckNum2 == resolvedCheck.Num ||
                                              irow.LBVDCheckNum3 == resolvedCheck.Num ||
                                              irow.TIDCheckNum == resolvedCheck.Num ||
                                              irow.TIDCheckNum2 == resolvedCheck.Num ||
                                              irow.TIDCheckNum3 == resolvedCheck.Num ||
                                              irow.TDLCheckNum == resolvedCheck.Num ||
                                              irow.TDLCheckNum2 == resolvedCheck.Num ||
                                              irow.TDLCheckNum3 == resolvedCheck.Num ||
                                              irow.MBVDCheckNum == resolvedCheck.Num ||
                                              irow.MBVDCheckNum2 == resolvedCheck.Num ||
                                              irow.MBVDCheckNum3 == resolvedCheck.Num

                                              // Supporting document checks

                                              /*
                                              || irow.SDCheckNum1 == resolvedCheck.Num
                                              || irow.SDCheckNum2 == resolvedCheck.Num
                                              || irow.SDCheckNum3 == resolvedCheck.Num
                                              ||
                                              || irow.SDCheckNum12 == resolvedCheck.Num
                                              || irow.SDCheckNum22 == resolvedCheck.Num
                                              || irow.SDCheckNum32 == resolvedCheck.Num
                                              ||
                                              || irow.SDCheckNum13 == resolvedCheck.Num
                                              || irow.SDCheckNum23 == resolvedCheck.Num
                                              || irow.SDCheckNum33 == resolvedCheck.Num
                                              */

                                              // Does resolvedCheck match an existing importRow by ID?
                                              // This is the case where there is more than one check on an import row, IR,
                                              // and resolvedCheck will be used to update row IR.
                                              || (resolvedCheck.InterviewRecordID != 0 && irow.InterviewRecordID == resolvedCheck.InterviewRecordID) ||
                                              (resolvedCheck.RecordID != 0 && irow.RecordID == resolvedCheck.RecordID)
                                              select irow).ToList();

                    if (irows.Count() == 0)
                    {
                        // There is no import row representing this resolved check.
                        // Create one.
                        importRows.Add(NewImportRow(researchChecks, resolvedCheck, disposition));
                    }
                    else
                    {
                        bool added = false;

                        foreach (ImportRow irow in irows)
                        {
                            if ((resolvedCheck.Service == "LBVD" || resolvedCheck.Service == "LBVD2" || resolvedCheck.Service == "LBVD3" ||
                                 resolvedCheck.Service == "TID" || resolvedCheck.Service == "TID2" || resolvedCheck.Service == "TID3" ||
                                 resolvedCheck.Service == "TDL" || resolvedCheck.Service == "TDL2" || resolvedCheck.Service == "TDL3" ||
                                 resolvedCheck.Service == "MBVD" || resolvedCheck.Service == "MBVD2" || resolvedCheck.Service == "MBVD3")
                                &&
                                ((resolvedCheck.InterviewRecordID != 0 && resolvedCheck.InterviewRecordID != irow.InterviewRecordID)
                                 ||
                                 (resolvedCheck.RecordID != 0 && resolvedCheck.RecordID != irow.RecordID)))
                            {
                                // Case of same check number being used for multiple
                                // birth certificates.
                                if (!added)
                                {
                                    // Log.Debug(string.Format("resolvedCheck: RecordID {0}, InterviewRecordID {1}, Num: {2}, Name: {3}", resolvedCheck.RecordID, resolvedCheck.InterviewRecordID, resolvedCheck.Num, resolvedCheck.Name));
                                    importRows.Add(NewImportRow(researchChecks, resolvedCheck, disposition));
                                    // Prevent the same resolved check from being added twice.
                                    added = true;
                                }
                            }
                            else
                            {
                                // Found row among existing import rows. There is more than one check
                                // number on this row. In other words, the client had more than
                                // one check written for the visit this row corresponds to.
                                UpdateExistingImportRow(resolvedCheck, disposition, irow);
                            }
                        }
                    }
                }
            }

            return(importRows);
        }