XMLWAN 2 år sedan
förälder
incheckning
565f32e86d

+ 2 - 2
service/data.go Visa fil

@@ -317,8 +317,8 @@ func BatchInspectionConfiguration(orgid int64) (err error) {
317 317
 	return
318 318
 }
319 319
 
320
-func ShowFiledConfig(org_id int64, isShow int, id int64) (err error) {
321
-	err = readDb.Model(&models.FiledConfig{}).Where("org_id = ? AND id = ?", org_id, id).Updates(map[string]interface{}{"create_time": time.Now().Unix(), "update_time": time.Now().Unix(), "is_show": isShow}).Error
320
+func ShowFiledConfig(org_id int64, isShow int, is_write int, id int64) (err error) {
321
+	err = readDb.Model(&models.FiledConfig{}).Where("org_id = ? AND id = ?", org_id, id).Updates(map[string]interface{}{"create_time": time.Now().Unix(), "update_time": time.Now().Unix(), "is_show": isShow, "is_write": is_write}).Error
322 322
 	return
323 323
 }
324 324
 

+ 1 - 1
service/dialysis_service.go Visa fil

@@ -131,7 +131,7 @@ func GetTotalDialysisCout(orgid int64, patientid int64) (order []*models.Dialysi
131 131
 //临时医嘱
132 132
 func FindDoctorAdviceOrderById(orgID int64, patientsId int64, recordDate int64) (patient []*models.DoctorAdvice, err error) {
133 133
 	err = readDb.Model(&models.DoctorAdvice{}).
134
-		Where("patient_id = ? and user_org_id=? and status=1 and record_date = ? and advice_type = 2", patientsId, orgID, recordDate).
134
+		Where("patient_id = ? and user_org_id=? and status=1 and advice_date = ? and advice_type = 2", patientsId, orgID, recordDate).
135 135
 		Select("id, user_org_id, patient_id, advice_type, advice_date, record_date, start_time, advice_name,advice_desc, reminder_date, drug_spec, drug_spec_unit, single_dose, single_dose_unit, prescribing_number, prescribing_number_unit, delivery_way, execution_frequency, advice_doctor, status, created_time,updated_time, advice_affirm, remark, stop_time, stop_reason, stop_doctor, stop_state, parent_id, execution_time, execution_staff, execution_state, checker, check_state, check_time, groupno, IF(parent_id > 0, parent_id, id) as advice_order").Order("start_time asc, groupno desc, advice_order desc, id asc").
136 136
 		Find(&patient).Error
137 137
 	return

+ 1 - 1
service/his_config_service.go Visa fil

@@ -3,10 +3,10 @@ package service
3 3
 import (
4 4
 	"XT_New/enums"
5 5
 	"XT_New/models"
6
-	"XT_New/src/golang.org/x/sync/errgroup"
7 6
 	"XT_New/utils"
8 7
 	"fmt"
9 8
 	"github.com/astaxie/beego/config"
9
+	"golang.org/x/sync/errgroup"
10 10
 
11 11
 	"reflect"
12 12
 	"strconv"

+ 17 - 0
service/mobile_dialysis_service.go Visa fil

@@ -626,6 +626,14 @@ func MobileGetPredialysisEvaluationOne(orgID int64, patientID int64, recordDate
626 626
 	return &record, nil
627 627
 }
628 628
 
629
+func MobileGetPredialysisEvaluationTwo(orgID int64, patientID int64, recordDate int64) (models.PredialysisEvaluation, error) {
630
+
631
+	var record models.PredialysisEvaluation
632
+	err := readDb.Model(&models.PredialysisEvaluation{}).Where("patient_id = ? and user_org_id = ? and status = 1 and assessment_date = ?", patientID, orgID, recordDate).First(&record).Error
633
+
634
+	return record, err
635
+}
636
+
629 637
 // 透前评估
630 638
 func MobileGetPredialysisEvaluation(orgID int64, patientID int64, recordDate int64) (*models.PredialysisEvaluation, error) {
631 639
 
@@ -756,6 +764,7 @@ func MobileGetDoctorAdvicesByGroups(orgID int64, patientID int64, recordDate int
756 764
 	doctor_advices_str, _ := redis.Get(key).Result()
757 765
 
758 766
 	if len(doctor_advices_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
767
+
759 768
 		err := readDb.Model(&models.DoctorAdvice{}).
760 769
 			Where("patient_id = ? and user_org_id = ? and status = 1 and record_date = ? and (advice_type = 2 || advice_type = 3)", patientID, orgID, recordDate).
761 770
 			Select("id, user_org_id, patient_id, advice_type, advice_date, record_date, start_time, advice_name,advice_desc, reminder_date, drug_spec, drug_spec_unit, single_dose, single_dose_unit, prescribing_number, prescribing_number_unit, delivery_way, execution_frequency, advice_doctor, status, created_time,updated_time, advice_affirm, remark, stop_time, stop_reason, stop_doctor, stop_state, parent_id, execution_time, execution_staff, execution_state, checker, check_state, check_time, groupno,way,drug_id,is_medicine,drug_name_id, IF(parent_id > 0, parent_id, id) as advice_order").
@@ -2951,6 +2960,14 @@ func GetLastDialysisPrescriptionByPatientId(orgid int64, patientid int64, record
2951 2960
 	return &prescription, nil
2952 2961
 }
2953 2962
 
2963
+func GetLastDialysisPrescriptionByPatientIdTwo(orgid int64, patientid int64, recorddate int64) (models.DialysisPrescription, error) {
2964
+
2965
+	prescription := models.DialysisPrescription{}
2966
+	err := readDb.Model(&models.DialysisPrescription{}).Where("user_org_id = ? and patient_id = ? and record_date = ? and status = 1", orgid, patientid, recorddate).Find(&prescription).Error
2967
+
2968
+	return prescription, err
2969
+}
2970
+
2954 2971
 type HisMScheduleDoctorAdviceVM struct {
2955 2972
 	ID                     int64                            `gorm:"column:id" json:"id"`
2956 2973
 	UserOrgId              int64                            `gorm:"column:user_org_id" json:"user_org_id"`

+ 2 - 2
service/patient_service.go Visa fil

@@ -74,7 +74,7 @@ func GetPatientList(orgID int64, keywords string, page, limit, schedulType, bind
74 74
 //GetAllPatientList 返回全部患者的列表
75 75
 func GetAllPatientList(orgID int64) (patients []*models.Patients, total int64, err error) {
76 76
 
77
-	db := readDb.Table("xt_patients as p").Where("p.user_org_id=? and p.status=1 and p.lapseto = 1", orgID)
77
+	db := readDb.Table("xt_patients as p").Where("p.user_org_id=? and p.status=1", orgID)
78 78
 
79 79
 	err = db.Select(" p.id, p.user_org_id, p.user_id, p.patient_type, p.dialysis_no, p.admission_number, p.source, p.lapseto, p.partition_id, p.bed_id, p.name, p.alias, p.gender, p.marital_status, p.id_card_no, p.birthday, p.reimbursement_way_id, p.health_care_type, p.health_care_no, p.health_care_due_date, p.height, p.blood_type, p.rh, p.health_care_due_alert_date, p.education_level, p.profession, p.phone, p.home_telephone, p.relative_phone, p.relative_relations, p.home_address, p.work_unit, p.unit_address, p.children, p.receiving_date, p.is_hospital_first_dialysis, p.first_dialysis_date, p.first_dialysis_hospital, p.induction_period, p.initial_dialysis, p.total_dialysis, p.attending_doctor_id, p.head_nurse_id, p.evaluate, p.diagnose, p.remark, p.registrars_id, p.registrars, p.qr_code, p.binding_state, p.status, p.created_time, p.updated_time").Count(&total).Find(&patients).Error
80 80
 	return
@@ -572,7 +572,7 @@ func FindPatientWithDeviceByNo(orgID int64, no string, time int64) (patient mode
572 572
 		return db.Preload("DeviceNumber", "org_id = ?", orgID).
573 573
 			Preload("DeviceZone", "org_id = ?", orgID).
574 574
 			Where("user_org_id = ? AND schedule_date = ? ", orgID, time)
575
-	}).Preload("InfectiousDiseases", "status = 1").Where("user_org_id=? and dialysis_no = ? and status=1 and lapseto =1", orgID, no).First(&patient).Error
575
+	}).Preload("InfectiousDiseases", "status = 1").Where("user_org_id=? and dialysis_no = ? and status = 1", orgID, no).First(&patient).Error
576 576
 	return
577 577
 }
578 578