示例#1
0
        protected void PrintDoctorInquiry()
        {
            try
            {
                JmsDoctor objJmsDoctor = new JmsDoctor();
                objJmsDoctor.DoctorName = KPIHlp.CVS(txtName.Text);
                objJmsDoctor.Location   = KPIHlp.CVS(txtLocation.Text);

                if (chkIsActive.Checked == true)
                {
                    objJmsDoctor.IsActive = 0;
                }
                else
                {
                    objJmsDoctor.IsActive = 1;
                }

                objJmsDoctor.DoctorName = KPIHlp.CVS(txtName.Text);
                objJmsDoctor.Location   = KPIHlp.CVS(txtLocation.Text);
                objJmsDoctor.JurisID    = lstJuris.JurisID;

                JmsDoctorBL objJmsDoctorBL = new JmsDoctorBL();

                objJmsDoctorBL.DoctorPrintSearch(objJmsDoctor);
                WrtActivityLog(long.MinValue, "DoctorSearch Print", "PRT");
                // 66954
                State.PageSelectedSubAgency = -1;
                //
                PrintReport();
            }
            catch (Exception objErr)
            {
                ShowMsg(MsgType.Error, FrwkMsg.PAGE_ERR, objErr);
            }
        }
示例#2
0
        private bool Save()
        {
            try
            {
                JmsDoctor objJmsDoctor = ReadScr();

                JmsDoctorBL objJmsDoctorBL = new JmsDoctorBL();
                if (hdnMode.Value == UIMode.ADD.ToString())
                {
                    objJmsDoctorBL.Insert(objJmsDoctor);
                    ShowMsg(MsgType.Success, FrwkMsg.ADD_SUCCESS);
                    hdnMode.Value     = UIMode.CHG.ToString();
                    hdnDoctorId.Value = KPIHlp.CVS(objJmsDoctor.DoctorID);
                }
                else
                {
                    objJmsDoctor.DoctorID = KPIHlp.CVI64(hdnDoctorId.Value);
                    objJmsDoctorBL.Update(objJmsDoctor);
                    ShowMsg(MsgType.Success, FrwkMsg.UPD_SUCCESS);
                    hdnMode.Value = UIMode.CHG.ToString();
                }
                //Updating the parent

                Inquiry(objJmsDoctor.DoctorID);
                AutoUpdateParent();

                return(true);
            }
            catch (Exception objErr)
            {
                throw objErr;
            }
        }
示例#3
0
        public void GetDoctorInfo(ref JMMMedicalHist objJMMMedicalHist)
        {
            JmsDoctor   objJmsDoc   = new JmsDoctor();
            JmsDoctorBL objJmsDocBL = new JmsDoctorBL();

            try
            {
                if (objJMMMedicalHist != null && objJMMMedicalHist.JMBookingID.HasValue && objJMMMedicalHist.JMBookingID.Value > 0 && objJMMMedicalHist.PrimeDentistID.HasValue && objJMMMedicalHist.PrimeDentistID.Value > 0)
                {
                    objJmsDoc.DoctorID = objJMMMedicalHist.PrimeDentistID.Value;
                    objJmsDoc.JurisID  = objJMMMedicalHist.JurisID.Value;
                    objJmsDoc.IsDental = 1;
                    objJmsDoc          = objJmsDocBL.SelectDoctor(ref objJmsDoc);
                    if (objJmsDoc != null)
                    {
                        txtOfficeLocation.Text     = objJmsDoc.Location;
                        cusHeaderPhone.PhoneNumber = KPIHlp.GVS(objJmsDoc.PhoneNbrIsNull, objJmsDoc.PhoneNbr);
                        cusHeaderPhone.PhoneType   = KPIHlp.GVS(objJmsDoc.PhoneTypeIsNull, objJmsDoc.PhoneType);

                        lupPrimaryDentist.KPIID    = objJmsDoc.DoctorID;
                        lupPrimaryDentist.KPIValue = objJmsDoc.DoctorName;
                    }
                    else
                    {
                        txtOfficeLocation.Text     = "";
                        cusHeaderPhone.PhoneNumber = null;
                        cusHeaderPhone.PhoneType   = null;
                        lupPrimaryDentist.KPIID    = long.MinValue;
                        lupPrimaryDentist.KPIValue = string.Empty;
                    }
                }
                else
                {
                    txtOfficeLocation.Text     = "";
                    cusHeaderPhone.PhoneNumber = null;
                    cusHeaderPhone.PhoneType   = null;
                    lupPrimaryDentist.KPIID    = long.MinValue;
                    lupPrimaryDentist.KPIValue = string.Empty;
                    ((BasePage)this.Page).AddClientOnLoadScript("SCV('Dental', 'txtOfficeLocation', '',0);");
                }
            }
            catch (Exception objError)
            {
                throw objError;
            }
        }
