Beispiel #1
0
    public void GenerateAllergyReconciliationRows(int GlobalCodeId, int DocumentVersionId)
    {
        try
        {
            String RowIdentifier = null;
            int    AllergyType   = 8794;
            int    ClientId      = ((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientId;
            int    StaffId       = ((Streamline.BaseLayer.StreamlineIdentity)Context.User.Identity).UserId;
            Streamline.UserBusinessServices.ClientMedication objClientMedications = new ClientMedication();

            Streamline.UserBusinessServices.DataSets.DataSetClientMedications dsClientMedications = new Streamline.UserBusinessServices.DataSets.DataSetClientMedications();
            if (Session["DataSetClientMedications"] != null)
            {
                dsClientMedications = (Streamline.UserBusinessServices.DataSets.DataSetClientMedications)Session["DataSetClientMedications"];
            }
            if (dsClientMedications.Tables["ClientMedications"].Rows.Count > 0)
            {
                RowIdentifier = dsClientMedications.Tables["ClientMedications"].Rows[0]["RowIdentifier"].ToString();
            }
            objClientMedications.GetMedReconciliationData(GlobalCodeId, DocumentVersionId, ClientId, StaffId, AllergyType, RowIdentifier);
        }
        catch (Exception ex)
        {
        }
    }
Beispiel #2
0
        private void GetClientSummaryData()
        {
            Streamline.UserBusinessServices.DataSets.DataSetClientMedications DataSetClientMedications;
            Streamline.UserBusinessServices.ClientMedication objectClientMedications = null;
            DataSet dataSetClientSummary = null;

            Session["DataSetClientSummary"] = null;
            try
            {
                objectClientMedications = new Streamline.UserBusinessServices.ClientMedication();
                CommonFunctions.Event_Trap(this);
                string _ClientRowIdentifier    = "";
                string _ClinicianrowIdentifier = "";

                DataSetClientMedications = new Streamline.UserBusinessServices.DataSets.DataSetClientMedications();
                try
                {
                    _ClinicianrowIdentifier = ((Streamline.BaseLayer.StreamlineIdentity)Context.User.Identity).ClinicianRowIdentifier;
                }
                catch (Exception ex)
                {
                    if (ex.Data["CustomExceptionInformation"] == null)
                    {
                        ex.Data["CustomExceptionInformation"] = "";
                    }

                    string ParseMessage = ex.Message;
                    if (ParseMessage.Contains("Object") == true)
                    {
                        throw new Exception("Session Expired");
                    }
                }
                _ClientRowIdentifier = ((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientRowIdentifier;

                if (_ClientRowIdentifier != "" && _ClinicianrowIdentifier != "")
                {
                    dataSetClientSummary = objectClientMedications.DownloadClientMedicationSummary(_ClientRowIdentifier, _ClinicianrowIdentifier);
                    Session["DataSetClientMedications"] = null;
                    Session["DataSetClientSummary"]     = dataSetClientSummary;

                    DataSetClientMedications.EnforceConstraints = false;
                    DataSetClientMedications.Tables["ClientMedications"].Merge(dataSetClientSummary.Tables["ClientMedications"]);
                    DataSetClientMedications.Tables["ClientMedicationInstructions"].Merge(dataSetClientSummary.Tables["ClientMedicationInstructions"]);
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                objectClientMedications = null;
            }
        }
Beispiel #3
0
    //Ended over here

    #region Update

    public bool DocumentUpdateDocument()
    {
        DataRow BlankRow = null;

        try
        {
            Streamline.UserBusinessServices.DataSets.DataSetClientMedications dsClientMedications = new Streamline.UserBusinessServices.DataSets.DataSetClientMedications();
            CommonFunctions.Event_Trap(this);
            if (Session["DataSetClientMedications"] != null)
            {
                dsClientMedications = (Streamline.UserBusinessServices.DataSets.DataSetClientMedications)Session["DataSetClientMedications"];
            }
            if (dsClientMedications.Tables["ClientMedications"].Rows.Count > 0)
            {
                ClientMedication objClientMedication = new ClientMedication();
                if (dsClientMedications != null)
                {
                    DataSet dsTemp = objClientMedication.UpdateDocuments(dsClientMedications);
                    Session["DataSetClientMedications"] = dsTemp;
                }
            }
            Session["LoadMgt"] = true;
            Session["ClientIdForValidateToken"] = ((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientId;

            Session["CurrentControl"]   = "~/UserControls/MedicationMgt.ascx";
            Session["InitializeClient"] = true;

            return(true);
        }
        catch (Exception ex)
        {
            if (ex.Data["CustomExceptionInformation"] == null)
            {
                ex.Data["CustomExceptionInformation"] = "";
            }
            else
            {
                ex.Data["CustomExceptionInformation"] = "";
            }
            if (ex.Data["DatasetInfo"] == null)
            {
                ex.Data["DatasetInfo"] = "";
            }
            Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this);
            return(false);
        }
    }
    /// <summary>
    ///<Author>Sony </Author>
    /// Purpose:To Get the drug Interactions between Medications and Merge the interactions in DataSet accordingly
    /// </summary>
    /// <param name="dsTemp"></param>
    private void getDrugInteraction(Streamline.UserBusinessServices.DataSets.DataSetClientMedications dsTemp)
    {
        try
        {
            CommonFunctions.Event_Trap(this);
            string MedicationIds = "";
            foreach (DataRow dr in dsTemp.ClientMedicationInstructions.Select("isnull(Recorddeleted,'N')<>'Y'"))
            {
                MedicationIds += dr["StrengthId"].ToString() + ",";
            }

            if (MedicationIds.Length > 1)
            {
                MedicationIds = MedicationIds.TrimEnd(',');
            }

            Streamline.UserBusinessServices.ClientMedication objClientMed = new Streamline.UserBusinessServices.ClientMedication();

            DataSet dsTempInteraction = objClientMed.GetClientMedicationDrugInteraction(MedicationIds, ((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientId, ((Streamline.BaseLayer.StreamlineIdentity)Context.User.Identity).UserId);
            if (dsTempInteraction.Tables.Count > 0)
            {
                createClientMedicationInteraction(dsTempInteraction);
                Streamline.UserBusinessServices.DataSets.DataSetClientMedications dsClientMedicationsTemp = (Streamline.UserBusinessServices.DataSets.DataSetClientMedications)Session["DataSetClientMedications"];
                dsClientMedicationsTemp.ClientAllergiesInteraction.Merge(dsTempInteraction.Tables["ClientAllergyInteraction"]);
            }
        }
        catch (Exception ex)
        {
            if (ex.Data["CustomExceptionInformation"] == null)
            {
                ex.Data["CustomExceptionInformation"] = "";
            }
            else
            {
                ex.Data["CustomExceptionInformation"] = "";
            }
            if (ex.Data["DatasetInfo"] == null)
            {
                ex.Data["DatasetInfo"] = null;
            }
            throw (ex);
        }
    }
Beispiel #5
0
 public string CheckExistingMedication(int medicationNameId)
 {
     try
     {
         Streamline.UserBusinessServices.DataSets.DataSetClientMedications DataSet1 = null;
         if (Session["DataSetClientMedications"] != null)
         {
             DataSet1 = (Streamline.UserBusinessServices.DataSets.DataSetClientMedications)Session["DataSetClientMedications"];
             if (DataSet1.ClientMedications.Select("MedicationNameId=" + medicationNameId + " and DrugCategory=2").Length > 0)
             {
                 return("Selected medication already exists in Medication List");
             }
         }
         return("");
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #6
0
 /// <summary>
 /// <description>Function used to set the titartion dataset to session on page load.</description>
 /// <author>Ankesh Bharti</author>
 /// <createdDate>24/12/2008</createdDate>
 /// </summary>
 private void FillMedicationInfo()
 {
     try
     {
         if (Session["DataSetTitration"] != null)
         {
             using (DataSet _dataSetClientTitration = ((DataSet)Session["DataSetTitration"]).Copy())
             {
                 Session["DataSetTitration"] = _dataSetClientTitration;
             }
         }
         else
         {
             _DataSetClientMedications = new Streamline.UserBusinessServices.DataSets.DataSetClientMedications();
             Session["DataSetTitration"] = _DataSetClientMedications;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #7
0
    /// <summary>
    /// Purpose:This function will be used to Get Client Medication Summary Data
    /// </summary>
    private void GetClientSummaryData()
    {
        Streamline.UserBusinessServices.DataSets.DataSetClientMedications DataSetClientMedications;

        try
        {
            objectClientMedications = new ClientMedication();
            //objectCommonFunctions = new ApplicationCommonFunctions();
            CommonFunctions.Event_Trap(this);
            string _ClientRowIdentifier    = "";
            string _ClinicianrowIdentifier = "";

            DataSetClientMedications = new Streamline.UserBusinessServices.DataSets.DataSetClientMedications();
            try
            {
                _ClinicianrowIdentifier = ((Streamline.BaseLayer.StreamlineIdentity)Context.User.Identity).ClinicianRowIdentifier;
            }
            catch (Exception ex)
            {
                if (ex.Data["CustomExceptionInformation"] == null)
                {
                    ex.Data["CustomExceptionInformation"] = "";
                }

                string ParseMessage = ex.Message;
                if (ParseMessage.Contains("Object") == true)
                {
                    throw new Exception("Session Expired");
                }
            }
            _ClientRowIdentifier = ((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientRowIdentifier;

            if (_ClientRowIdentifier != "" && _ClinicianrowIdentifier != "")
            {
                _DataSetClientSummary = objectClientMedications.DownloadClientMedicationSummary(_ClientRowIdentifier, _ClinicianrowIdentifier);
                Session["DataSetClientMedications"]           = null;
                Session["DataSetPrescribedClientMedications"] = null;//Added As per task#3323 By Pradeep on 4 March 2011
                Session["DataSetClientSummary"] = _DataSetClientSummary;

                DataSetClientMedications.EnforceConstraints = false;
                DataSetClientMedications.Tables["ClientMedications"].Merge(_DataSetClientSummary.Tables["ClientMedications"]);
                DataSetClientMedications.Tables["ClientMedicationInstructions"].Merge(_DataSetClientSummary.Tables["ClientMedicationInstructions"]);

                //Activate the MedicationClientPersonalInformation Control
                //MedicationClientPersonalInformation1.showEditableAllergyList = true;
                //MedicationClientPersonalInformation1.Activate();
                //LabelClientName.Text = "";
                //LabelClientName.Text = _DataSetClientSummary.Tables["ClientInformation"].Rows[0]["ClientInformationLabel"].ToString(); //DataSetClientSummary.Tables["ClientInformation"].Rows[0]["ClientInformationLabel"].ToString();
            }
        }
        catch (Exception ex)
        {
            if (ex.Data["CustomExceptionInformation"] == null)
            {
                ex.Data["CustomExceptionInformation"] = "";
            }
            else
            {
                ex.Data["CustomExceptionInformation"] = "";
            }
            if (ex.Data["DatasetInfo"] == null)
            {
                ex.Data["DatasetInfo"] = _DataSetClientSummary;
            }
            Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this);
        }
        finally
        {
            objectClientMedications = null;
            //objectCommonFunctions = null;
        }
    }
    /// <summary>
    /// Author Sony John
    /// Purpose to get the Interaction rows corresponding to the Passed Rows array
    /// </summary>
    /// <param name="drTemp"></param>
    private void getInteractionRows(DataRow[] drTemp)
    {
        try
        {
            Streamline.UserBusinessServices.DataSets.DataSetClientMedications dsClientMedications = (Streamline.UserBusinessServices.DataSets.DataSetClientMedications)Session["DataSetClientMedications"];
            int ClientMedicationInteractionId = 0;
            CommonFunctions.Event_Trap(this);

            for (int i = 0; i < drTemp.Length; i++)//Takes the first id and makes possible combination with all the rest of the ids
            {
                int MedicationId1 = 0;
                int MedicationId2 = 0;
                int k             = i + 1;
                for (; k < drTemp.Length; k++)
                {
                    DataRow[] ClientMedication1 = dsClientMedications.ClientMedications.Select("StrengthId=" + drTemp[i]["MedicationId"] + " and isnull(recorddeleted,'N')<>'Y'");
                    if (ClientMedication1.Length > 0)
                    {
                        MedicationId1 = Convert.ToInt32(ClientMedication1[0]["ClientMedicationId"]);
                    }

                    DataRow[] ClientMedication2 = dsClientMedications.ClientMedications.Select("StrengthId=" + drTemp[k]["MedicationId"] + " and isnull(recorddeleted,'N')<>'Y'");
                    if (ClientMedication2.Length > 0)
                    {
                        MedicationId2 = Convert.ToInt32(ClientMedication2[0]["ClientMedicationId"]);
                    }

                    Streamline.UserBusinessServices.DataSets.DataSetClientMedications.ClientMedicationInteractionsRow[] drExists = null;
                    string Query = "((MedicationNameId1=" + drTemp[i]["MedicationId"] + " and MedicationNameId2=" + drTemp[k]["MedicationId"] + ") or (MedicationNameId2=" + drTemp[i]["MedicationId"] + " and MedicationNameId1=" + drTemp[k]["MedicationId"] + "))";
                    Query += " and InteractionLevel<=" + Convert.ToInt32(drTemp[i]["SeverityLevel"]);
                    Query += " and isnull(recorddeleted,'N')<>'Y'";

                    drExists = (Streamline.UserBusinessServices.DataSets.DataSetClientMedications.ClientMedicationInteractionsRow[])dsClientMedications.ClientMedicationInteractions.Select(Query);

                    bool newRow    = false;
                    bool modifyrow = false;
                    drExists = (Streamline.UserBusinessServices.DataSets.DataSetClientMedications.ClientMedicationInteractionsRow[])dsClientMedications.ClientMedicationInteractions.Select(Query);
                    Streamline.UserBusinessServices.DataSets.DataSetClientMedications.ClientMedicationInteractionsRow drInteraction = null;
                    if (drExists.Length > 0)
                    {
                        ClientMedicationInteractionId = Convert.ToInt32(drExists[0]["ClientMedicationInteractionId"]);
                        newRow    = false;
                        modifyrow = false;
                        if (Convert.ToInt32(drExists[0]["InteractionLevel"]) > Convert.ToInt32(drTemp[i]["SeverityLevel"]))
                        {
                            drInteraction = drExists[0];
                            modifyrow     = true;
                        }
                    }
                    else
                    {
                        newRow = true;
                    }
                    if (newRow == true || modifyrow == true)
                    {
                        drInteraction = dsClientMedications.ClientMedicationInteractions.NewClientMedicationInteractionsRow();
                        drInteraction.ClientMedicationId1        = MedicationId1;
                        drInteraction.ClientMedicationId2        = MedicationId2;
                        drInteraction.InteractionLevel           = drTemp[i]["SeverityLevel"].ToString();
                        drInteraction.DrugInteractionMonographId = Convert.ToInt32(drTemp[i]["DrugInteractionMonographId"]);
                        if (newRow)
                        {
                            drInteraction.CreatedBy   = ((Streamline.BaseLayer.StreamlineIdentity)Context.User.Identity).UserCode;
                            drInteraction.CreatedDate = System.DateTime.Now;
                        }
                        drInteraction.ModifiedBy        = ((Streamline.BaseLayer.StreamlineIdentity)Context.User.Identity).UserCode;
                        drInteraction.ModifiedDate      = System.DateTime.Now;
                        drInteraction.MedicationNameId1 = Convert.ToInt32(drTemp[i]["MedicationId"]);
                        drInteraction.MedicationNameId2 = Convert.ToInt32(drTemp[k]["MedicationId"]);
                        drInteraction.PrescriberAcknowledgementRequired = "Y";
                        if (newRow)
                        {
                            dsClientMedications.ClientMedicationInteractions.Rows.Add(drInteraction);
                        }
                        ClientMedicationInteractionId = drInteraction.ClientMedicationInteractionId;
                    }
                }
                //Added into ClientMedicationInteractionDetails
                bool      newDetailsRow            = false;
                DataRow   drClientMedicationDetail = null;
                DataRow[] DetailsExists            = dsClientMedications.ClientMedicationInteractionDetails.Select("ClientMedicationInteractionId=" + ClientMedicationInteractionId + "and DrugDrugInteractionId=" + Convert.ToInt32(drTemp[i]["DrugDrugInteractionId"]) + " and isnull(recorddeleted,'N')<>'Y'");
                if (DetailsExists.Length > 0)
                {
                    drClientMedicationDetail = DetailsExists[0];
                    newDetailsRow            = false;
                }
                else
                {
                    drClientMedicationDetail = dsClientMedications.ClientMedicationInteractionDetails.NewRow();
                    newDetailsRow            = true;
                }
                drClientMedicationDetail["ClientMedicationInteractionId"] = ClientMedicationInteractionId;
                drClientMedicationDetail["DrugDrugInteractionId"]         = drTemp[i]["DrugDrugInteractionId"];
                if (newDetailsRow == true)
                {
                    drClientMedicationDetail["RowIdentifier"] = System.Guid.NewGuid().ToString();
                    drClientMedicationDetail["CreatedBy"]     = ((Streamline.BaseLayer.StreamlineIdentity)Context.User.Identity).UserCode;
                    drClientMedicationDetail["CreatedDate"]   = DateTime.Now;
                }
                drClientMedicationDetail["ModifiedBy"]   = ((Streamline.BaseLayer.StreamlineIdentity)Context.User.Identity).UserCode;
                drClientMedicationDetail["ModifiedDate"] = DateTime.Now;
                if (newDetailsRow)
                {
                    dsClientMedications.ClientMedicationInteractionDetails.Rows.Add(drClientMedicationDetail);
                }
            }

            Session["DataSetClientMedications"] = dsClientMedications;
        }
        catch (Exception ex)
        {
            if (ex.Data["CustomExceptionInformation"] == null)
            {
                ex.Data["CustomExceptionInformation"] = "";
            }
            else
            {
                ex.Data["CustomExceptionInformation"] = "";
            }
            if (ex.Data["DatasetInfo"] == null)
            {
                ex.Data["DatasetInfo"] = null;
            }
            throw (ex);
        }
    }