Ejemplo n.º 1
0
        /// <summary>
        /// Handles the Click event of the btnsave control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void btnsave_Click(object sender, EventArgs e)
        {
            //TODO validate first if valid continue
            if (!ValidateForm())
            {
                return;
            }

            DataTable theDt = new DataTable();

            theDt.Columns.Add("ParameterID", typeof(int));
            theDt.Columns.Add("TestResult", typeof(Decimal));
            theDt.Columns.Add("TestResult1", typeof(String));
            theDt.Columns.Add("TestResultId", typeof(int));
            theDt.Columns.Add("Units", typeof(int));

            theDt = GetDataToSave(maindiv, theDt);

            IQCareUtils   theUtils  = new IQCareUtils();
            ILabFunctions LabMaster = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory");

            LabMaster.SaveDynamicLabResults(Convert.ToInt32(ViewState["LabId"]), Convert.ToInt32(Session["AppUserId"]),
                                            int.Parse(ddlLabReportedbyName.SelectedValue), DateTime.Parse(txtlabReportedbyDate.Text), theDt);
            SuccessRecordsSave();
        }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Ajax.Utility.RegisterTypeForAjax(typeof(Laboratory_LabOrderForm));
        txtlaborderedbydate.Attributes.Add("onkeyup", "DateFormat(this,this.value,event,false,'3')");
        txtlaborderedbydate.Attributes.Add("onblur", "DateFormat(this,this.value,event,true,'3')");

        txtLabtobeDone.Attributes.Add("onkeyup", "DateFormat(this,this.value,event,false,'3')");
        txtLabtobeDone.Attributes.Add("onblur", "DateFormat(this,this.value,event,true,'3')");

        DataTable dtPatientInfo = (DataTable)Session["PatientInformation"];

        if (dtPatientInfo != null && dtPatientInfo.Rows.Count > 0)
        {
            if (Session["SystemId"].ToString() == "1")
            {
                lblpatientname.Text = dtPatientInfo.Rows[0]["LastName"].ToString() + ", " + dtPatientInfo.Rows[0]["FirstName"].ToString();
            }
            else
            {
                lblpatientname.Text = dtPatientInfo.Rows[0]["LastName"].ToString() + ", " + dtPatientInfo.Rows[0]["MiddleName"].ToString() + " , " + dtPatientInfo.Rows[0]["FirstName"].ToString();
            }
            lblIQnumber.Text = dtPatientInfo.Rows[0]["IQNumber"].ToString();
        }
        TechnicalAreaIdentifier();

        AuthenticationManager Authentication = new AuthenticationManager();

        if (Session["LabId"] != null)
        {
            Session["Lab_ID"]      = Session["LabId"];
            ViewState["LabTestID"] = Session["LabTestID"];
            Session["LabId"]       = null;
            Session["LabTestID"]   = null;
        }
        if (Application["AppCurrentDate"] != null)
        {
            hdappcurrentdate.Value = Application["AppCurrentDate"].ToString();
        }
        if (!IsPostBack)
        {
            ILabFunctions LabResultManager = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory");
            DataSet       theDSPatient     = LabResultManager.GetPatientInfo(Session["PatientId"].ToString());
            if (theDSPatient.Tables[1].Rows.Count > 0)
            {
                ViewState["IEVisitDate"] = theDSPatient.Tables[1].Rows[0]["VisitDate"];
            }
            dtLabTest = new DataTable();
            dtLabTest.Rows.Clear();
            hdControlExists.Value = "";
            if (dtLabTest.Columns.Count == 0)
            {
                dtLabTest.Columns.Add("TestId", System.Type.GetType("System.Int32"));
                dtLabTest.Columns.Add("TestName", System.Type.GetType("System.String"));
                dtLabTest.Columns.Add("Department", System.Type.GetType("System.String"));
            }
            GetLaborderdate();
            BindControls();
        }
    }
