瀏覽代碼

宣教信息

XMLWAN 5 年之前
父節點
當前提交
273406020f

+ 7 - 8
controllers/mobile_api_controllers/mobile_api_base_controller.go 查看文件

4
 	"XT_New/controllers"
4
 	"XT_New/controllers"
5
 	"XT_New/enums"
5
 	"XT_New/enums"
6
 	"XT_New/models"
6
 	"XT_New/models"
7
-	"XT_New/service"
8
 	"fmt"
7
 	"fmt"
9
 )
8
 )
10
 
9
 
54
 		this.StopRun()
53
 		this.StopRun()
55
 	}
54
 	}
56
 
55
 
57
-	if this.Ctx.Request.Method != "GET" {
58
-		err := service.GetOrgSubscibeState(adminUserInfo.Subscibe)
59
-		if err != nil || adminUserInfo.Subscibe.State == 3 {
60
-			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotSubscibe)
61
-			this.StopRun()
62
-		}
63
-	}
56
+	//if this.Ctx.Request.Method != "GET" {
57
+	//	err := service.GetOrgSubscibeState(adminUserInfo.Subscibe)
58
+	//	if err != nil || adminUserInfo.Subscibe.State == 3 {
59
+	//		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotSubscibe)
60
+	//		this.StopRun()
61
+	//	}
62
+	//}
64
 }
63
 }

+ 36 - 6
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go 查看文件

187
 		ids = append(ids, id)
187
 		ids = append(ids, id)
188
 	}
188
 	}
189
 	fmt.Print("传染病2", contagions)
189
 	fmt.Print("传染病2", contagions)
190
+	is_infectious := int64(dataBody["is_infectious"].(float64))
191
+	fmt.Print("传染病", is_infectious)
190
 	adminssionNumber := dataBody["admissionNumber"].(string)
192
 	adminssionNumber := dataBody["admissionNumber"].(string)
191
 	fmt.Print("住院号", adminssionNumber)
193
 	fmt.Print("住院号", adminssionNumber)
194
+
192
 	fistdate := dataBody["fistDate"].(string)
195
 	fistdate := dataBody["fistDate"].(string)
193
 	fmt.Print("首次透析日期", fistdate)
196
 	fmt.Print("首次透析日期", fistdate)
194
-	times, err := utils.ParseTimeStringToTime(timeLayout, fistdate+"00:00:00")
197
+	timeLayouts := "2006-01-02"
198
+	loc, _ := time.LoadLocation("Local")
199
+	times, err := time.ParseInLocation(timeLayouts+" 15:04:05", fistdate+" 00:00:00", loc)
200
+	//times, err := utils.ParseTimeStringToTime(timeLayout, fistdate+"00:00:00")
195
 	fisttime := times.Unix()
201
 	fisttime := times.Unix()
196
 	fmt.Print(fisttime)
202
 	fmt.Print(fisttime)
203
+
197
 	diagonse := dataBody["diagnose"].(string)
204
 	diagonse := dataBody["diagnose"].(string)
198
 	fmt.Print("诊断", diagonse)
205
 	fmt.Print("诊断", diagonse)
199
 	avatar := dataBody["avatar"].(string)
206
 	avatar := dataBody["avatar"].(string)
225
 	//会员
232
 	//会员
226
 	memberFistDate := dataBody["memberFistDate"].(string)
233
 	memberFistDate := dataBody["memberFistDate"].(string)
227
 	fmt.Print("首次透析日期", memberFistDate)
234
 	fmt.Print("首次透析日期", memberFistDate)
228
-	membertimes, err := utils.ParseTimeStringToTime(timeLayout, memberFistDate+"00:00:00")
235
+	//membertimes, err := utils.ParseTimeStringToTime(timeLayout, memberFistDate+"00:00:00")
236
+	membertimes, _ := time.ParseInLocation(timeLayouts+" 15:04:05", memberFistDate+" 00:00:00", loc)
229
 	memtime := membertimes.Unix()
237
 	memtime := membertimes.Unix()
230
-	fmt.Print(memtime)
238
+	fmt.Print("会员透析日期", memtime)
231
 	patient_type := int64(dataBody["patientType"].(float64))
239
 	patient_type := int64(dataBody["patientType"].(float64))
232
 	fmt.Print("病种", patient_type)
240
 	fmt.Print("病种", patient_type)
233
 	treatmentmethod := int64(dataBody["treatmentMethod"].(float64))
241
 	treatmentmethod := int64(dataBody["treatmentMethod"].(float64))
254
 				CreatedTime:       time.Now().Unix(),
262
 				CreatedTime:       time.Now().Unix(),
255
 				Avatar:            avatar,
263
 				Avatar:            avatar,
256
 				IdCardNo:          idCard,
264
 				IdCardNo:          idCard,
265
+				IsInfectious:      is_infectious,
257
 			}
266
 			}
258
 			err := service.CreateOldPatient(&patients)
267
 			err := service.CreateOldPatient(&patients)
259
 			fmt.Print("报错", err)
