Quellcode durchsuchen

Merge branch '20201014_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20201014_xt_api_new_branch

csx vor 4 Jahren
Ursprung
Commit
a767f28ecc

+ 11 - 11
controllers/dialysis_api_controller.go Datei anzeigen

@@ -244,8 +244,8 @@ func (c *DialysisApiController) PostPrescription() {
244 244
 	//fmt.Println("下机前推注鱼精蛋白",push_the_protamine)
245 245
 	// var prescription_doctor int64
246 246
 	blood := c.GetString("blood")
247
-	dialysis_dialyszers := c.GetString("dialysis_dialyszers")
248
-	dialysis_irrigation := c.GetString("dialysis_irrigation")
247
+	//dialysis_dialyszers := c.GetString("dialysis_dialyszers")
248
+	//dialysis_irrigation := c.GetString("dialysis_irrigation")
249 249
 	antioxidant_commodity_name := c.GetString("antioxidant_commodity_name")
250 250
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
251 251
 	//template, _ := service.GetOrgInfoTemplate(adminUserInfo.CurrentOrgId)
@@ -326,9 +326,9 @@ func (c *DialysisApiController) PostPrescription() {
326 326
 		AnticoagulantStopTimeHour:  anticoagulant_stop_time_hour,
327 327
 		AnticoagulantStopTimeMin:   anticoagulant_stop_time_min,
328 328
 		Blood:                      blood,
329
-		DialysisDialyszers:         dialysis_dialyszers,
330
-		DialysisIrrigation:         dialysis_irrigation,
331
-		AntioxidantCommodityName:   antioxidant_commodity_name,
329
+		//DialysisDialyszers:         dialysis_dialyszers,
330
+		//DialysisIrrigation:         dialysis_irrigation,
331
+		AntioxidantCommodityName: antioxidant_commodity_name,
332 332
 	}
333 333
 
334 334
 	if appRole.UserType == 2 || appRole.UserType == 1 {
@@ -495,8 +495,8 @@ func (c *DialysisApiController) PostSoulution() {
495 495
 	anticoagulant_stop_time_hour, _ := c.GetInt64("anticoagulant_stop_time_hour", 0)
496 496
 	anticoagulant_stop_time_min, _ := c.GetInt64("anticoagulant_stop_time_min", 0)
497 497
 	blood := c.GetString("blood")
498
-	dialysis_dialyszers := c.GetString("dialysis_dialyszers")
499
-	dialysis_irrigation := c.GetString("dialysis_irrigation")
498
+	//dialysis_dialyszers := c.GetString("dialysis_dialyszers")
499
+	//dialysis_irrigation := c.GetString("dialysis_irrigation")
500 500
 	antioxidant_commodity_name := c.GetString("antioxidant_commodity_name")
501 501
 	var prescription_doctor int64
502 502
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentAppId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
@@ -588,9 +588,9 @@ func (c *DialysisApiController) PostSoulution() {
588 588
 		AnticoagulantStopTimeHour: anticoagulant_stop_time_hour,
589 589
 		AnticoagulantStopTimeMin:  anticoagulant_stop_time_min,
590 590
 		Blood:                     blood,
591
-		DialysisIrrigation:        dialysis_irrigation,
592
-		DialysisDialyszers:        dialysis_dialyszers,
593
-		AntioxidantCommodityName:  antioxidant_commodity_name,
591
+		//DialysisIrrigation:        dialysis_irrigation,
592
+		//DialysisDialyszers:        dialysis_dialyszers,
593
+		AntioxidantCommodityName: antioxidant_commodity_name,
594 594
 	}
595 595
 
596 596
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(patient, recordDate.Unix(), adminUserInfo.CurrentOrgId)
@@ -1280,7 +1280,7 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
1280 1280
 		dewater_amount = 0
1281 1281
 		if evaluation.DryWeight > 0 {
1282 1282
 			dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
1283
-			if templateInfo.TemplateId == 17 && templateInfo.TemplateId == 22 && templateInfo.TemplateId == 21 {
1283
+			if templateInfo.TemplateId == 17 || templateInfo.TemplateId == 22 || templateInfo.TemplateId == 21 || templateInfo.TemplateId == 34 {
1284 1284
 				dewater_amount = dewater_amount * 1000
1285 1285
 			}
1286 1286
 			if dewater_amount <= 0 {

+ 1 - 1
controllers/his_api_controller.go Datei anzeigen

@@ -955,7 +955,7 @@ func (c *HisApiController) CreateHisPatientCaseHistory() {
955 955
 	doctor_advice := c.GetString("doctor_advice")
956 956
 	remark := c.GetString("remark")
957 957
 	breathingfloat, _ := strconv.ParseFloat(breathing, 64)
958
-	fmt.Println("breathingfloat", breathingfloat)
958
+	//fmt.Println("breathingfloat", breathingfloat)
959 959
 	sick, _ := c.GetInt64("sick")
960 960
 	diagnose, _ := c.GetInt64("diagnose")
961 961
 	timeLayout := "2006-01-02"

+ 1 - 1
controllers/mobile_api_controllers/patient_api_controller.go Datei anzeigen

@@ -1545,7 +1545,7 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
1545 1545
 	if evaluation.DryWeight > 0 {
1546 1546
 		dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
1547 1547
 
1548
-		if template.TemplateId == 17 || template.TemplateId == 22 || template.TemplateId == 21 || template.TemplateId == 26 {
1548
+		if template.TemplateId == 17 || template.TemplateId == 22 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 34 {
1549 1549
 			dewater_amount = dewater_amount * 1000
1550 1550
 
1551 1551
 		}

+ 25 - 7
controllers/schedule_api_controller.go Datei anzeigen

@@ -548,14 +548,32 @@ func (c *ScheduleApiController) ChangeSchedule() {
548 548
 
549 549
 	schedule.UpdatedTime = time.Now().Unix()
550 550
 	err = service.UpdateSchedule(schedule)
551
-	if err != nil {
552
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeChangeScheduleFail)
553
-		return
551
+
552
+	prescription := models.DialysisPrescription{
553
+		ModeId: schedule.ModeId,
554
+	}
555
+	_, errcode := service.GetDialysisPrescribe(schedule.UserOrgId, schedule.PatientId, schedule.ScheduleDate)
556
+	if errcode == gorm.ErrRecordNotFound {
557
+		if err != nil {
558
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeChangeScheduleFail)
559
+			return
560
+		}
561
+		c.ServeSuccessJSON(map[string]interface{}{
562
+			"msg":      "ok",
563
+			"schedule": &schedule,
564
+		})
565
+	} else if errcode == nil {
566
+		err = service.UpdatedDialysisPrescription(&prescription, schedule.ScheduleDate, schedule.PatientId, schedule.UserOrgId)
567
+
568
+		if err != nil {
569
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeChangeScheduleFail)
570
+			return
571
+		}
572
+		c.ServeSuccessJSON(map[string]interface{}{
573
+			"msg":      "ok",
574
+			"schedule": &schedule,
575
+		})
554 576
 	}
555
-	c.ServeSuccessJSON(map[string]interface{}{
556
-		"msg":      "ok",
557
-		"schedule": &schedule,
558
-	})
559 577
 }
560 578
 
561 579
 // /api/schedule/print/initdata [get]

+ 13 - 11
controllers/stock_api_controller.go Datei anzeigen

@@ -288,18 +288,20 @@ func (c *StockApiController) ModifyManufacturer() {
288 288
 		PinYin:           pinyin,
289 289
 	}
290 290
 
291
-	_, errcode := service.GetManufacturerName(adminUserInfo.CurrentOrgId, manufacturer_name)
292
-	if errcode == gorm.ErrRecordNotFound {
293
-		err := service.ModifyManufacturer(&manufacturer)
291
+	Manufacturer, _ := service.GetManufacturerName(adminUserInfo.CurrentOrgId, manufacturer_name)
294 292
 
295
-		if err == nil {
296
-			c.ServeSuccessJSON(map[string]interface{}{
297
-				"manufacturer": manufacturer,
298
-			})
299
-		} else {
300
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
301
-		}
302
-	} else if errcode == nil {
293
+	if Manufacturer.ID > 0 && Manufacturer.ID != manufacturer.ID {
294
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeIdCardNoExist)
295
+		return
296
+	}
297
+
298
+	err := service.ModifyManufacturer(&manufacturer)
299
+
300
+	if err == nil {
301
+		c.ServeSuccessJSON(map[string]interface{}{
302
+			"manufacturer": manufacturer,
303
+		})
304
+	} else {
303 305
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
304 306
 	}
305 307
 

+ 6 - 0
service/schedule_service.go Datei anzeigen

@@ -713,3 +713,9 @@ func GetThreeWeekList(startime int64, endtime int64, orgid int64, scheduletype i
713 713
 
714 714
 	return schedule, err
715 715
 }
716
+
717
+func UpdatedDialysisPrescription(prescription *models.DialysisPrescription, recordDate int64, patientid int64, orgid int64) error {
718
+
719
+	err := XTWriteDB().Model(&prescription).Where("record_date = ? and patient_id = ? and user_org_id = ?", recordDate, patientid, orgid).Update(map[string]interface{}{"mode_id": prescription.ModeId, "updated_time": time.Now().Unix()}).Error
720
+	return err
721
+}