Browse Source

历史排班

28169 9 months ago
parent
commit
94b3171617

BIN
XT_New.exe View File


+ 4 - 4
controllers/base_api_controller.go View File

@@ -83,7 +83,7 @@ func (this *BaseAuthAPIController) Prepare() {
83 83
 		userAdmin.ModifyTime = 1530786071
84 84
 		var subscibe models.ServeSubscibe
85 85
 		subscibe.ID = 11
86
-		subscibe.OrgId = 10633 //机构id
86
+		subscibe.OrgId = 10340 //机构id
87 87
 		subscibe.PeriodStart = 1547447814
88 88
 		subscibe.PeriodEnd = 1550039814
89 89
 		subscibe.State = 1
@@ -93,7 +93,7 @@ func (this *BaseAuthAPIController) Prepare() {
93 93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
94 94
 		subscibes[4] = &subscibe
95 95
 		var adminUserInfo service.AdminUserInfo
96
-		adminUserInfo.CurrentOrgId = 10633 //机构id小英9675或4
96
+		adminUserInfo.CurrentOrgId = 10340 //机构id小英9675或4
97 97
 		adminUserInfo.CurrentAppId = 14    //4
98 98
 		adminUserInfo.AdminUser = &userAdmin
99 99
 		adminUserInfo.Subscibes = subscibes
@@ -329,7 +329,7 @@ func (this *BaseServeAPIController) Prepare() {
329 329
 		userAdmin.ModifyTime = 1530786071
330 330
 		var subscibe models.ServeSubscibe
331 331
 		subscibe.ID = 11
332
-		subscibe.OrgId = 10633 //机构id小英9675或4
332
+		subscibe.OrgId = 10340 //机构id小英9675或4
333 333
 		subscibe.PeriodStart = 1538035409
334 334
 		subscibe.PeriodEnd = 1569571409
335 335
 		subscibe.State = 1
@@ -339,7 +339,7 @@ func (this *BaseServeAPIController) Prepare() {
339 339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
340 340
 		subscibes[4] = &subscibe
341 341
 		var adminUserInfo service.AdminUserInfo
342
-		adminUserInfo.CurrentOrgId = 10633 //机构id小英9675或4
342
+		adminUserInfo.CurrentOrgId = 10340 //机构id小英9675或4
343 343
 		adminUserInfo.CurrentAppId = 14    //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes

+ 1 - 1
controllers/new_mobile_api_controllers/staff_schedule_api_controller.go View File

@@ -429,7 +429,7 @@ func (this *StaffScheduleApiController) GetAllZonePb() {
429 429
 	}
430 430
 
431 431
 	//查询排班里面的空透析器
432
-	if orgid == 10375 || orgid == 10510 || orgid == 9538 || orgid == 10610 {
432
+	if orgid == 10375 || orgid == 10510 || orgid == 9538 || orgid == 10610 || orgid == 10679 {
433 433
 
434 434
 		schedulesFive, _ := service.GetMobileScheduleListByScheduleDateOne(orgid, startTime)
435 435
 

+ 12 - 12
controllers/sign_api_controller.go View File

@@ -1223,7 +1223,7 @@ func (this *SignApiController) ToAutoDrug() {
1223 1223
 
1224 1224
 func (this *SignApiController) ToAutoDiagnose() {
1225 1225
 
1226
-	//orgId := this.GetAdminUserInfo().CurrentOrgId
1226
+	orgId := this.GetAdminUserInfo().CurrentOrgId
1227 1227
 
1228 1228
 	//order, _ := service.GetDialysisOrderTotalCount()
1229 1229
 	//
@@ -1238,19 +1238,19 @@ func (this *SignApiController) ToAutoDiagnose() {
1238 1238
 	//	service.UpdateAllPatient(item.BloodId, item.Diagnose, item.UserOrgId)
1239 1239
 	//}
1240 1240
 
1241
-	//list, _ := service.GetAllDialysisOrder(10469)
1242
-	//for _, item := range list {
1243
-	//	schedule, _ := service.GetLastScheduleByUserOrg(item.PatientId, item.DialysisDate, orgId, item.BedId, item.ZoneId, item.SchedualType)
1244
-	//	service.UpdateScheduleByOrder(item.PatientId, item.DialysisDate, orgId, item.BedId, item.ZoneId, item.SchedualType, schedule.ID)
1245
-	//}
1246
-
1247
-	drugList, _ := service.GetAllBaseDrugList(10318)
1248
-	for _, item := range drugList {
1249
-		service.UpdateDrugWarehouseInfoByDrug(item.ID, item.MinPrice, item.OrgId)
1250
-
1251
-		//service.UpdateHisDoctorAdviceOne(item.ID, item.MinPrice, item.OrgId)
1241
+	list, _ := service.GetAllDialysisOrder(14749)
1242
+	for _, item := range list {
1243
+		schedule, _ := service.GetLastScheduleByUserOrg(item.PatientId, item.DialysisDate, orgId, item.BedId, item.ZoneId, item.SchedualType)
1244
+		service.UpdateScheduleByOrder(item.PatientId, item.DialysisDate, orgId, item.BedId, item.ZoneId, item.SchedualType, schedule.ID)
1252 1245
 	}
1253 1246
 
1247
+	//drugList, _ := service.GetAllBaseDrugList(10318)
1248
+	//for _, item := range drugList {
1249
+	//	service.UpdateDrugWarehouseInfoByDrug(item.ID, item.MinPrice, item.OrgId)
1250
+	//
1251
+	//	//service.UpdateHisDoctorAdviceOne(item.ID, item.MinPrice, item.OrgId)
1252
+	//}
1253
+
1254 1254
 	//goodList, _ := service.GetAllGoodList(10571)
1255 1255
 	//for _, item := range goodList {
1256 1256
 	//	service.UpdasteGoodWarehouseInfoByGood(item.ID, item.PackingPrice, item.OrgId)

+ 2 - 0
models/patient_models.go View File

@@ -26,6 +26,7 @@ type MSchedualPatientList struct {
26 26
 	SchRemark          string `gorm:"column:sch_remark" json:"sch_remark" form:"sch_remark"`
27 27
 	ScheduleRemark     string `gorm:"column:schedule_remark" json:"schedule_remark" form:"schedule_remark"`
28 28
 	FirstLetter        string `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
29
+	IsInfectious       int64  `gorm:"column:is_infectious" json:"is_infectious" form:"is_infectious"`
29 30
 }
30 31
 
31 32
 func (MSchedualPatientList) TableName() string {
@@ -673,6 +674,7 @@ type PatientDialysisRecord struct {
673 674
 	TreatmentSummary        TreatmentSummary        `json:"treatment_summary" gorm:"foreignkey:AssessmentDate;AssociationForeignKey:DialysisDate;"`
674 675
 	Device                  DeviceNumber            `json:"device" gorm:"foreignkey:ID;AssociationForeignKey:BedID;"`
675 676
 	MonitoringRecord        []MonitoringRecord      `json:"monitoring_record" gorm:"foreignkey:MonitoringDate;AssociationForeignKey:DialysisDate;"`
677
+	DoctorAdvice            []DoctorAdvice          `json:"doctor_advice" gorm:"foreignkey:AdviceDate;AssociationForeignKey:DialysisDate;"`
676 678
 }
677 679
 
678 680
 type DialysisPrescriptionAddtional struct {

+ 3 - 2
service/patient_service.go View File

@@ -103,7 +103,7 @@ func GetAllPatientList(orgID int64) (patients []*models.Patients, total int64, e
103 103
 
104 104
 	db := readDb.Table("xt_patients as p").Where("p.user_org_id=? and p.status=1", orgID)
105 105
 
106
-	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
106
+	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,p.age,p.id_card_no").Count(&total).Find(&patients).Error
107 107
 	return
108 108
 }
109 109
 
@@ -1535,6 +1535,7 @@ func GetPatientDialysisRecord(orgID, patientID int64, page, limit, start, end, m
1535 1535
 	// Where("do.patient_id=? and do.user_org_id=? and do.stage = 2 and do.status=1", patientID, orgID).Count(&total).Offset(offset).Limit(limit).Order("do.dialysis_date desc").Select(" do.id, do.dialysis_date, do.user_org_id, do.patient_id, do.prescription_id, do.stage, do.remark, do.status, do.created_time, do.updated_time, s.schedule_type, s.partition_id, dz.name as partition_name").Find(&orders).Error
1536 1536
 
1537 1537
 	db := readDb.Table("xt_dialysis_order as do").
1538
+		Preload("DoctorAdvice", "patient_id =? and user_org_id = ? and status =1", patientID, orgID).
1538 1539
 		Preload("DialysisPrescription", "patient_id=? and user_org_id=? and status=1", patientID, orgID).
1539 1540
 		Preload("PredialysisEvaluation", "patient_id=? and user_org_id=? and status=1", patientID, orgID).
1540 1541
 		Preload("DialysisPrescription", func(db *gorm.DB) *gorm.DB {
@@ -1563,7 +1564,7 @@ func GetPatientDialysisRecord(orgID, patientID int64, page, limit, start, end, m
1563 1564
 		db = db.Where("dp.mode_id=?", mode_id)
1564 1565
 	}
1565 1566
 
1566
-	err = db.Count(&total).Offset(offset).Limit(limit).Order("do.dialysis_date desc").Select("do.bed_id, do.id, do.dialysis_date, do.user_org_id, do.patient_id, do.prescription_id, do.stage, do.remark, do.status, do.created_time, do.updated_time,do.start_nurse,do.finish_nurse ,s.schedule_type, s.partition_id, dz.name as partition_name").Find(&orders).Error
1567
+	err = db.Count(&total).Offset(offset).Limit(limit).Order("do.dialysis_date desc").Select("do.bed_id, do.id, do.dialysis_date, do.user_org_id, do.patient_id, do.prescription_id, do.stage, do.remark, do.status, do.created_time, do.updated_time,do.start_nurse,do.finish_nurse ,do.start_time,do.end_time,do.url,s.schedule_type, s.partition_id, dz.name as partition_name").Find(&orders).Error
1567 1568
 
1568 1569
 	if len(orders) > 0 {
1569 1570
 		ids := make([]int64, 0)

+ 1 - 1
service/sign_service.go View File

@@ -2112,7 +2112,7 @@ func UpdateAllPatient(id int64, diagose string, orgid int64) error {
2112 2112
 
2113 2113
 func GetAllDialysisOrder(user_org_id int64) (list []*models.XtDialysisOrder, err error) {
2114 2114
 
2115
-	err = XTReadDB().Where("patient_id = ? and status =1", 28449).Find(&list).Error
2115
+	err = XTReadDB().Where("patient_id = ? and status =1", 14749).Find(&list).Error
2116 2116
 
2117 2117
 	return list, err
2118 2118
 }