268
 			fmt.Print("报错", err)
282
 				BloodPatients:     bloodPatient,
291
 				BloodPatients:     bloodPatient,
283
 				SlowPatients:      slowpatient,
292
 				SlowPatients:      slowpatient,
284
 				BloodId:           patient.ID,
293
 				BloodId:           patient.ID,
294
+				IsInfectious:      is_infectious,
295
+				IdCardNo:          idCard,
285
 			}
296
 			}
286
 			err = service.CreateNewPatient(&patientsNew)
297
 			err = service.CreateNewPatient(&patientsNew)
287
 			fmt.Print("报错", err)
298
 			fmt.Print("报错", err)
300
 		}
311
 		}
301
 	}
312
 	}
302
 
313
 
303
-	fmt.Print("slowpatient----------------", slowpatient)
314
+	fmt.Print("slowpatient", slowpatient)
304
 	//如果是慢病病人
315
 	//如果是慢病病人
305
 	if slowpatient == 1 {
316
 	if slowpatient == 1 {
306
 		_, errcodetwo := service.GetSlowPatientData(phone, orgid)
317
 		_, errcodetwo := service.GetSlowPatientData(phone, orgid)
349
 					BloodPatients:     bloodPatient,
360
 					BloodPatients:     bloodPatient,
350
 					SlowPatients:      slowpatient,
361
 					SlowPatients:      slowpatient,
351
 					SlowId:            slowPatient.ID,
362
 					SlowId:            slowPatient.ID,
363
+					IsInfectious:      is_infectious,
364
+					IdCardNo:          idCard,
365
+					EquitmentId:       requipmentId,
352
 				}
366
 				}
353
 				err = service.CreateNewPatient(&patientsNew)
367
 				err = service.CreateNewPatient(&patientsNew)
354
 				if err != nil {
368
 				if err != nil {
404
 								BloodPatients:     bloodPatient,
418
 								BloodPatients:     bloodPatient,
405
 								SlowPatients:      slowpatient,
419
 								SlowPatients:      slowpatient,
406
 								MemberId:          memberPatient.ID,
420
 								MemberId:          memberPatient.ID,
421
+								IsInfectious:      is_infectious,
422
+								IdCardNo:          idCard,
423
+								MemberFistdate:    memtime,
424
+								MemberPatienttype: patient_type,
425
+								MemberTreatement:  treatmentmethod,
407
 							}
426
 							}
408
 							err = service.CreateNewPatient(&patientsNew)
427
 							err = service.CreateNewPatient(&patientsNew)
409
 							fmt.Print("报错-----------------------", err)
428
 							fmt.Print("报错-----------------------", err)
485
 					BloodPatients:     bloodPatient,
504
 					BloodPatients:     bloodPatient,
486
 					SlowPatients:      slowpatient,
505
 					SlowPatients:      slowpatient,
487
 					MemberId:          memberPatient.ID,
506
 					MemberId:          memberPatient.ID,
507
+					IsInfectious:      is_infectious,
508
+					IdCardNo:          idCard,
509
+					MemberFistdate:    memtime,
510
+					MemberPatienttype: patient_type,
511
+					MemberTreatement:  treatmentmethod,
488
 				}
512
 				}
489
 				err = service.CreateNewPatient(&patientsNew)
513
 				err = service.CreateNewPatient(&patientsNew)
490
 				fmt.Print("报错-----------------------", err)
514
 				fmt.Print("报错-----------------------", err)
517
 	detail, err := service.GetPatientDetailTwo(id)
541
 	detail, err := service.GetPatientDetailTwo(id)
518
 	//获取传染病详情
542
 	//获取传染病详情
519
 	diseases := service.GetPatientDiseasesTwo(detail.BloodId)
543
 	diseases := service.GetPatientDiseasesTwo(detail.BloodId)
544
+	//获取慢病传染病
545
+	slowDiseases, err := service.GetSlowPatientDiseases(detail.SlowId)
546
+	//获取慢病慢性病
547
+	cronicDiseases, err := service.GetCronicDiseases(detail.SlowId)
520
 	//获取血透医嘱管理
548
 	//获取血透医嘱管理
521
 	if err != nil {
549
 	if err != nil {
522
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
550
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
523
 		return
551
 		return
524
 	}
552
 	}
525
 	this.ServeSuccessJSON(map[string]interface{}{
553
 	this.ServeSuccessJSON(map[string]interface{}{
526
-		"patientDetail": detail,
527
-		"diseases":      diseases,
554
+		"patientDetail":  detail,
555
+		"diseases":       diseases,
556
+		"slowDiseases":   slowDiseases,
557
+		"cronicDiseases": cronicDiseases,
528
 	})
558
 	})
529
 }
559
 }
530
 
560
 

+ 34 - 0
models/patient_models.go 查看文件

479
 	BloodId                      int64   `gorm:"column:blood_id" json:"blood_id" form:"blood_id"`
479
 	BloodId                      int64   `gorm:"column:blood_id" json:"blood_id" form:"blood_id"`
