XMLWAN vor 4 Jahren
Ursprung
Commit
bde3de34e5

+ 17 - 0
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go Datei anzeigen

1325
 	treatmentmethod := int64(dataBody["treatmentMethod"].(float64))
1325
 	treatmentmethod := int64(dataBody["treatmentMethod"].(float64))
1326
 	fmt.Print("治疗方式", treatmentmethod)
1326
 	fmt.Print("治疗方式", treatmentmethod)
1327
 
1327
 
1328
+	deathtime := dataBody["death_time"].(string)
1329
+	fmt.Print("首次透析日期", deathtime)
1330
+	deathtimes, err := time.ParseInLocation(timeLayouts+" 15:04:05", deathtime+" 00:00:00", loc)
1331
+	//times, err := utils.ParseTimeStringToTime(timeLayout, fistdate+"00:00:00")
1332
+	death_time := deathtimes.Unix()
1333
+
1334
+	out_reason := dataBody["out_reason"].(string)
1335
+
1336
+	fmt.Print(fisttime)
1328
 	//如果是血透病人
1337
 	//如果是血透病人
1329
 	if bloodPatient == 1 {
1338
 	if bloodPatient == 1 {
1330
 		//根据新表ID获取老表病人ID
1339
 		//根据新表ID获取老表病人ID
1376
 			IdCardNo:          idCard,
1385
 			IdCardNo:          idCard,
1377
 			IsInfectious:      is_infectious,
1386
 			IsInfectious:      is_infectious,
1378
 			Lapseto:           lapseto,
1387
 			Lapseto:           lapseto,
1388
+			DeathTime:         death_time,
1389
+			OutReason:         out_reason,
1379
 		}
1390
 		}
1380
 		err = service.UpdatedPatient(patients, patient.BloodId)
1391
 		err = service.UpdatedPatient(patients, patient.BloodId)
1381
 		//patientLapseto := models.PatientLapseto{
1392
 		//patientLapseto := models.PatientLapseto{
1404
 			IdCardNo:          idCard,
1415
 			IdCardNo:          idCard,
1405
 			IsInfectious:      is_infectious,
1416
 			IsInfectious:      is_infectious,
1406
 			Lapseto:           lapseto,
1417
 			Lapseto:           lapseto,
1418
+			OutReason:         out_reason,
1419
+			DeathTime:         death_time,
1407
 		}
1420
 		}
1408
 		err = service.UpdateXtPatientNew(patientsNew, id)
1421
 		err = service.UpdateXtPatientNew(patientsNew, id)
1409
 		if err != nil {
1422
 		if err != nil {
1459
 			IsInfectious:      is_infectious,
1472
 			IsInfectious:      is_infectious,
1460
 			IdCardNo:          idCard,
1473
 			IdCardNo:          idCard,
1461
 			EquitmentId:       requipmentId,
1474
 			EquitmentId:       requipmentId,
1475
+			OutReason:         out_reason,
1476
+			DeathTime:         death_time,
1462
 		}
1477
 		}
1463
 		err = service.UpdateXtPatientNew(xtPatientsNew, id)
1478
 		err = service.UpdateXtPatientNew(xtPatientsNew, id)
1464
 		fmt.Print("更新失败", err)
1479
 		fmt.Print("更新失败", err)
1513
 			MemberFistdate:    memtime,
1528
 			MemberFistdate:    memtime,
1514
 			MemberPatienttype: patient_type,
1529
 			MemberPatienttype: patient_type,
1515
 			MemberTreatement:  treatmentmethod,
1530
 			MemberTreatement:  treatmentmethod,
1531
+			OutReason:         out_reason,
1532
+			DeathTime:         death_time,
1516
 		}
1533
 		}
1517
 		err = service.UpdateXtPatientNewOne(patientsNew, id)
1534
 		err = service.UpdateXtPatientNewOne(patientsNew, id)
