Example #1
0
 public void FromAliquotOrder(string aliquotOrderId, string aliquotLabel, string masterAccessionNo, string pLastName, string pFirstName)
 {
     this.m_AliquotOrderId = aliquotOrderId;
     this.m_MasterAccessionNo = masterAccessionNo;
     YellowstonePathology.Business.PatientName patientName = new PatientName(pLastName, pFirstName);
     this.m_PatientInitials = patientName.GetInitials();
     this.m_AliquotLabel = aliquotLabel;
 }
 public void FromLegacyAliquotOrder(string aliquotOrderId, string aliquotLabel, string reportNo, string pLastName, string pFirstName)
 {
     this.m_AliquotOrderId = aliquotOrderId;
     this.m_ReportNo = reportNo;
     YellowstonePathology.Business.PatientName patientName = new PatientName(pLastName, pFirstName);
     this.m_PatientInitials = patientName.GetInitials();
     this.m_AliquotLabel = aliquotLabel;
 }
        public void Equals_DoesNotMatchNull()
        {
            // Arrange
            var patientName = new PatientName("test");

            // Act
            var result = patientName.Equals(null);

            // Arrange
            Assert.That(result, Is.False);
        }
        public void Contains_ReturnsExpectedValue(string name, object value, bool expectedValue)
        {
            // Arrange
            var patientName = new PatientName(name);

            // Act
            var result = patientName.Contains(value);

            // Assert
            Assert.That(result, Is.EqualTo(expectedValue));
        }
        public void WriteJson_SerializesCorrectly()
        {
            // Arrange  
            var testPatientName = new PatientName("Doe^John");
            
            // Act
            var result = JsonConvert.SerializeObject(testPatientName);

            // Assert
            Assert.That(result, Is.EqualTo("\"Doe^John\""));
        }
        public void Equals_MatchEqualObject(string firstName, string secondName, bool expectedResult)
        {
            // Arrange
            var firstPatientName = new PatientName(firstName);
            var secondPatientName = new PatientName(secondName);

            // Act
            bool result = firstPatientName.Equals(secondPatientName);

            // Assert
            Assert.That(result, Is.EqualTo(expectedResult));
        }
        public void Constructor_NameIsCorrectlyParsed(string input, string expectedLastName, string expectedFirstName, string expectedMiddleName, string expectedPrefix, string expectedSuffix,
            string expectedToString)
        {
            // Arrange + Act
            var patientName = new PatientName(input);

            // Assert
            Assert.That(patientName.LastName, Is.EqualTo(expectedLastName));
            Assert.That(patientName.FirstName, Is.EqualTo(expectedFirstName));
            Assert.That(patientName.MiddleName, Is.EqualTo(expectedMiddleName));
            Assert.That(patientName.Prefix, Is.EqualTo(expectedPrefix));
            Assert.That(patientName.Suffix, Is.EqualTo(expectedSuffix));
            Assert.That(patientName.DicomString, Is.EqualTo(input));
            Assert.That(patientName.ToString(), Is.EqualTo(expectedToString));
        }
Example #8
0
    public string Delete_Patient(PatientName Pat_Name)
    {
        SqlConnection sqlCon = new SqlConnection(ConStr);
        SqlCommand sqlCmd = new SqlCommand("sp_delete_Patient", sqlCon);
        sqlCmd.CommandType = CommandType.StoredProcedure;
        SqlParameter P_ID = sqlCmd.Parameters.Add("@Pat_ID", SqlDbType.Int);
        P_ID.Value = Pat_Name.Pat_ID;
        try
        {
            sqlCon.Open();
            sqlCmd.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            return ex.ToString();
        }
        finally
        {
            sqlCon.Close();
        }

        return "Deleted Patient Information Successfully";
    }
Example #9
0
        public void FromAliquotOrder(YellowstonePathology.Business.Test.AliquotOrder aliquotOrder, YellowstonePathology.Business.Test.AccessionOrder accessionOrder)
        {
            this.m_AliquotOrder = aliquotOrder;
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(accessionOrder.MasterAccessionNo);
            YellowstonePathology.Business.PatientName   patientName   = new PatientName(accessionOrder.PLastName, accessionOrder.PFirstName);
            this.m_MasterAccessionNo     = orderIdParser.MasterAccessionNo;
            this.m_AliquotOrder          = aliquotOrder;
            this.m_BlockTitle            = aliquotOrder.PrintLabel;
            this.m_Verified              = aliquotOrder.GrossVerified;
            this.m_PatientInitials       = patientName.GetInitials();
            this.m_EmbeddingInstructions = aliquotOrder.EmbeddingInstructions;

            if (accessionOrder.ClientAccessioned == true)
            {
                this.m_ClientAccessionNo = accessionOrder.ClientAccessionNo;
                this.m_ClientAccessioned = true;
            }
            else
            {
                this.m_ClientAccessionNo = null;
                this.m_ClientAccessioned = false;
            }
            this.m_CassetteColor = accessionOrder.CassetteColor;
        }
        public void GetHashCode_SameCodeForEqualObjects()
        {
            // Arrange
            string name = "testName";
            var firstPatientName = new PatientName(name);
            var secondPatientName = new PatientName(name);

            // Act
            int firstHashCode = firstPatientName.GetHashCode();
            int secondHashCode = secondPatientName.GetHashCode();

            // Assert
            Assert.That(firstHashCode, Is.EqualTo(secondHashCode));
        }
        public void Equals_DoesNotMatchDifferentType()
        {
            // Arrange
            var patientName = new PatientName("test");

            // Act
            var result = patientName.Equals(1);

            // Arrange
            Assert.That(result, Is.False);
        }
        public void Equals_PatientsWithSameIDAndNameAreEqual()
        {
            // Arrange
            var birthNumber = new BirthNumber("9107256444");
            var name = new PatientName("Doe^John");
            var patient1 = new PatientInfo
            {
                PatientID = birthNumber,
                PatientName = name
            };
            var patient2 = new PatientInfo
            {
                PatientID = birthNumber,
                PatientName = name
            };

            // Act
            var result = patient1.Equals(patient2);

            // Assert
            Assert.That(result, Is.True);
        }
