瀏覽代碼

库存流水展示

XMLWAN 2 年之前
父節點
當前提交
130bf048e0

+ 1 - 1
controllers/data_api_controller.go 查看文件

@@ -400,7 +400,7 @@ func configFormData(dataconfig *models.Dataconfig, data []byte) (code int) {
400 400
 	}
401 401
 	dataconfig.Module = module
402 402
 
403
-	if module == "education" || module == "summary" || module == "course_disease" || module == "rescue_record" || module == "nursing_record" || module == "special_record" || module == "special_treatment" || module == "template_summary" || module == "template_plan" || module == "admitting_diagnosis" || module == "discharge_diagnosis" || module == "diagnosis_admission" || module == "treatment" || module == "illness_discharge" || module == "discharge_advice" || module == "dialysis_remark" || module == "catheter_operation" {
403
+	if module == "education" || module == "summary" || module == "course_disease" || module == "rescue_record" || module == "nursing_record" || module == "special_record" || module == "special_treatment" || module == "template_summary" || module == "template_plan" || module == "admitting_diagnosis" || module == "discharge_diagnosis" || module == "diagnosis_admission" || module == "treatment" || module == "illness_discharge" || module == "discharge_advice" || module == "dialysis_remark" || module == "catheter_operation" || module == "main_content" || module == "patient_case" || module == "tentative_diagnosis" || module == "diagnostic_basis" || module == "differential_diagnosis" || module == "treatment_plan" {
404 404
 		if configBody["title"] == nil || reflect.TypeOf(configBody["title"]).String() != "string" {
405 405
 			utils.ErrorLog("title")
406 406
 			code = enums.ErrorCodeParamWrong

+ 2 - 2
controllers/dialysis_api_controller.go 查看文件

@@ -4144,7 +4144,7 @@ func (this *DialysisApiController) GetTodayMonitor() {
4144 4144
 			}
4145 4145
 
4146 4146
 			//长沙南雅
4147
-			if adminInfo.CurrentOrgId == 10395 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10340 || adminInfo.CurrentOrgId == 10432 || adminInfo.CurrentOrgId == 10441 || adminInfo.CurrentOrgId == 10445 || adminInfo.CurrentOrgId == 9829 || adminInfo.CurrentOrgId == 10440 {
4147
+			if adminInfo.CurrentOrgId == 10395 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10340 || adminInfo.CurrentOrgId == 10432 || adminInfo.CurrentOrgId == 10441 || adminInfo.CurrentOrgId == 10445 || adminInfo.CurrentOrgId == 9829 || adminInfo.CurrentOrgId == 10440 || adminInfo.CurrentOrgId == 10469 {
4148 4148
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 60 / 1000 / float64(totalMin) * 1000)
4149 4149
 
4150 4150
 				record.UltrafiltrationRate = ultrafiltration_rate
@@ -4173,7 +4173,7 @@ func (this *DialysisApiController) GetTodayMonitor() {
4173 4173
 	}
4174 4174
 
4175 4175
 	//长沙南雅
4176
-	if adminInfo.CurrentOrgId == 10395 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10432 || adminInfo.CurrentOrgId == 10441 || adminInfo.CurrentOrgId == 10445 {
4176
+	if adminInfo.CurrentOrgId == 10395 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10432 || adminInfo.CurrentOrgId == 10441 || adminInfo.CurrentOrgId == 10445 || adminInfo.CurrentOrgId == 10469 {
4177 4177
 
4178 4178
 		if ultrafiltration_rate > 0 {
4179 4179
 			ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)

+ 1 - 1
controllers/dialysis_record_api_controller.go 查看文件

@@ -1124,7 +1124,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1124 1124
 				}
1125 1125
 
1126 1126
 				//针对肇庆三鹤血液透析中心
1127
-				if adminUserInfo.CurrentOrgId == 10215 || template.TemplateId == 43 || adminUserInfo.CurrentOrgId == 10441 || adminUserInfo.CurrentOrgId == 10445 {
1127
+				if adminUserInfo.CurrentOrgId == 10215 || template.TemplateId == 43 || adminUserInfo.CurrentOrgId == 10441 || adminUserInfo.CurrentOrgId == 10445 || adminUserInfo.CurrentOrgId == 10469 {
1128 1128
 
1129 1129
 					if evaluation.ID > 0 {
1130 1130
 						ultrafiltration_rate = math.Ceil(prescription.TargetUltrafiltration / float64(totalMin) * 60)

+ 150 - 0
controllers/doctors_api_controller.go 查看文件

@@ -60,6 +60,11 @@ func DoctorApiRegistRouters() {
60 60
 	beego.Router("/api/patient/updatehospitalsummary", &DoctorsApiController{}, "Post:UpdateHospitalSummary")
61 61
 	beego.Router("/api/patient/deletehospitalsummary", &DoctorsApiController{}, "Get:DeleteHospitalSummary")
62 62
 	beego.Router("/api/patient/getpatientinfo", &DoctorsApiController{}, "Get:GetPatientInfo")
63
+	beego.Router("/api/patient/createfirstdisease", &DoctorsApiController{}, "Post:CreateFirstDisease")
64
+	beego.Router("/api/patient/getfirstdiseaselist", &DoctorsApiController{}, "Get:GetFirstDiseaseList")
65
+	beego.Router("/api/patient/getfirstdetailbyid", &DoctorsApiController{}, "Get:GetFirstDetailById")
66
+	beego.Router("/api/patient/updatefirstdisease", &DoctorsApiController{}, "Post:UpdateFirstDisease")
67
+	beego.Router("/api/patient/deletefirstdisease", &DoctorsApiController{}, "Get:DeleteFirstDisease")
63 68
 }
64 69
 
65 70
 func (c *DoctorsApiController) ScheduleAdvices() {
@@ -1455,3 +1460,148 @@ func (c *DoctorsApiController) GetScheduleAdvicesList() {
1455 1460
 	}
1456 1461
 
1457 1462
 }
1463
+
1464
+func (c *DoctorsApiController) CreateFirstDisease() {
1465
+
1466
+	timeLayout := "2006-01-02"
1467
+	loc, _ := time.LoadLocation("Local")
1468
+	dataBody := make(map[string]interface{}, 0)
1469
+	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
1470
+	fmt.Print("err", err)
1471
+
1472
+	doctor := int64(dataBody["doctor"].(float64))
1473
+	record_date := dataBody["record_date"].(string)
1474
+	recordDates, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
1475
+	recordtime := recordDates.Unix()
1476
+	patient_id := int64(dataBody["patient_id"].(float64))
1477
+	title := dataBody["title"].(string)
1478
+	main_content := dataBody["main_content"].(string)
1479
+	patient_case := dataBody["patient_case"].(string)
1480
+	tentative_diagnosis := dataBody["tentative_diagnosis"].(string)
1481
+	diagnostic_basis := dataBody["diagnostic_basis"].(string)
1482
+	differential_diagnosis := dataBody["differential_diagnosis"].(string)
1483
+	treatment_plan := dataBody["treatment_plan"].(string)
1484
+
1485
+	orgId := c.GetAdminUserInfo().CurrentOrgId
1486
+	firstdisease := models.XtPatientFirstDisease{
1487
+		Title:                 title,
1488
+		RecordDate:            recordtime,
1489
+		Doctor:                doctor,
1490
+		MainContent:           main_content,
1491
+		PatientCase:           patient_case,
1492
+		TentativeDiagnosis:    tentative_diagnosis,
1493
+		DiagnosticBasis:       diagnostic_basis,
1494
+		DifferentialDiagnosis: differential_diagnosis,
1495
+		TreatmentPlan:         treatment_plan,
1496
+		UserOrgId:             orgId,
1497
+		PatientId:             patient_id,
1498
+		Ctime:                 time.Now().Unix(),
1499
+		Mtime:                 0,
1500
+		Status:                1,
1501
+	}
1502
+
1503
+	error := service.CreatePatientFirstDisease(firstdisease)
1504
+	fmt.Println("err-------", error)
1505
+	if error == nil {
1506
+		c.ServeSuccessJSON(map[string]interface{}{
1507
+			"firstDisease": firstdisease,
1508
+		})
1509
+	}
1510
+}
1511
+
1512
+func (c *DoctorsApiController) GetFirstDiseaseList() {
1513
+
1514
+	timeLayout := "2006-01-02"
1515
+	loc, _ := time.LoadLocation("Local")
1516
+	orgId := c.GetAdminUserInfo().CurrentOrgId
1517
+	patient_id, _ := c.GetInt64("patient_id")
1518
+	start_time := c.GetString("start_time")
1519
+
1520
+	dischargeTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
1521
+	startime := dischargeTimes.Unix()
1522
+
1523
+	end_time := c.GetString("end_time")
1524
+	endTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 00:00:00", loc)
1525
+	endtime := endTimes.Unix()
1526
+	list, err := service.GetPatientDiseaseList(orgId, patient_id, startime, endtime)
1527
+	if err == nil {
1528
+		c.ServeSuccessJSON(map[string]interface{}{
1529
+			"list": list,
1530
+		})
1531
+		return
1532
+	}
1533
+}
1534
+
1535
+func (c *DoctorsApiController) GetFirstDetailById() {
1536
+
1537
+	id, _ := c.GetInt64("id")
1538
+	list, err := service.GetFirstDetailById(id)
1539
+	if err == nil {
1540
+		c.ServeSuccessJSON(map[string]interface{}{
1541
+			"detail": list,
1542
+		})
1543
+		return
1544
+	}
1545
+}
1546
+
1547
+func (c *DoctorsApiController) UpdateFirstDisease() {
1548
+
1549
+	timeLayout := "2006-01-02"
1550
+	loc, _ := time.LoadLocation("Local")
1551
+	dataBody := make(map[string]interface{}, 0)
1552
+	err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
1553
+	fmt.Print("err", err)
1554
+	id := int64(dataBody["id"].(float64))
1555
+	doctor := int64(dataBody["doctor"].(float64))
1556
+	record_date := dataBody["record_date"].(string)
1557
+	recordDates, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
1558
+	recordtime := recordDates.Unix()
1559
+	patient_id := int64(dataBody["patient_id"].(float64))
1560
+	title := dataBody["title"].(string)
1561
+	main_content := dataBody["main_content"].(string)
1562
+	patient_case := dataBody["patient_case"].(string)
1563
+	tentative_diagnosis := dataBody["tentative_diagnosis"].(string)
1564
+	diagnostic_basis := dataBody["diagnostic_basis"].(string)
1565
+	differential_diagnosis := dataBody["differential_diagnosis"].(string)
1566
+	treatment_plan := dataBody["treatment_plan"].(string)
1567
+
1568
+	orgId := c.GetAdminUserInfo().CurrentOrgId
1569
+	firstdisease := models.XtPatientFirstDisease{
1570
+		Title:                 title,
1571
+		RecordDate:            recordtime,
1572
+		Doctor:                doctor,
1573
+		MainContent:           main_content,
1574
+		PatientCase:           patient_case,
1575
+		TentativeDiagnosis:    tentative_diagnosis,
1576
+		DiagnosticBasis:       diagnostic_basis,
1577
+		DifferentialDiagnosis: differential_diagnosis,
1578
+		TreatmentPlan:         treatment_plan,
1579
+		UserOrgId:             orgId,
1580
+		PatientId:             patient_id,
1581
+		Ctime:                 time.Now().Unix(),
1582
+		Mtime:                 0,
1583
+		Status:                1,
1584
+		ID:                    id,
1585
+	}
1586
+
1587
+	error := service.UpdatePatientFirstDisease(firstdisease, id)
1588
+
1589
+	if error == nil {
1590
+		c.ServeSuccessJSON(map[string]interface{}{
1591
+			"firstDisease": firstdisease,
1592
+		})
1593
+	}
1594
+
1595
+}
1596
+
1597
+func (c *DoctorsApiController) DeleteFirstDisease() {
1598
+
1599
+	schIDStr := c.GetString("ids")
1600
+	idStrs := strings.Split(schIDStr, ",")
1601
+	err := service.DeleteFirstDisease(idStrs)
1602
+	fmt.Println(err)
1603
+	returnData := make(map[string]interface{}, 0)
1604
+	returnData["msg"] = "ok"
1605
+	c.ServeSuccessJSON(returnData)
1606
+	return
1607
+}

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

@@ -269,7 +269,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
269 269
 
270 270
 	template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
271 271
 
272
-	if template.TemplateId == 22 || template.TemplateId == 17 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 27 || template.TemplateId == 34 || template.TemplateId == 30 || template.TemplateId == 32 || template.TemplateId == 36 || template.TemplateId == 40 || template.TemplateId == 38 || template.TemplateId == 43 || template.TemplateId == 46 || template.TemplateId == 53 || template.TemplateId == 48 || adminUserInfo.Org.Id == 10345 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10441 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10138 || adminUserInfo.Org.Id == 10278 || adminUserInfo.Org.Id == 9829 || adminUserInfo.Org.Id == 10440 {
272
+	if template.TemplateId == 22 || template.TemplateId == 17 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 27 || template.TemplateId == 34 || template.TemplateId == 30 || template.TemplateId == 32 || template.TemplateId == 36 || template.TemplateId == 40 || template.TemplateId == 38 || template.TemplateId == 43 || template.TemplateId == 46 || template.TemplateId == 53 || template.TemplateId == 48 || adminUserInfo.Org.Id == 10345 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10441 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10138 || adminUserInfo.Org.Id == 10278 || adminUserInfo.Org.Id == 9829 || adminUserInfo.Org.Id == 10440 || adminUserInfo.Org.Id == 10469 {
273 273
 		if adminUserInfo.Org.Id != 10447 {
274 274
 			dewater_amount = dewater_amount * 1000
275 275
 		}
@@ -655,10 +655,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
655 655
 				evaluation.BreathingRate = lastPredialysisEvaluation.BreathingRate
656 656
 				evaluation.Catheter = lastPredialysisEvaluation.Catheter
657 657
 				evaluation.InternalFistula = lastPredialysisEvaluation.InternalFistula
658
-				if adminUserInfo.Org.Id != 10445 {
659
-					evaluation.PulseFrequency = lastPredialysisEvaluation.PulseFrequency
660
-				}
661
-
658
+				evaluation.PulseFrequency = lastPredialysisEvaluation.PulseFrequency
662 659
 				evaluation.Complication = lastPredialysisEvaluation.Complication
663 660
 				evaluation.LastPostDialysis = lastPredialysisEvaluation.LastPostDialysis
664 661
 				evaluation.DialysisInterphase = lastPredialysisEvaluation.DialysisInterphase
@@ -684,12 +681,15 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
684 681
 					evaluation.VenousCatheterization = lastPredialysisEvaluation.VenousCatheterization
685 682
 				}
686 683
 
687
-				if adminUserInfo.Org.Id == 9829 {
684
+				if adminUserInfo.Org.Id == 9829 || adminUserInfo.Org.Id == 10469 {
688 685
 					evaluation.PulseFrequency = 80
689 686
 				}
690 687
 				if adminUserInfo.Org.Id == 10440 {
691 688
 					evaluation.Temperature = 36.5
692 689
 				}
690
+				if adminUserInfo.Org.Id == 10469 {
691
+					evaluation.Temperature = 36.5
692
+				}
693 693
 			}
694 694
 		} else {
695 695
 			evaluation.UpdatedTime = time.Now().Unix()
@@ -766,7 +766,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
766 766
 
767 767
 		//蓬安济民
768 768
 
769
-		if adminUserInfo.Org.Id == 9829 {
769
+		if adminUserInfo.Org.Id == 9829 || adminUserInfo.Org.Id == 10469 {
770 770
 			afterevaluation.PulseFrequency = 80
771 771
 		}
772 772
 

+ 10 - 7
controllers/mobile_api_controllers/dialysis_api_controller.go 查看文件

@@ -2097,7 +2097,7 @@ func (c *DialysisAPIController) Finish() {
2097 2097
 
2098 2098
 	}
2099 2099
 
2100
-	if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9675 || adminUserInfo.Org.Id == 10215 || adminUserInfo.Org.Id == 10233 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 10243 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10414 || adminUserInfo.Org.Id == 10430 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 9829 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10440 {
2100
+	if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9675 || adminUserInfo.Org.Id == 10215 || adminUserInfo.Org.Id == 10233 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 10243 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10414 || adminUserInfo.Org.Id == 10430 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 9829 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10440 || adminUserInfo.Org.Id == 10469 {
2101 2101
 		evaluation, _ := service.MobileGetPredialysisEvaluationOne(adminUserInfo.Org.Id, id, recordDate.Unix())
2102 2102
 		if evaluation.SystolicBloodPressure == 0 {
2103 2103
 			evaluation.SystolicBloodPressure = fmonitorRecords.SystolicBloodPressure
@@ -2754,8 +2754,9 @@ func (this *DialysisAPIController) StartDialysis() {
2754 2754
 
2755 2755
 			//针对肇庆三鹤血液透析中心
2756 2756
 
2757
-			if template.TemplateId == 43 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10441 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10440 {
2757
+			if template.TemplateId == 43 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10441 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10440 || adminUserInfo.Org.Id == 10469 {
2758 2758
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 60 / float64(totalMin))
2759
+
2759 2760
 			}
2760 2761
 
2761 2762
 			if template.TemplateId == 20 || template.TemplateId == 22 { //adminUserInfo.Org.Id == 9538
@@ -2837,7 +2838,7 @@ func (this *DialysisAPIController) StartDialysis() {
2837 2838
 			record.BreathingRate = befor.BreathingRate
2838 2839
 		}
2839 2840
 
2840
-		if adminUserInfo.Org.Id == 9829 {
2841
+		if adminUserInfo.Org.Id == 9829 || adminUserInfo.Org.Id == 10469 {
2841 2842
 			record.PulseFrequency = 80
2842 2843
 			record.Temperature = 36.5
2843 2844
 		}
@@ -3594,8 +3595,10 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
3594 3595
 				record.UltrafiltrationRate = ultrafiltration_rate
3595 3596
 			}
3596 3597
 
3597
-			if adminInfo.Org.Id == 10395 || adminInfo.Org.Id == 10138 || adminInfo.Org.Id == 10278 || adminInfo.Org.Id == 10340 || adminInfo.Org.Id == 10432 || adminInfo.Org.Id == 10441 || adminInfo.Org.Id == 10445 || adminInfo.Org.Id == 9829 || adminInfo.Org.Id == 10440 {
3598
+			fmt.Println("adminiNof2323323232", adminInfo.Org.Id)
3599
+			if adminInfo.Org.Id == 10395 || adminInfo.Org.Id == 10138 || adminInfo.Org.Id == 10278 || adminInfo.Org.Id == 10340 || adminInfo.Org.Id == 10432 || adminInfo.Org.Id == 10441 || adminInfo.Org.Id == 10445 || adminInfo.Org.Id == 9829 || adminInfo.Org.Id == 10440 || adminInfo.Org.Id == 10469 {
3598 3600
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 60 / 1000 / float64(totalMin) * 1000)
3601
+				fmt.Println("ooooooooooo", ultrafiltration_rate)
3599 3602
 				record.UltrafiltrationRate = ultrafiltration_rate
3600 3603
 			}
3601 3604
 			//if template.TemplateId == 47 {
@@ -3624,11 +3627,11 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
3624 3627
 	}
3625 3628
 
3626 3629
 	//长沙南雅
3627
-	if adminInfo.Org.Id == 10395 || adminInfo.Org.Id == 10138 || adminInfo.Org.Id == 10278 || adminInfo.Org.Id == 10432 || adminInfo.Org.Id == 10441 || adminInfo.Org.Id == 10445 {
3628
-
3630
+	if adminInfo.Org.Id == 10395 || adminInfo.Org.Id == 10138 || adminInfo.Org.Id == 10278 || adminInfo.Org.Id == 10432 || adminInfo.Org.Id == 10441 || adminInfo.Org.Id == 10445 || adminInfo.Org.Id == 10469 {
3631
+		fmt.Println("ultrafiltration_rate-------", ultrafiltration_rate)
3629 3632
 		if ultrafiltration_rate > 0 {
3630 3633
 			ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
3631
-
3634
+			fmt.Println("ultrafiltration_volume=======", ultrafiltration_volume)
3632 3635
 			record.UltrafiltrationVolume = ultrafiltration_volume
3633 3636
 		}
3634 3637
 

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

@@ -1795,3 +1795,25 @@ type NewDialysisSolutionOne struct {
1795 1795
 func (NewDialysisSolutionOne) TableName() string {
1796 1796
 	return "xt_dialysis_solution"
1797 1797
 }
1798
+
1799
+type XtPatientFirstDisease struct {
1800
+	ID                    int64  `gorm:"column:id" json:"id" form:"id"`
1801
+	Title                 string `gorm:"column:title" json:"title" form:"title"`
1802
+	RecordDate            int64  `gorm:"column:record_date" json:"record_date" form:"record_date"`
1803
+	Doctor                int64  `gorm:"column:doctor" json:"doctor" form:"doctor"`
1804
+	MainContent           string `gorm:"column:main_content" json:"main_content" form:"main_content"`
1805
+	PatientCase           string `gorm:"column:patient_case" json:"patient_case" form:"patient_case"`
1806
+	TentativeDiagnosis    string `gorm:"column:tentative_diagnosis" json:"tentative_diagnosis" form:"tentative_diagnosis"`
1807
+	DiagnosticBasis       string `gorm:"column:diagnostic_basis" json:"diagnostic_basis" form:"diagnostic_basis"`
1808
+	DifferentialDiagnosis string `gorm:"column:differential_diagnosis" json:"differential_diagnosis" form:"differential_diagnosis"`
1809
+	TreatmentPlan         string `gorm:"column:treatment_plan" json:"treatment_plan" form:"treatment_plan"`
1810
+	UserOrgId             int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1811
+	PatientId             int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1812
+	Ctime                 int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
1813
+	Mtime                 int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
1814
+	Status                int64  `gorm:"column:status" json:"status" form:"status"`
1815
+}
1816
+
1817
+func (XtPatientFirstDisease) TableName() string {
1818
+	return "xt_patient_first_disease"
1819
+}

+ 2 - 2
service/auto_create_week_disinfection.go 查看文件

@@ -15,9 +15,9 @@ var createWeekDisinfectionCronJob *cron.Cron
15 15
 
16 16
 func init() {
17 17
 	createWeekDisinfectionCronJob = cron.New()
18
-	spec := "0 50 23 * * ?" // 每天23点执行一次
18
+	//spec := "0 50 23 * * ?" // 每天23点执行一次
19 19
 	//spec := "0 55 23 * * ?" // 每天23点55执行一次
20
-	//spec := "0 0 5 * * ?" // 每天23点55执行一次
20
+	spec := "0 0 5 * * ?" // 每天23点55执行一次
21 21
 	//spec := "0 */1 * * * ?" // 每1分钟执行一次
22 22
 	createWeekDisinfectionCronJob.AddFunc(spec, func() {
23 23
 

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

@@ -1912,3 +1912,47 @@ func UpdateDialysisOrderSix(patient_id int64, dialysis_date int64, user_org_id i
1912 1912
 
1913 1913
 	return order, err
1914 1914
 }
1915
+
1916
+func CreatePatientFirstDisease(firstdisease models.XtPatientFirstDisease) error {
1917
+
1918
+	err := XTWriteDB().Create(&firstdisease).Error
1919
+	return err
1920
+}
1921
+
1922
+func GetPatientDiseaseList(org_id int64, patient_id int64, start_time int64, end_time int64) (disease []*models.XtPatientFirstDisease, err error) {
1923
+
1924
+	db := XTReadDB().Model(&disease).Where("status=1")
1925
+
1926
+	if org_id > 0 {
1927
+		db = db.Where("user_org_id =?", org_id)
1928
+	}
1929
+	if patient_id > 0 {
1930
+		db = db.Where("patient_id = ?", patient_id)
1931
+	}
1932
+	if start_time > 0 {
1933
+		db = db.Where("record_date >=?", start_time)
1934
+	}
1935
+	if end_time > 0 {
1936
+		db = db.Where("record_date<=?", end_time)
1937
+	}
1938
+	err = db.Find(&disease).Error
1939
+	return disease, err
1940
+}
1941
+
1942
+func GetFirstDetailById(id int64) (models.XtPatientFirstDisease, error) {
1943
+
1944
+	disease := models.XtPatientFirstDisease{}
1945
+	err = XTReadDB().Where("id = ? and status= 1", id).Find(&disease).Error
1946
+	return disease, err
1947
+}
1948
+
1949
+func UpdatePatientFirstDisease(disease models.XtPatientFirstDisease, id int64) error {
1950
+
1951
+	err := XTWriteDB().Model(&models.XtPatientFirstDisease{}).Where("id =? and status = 1", id).Update(map[string]interface{}{"title": disease.Title, "doctor": disease.Doctor, "record_date": disease.RecordDate, "main_content": disease.MainContent, "patient_case": disease.PatientCase, "tentative_diagnosis": disease.TentativeDiagnosis, "diagnostic_basis": disease.DiagnosticBasis, "differential_diagnosis": disease.DifferentialDiagnosis, "treatment_plan": disease.TreatmentPlan}).Error
1952
+	return err
1953
+}
1954
+
1955
+func DeleteFirstDisease(id []string) error {
1956
+	err := XTWriteDB().Model(models.XtPatientFirstDisease{}).Where("id in (?) and status=1", id).Updates(map[string]interface{}{"status": 0}).Error
1957
+	return err
1958
+}