/// <summary> /// 拷贝病历 /// </summary> /// <param name="currentPatId">当前病人id</param> /// <param name="hisPatListId">历史病人id</param> /// <param name="presDoctorID">处方医生Id</param> /// <param name="presDeptID">处方科室Id</param> private void CopyOMR(int currentPatId, int hisPatListId, int presDoctorID, int presDeptID) { //获取历史病人的病历 List <OPD_MedicalRecord> omrList = NewObject <OPD_MedicalRecord>().getlist <OPD_MedicalRecord>("PatListID=" + hisPatListId); //存在病历记录再复制 if (omrList.Count > 0) { //当前存在病历 List <OPD_MedicalRecord> omrCurrList = NewObject <OPD_MedicalRecord>().getlist <OPD_MedicalRecord>("PatListID=" + currentPatId); OPD_MedicalRecord copyModel = NewObject <OPD_MedicalRecord>(); //存在病历记录 更新 if (omrCurrList.Count > 0) { copyModel = omrCurrList[0]; copyModel.Symptoms = omrList[0].Symptoms; copyModel.SicknessHistory = omrList[0].SicknessHistory; copyModel.PhysicalExam = omrList[0].PhysicalExam; } else { //不存在那么 创建 OP_PatList patModel = NewObject <OP_PatList>().getmodel(currentPatId) as OP_PatList; copyModel.Symptoms = omrList[0].Symptoms; copyModel.SicknessHistory = omrList[0].SicknessHistory; copyModel.PhysicalExam = omrList[0].PhysicalExam; copyModel.PatListID = currentPatId; copyModel.PresDeptID = presDeptID; copyModel.PresDoctorID = presDoctorID; copyModel.MemberID = patModel.MemberID; } this.BindDb(copyModel); copyModel.save(); } }
/// <summary> /// 保存病历 /// </summary> /// <param name="omrModel">病历实体</param> /// <returns>true成功</returns> public bool SaveOMRData(OPD_MedicalRecord omrModel) { //查询病历表 List <OPD_MedicalRecord> ormList = NewObject <OPD_MedicalRecord>().getlist <OPD_MedicalRecord>("PatListID=" + omrModel.PatListID); //查询挂号表 OP_PatList op = (OP_PatList)NewObject <OP_PatList>().getmodel(omrModel.PatListID); if (ormList.Count > 0) { //主键赋值 omrModel.MedicalRecordID = ormList[0].MedicalRecordID; } //会员Id omrModel.MemberID = op.MemberID; this.BindDb(omrModel); int iRtn = omrModel.save(); if (iRtn > 0) { return(true); } return(false); }