术中模板子药调整
This commit is contained in:
parent
6c61a961ec
commit
4e5640d286
@ -91,7 +91,7 @@ namespace AIMS.PublicUI.UI
|
||||
dgvYP.Visible = false;
|
||||
dgvYP.AutoGenerateColumns = false;
|
||||
|
||||
if (PublicMethod.OperatorNo == "admin" || PublicMethod.RoleName.Contains("常用药品"))
|
||||
if (PublicMethod.OperatorNo == "admin" || PublicMethod.RoleName.Contains("常用药品"))
|
||||
{
|
||||
btnTypeManager.Visible = true;
|
||||
}
|
||||
@ -140,13 +140,13 @@ namespace AIMS.PublicUI.UI
|
||||
|
||||
private void Dgv_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if (_dataGridView.CurrentCell.ColumnIndex == 3)
|
||||
{
|
||||
frmPrescriptionDocument document = new frmPrescriptionDocument();
|
||||
document._operationRecord = _record;
|
||||
document.CurrentRow = _dataGridView.CurrentRow;
|
||||
document.ShowDialog();
|
||||
}
|
||||
//if (_dataGridView.CurrentCell.ColumnIndex == 3)
|
||||
//{
|
||||
// frmPrescriptionDocument document = new frmPrescriptionDocument();
|
||||
// document._operationRecord = _record;
|
||||
// document.CurrentRow = _dataGridView.CurrentRow;
|
||||
// document.ShowDialog();
|
||||
//}
|
||||
}
|
||||
|
||||
private void Dgv_CellEndEdit(object sender, DataGridViewCellEventArgs e)
|
||||
@ -808,15 +808,17 @@ namespace AIMS.PublicUI.UI
|
||||
FactDrug er = _record.FactDrugList.Where(b => b.Id == id).ToList()[0];
|
||||
er.clearAddObj(zgcAnaesRecord);
|
||||
er.clearIm(zgcAnaesRecord);
|
||||
//er.IsValid = 0;
|
||||
BFactDrug.Delete(er);
|
||||
_record.FactDrugList.Remove(er);
|
||||
_dataGridView.Rows.Remove(_dataGridView.CurrentRow);
|
||||
_lineNumber = 0;
|
||||
|
||||
|
||||
FullALLDGV();
|
||||
tabDrugs_SelectedTabChanged(null, null);
|
||||
if (DrugsParam != null) DrugsParam();
|
||||
if (_dataGridView.Rows.Count == 0 || _dataGridView.Rows[_dataGridView.Rows.Count - 1].Cells[3].Value != null)
|
||||
AddNewNullRows();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -824,6 +826,8 @@ namespace AIMS.PublicUI.UI
|
||||
{
|
||||
_dataGridView.Rows.Remove(_dataGridView.CurrentRow);
|
||||
_lineNumber = 0;
|
||||
if (_dataGridView.Rows.Count == 0 || _dataGridView.Rows[_dataGridView.Rows.Count - 1].Cells[3].Value != null)
|
||||
AddNewNullRows();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,9 +11,9 @@ namespace AIMSBLL
|
||||
{
|
||||
public partial class BFactDrug
|
||||
{
|
||||
public static void Add(FactDrug FactDrugObj)
|
||||
public static int Add(FactDrug FactDrugObj)
|
||||
{
|
||||
DFactDrug.Add(FactDrugObj);
|
||||
return DFactDrug.Add(FactDrugObj);
|
||||
}
|
||||
public static bool IsValid(int DrugId)
|
||||
{
|
||||
|
||||
@ -47,12 +47,12 @@ namespace AIMSBLL
|
||||
OperationTemplateDrugObj.Spare5 = Drugdt.Rows[i]["ParentId"].ToString();
|
||||
OperationTemplateDrugObj.Spare6 = Drugdt.Rows[i]["DrugName"].ToString();
|
||||
OperationTemplateDrugObj.Spare7 = Drugdt.Rows[i]["Access"].ToString();
|
||||
OperationTemplateDrugObj.Spare8 = Drugdt.Rows[i]["Id"].ToString();
|
||||
Add(OperationTemplateDrugObj);
|
||||
}
|
||||
|
||||
}
|
||||
//事件
|
||||
|
||||
//事件
|
||||
DataTable Eventdt = BFactEvents.GetDataTable(PatientId, TypeId);
|
||||
for (int i = 0; i < Eventdt.Rows.Count; i++)
|
||||
{
|
||||
@ -129,7 +129,7 @@ namespace AIMSBLL
|
||||
{
|
||||
DateTime NewInRoomTime = AIMSExtension.PublicMethod.SystemDate();
|
||||
DataTable dt = DOperationTemplate.GetDataTable(TemplateName, TypeId);
|
||||
DataRow[] drugdr = dt.Select("ItemKindName='药品'");
|
||||
DataRow[] drugdr = dt.Select("ItemKindName='药品' and Spare5='0' ");
|
||||
foreach (DataRow dr in drugdr)
|
||||
{
|
||||
int DrugId = int.Parse(dr["ItemId"].ToString());
|
||||
@ -141,9 +141,6 @@ namespace AIMSBLL
|
||||
TimeSpan BeginTimets = DateTime.Parse(dr["BeginTime"].ToString()).Subtract(DateTime.Parse(dr["InRoomTime"].ToString()));
|
||||
TimeSpan EndTimets = DateTime.Parse(dr["EndTime"].ToString()).Subtract(DateTime.Parse(dr["InRoomTime"].ToString()));
|
||||
|
||||
//FactDrugObj.DrugBeginTime = NewInRoomTime.AddSeconds(BeginTimets.TotalSeconds);
|
||||
//FactDrugObj.DrugEndTime = NewInRoomTime.AddSeconds(EndTimets.TotalSeconds);
|
||||
|
||||
FactDrugObj.DrugBeginTime = InRoomTime.AddSeconds(BeginTimets.TotalSeconds);
|
||||
FactDrugObj.DrugEndTime = InRoomTime.AddSeconds(EndTimets.TotalSeconds);
|
||||
|
||||
@ -177,11 +174,63 @@ namespace AIMSBLL
|
||||
FactDrugObj.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
|
||||
FactDrugObj.OperatorName = AIMSExtension.PublicMethod.OperatorName;
|
||||
FactDrugObj.OperateDate = NewInRoomTime;
|
||||
FactDrugObj.ParentId =int.Parse( dr["Spare5"].ToString());
|
||||
FactDrugObj.ParentId = 0;// int.Parse(dr["Spare5"].ToString());
|
||||
FactDrugObj.DrugName = dr["Spare6"].ToString();
|
||||
FactDrugObj.Access = dr["Spare7"].ToString();
|
||||
BFactDrug.Add(FactDrugObj);
|
||||
FactDrugObj.Id = BFactDrug.Add(FactDrugObj);
|
||||
DataRow[] drugchild = dt.Select("ItemKindName='药品' and Spare5='"+dr["Spare8"].ToString()+"' ");
|
||||
foreach (DataRow child in drugchild)
|
||||
{
|
||||
int DrugId2 = int.Parse(child["ItemId"].ToString());
|
||||
if (BFactDrug.IsValid(DrugId2))
|
||||
{
|
||||
FactDrug FactDrugObjChild = new FactDrug();
|
||||
FactDrugObjChild.PatientId = PatientId;
|
||||
FactDrugObjChild.DrugId = DrugId2;
|
||||
TimeSpan BeginTimets2 = DateTime.Parse(child["BeginTime"].ToString()).Subtract(DateTime.Parse(child["InRoomTime"].ToString()));
|
||||
TimeSpan EndTimets2 = DateTime.Parse(child["EndTime"].ToString()).Subtract(DateTime.Parse(child["InRoomTime"].ToString()));
|
||||
|
||||
FactDrugObjChild.DrugBeginTime = InRoomTime.AddSeconds(BeginTimets2.TotalSeconds);
|
||||
FactDrugObjChild.DrugEndTime = InRoomTime.AddSeconds(EndTimets2.TotalSeconds);
|
||||
|
||||
if (child["BeginTime"].ToString() == child["EndTime"].ToString())
|
||||
{
|
||||
FactDrugObjChild.IsContinue = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
FactDrugObjChild.IsContinue = 1;
|
||||
}
|
||||
FactDrugObjChild.DrugTypeId = TypeId;
|
||||
if (child["Value"].ToString() != "")
|
||||
{
|
||||
FactDrugObjChild.Dosage = decimal.Parse(child["Value"].ToString());
|
||||
}
|
||||
FactDrugObjChild.DosageUnit = child["DosageUnit"].ToString();
|
||||
if (child["Spare1"].ToString() != "" && child["Spare1"].ToString() != "0" && child["Spare1"].ToString() != "0.00")
|
||||
{
|
||||
FactDrugObjChild.Density = decimal.Parse(child["Spare1"].ToString());
|
||||
FactDrugObjChild.DensityUnit = child["Spare2"].ToString();
|
||||
}
|
||||
if (child["Spare3"].ToString() != "" && child["Spare3"].ToString() != "0" && child["Spare3"].ToString() != "0.00")
|
||||
{
|
||||
FactDrugObjChild.Velocity = decimal.Parse(child["Spare3"].ToString());
|
||||
FactDrugObjChild.VelocityUnit = child["Spare4"].ToString();
|
||||
}
|
||||
|
||||
FactDrugObjChild.DrugChannel = child["DrugChannel"].ToString();
|
||||
FactDrugObjChild.GiveDrugType = child["GiveDrugType"].ToString();
|
||||
FactDrugObjChild.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
|
||||
FactDrugObjChild.OperatorName = AIMSExtension.PublicMethod.OperatorName;
|
||||
FactDrugObjChild.OperateDate = NewInRoomTime;
|
||||
FactDrugObjChild.ParentId = FactDrugObj.Id;
|
||||
FactDrugObjChild.DrugName = child["Spare6"].ToString();
|
||||
FactDrugObjChild.Access = child["Spare7"].ToString();
|
||||
BFactDrug.Add(FactDrugObjChild);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -7,151 +7,153 @@ using AIMSModel;
|
||||
using AIMSObjectQuery;
|
||||
using System.Text;
|
||||
using DrawGraph;
|
||||
using HelperDB;
|
||||
|
||||
namespace AIMSDAL
|
||||
{
|
||||
internal partial class DFactDrug
|
||||
{
|
||||
public static void Add(FactDrug FactDrugObj)
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("insert into [FactDrug](");
|
||||
strSql.Append("PatientId,DrugTypeId,DrugId,DrugBeginTime,DrugEndTime,Dosage,DosageUnit,DrugChannel,GiveDrugType,IsContinue,Remark,OperatorNo,OperatorName,OperateDate, Density, DensityUnit, Velocity, VelocityUnit,ParentId");
|
||||
strSql.Append(")");
|
||||
strSql.Append(" values (");
|
||||
strSql.Append("" + FactDrugObj.PatientId + ",");
|
||||
strSql.Append("" + FactDrugObj.DrugTypeId + ",");
|
||||
strSql.Append("" + FactDrugObj.DrugId + ",");
|
||||
strSql.Append("'" + FactDrugObj.DrugBeginTime + "',");
|
||||
strSql.Append("'" + FactDrugObj.DrugEndTime + "',");
|
||||
strSql.Append("" + FactDrugObj.Dosage + ",");
|
||||
strSql.Append("'" + FactDrugObj.DosageUnit + "',");
|
||||
strSql.Append("'" + FactDrugObj.DrugChannel + "',");
|
||||
strSql.Append("'" + FactDrugObj.GiveDrugType + "',");
|
||||
strSql.Append("" + FactDrugObj.IsContinue + ",");
|
||||
strSql.Append("'" + FactDrugObj.Remark + "',");
|
||||
strSql.Append("'" + FactDrugObj.OperatorNo + "',");
|
||||
strSql.Append("'" + FactDrugObj.OperatorName + "',");
|
||||
strSql.Append("'" + FactDrugObj.OperateDate + "',");
|
||||
strSql.Append("'" + FactDrugObj.Density + "',");
|
||||
strSql.Append("'" + FactDrugObj.DensityUnit + "',");
|
||||
strSql.Append("'" + FactDrugObj.Velocity + "',");
|
||||
strSql.Append("'" + FactDrugObj.VelocityUnit + "',");
|
||||
strSql.Append("'" + FactDrugObj.ParentId + "'");
|
||||
strSql.Append(")");
|
||||
HelperDB.DbHelperSQL.ExecNonQuery(strSql.ToString());
|
||||
}
|
||||
public static int Add(FactDrug FactDrugObj)
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("insert into [FactDrug](");
|
||||
strSql.Append("PatientId,DrugTypeId,DrugId,DrugBeginTime,DrugEndTime,Dosage,DosageUnit,DrugChannel,GiveDrugType,IsContinue,Remark,OperatorNo,OperatorName,OperateDate, Density, DensityUnit, Velocity, VelocityUnit,ParentId");
|
||||
strSql.Append(")");
|
||||
strSql.Append(" values (");
|
||||
strSql.Append("" + FactDrugObj.PatientId + ",");
|
||||
strSql.Append("" + FactDrugObj.DrugTypeId + ",");
|
||||
strSql.Append("" + FactDrugObj.DrugId + ",");
|
||||
strSql.Append("'" + FactDrugObj.DrugBeginTime + "',");
|
||||
strSql.Append("'" + FactDrugObj.DrugEndTime + "',");
|
||||
strSql.Append("" + FactDrugObj.Dosage + ",");
|
||||
strSql.Append("'" + FactDrugObj.DosageUnit + "',");
|
||||
strSql.Append("'" + FactDrugObj.DrugChannel + "',");
|
||||
strSql.Append("'" + FactDrugObj.GiveDrugType + "',");
|
||||
strSql.Append("" + FactDrugObj.IsContinue + ",");
|
||||
strSql.Append("'" + FactDrugObj.Remark + "',");
|
||||
strSql.Append("'" + FactDrugObj.OperatorNo + "',");
|
||||
strSql.Append("'" + FactDrugObj.OperatorName + "',");
|
||||
strSql.Append("'" + FactDrugObj.OperateDate + "',");
|
||||
strSql.Append("'" + FactDrugObj.Density + "',");
|
||||
strSql.Append("'" + FactDrugObj.DensityUnit + "',");
|
||||
strSql.Append("'" + FactDrugObj.Velocity + "',");
|
||||
strSql.Append("'" + FactDrugObj.VelocityUnit + "',");
|
||||
strSql.Append("'" + FactDrugObj.ParentId + "'");
|
||||
strSql.Append(");select @@identity");
|
||||
//HelperDB.DbHelperSQL.ExecNonQuery(strSql.ToString());
|
||||
return Convert.ToInt32(DBHelper.ExecuteScalar(strSql.ToString()));
|
||||
}
|
||||
|
||||
public static bool IsValid(int DrugId)
|
||||
{
|
||||
bool Temp = false;
|
||||
string strSql = " SELECT * FROM Drugs WHERE Id =" + DrugId + " and IsValid=1";
|
||||
DataTable dt = HelperDB.DbHelperSQL.GetDataTable(strSql.ToString());
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
Temp = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Temp = false;
|
||||
}
|
||||
return Temp;
|
||||
}
|
||||
public static bool IsValid(int DrugId)
|
||||
{
|
||||
bool Temp = false;
|
||||
string strSql = " SELECT * FROM Drugs WHERE Id =" + DrugId + " and IsValid=1";
|
||||
DataTable dt = HelperDB.DbHelperSQL.GetDataTable(strSql.ToString());
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
Temp = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Temp = false;
|
||||
}
|
||||
return Temp;
|
||||
}
|
||||
|
||||
//public void Update(FactDrug FactDrugObj)
|
||||
//{
|
||||
// StringBuilder strSql = new StringBuilder();
|
||||
// strSql.Append("update FactDrug set ");
|
||||
// strSql.Append("PatientId=" + FactDrugObj.PatientId + ",");
|
||||
// strSql.Append("DrugTypeId=" + FactDrugObj.DrugTypeId + ",");
|
||||
// strSql.Append("DrugId=" + FactDrugObj.DrugId + ",");
|
||||
// strSql.Append("DrugBeginTime='" + FactDrugObj.DrugBeginTime + "',");
|
||||
// strSql.Append("DrugEndTime='" + FactDrugObj.DrugEndTime + "',");
|
||||
// strSql.Append("Dosage=" + FactDrugObj.Dosage + ",");
|
||||
// strSql.Append("DosageUnit='" + FactDrugObj.DosageUnit + "',");
|
||||
// strSql.Append("DrugChannel='" + FactDrugObj.DrugChannel + "',");
|
||||
// strSql.Append("GiveDrugType='" + FactDrugObj.GiveDrugType + "',");
|
||||
// strSql.Append("IsContinue=" + FactDrugObj.IsContinue + ",");
|
||||
// strSql.Append("Remark='" + FactDrugObj.Remark + "',");
|
||||
// strSql.Append("OperatorNo='" + FactDrugObj.OperatorNo + "',");
|
||||
// strSql.Append("OperatorName='" + FactDrugObj.OperatorName + "',");
|
||||
// strSql.Append("OperateDate='" + FactDrugObj.OperateDate + "'");
|
||||
// strSql.Append(" where Id=" + FactDrugObj.Id + " ");
|
||||
// HelperDB.DbHelperSQL.ExecNonQuery(strSql.ToString());
|
||||
//}
|
||||
//public void Update(FactDrug FactDrugObj)
|
||||
//{
|
||||
// StringBuilder strSql = new StringBuilder();
|
||||
// strSql.Append("update FactDrug set ");
|
||||
// strSql.Append("PatientId=" + FactDrugObj.PatientId + ",");
|
||||
// strSql.Append("DrugTypeId=" + FactDrugObj.DrugTypeId + ",");
|
||||
// strSql.Append("DrugId=" + FactDrugObj.DrugId + ",");
|
||||
// strSql.Append("DrugBeginTime='" + FactDrugObj.DrugBeginTime + "',");
|
||||
// strSql.Append("DrugEndTime='" + FactDrugObj.DrugEndTime + "',");
|
||||
// strSql.Append("Dosage=" + FactDrugObj.Dosage + ",");
|
||||
// strSql.Append("DosageUnit='" + FactDrugObj.DosageUnit + "',");
|
||||
// strSql.Append("DrugChannel='" + FactDrugObj.DrugChannel + "',");
|
||||
// strSql.Append("GiveDrugType='" + FactDrugObj.GiveDrugType + "',");
|
||||
// strSql.Append("IsContinue=" + FactDrugObj.IsContinue + ",");
|
||||
// strSql.Append("Remark='" + FactDrugObj.Remark + "',");
|
||||
// strSql.Append("OperatorNo='" + FactDrugObj.OperatorNo + "',");
|
||||
// strSql.Append("OperatorName='" + FactDrugObj.OperatorName + "',");
|
||||
// strSql.Append("OperateDate='" + FactDrugObj.OperateDate + "'");
|
||||
// strSql.Append(" where Id=" + FactDrugObj.Id + " ");
|
||||
// HelperDB.DbHelperSQL.ExecNonQuery(strSql.ToString());
|
||||
//}
|
||||
|
||||
public static void Delete(int Id)
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("delete FactDrug ");
|
||||
strSql.Append(" where Id=" + Id + "");
|
||||
HelperDB.DbHelperSQL.ExecNonQuery(strSql.ToString());
|
||||
}
|
||||
public static void Delete(int Id)
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("delete FactDrug ");
|
||||
strSql.Append(" where Id=" + Id + "");
|
||||
HelperDB.DbHelperSQL.ExecNonQuery(strSql.ToString());
|
||||
}
|
||||
|
||||
public static FactDrug GetModel(int Id)
|
||||
{
|
||||
FactDrug FactDrugObj = new FactDrug();
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("select ");
|
||||
strSql.Append("Id,PatientId,DrugTypeId,DrugId,DrugBeginTime,DrugEndTime,Dosage,DosageUnit,DrugChannel,GiveDrugType,IsContinue,Remark,OperatorNo,OperatorName,OperateDate ");
|
||||
strSql.Append(" from FactDrug ");
|
||||
strSql.Append(" where Id=" + Id + "");
|
||||
DataSet ds = HelperDB.DbHelperSQL.GetDataSet(strSql.ToString());
|
||||
if (ds.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
if (ds.Tables[0].Rows[0]["Id"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.Id = int.Parse(ds.Tables[0].Rows[0]["Id"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["PatientId"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.PatientId = int.Parse(ds.Tables[0].Rows[0]["PatientId"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["DrugTypeId"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.DrugTypeId = int.Parse(ds.Tables[0].Rows[0]["DrugTypeId"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["DrugId"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.DrugId = int.Parse(ds.Tables[0].Rows[0]["DrugId"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["DrugBeginTime"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.DrugBeginTime = DateTime.Parse(ds.Tables[0].Rows[0]["DrugBeginTime"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["DrugEndTime"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.DrugEndTime = DateTime.Parse(ds.Tables[0].Rows[0]["DrugEndTime"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["Dosage"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.Dosage = decimal.Parse(ds.Tables[0].Rows[0]["Dosage"].ToString());
|
||||
}
|
||||
FactDrugObj.DosageUnit = ds.Tables[0].Rows[0]["DosageUnit"].ToString();
|
||||
FactDrugObj.DrugChannel = ds.Tables[0].Rows[0]["DrugChannel"].ToString();
|
||||
FactDrugObj.GiveDrugType = ds.Tables[0].Rows[0]["GiveDrugType"].ToString();
|
||||
if (ds.Tables[0].Rows[0]["IsContinue"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.IsContinue = int.Parse(ds.Tables[0].Rows[0]["IsContinue"].ToString());
|
||||
}
|
||||
FactDrugObj.Remark = ds.Tables[0].Rows[0]["Remark"].ToString();
|
||||
FactDrugObj.OperatorNo = ds.Tables[0].Rows[0]["OperatorNo"].ToString();
|
||||
FactDrugObj.OperatorName = ds.Tables[0].Rows[0]["OperatorName"].ToString();
|
||||
if (ds.Tables[0].Rows[0]["OperateDate"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.OperateDate = DateTime.Parse(ds.Tables[0].Rows[0]["OperateDate"].ToString());
|
||||
}
|
||||
}
|
||||
return FactDrugObj;
|
||||
}
|
||||
public static FactDrug GetModel(int Id)
|
||||
{
|
||||
FactDrug FactDrugObj = new FactDrug();
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("select ");
|
||||
strSql.Append("Id,PatientId,DrugTypeId,DrugId,DrugBeginTime,DrugEndTime,Dosage,DosageUnit,DrugChannel,GiveDrugType,IsContinue,Remark,OperatorNo,OperatorName,OperateDate ");
|
||||
strSql.Append(" from FactDrug ");
|
||||
strSql.Append(" where Id=" + Id + "");
|
||||
DataSet ds = HelperDB.DbHelperSQL.GetDataSet(strSql.ToString());
|
||||
if (ds.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
if (ds.Tables[0].Rows[0]["Id"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.Id = int.Parse(ds.Tables[0].Rows[0]["Id"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["PatientId"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.PatientId = int.Parse(ds.Tables[0].Rows[0]["PatientId"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["DrugTypeId"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.DrugTypeId = int.Parse(ds.Tables[0].Rows[0]["DrugTypeId"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["DrugId"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.DrugId = int.Parse(ds.Tables[0].Rows[0]["DrugId"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["DrugBeginTime"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.DrugBeginTime = DateTime.Parse(ds.Tables[0].Rows[0]["DrugBeginTime"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["DrugEndTime"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.DrugEndTime = DateTime.Parse(ds.Tables[0].Rows[0]["DrugEndTime"].ToString());
|
||||
}
|
||||
if (ds.Tables[0].Rows[0]["Dosage"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.Dosage = decimal.Parse(ds.Tables[0].Rows[0]["Dosage"].ToString());
|
||||
}
|
||||
FactDrugObj.DosageUnit = ds.Tables[0].Rows[0]["DosageUnit"].ToString();
|
||||
FactDrugObj.DrugChannel = ds.Tables[0].Rows[0]["DrugChannel"].ToString();
|
||||
FactDrugObj.GiveDrugType = ds.Tables[0].Rows[0]["GiveDrugType"].ToString();
|
||||
if (ds.Tables[0].Rows[0]["IsContinue"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.IsContinue = int.Parse(ds.Tables[0].Rows[0]["IsContinue"].ToString());
|
||||
}
|
||||
FactDrugObj.Remark = ds.Tables[0].Rows[0]["Remark"].ToString();
|
||||
FactDrugObj.OperatorNo = ds.Tables[0].Rows[0]["OperatorNo"].ToString();
|
||||
FactDrugObj.OperatorName = ds.Tables[0].Rows[0]["OperatorName"].ToString();
|
||||
if (ds.Tables[0].Rows[0]["OperateDate"].ToString() != "")
|
||||
{
|
||||
FactDrugObj.OperateDate = DateTime.Parse(ds.Tables[0].Rows[0]["OperateDate"].ToString());
|
||||
}
|
||||
}
|
||||
return FactDrugObj;
|
||||
}
|
||||
|
||||
public static DataTable GetDataTable(int PatientId, int DrugTypeId)
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("SELECT fd.Id, d.Id as DrugId, d.Name AS DrugName,fd.Dosage,fd.DosageUnit,fd.DrugChannel, fd.GiveDrugType,fd.DrugBeginTime, Density, DensityUnit, Velocity, VelocityUnit,fd.DrugEndTime,fd.Remark,fd.ParentId,fd.DrugName,fd.Access FROM FactDrug fd ");
|
||||
strSql.Append("LEFT JOIN Drugs d ON d.Id = fd.DrugId WHERE fd.PatientId=" + PatientId + " AND fd.DrugTypeId=" + DrugTypeId + " order by fd.DrugBeginTime");
|
||||
return HelperDB.DbHelperSQL.GetDataTable(strSql.ToString());
|
||||
}
|
||||
public static DataTable GetDataTable(int PatientId, int DrugTypeId)
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("SELECT fd.Id, d.Id as DrugId, d.Name AS DrugName,fd.Dosage,fd.DosageUnit,fd.DrugChannel, fd.GiveDrugType,fd.DrugBeginTime, Density, DensityUnit, Velocity, VelocityUnit,fd.DrugEndTime,fd.Remark,fd.ParentId,fd.DrugName,fd.Access FROM FactDrug fd ");
|
||||
strSql.Append("LEFT JOIN Drugs d ON d.Id = fd.DrugId WHERE fd.PatientId=" + PatientId + " AND fd.DrugTypeId=" + DrugTypeId + " order by fd.DrugBeginTime");
|
||||
return HelperDB.DbHelperSQL.GetDataTable(strSql.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,17 +65,17 @@ namespace DrawGraph
|
||||
strSql += " order by UseRate asc";
|
||||
break;
|
||||
case "手术体位":
|
||||
strSql = "SELECT top 15 p.Id,p.Name,p.Explain Code FROM OperationBodyPosition p WHERE p.IsValid=1 AND (p.Name LIKE '%" + HelpCode + "%' OR p.HelpCode LIKE '%" + HelpCode + "%' )";
|
||||
strSql = "SELECT top 30 p.Id,p.Name,p.Explain Code FROM OperationBodyPosition p WHERE p.IsValid=1 AND (p.Name LIKE '%" + HelpCode + "%' OR p.HelpCode LIKE '%" + HelpCode + "%' )";
|
||||
if (SelPerson != "") strSql += " AND p.Id not in (" + SelPerson + ") ";
|
||||
strSql += " order by PositionOrder asc";
|
||||
break;
|
||||
case "手术部位":
|
||||
strSql = "SELECT top 15 p.Id,p.Name,p.Explain Code FROM OperationPosition p WHERE p.IsValid=1 AND (p.Name LIKE '%" + HelpCode + "%' OR p.HelpCode LIKE '%" + HelpCode + "%' )";
|
||||
strSql = "SELECT top 20 p.Id,p.Name,p.Explain Code FROM OperationPosition p WHERE p.IsValid=1 AND (p.Name LIKE '%" + HelpCode + "%' OR p.HelpCode LIKE '%" + HelpCode + "%' )";
|
||||
if (SelPerson != "") strSql += " AND p.Id not in (" + SelPerson + ") ";
|
||||
strSql += " order by PositionOrder asc";
|
||||
break;
|
||||
default:
|
||||
strSql = "SELECT top 15 p.Id,p.Name,p.Remark Code FROM BasicDictionary p WHERE p.IsValid=1 and ParentId in(select Id from BasicDictionary where Name='" + _title + "') AND (p.Name LIKE '%" + HelpCode + "%' OR p.HelpCode LIKE '%" + HelpCode + "%' )";
|
||||
strSql = "SELECT top 30 p.Id,p.Name,p.Remark Code FROM BasicDictionary p WHERE p.IsValid=1 and ParentId in(select Id from BasicDictionary where Name='" + _title + "') AND (p.Name LIKE '%" + HelpCode + "%' OR p.HelpCode LIKE '%" + HelpCode + "%' )";
|
||||
if (SelPerson != "") strSql += " AND p.Id not in (" + SelPerson + ") ";
|
||||
strSql += " order by p.[Order] asc";
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user