示例#4
0
        private JmsDoctor ReadScr()
        {
            try
            {
                JmsDoctor objJmsDoctor = null;

                objJmsDoctor         = new JmsDoctor();
                objJmsDoctor.JurisID = lstJuris.JurisID;

                objJmsDoctor.DoctorID = KPICounter.GetCounterID(objJmsDoctor.JurisID);

                objJmsDoctor.DoctorName = txtDoctorName.Text;
                objJmsDoctor.Location   = txtadrMainAddress.Text;
                objJmsDoctor.City       = KPIHlp.CVS(custHeaderCSZ.City);
                objJmsDoctor.State      = KPIHlp.CVS(custHeaderCSZ.State);
                objJmsDoctor.Zip        = KPIHlp.CVS(custHeaderCSZ.Zip);

                objJmsDoctor.PhoneNbr  = KPIHlp.CVS(cusHeaderPhone.PhoneNumber);
                objJmsDoctor.PhoneType = KPIHlp.CVS(cusHeaderPhone.PhoneType);
                objJmsDoctor.PhoneID   = KPICounter.GetCounterID(objJmsDoctor.JurisID);
                if (chkDentist.Checked)
                {
                    objJmsDoctor.IsDental = 1;
                }
                else
                {
                    objJmsDoctor.IsDental = 0;
                }

                if (chkInActive.Checked)
                {
                    objJmsDoctor.IsActive     = 0;
                    objJmsDoctor.InActiveDttm = KPIHlp.CVDttm(txtInActive.Text.ToString());
                }
                else
                {
                    objJmsDoctor.IsActive = 1;
                }

                return(objJmsDoctor);
            }
            catch (Exception objErr)
            {
                throw objErr;
            }
        }
示例#5
0
        /// <summary>
        /// To display doctor Location and Phone number in INquiy
        /// </summary>
        /// <param name="DoctorID">Return Location and Phone number</param>

        public void getDoctorInfo(ref JMMMedicalHist objJMMMedicalHist)
        {
            JmsDoctor objJmsDoc = new JmsDoctor();;

            try
            {
                if (objJMMMedicalHist != null && objJMMMedicalHist.JMBookingID.HasValue && objJMMMedicalHist.JMBookingID.Value > 0 && objJMMMedicalHist.PrimeDoctorID.HasValue && objJMMMedicalHist.PrimeDoctorID.Value > 0)
                {
                    objJmsDoc.DoctorID = objJMMMedicalHist.PrimeDoctorID.Value;
                    objJmsDoc.IsDental = 0;
                    objJmsDoc.JurisID  = objJMMMedicalHist.JurisID.Value;
                    objJmsDoc          = new JmsDoctorBL().SelectDoctor(ref objJmsDoc);

                    if (objJmsDoc != null)
                    {
                        txtOfficeLocation.Text     = objJmsDoc.Location;
                        cusHeaderPhone.PhoneNumber = KPIHlp.GVS(objJmsDoc.PhoneNbrIsNull, objJmsDoc.PhoneNbr);
                        cusHeaderPhone.PhoneType   = KPIHlp.GVS(objJmsDoc.PhoneTypeIsNull, objJmsDoc.PhoneType);
                        lupPrimaryDoctor.KPIID     = objJmsDoc.DoctorID;
                        lupPrimaryDoctor.KPIValue  = objJmsDoc.DoctorName;
                    }
                    else
                    {
                        cusHeaderPhone.PhoneNumber = null;
                        cusHeaderPhone.PhoneType   = null;
                        ((BasePage)this.Page).AddClientOnLoadScript("SCV('Main', 'txtOfficeLocation', '',0);SCV('Main', 'lupPrimaryDoctor', '',6);SCV('Main', 'lupPrimaryDoctor', '',7);SCV('Main', 'lupPrimaryDoctor', '',77);");
                    }
                }
                else
                {
                    cusHeaderPhone.PhoneNumber = null;
                    cusHeaderPhone.PhoneType   = null;
                    ((BasePage)this.Page).AddClientOnLoadScript("SCV('Main', 'txtOfficeLocation', '',0);SCV('Main', 'lupPrimaryDoctor', '',6);SCV('Main', 'lupPrimaryDoctor', '',7);SCV('Main', 'lupPrimaryDoctor', '',77);");
                }
            }
            catch (Exception objError)
            {
                throw objError;
            }
        }