Ejemplo n.º 3
0
        public int DeleteForm(string FormName, int visitPk, int patientID, int userid)
        {
            int theResultRow;

            ILabFunctions LabResultManager = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory");

            theResultRow = (int)LabResultManager.DeleteLabForms(FormName, visitPk, patientID, userid);

            return(theResultRow);
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                labManager = (Interface.Laboratory.ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory");
                DataSet dt = labManager.GetPendingLabOrders();

                gvLabOrders.DataSource = dt.Tables[0];
                gvLabOrders.DataBind();
            }
        }
    private void Init_Form()
    {
        BindFunctions BindManager      = new BindFunctions();
        IQCareUtils   theUtils         = new IQCareUtils();
        ILabFunctions LabResultManager = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory");
        DataSet       theDSLabs;

        theDSLabs = LabResultManager.GetLabValues();
        DataTable HivTestType = theDSLabs.Tables[2];
        DataView  theDV1      = new DataView(HivTestType);

        theDV1.RowFilter = "SubTestId in (53,114)";
        HivTestType      = theUtils.CreateTableFromDataView(theDV1);
        BindManager.BindCombo(DDHIVTestType, HivTestType, "SubTestName", "SubTestId");
        DataSet theDSXML = new DataSet();

        theDSXML.ReadXml(MapPath("..\\XMLFiles\\ALLMasters.con"));
        DataView  theDV = new DataView();
        DataTable theDT = new DataTable();

        /*******/
        theDV           = new DataView(theDSXML.Tables["Mst_ModDeCode"]);
        theDV.RowFilter = "DeleteFlag=0 and CodeID=5";
        if (theDV.Table != null)
        {
            theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
            BindManager.BindCombo(DDFinalResult, theDT, "Name", "ID");
            theDV.Dispose();
            theDT.Clear();
        }
        theDV           = new DataView(theDSXML.Tables["mst_PMTCTDecode"]);
        theDV.RowFilter = "DeleteFlag=0 and CodeID=5";
        if (theDV.Table != null)
        {
            theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
            BindManager.BindCombo(DDResult, theDT, "Name", "ID");
            theDV.Dispose();
            theDT.Clear();
        }
        theDV           = new DataView(theDSXML.Tables["mst_PMTCTDecode"]);
        theDV.RowFilter = "DeleteFlag=0 and CodeID=4";
        if (theDV.Table != null)
        {
            theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
            BindManager.BindCombo(DDInfantFeedingPractice, theDT, "Name", "ID");
            theDV.Dispose();
            theDT.Clear();
        }
    }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "")
            {
                IQCareMsgBox.Show("SessionExpired", this);
                Response.Redirect("~/frmlogin.aspx", true);
            }

            ILabFunctions labManager = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory");
            DataSet       theDS      = labManager.GetLabHistory(Convert.ToInt32(Session["PatientID"]), Convert.ToInt32(Session["AppLocationId"]));

            ViewState["LabHistory"] = theDS;

            DataView  view           = new DataView(theDS.Tables[0]);
            DataTable distinctValues = view.ToTable(true, "LabID", "LabNumber");

            gvLabHistory.DataSource = distinctValues;
            gvLabHistory.DataBind();
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Init_pages this instance.
        /// </summary>
        private void Init_page()
        {
            ILabFunctions LabResultManager = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory");

            ViewState["LabId"] = Session["PatientVisitId"];
            int labID = 0;

            if (ViewState["LabId"] != null)
            {
                int.TryParse(ViewState["LabId"].ToString(), out labID);
            }

            orderedLabs = LabResultManager.GetOrderedLabs(labID);
            if (!IsPostBack)
            {
                if (orderedLabs.Tables[0].Rows.Count > 0)
                {
                    BindDropdownReportedBy(orderedLabs.Tables[0].Rows[0]["ReportedByName"].ToString());
                    ddlLabReportedbyName.SelectedValue = orderedLabs.Tables[0].Rows[0]["ReportedByName"].ToString();
                    string reportDate = orderedLabs.Tables[0].Rows[0]["ReportedbyDate"].ToString();
                    if (reportDate != "")
                    {
                        txtlabReportedbyDate.Text = ((DateTime.Parse(reportDate)).ToString(Session["AppDateFormat"].ToString()));
                    }
                    ViewState["labOrderDate"] = ((DateTime)orderedLabs.Tables[0].Rows[0]["OrderedbyDate"]);
                }
            }

            DataView dv = orderedLabs.Tables[0].DefaultView;

            DataTable theDT = dv.ToTable(true, "LabDepartmentName");

            foreach (DataRow r in theDT.Rows)
            {
                AddDepartment(r[0].ToString());
            }
            txtlabReportedbyDate.Attributes.Add("onkeyup", "DateFormat(this,this.value,event,false,'3')");
            txtlabReportedbyDate.Attributes.Add("onblur", "DateFormat(this,this.value,event,true,'3')");
        }
Ejemplo n.º 8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     labFunctions         = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory");
     Session["PatientId"] = 0;
 }