Example #1
0
        public void LoadData(ref JMMMedicalHist objJMMMedicalHist)
        {
            try
            {
                JMMMedPrescription objJMMedPrescription = null;

                if (objJMMMedicalHist != null)
                {
                    objJMMedPrescription = new JMMMedPrescription();
                    if (objJMMMedicalHist.JMMedicalHistID.HasValue)
                    {
                        objJMMedPrescription.JMMedicalHistID = objJMMMedicalHist.JMMedicalHistID.Value;
                    }
                    objJMMedPrescription.JMBookingID = objJMMMedicalHist.JMBookingID.Value;
                    objJMMedPrescription.JurisID     = objJMMMedicalHist.JurisID.Value;

                    if (chkInactive.Checked)
                    {
                        objJMMedPrescription.IsActiveSchedule = "1";
                    }
                    else
                    {
                        objJMMedPrescription.IsActiveSchedule = string.Empty;
                    }
                    objJMMedPrescription.ScreenID = ((HtmlInputHidden)(((BasePage)this.Page).FindControl("hdnScreenId"))).Value;
                    DataSet objDS = BindMedicalPrescriptionGrid(ref objJMMedPrescription);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #2
0
        public static object GetCurrentDispenseCount(string JMMedPrescriptionID, string MedicationType)
        {
            JMMMedPrescription objJMMMedPrescription = new JMMMedPrescription();

            objJMMMedPrescription.JMMedPrescriptionID = KPIHlp.CVI64(JMMedPrescriptionID);
            objJMMMedPrescription.MedicationType      = MedicationType;


            JMMMedPrescription objJMMedPrescriptiontref = new JMMMedPrescriptionDB().DispenseTypeCount(ref objJMMMedPrescription);

            return((new System.Web.Script.Serialization.JavaScriptSerializer()).Serialize(objJMMedPrescriptiontref));
        }
Example #3
0
        private DataSet BindMedicalPrescriptionGrid(ref JMMMedPrescription objJMMedPrescription)
        {
            DataSet objDS = null;

            try
            {
                objDS = new JMMMedPrescriptionBL().GetPrescriptionDetails(ref objJMMedPrescription);
                DataRelation objDR = new DataRelation("MasterDetails1", objDS.Tables[0].Columns["JMMedPrescriptionID"], objDS.Tables[1].Columns["JMMedPrescriptionID"], true);
                objDS.Relations.Add(objDR);
                grdPrescription.GridView.GroupedRows.Clear();
                grdPrescription.Rows.Clear();
                grdPrescription.GridView.Rows.Clear();
                grdPrescription.GridView.ClearDataSource();
                grdPrescription.DataSource = objDS;
                grdPrescription.DataBind();
            }
            catch (Exception)
            {
                throw;
            }
            return(objDS);
        }
Example #4
0
        protected void LoadData()
        {
            JMMMedVisit objMedVisit = new JMMMedVisit();
            string      strhdnMode = UIMode.ADD.ToString();
            long        NameID, JMBookingID;

            try
            {
                if (Request.QueryString.Get("JMMedPrescriptionID") != null && Request.QueryString.Get("JMMedPrescriptionID") != string.Empty)
                {
                    hdnPrescriptionID.Value = Request.QueryString.Get("JMMedPrescriptionID").Trim();
                }


                //hdnSchID.Value = Request.QueryString.Get("JMPrescriptionSchduleID") == null ? string.Empty : Request.QueryString.Get("JMPrescriptionSchduleID").Trim();
                NameID = Request.QueryString.Get("NameID") == null ? long.MinValue : KPIHlp.CVI64(Request.QueryString.Get("NameID").Trim());
                if (Request.QueryString.Get("JMMedPrescriptionHistID") != null && Request.QueryString.Get("JMMedPrescriptionHistID") != string.Empty)
                {
                    hdnMedPresHisID.Value = Request.QueryString.Get("JMMedPrescriptionHistID").Trim();
                    hdnMode.Value         = UIMode.INQ.ToString();
                }

                hdnJMMScheduleEventsID.Value = Request.QueryString.Get("JMMScheduleEventsID") == null ? string.Empty : Request.QueryString.Get("JMMScheduleEventsID").Trim();
                hdnJurisId.Value             = Request.QueryString.Get("JurisID") == null?GetPageJuris().ToString() : Request.QueryString.Get("JurisID").Trim();

                try
                {
                    if (NameID > 0)
                    {
                        NamCtrlSPIN.KPIID = NameID;
                        imgFrontView.GenerateImage(true, ImgType.FrontView, ImgRefType.Names, NameID, short.MinValue);
                    }
                }
                catch (KPIException objKPIError)
                {
                    throw objKPIError;
                }
            }
            catch (Exception objError)
            {
                ShowMsg(MsgType.Error, FrwkMsg.OP_FAIL, objError);
            }

            if (hdnMode.Value == UIMode.INQ.ToString()) //Added by jeyaganesh
            {
                blnForceModeChange = true;
                JMMMedPrescription     objJMMMedPrescription     = new JMMMedPrescription();
                JMMMedPrescriptionBL   objJMMMedPrescriptionBL   = new JMMMedPrescriptionBL();
                JMMMedPrescriptionHist objJMMMedPrescriptionHist = new JMMMedPrescriptionHist();
                KPITxtBL objKPITxtBL = new KPITxtBL();


                try
                {
                    objJMMMedPrescriptionHist = new JMMMedPrescriptionHistBL().Select(KPIHlp.CVI64(hdnMedPresHisID.Value));


                    if (objJMMMedPrescriptionHist != null && objJMMMedPrescriptionHist.JMMedPrescriptionHistID.HasValue)
                    {
                        txtNotes.Text   = objKPITxtBL.GetDisplayText(objJMMMedPrescriptionHist.JMMedPrescriptionHistID.Value, TxtType.JmMed_MedHisCmnts);
                        txtDrug.Text    = new CodedBL().GetCodeDescription(6007, objJMMMedPrescriptionHist.Drug, objJMMMedPrescriptionHist.JurisID.Value);
                        txtDosage.Text  = objJMMMedPrescriptionHist.Dosage;
                        txtBalance.Text = objJMMMedPrescriptionHist.CurQuantity.HasValue ? objJMMMedPrescriptionHist.CurQuantity.Value.ToString() : string.Empty;
                        if (!String.IsNullOrWhiteSpace(txtBalance.Text) && KPIHlp.CVI32(txtBalance.Text) <= 5)
                        {
                            txtBalance.ForeColor = System.Drawing.Color.Red;
                            tdComments.Attributes.Add("class", "req");
                        }

                        imgMedSignature.Style.Add("pointer-events", "none");
                        if (objJMMMedPrescriptionHist.Dispense.HasValue && objJMMMedPrescriptionHist.Dispense.Value > 0)
                        {
                            txtDispense.Text = objJMMMedPrescriptionHist.Dispense.HasValue ? objJMMMedPrescriptionHist.Dispense.Value.ToString() : String.Empty;
                        }
                        else
                        {
                            txtDispense.Text = string.Empty;
                        }

                        cddDispense.KPISelectedCodeValue = objJMMMedPrescriptionHist.MedicationType;

                        if (objJMMMedPrescriptionHist.LastAdministeredDttm.HasValue)
                        {
                            dttmLstAdministered.DateValue = objJMMMedPrescriptionHist.LastAdministeredDttm.Value;
                        }
                        else
                        {
                            if (dttmLstAdministered.DateValue == DateTime.MinValue)
                            {
                                dttmLstAdministered.DateValue = new JMMMedPrescriptionHistBL().GetLastAdministeredDttm(ref objJMMMedPrescriptionHist);
                            }
                        }
                        if (objJMMMedPrescriptionHist.ActivityDttm.HasValue)
                        {
                            dttmDateTime.DateValue = objJMMMedPrescriptionHist.ActivityDttm.Value;
                        }
                        if (objJMMMedPrescriptionHist.MarPFID.HasValue)
                        {
                            lupPFNo.KPIID = objJMMMedPrescriptionHist.MarPFID.Value;
                        }
                        cddMethodAdmin.KPISelectedCodeValue = objJMMMedPrescriptionHist.MethodAdministered;
                        cddStatus.KPISelectedCodeValue      = objJMMMedPrescriptionHist.Status;
                        if (objJMMMedPrescriptionHist.MarPFSignID.HasValue)
                        {
                            hdnMarSignId.Value = objJMMMedPrescriptionHist.MarPFSignID.ToString();
                            imgMedSignature.GenerateImage(true, ImgType.Signature, ImgRefType.JMMMarInmateOfficer, objJMMMedPrescriptionHist.MarPFSignID.Value, short.MinValue);
                        }
                        else
                        {
                            hdnMarSignId.Value = string.Empty;
                        }

                        txtInstructions.Text = objJMMMedPrescriptionHist.Instructions;
                    }
                }
                catch (Exception objError)
                {
                    ShowMsg(MsgType.Error, FrwkMsg.OP_FAIL, objError);
                }
            }
            else
            {
                hdnMode.Value = UIMode.ADD.ToString();
                txtDrug.Text  = Request.QueryString.Get("Drug") == null ? string.Empty : Request.QueryString.Get("Drug").Trim();

                if (!String.IsNullOrWhiteSpace(txtDrug.Text))
                {
                    txtDrug.Text = new CodedBL().GetCodeDescription(6007, txtDrug.Text, KPIHlp.CVI32(hdnJurisId.Value));
                }

                txtDosage.Text = Request.QueryString.Get("Dosage") == null?string.Empty: Request.QueryString.Get("Dosage").Trim();
                //txtBalance.Text = Request.QueryString.Get("CurQuantity") == null ? string.Empty : Request.QueryString.Get("CurQuantity").Trim();

                JMMMedPrescriptionHist objJMMMedPrescriptionHist = new JMMMedPrescriptionHist();
                objJMMMedPrescriptionHist.JMMedPrescriptionID = KPIHlp.CVI64(hdnPrescriptionID.Value);
                txtBalance.Text = new JMMMedPrescriptionHistBL().GetMedicationBalance(ref objJMMMedPrescriptionHist).ToString();

                hdnPrescriptionID.Value = Request.QueryString.Get("JMMedPrescriptionID") == null ? string.Empty : Request.QueryString.Get("JMMedPrescriptionID").Trim();
                JMBookingID             = Request.QueryString.Get("JMBookingID") == null ? long.MinValue : KPIHlp.CVI64(Request.QueryString.Get("JMBookingID").Trim());


                lupPFNo.KPIID = State.sPFID;


                ReadAddMode();
            }
        }
Example #5
0
        private JMMMedPrescriptionHist ReadScr(ref JMMMedPrescription objJMMMedPrescription)
        {
            JMMMedPrescriptionHist objJMMMedPrescriptionHist = new JMMMedPrescriptionHist();

            try
            {
                if (ValidateScr())
                {
                    objJMMMedPrescriptionHist.JMMedPrescriptionID   = objJMMMedPrescription.JMMedPrescriptionID;
                    objJMMMedPrescriptionHist.JurisID               = objJMMMedPrescription.JurisID;
                    objJMMMedPrescriptionHist.JMBookingID           = objJMMMedPrescription.JMBookingID;
                    objJMMMedPrescriptionHist.JMMedicalHistID       = objJMMMedPrescription.JMMedicalHistID;
                    objJMMMedPrescriptionHist.JMMedVisitID          = objJMMMedPrescription.JMMedVisitID;
                    objJMMMedPrescriptionHist.PrescribedDttm        = objJMMMedPrescription.PrescribedDttm;
                    objJMMMedPrescriptionHist.PrescribingDoctorID   = objJMMMedPrescription.PrescribingDoctorID;
                    objJMMMedPrescriptionHist.MedicalPrescriptionNo = objJMMMedPrescription.MedicalPrescriptionNo;
                    objJMMMedPrescriptionHist.Prescription          = objJMMMedPrescription.Prescription;
                    objJMMMedPrescriptionHist.Drug               = objJMMMedPrescription.Drug;
                    objJMMMedPrescriptionHist.Dosage             = objJMMMedPrescription.Dosage;
                    objJMMMedPrescriptionHist.PrescribedAmt      = objJMMMedPrescription.PrescribedAmt;
                    objJMMMedPrescriptionHist.PrescribedDuration = objJMMMedPrescription.PrescribedDuration;
                    objJMMMedPrescriptionHist.CurQuantity        = KPIHlp.CVI32(txtBalance.Text); //objJMMMedPrescription.CurQuantity;
                    objJMMMedPrescriptionHist.RefillBal          = objJMMMedPrescription.RefillBal == short.MinValue ? 0 : objJMMMedPrescription.RefillBal;
                    objJMMMedPrescriptionHist.IsGeneric          = objJMMMedPrescription.IsGeneric;
                    objJMMMedPrescriptionHist.Times              = objJMMMedPrescription.Times;

                    if (String.IsNullOrWhiteSpace(Request.QueryString.Get("Flag")))
                    {
                        objJMMMedPrescriptionHist.IsPersonalProp = 1;
                    }
                    else
                    {
                        objJMMMedPrescriptionHist.IsPersonalProp = objJMMMedPrescription.IsPersonalProp;
                    }
                    objJMMMedPrescriptionHist.MedicationType = cddDispense.CodeValue;
                    objJMMMedPrescriptionHist.UseEndedDttm   = objJMMMedPrescription.UseEndedDttm;


                    objJMMMedPrescriptionHist.CreatedPFID  = objJMMMedPrescription.CreatedPFID;
                    objJMMMedPrescriptionHist.CreatedDttm  = objJMMMedPrescription.CreatedDttm;
                    objJMMMedPrescriptionHist.ModifiedPFID = objJMMMedPrescription.ModifiedPFID;
                    objJMMMedPrescriptionHist.ModifiedDttm = objJMMMedPrescription.ModifiedDttm;
                    objJMMMedPrescriptionHist.Custom1      = objJMMMedPrescription.Custom1;
                    objJMMMedPrescriptionHist.Custom2      = objJMMMedPrescription.Custom2;
                    objJMMMedPrescriptionHist.Dispense     = KPIHlp.CVI32(txtDispense.Text);

                    objJMMMedPrescriptionHist.JMMScheduleEventsID     = KPIHlp.CVI64(hdnJMMScheduleEventsID.Value);
                    objJMMMedPrescriptionHist.JMMedPrescriptionHistID = KPICounter.GetCounterID(objJMMMedPrescriptionHist.JurisID.Value);

                    objJMMMedPrescriptionHist.ActivityDttm = dttmDateTime.DateValue;
                    if (lupPFNo.KPIID != long.MinValue)
                    {
                        objJMMMedPrescriptionHist.MarPFID = lupPFNo.KPIID;
                    }
                    if (KPIHlp.CVI64(hdnMarSignId.Value) != long.MinValue)
                    {
                        objJMMMedPrescriptionHist.MarPFSignID = KPIHlp.CVI64(hdnMarSignId.Value);
                    }
                    objJMMMedPrescriptionHist.MethodAdministered = cddMethodAdmin.CodeValue;
                    if (objJMMMedPrescriptionHist.CurQuantity == 0 && String.IsNullOrWhiteSpace(objJMMMedPrescriptionHist.MethodAdministered))
                    {
                        objJMMMedPrescriptionHist.Status = "MEU";
                    }
                    else
                    {
                        objJMMMedPrescriptionHist.Status = cddStatus.CodeValue;
                    }
                    objJMMMedPrescriptionHist.MedicationNotes = txtNotes.Text;
                    objJMMMedPrescriptionHist.Instructions    = txtInstructions.Text;
                    if (dttmLstAdministered.DateValue != DateTime.MinValue)
                    {
                        objJMMMedPrescriptionHist.LastAdministeredDttm = dttmLstAdministered.DateValue;
                    }
                }
            }
            catch (Exception objError)
            {
                ShowMsg(MsgType.Error, FrwkMsg.OP_FAIL, objError);
            }
            return(objJMMMedPrescriptionHist);
        }
Example #6
0
        public void ReadScr(ref JMMMedicalHist objJMMMedicalHist)
        {
            #region
            JMMMedPrescriptionList objJMMedPrescriptionList = new JMMMedPrescriptionList();
            for (int iCount = 0; iCount < grdPrescription.Rows.Count; iCount++)
            {
                if (grdPrescription.IsActiveRow(iCount))
                {
                    JMMMedPrescription objJMMedPrescription = new JMMMedPrescription();

                    objJMMedPrescription.JurisID         = objJMMMedicalHist.JurisID != Int32.MinValue ? objJMMMedicalHist.JurisID : null;
                    objJMMedPrescription.JMMedicalHistID = objJMMMedicalHist.JMMedicalHistID.Value;
                    objJMMedPrescription.JMBookingID     = objJMMMedicalHist.JMBookingID;
                    hdnBookingID.Value = objJMMMedicalHist.JMBookingID.Value.ToString();
                    if (grdPrescription.GetLong(iCount, "JMMedVisitID") > 0)
                    {
                        objJMMedPrescription.JMMedVisitID = grdPrescription.GetLong(iCount, "JMMedVisitID");
                    }
                    else
                    {
                        objJMMedPrescription.JMMedVisitID = null;
                    }

                    long JMMedPrescriptionID = grdPrescription.GetLong(iCount, "KPIID");
                    if (JMMedPrescriptionID != long.MinValue && JMMedPrescriptionID > 0)
                    {
                        objJMMedPrescription.JMMedPrescriptionID   = JMMedPrescriptionID;
                        objJMMedPrescription.MedicalPrescriptionNo = KPIHlp.CVI64(grdPrescription.Rows[iCount].Items.FindItemByKey("MedicalPrescriptionNo").Text);
                        objJMMedPrescription.cMode = 'C';
                    }
                    else
                    {
                        objJMMedPrescription.JMMedPrescriptionID   = KPICounter.GetCounterID(objJMMedPrescription.JurisID.Value);
                        objJMMedPrescription.MedicalPrescriptionNo = Counter.GetCounterNo(objJMMedPrescription.JurisID.Value, CounterType.MedicalPrescriptionNo, Int64.MinValue);
                        objJMMedPrescription.cMode = 'A';
                    }



                    //missing prescribed date
                    if (grdPrescription.GetDateTime(iCount, "PrescribedDttm") != DateTime.MinValue)
                    {
                        objJMMedPrescription.PrescribedDttm = grdPrescription.GetDateTime(iCount, "PrescribedDttm");
                    }

                    objJMMedPrescription.PrescribingDoctorID = KPIHlp.CVI64(grdPrescription.Rows[iCount].Items.FindItemByKey("PrescribingDoctorID").Text);
                    if (!String.IsNullOrWhiteSpace(grdPrescription.Rows[iCount].Items.FindItemByKey("Prescription").Text))
                    {
                        objJMMedPrescription.Prescription = grdPrescription.Rows[iCount].Items.FindItemByKey("Prescription").Text;
                    }
                    objJMMedPrescription.Drug = grdPrescription.Rows[iCount].Items.FindItemByKey("Drug").Text;
                    if (!String.IsNullOrWhiteSpace(grdPrescription.Rows[iCount].Items.FindItemByKey("Dosage").Text))
                    {
                        objJMMedPrescription.Dosage = grdPrescription.Rows[iCount].Items.FindItemByKey("Dosage").Text;
                    }
                    if (!String.IsNullOrWhiteSpace(grdPrescription.Rows[iCount].Items.FindItemByKey("PrescribedAmt").Text) && KPIHlp.CVI32(grdPrescription.Rows[iCount].Items.FindItemByKey("PrescribedAmt").Text) != Int32.MinValue)
                    {
                        objJMMedPrescription.PrescribedAmt = KPIHlp.CVI32(grdPrescription.Rows[iCount].Items.FindItemByKey("PrescribedAmt").Text);
                    }
                    if (!String.IsNullOrWhiteSpace(grdPrescription.Rows[iCount].Items.FindItemByKey("PrescribedDuration").Text))
                    {
                        objJMMedPrescription.PrescribedDuration = grdPrescription.Rows[iCount].Items.FindItemByKey("PrescribedDuration").Text;
                    }
                    if (!String.IsNullOrWhiteSpace(grdPrescription.Rows[iCount].Items.FindItemByKey("Refills").Text) && KPIHlp.CVI32(grdPrescription.Rows[iCount].Items.FindItemByKey("Refills").Text) != Int32.MinValue)
                    {
                        objJMMedPrescription.Refills = KPIHlp.CVI32(grdPrescription.Rows[iCount].Items.FindItemByKey("Refills").Text);
                    }
                    if (grdPrescription.Rows[iCount].Items.FindItemByKey("IsGeneric").Text == "1")
                    {
                        objJMMedPrescription.IsGeneric = 1;
                    }
                    else
                    {
                        objJMMedPrescription.IsGeneric = 0;
                    }
                    objJMMedPrescription.Times = 0;


                    if (grdPrescription.GetInt(iCount, "CurQuantity") > 0)
                    {
                        objJMMedPrescription.CurQuantity = KPIHlp.CVI32(grdPrescription.Rows[iCount].Items.FindItemByKey("CurQuantity").Text);
                        objJMMedPrescription.Balance     = KPIHlp.CVI32(grdPrescription.Rows[iCount].Items.FindItemByKey("CurQuantity").Text);
                    }
                    else
                    {
                        objJMMedPrescription.CurQuantity = 0;
                        objJMMedPrescription.Balance     = 0;
                    }


                    objJMMedPrescription.IsPersonalProp = 0;
                    if (grdPrescription.GetDateTime(iCount, "UseEndedDttmTemp") != DateTime.MinValue)
                    {
                        objJMMedPrescription.UseEndedDttm = grdPrescription.GetDateTime(iCount, "UseEndedDttmTemp");
                    }
                    //if (!string.IsNullOrWhiteSpace(grdPrescription.Rows[iCount].Items.FindItemByKey("Balance").Text) && KPIHlp.CVI32(grdPrescription.Rows[iCount].Items.FindItemByKey("Balance").Text) != Int32.MinValue)
                    //{
                    //    objJMMedPrescription.Balance = KPIHlp.CVI32(grdPrescription.Rows[iCount].Items.FindItemByKey("Balance").Text);
                    //}
                    //objJMMedPrescription.MedicationType = null; // grdPrescription.Rows[iCount].Items.FindItemByKey("MedicationType").Text;

                    if (!String.IsNullOrWhiteSpace(grdPrescription.Rows[iCount].Items.FindItemByKey("Notes").Text))
                    {
                        objJMMedPrescription.PrescribeNotes = grdPrescription.Rows[iCount].Items.FindItemByKey("Notes").Text;
                    }

                    objJMMedPrescription.IsActiveSchedule = grdPrescription.Rows[iCount].Items.FindItemByKey("IsActiveSchedule").Text;


                    objJMMedPrescriptionList.Add(objJMMedPrescription);
                }
            }
            objJMMMedicalHist.objJMMMedPrescriptionList = objJMMedPrescriptionList;
            #endregion
        }