示例#6
0
        protected void Inquiry(long DoctorID)
        {
            try
            {
                JmsDoctor   objJmsDoctor   = new JmsDoctor();
                JmsDoctorBL objJmsDoctorBL = new JmsDoctorBL();

                objJmsDoctor = objJmsDoctorBL.Select(DoctorID);

                txtadrMainAddress.Text     = KPIHlp.GVS(objJmsDoctor.LocationIsNull, objJmsDoctor.Location);
                custHeaderCSZ.City         = KPIHlp.GVS(objJmsDoctor.CityIsNull, objJmsDoctor.City);
                custHeaderCSZ.State        = KPIHlp.GVS(objJmsDoctor.StateIsNull, objJmsDoctor.State);
                custHeaderCSZ.Zip          = KPIHlp.GVS(objJmsDoctor.ZipIsNull, objJmsDoctor.Zip);
                cusHeaderPhone.PhoneNumber = KPIHlp.GVS(objJmsDoctor.PhoneNbrIsNull, objJmsDoctor.PhoneNbr);
                cusHeaderPhone.PhoneType   = KPIHlp.GVS(objJmsDoctor.PhoneTypeIsNull, objJmsDoctor.PhoneType);
                if (objJmsDoctor.IsActive == 0)
                {
                    chkInActive.Checked = true;
                    txtInActive.Text    = Convert.ToDateTime(objJmsDoctor.InActiveDttm).ToString();
                }
                else
                {
                    chkInActive.Checked = false;
                }
                if (objJmsDoctor.IsDental == 1)
                {
                    chkDentist.Checked = true;
                }
                else
                {
                    chkDentist.Checked = false;
                }
                txtDoctorName.Text = KPIHlp.GVS(objJmsDoctor.DoctorNameIsNull, objJmsDoctor.DoctorName);
            }
            catch (Exception objErr)
            {
                throw objErr;
            }
        }
示例#7
0
        protected DataSet GetData(bool blnExcel)
        {
            try
            {
                JmsDoctor objJmsDoctor = new JmsDoctor();
                objJmsDoctor.DoctorName = KPIHlp.CVS(txtName.Text);
                objJmsDoctor.Location   = KPIHlp.CVS(txtLocation.Text);

                if (chkIsActive.Checked == true)
                {
                    objJmsDoctor.IsActive = 0;
                }
                else
                {
                    objJmsDoctor.IsActive = 1;
                }

                objJmsDoctor.DoctorName = KPIHlp.CVS(txtName.Text);
                objJmsDoctor.Location   = KPIHlp.CVS(txtLocation.Text);
                objJmsDoctor.JurisID    = lstJuris.JurisID;

                JmsDoctorBL objJmsDoctorBL = new JmsDoctorBL();
                iGrdPageSize = 23;

                if (!blnExcel)
                {
                    return(objJmsDoctorBL.Search(objJmsDoctor, grdDoctorSrch.KPICurrentGrdPageIndex, iGrdPageSize));
                }
                else
                {
                    return(objJmsDoctorBL.Search(objJmsDoctor, 1, iExcelPageSize));
                }
            }
            catch (Exception objErr)
            {
                throw objErr;
            }
        }
