Browse Source

11月9日库存管理

XMLWAN 2 years ago
parent
commit
06fe598f80

+ 4 - 1
controllers/dialysis_api_controller.go View File

@@ -1501,7 +1501,8 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
1501 1501
 	urea_befor := c.GetString("urea_befor")
1502 1502
 	suction := c.GetString("suction")
1503 1503
 	weight_befor_remake := c.GetString("weight_befor_remake")
1504
-
1504
+	height := c.GetString("height")
1505
+	age := c.GetString("age")
1505 1506
 	assessmentBeforeDislysis := models.PredialysisEvaluation{
1506 1507
 		DialysisCount:                  dialysis_count,
1507 1508
 		EmergencyTreatment:             emergency_treatment,
@@ -1571,6 +1572,8 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
1571 1572
 		UreaBefor:                      urea_befor,
1572 1573
 		Suction:                        suction,
1573 1574
 		WeightBeforRemake:              weight_befor_remake,
1575
+		Height:                         height,
1576
+		Age:                            age,
1574 1577
 	}
1575 1578
 
1576 1579
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)

+ 3 - 1
controllers/doctors_api_controller.go View File

@@ -211,8 +211,10 @@ func (c *DoctorsApiController) GetAllAdminUsers() {
211 211
 
212 212
 	adminUserInfo := c.GetAdminUserInfo()
213 213
 	users, _ := service.GetAllAdminUsersTwo(adminUserInfo.CurrentOrgId)
214
+	operators, _ := service.GetAdminUserEsOne(adminUserInfo.CurrentOrgId)
214 215
 	c.ServeSuccessJSON(map[string]interface{}{
215
-		"users": users,
216
+		"users":     users,
217
+		"operators": operators,
216 218
 	})
217 219
 	return
218 220
 }

+ 8 - 0
controllers/his_config_api_controller.go View File

@@ -27,6 +27,7 @@ const (
27 27
 
28 28
 func HisConfigApiRegistRouters() {
29 29
 	beego.Router("/api/his/patient/list", &HisConfigApiController{}, "get:GetAllHisPatientsList")
30
+	beego.Router("/api/his/patient/getpatientlisttwenty", &HisConfigApiController{}, "get:GetPatientListTwenty")
30 31
 	beego.Router("/api/his/prescriptiontemplate/list", &HisConfigApiController{}, "get:GetPrescriptionTemplateList")
31 32
 	beego.Router("/api/his/prescriptiontemplate/info", &HisConfigApiController{}, "get:GetPrescriptionTemplateInfo")
32 33
 	beego.Router("/api/his/prescriptiontemplate/create", &HisConfigApiController{}, "post:CreatePrescriptionTemplate") //批量添加
@@ -66,6 +67,13 @@ func (c *HisConfigApiController) GetAllHisPatientsList() {
66 67
 	})
67 68
 }
68 69
 
70
+func (c *HisConfigApiController) GetPatientListTwenty() {
71
+	patients, _, _ := service.GetAllPatientListTwenty(c.GetAdminUserInfo().CurrentOrgId)
72
+	c.ServeSuccessJSON(map[string]interface{}{
73
+		"list": patients,
74
+	})
75
+}
76
+
69 77
 func (c *HisConfigApiController) GetPrescriptionTemplateList() {
70 78
 	patient_id, _ := c.GetInt64("patient_id", 0)
71 79
 	page, _ := c.GetInt64("page", 0)

+ 6 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -5127,6 +5127,7 @@ func (c *DialysisAPIController) GetDialysisGoods() {
5127 5127
 
5128 5128
 	project, _ := service.GetHisPrescriptionProject(adminUser.Org.Id, patient_id, date.Unix())
5129 5129
 
5130
+	_, config := service.FindXTHisRecordByOrgId(adminUser.Org.Id)
5130 5131
 	//获取当天该病人的透析处方
5131 5132
 	prescribe, parseDateErr := service.GetDialysisPrescribe(adminUser.Org.Id, patient_id, date.Unix())
5132 5133
 	good_info, _ := service.FindAllGoodInfo(adminUser.Org.Id)
@@ -5150,6 +5151,7 @@ func (c *DialysisAPIController) GetDialysisGoods() {
5150 5151
 			"prescribe":        prescribe,
5151 5152
 			"good_info":        good_info,
5152 5153
 			"warehouseOutList": warehouseOutList,
5154
+			"config":           config,
5153 5155
 		})
5154 5156
 		return
5155 5157
 
@@ -5176,6 +5178,7 @@ func (c *DialysisAPIController) GetDialysisGoods() {
5176 5178
 				"good_info":        good_info,
5177 5179
 				"project":          project,
5178 5180
 				"warehouseOutList": warehouseOutList,
5181
+				"config":           config,
5179 5182
 			})