Example #13
0
        /// <inheritdoc/>
        public string ToDelimitedString()
        {
            CultureInfo culture = CultureInfo.CurrentCulture;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 31, Configuration.FieldSeparator),
                       Id,
                       SetIdPid.HasValue ? SetIdPid.Value.ToString(culture) : null,
                       PatientId?.ToDelimitedString(),
                       PatientIdentifierList != null ? string.Join(Configuration.FieldRepeatSeparator, PatientIdentifierList.Select(x => x.ToDelimitedString())) : null,
                       AlternatePatientIdPid != null ? string.Join(Configuration.FieldRepeatSeparator, AlternatePatientIdPid.Select(x => x.ToDelimitedString())) : null,
                       PatientName != null ? string.Join(Configuration.FieldRepeatSeparator, PatientName.Select(x => x.ToDelimitedString())) : null,
                       MothersMaidenName != null ? string.Join(Configuration.FieldRepeatSeparator, MothersMaidenName.Select(x => x.ToDelimitedString())) : null,
                       DateTimeOfBirth.HasValue ? DateTimeOfBirth.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       AdministrativeSex,
                       PatientAlias != null ? string.Join(Configuration.FieldRepeatSeparator, PatientAlias.Select(x => x.ToDelimitedString())) : null,
                       Race != null ? string.Join(Configuration.FieldRepeatSeparator, Race.Select(x => x.ToDelimitedString())) : null,
                       PatientAddress != null ? string.Join(Configuration.FieldRepeatSeparator, PatientAddress.Select(x => x.ToDelimitedString())) : null,
                       CountyCode,
                       PhoneNumberHome != null ? string.Join(Configuration.FieldRepeatSeparator, PhoneNumberHome.Select(x => x.ToDelimitedString())) : null,
                       PhoneNumberBusiness != null ? string.Join(Configuration.FieldRepeatSeparator, PhoneNumberBusiness.Select(x => x.ToDelimitedString())) : null,
                       PrimaryLanguage?.ToDelimitedString(),
                       MaritalStatus?.ToDelimitedString(),
                       Religion?.ToDelimitedString(),
                       PatientAccountNumber?.ToDelimitedString(),
                       SsnNumberPatient,
                       DriversLicenseNumberPatient?.ToDelimitedString(),
                       MothersIdentifier != null ? string.Join(Configuration.FieldRepeatSeparator, MothersIdentifier.Select(x => x.ToDelimitedString())) : null,
                       EthnicGroup != null ? string.Join(Configuration.FieldRepeatSeparator, EthnicGroup.Select(x => x.ToDelimitedString())) : null,
                       BirthPlace,
                       MultipleBirthIndicator,
                       BirthOrder.HasValue ? BirthOrder.Value.ToString(Consts.NumericFormat, culture) : null,
                       Citizenship != null ? string.Join(Configuration.FieldRepeatSeparator, Citizenship.Select(x => x.ToDelimitedString())) : null,
                       VeteransMilitaryStatus?.ToDelimitedString(),
                       Nationality?.ToDelimitedString(),
                       PatientDeathDateAndTime.HasValue ? PatientDeathDateAndTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       PatientDeathIndicator
                       ).TrimEnd(Configuration.FieldSeparator.ToCharArray()));
        }
        public void Equals_DoesMatchItself()
        {
            // Arrange
            var patientName = new PatientName("test");

            // Act
            var result = patientName.Equals(patientName);

            // Arrange
            Assert.That(result, Is.True);
        }
