Browse Source

耗材参数

XMLWAN 4 years ago
parent
commit
bde3de34e5

+ 17 - 0
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go View File

@@ -1325,6 +1325,15 @@ func (this *NewDialysisApiController) UpdatedPatient() {
1325 1325
 	treatmentmethod := int64(dataBody["treatmentMethod"].(float64))
1326 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 1338
 	if bloodPatient == 1 {
1330 1339
 		//根据新表ID获取老表病人ID
@@ -1376,6 +1385,8 @@ func (this *NewDialysisApiController) UpdatedPatient() {
1376 1385
 			IdCardNo:          idCard,
1377 1386
 			IsInfectious:      is_infectious,
1378 1387
 			Lapseto:           lapseto,
1388
+			DeathTime:         death_time,
1389
+			OutReason:         out_reason,
1379 1390
 		}
1380 1391
 		err = service.UpdatedPatient(patients, patient.BloodId)
1381 1392
 		//patientLapseto := models.PatientLapseto{
@@ -1404,6 +1415,8 @@ func (this *NewDialysisApiController) UpdatedPatient() {
1404 1415
 			IdCardNo:          idCard,
1405 1416
 			IsInfectious:      is_infectious,
1406 1417
 			Lapseto:           lapseto,
1418
+			OutReason:         out_reason,
1419
+			DeathTime:         death_time,
1407 1420
 		}
1408 1421
 		err = service.UpdateXtPatientNew(patientsNew, id)
1409 1422
 		if err != nil {
@@ -1459,6 +1472,8 @@ func (this *NewDialysisApiController) UpdatedPatient() {
1459 1472
 			IsInfectious:      is_infectious,
1460 1473
 			IdCardNo:          idCard,
1461 1474
 			EquitmentId:       requipmentId,
1475
+			OutReason:         out_reason,
1476
+			DeathTime:         death_time,
1462 1477
 		}
1463 1478
 		err = service.UpdateXtPatientNew(xtPatientsNew, id)
1464 1479
 		fmt.Print("更新失败", err)
@@ -1513,6 +1528,8 @@ func (this *NewDialysisApiController) UpdatedPatient() {
1513 1528
 			MemberFistdate:    memtime,
1514 1529
 			MemberPatienttype: patient_type,
1515 1530
 			MemberTreatement:  treatmentmethod,
1531
+			OutReason:         out_reason,
1532
+			DeathTime:         death_time,
1516 1533
 		}
1517 1534
 		err = service.UpdateXtPatientNewOne(patientsNew, id)
1518 1535
 		if err != nil {

+ 2 - 0
models/patient_models.go View File

@@ -544,6 +544,8 @@ type XtPatientsNew struct {
544 544
 	UserSysBeforeCount           int64   `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
545 545
 	IsExcelExport                int64   `gorm:"column:is_excel_export" json:"is_excel_export" form:"is_excel_export"`
546 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 551
 func (XtPatientsNew) TableName() string {

+ 2 - 2
service/patientmanage_service.go View File

@@ -940,14 +940,14 @@ func GetNewPatient(id int64) (models.XtPatientsNew, error) {
940 940
 
941 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 945
 	return err
946 946
 }
947 947
 
948 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 952
 	return err
953 953
 }