Browse Source

2024/6/17

28169 8 months ago
parent
commit
825a0fe049
2 changed files with 16 additions and 0 deletions
  1. 9 0
      controllers/patient_api_controller.go
  2. 7 0
      service/patient_service.go

+ 9 - 0
controllers/patient_api_controller.go View File

7691
 		service.UpdateScheduleItemByPatientId(patient_id)
7691
 		service.UpdateScheduleItemByPatientId(patient_id)
7692
 	}
7692
 	}
7693
 
7693
 
7694
+	if lapse_type == 11 {
7695
+
7696
+		service.UpdatePatientLasetoType(patient_id, lapse_type)
7697
+	}
7698
+
7694
 	//病人转出
7699
 	//病人转出
7695
 	if lapse_type == 1 {
7700
 	if lapse_type == 1 {
7696
 
7701
 
7879
 
7884
 
7880
 	}
7885
 	}
7881
 
7886
 
7887
+	if lapse_type == 11 {
7888
+		service.UpdatePatientLasetoType(patient_id, lapse_type)
7889
+	}
7890
+
7882
 	service.SavePatientLapseRecord(record)
7891
 	service.SavePatientLapseRecord(record)
7883
 
7892
 
7884
 	c.ServeSuccessJSON(map[string]interface{}{
7893
 	c.ServeSuccessJSON(map[string]interface{}{

+ 7 - 0
service/patient_service.go View File

2161
 	return err
2161
 	return err
2162
 }
2162
 }
2163
 
2163
 
2164
+func UpdatePatientLasetoType(patient_id int64, lapse_type int64) error {
2165
+
2166
+	err := XTWriteDB().Model(&models.Patients{}).Where("id = ? and status=1", patient_id).Updates(map[string]interface{}{"lapseto": 11}).Error
2167
+	err = XTWriteDB().Model(&models.XtPatientsNew{}).Where("id = ? and status=1", patient_id).Updates(map[string]interface{}{"lapseto": 11}).Error
2168
+	return err
2169
+}
2170
+
2164
 func UpdatePatientLapsetoByPatientIdTwo(patient_id int64, record_date int64) error {
2171
 func UpdatePatientLapsetoByPatientIdTwo(patient_id int64, record_date int64) error {
2165
 
2172
 
2166
 	err := XTWriteDB().Model(&models.Patients{}).Where("id = ? and status= 1", patient_id).Updates(map[string]interface{}{"death_time": record_date, "lapseto": 1}).Error
2173
 	err := XTWriteDB().Model(&models.Patients{}).Where("id = ? and status= 1", patient_id).Updates(map[string]interface{}{"death_time": record_date, "lapseto": 1}).Error