480
 	SlowId                       int64   `gorm:"column:slow_id" json:"slow_id" form:"slow_id"`
480
 	SlowId                       int64   `gorm:"column:slow_id" json:"slow_id" form:"slow_id"`
481
 	MemberId                     int64   `gorm:"column:member_id" json:"member_id" form:"member_id"`
481
 	MemberId                     int64   `gorm:"column:member_id" json:"member_id" form:"member_id"`
482
+	MemberFistdate               int64   `gorm:"column:member_fistdate" json:"member_fistdate" form:"member_fistdate"`
483
+	MemberPatienttype            int64   `gorm:"column:member_patienttype" json:"member_patienttype" form:"member_patienttype"`
484
+	MemberTreatement             int64   `gorm:"column:member_treatement" json:"member_treatement" form:"member_treatement"`
485
+	EquitmentId                  string  `gorm:"column:equitment_id" json:"equitment_id" form:"equitment_id"`
482
 }
486
 }
483
 
487
 
484
 func (XtPatientsNew) TableName() string {
488
 func (XtPatientsNew) TableName() string {
535
 	return "xt_patients"
539
 	return "xt_patients"
536
 }
540
 }
537
 
541
 
542
+type CdmPatientsInfectiousDiseases struct {
543
+	ID          int64 `gorm:"column:id" json:"id" form:"id"`
544
+	PatientId   int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
545
+	DiseaseId   int64 `gorm:"column:disease_id" json:"disease_id" form:"disease_id"`
546
+	Status      int64 `gorm:"column:status" json:"status" form:"status"`
547
+	CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
548
+	UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
549
+	UserOrgId   int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
550
+}
551
+
552
+func (CdmPatientsInfectiousDiseases) TableName() string {
553
+
554
+	return "xt_patients_infectious_diseases"
555
+}
556
+
557
+type CdmPatientsChronicDiseases struct {
558
+	ID          int64 `gorm:"column:id" json:"id" form:"id"`
559
+	PatientId   int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
560
+	DiseaseId   int64 `gorm:"column:disease_id" json:"disease_id" form:"disease_id"`
561
+	Status      int64 `gorm:"column:status" json:"status" form:"status"`
562
+	CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
563
+	UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
564
+	UserOrgId   int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
565
+}
566
+
567
+func (CdmPatientsChronicDiseases) TableName() string {
568
+
569
+	return "xt_patients_chronic_diseases"
570
+}
571
+
538
 type SgjUserCustomer struct {
572
 type SgjUserCustomer struct {
539
 	ID              int64  `gorm:"column:id" json:"id" form:"id"`
573
 	ID              int64  `gorm:"column:id" json:"id" form:"id"`
540
 	UserOrgId       int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
574
 	UserOrgId       int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`

+ 31 - 0
service/patientmanage_service.go 查看文件

249
 	return ids
249
 	return ids
250
 }
250
 }
251
 
251
 
252
+func GetSlowPatientDiseases(id int64) (infeciousdisease []*models.CdmPatientsInfectiousDiseases, err error) {
253
+	//var dis  []models.CdmPatientsInfectiousDiseases
254
+	//diseases := models.CdmPatientsChronicDiseases{}
255
+	//ids := make([]int64, 0)
256
+	//err := PatientReadDB().Model(&diseases).Where("patient_id = ? and status =1", id).Find(&ids).Error
257
+	//if err != nil || len(dis) == 0 {
258
+	//  return ids
259
+	//}
260
+	//for _, item := range dis {
261
+	//  ids = append(ids, item.DiseaseId)
262
+	//}
263
+	//return ids
264
+	err = PatientReadDB().Model(&infeciousdisease).Where("patient_id = ? and status =1", id).Find(&infeciousdisease).Error
265
+	return infeciousdisease, err
266
+}
267
+
268
+func GetCronicDiseases(id int64) (chronic []*models.CdmPatientsChronicDiseases, err error) {
269
+	//var dis  []models.CdmPatientsChronicDiseases
270
+	//ids := make([]int64, 0)
271
+	//err := PatientReadDB().Model(&models.CdmPatientsChronicDiseases{}).Where("patient_id = ? and status =1", id).Find(&ids).Error
272
+	//if err != nil || len(dis) == 0 {
273
+	//  return ids
274
+	//}
275
+	//for _, item := range dis {
276
+	//  ids = append(ids, item.DiseaseId)
277
+	//}
278
+	//return ids
279
+	err = PatientReadDB().Model(&chronic).Where("patient_id = ? and status =1", id).Find(&chronic).Error
280
+	return chronic, err
281
+}
282
+
252
 func CreatePatientTwo(patient *models.Patients, contagions []int64, diseases []int64) (err error) {
283
 func CreatePatientTwo(patient *models.Patients, contagions []int64, diseases []int64) (err error) {
253
 
284
 
254
 	user, _ := GetSgjUserByMobild(patient.Phone)
285
 	user, _ := GetSgjUserByMobild(patient.Phone)