瀏覽代碼

耗材参数

XMLWAN 4 年之前
父節點
當前提交
2b733934b7

+ 3 - 0
controllers/dialysis_record_api_controller.go 查看文件

@@ -947,6 +947,9 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
947 947
 		if prescription.ID > 0 && adminUserInfo.CurrentOrgId == 9583 {
948 948
 			tempassessmentAfterDislysis.ActualUltrafiltration = prescription.TargetUltrafiltration
949 949
 		}
950
+		if endmonitorRecords.ID > 0 && adminUserInfo.CurrentOrgId == 10060 {
951
+			tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume
952
+		}
950 953
 	}
951 954
 
952 955
 	if lastAssessmentAfterDislysis != nil {

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

@@ -335,7 +335,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
335 335
 
336 336
 	template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
337 337
 
338
-	if template.TemplateId == 22 || template.TemplateId == 17 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 27 {
338
+	if template.TemplateId == 22 || template.TemplateId == 17 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 27 || template.TemplateId == 34 || template.TemplateId == 30 {
339 339
 		dewater_amount = dewater_amount * 1000
340 340
 	}
341 341
 

+ 12 - 1
controllers/mobile_api_controllers/dialysis_api_controller.go 查看文件

@@ -1363,6 +1363,11 @@ func (c *DialysisAPIController) Finish() {
1363 1363
 
1364 1364
 			tempassessmentAfterDislysis.ActualUltrafiltration = diaPrescription.TargetUltrafiltration
1365 1365
 		}
1366
+
1367
+	}
1368
+
1369
+	if endmonitorRecords.ID > 0 && adminUserInfo.Org.Id == 10060 {
1370
+		tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume
1366 1371
 	}
1367 1372
 
1368 1373
 	if lastAssessmentAfterDislysis != nil {
@@ -2133,7 +2138,13 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
2133 2138
 				record.UltrafiltrationRate = ultrafiltration_rate
2134 2139
 			}
2135 2140
 
2136
-			if template.TemplateId == 20 || template.TemplateId == 22 || template.TemplateId == 32 || template.TemplateId == 34 {
2141
+			if template.TemplateId == 32 || template.TemplateId == 34 {
2142
+
2143
+				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1)
2144
+				record.UltrafiltrationRate = ultrafiltration_rate
2145
+			}
2146
+
2147
+			if template.TemplateId == 20 || template.TemplateId == 22 {
2137 2148
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60)
2138 2149
 				record.UltrafiltrationRate = ultrafiltration_rate
2139 2150
 			}

+ 25 - 14
controllers/stock_api_controller.go 查看文件

@@ -6,6 +6,7 @@ import (
6 6
 	"XT_New/service"
7 7
 	"XT_New/utils"
8 8
 	"github.com/astaxie/beego"
9
+	"github.com/jinzhu/gorm"
9 10
 	"strconv"
10 11
 	"time"
11 12
 )
@@ -224,13 +225,18 @@ func (c *StockApiController) CreateManufacturer() {
224 225
 		PinYin:           pinyin,
225 226
 	}
226 227
 