示例#8
0
        protected void LoadData()
        {
            try
            {
                KPITrace.Debug(TraceWeight.Five, "Getting Prescription History info from JmmMedPresHist DB.");
                string sCaller = "";
                NameValueCollection nvcXMLResponseData = new NameValueCollection();

                NameValueCollection nvcXMLPOSTData = GetKPIXMLPOSTData();

                sCaller = nvcXMLPOSTData.Get("Caller") == null ? string.Empty : nvcXMLPOSTData.Get("Caller");

                if (sCaller.Equals("RefillHist"))
                {
                    string sMode, sActDttm, sBalQuan, sPresID, sRefill, sBalRefill = "";

                    sMode      = nvcXMLPOSTData.Get("Mode") == null ? string.Empty : nvcXMLPOSTData.Get("Mode");
                    sActDttm   = nvcXMLPOSTData.Get("ActivityDate") == null ? string.Empty : nvcXMLPOSTData.Get("ActivityDate");
                    sPresID    = nvcXMLPOSTData.Get("PrescId") == null ? string.Empty : nvcXMLPOSTData.Get("PrescId");
                    sBalQuan   = nvcXMLPOSTData.Get("BalQuan") == null ? string.Empty : nvcXMLPOSTData.Get("BalQuan");
                    sRefill    = nvcXMLPOSTData.Get("Refills") == null ? string.Empty : nvcXMLPOSTData.Get("Refills");
                    sBalRefill = nvcXMLPOSTData.Get("RefillBal") == null ? string.Empty : nvcXMLPOSTData.Get("RefillBal");
                    ///JmmMedPresHist--Adding into prescription History table
                    JmmMedPresHist   objJmmMedPresHist   = new JmmMedPresHist();
                    JmmMedPresHistBL objJmmMedPresHistBL = new JmmMedPresHistBL();
                    objJmmMedPresHist.MedPrescribeID = KPIHlp.CVI64(sPresID);
                    objJmmMedPresHist.JurisID        = GetPageJuris();
                    objJmmMedPresHist.MedPresHistID  = KPICounter.GetCounterID(objJmmMedPresHist.JurisID);
                    objJmmMedPresHist.ActivityDttm   = KPIHlp.CVDttm(sActDttm);
                    objJmmMedPresHist.BalanceQty     = KPIHlp.CVI32(sBalQuan);
                    objJmmMedPresHist.DispenseQty    = 0;
                    objJmmMedPresHist.FillQty        = KPIHlp.CVI32(sRefill);
                    objJmmMedPresHist.IsFill         = 1;
                    objJmmMedPresHist.OfficerPFID    = State.sPFID;
                    objJmmMedPresHist.PendRefills    = KPIHlp.CVI32(sBalRefill);
                    ////Updating Prescription Table on refill.
                    JmmMedPrescribe   objMedPres   = new JmmMedPrescribe();
                    JmmMedPrescribeBL objMedPresBL = new JmmMedPrescribeBL();

                    objMedPres.MedPrescribeID = KPIHlp.CVI64(sPresID);
                    objMedPres.JurisID        = GetPageJuris();
                    objMedPres.CurQuantity    = KPIHlp.CVI32(sBalQuan);
                    objMedPres.RefillBal      = KPIHlp.CVI16(sBalRefill);

                    if (sMode.Equals("A"))
                    {
                        objJmmMedPresHistBL.Insert(objJmmMedPresHist);
                        objMedPresBL.UpdateBalance(objMedPres);
                        nvcXMLResponseData.Add("PrescrpHistId", objJmmMedPresHist.MedPresHistID.ToString());
                        nvcXMLResponseData.Add("PFid", objJmmMedPresHist.OfficerPFID.ToString());
                    }
                    else
                    {
                        objJmmMedPresHistBL.Update(objJmmMedPresHist);
                        nvcXMLResponseData.Add("PrescrpHistId", objJmmMedPresHist.MedPresHistID.ToString());
                    }
                    Response.Write(BuildKPIXMLResponse(nvcXMLResponseData));
                    Response.End();
                }
                else if (sCaller.Equals("PrescripUseEnd"))
                {
                    string sMode, sUseEnd, sComments, sPresID = "";
                    int    result = 0;
                    sMode     = nvcXMLPOSTData.Get("Mode") == null ? string.Empty : nvcXMLPOSTData.Get("Mode");
                    sUseEnd   = nvcXMLPOSTData.Get("UseEnd") == null ? string.Empty : nvcXMLPOSTData.Get("UseEnd");
                    sComments = nvcXMLPOSTData.Get("comments") == null ? string.Empty : nvcXMLPOSTData.Get("comments");
                    sPresID   = nvcXMLPOSTData.Get("PrescId") == null ? string.Empty : nvcXMLPOSTData.Get("PrescId");

                    JmmMedPrescribe   objJmmPresc   = new JmmMedPrescribe();
                    JmmMedPrescribeBL objJmmPrescBL = new JmmMedPrescribeBL();
                    objJmmPresc.MedPrescribeID = KPIHlp.CVI64(sPresID);
                    objJmmPresc.EndedDttm      = KPIHlp.CVDttm(sUseEnd);
                    objJmmPresc.PrescribeNotes = sComments;
                    objJmmPresc.JurisID        = GetPageJuris();
                    if (sMode.Equals("C"))
                    {
                        try
                        {
                            result = objJmmPrescBL.UpdateUseEnd(objJmmPresc);
                        }
                        catch (Exception ex)
                        {
                            string exp = ex.Message;
                        }
                        if (result == 1)
                        {
                            nvcXMLResponseData.Add("Success", "1");
                        }
                        else
                        {
                            nvcXMLResponseData.Add("Success", "0");
                        }
                    }

                    Response.Write(BuildKPIXMLResponse(nvcXMLResponseData));
                    Response.End();
                }
            }
            catch (Exception objErr)
            {
                if (!objErr.Message.StartsWith("Thread was being aborted"))
                {
                    string sErrMsg = "Invalid XML Request String" + objErr.Message;
                    Response.Write(sErrMsg);
                    Response.End();
                    //return;
                }
            }

            try
            {
                KPITrace.Debug(TraceWeight.Five, "Getting Doctor info from JmsDoctor DB.");

                string sDoctor, sCallertype = "";
                string sDrug, sDosage, sPrescribedAmt, sRefills, sGenericAllowed, sNotes, sPresID, sVisitID, sBookID, sMode, sCurBalance = "";
                string JurisID        = string.Empty;
                string JMMDentVisitID = string.Empty;
                string RecType        = string.Empty;
                string JMMMedVisitID  = string.Empty;
                NameValueCollection nvcXMLPOSTData     = GetKPIXMLPOSTData();
                NameValueCollection nvcXMLResponseData = new NameValueCollection();
                sCallertype = nvcXMLPOSTData.Get("CallerType") == null ? string.Empty : nvcXMLPOSTData.Get("CallerType");
                if (sCallertype.Equals("PrimaryDoctor"))
                {
                    sDoctor = nvcXMLPOSTData.Get("Doctor") == null ? string.Empty : nvcXMLPOSTData.Get("Doctor");
                    JmsDoctor   objJmsDoc   = new JmsDoctor();
                    JmsDoctorBL objJmsDocBL = new JmsDoctorBL();
                    //bool blnValid = false;

                    if (sDoctor != null && sDoctor != string.Empty)
                    {
                        objJmsDoc.DoctorID = KPIHlp.CVI64(sDoctor);
                        objJmsDoc.JurisID  = GetPageJuris();
                        objJmsDoc.IsDental = 0;
                        objJmsDoc          = objJmsDocBL.SelectDoctor(ref objJmsDoc);

                        if (objJmsDoc != null)
                        {
                            nvcXMLResponseData.Add("location", objJmsDoc.Location);
                            nvcXMLResponseData.Add("Phone", objJmsDoc.PhoneNbr);
                            nvcXMLResponseData.Add("PhoneType", objJmsDoc.PhoneType);
                        }
                        else
                        {
                            nvcXMLResponseData.Add("location", "");
                            nvcXMLResponseData.Add("Phone", "");
                            nvcXMLResponseData.Add("PhoneType", "");
                        }

                        Response.Write(BuildKPIXMLResponse(nvcXMLResponseData));
                        Response.End();
                    }
                }
                else if (sCallertype.Equals("PrimaryDentist"))
                {
                    sDoctor = nvcXMLPOSTData.Get("Doctor") == null ? string.Empty : nvcXMLPOSTData.Get("Doctor");
                    JmsDoctor   objJmsDoc   = new JmsDoctor();
                    JmsDoctorBL objJmsDocBL = new JmsDoctorBL();
                    //bool blnValid = false;

                    if (sDoctor != null && sDoctor != string.Empty)
                    {
                        objJmsDoc.DoctorID = KPIHlp.CVI64(sDoctor);
                        objJmsDoc.JurisID  = GetPageJuris();
                        objJmsDoc.IsDental = 1;
                        objJmsDoc          = objJmsDocBL.SelectDentist(objJmsDoc.DoctorID);

                        if (objJmsDoc != null)
                        {
                            nvcXMLResponseData.Add("location", objJmsDoc.Location);
                            nvcXMLResponseData.Add("Phone", objJmsDoc.PhoneNbr);
                            nvcXMLResponseData.Add("PhoneType", objJmsDoc.PhoneType);
                        }
                        else
                        {
                            nvcXMLResponseData.Add("location", "");
                            nvcXMLResponseData.Add("Phone", "");
                            nvcXMLResponseData.Add("PhoneType", "");
                        }

                        Response.Write(BuildKPIXMLResponse(nvcXMLResponseData));
                        Response.End();
                    }
                }
                else if (sCallertype.Equals("Prescription"))
                {
                    sDrug           = nvcXMLPOSTData.Get("Drug") == null ? string.Empty : nvcXMLPOSTData.Get("Drug");
                    sDosage         = nvcXMLPOSTData.Get("Dosage") == null ? string.Empty : nvcXMLPOSTData.Get("Dosage");
                    sPrescribedAmt  = nvcXMLPOSTData.Get("PrescribedAmt") == null ? string.Empty : nvcXMLPOSTData.Get("PrescribedAmt");
                    sRefills        = nvcXMLPOSTData.Get("Refills") == null ? string.Empty : nvcXMLPOSTData.Get("Refills");
                    sGenericAllowed = nvcXMLPOSTData.Get("GenericAllowed") == null ? string.Empty : nvcXMLPOSTData.Get("GenericAllowed");
                    sNotes          = nvcXMLPOSTData.Get("Notes") == null ? string.Empty : nvcXMLPOSTData.Get("Notes");
                    sVisitID        = nvcXMLPOSTData.Get("VisitId") == null ? string.Empty : nvcXMLPOSTData.Get("VisitId");
                    sBookID         = nvcXMLPOSTData.Get("BookId") == null ? string.Empty : nvcXMLPOSTData.Get("BookId");
                    sMode           = nvcXMLPOSTData.Get("Mode") == null ? string.Empty : nvcXMLPOSTData.Get("Mode");
                    sPresID         = nvcXMLPOSTData.Get("Prescriptionid") == null ? string.Empty : nvcXMLPOSTData.Get("Prescriptionid");

                    JmmMedPrescribe   objJmmPresc   = new JmmMedPrescribe();
                    JmmMedPrescribeBL objJmmPrescBL = new JmmMedPrescribeBL();
                    objJmmPresc.Dosage        = sDosage.ToString();
                    objJmmPresc.Drug          = sDrug.ToString();
                    objJmmPresc.PrescribedAmt = KPIHlp.CVI32(sPrescribedAmt.ToString());
                    objJmmPresc.Refills       = KPIHlp.CVI32(sRefills.ToString());
                    if (sGenericAllowed.ToString().Equals("true"))
                    {
                        objJmmPresc.IsGeneric = 1;
                    }
                    else
                    {
                        objJmmPresc.IsGeneric = 0;
                    }

                    objJmmPresc.CurQuantity = KPIHlp.CVI32(sPrescribedAmt.ToString());
                    //need to change
                    objJmmPresc.cMode          = KPIHlp.CVC(sMode);
                    objJmmPresc.IsPersonalProp = 0;
                    //need to pass
                    objJmmPresc.JMBookingID = KPIHlp.CVI64(sBookID.ToString());
                    objJmmPresc.JurisID     = GetPageJuris();

                    objJmmPresc.MedVisitID = KPIHlp.CVI64(sVisitID.ToString());
                    objJmmPresc.RefillBal  = KPIHlp.CVI16(sRefills.ToString());
                    objJmmPresc.Times      = 0;
                    //objJmmPresc.Times="";
                    objJmmPresc.PrescribeNotes = sNotes.ToString();
                    if (sMode.Equals("A"))
                    {
                        objJmmPresc.MedPrescribeID = KPICounter.GetCounterID(objJmmPresc.JurisID);
                        objJmmPrescBL.Insert(objJmmPresc);
                        nvcXMLResponseData.Add("PrescriptionId", objJmmPresc.MedPrescribeID.ToString());
                    }
                    else
                    {
                        objJmmPresc.MedPrescribeID = KPIHlp.CVI64(sPresID);
                        objJmmPrescBL.Update(objJmmPresc);
                        //get id from grd
                        nvcXMLResponseData.Add("PrescriptionId", objJmmPresc.MedPrescribeID.ToString());
                    }

                    Response.Write(BuildKPIXMLResponse(nvcXMLResponseData));
                    Response.End();
                }
                #region
                else if (sCallertype == "DentistEntryNotes")
                {
                    JMMDentVisitID = nvcXMLPOSTData.Get("JMMDentVisitID") == null ? string.Empty : nvcXMLPOSTData.Get("JMMDentVisitID").ToString();
                    JurisID        = nvcXMLPOSTData.Get("JurisID") == null ? string.Empty : nvcXMLPOSTData.Get("JurisID").ToString();
                    RecType        = nvcXMLPOSTData.Get("RecType") == null ? string.Empty : nvcXMLPOSTData.Get("RecType").ToString();

                    sNotes = new CMSHlp().GetCommentNotes(Convert.ToInt64(JMMDentVisitID), KPIHlp.CVI32(RecType));

                    if (!string.IsNullOrEmpty(sNotes))
                    {
                        nvcXMLResponseData.Add("Notes", sNotes);
                    }
                    Response.Write(BuildKPIXMLResponse(nvcXMLResponseData));
                    Response.End();
                }
                #endregion

                #region Medical Visit Facility Notes
                else if (sCallertype == "MedicalVisitNotes")
                {
                    JMMMedVisitID = nvcXMLPOSTData.Get("JMMMedVisitID") == null ? string.Empty : nvcXMLPOSTData.Get("JMMMedVisitID").ToString();
                    JurisID       = nvcXMLPOSTData.Get("JurisID") == null ? string.Empty : nvcXMLPOSTData.Get("JurisID").ToString();
                    RecType       = nvcXMLPOSTData.Get("RecType") == null ? string.Empty : nvcXMLPOSTData.Get("RecType").ToString();

                    sNotes = new CMSHlp().GetCommentNotes(Convert.ToInt64(JMMMedVisitID), KPIHlp.CVI32(RecType));

                    if (!string.IsNullOrEmpty(sNotes))
                    {
                        nvcXMLResponseData.Add("Notes", sNotes);
                    }
                    Response.Write(BuildKPIXMLResponse(nvcXMLResponseData));
                    Response.End();
                }
                #endregion
                else
                {
                    sDrug           = nvcXMLPOSTData.Get("Drug") == null ? string.Empty : nvcXMLPOSTData.Get("Drug");
                    sDosage         = nvcXMLPOSTData.Get("Dosage") == null ? string.Empty : nvcXMLPOSTData.Get("Dosage");
                    sPrescribedAmt  = nvcXMLPOSTData.Get("PrescribedAmt") == null ? string.Empty : nvcXMLPOSTData.Get("PrescribedAmt");
                    sRefills        = nvcXMLPOSTData.Get("Refills") == null ? string.Empty : nvcXMLPOSTData.Get("Refills");
                    sGenericAllowed = nvcXMLPOSTData.Get("GenericAllowed") == null ? string.Empty : nvcXMLPOSTData.Get("GenericAllowed");
                    sNotes          = nvcXMLPOSTData.Get("Notes") == null ? string.Empty : nvcXMLPOSTData.Get("Notes");
                    sCurBalance     = nvcXMLPOSTData.Get("CurBalance") == null ? string.Empty : nvcXMLPOSTData.Get("CurBalance");
                    sBookID         = nvcXMLPOSTData.Get("BookId") == null ? string.Empty : nvcXMLPOSTData.Get("BookId");
                    sMode           = nvcXMLPOSTData.Get("Mode") == null ? string.Empty : nvcXMLPOSTData.Get("Mode");
                    sPresID         = nvcXMLPOSTData.Get("Prescriptionid") == null ? string.Empty : nvcXMLPOSTData.Get("Prescriptionid");
                    sVisitID        = nvcXMLPOSTData.Get("MedVisitID") == null ? string.Empty : nvcXMLPOSTData.Get("MedVisitID");

                    JmmMedPrescribe   objJmmPresc   = new JmmMedPrescribe();
                    JmmMedPrescribeBL objJmmPrescBL = new JmmMedPrescribeBL();
                    objJmmPresc.Dosage        = sDosage.ToString();
                    objJmmPresc.Drug          = sDrug.ToString();
                    objJmmPresc.PrescribedAmt = KPIHlp.CVI32(sPrescribedAmt.ToString());
                    objJmmPresc.Refills       = KPIHlp.CVI32(sRefills.ToString());
                    if (sGenericAllowed.ToString().Equals("true"))
                    {
                        objJmmPresc.IsGeneric = 1;
                    }
                    else
                    {
                        objJmmPresc.IsGeneric = 0;
                    }

                    objJmmPresc.CurQuantity = KPIHlp.CVI32(sCurBalance.ToString());
                    //need to change
                    if (!String.IsNullOrEmpty(sMode))
                    {
                        objJmmPresc.cMode = KPIHlp.CVC(sMode);
                    }
                    objJmmPresc.IsPersonalProp = 1;
                    //need to pass
                    objJmmPresc.JMBookingID = KPIHlp.CVI64(sBookID.ToString());
                    objJmmPresc.JurisID     = GetPageJuris();

                    objJmmPresc.RefillBal = KPIHlp.CVI16(sRefills.ToString());
                    objJmmPresc.Times     = 0;
                    //objJmmPresc.Times="";
                    objJmmPresc.PrescribeNotes = sNotes.ToString();
                    if (sMode.Equals("A"))
                    {
                        objJmmPresc.MedVisitID     = KPIHlp.CVI64(sVisitID.ToString());
                        objJmmPresc.MedPrescribeID = KPICounter.GetCounterID(objJmmPresc.JurisID);
                        objJmmPrescBL.Insert(objJmmPresc);
                        nvcXMLResponseData.Add("PrescriptionId", objJmmPresc.MedPrescribeID.ToString());
                    }
                    else
                    {
                        objJmmPresc.MedPrescribeID = KPIHlp.CVI64(sPresID);
                        objJmmPrescBL.Update(objJmmPresc);
                        //get id from grd
                        nvcXMLResponseData.Add("PrescriptionId", objJmmPresc.MedPrescribeID.ToString());
                    }

                    Response.Write(BuildKPIXMLResponse(nvcXMLResponseData));
                    Response.End();
                }
            }
            catch (Exception objErr)
            {
                if (!objErr.Message.StartsWith("Thread was being aborted"))
                {
                    string sErrMsg = "Invalid XML Request String" + objErr.Message;
                    Response.Write(sErrMsg);
                    Response.End();
                    //return;
                }
            }
        }