Example #1
0
        public List <ResultUnit> GetResultUnits()
        {
            ClsObject obj = new ClsObject();

            ClsUtility.Init_Hashtable();

            DataTable dt     = (DataTable)obj.ReturnObject(ClsUtility.theParams, "Laboratory_GetResultUnit", ClsUtility.ObjectEnum.DataTable);
            var       result = (from row in dt.AsEnumerable()
                                select new ResultUnit()
            {
                Id = Convert.ToInt32(row["UnitId"]),
                Text = row["Name"].ToString()
            }
                                );

            return(result.ToList());
        }
Example #2
0
        /// <summary>
        /// Gets the report queries.
        /// </summary>
        /// <param name="reportId">The report identifier.</param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        QueryCollection IReportIQTools.GetReportQueries(int reportId)
        {
            lock (this)
            {
                QueryCollection qCollection   = new QueryCollection();
                ClsObject       ReportManager = new ClsObject();
                ClsUtility.Init_Hashtable();
                string queryStatement;
                //DataMgr dataManager = new DataMgr();
                ClsUtility.AddParameters("@ReportID", SqlDbType.Int, reportId.ToString());
                queryStatement = @"Select Distinct	Q.QryID QueryID,
				                SB.sbCatID SubCategoryID,
				                SB.sbCategory SubCategory,
				                Q.qryName QueryName,
				                Q.qryDefinition Defination,
				                Q.qryDescription Description
                From dbo.aa_sbCategory SB
                Inner Join aa_Category C
	                On SB.CatID = C.CatID
                Inner Join dbo.aa_Queries Q On Q.qryID = SB.QryID
                Where (SB.DeleteFlag Is Null Or SB.DeleteFlag = 0) 
                And SB.QryID Is Not Null 
                And C.CatID=@ReportID;";
                DataTable dt = (DataTable)ReportManager.ReturnObject(ClsUtility.theParams, queryStatement, ClsUtility.ObjectEnum.DataTable, ConnectionMode.REPORT);
                if (dt == null)
                {
                    return(null);
                }
                foreach (DataRow row in dt.Rows)
                {
                    //Query q = new
                    qCollection.Add(new Query()
                    {
                        QueryID       = Convert.ToInt16(row["QueryID"]),
                        Name          = row["QueryName"].ToString(),
                        SubCategoryID = Convert.ToInt16(row["SubCategoryID"]),
                        SubCategory   = row["SubCategory"].ToString(),
                        Defination    = row["Defination"].ToString(),
                        Description   = row["Description"].ToString()
                    });
                }
                ;

                return(qCollection);
            }
        }
Example #3
0
 public DataSet GetCustomFieldValues(string TableName, string fields, Int32 ptnID, Int32 HomeVisitId, Int32 visitpk, Int32 labID, Int32 ptn_pharmacy_pk, Int32 FeatureID)
 {
     lock (this)
     {
         oUtility.Init_Hashtable();
         ClsObject CustomFields = new ClsObject();
         oUtility.AddParameters("@TableName", SqlDbType.VarChar, TableName.ToString());
         oUtility.AddParameters("@Columns", SqlDbType.VarChar, fields.ToString());
         oUtility.AddParameters("@PtnID", SqlDbType.Int, ptnID.ToString());
         oUtility.AddParameters("@HomeVisitId", SqlDbType.Int, HomeVisitId.ToString());
         oUtility.AddParameters("@Visitpk", SqlDbType.Int, visitpk.ToString());
         oUtility.AddParameters("@LabID", SqlDbType.Int, labID.ToString());
         oUtility.AddParameters("@ptn_pharmacy_pk", SqlDbType.Int, ptn_pharmacy_pk.ToString());
         oUtility.AddParameters("@FeatureID", SqlDbType.Int, FeatureID.ToString());
         return((DataSet)CustomFields.ReturnObject(oUtility.theParams, "pr_General_Dynamic_Select", ClsUtility.ObjectEnum.DataSet));
     }
 }
Example #4
0
        public DataSet GetAppointmentGrid(int AppStatus, DateTime FromDate, DateTime ToDate, int LocationID)
        {
            lock (this)
            {
                ClsUtility.Init_Hashtable();
                ClsObject AppointmentManager = new ClsObject();

                ClsUtility.AddParameters("@AppStatus", SqlDbType.Int, AppStatus.ToString());
                ClsUtility.AddParameters("@FromDate", SqlDbType.DateTime, FromDate.ToString());
                ClsUtility.AddParameters("@ToDate", SqlDbType.DateTime, ToDate.ToString());
                ClsUtility.AddParameters("@LocationID", SqlDbType.Int, LocationID.ToString());
                ClsUtility.AddParameters("@password", SqlDbType.VarChar, ApplicationAccess.DBSecurity);


                return((DataSet)AppointmentManager.ReturnObjectNewImpl(ClsUtility.theParams, "pr_Scheduler_AppointmentList_Constella", ClsDBUtility.ObjectEnum.DataSet));
            }
        }