Example #15
0
    private void AddPatientRecord(int isDupPatient)
    {
        if (rbtnMale.Checked == true)
        {
            Pat_Det.Gender = "M";
        }
        else
        {
            Pat_Det.Gender = "F";
        }

        PatientName Pat_Name = new PatientName();
        int patFacID;

        patFacID = Pat_Info.Get_FacID(txtClinicFacility.Text);

        if (patFacID == 0)
        {
            Pat_Det.FacID = 0;
        }
        else
        {
            Pat_Det.FacID = patFacID;
        }

        Pat_Det.MRN = txtMRN.Text;

        Pat_Name.FirstName = txtPatientFName.Text;

        Pat_Name.MiddleName = txtPatientMName.Text;

        Pat_Name.LastName = txtPatientLName.Text;

        if (rbtnMale.Checked == true)
        {
            Pat_Det.Gender = "M";
        }
        else
        {
            Pat_Det.Gender = "F";
        }

        Pat_Det.DOB = txtDOB.Text;

        Pat_Det.SSN = txtSSN.Text;

        Pat_Det.eContactFName = txtecontactFNAME.Text.Trim();

        Pat_Det.eContactLName = txtecontactLNAME.Text.Trim();

        Pat_Det.eContactPhone = txtecontactPHONE.Text.Trim();

        if (ddlecontactREL.SelectedValue != "0")
            Pat_Det.eContactRelation = ddlecontactREL.SelectedValue;

        Pat_Det.PatientAddress1 = txtAddress1.Text;
        Pat_Det.PatientAddress2 = txtAddress2.Text;
        Pat_Det.Pat_City = txtCity.Text;
        Pat_Det.Pat_state = txtState.Text;
        Pat_Det.Pat_ZIP = txtZip.Text;

        Pat_Det.PatientShipAddress1 = txtSAddr1.Text;
        Pat_Det.PatientShipAddress2 = txtSAddr2.Text;
        Pat_Det.Pat_SCity = txtSCity1.Text;
        Pat_Det.Pat_Sstate = txtSState.Text;
        Pat_Det.Pat_SZIP = txtSZIP.Text;

        Pat_Det.Pat_Phone = txtPhone.Text;
        Pat_Det.Pat_WPhone = txtWorkPhone.Text;
        Pat_Det.Pat_CellPhone = txtCellPhone.Text;

        string diag_Code = "";

        if (txtDiagn1.Text.Trim() != "")
            diag_Code = txtDiagn1.Text.Trim();

        if (txtDiagn2.Text.Trim() != "")
        {
            if (diag_Code.Trim() != "")

                diag_Code = diag_Code + "," + txtDiagn2.Text.Trim();
            else
                diag_Code = diag_Code + txtDiagn2.Text.Trim();
        }

        if (txtDiagn3.Text.Trim() != "")
        {
            if (diag_Code.Trim() != "")

                diag_Code = diag_Code + "," + txtDiagn3.Text.Trim();
            else
                diag_Code = diag_Code + txtDiagn3.Text.Trim();
        }

        if (txtDiagn4.Text.Trim() != "")
        {
            if (diag_Code.Trim() != "")

                diag_Code = diag_Code + "," + txtDiagn4.Text.Trim();
            else
                diag_Code = diag_Code + txtDiagn4.Text.Trim();
        }

        if (txtDiagn5.Text.Trim() != "")
        {
            if (diag_Code.Trim() != "")

                diag_Code = diag_Code + "," + txtDiagn5.Text.Trim();
            else
                diag_Code = diag_Code + txtDiagn5.Text.Trim();
        }

        Pat_Det.Pat_Diagnosis = diag_Code;

        Pat_Det.Pat_Pre_Doc = txtDoctor.Text;

        Pat_Det.DocID = Int32.Parse(Pat_Info.Get_DocID(txtDoctor.Text).ToString());

        if (chkAutoreFillOption.Checked)
            Pat_Det.Pat_AutoFill = "Y";
        else
            Pat_Det.Pat_AutoFill = "N";

        if (chkHippa.Checked)
        {
            Pat_Det.HIPPANotice = "Y";
            Pat_Det.HIPPADate = txtHippaDate.Text;
        }
        else
            Pat_Det.HIPPANotice = "N";

        if (ddlPrimInsurance.Enabled == true)

            Pat_Det.PrimaryInsID = int.Parse(ddlPrimInsurance.SelectedValue.ToString());
        else
            Pat_Det.PrimaryInsID = 0;

        //if(ddlPatStatus.Enabled==true)
        Pat_Det.PatientStatus = 'Y';

        string userID = (string)Session["User"];

        if (Pat_Det.FacID == 0)
        {
            //lblStatus.Visible = true;
            //lblStatus.Text = "No Facilities Found / Invalid Facility..!";

            divPatWarning.Visible = true;
            divPatError.Visible = false;
            divPatSuccess.Visible = false;
            lblAddPatientStatus.Text = "No Facilities Found / Invalid Facility..!";
            mpeAddPatientStatus.Show();

        }
        else if (Pat_Det.DocID == 0)
        {
            //lblStatus.Visible = true;
            //lblStatus.Text = "No Doctors Found / Invalid Doctor..!";

            divPatWarning.Visible = true;
            divPatError.Visible = false;
            divPatSuccess.Visible = false;
            lblAddPatientStatus.Text = "No Doctors Found / Invalid Doctor..!";
            mpeAddPatientStatus.Show();
        }
        else
        {
            //Insert New Patient Details
            string patID = Pat_Info.set_PatientInfo(userID, Pat_Name, Pat_Det);
            hidPat_ID.Value = patID;

            //lblStatus.Visible = true;
            //lblStatus.Text = "Patient Added Successfully..!";

            tabCntPatient.Visible = true;
            tabCntPatient.ActiveTabIndex = 0;

            divPatWarning.Visible = false;
            divPatError.Visible = false;
            divPatSuccess.Visible = true;
            //if(isDupPatient==0)
            //   lblAddPatientStatus.Text = "Patient Record Added Successfully..!";
            //else
            //    lblAddPatientStatus.Text = "Patient Duplicate Record Added Successfully..!";

                lblAddPatientStatus.Text = "Patient Record Added Successfully..!";

            mpeAddPatientStatus.Show();
        }
    }