1518
 		if err != nil {
1535
 		if err != nil {

+ 2 - 0
models/patient_models.go Datei anzeigen

544
 	UserSysBeforeCount           int64   `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
544
 	UserSysBeforeCount           int64   `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
545
 	IsExcelExport                int64   `gorm:"column:is_excel_export" json:"is_excel_export" form:"is_excel_export"`
545
 	IsExcelExport                int64   `gorm:"column:is_excel_export" json:"is_excel_export" form:"is_excel_export"`
546
 	SchRemark                    string  `gorm:"column:sch_remark" json:"sch_remark" form:"sch_remark"`
546
 	SchRemark                    string  `gorm:"column:sch_remark" json:"sch_remark" form:"sch_remark"`
547
+	OutReason                    string  `gorm:"column:out_reason" json:"out_reason" form:"out_reason"`
548
+	DeathTime                    int64   `gorm:"column:death_time" json:"death_time" form:"death_time"`
547
 }
549
 }
548
 
550
 
549
 func (XtPatientsNew) TableName() string {
551
 func (XtPatientsNew) TableName() string {

+ 2 - 2
service/patientmanage_service.go Datei anzeigen

940
 
940
 
941
 func UpdatedPatient(patients models.Patients, id int64) error {
941
 func UpdatedPatient(patients models.Patients, id int64) error {
942
 
942
 
943
-	err := XTWriteDB().Model(&patients).Where("id=?", id).Update(map[string]interface{}{"name": patients.Name, "gender": patients.Gender, "birthday": patients.Birthday, "age": patients.Age, "phone": patients.Phone, "lapseto": patients.Lapseto, "admission_number": patients.AdmissionNumber, "first_dialysis_date": patients.FirstDialysisDate, "diagnose": patients.Diagnose, "source": patients.Source, "dialysis_no": patients.DialysisNo, "avatar": patients.Avatar, "id_card_no": patients.IdCardNo, "is_infectious": patients.IsInfectious}).Error
943
+	err := XTWriteDB().Model(&patients).Where("id=?", id).Update(map[string]interface{}{"name": patients.Name, "gender": patients.Gender, "birthday": patients.Birthday, "age": patients.Age, "phone": patients.Phone, "lapseto": patients.Lapseto, "admission_number": patients.AdmissionNumber, "first_dialysis_date": patients.FirstDialysisDate, "diagnose": patients.Diagnose, "source": patients.Source, "dialysis_no": patients.DialysisNo, "avatar": patients.Avatar, "id_card_no": patients.IdCardNo, "is_infectious": patients.IsInfectious, "out_reason": patients.OutReason, "death_time": patients.DeathTime}).Error
944
 
944
 
945
 	return err
945
 	return err
946
 }
946
 }
947
 
947
 
948
 func UpdateXtPatientNew(patients models.XtPatientsNew, id int64) error {
948
 func UpdateXtPatientNew(patients models.XtPatientsNew, id int64) error {
949
 
949
 
950
-	err := XTWriteDB().Model(&patients).Where("id=?", id).Update(map[string]interface{}{"name": patients.Name, "gender": patients.Gender, "birthday": patients.Birthday, "age": patients.Age, "phone": patients.Phone, "lapseto": patients.Lapseto, "admission_number": patients.AdmissionNumber, "first_dialysis_date": patients.FirstDialysisDate, "diagnose": patients.Diagnose, "source": patients.Source, "dialysis_no": patients.DialysisNo, "avatar": patients.Avatar, "id_card_no": patients.IdCardNo, "is_infectious": patients.IsInfectious}).Error
950
+	err := XTWriteDB().Model(&patients).Where("id=?", id).Update(map[string]interface{}{"name": patients.Name, "gender": patients.Gender, "birthday": patients.Birthday, "age": patients.Age, "phone": patients.Phone, "lapseto": patients.Lapseto, "admission_number": patients.AdmissionNumber, "first_dialysis_date": patients.FirstDialysisDate, "diagnose": patients.Diagnose, "source": patients.Source, "dialysis_no": patients.DialysisNo, "avatar": patients.Avatar, "id_card_no": patients.IdCardNo, "is_infectious": patients.IsInfectious, "out_reason": patients.OutReason, "death_time": patients.DeathTime}).Error
951
 
951
 
952
 	return err
952
 	return err
953
 }
953
 }