227
-	err, manufacturers := service.AddSigleManufacturer(&manufacturer)
228
-	if err == nil {
229
-		c.ServeSuccessJSON(map[string]interface{}{
230
-			"manufacturer": manufacturers,
231
-		})
232
-
233
-	} else {
228
+	_, errcode := service.GetManufacturerName(adminUserInfo.CurrentOrgId, manufacturer_name)
229
+	if errcode == gorm.ErrRecordNotFound {
230
+		err, manufacturers := service.AddSigleManufacturer(&manufacturer)
231
+		if err == nil {
232
+			c.ServeSuccessJSON(map[string]interface{}{
233
+				"manufacturer": manufacturers,
234
+			})
235
+
236
+		} else {
237
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
238
+		}
239
+	} else if errcode == nil {
234 240
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
235 241
 	}
236 242
 
@@ -282,13 +288,18 @@ func (c *StockApiController) ModifyManufacturer() {
282 288
 		PinYin:           pinyin,
283 289
 	}
284 290
 
285
-	err := service.ModifyManufacturer(&manufacturer)
286
-
287
-	if err == nil {
288
-		c.ServeSuccessJSON(map[string]interface{}{
289
-			"manufacturer": manufacturer,
290
-		})
291
-	} else {
291
+	_, errcode := service.GetManufacturerName(adminUserInfo.CurrentOrgId, manufacturer_name)
292
+	if errcode == gorm.ErrRecordNotFound {
293
+		err := service.ModifyManufacturer(&manufacturer)
294
+
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 {
292 303
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
293 304
 	}
294 305
 

+ 36 - 36
models/his_models.go 查看文件

@@ -1,7 +1,7 @@
1 1
 package models
2 2
 
3 3
 import (
4
-	"gdyb/models"
4
+	//"gdyb/models"
5 5
 	"time"
6 6
 )
7 7
 
@@ -575,41 +575,41 @@ func (XtHisProjectList) TableName() string {
575 575
 }
576 576
 
577 577
 type XtHisPatient struct {
578
-	ID                     int64           `gorm:"column:id" json:"id" form:"id"`
579
-	BalanceAccountsType    int64           `gorm:"column:balance_accounts_type" json:"balance_accounts_type" form:"balance_accounts_type"`
580
-	MedicalInsuranceNumber string          `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
581
-	Name                   string          `gorm:"column:name" json:"name" form:"name"`
582
-	Gender                 int64           `gorm:"column:gender" json:"gender" form:"gender"`
583
-	IdType                 int64           `gorm:"column:id_type" json:"id_type" form:"id_type"`
584
-	MedicalTreatmentType   int64           `gorm:"column:medical_treatment_type" json:"medical_treatment_type" form:"medical_treatment_type"`
585
-	Birthday               int64           `gorm:"column:birthday" json:"birthday" form:"birthday"`
586
-	RecordDate             int64           `gorm:"column:record_date" json:"record_date" form:"record_date"`
587
-	Age                    int64           `gorm:"column:age" json:"age" form:"age"`
588
-	PhoneNumber            string          `gorm:"column:phone_number" json:"phone_number" form:"phone_number"`
589
-	IdCardNo               string          `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
590
-	RegisterType           int64           `gorm:"column:register_type" json:"register_type" form:"register_type"`
591
-	AdminUserId            int64           `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
592
-	Departments            int64           `gorm:"column:departments" json:"departments" form:"departments"`
593
-	IsNeedCostOfProduction int64           `gorm:"column:is_need_cost_of_production" json:"is_need_cost_of_production" form:"is_need_cost_of_production"`
594
-	RegisterCost           float64         `gorm:"column:register_cost" json:"register_cost" form:"register_cost"`
595
-	TreatmentCost          float64         `gorm:"column:treatment_cost" json:"treatment_cost" form:"treatment_cost"`
596
-	CostOfProduction       float64         `gorm:"column:cost_of_production" json:"cost_of_production" form:"cost_of_production"`
597
-	Total                  float64         `gorm:"column:total" json:"total" form:"total"`
598
-	UserOrgId              int64           `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
599
-	Status                 int64           `gorm:"column:status" json:"status" form:"status"`
600
-	Ctime                  int64           `gorm:"column:ctime" json:"ctime" form:"ctime"`
601
-	Mtime                  int64           `gorm:"column:mtime" json:"mtime" form:"mtime"`
602
-	PatientId              int64           `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
603
-	Number                 string          `gorm:"column:number" json:"number" form:"number"`
604
-	Doctor                 int64           `gorm:"column:doctor" json:"doctor" form:"doctor"`
605
-	IsReturn               int64           `gorm:"column:is_return" json:"is_return" form:"is_return"`
606
-	Phone                  string          `gorm:"column:phone" json:"phone" form:"phone"`
607
-	SocialType             int64           `gorm:"column:social_type" json:"social_type" form:"social_type"`
608
-	IdCardType             int64           `gorm:"column:id_card_type" json:"id_card_type" form:"id_card_type"`
609
-	PType                  string          `gorm:"column:p_type" json:"p_type" form:"p_type"`
610
-	Diagnosis              int64           `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
611
-	SickType               int64           `gorm:"column:sick_type" json:"sick_type" form:"sick_type"`
612
-	HisOrder               models.HisOrder `gorm:"ForeignKey:PatientId,RecordDate;AssociationForeignKey:PatientId,SettleAccountsDate" json:"order"`
578
+	ID                     int64   `gorm:"column:id" json:"id" form:"id"`
579
+	BalanceAccountsType    int64   `gorm:"column:balance_accounts_type" json:"balance_accounts_type" form:"balance_accounts_type"`
580
+	MedicalInsuranceNumber string  `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
581
+	Name                   string  `gorm:"column:name" json:"name" form:"name"`
582
+	Gender                 int64   `gorm:"column:gender" json:"gender" form:"gender"`
583
+	IdType                 int64   `gorm:"column:id_type" json:"id_type" form:"id_type"`
584
+	MedicalTreatmentType   int64   `gorm:"column:medical_treatment_type" json:"medical_treatment_type" form:"medical_treatment_type"`
585
+	Birthday               int64   `gorm:"column:birthday" json:"birthday" form:"birthday"`
586
+	RecordDate             int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
587
+	Age                    int64   `gorm:"column:age" json:"age" form:"age"`
588
+	PhoneNumber            string  `gorm:"column:phone_number" json:"phone_number" form:"phone_number"`
589
+	IdCardNo               string  `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
590
+	RegisterType           int64   `gorm:"column:register_type" json:"register_type" form:"register_type"`
591
+	AdminUserId            int64   `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
592
+	Departments            int64   `gorm:"column:departments" json:"departments" form:"departments"`
593
+	IsNeedCostOfProduction int64   `gorm:"column:is_need_cost_of_production" json:"is_need_cost_of_production" form:"is_need_cost_of_production"`
594
+	RegisterCost           float64 `gorm:"column:register_cost" json:"register_cost" form:"register_cost"`
595
+	TreatmentCost          float64 `gorm:"column:treatment_cost" json:"treatment_cost" form:"treatment_cost"`
596
+	CostOfProduction       float64 `gorm:"column:cost_of_production" json:"cost_of_production" form:"cost_of_production"`
597
+	Total                  float64 `gorm:"column:total" json:"total" form:"total"`
598
+	UserOrgId              int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
599
+	Status                 int64   `gorm:"column:status" json:"status" form:"status"`
600
+	Ctime                  int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
601
+	Mtime                  int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
602
+	PatientId              int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
603
+	Number                 string  `gorm:"column:number" json:"number" form:"number"`
604
+	Doctor                 int64   `gorm:"column:doctor" json:"doctor" form:"doctor"`
605
+	IsReturn               int64   `gorm:"column:is_return" json:"is_return" form:"is_return"`
606
+	Phone                  string  `gorm:"column:phone" json:"phone" form:"phone"`
607
+	SocialType             int64   `gorm:"column:social_type" json:"social_type" form:"social_type"`
608
+	IdCardType             int64   `gorm:"column:id_card_type" json:"id_card_type" form:"id_card_type"`
609
+	PType                  string  `gorm:"column:p_type" json:"p_type" form:"p_type"`
610
+	Diagnosis              int64   `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
611
+	SickType               int64   `gorm:"column:sick_type" json:"sick_type" form:"sick_type"`
612
+	//HisOrder               models.HisOrder `gorm:"ForeignKey:PatientId,RecordDate;AssociationForeignKey:PatientId,SettleAccountsDate" json:"order"`
613 613
 }
614 614
 
615 615
 func (XtHisPatient) TableName() string {

+ 13 - 0
service/stock_service.go 查看文件

@@ -2174,3 +2174,16 @@ func GetOutStockTotalCountOne(startime int64, endtime int64, orgid int64) (autoM
2174 2174
 
2175 2175
 	return autoMatic, err
2176 2176
 }
2177
+
2178
+func GetManufacturerName(orgid int64, name string) (*models.Manufacturer, error) {
2179
+	var manufacturer models.Manufacturer
2180
+	var err error
2181
+	err = XTReadDB().Model(&manufacturer).Where("org_id = ? and manufacturer_name = ? and status = 1", orgid, name).Find(&manufacturer).Error
2182
+	if err == gorm.ErrRecordNotFound {
2183
+		return nil, err
2184
+	}
2185
+	if err != nil {
2186
+		return nil, err
2187
+	}
2188
+	return &manufacturer, nil
2189
+}