Example #16
0
    protected void btnUpdate_Click(object sender, ImageClickEventArgs e)
    {
        objNLog.Info("Event Started..");

        //if (lblStatus.Visible == true)
        //    lblStatus.Visible = false;

        PatientPersonalDetails Pat_Det = new PatientPersonalDetails();
        PatientInfoDAL Pat_Info = new PatientInfoDAL();
        try
        {
            PatientName Pat_Name = new PatientName();
            int facID=Pat_Info.Get_FacID(txtClinicFacility.Text);

            if (facID == 0)
            {
                Pat_Det.FacID = 0;
            }
            else
            {
                Pat_Det.FacID = facID;
            }

            Pat_Det.MRN = txtMRN.Text;
            Pat_Name.FirstName = txtPatientFName.Text;
            Pat_Name.LastName = txtPatientLName.Text;
            Pat_Name.MiddleName = txtPatientMName.Text;

            if (rbtnMale.Checked == true)
            {
                Pat_Det.Gender = "M";
            }
            else
            {
                Pat_Det.Gender = "F";
            }

            Pat_Det.DOB = txtDOB.Text;
            Pat_Det.SSN = txtSSN.Text;

            Pat_Det.eContactFName = txtecontactFNAME.Text.Trim();
            Pat_Det.eContactLName = txtecontactLNAME.Text.Trim();
            Pat_Det.eContactPhone = txtecontactPHONE.Text.Trim();
            if (ddlecontactREL.SelectedValue != "0")
                Pat_Det.eContactRelation = ddlecontactREL.SelectedValue;

            Pat_Det.PatientAddress1 = txtAddress1.Text;
            Pat_Det.PatientAddress2 = txtAddress2.Text;
            Pat_Det.Pat_City = txtCity.Text;
            Pat_Det.Pat_state = txtState.Text;
            Pat_Det.Pat_ZIP = txtZip.Text;

            Pat_Det.PatientShipAddress1 = txtSAddr1.Text;
            Pat_Det.PatientShipAddress2 = txtSAddr2.Text;
            Pat_Det.Pat_SCity = txtSCity1.Text;
            Pat_Det.Pat_Sstate = txtSState.Text;
            Pat_Det.Pat_SZIP = txtSZIP.Text;

            Pat_Det.Pat_Phone = txtPhone.Text;
            Pat_Det.Pat_WPhone = txtWorkPhone.Text;
            Pat_Det.Pat_CellPhone = txtCellPhone.Text;
            string diag_Code = "";
            if (txtDiagn1.Text.Trim() != "")
                diag_Code = txtDiagn1.Text.Trim();
            if (txtDiagn2.Text.Trim() != "")
            {
                if (diag_Code.Trim() != "")

                    diag_Code = diag_Code + "," + txtDiagn2.Text.Trim();
                else
                    diag_Code = diag_Code + txtDiagn2.Text.Trim();
            }
            if (txtDiagn3.Text.Trim() != "")
            {
                if (diag_Code.Trim() != "")

                    diag_Code = diag_Code + "," + txtDiagn3.Text.Trim();
                else
                    diag_Code = diag_Code + txtDiagn3.Text.Trim();
            }
            if (txtDiagn4.Text.Trim() != "")
            {
                if (diag_Code.Trim() != "")

                    diag_Code = diag_Code + "," + txtDiagn4.Text.Trim();
                else
                    diag_Code = diag_Code + txtDiagn4.Text.Trim();
            }
            if (txtDiagn5.Text.Trim() != "")
            {
                if (diag_Code.Trim() != "")

                    diag_Code = diag_Code + "," + txtDiagn5.Text.Trim();
                else
                    diag_Code = diag_Code + txtDiagn5.Text.Trim();
            }
            Pat_Det.Pat_Diagnosis = diag_Code;

            Pat_Det.Pat_Pre_Doc = txtDoctor.Text;
            Pat_Det.DocID = Int32.Parse(Pat_Info.Get_DocID(txtDoctor.Text).ToString());

            if (chkAutoreFillOption.Checked)

                Pat_Det.Pat_AutoFill = "Y";
            else
                Pat_Det.Pat_AutoFill = "N";

            if (chkHippa.Checked)
            {
                Pat_Det.HIPPANotice = "Y";
                Pat_Det.HIPPADate = txtHippaDate.Text;
            }
            else
                Pat_Det.HIPPANotice = "N";

            Pat_Det.Pat_ID = int.Parse(hidPat_ID.Value.ToString());

            if (ddlPrimInsurance.Enabled == true )
                Pat_Det.PrimaryInsID = int.Parse(ddlPrimInsurance.SelectedValue.ToString());

            if (ddlPatStatus.Enabled == true)
            Pat_Det.PatientStatus = char.Parse(ddlPatStatus.SelectedValue);

            string userID = (string)Session["User"];
            if (Pat_Det.FacID == 0)
            {
                //lblStatus.Visible=true;
                //lblStatus.Text = "No Facilities Found / Invalid Facility..!";

                divPatWarning.Visible = true;
                divPatError.Visible = false;
                divPatSuccess.Visible = false;
                lblAddPatientStatus.Text = "No Facilities Found / Invalid Facility..!";
                mpeAddPatientStatus.Show();

            }
            else if (Pat_Det.DocID == 0)
            {
                //lblStatus.Visible = true;
                //lblStatus.Text = "No Doctors Found / Invalid Doctor..!";

                divPatWarning.Visible = true;
                divPatError.Visible = false;
                divPatSuccess.Visible = false;
                lblAddPatientStatus.Text = "No Doctors Found / Invalid Doctor..!";
                mpeAddPatientStatus.Show();

            }
            else
            {
                Pat_Info.update_patInfo(userID, Pat_Det, Pat_Name);
                Response.Redirect("AllPatientProfile.aspx?patID=" + Request.QueryString["patID"].ToString());
            }

        }
        catch (Exception ex)
        {
            objNLog.Error("Error : " + ex.Message);
        }
        objNLog.Info("Event Completed..");
    }
Example #17
0
    public Object GetRidePatView(int daysAhead)
    {
        // get the basic ride data
        DbService db = new DbService();
        Dictionary <int, RideSlimExt> dic = new Dictionary <int, RideSlimExt>();

        //List<RideSlimExt> rides = new List<RideSlimExt>();
        SqlCommand cmd = new SqlCommand();

        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@daysAhead", daysAhead);
        cmd.CommandText = "spGetBasicRidePatData";
        //if (db.con.State == ConnectionState.Closed)
        //{
        //    con.Open();
        //}

        //command.Connection = con;
        SqlDataReader dr = db.GetDataReaderSP(cmd);

        while (dr.Read())
        {
            Id          = Convert.ToInt32(dr["ridepatnum"]);
            Destination = dr["destination"].ToString();
            Origin      = dr["origin"].ToString();
            PickUpTime  = Convert.ToDateTime(dr["PickUpTime"].ToString());

            bool isAnonymous = true;
            if (dr["IsAnonymous"] == System.DBNull.Value)
            {
                isAnonymous = false;
            }
            else
            {
                isAnonymous = Convert.ToBoolean(dr["IsAnonymous"]);
            }
            PatientName = dr["patient"].ToString();
            if (isAnonymous || PatientName.Contains("אנונימי") || PatientName.Contains("Anonymous"))
            {
                PatientName = "אנונימי";
            }

            CellPhone = dr["CellPhone"].ToString();
            RideSlimExt rse = new RideSlimExt(PatientName, "", 0, Origin, Destination, PickUpTime, Id, CellPhone);
            rse.Area       = dr["area"].ToString();
            rse.OnlyEscort = Convert.ToBoolean(dr["onlyEscort"]);
            dic.Add(Id, rse);
        }

        dr.Close();

        // get the escorts
        cmd.CommandText = "spGetEscortsForRides";
        dr = db.GetDataReaderSP(cmd);
        while (dr.Read())
        {
            int ridepatnum = Convert.ToInt32(dr["ridepatnum"]);
            dic[ridepatnum].escorts = new List <EscoretSlim>();
            string displayName = dr["DisplayName"].ToString();
            bool   isAnonymous = true;
            if (dr["IsAnonymous"] == System.DBNull.Value)
            {
                isAnonymous = false;
            }
            else
            {
                isAnonymous = Convert.ToBoolean(dr["IsAnonymous"]);
            }

            if (isAnonymous != true && !displayName.Contains("אנונימי") && !displayName.Contains("Anonymus"))
            {
                string cellphone = dr["CellPhone"].ToString();
                dic[ridepatnum].escorts.Add(new EscoretSlim(displayName, cellphone, 0));
            }
            else
            {
                dic[ridepatnum].escorts.Add(new EscoretSlim("אנונימי", "", 0));
            }
        }
        dr.Close();

        // get the equipment
        cmd.CommandText = "spGetEquipmentPerPatient";
        dr = db.GetDataReaderSP(cmd);
        while (dr.Read())
        {
            string patient   = dr["patient"].ToString();
            string equipment = dr["Name"].ToString();
            foreach (KeyValuePair <int, RideSlimExt> kv in dic)
            {
                if (kv.Value.PatientName == patient)
                {
                    if (kv.Value.equipment == null)
                    {
                        kv.Value.equipment = new List <string>();
                    }
                    kv.Value.equipment.Add(equipment);
                }
            }
        }

        db.CloseConnection();


        List <RideSlimExt> l = dic.Values.ToList <RideSlimExt>();

        Object o = RideSlimExtToObject(l);

        return(o);
    }