5180 5183
 			return
5181 5184
 
@@ -5250,6 +5253,8 @@ func (c *DialysisAPIController) GetStockInGoodInfo() {
5250 5253
 	prescribe, parseDateErr := service.GetDialysisPrescribe(adminUser.Org.Id, patient_id, date.Unix())
5251 5254
 
5252 5255
 	outInfo, _ := service.GetGoodWarehouseOutInfo(adminUser.Org.Id, patient_id, date.Unix())
5256
+
5257
+	_, configs := service.FindXTHisRecordByOrgId(adminUser.Org.Id)
5253 5258
 	c.ServeSuccessJSON(map[string]interface{}{
5254 5259
 		"good_type":      goodTypes,
5255 5260
 		"good_user":      goodUser,
@@ -5258,6 +5263,7 @@ func (c *DialysisAPIController) GetStockInGoodInfo() {
5258 5263
 		"project":        project,
5259 5264
 		"prescription":   prescribe,
5260 5265
 		"outInfo":        outInfo,
5266
+		"configs":        configs,
5261 5267
 	})
5262 5268
 	return
5263 5269
 

+ 12 - 0
controllers/mobile_api_controllers/patient_api_controller.go View File

@@ -2766,6 +2766,18 @@ func predialysisEvaluationFormData(evaluation *models.PredialysisEvaluation, dat
2766 2766
 
2767 2767
 		evaluation.WeightBeforRemake = weight_befor_remake
2768 2768
 	}
2769
+
2770
+	if dataBody["height"] != nil && reflect.TypeOf(dataBody["height"]).String() == "string" {
2771
+		height := dataBody["height"].(string)
2772
+
2773
+		evaluation.Height = height
2774
+	}
2775
+
2776
+	if dataBody["age"] != nil && reflect.TypeOf(dataBody["age"]).String() == "string" {
2777
+		age := dataBody["age"].(string)
2778
+
2779
+		evaluation.Age = age
2780
+	}
2769 2781
 	return
2770 2782
 }
2771 2783
 

+ 6 - 0
controllers/patient_api_controller.go View File

@@ -365,6 +365,7 @@ func (c *PatientApiController) CreatePatient() {
365 365
 		UserSysBeforeCount:           patient.UserSysBeforeCount,
366 366
 		TrobleShoot:                  patient.TrobleShoot,
367 367
 		TreatmentPlan:                patient.TreatmentPlan,
368
+		Doctor:                       patient.Doctor,
368 369
 	}
369 370
 
370 371
 	err = service.CreatePatientsNew(&patientsNew)
@@ -4447,6 +4448,11 @@ func patientFormData(patient *models.Patients, data []byte, method string) (cont
4447 4448
 		treatment_plan := patientBody["treatment_plan"].(string)
4448 4449
 		patient.TreatmentPlan = treatment_plan
4449 4450
 	}
4451
+
4452
+	if patientBody["doctor"] != nil && reflect.TypeOf(patientBody["doctor"]).String() == "float64" {
4453
+		doctor := int64(patientBody["doctor"].(float64))
4454
+		patient.Doctor = doctor
4455
+	}
4450 4456
 	return
4451 4457
 }
4452 4458
 

+ 2 - 0
models/dialysis.go View File

@@ -321,6 +321,8 @@ type PredialysisEvaluation struct {
321 321
 	UreaBefor                      string  `gorm:"column:urea_befor" json:"urea_befor" form:"urea_befor"`
322 322
 	Suction                        string  `gorm:"column:suction" json:"suction" form:"suction"`
323 323
 	WeightBeforRemake              string  `gorm:"column:weight_befor_remake" json:"weight_befor_remake" form:"weight_befor_remake"`
324
+	Height                         string  `gorm:"column:height" json:"height" form:"height"`
325
+	Age                            string  `gorm:"column:age" json:"age" form:"age"`
324 326
 }
