术中模板子药调整
This commit is contained in:
parent
6c61a961ec
commit
4e5640d286
@ -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,12 +7,13 @@ using AIMSModel;
|
||||
using AIMSObjectQuery;
|
||||
using System.Text;
|
||||
using DrawGraph;
|
||||
using HelperDB;
|
||||
|
||||
namespace AIMSDAL
|
||||
{
|
||||
internal partial class DFactDrug
|
||||
{
|
||||
public static void Add(FactDrug FactDrugObj)
|
||||
public static int Add(FactDrug FactDrugObj)
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("insert into [FactDrug](");
|
||||
@ -38,8 +39,9 @@ namespace AIMSDAL
|
||||
strSql.Append("'" + FactDrugObj.Velocity + "',");
|
||||
strSql.Append("'" + FactDrugObj.VelocityUnit + "',");
|
||||
strSql.Append("'" + FactDrugObj.ParentId + "'");
|
||||
strSql.Append(")");
|
||||
HelperDB.DbHelperSQL.ExecNonQuery(strSql.ToString());
|
||||
strSql.Append(");select @@identity");
|
||||
//HelperDB.DbHelperSQL.ExecNonQuery(strSql.ToString());
|
||||
return Convert.ToInt32(DBHelper.ExecuteScalar(strSql.ToString()));
|
||||
}
|
||||
|
||||
public static bool IsValid(int DrugId)
|
||||
|
||||
@ -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