Example #18
0
        public void FromAliquotOrder(YellowstonePathology.Business.Test.AliquotOrder aliquotOrder, YellowstonePathology.Business.Test.AccessionOrder accessionOrder)
        {
            this.m_AliquotOrder = aliquotOrder;
            YellowstonePathology.Business.OrderIdParser orderIdParser = new YellowstonePathology.Business.OrderIdParser(accessionOrder.MasterAccessionNo);

            YellowstonePathology.Business.PatientName patientName = new PatientName(accessionOrder.PLastName, accessionOrder.PFirstName);
            this.m_MasterAccessionNo = orderIdParser.MasterAccessionNo;
            this.m_AliquotOrder = aliquotOrder;
            this.m_BlockTitle = aliquotOrder.PrintLabel;
            this.m_Verified = aliquotOrder.GrossVerified;
            this.m_PatientInitials = patientName.GetInitials();
            this.m_EmbeddingInstructions = aliquotOrder.EmbeddingInstructions;

            if(accessionOrder.ClientAccessioned == true)
            {
                this.m_ClientAccessionNo = accessionOrder.ClientAccessionNo;
                this.m_ClientAccessioned = true;
            }
            else
            {
                this.m_ClientAccessionNo = null;
                this.m_ClientAccessioned = false;
            }

            if(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.UseLaserCassettePrinter == false)
            {
                this.m_CassetteColumn = accessionOrder.PrintMateColumnNumber.ToString();
            }
            else
            {
                YellowstonePathology.Business.Common.PrintMateCarousel printMateCarousel = new Common.PrintMateCarousel();
                YellowstonePathology.Business.Common.PrintMateColumn printMateColumn = printMateCarousel.GetColumn(accessionOrder.PrintMateColumnNumber);
                this.m_CassetteColumn = printMateColumn.GeneralDataColor.ToString();
            }
        }
Example #19
0
 public DataTable getPatSearch(PatientName Pat_Name)
 {
     SqlConnection con = new SqlConnection(ConStr);
     SqlCommand sqlCmd = new SqlCommand("select * from Patient_Info where Pat_FName ='"+Pat_Name.FirstName+"' and Pat_LName = '"+Pat_Name.LastName+ "'", con);
     SqlDataReader sqlDr;
     DataTable dtable = new DataTable();
     // DataRow dr;
     con.Open();
     sqlDr = sqlCmd.ExecuteReader();
     dtable.Load(sqlDr);
     con.Close();
     return dtable;
 }
        public void Equals_WithDifferentType_ReturnsFalse()
        {
            // Arrange
            var birthNumber = new BirthNumber("9107256444");
            var name = new PatientName("Doe^John");
            var patient = new PatientInfo
            {
                PatientID = birthNumber,
                PatientName = name
            };
            
            // Act
            var result = patient.Equals(new object());

            // Assert
            Assert.That(result, Is.False);
        }