Example #5
0
        public List <TestDepartment> GetTestDepartments()
        {
            ClsObject obj = new ClsObject();

            ClsUtility.Init_Hashtable();
            DataTable dt     = (DataTable)obj.ReturnObject(ClsUtility.theParams, "Laboratory_GetTestDepartment", ClsUtility.ObjectEnum.DataTable);
            var       result = (from row in dt.AsEnumerable()
                                select new TestDepartment()
            {
                Id = Convert.ToInt32(row["Id"]),
                Name = row["Name"].ToString(),
                DeleteFlag = Convert.ToBoolean(row["DeleteFlag"])
            }
                                );

            return(result.ToList());
        }
Example #6
0
        /// <summary>
        /// Gets the technical area identifier future.
        /// </summary>
        /// <param name="ModuleId">The module identifier.</param>
        /// <param name="patientId">The PTN_PK.</param>
        /// <returns></returns>
        public DataSet GetTechnicalAreaIdentifierFuture(int moduleId, int patientId)
        {
            try
            {
                ClsObject PatientHistory = new ClsObject();
                ClsUtility.Init_Hashtable();
                ClsUtility.AddExtendedParameters("@ModuleId", SqlDbType.Int, moduleId);
                ClsUtility.AddExtendedParameters("@Ptn_pk", SqlDbType.Int, patientId);
                return((DataSet)PatientHistory.ReturnObject(ClsUtility.theParams, "pr_Clinical_GetTechnicalAreaIdentifier_Future", ClsUtility.ObjectEnum.DataSet));
            }

            catch //(Exception ex)
            {
                //throw ex;
                return(null);
            }
        }
Example #7
0
        public DataSet GetTechnicalAreaIdentifierFuture(int ModuleId, int Ptn_pk)
        {
            try
            {
                ClsObject PatientHistory = new ClsObject();
                oUtility.Init_Hashtable();
                oUtility.AddParameters("@ModuleId", SqlDbType.Int, ModuleId.ToString());
                oUtility.AddParameters("@Ptn_pk", SqlDbType.Int, Ptn_pk.ToString());
                return((DataSet)PatientHistory.ReturnObject(oUtility.theParams, "pr_Clinical_GetTechnicalAreaIdentifier_Future", ClsUtility.ObjectEnum.DataSet));
            }

            catch (Exception ex)
            {
                //throw ex;
                return(null);
            }
        }
