using PMS.BusinessModels.Account;
using PMS.BusinessModels.SmartForm;
using PMS.EntityModels.MedicalRecordManager;
using PMS.EntityModels.SmartForm;
using PMS.Interface;
using PMS.Interface.MedicalRecordManager;
using PMS.Interface.SmartForm;
using QWPlatform.SystemLibrary.Utils;
using System.Collections.Generic;
using System.Data;
using System.Web.Helpers;
using System.Web.Mvc;
namespace PMS.WebUI.Controllers
{
///
/// 病历原型
///
public class MedicalRecordManagerController : BaseController
{
///
/// 实例接口
///
IMedicalRecord MedicalRecord = InterfaceFactory.CreateBusinessInstance();
// GET: MedicalRecord
public ActionResult MedicalRecordIndex()
{
return View();
}
public ActionResult Preview()
{
return View();
}
///
/// 新增分类
///
///
public ActionResult AddClass()
{
return View();
}
///
/// 新增修改分类
///
///
///
public ActionResult AddUpdateCategory(BLYXFL model)
{
var user = GetCurrentUser();
model.渠道ID = user.CompanyID;
model.登记人ID = user.PersonID;
model.登记人 = user.Name;
var r = MedicalRecord.AddCategory(model.type, model);
if (r)
{//保存成功
return this.ResponseJson(System.Net.HttpStatusCode.OK, "操作成功");
}
else
{//保存失败
return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "操作失败");
}
}
///
/// 删除分类
///
///
///
public ActionResult DelCategory(BLYXFL model)
{
var msg = "";
var r = MedicalRecord.DelCategory(model, ref msg);
if (r)
{//保存成功
return this.ResponseJson(System.Net.HttpStatusCode.OK, "操作成功");
}
else
{//保存失败
return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, msg);
}
}
///
/// 查询分类
///
///
///
[HttpPost]
public ActionResult GetCategory(DTOPrototypeCassModel model)
{
var user = GetCurrentUser();
model.渠道ID = user.CompanyID;
model.登记人ID = user.PersonID;
var list = MedicalRecord.GetCategory(model);
var json = Strings.ObjectToJson(list);
return Content(json, "application/json");
}
///
/// 查询字典表
///
///
///
public ActionResult SelectNature(string ID)
{
var list = account_obj.SelectNature(ID);
var json = Strings.ObjectToJson(list);
return Content(json, "application/json");
}
///
/// 查询原型
///
///
///
public string PrototypeRecordSelect(DTOPrototypeRecordModel model)
{
var total = 0;
var user = GetCurrentUser();
model.渠道ID = user.CompanyID;
model.登记人ID = user.PersonID;
var dt = MedicalRecord.PrototypeRecordSelect(model, out total);
return Strings.ObjectToJson(
new { total = total, rows = dt });
}
///
/// 查询单个记录
///
///
///
[HttpPost]
public ActionResult PrototypeIndividualRecord(string ID)
{
var dt = MedicalRecord.PrototypeIndividualRecord(ID);
var json= Strings.ObjectToJson(dt);
return Content(json, "application/json");
}
public ActionResult MedicalRecordStatistics()
{
return View();
}
///
/// 添加过程记录
///
///
public ActionResult AddComment()
{
return View();
}
///
/// 设置状态
///
/// 1状态状态,2审核操作
///
///
///
public ActionResult UpdateSate(int type, string id, int state)
{
var user = GetCurrentUser();
var SHR = user.Name;
var SHRID = user.PersonID;
var r = MedicalRecord.UpdateSate(type, id, state,SHR,SHRID);
if (r)
{//保存成功
return this.ResponseJson(System.Net.HttpStatusCode.OK, "操作成功");
}
else
{//保存失败
return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "操作失败");
}
}
///
/// 根据病历原型ID获取过程记录
///
///
///
public ActionResult GetProcessRecords(string ID)
{
var dt = MedicalRecord.GetProcessRecords(ID);
var json = Strings.ObjectToJson(dt);
return Content(json, "application/json");
}
///
/// 添加过程记录
///
///
///
public ActionResult AddProcessRecords(DTOProcessRecordsModel model)
{
var user = GetCurrentUser();
model.评论人ID = user.PersonID;
model.评论人 = user.Name;
var r = MedicalRecord.AddProcessRecords(model);
if (r)
{//保存成功
return this.ResponseJson(System.Net.HttpStatusCode.OK, "操作成功");
}
else
{//保存失败
return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "操作失败");
}
}
}
}