Example #21
0
    public string Update_Patient(PatientName Pat_Name, PatientPersonalDetails Pat_Per_Details, PatientAddress Pat_Add,
                           PatientInsuranceDetails Pat_Ins_Details, PatientAllergies Pat_Allergies,
                           FacilityInfo Fac_Info, PharmacyInfo Phrm_Info,ProviderInfo Prov_Info)
    {
        SqlConnection sqlCon = new SqlConnection(ConStr);
        SqlCommand sqlCmd = new SqlCommand("sp_update_Patient", sqlCon);
        sqlCmd.CommandType = CommandType.StoredProcedure;

        SqlParameter P_ID = sqlCmd.Parameters.Add("@Pat_ID", SqlDbType.Int);
        P_ID.Value = Pat_Name.Pat_ID;

        SqlParameter P_MName = sqlCmd.Parameters.Add("@Pat_MName", SqlDbType.VarChar, 50);
        if (Pat_Name.MiddleName != null)
            P_MName.Value = Pat_Name.MiddleName;
        else
            P_MName.Value = Convert.DBNull;

        SqlParameter P_Gender = sqlCmd.Parameters.Add("@Pat_Gender", SqlDbType.Char, 1);
        if (Pat_Per_Details.Gender != null)
            P_Gender.Value = Pat_Per_Details.Gender;
        else
            P_Gender.Value = Convert.DBNull;

        SqlParameter P_DOB = sqlCmd.Parameters.Add("@Pat_DOB", SqlDbType.DateTime);
        if (Pat_Per_Details.DOB != null)
            P_DOB.Value = DateTime.Parse(Pat_Per_Details.DOB);
        else
        {
            Nullable<DateTime> NullDate = null;
            P_DOB.Value = NullDate;
        }

        SqlParameter P_SSN = sqlCmd.Parameters.Add("@Pat_SSN", SqlDbType.VarChar, 50);
        if (Pat_Per_Details.SSN != null)
            P_SSN.Value = Pat_Per_Details.SSN;
        else
            P_SSN.Value = Convert.DBNull;

        SqlParameter P_Address1 = sqlCmd.Parameters.Add("@Pat_Address1", SqlDbType.VarChar, 50);
        if (Pat_Add.Address1 != null)
            P_Address1.Value = Pat_Add.Address1;
        else
            P_Address1.Value = Convert.DBNull;

        SqlParameter P_Address2 = sqlCmd.Parameters.Add("@Pat_Address2", SqlDbType.VarChar, 50);
        if (Pat_Add.Address2 != null)
            P_Address2.Value = Pat_Add.Address2;
        else
            P_Address2.Value = Convert.DBNull;

        SqlParameter P_City = sqlCmd.Parameters.Add("@Pat_City", SqlDbType.VarChar, 50);
        if (Pat_Add.City != null)
            P_City.Value = Pat_Add.City;
        else
            P_City.Value = Convert.DBNull;
        SqlParameter P_State = sqlCmd.Parameters.Add("@Pat_State", SqlDbType.VarChar, 50);
        if (Pat_Add.State != null)
            P_State.Value = Pat_Add.State;
        else
            P_State.Value = Convert.DBNull;
        SqlParameter P_ZIP = sqlCmd.Parameters.Add("@Pat_Zip", SqlDbType.VarChar, 50);
        if (Pat_Add.Zip != null)
            P_ZIP.Value = Pat_Add.Zip;
        else
            P_ZIP.Value = Convert.DBNull;
        SqlParameter P_PDoc = sqlCmd.Parameters.Add("@Pat_PDoc", SqlDbType.VarChar, 50);
        if (Pat_Per_Details.Pat_Pre_Doc != null)
            P_PDoc.Value = Pat_Per_Details.Pat_Pre_Doc;
        else
            P_PDoc.Value = Convert.DBNull;

        SqlParameter P_MRN = sqlCmd.Parameters.Add("@Pat_MRN", SqlDbType.VarChar, 15);
        if (Pat_Per_Details.MRN != null)
            P_MRN.Value = Pat_Per_Details.MRN;
        else
            P_MRN.Value = Convert.DBNull;

        SqlParameter Fac_ID = sqlCmd.Parameters.Add("@Fac_ID", SqlDbType.Int);
        if (Fac_Info.FacilityNO != null)
            Fac_ID.Value = Fac_Info.FacilityNO;
        else
            Fac_ID.Value = Convert.DBNull;

        SqlParameter Phrm_ID = sqlCmd.Parameters.Add("@Phrm_ID", SqlDbType.Int);
        if (Phrm_Info.PhrmID != null)
            Phrm_ID.Value = Phrm_Info.PhrmID;
        else
            Phrm_ID.Value = Convert.DBNull;

        //SqlParameter PI_InsName = sqlCmd.Parameters.Add("@Ins_Name", SqlDbType.VarChar, 50);
        //if (Pat_Ins_Details.InsuranceName != null)
        //    PI_InsName.Value = Pat_Ins_Details.InsuranceName;
        //else
        //    PI_InsName.Value = Convert.DBNull;

        int InsID = getInsuranceID(Pat_Ins_Details);
        Pat_Ins_Details.InsuranceID = InsID;

        SqlParameter Ins_ID = sqlCmd.Parameters.Add("@Ins_ID", SqlDbType.Int);
        if (Pat_Ins_Details.InsuranceID.ToString() != "0")
            Ins_ID.Value = Pat_Ins_Details.InsuranceID;
        else
            Ins_ID.Value = Convert.DBNull;

        SqlParameter PI_No = sqlCmd.Parameters.Add("@PI_Number", SqlDbType.Int);
        if (Pat_Ins_Details.PI_PolicyNo.ToString() != "0")
            PI_No.Value = Pat_Ins_Details.PI_PolicyNo;
        else
            PI_No.Value = Convert.DBNull;

        SqlParameter PI_PolicyID = sqlCmd.Parameters.Add("@PI_PolicyID", SqlDbType.Int);
        if (Pat_Ins_Details.PI_PolicyID.ToString() != "0")
            PI_PolicyID.Value = Pat_Ins_Details.PI_PolicyID;
        else
            PI_PolicyID.Value = Convert.DBNull;

        SqlParameter PI_GroupNo = sqlCmd.Parameters.Add("@PI_GroupNo", SqlDbType.Int);
        if (Pat_Ins_Details.PI_GroupNo.ToString() != "0")
            PI_GroupNo.Value = Pat_Ins_Details.PI_GroupNo;
        else
            PI_GroupNo.Value = Convert.DBNull;

        SqlParameter PI_BINNo = sqlCmd.Parameters.Add("@PI_BINNo", SqlDbType.Int);
        if (Pat_Ins_Details.PI_BINNo.ToString() != "0")
            PI_BINNo.Value = Pat_Ins_Details.PI_BINNo;
        else
            PI_BINNo.Value = Convert.DBNull;

        SqlParameter PI_InsdName = sqlCmd.Parameters.Add("@PI_InsdName", SqlDbType.VarChar, 50);
        if (Pat_Ins_Details.InsuredName != null)
            PI_InsdName.Value = Pat_Ins_Details.InsuredName;
        else
            PI_InsdName.Value = Convert.DBNull;

        SqlParameter PI_InsdDOB = sqlCmd.Parameters.Add("@PI_InsdDOB", SqlDbType.DateTime);
        if (Pat_Ins_Details.InsuredDOB != null)
            PI_InsdDOB.Value = DateTime.Parse( Pat_Ins_Details.InsuredDOB);
        else
        {
            Nullable<DateTime> NullDate = null;
            PI_InsdDOB.Value = NullDate;
        }
        SqlParameter PI_InsdSSN = sqlCmd.Parameters.Add("@PI_InsdSSN", SqlDbType.VarChar, 50);
        if (Pat_Ins_Details.InsuredSSN != null)
            PI_InsdSSN.Value = Pat_Ins_Details.InsuredSSN;
        else
            PI_InsdSSN.Value = Convert.DBNull;
        SqlParameter PI_InsdRel = sqlCmd.Parameters.Add("@PI_InsdRel", SqlDbType.VarChar, 50);
        if (Pat_Ins_Details.InsuredRelation != null)
            PI_InsdRel.Value = Pat_Ins_Details.InsuredRelation;
        else
            PI_InsdRel.Value = Convert.DBNull;

        SqlParameter PA_Desc = sqlCmd.Parameters.Add("@PA_Desc", SqlDbType.VarChar, 200);
        if (Pat_Allergies.AllergyDescription != null)
            PA_Desc.Value = Pat_Allergies.AllergyDescription;
        else
            PA_Desc.Value = Convert.DBNull;

        try
        {
            sqlCon.Open();
            sqlCmd.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            return ex.ToString();
        }
        finally
        {
            sqlCon.Close();
        }

        return "Updated Patient Information Successfully";
    }
