Browse Source

耗材参数

XMLWAN 4 years ago
parent
commit
2f215ac10d

+ 12 - 1
controllers/doctors_api_controller.go View File

@@ -343,6 +343,9 @@ func (this *DoctorsApiController) SaveVasularAccess() {
343 343
 	stopTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", stop_time+" 00:00:00", loc)
344 344
 	patient_id, _ := this.GetInt64("patient_id")
345 345
 	other_vascular := this.GetString("other_vascular")
346
+	ci_type, _ := this.GetInt64("ci_type")
347
+	blood_cultupe, _ := this.GetInt64("blood_cultupe")
348
+	sequelae_type, _ := this.GetInt64("sequelae_type")
346 349
 	adminUserInfo := this.GetAdminUserInfo()
347 350
 	orgId := adminUserInfo.CurrentOrgId
348 351
 	creator := adminUserInfo.AdminUser.Id
@@ -367,6 +370,9 @@ func (this *DoctorsApiController) SaveVasularAccess() {
367 370
 			StopTime:               stopTime.Unix(),
368 371
 			PatientId:              patient_id,
369 372
 			OtherVascular:          other_vascular,
373
+			CiType:                 ci_type,
374
+			BloodCultupe:           blood_cultupe,
375
+			SequelaeType:           sequelae_type,
370 376
 		}
371 377
 		err := service.SaveVascularAccess(&access)
372 378
 		if err == nil {
@@ -439,8 +445,10 @@ func (this *DoctorsApiController) UpdateVasularAccess() {
439 445
 	orgId := adminUserInfo.CurrentOrgId
440 446
 	creator := adminUserInfo.AdminUser.Id
441 447
 	patientId, _ := this.GetInt64("patient_id")
442
-	fmt.Println("patient_id222222222222222222", patientId)
443 448
 	other_vascular := this.GetString("other_vascular")
449
+	ci_type, _ := this.GetInt64("ci_type")
450
+	blood_cultupe, _ := this.GetInt64("blood_cultupe")
451
+	sequelae_type, _ := this.GetInt64("sequelae_type")
444 452
 	access := models.XtPatientVascularAccess{
445 453
 		AccessProject:          access_project,
446 454
 		BloodAccessPartId:      blood_access_part_id,
@@ -456,6 +464,9 @@ func (this *DoctorsApiController) UpdateVasularAccess() {
456 464
 		Status:                 1,
457 465
 		StopTime:               stopTime.Unix(),
458 466
 		OtherVascular:          other_vascular,
467
+		CiType:                 ci_type,
468
+		BloodCultupe:           blood_cultupe,
469
+		SequelaeType:           sequelae_type,
459 470
 	}
460 471
 	_, errcode := service.GetDialysisDateByDateOne(startTime.Unix(), patientId, orgId, id)
461 472
 	if errcode == gorm.ErrRecordNotFound {

+ 4 - 1
controllers/manager_center_api_controller.go View File

@@ -126,7 +126,7 @@ func (c *ManagerCenterApiController) CreateBaseDrugLib() {
126 126
 	is_charge_predict, _ := c.GetInt64("is_charge_predict")
127 127
 	is_statistics_work, _ := c.GetInt64("is_statistics_work")
128 128
 	is_charge_use, _ := c.GetInt64("is_charge_use")
129
-
129
+	dealer, _ := c.GetInt64("dealer")
130 130
 	adminInfo := c.GetAdminUserInfo()
131 131
 
132 132
 	drugLib := &models.BaseDrugLib{
@@ -178,6 +178,7 @@ func (c *ManagerCenterApiController) CreateBaseDrugLib() {
178 178
 		Status:                 1,
179 179
 		Ctime:                  time.Now().Unix(),
180 180
 		Mtime:                  time.Now().Unix(),
181
+		Dealer:                 dealer,
181 182
 	}
182 183
 
183 184
 	total := service.FindAllDrugLibRecordTotal(adminInfo.CurrentOrgId)
@@ -255,6 +256,7 @@ func (c *ManagerCenterApiController) EditBaseDrugLib() {
255 256
 	is_charge_use, _ := c.GetInt64("is_charge_use")
256 257
 	drug_code := c.GetString("drug_code")
257 258
 	//unit := c.GetString("unit")
259
+	dealer, _ := c.GetInt64("dealer")
258 260
 	adminInfo := c.GetAdminUserInfo()
259 261
 	drug, _ := service.FindBaseDrugLibRecord(adminInfo.CurrentOrgId, id)
260 262
 
@@ -309,6 +311,7 @@ func (c *ManagerCenterApiController) EditBaseDrugLib() {
309 311
 		Ctime:                  drug.Ctime,
310 312
 		Mtime:                  time.Now().Unix(),
311 313
 		DrugCode:               drug_code,
314
+		Dealer:                 dealer,
312 315
 	}
313 316
 
314 317
 	err := service.UpdateBaseDrugLib(drugLib)

+ 1 - 0
models/drug.go View File

@@ -51,6 +51,7 @@ type BaseDrugLib struct {
51 51
 	Mtime                  int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
52 52
 	OrgId                  int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
53 53
 	DrugCode               string  `gorm:"column:drug_code" json:"drug_code" form:"drug_code"`
54
+	Dealer                 int64   `gorm:"column:dealer" json:"dealer" form:"dealer"`
54 55
 	//MedicineInsurancePercentage []*MedicineInsurancePercentage `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"monitoring_record"`
55 56
 }
56 57
 

+ 3 - 0
models/user_models.go View File

@@ -492,6 +492,9 @@ type XtPatientVascularAccess struct {
492 492
 	StopTime               int64  `gorm:"column:stop_time" json:"stop_time" form:"stop_time"`
493 493
 	PatientId              int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
494 494
 	OtherVascular          string `gorm:"column:other_vascular" json:"other_vascular" form:"other_vascular"`
495
+	CiType                 int64  `gorm:"column:ci_type" json:"ci_type" form:"ci_type"`
496
+	BloodCultupe           int64  `gorm:"column:blood_cultupe" json:"blood_cultupe" form:"blood_cultupe"`
497
+	SequelaeType           int64  `gorm:"column:sequelae_type" json:"sequelae_type" form:"sequelae_type"`
495 498
 }
496 499
 
497 500
 func (XtPatientVascularAccess) TableName() string {

+ 3 - 3
service/drug_stock_service.go View File

@@ -35,9 +35,9 @@ func FindAllDrugByManufactureId(manufacturer_id int64, dealer_id int64, org_id i
35 35
 	if manufacturer_id > 0 {
36 36
 		db = db.Where("manufacturer = ?", manufacturer_id)
37 37
 	}
38
-	//if dealer_id > 0 {
39
-	//	db = db.Where("dealer = ?", dealer_id)
40
-	//}
38
+	if dealer_id > 0 {
39
+		db = db.Where("dealer = ?", dealer_id)
40
+	}
41 41
 	err = db.Preload("DrugSpecs", "status = 1 AND org_id = ? AND find_in_set('停用',drug_status) = 0", org_id).Group("drug_name").Find(&goodInfo).Error
42 42
 	return goodInfo, err
43 43
 }

+ 1 - 1
service/patientmanage_service.go View File

@@ -1520,7 +1520,7 @@ func GetVasularAccessByDetail(id int64) (models.XtPatientVascularAccess, error)
1520 1520
 
1521 1521
 func UpdateVascularAccess(access *models.XtPatientVascularAccess, id int64) error {
1522 1522
 
1523
-	err := XTWriteDB().Model(&access).Where("id= ?", id).Updates(map[string]interface{}{"access_project": access.AccessProject, "blood_access_part_id": access.BloodAccessPartId, "inflow_pass": access.InflowPass, "start_time": access.StartTime, "first_start_time": access.FirstStartTime, "blood_access_part_opera_id": access.BloodAccessPartOperaId, "stop_reason": access.StopReason, "remark": access.Remark, "user_status": access.UserStatus, "modify": access.Modify, "stop_time": access.StopTime, "other_vascular": access.OtherVascular}).Error
1523
+	err := XTWriteDB().Model(&access).Where("id= ?", id).Updates(map[string]interface{}{"access_project": access.AccessProject, "blood_access_part_id": access.BloodAccessPartId, "inflow_pass": access.InflowPass, "start_time": access.StartTime, "first_start_time": access.FirstStartTime, "blood_access_part_opera_id": access.BloodAccessPartOperaId, "stop_reason": access.StopReason, "remark": access.Remark, "user_status": access.UserStatus, "modify": access.Modify, "stop_time": access.StopTime, "other_vascular": access.OtherVascular, "ci_type": access.CiType, "blood_cultupe": access.BloodCultupe, "sequelae_type": access.SequelaeType}).Error
1524 1524
 	return err
1525 1525
 }
1526 1526