325 327
 
326 328
 func (PredialysisEvaluation) TableName() string {

+ 2 - 0
models/patient_models.go View File

@@ -192,6 +192,7 @@ type Patients struct {
192 192
 	DryWeight                float64 `gorm:"-"`
193 193
 	ZbPatientId              string  `gorm:"column:zb_patient_id" json:"zb_patient_id" form:"zb_patient_id"`
194 194
 	TreatmentPlan            string  `gorm:"column:treatment_plan" json:"treatment_plan" form:"treatment_plan"`
195
+	Doctor                   int64   `gorm:"column:doctor" json:"doctor" form:"doctor"`
195 196
 }
196 197
 
197 198
 func (Patients) TableName() string {
@@ -749,6 +750,7 @@ type XtPatientsNew struct {
749 750
 	DeathTime                    int64   `gorm:"column:death_time" json:"death_time" form:"death_time"`
750 751
 	TrobleShoot                  int64   `gorm:"column:troble_shoot" json:"troble_shoot" form:"troble_shoot"`
751 752
 	TreatmentPlan                string  `gorm:"column:treatment_plan" json:"treatment_plan" form:"treatment_plan"`
753
+	Doctor                       int64   `gorm:"column:doctor" json:"doctor" form:"doctor"`
752 754
 }
753 755
 
754 756
 func (XtPatientsNew) TableName() string {

+ 1 - 1
service/new_warehouse_service.go View File

@@ -2070,6 +2070,6 @@ func FindeGoodInfo(orgid int64, id int64) (models.GoodInformation, error) {
2070 2070
 func UpdateHisPrescriptionProjectStatus(project_id int64, record_time int64, user_org_id int64, patient_id int64) (models.HisPrescriptionProject, error) {
2071 2071
 
2072 2072
 	project := models.HisPrescriptionProject{}
2073
-	err := XTWriteDB().Model(&project).Where("project_id  = ? and record_date = ? and user_org_id = ? and patient_id = ? and status = 1", project_id, record_time, user_org_id, patient_id).Update(map[string]interface{}{"is_out": 2}).Error
2073
+	err := XTWriteDB().Model(&project).Where("project_id  = ? and record_date = ? and user_org_id = ? and patient_id = ? and status = 1", project_id, record_time, user_org_id, patient_id).Update(map[string]interface{}{"is_out": 1}).Error
2074 2074
 	return project, err
2075 2075
 }

+ 8 - 0
service/patient_service.go View File

@@ -80,6 +80,14 @@ func GetAllPatientList(orgID int64) (patients []*models.Patients, total int64, e
80 80
 	return
81 81
 }
82 82
 
83
+func GetAllPatientListTwenty(orgID int64) (patients []*models.Patients, total int64, err error) {
84
+
85
+	db := readDb.Table("xt_patients as p").Where("p.user_org_id=? and p.status=1 and p.lapseto = 1", orgID)
86
+
87
+	err = db.Select(" p.id, p.user_org_id, p.user_id, p.patient_type, p.dialysis_no, p.admission_number, p.source, p.lapseto, p.partition_id, p.bed_id, p.name, p.alias, p.gender, p.marital_status, p.id_card_no, p.birthday, p.reimbursement_way_id, p.health_care_type, p.health_care_no, p.health_care_due_date, p.height, p.blood_type, p.rh, p.health_care_due_alert_date, p.education_level, p.profession, p.phone, p.home_telephone, p.relative_phone, p.relative_relations, p.home_address, p.work_unit, p.unit_address, p.children, p.receiving_date, p.is_hospital_first_dialysis, p.first_dialysis_date, p.first_dialysis_hospital, p.induction_period, p.initial_dialysis, p.total_dialysis, p.attending_doctor_id, p.head_nurse_id, p.evaluate, p.diagnose, p.remark, p.registrars_id, p.registrars, p.qr_code, p.binding_state, p.status, p.created_time, p.updated_time").Count(&total).Find(&patients).Error
88
+	return
89
+}
90
+
83 91
 func GetAllPatientListSix(orgID int64) (patients []*models.MSchedualPatientList, err error) {
84 92
 
85 93
 	err = XTReadDB().Model(&patients).Where("user_org_id = ? and status = 1", orgID).Find(&patients).Error