Example #22
0
    public void update_patInfo(string userID,PatientPersonalDetails Pat_Info, PatientName Pat_Name)
    {
        objNLog.Info("Function Started with Pat_Info, Pat_Name as argument...");
        bool successFlag = false;
        SqlConnection sqlCon = new SqlConnection(conStr);
        try
        {
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "sp_update_PatientInfo";
        cmd.Connection = sqlCon;

        SqlParameter sql_FacId = cmd.Parameters.Add("@FacId", SqlDbType.Int);
        sql_FacId.Value = Pat_Info.FacID;

        SqlParameter sql_PatMRN = cmd.Parameters.Add("@Pat_MRN", SqlDbType.VarChar,15);
        sql_PatMRN.Value = Pat_Info.MRN;

        SqlParameter sql_PatFname = cmd.Parameters.Add("@Pat_Fname", SqlDbType.VarChar, 50);
        sql_PatFname.Value = Pat_Name.FirstName;

        SqlParameter sql_PatMname = cmd.Parameters.Add("@Pat_Mname", SqlDbType.VarChar, 50);
        sql_PatMname.Value = Pat_Name.MiddleName;

        SqlParameter sql_PatLname = cmd.Parameters.Add("@Pat_Lname", SqlDbType.VarChar, 50);
        sql_PatLname.Value = Pat_Name.LastName;

        SqlParameter sql_PatGender = cmd.Parameters.Add("@Pat_Gender", SqlDbType.Char, 1);
        sql_PatGender.Value = Pat_Info.Gender;

        SqlParameter sql_PatDob = cmd.Parameters.Add("@Pat_DOB", SqlDbType.DateTime2, 7);
        sql_PatDob.Value = Convert.ToDateTime(Pat_Info.DOB);

        SqlParameter sql_PatSSN = cmd.Parameters.Add("@Pat_SSN", SqlDbType.VarChar, 16);
        sql_PatSSN.Value = Pat_Info.SSN;

        SqlParameter sql_PatAdd1 = cmd.Parameters.Add("@Pat_Address1", SqlDbType.VarChar, 50);
        sql_PatAdd1.Value = Pat_Info.PatientAddress1;

        SqlParameter sql_PatAdd2 = cmd.Parameters.Add("@Pat_Address2", SqlDbType.VarChar, 50);
        sql_PatAdd2.Value = Pat_Info.PatientAddress2;

        SqlParameter sql_PatCity = cmd.Parameters.Add("@Pat_City", SqlDbType.VarChar, 50);
        sql_PatCity.Value = Pat_Info.Pat_City ;

        SqlParameter sql_PatState = cmd.Parameters.Add("@Pat_State", SqlDbType.VarChar, 14);
        sql_PatState.Value = Pat_Info.Pat_state;

        SqlParameter sql_PatZip = cmd.Parameters.Add("@Pat_Zip", SqlDbType.VarChar, 10);
        sql_PatZip.Value = Pat_Info.Pat_ZIP;

        SqlParameter sql_PatSAdd1 = cmd.Parameters.Add("@Pat_SAddress1", SqlDbType.VarChar, 50);
        sql_PatSAdd1.Value = Pat_Info.PatientShipAddress1;

        SqlParameter sql_PatSAdd2 = cmd.Parameters.Add("@Pat_SAddress2", SqlDbType.VarChar, 50);
        sql_PatSAdd2.Value = Pat_Info.PatientShipAddress2;

        SqlParameter sql_PatSCity = cmd.Parameters.Add("@Pat_SCity", SqlDbType.VarChar, 50);
        sql_PatSCity.Value = Pat_Info.Pat_SCity;

        SqlParameter sql_PatSState = cmd.Parameters.Add("@Pat_SState", SqlDbType.VarChar, 14);
        sql_PatSState.Value = Pat_Info.Pat_Sstate;

        SqlParameter sql_PatSZip = cmd.Parameters.Add("@Pat_SZip", SqlDbType.VarChar, 10);
        sql_PatSZip.Value = Pat_Info.Pat_SZIP;

        SqlParameter sql_PatPhone = cmd.Parameters.Add("@Pat_Phone", SqlDbType.VarChar, 16);
        sql_PatPhone.Value = Pat_Info.Pat_Phone;//@Pat_WPhone

        SqlParameter sql_PatCPhone = cmd.Parameters.Add("@Pat_CPhone", SqlDbType.VarChar, 16);
        sql_PatCPhone.Value = Pat_Info.Pat_CellPhone;

        SqlParameter sql_PatWPhone = cmd.Parameters.Add("@Pat_WPhone", SqlDbType.VarChar, 16);
        sql_PatWPhone.Value = Pat_Info.Pat_WPhone;

        SqlParameter sql_patDoc = cmd.Parameters.Add("@Pat_PDoc", SqlDbType.VarChar, 50);
        sql_patDoc.Value = Pat_Info.Pat_Pre_Doc;

        SqlParameter sql_AutoFill = cmd.Parameters.Add("@AutoFill", SqlDbType.Char, 1);
        sql_AutoFill.Value = Pat_Info.Pat_AutoFill;

        SqlParameter sql_DocId = cmd.Parameters.Add("@DocId", SqlDbType.Int);
        sql_DocId.Value = Pat_Info.DocID;

        SqlParameter sql_PatPrmIns = cmd.Parameters.Add("@Pat_PrimInsu_ID", SqlDbType.Int);
        if(Pat_Info.PrimaryInsID!=0)
            sql_PatPrmIns.Value = Pat_Info.PrimaryInsID;

        SqlParameter par_DiagnnosisCode = cmd.Parameters.Add("@DiagnnosisCode", SqlDbType.VarChar, 255);

        par_DiagnnosisCode.Value = Pat_Info.Pat_Diagnosis;

        SqlParameter par_Patid = cmd.Parameters.Add("@Pat_ID", SqlDbType.Int);
        if (Pat_Info.Pat_ID != null)
            par_Patid.Value = Pat_Info.Pat_ID;

        //SqlParameter sql_Pharmacy = cmd.Parameters.Add("@Pharmacy", SqlDbType.VarChar, 255);
        //sql_Pharmacy.Value = Pat_Info.PhacyName;
        SqlParameter sql_userid = cmd.Parameters.Add("@UserID", SqlDbType.VarChar, 20);
        sql_userid.Value = userID;

        SqlParameter sql_HIPPA_Notice = cmd.Parameters.Add("@HIPPA", SqlDbType.Char, 1);
        sql_HIPPA_Notice.Value = Pat_Info.HIPPANotice ;
        SqlParameter sql_HIPPA_Date = cmd.Parameters.Add("@HIPPADate", SqlDbType.Date , 7);
        if(Pat_Info.HIPPANotice=="Y")
            sql_HIPPA_Date.Value = Pat_Info.HIPPADate;

        SqlParameter sql_ecFNAME = cmd.Parameters.Add("@ecFNAME", SqlDbType.VarChar, 20);
        sql_ecFNAME.Value = Pat_Info.eContactFName;

        SqlParameter sql_ecLNAME = cmd.Parameters.Add("@ecLNAME", SqlDbType.VarChar, 20);
        sql_ecLNAME.Value = Pat_Info.eContactLName;
        SqlParameter sql_ecPHONE = cmd.Parameters.Add("@ecPHONE", SqlDbType.VarChar, 50);
        sql_ecPHONE.Value = Pat_Info.eContactPhone;
        SqlParameter sql_ecREL = cmd.Parameters.Add("@ecREL", SqlDbType.Char, 1);
        sql_ecREL.Value = Pat_Info.eContactRelation;

        SqlParameter sql_IsActive = cmd.Parameters.Add("@Pat_Status", SqlDbType.Char, 1);
        sql_IsActive.Value = Pat_Info.PatientStatus;

            sqlCon.Open();
            cmd.ExecuteNonQuery();
            successFlag = true;
            objUALog.LogUserActivity(conStr, userID, "Updated Patient Profile Info. with PatID = " + Pat_Info.Pat_ID.ToString(), "Patient_Info", Pat_Info.Pat_ID );
        }
        catch (SqlException SqlEx)
        {
            objNLog.Error("SQLException : " + SqlEx.Message);
            throw new Exception("Exception re-Raised from DL with SQLError# " + SqlEx.Number + " while Updating Patient Info.", SqlEx);
        }
        catch (Exception ex)
        {
            objNLog.Error("Exception : " + ex.Message);
            throw new Exception("**Error occured while Updating Patient Info.", ex);
        }
        finally
        {
            sqlCon.Close();
            objNLog.Info("Finally Block: " + successFlag);
        }

        objNLog.Info("Function Completed...");
    }
        public void GetHashCode_PatientsWithSameIDAndNameAreEqual()
        {
            // Arrange
            var birthNumber = new BirthNumber("9107256444");
            var name = new PatientName("Doe^John");
            var patient1 = new PatientInfo
            {
                PatientID = birthNumber,
                PatientName = name
            };
            var patient2 = new PatientInfo
            {
                PatientID = birthNumber,
                PatientName = name
            };

            // Act
            var hash1 = patient1.GetHashCode();
            var hash2 = patient2.GetHashCode();

            // Assert
            Assert.That(hash1, Is.EqualTo(hash2));
        }
