Beispiel #1
0
    public ILC(String id, String accessionNumber, String user)
    {
        DataTable ILCMessages = DL_ILC.getILCMessages(id, user);

        if (ILCMessages == null)
        {
            this.IsValid = false;
        }
        else if (ILCMessages.Rows.Count < 1)
        {
            this.IsValid = false;
        }
        else
        {
            _isValid               = true;
            _rowId                 = id;
            _accession             = new Accession(accessionNumber);
            _tubeLocation          = AccessionExtended.getSpecimenLocation(accessionNumber);
            _previousCommunication = ILCMessages;
            _testsString           = DL_ILC.getILCTestsString(id);
            _defaultToLab          = DL_ILC.getDefaultILCToLab(id);
        }
    }
Beispiel #2
0
 public static String getSpecimenLocation(String accessionNumber)
 {
     return(AccessionExtended.getSpecimenLocation(DL_Accession.getSpecimenLocation(accessionNumber)));
 }
Beispiel #3
0
    public void loadDetails()
    {
        dateTimeFormat = AtlasIndia.AntechCSM.functions.getDateTimeFormat();
        if (this.IsValid)
        {
            DataTable accessionDetail = DL_Accession.getExtendedAccessionDetails(this.AccessionNumber);
            DataRow   dr = accessionDetail.Rows[0];

            this.MiniLogDateTime    = AtlasIndia.AntechCSM.functions.AddTimeToDateNullable(dr["MiniLogDate"].ToString(), dr["MiniLogTime"].ToString());
            this.MiniLogger         = dr["MiniLoggerInitial"].ToString();
            this.MiniLoggerDispName = dr["MiniLoggerInitialDispName"].ToString();
            this.MaxiLogDateTime    = AtlasIndia.AntechCSM.functions.AddTimeToDateNullable(dr["MaxiLogDate"].ToString(), dr["MaxiLogTime"].ToString());
            this.MaxiLogger         = dr["MaxiLoggerInitials"].ToString();
            this.MaxiLoggerDispName = dr["MaxiLoggerInitialsDispName"].ToString();
            this.CollectedDateTime  = AtlasIndia.AntechCSM.functions.AddTimeToDateNullable(dr["CollectionDateText"].ToString(), dr["CollectionTimeText"].ToString());
            this.ReceivedDateTime   = AtlasIndia.AntechCSM.functions.AddTimeToDateNullable(dr["ReceivedDate"].ToString(), dr["ReceivedTime"].ToString());
            this.InternalNotes      = dr["LabMessage"].ToString();
            this.ExternalNotes      = dr["ReportNotes"].ToString();

            ///<Commented aagrawal 5/17/2008>
            //this.IsCritical = (dr["IsCritical"].ToString() == "N") ? false : true;
            ///</Commented aagrawal 5/17/2008>

            ///<Added aagrawal 5/17/2008>
            this.CriticalInfo = dr["CriticalInfo"].ToString();
            ///</Added aagrawal 5/17/2008>

            this.ChartNumber    = dr["ChartNumber"].ToString();
            this.AutoDial       = dr["AutoDial"].ToString();
            this.PetName        = dr["PetName"].ToString();
            this.ClientID       = dr["ClientNumber"].ToString();
            this.ClientName     = dr["ClientName"].ToString();
            this.ClientMnemonic = dr["ClientMnemonic"].ToString();
            this.OwnerName      = dr["OwnerName"].ToString();
            this.Sex            = dr["Sex"].ToString();
            this.Species        = dr["Species"].ToString();
            this.Breed          = dr["Breed"].ToString();
            this.Age            = dr["Age"].ToString();
            this.Doctor         = dr["Doctor"].ToString();
            this.DoctorPhone    = dr["DoctorPhone"].ToString();
            this.Requisition    = dr["RequisitionNumber"].ToString();
            this.BillTo         = dr["BillTo"].ToString();
            this.RecheckNumber  = dr["RecheckNumber"].ToString();

            ///<Commented aagrawal 5/17/2008>
            //this.ZoaReq = (dr["ZoasisRequest"].ToString() == "N") ? false : true;
            ///</Commented aagrawal 5/17/2008>

            ///<Added aagrawal 5/17/2008>
            this.ZoasisRequest = dr["ZoasisRequest"].ToString();
            ///</Added aagrawal 5/17/2008>

            ///<Commented aagrawal 5/17/2008>
            //this.OrderedDateTime = AtlasIndia.AntechCSM.functions.AddTimeToDate(dr["OrderedDate"].ToString(), dr["OrderedTime"].ToString());
            ///</Commented aagrawal 5/17/2008>

            ///<Added aagrawal 5/17/2008>
            this.OrderedDateTime = this.MaxiLogDateTime;
            ///</Added aagrawal 5/17/2008>

            this.TestsOrdered = dr["TestsOrdered"].ToString();

            ///<Added aagrawal 5/17/2008>
            this.SpecimenSubmitted = dr["SpecimenSubmitted"].ToString();
            ///</Added aagrawal 5/17/2008>

            ///<Commented aagrawal 5/17/2008>
            //this.SpecimenSubmittedInformation = dr["SpecimenSubmittedInformation"].ToString();
            //this.SpecimenSubmittedVolume = dr["SpecimenSubmittedVolume"].ToString();
            ///</Commented aagrawal 5/17/2008>

            this.LabMessage  = dr["LabMessage"].ToString();
            this.ReportNotes = dr["ReportNotes"].ToString();

            this.InquiryNotes    = GetInquiryNotes(this.AccessionNumber);
            this.HasInquiryNotes = (this.InquiryNotes.Length > 0 ? true : false);
            this.ClientTimeZone  = dr["ClientTimeZone"].ToString(); //SSM 20/10/2011 #114978 AntechCSM 2B - Assigning ClientTimeZone value from Database

            this.Requests = GetRequests(this.AccessionNumber);

            if (Int32.TryParse(dr["SpecimenAge"].ToString(), out _specimenAge))
            {
                // TO DO: Value is hard coded, that need to be moved to global config file and the access method also need to be placed in a class.
                Int32 SPECIMEN_VALIDITY_PERIOD = 7;
                if (this.SpecimenAge >= SPECIMEN_VALIDITY_PERIOD)
                {
                    this.NewRequestAlertMessage = "The Specimen is " + this.SpecimenAge + " Days old. New Add-on/Verification request cannot be taken.";
                }
                else
                {
                    this.NewRequestAlertMessage = "The Specimen is " + this.SpecimenAge + " Days old. New Add-on/Verification request can be taken.";
                }
            }
            else
            {
                this.NewRequestAlertMessage = "The specimen age is not specified. New Add-on/Verification request can be taken.";
            }

            this.SpecimenLocationList = DL_Accession.getSpecimenLocation(this.AccessionNumber);
            this.SpecimenLocation     = AccessionExtended.getSpecimenLocation(this.SpecimenLocationList);

            #region Moved in getSpecimenLocation()
            //System.Text.StringBuilder specimenLocationInformationBuilder = new System.Text.StringBuilder();
            //string previousLabLocation = string.Empty;
            //foreach (DataRow tmpRow in this.SpecimenLocationList.Rows)
            //{
            //    string currentLabLocation = tmpRow["LabName"].ToString();
            //    if (String.Compare(currentLabLocation, previousLabLocation) != 0)
            //    {
            //        previousLabLocation = currentLabLocation;
            //        specimenLocationInformationBuilder.AppendLine();
            //        specimenLocationInformationBuilder.Append("Tube assigned to Location: ");
            //        specimenLocationInformationBuilder.AppendLine(currentLabLocation);
            //    }
            //    specimenLocationInformationBuilder.Append("Date: ");
            //    DateTime tmpLocationDate;
            //    if (DateTime.TryParse(tmpRow["LocationDate"].ToString(), out tmpLocationDate))
            //    {
            //        specimenLocationInformationBuilder.Append(tmpLocationDate.ToString("MM/dd/yyyy"));
            //    }
            //    specimenLocationInformationBuilder.Append("\t");
            //    specimenLocationInformationBuilder.Append(" Rack: ");
            //    specimenLocationInformationBuilder.Append(tmpRow["LocationRack"].ToString());
            //    specimenLocationInformationBuilder.Append("\t");
            //    specimenLocationInformationBuilder.Append(" Position: ");
            //    specimenLocationInformationBuilder.Append(tmpRow["LocationPosition"].ToString());
            //    specimenLocationInformationBuilder.Append("\t");
            //    specimenLocationInformationBuilder.Append(" Scanned By: ");
            //    specimenLocationInformationBuilder.AppendLine(tmpRow["User"].ToString());
            //}
            //if (specimenLocationInformationBuilder.Length > 1)
            //{
            //    specimenLocationInformationBuilder.Remove(0, 2);
            //}
            //this.SpecimenLocation = specimenLocationInformationBuilder.ToString();
            #endregion Moved in getSpecimenLocation()


            this.UnitsOrdered            = DL_Accession.getUnitsOrdered(this.AccessionNumber);
            this.AccessionOrderUnitsList = new System.Collections.Generic.List <Unit_ScaledDown>();
            foreach (DataRow unitRow in this.UnitsOrdered.Rows)
            {
                this.AccessionOrderUnitsList.Add(new Unit_ScaledDown(this.AccessionNumber, this.Species, this.Sex, unitRow, false));
            }

            this.SatelliteTable = DL_Accession.getSatelliteInformation(this.AccessionNumber);

            System.Collections.Generic.Dictionary <string, string> labFilter  = new System.Collections.Generic.Dictionary <string, string>();
            System.Collections.Generic.Dictionary <string, string> userFilter = new System.Collections.Generic.Dictionary <string, string>();

            System.Text.StringBuilder satelliteInformationBuilder = new System.Text.StringBuilder();
            System.Text.StringBuilder labListBuilder  = new System.Text.StringBuilder();
            System.Text.StringBuilder userListBuilder = new System.Text.StringBuilder();

            satelliteInformationBuilder.Append("Unit Code");
            satelliteInformationBuilder.Append("\t");
            satelliteInformationBuilder.AppendLine("Reporting Title");
            satelliteInformationBuilder.AppendLine("-----------------------------------");

            foreach (DataRow satelliteRow in this.SatelliteTable.Rows)
            {
                satelliteInformationBuilder.Append(satelliteRow["UnitCode"].ToString());
                satelliteInformationBuilder.Append("\t");

                ///<Commented aagrawal 5/17/2008>
                //satelliteInformationBuilder.AppendLine(satelliteRow["UnitTitle"].ToString());
                ///</Commented aagrawal 5/17/2008>

                ///<Added aagrawal 5/17/2008>
                satelliteInformationBuilder.Append(satelliteRow["UnitTitle"].ToString());
                satelliteInformationBuilder.Append(" (");
                satelliteInformationBuilder.Append(satelliteRow["UnitSpecimenType"].ToString());
                satelliteInformationBuilder.AppendLine(")");
                ///</Added aagrawal 5/17/2008>

                satelliteInformationBuilder.Append("\t");

                ///<Commented aagrawal 5/20/2008>
                //DateTime receivedDateTime;
                //receivedDateTime = AtlasIndia.AntechCSM.functions.AddTimeToDate(satelliteRow["ReceivedDate"].ToString(), satelliteRow["ReceivedTime"].ToString());
                //satelliteInformationBuilder.Append(receivedDateTime.ToString("MM/dd/yyyy HH:mm"));
                ///</Commented aagrawal 5/20/2008>

                ///<Added aagrawal 5/20/2008>
                DateTime?receivedDateTime = AtlasIndia.AntechCSM.functions.AddTimeToDateNullable(satelliteRow["ReceivedDate"].ToString(), satelliteRow["ReceivedTime"].ToString());
                satelliteInformationBuilder.Append((receivedDateTime.HasValue) ? receivedDateTime.Value.ToString(dateTimeFormat) : String.Empty);
                ///</Added aagrawal 5/20/2008>

                satelliteInformationBuilder.Append("\t");
                satelliteInformationBuilder.Append(satelliteRow["ReceivedMode"].ToString());
                satelliteInformationBuilder.Append(" at ");
                satelliteInformationBuilder.Append(satelliteRow["LabID"].ToString());
                satelliteInformationBuilder.Append("\t by ");
                satelliteInformationBuilder.AppendLine(satelliteRow["UserID"].ToString());
                satelliteInformationBuilder.AppendLine();

                if (!labFilter.ContainsKey(satelliteRow["LabID"].ToString()))
                {
                    labFilter.Add(satelliteRow["LabID"].ToString(), satelliteRow["LabName"].ToString());
                    labListBuilder.AppendLine("\t" + satelliteRow["LabID"].ToString() + " = " + satelliteRow["LabName"].ToString());
                }
                if (!userFilter.ContainsKey(satelliteRow["UserID"].ToString()))
                {
                    userFilter.Add(satelliteRow["UserID"].ToString(), satelliteRow["UserFirstLastName"].ToString());
                    userListBuilder.AppendLine("\t" + satelliteRow["UserID"].ToString() + " = " + satelliteRow["UserFirstLastName"].ToString());
                }
            }
            satelliteInformationBuilder.AppendLine("Company Key:");
            satelliteInformationBuilder.AppendLine(labListBuilder.ToString());

            satelliteInformationBuilder.AppendLine("Username Key:");
            satelliteInformationBuilder.AppendLine(userListBuilder.ToString());

            this.SatelliteInformation = satelliteInformationBuilder.ToString();
        }
    }