Example #8
0
        public int UpdateCustomMasterRecord(string TableName, int Id, string Name, string Code, string Stage, int Sequence, int Category, int Status, int UserId, int SystemId, int CountryID, int ModuleId, string multiplier)
        {
            TableName = "mst_" + TableName;
            ClsObject CustomManager = new ClsObject();

            try
            {
                this.Connection           = DataMgr.GetConnection();
                CustomManager.Connection  = this.Connection;
                this.Transaction          = DataMgr.BeginTransaction(this.Connection);
                CustomManager.Transaction = this.Transaction;

                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@TableName", SqlDbType.VarChar, TableName);
                ClsUtility.AddParameters("@Id", SqlDbType.Int, Id.ToString());
                ClsUtility.AddParameters("@Name", SqlDbType.VarChar, Name);
                ClsUtility.AddParameters("@Code", SqlDbType.VarChar, Code);
                ClsUtility.AddParameters("@Stage", SqlDbType.VarChar, Stage);
                ClsUtility.AddParameters("@Sequence", SqlDbType.Int, Sequence.ToString());
                ClsUtility.AddParameters("@Category", SqlDbType.Int, Category.ToString());
                ClsUtility.AddParameters("@DeleteFlag", SqlDbType.Int, Status.ToString());
                ClsUtility.AddParameters("@UserId", SqlDbType.Int, UserId.ToString());
                ClsUtility.AddParameters("@SystemId", SqlDbType.Int, SystemId.ToString());
                ClsUtility.AddParameters("@CID", SqlDbType.Int, CountryID.ToString());
                ClsUtility.AddParameters("@ModuleID", SqlDbType.Int, ModuleId.ToString());
                ClsUtility.AddParameters("@multiplier", SqlDbType.Int, multiplier.ToString());


                Int32 RowsAffected = (Int32)CustomManager.ReturnObject(ClsUtility.theParams, "Pr_Admin_UpdateCustomListMasters_Constella", ClsUtility.ObjectEnum.ExecuteNonQuery);
                DataMgr.CommitTransaction(this.Transaction);
                return(RowsAffected);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                CustomManager = null;
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
Example #9
0
        /// <summary>
        /// Creates the debit note.
        /// </summary>
        /// <param name="patientID">The patient identifier.</param>
        /// <param name="locationID">The location identifier.</param>
        /// <param name="userID">The user identifier.</param>
        /// <param name="start">The start.</param>
        /// <param name="end">The end.</param>
        /// <returns></returns>
        public int CreateDebitNote(int patientId, int locationId, int userId, DateTime start, DateTime end)
        {
            lock (this)
            {
                ClsObject PatientVisitMgr = new ClsObject();
                ClsUtility.Init_Hashtable();
                ClsUtility.AddExtendedParameters("@PatientId", SqlDbType.Int, patientId);
                ClsUtility.AddExtendedParameters("@locationID", SqlDbType.Int, locationId);
                ClsUtility.AddExtendedParameters("@userID", SqlDbType.Int, userId);
                ClsUtility.AddExtendedParameters("@Start", SqlDbType.DateTime, start.ToString());
                ClsUtility.AddExtendedParameters("@End", SqlDbType.DateTime, end.ToString());

                DataRow row    = (DataRow)PatientVisitMgr.ReturnObject(ClsUtility.theParams, "Pr_Clinical_CreateDebitNote_Futures", ClsUtility.ObjectEnum.DataRow);
                int     billid = Convert.ToInt32(row["BillId"]);
                return(billid);
            }
        }
Example #10
0
        /// <summary>
        /// Saves the name of the batch.
        /// </summary>
        /// <param name="BatchName">Name of the batch.</param>
        /// <param name="UserId">The user identifier.</param>
        /// <param name="itemID">The item identifier.</param>
        /// <param name="expiryDatetime">The expiry datetime.</param>
        /// <returns></returns>
        public DataSet SaveBatchName(string BatchName, int UserId, string itemID, string expiryDatetime)
        {
            lock (this)
            {
                ClsObject BatchNameMgr = new ClsObject();
                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@BatchName", SqlDbType.VarChar, BatchName.ToString());
                ClsUtility.AddParameters("@UserId", SqlDbType.Int, UserId.ToString());
                ClsUtility.AddParameters("@ItemID", SqlDbType.VarChar, itemID.ToString());
                ClsUtility.AddParameters("@ExpiryDatetime", SqlDbType.VarChar, expiryDatetime.ToString());

                return
                    ((DataSet)
                     BatchNameMgr.ReturnObject(ClsUtility.theParams, "pr_SCM_SaveBatchFromOpnStock_Futures",
                                               ClsUtility.ObjectEnum.DataSet));
            }
        }
Example #11
0
        public int SaveFollowupEducation(int Id, int Ptn_pk, int CouncellingTypeId, int CouncellingTopicId, int Visit_pk, int LocationID, DateTime VisitDate, string Comments, string OtherDetail, int UserId, int DeleteFlag)
        {
            ClsObject FollowupEducation = new ClsObject();
            int       retval            = 0;

            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                FollowupEducation.Connection  = this.Connection;
                FollowupEducation.Transaction = this.Transaction;

                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@Id", SqlDbType.Int, Id.ToString());
                ClsUtility.AddParameters("@Ptn_pk", SqlDbType.Int, Ptn_pk.ToString());
                ClsUtility.AddParameters("@VisitPk ", SqlDbType.Int, Visit_pk.ToString());
                ClsUtility.AddParameters("@LocationID", SqlDbType.Int, LocationID.ToString());
                ClsUtility.AddParameters("@CouncellingTypeId", SqlDbType.Int, CouncellingTypeId.ToString());
                ClsUtility.AddParameters("@CouncellingTopicId", SqlDbType.Int, CouncellingTopicId.ToString());
                ClsUtility.AddParameters("@VisitDate", SqlDbType.DateTime, VisitDate.ToString());
                ClsUtility.AddParameters("@Comments", SqlDbType.VarChar, Comments.ToString());
                ClsUtility.AddParameters("@OtherDetail", SqlDbType.VarChar, OtherDetail.ToString());
                ClsUtility.AddParameters("@UserId", SqlDbType.Int, UserId.ToString());
                ClsUtility.AddParameters("@DeleteFlag", SqlDbType.Int, DeleteFlag.ToString());

                retval = (int)FollowupEducation.ReturnObject(ClsUtility.theParams, "Pr_Clinical_SaveFollowupEducation_Constella", ClsDBUtility.ObjectEnum.ExecuteNonQuery);

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                FollowupEducation = null;
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
            return(retval);
        }
Example #12
0
        public DataSet SaveHivTreatementPharmacyField(Int32 theOrderId, string weight, string height, int Program, int PeriodTaken, int Provider, int RegimenLine, DateTime NxtAppDate, int Reason)
        {
            oUtility.Init_Hashtable();
            oUtility.AddParameters("@OrderID", SqlDbType.Int, theOrderId.ToString());
            oUtility.AddParameters("@weight", SqlDbType.VarChar, weight.ToString());
            oUtility.AddParameters("@height", SqlDbType.VarChar, height.ToString());
            oUtility.AddParameters("@Programe", SqlDbType.Int, Program.ToString());
            oUtility.AddParameters("@Periodtaken", SqlDbType.Int, PeriodTaken.ToString());
            oUtility.AddParameters("@Provider", SqlDbType.Int, Provider.ToString());
            oUtility.AddParameters("@RegimenLine", SqlDbType.Int, RegimenLine.ToString());
            oUtility.AddParameters("@NxtAppDate", SqlDbType.DateTime, NxtAppDate.ToString());
            oUtility.AddParameters("@Region", SqlDbType.Int, Reason.ToString());

            ClsObject theManager = new ClsObject();

            return((DataSet)theManager.ReturnObject(oUtility.theParams, "pr_SCM_SaveUpdateHivTreatementPharmacyField_Futures", ClsUtility.ObjectEnum.DataSet));
        }
        public String ParseSQLColoumns(string sqlstr)
        {
            lock (this)
            {
                try
                {
                    ClsObject Query = new ClsObject();

                    oUtility.Init_Hashtable();
                    oUtility.AddParameters("@QryString", SqlDbType.NVarChar, sqlstr);

                    DataTable dt1 = (DataTable)Query.ReturnObject(oUtility.theParams, "pr_General_SQL_Parse", ClsUtility.ObjectEnum.DataTable);

                    if (dt1.Rows.Count == 0)
                    {
                        return("No Records");
                    }
                    //else if (dt1.Rows.Count > 1 || dt1.Columns.Count > 1)
                    //{
                    //    return ("InValid Rows or Columns.Pelase use count function in Query");
                    //}
                    else
                    {
                        //DataRow row = dt1.Rows[0];
                        //object item = row.ItemArray[0];
                        if (dt1.Columns.Count < 4)
                        {
                            return("Valid Value");
                        }
                        else
                        {
                            return("InValid Value");
                        }
                    }
                }
                catch (SqlException sqlEx)
                {
                    return(sqlEx.Message.ToString());
                }
                catch (Exception ex)
                {
                    //throw ex;
                    return(ex.Message.ToString());
                }
            }
        }
Example #14
0
 public DataSet GetFacilitySettings(int SystemId)
 {
     lock (this)
     {
         try
         {
             ClsObject FacilityManager = new ClsObject();
             ClsUtility.Init_Hashtable();
             ClsUtility.AddParameters("@SystemId", SqlDbType.Int, SystemId.ToString());
             return((DataSet)FacilityManager.ReturnObject(ClsUtility.theParams, "pr_Admin_SelectFacility_Constella", ClsUtility.ObjectEnum.DataSet));
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
Example #15
0
        public int SaveUpdateTBRegimenGeneric(string RegimenName, int RegimenID, int TreatmentTime, int Status, string GenericID, int UserID, int SRNo, int flag)
        {
            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject DrugManager = new ClsObject();
                DrugManager.Connection  = this.Connection;
                DrugManager.Transaction = this.Transaction;

                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@RegimenName", SqlDbType.VarChar, RegimenName);
                ClsUtility.AddParameters("@Rid", SqlDbType.Int, RegimenID.ToString());
                ClsUtility.AddParameters("@TreatmentTime", SqlDbType.Int, TreatmentTime.ToString());
                ClsUtility.AddParameters("@Status", SqlDbType.Int, Status.ToString());
                ClsUtility.AddParameters("@GenericID", SqlDbType.VarChar, GenericID);
                ClsUtility.AddParameters("@UserId", SqlDbType.Int, UserID.ToString());
                ClsUtility.AddParameters("@SRNo", SqlDbType.Int, SRNo.ToString());
                ClsUtility.AddParameters("@flag", SqlDbType.Int, flag.ToString());

                Int32 RowsAffected = (Int32)DrugManager.ReturnObject(ClsUtility.theParams, "pr_Admin_SaveTBRegimenGeneric_Constella", ClsDBUtility.ObjectEnum.ExecuteNonQuery);
                if (RowsAffected == 0)
                {
                    MsgBuilder theBL = new MsgBuilder();
                    theBL.DataElements["MessageText"] = "Error in Saving TB Regimen Generic Combinations. Try Again..";
                    Exception ex = AppException.Create("#C1", theBL);
                    throw ex;
                }
                DrugManager = null;
                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(RowsAffected);
            }
            catch
            {
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
Example #16
0
        public DataTable GetPatientFollowupEducationData(int ptnPk)
        {
            try
            {
                ClsObject obj = new ClsObject();
                ClsUtility.Init_Hashtable();
                ClsUtility.AddExtendedParameters("@Ptn_Pk", SqlDbType.Int, ptnPk);

                DataTable dt = (DataTable)obj.ReturnObject(ClsUtility.theParams, "Pr_Clinical_GetFollowupEducation_Constella", ClsUtility.ObjectEnum.DataTable);
                return(dt);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
Example #17
0
        public SystemVersion GetSystemVersion()
        {
            ClsObject SystemManager = new ClsObject();

            ClsUtility.Init_Hashtable();
            DataSet ds  = (DataSet)SystemManager.ReturnObject(ClsUtility.theParams, "pr_Admin_SelectFacility_Constella", ClsUtility.ObjectEnum.DataSet);
            DataRow row = ds.Tables[1].Rows[0];

            return(new SystemVersion()
            {
                Id = Convert.ToInt32(row["Id"]),
                VersionName = Convert.ToString(row["VersionName"]),
                AppVersion = Convert.ToString(row["AppVer"]),
                DBVersion = Convert.ToString(row["DbVer"]),
                ReleaseDate = Convert.ToDateTime(row["RelDate"])
            });
        }
Example #18
0
 public DataSet ExportSCMIQCare()
 {
     lock (this)
     {
         try
         {
             oUtility.Init_Hashtable();
             ClsObject theExportManager = new ClsObject();
             DataSet   theDs            = (DataSet)theExportManager.ReturnObject(oUtility.theParams, "Pr_Admin_SCMExportData_Futures", ClsUtility.ObjectEnum.DataSet);
             return(theDs);
         }
         catch (Exception err)
         {
             throw err;
         }
     }
 }
Example #19
0
        public int UpdateOccupation(int OccupationID, string OccupationName, int UserID, int DeleteFlag, int Sequence)
        {
            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject OccupationManager = new ClsObject();
                OccupationManager.Connection  = this.Connection;
                OccupationManager.Transaction = this.Transaction;

                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@OccupationName", SqlDbType.VarChar, OccupationName);
                ClsUtility.AddParameters("@OccupationID", SqlDbType.Int, OccupationID.ToString());
                ClsUtility.AddParameters("@UserId", SqlDbType.Int, UserID.ToString());
                ClsUtility.AddParameters("@DeleteFlag", SqlDbType.Int, DeleteFlag.ToString());
                ClsUtility.AddParameters("@Sequence", SqlDbType.Int, Sequence.ToString());



                int RowsAffected = (Int32)OccupationManager.ReturnObject(ClsUtility.theParams, "Pr_Admin_UpdateOccupation_Constella", ClsUtility.ObjectEnum.ExecuteNonQuery);
                if (RowsAffected == 0)
                {
                    MsgBuilder theBL = new MsgBuilder();
                    theBL.DataElements["MessageText"] = "Error in Saving Occupation record. Try Again..";
                    AppException.Create("#C1", theBL);
                }


                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(RowsAffected);
            }
            catch
            {
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
Example #20
0
        /// <summary>
        /// Saves the service order.
        /// </summary>
        /// <param name="order">The order.</param>
        /// <param name="userId">The user identifier.</param>
        /// <param name="LocationId">The location identifier.</param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public ServiceOrder SaveServiceOrder(ServiceOrder order, int userId, int locationId)
        {
            ClsObject obj = new ClsObject();

            ClsUtility.Init_Hashtable();
            try
            {
                ClsUtility.AddExtendedParameters("@PatientId", SqlDbType.Int, order.PatientId);
                ClsUtility.AddExtendedParameters("@LocationId", SqlDbType.Int, locationId);
                ClsUtility.AddExtendedParameters("@ModuleId", SqlDbType.Int, order.ModuleId);
                ClsUtility.AddExtendedParameters("@TargetModuleId", SqlDbType.Int, order.TargetModuleId);
                ClsUtility.AddExtendedParameters("@OrderDate", SqlDbType.DateTime, Convert.ToDateTime(order.OrderDate));
                ClsUtility.AddExtendedParameters("@Orderedby", SqlDbType.Int, order.OrderedBy);
                ClsUtility.AddExtendedParameters("@ClinicalNotes", SqlDbType.VarChar, order.ClinicalNotes);
                ClsUtility.AddExtendedParameters("@UserId", SqlDbType.Int, userId);

                XDocument docX = new XDocument(
                    new XElement("root", (from service in order.Services
                                          select new XElement("result",
                                                              new XElement("id", service.Id),
                                                              new XElement("serviceid", service.ServiceId),
                                                              new XElement("servicename", service.ServiceName),
                                                              new XElement("testnotes", service.RequestNotes),
                                                              new XElement("quantity", service.Quantity),
                                                              new XElement("resultnotes", service.ResultNotes),
                                                              new XElement("resultdate", service.ResultDate == null ? null : service.ResultDate),
                                                              new XElement("resultby", service.ResultBy == null ? null : service.ResultBy)
                                                              )
                                          )
                                 )
                    );
                ClsUtility.AddParameters("@ServiceList", SqlDbType.VarChar, docX.ToString());

                DataTable dt = (DataTable)obj.ReturnObject(ClsUtility.theParams, "ClinicalService_SaveOrder", ClsUtility.ObjectEnum.DataTable);

                int orderId   = Convert.ToInt32(dt.Rows[0]["OrderId"]);
                int patientId = Convert.ToInt32(dt.Rows[0]["PatientId"]);
                order = this.GetServiceOrder(patientId, orderId);
                return(order);
            }
            catch
            {
                throw;
            }
        }
Example #21
0
        public int SaveNewReason(string ReasonName, int CategoryID, int SRNo, int UserID)
        {
            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject ReasonManager = new ClsObject();
                ReasonManager.Connection  = this.Connection;
                ReasonManager.Transaction = this.Transaction;

                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@ReasonName", SqlDbType.VarChar, ReasonName);
                ClsUtility.AddParameters("@CategoryID", SqlDbType.Int, CategoryID.ToString());
                ClsUtility.AddParameters("@SRNo", SqlDbType.Int, SRNo.ToString());
                ClsUtility.AddParameters("@UserId", SqlDbType.Int, UserID.ToString());
//              ClsUtility.AddParameters("@DeleteFlag", SqlDbType.Int, DeleteFlag.ToString());


                // DataRow theDR;
                int RowsAffected = (Int32)ReasonManager.ReturnObject(ClsUtility.theParams, "Pr_Admin_InsertReason_Constella", ClsUtility.ObjectEnum.ExecuteNonQuery);
                if (RowsAffected == 0)
                {
                    MsgBuilder theBL = new MsgBuilder();
                    theBL.DataElements["MessageText"] = "Error in Saving Reason record. Try Again..";
                    AppException.Create("#C1", theBL);
                }


                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(Convert.ToInt32(RowsAffected));
            }
            catch
            {
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
Example #22
0
        public int UpdatePatientppointmentDetails(int PatientId, int LocationId, int VisitId, String AppDate, int AppReasonId, int UserId, int AppProviderId, String Updationdate)
        {
            lock (this)
            {
                try
                {
                    int theAffectedRows = 0;
                    this.Connection  = DataMgr.GetConnection();
                    this.Transaction = DataMgr.BeginTransaction(this.Connection);

                    ClsObject SaveAppointment = new ClsObject();
                    SaveAppointment.Connection  = this.Connection;
                    SaveAppointment.Transaction = this.Transaction;

                    ClsUtility.Init_Hashtable();
                    ClsUtility.AddParameters("@PatientId", SqlDbType.Int, PatientId.ToString());
                    ClsUtility.AddParameters("@LocationId", SqlDbType.Int, LocationId.ToString());
                    ClsUtility.AddParameters("@VisitId", SqlDbType.Int, VisitId.ToString());
                    ClsUtility.AddParameters("@AppDate", SqlDbType.VarChar, AppDate.ToString());
                    ClsUtility.AddParameters("@AppReasonId", SqlDbType.Int, AppReasonId.ToString());
                    ClsUtility.AddParameters("@UserId", SqlDbType.Int, UserId.ToString());
                    ClsUtility.AddParameters("@AppProviderId", SqlDbType.Int, AppProviderId.ToString());
                    ClsUtility.AddParameters("@Updationdate", SqlDbType.VarChar, Updationdate.ToString());


                    theAffectedRows = (int)SaveAppointment.ReturnObject(ClsUtility.theParams, "pr_Scheduler_UpdatePatientAppointmentDetails_Constella", ClsUtility.ObjectEnum.ExecuteNonQuery);

                    DataMgr.CommitTransaction(this.Transaction);
                    DataMgr.ReleaseConnection(this.Connection);
                    return(theAffectedRows);
                }
                catch
                {
                    DataMgr.RollBackTransation(this.Transaction);
                    throw;
                }
                finally
                {
                    if (this.Connection != null)
                    {
                        DataMgr.ReleaseConnection(this.Connection);
                    }
                }
            }
        }
Example #23
0
 public DataTable FindLabByName(string SearchText, int?IncludeDepartment = null, int?ExcludeDepartment = null)
 {
     lock (this)
     {
         ClsObject theON = new ClsObject();
         ClsUtility.Init_Hashtable();
         ClsUtility.AddParameters("@LabName", SqlDbType.VarChar, SearchText);
         if (IncludeDepartment.HasValue)
         {
             ClsUtility.AddExtendedParameters("@IncludeDepartment", SqlDbType.Int, IncludeDepartment.Value);
         }
         if (ExcludeDepartment.HasValue)
         {
             ClsUtility.AddExtendedParameters("@ExcludeLabDepartment", SqlDbType.Int, ExcludeDepartment.Value);
         }
         return((DataTable)theON.ReturnObject(ClsUtility.theParams, "Laboratory_GetLabTestID", ClsUtility.ObjectEnum.DataTable));
     }
 }
Example #24
0
 /// <summary>
 /// Adds the type of the item sub.
 /// </summary>
 /// <param name="ItemSubTypeID">The item sub type identifier.</param>
 /// <param name="SubTypeName">Name of the sub type.</param>
 /// <param name="ItemTypeID">The item type identifier.</param>
 /// <param name="UserID">The user identifier.</param>
 /// <exception cref="System.NotImplementedException"></exception>
 public int AddEditItemSubType(string SubTypeName, int ItemTypeID, int UserID, int ItemSubTypeID = -1, bool Active = true)
 {
     lock (this)
     {
         ClsUtility.Init_Hashtable();
         ClsObject itemManager = new ClsObject();
         if (ItemSubTypeID > -1)
         {
             ClsUtility.AddParameters("@ItemSubTypeID", SqlDbType.Int, ItemSubTypeID.ToString());
         }
         ClsUtility.AddParameters("@UserID", SqlDbType.Int, UserID.ToString());
         ClsUtility.AddParameters("@ItemTypeID", SqlDbType.Int, ItemTypeID.ToString());
         ClsUtility.AddParameters("@SubTypeName", SqlDbType.VarChar, SubTypeName);
         ClsUtility.AddExtendedParameters("@DeleteFlag", SqlDbType.Bit, !Active);
         DataRow returnRow = (DataRow)itemManager.ReturnObject(ClsUtility.theParams, "pr_Admin_InsertUpdateSubItemType", ClsDBUtility.ObjectEnum.DataRow);
         return(int.Parse(returnRow[0].ToString()));
     }
 }
Example #25
0
 public int GetClinicalEncounterVisitID(int PatientId)
 {
     lock (this)
     {
         try
         {
             ClsUtility.Init_Hashtable();
             ClsUtility.AddParameters("@Ptn_pk", SqlDbType.Int, PatientId.ToString());
             ClsObject FamilyInfo = new ClsObject();
             DataTable dt         = (DataTable)FamilyInfo.ReturnObject(ClsUtility.theParams, "pr_Clinical_GetClinicalEncounterVisitID", ClsDBUtility.ObjectEnum.DataTable);
             return(Convert.ToInt32(dt.Rows[0][0]));
         }
         catch
         {
             return(0);
         }
     }
 }
Example #26
0
 /// <summary>
 /// Updates the report XSL.
 /// </summary>
 /// <param name="reportId">The report identifier.</param>
 /// <param name="buffer">The buffer.</param>
 /// <returns></returns>
 /// <exception cref="System.NotImplementedException"></exception>
 public bool UpdateReportXsl(int reportId, byte[] buffer, string filename = "", string fileExt = "", string contentType = "text/xsl", int fileLength = 0)
 {
     lock (this)
     {
         ClsObject ReportManager = new ClsObject();
         ClsUtility.Init_Hashtable();
         string  queryStatement = "pr_IQTools_UpdateReport";
         DataMgr dataManager    = new DataMgr();
         ClsUtility.AddParameters("@reportID", SqlDbType.Int, reportId.ToString());
         ClsUtility.AddExtendedParameters("@template", SqlDbType.VarBinary, (object)(buffer));
         ClsUtility.AddParameters("@templateFileName", SqlDbType.VarChar, filename);
         ClsUtility.AddParameters("@templateFileExt", SqlDbType.VarChar, fileExt);
         ClsUtility.AddParameters("@templateContentType", SqlDbType.VarChar, contentType);
         ClsUtility.AddParameters("@fileLength", SqlDbType.Int, fileLength.ToString());
         ReportManager.ReturnObject(ClsUtility.theParams, queryStatement, ClsDBUtility.ObjectEnum.ExecuteNonQuery, true);
         return(true);
     }
 }
Example #27
0
        public List <ParameterResultOption> GetParameterResultOption(int ParameterId)
        {
            ClsObject obj = new ClsObject();

            ClsUtility.Init_Hashtable();
            ClsUtility.AddExtendedParameters("@ParameterId", SqlDbType.Int, ParameterId);
            DataTable dt     = (DataTable)obj.ReturnObject(ClsUtility.theParams, "Laboratory_GetParameterResultOption", ClsUtility.ObjectEnum.DataTable);
            var       result = (from row in dt.AsEnumerable()
                                select new ParameterResultOption()
            {
                Id = Convert.ToInt32(row["Id"]),
                ParameterId = Convert.ToInt32(row["ParameterId"]),
                Text = row["Value"].ToString()
            }
                                );

            return(result.ToList());
        }
Example #28
0
        /// <summary>
        /// Gets the reports.
        /// </summary>
        /// <returns></returns>
        public DataTable GetReports()
        {
            lock (this)
            {
                ClsObject ReportManager = new ClsObject();
                ClsUtility.Init_Hashtable();
                string queryStatement;
                // DataMgr dataManager = new DataMgr();
                queryStatement = @"Select  IQToolsCaTID ReportID,ReportName , 
                            Case  When ReportStylesheet Is Null Then 'No' Else 'Yes' End As HasTemplate,
                        FileName+'.'+FileExt FullFileName,
                        ContentType
                From dbo.IQToolsExcelReports;";
                DataTable dt = (DataTable)ReportManager.ReturnObject(ClsUtility.theParams, queryStatement, ClsUtility.ObjectEnum.DataTable);

                return(dt);
            }
        }
Example #29
0
        /// <summary>
        /// Saves the voucher.
        /// </summary>
        /// <param name="voucher">The voucher.</param>
        /// <param name="userId">The user identifier.</param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public PaymentVoucher SaveVoucher(PaymentVoucher voucher, int userId)
        {
            ClsUtility.Init_Hashtable();
            ClsObject objMgr = new ClsObject();

            ClsUtility.AddExtendedParameters("@LocationId", SqlDbType.Int, voucher.LocationId);
            ClsUtility.AddExtendedParameters("@UserId", SqlDbType.Int, userId);
            ClsUtility.AddExtendedParameters("@VoucherDate", SqlDbType.DateTime, voucher.VoucherDate);
            ClsUtility.AddExtendedParameters("@Amount", SqlDbType.Decimal, voucher.Amount);
            ClsUtility.AddExtendedParameters("@Description", SqlDbType.VarChar, voucher.Description);
            ClsUtility.AddExtendedParameters("@ReferenceId", SqlDbType.VarChar, voucher.ReferenceId);
            ClsUtility.AddExtendedParameters("@VoucherType", SqlDbType.VarChar, voucher.VoucherType);

            DataRow row = (DataRow)objMgr.ReturnObject(ClsUtility.theParams, "Billing_PaymentVoucher_Insert", ClsUtility.ObjectEnum.DataRow);

            objMgr = null;
            return(this.GetVoucherById(Convert.ToInt32(row["Id"]), false));
        }
Example #30
0
        public DataTable GetUserNameAndDateCreatedOfTab(int FeatureId, int TabID)
        {
            lock (this)
            {
                oUtility.Init_Hashtable();
                oUtility.AddParameters("@FeatureId", SqlDbType.Int, FeatureId.ToString());
                oUtility.AddParameters("@TabId", SqlDbType.Int, TabID.ToString());
                ClsObject FieldMgr = new ClsObject();

                DataTable dtTmp = (DataTable)FieldMgr.ReturnObject(oUtility.theParams, "pr_CustomFormSavedByUser", ClsUtility.ObjectEnum.DataTable);
                //if (dtTmp != null && dtTmp.Rows.Count > 0)
                //    return Convert.ToInt32(dtTmp.Rows[0][0]);
                //else
                //    return 0;

                return(dtTmp);
            }
        }