Example #24
0
        private IList <RestoreQueue> InternalSelect(int startRowIndex, int maximumRows, out int resultCount)
        {
            resultCount = 0;

            if (maximumRows == 0)
            {
                return(new List <RestoreQueue>());
            }

            if (SearchKeys != null)
            {
                IList <RestoreQueue> archiveQueueList = new List <RestoreQueue>();
                foreach (ServerEntityKey key in SearchKeys)
                {
                    archiveQueueList.Add(RestoreQueue.Load(key));
                }

                resultCount = archiveQueueList.Count;

                return(archiveQueueList);
            }

            WebQueryRestoreQueueParameters parameters = new WebQueryRestoreQueueParameters();

            parameters.StartIndex  = startRowIndex;
            parameters.MaxRowCount = maximumRows;
            if (Partition != null)
            {
                parameters.ServerPartitionKey = Partition.Key;
            }

            if (!string.IsNullOrEmpty(PatientId))
            {
                string key = PatientId.Replace("*", "%");
                key = key.Replace("?", "_");
                parameters.PatientId = key;
            }
            if (!string.IsNullOrEmpty(PatientName))
            {
                string key = PatientName.Replace("*", "%");
                key = key.Replace("?", "_");
                parameters.PatientsName = key;
            }

            if (String.IsNullOrEmpty(ScheduledDate))
            {
                parameters.ScheduledTime = null;
            }
            else
            {
                parameters.ScheduledTime = DateTime.ParseExact(ScheduledDate, DateFormats, null);
            }

            if (StatusEnum != null)
            {
                parameters.RestoreQueueStatusEnum = StatusEnum;
            }


            List <string>   groupOIDs = new List <string>();
            CustomPrincipal user      = Thread.CurrentPrincipal as CustomPrincipal;

            if (user != null)
            {
                if (!user.IsInRole(MatrixPACS.Enterprise.Common.AuthorityTokens.DataAccess.AllStudies))
                {
                    foreach (var oid in user.Credentials.DataAccessAuthorityGroups)
                    {
                        groupOIDs.Add(oid.ToString());
                    }

                    parameters.CheckDataAccess         = true;
                    parameters.UserAuthorityGroupGUIDs = StringUtilities.Combine(groupOIDs, ",");
                }
            }

            IList <RestoreQueue> list = _searchController.FindRestoreQueue(parameters);

            resultCount = parameters.ResultCount;

            return(list);
        }
Example #25
0
 public DataTable getPatInsDetails(PatientName Pat_Name)
 {
     SqlConnection con = new SqlConnection(ConStr);
     SqlCommand sqlCmd = new SqlCommand("select * from Patient_Ins where Pat_ID = '" + Pat_Name.Pat_ID + "'", con);
     SqlDataReader sqlDr;
     DataTable dtable = new DataTable();
     // DataRow dr;
     con.Open();
     sqlDr = sqlCmd.ExecuteReader();
     dtable.Load(sqlDr);
     con.Close();
     return dtable;
 }