test_user hace 2 años
padre
commit
be8cd22681

+ 2 - 1
controllers/his_api_controller.go Ver fichero

@@ -5228,6 +5228,7 @@ func (c *HisApiController) GetHisPrescriptionList() {
5228 5228
 	keywords := c.GetString("keywords")
5229 5229
 	page, _ := c.GetInt64("page")
5230 5230
 	limit, _ := c.GetInt64("limit")
5231
+	sch_type, _ := c.GetInt64("sch_type")
5231 5232
 
5232 5233
 	timeLayout := "2006-01-02"
5233 5234
 	loc, _ := time.LoadLocation("Local")
@@ -5238,7 +5239,7 @@ func (c *HisApiController) GetHisPrescriptionList() {
5238 5239
 	}
5239 5240
 	recordDateTime := theTime.Unix()
5240 5241
 	adminInfo := c.GetAdminUserInfo()
5241
-	prescriptionOrder, err, total := service.GetNewHisPatientPrescriptionList(adminInfo.CurrentOrgId, keywords, recordDateTime, page, limit)
5242
+	prescriptionOrder, err, total := service.GetNewHisPatientPrescriptionList(adminInfo.CurrentOrgId, keywords, recordDateTime, page, limit, sch_type)
5242 5243
 
5243 5244
 	//adminInfo := c.GetAdminUserInfo()
5244 5245
 	//prescriptionOrder, err := service.GetHisPrescriptionOrderList(adminInfo.CurrentOrgId)

+ 0 - 4
controllers/his_project_api_controller.go Ver fichero

@@ -1239,10 +1239,6 @@ func (this *HisProjectApiController) GetDoctorAdvicePrint() {
1239 1239
 	schIDStr := this.GetString("ids")
1240 1240
 	p_type, _ := this.GetInt64("p_type")
1241 1241
 
1242
-	if len(schIDStr) == 0 {
1243
-		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1244
-		return
1245
-	}
1246 1242
 	idStrs := strings.Split(schIDStr, ",")
1247 1243
 
1248 1244
 	timeLayout := "2006-01-02"

+ 12 - 9
models/his_print_models.go Ver fichero

@@ -1,15 +1,18 @@
1 1
 package models
2 2
 
3 3
 type PrintPatient struct {
4
-	ID                      int64                   `gorm:"column:id" json:"id" form:"id"`
5
-	UserOrgId               int64                   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
6
-	Name                    string                  `gorm:"column:name" json:"name" form:"name"`
7
-	Age                     string                  `gorm:"column:age" json:"age" form:"age"`
8
-	Gender                  int64                   `gorm:"column:gender" json:"gender" form:"gender"`
9
-	HomeAddress             string                  `gorm:"column:home_address" json:"home_address" form:"home_address"`
10
-	Phone                   string                  `gorm:"column:phone" json:"phone" form:"phone"`
11
-	Lapseto                 int64                   `gorm:"column:lapseto" json:"lapseto" form:"lapseto"`
12
-	Status                  int64                   `gorm:"column:status" json:"status" form:"status"`
4
+	ID                 int64  `gorm:"column:id" json:"id" form:"id"`
5
+	UserOrgId          int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
6
+	Name               string `gorm:"column:name" json:"name" form:"name"`
7
+	Age                string `gorm:"column:age" json:"age" form:"age"`
8
+	Gender             int64  `gorm:"column:gender" json:"gender" form:"gender"`
9
+	HomeAddress        string `gorm:"column:home_address" json:"home_address" form:"home_address"`
10
+	Phone              string `gorm:"column:phone" json:"phone" form:"phone"`
11
+	Lapseto            int64  `gorm:"column:lapseto" json:"lapseto" form:"lapseto"`
12
+	Status             int64  `gorm:"column:status" json:"status" form:"status"`
13
+	ReimbursementWayId int64  `gorm:"column:reimbursement_way_id" json:"reimbursement_way_id" form:"reimbursement_way_id"`
14
+	Birthday           int64  `gorm:"column:birthday" json:"birthday" form:"birthday"`
15
+
13 16
 	HisPrintPatient         HisPrintPatient         `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"his_patient"`
14 17
 	HisHospitalCheckRecord  HisHospitalCheckRecord  `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"his_record_patient"`
15 18
 	HisPrescriptionInfoTwo  HisPrescriptionInfoTwo  `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"info"`

+ 6 - 2
service/his_service.go Ver fichero

@@ -1396,17 +1396,21 @@ func DelelteAddition(id int64, user_org_id int64) (err error) {
1396 1396
 	return
1397 1397
 }
1398 1398
 
1399
-func GetNewHisPatientPrescriptionList(org_id int64, keywords string, record_date int64, page int64, limit int64) (patients []*VMHisHospitalPrescriptionInfo, err error, total int64) {
1399
+func GetNewHisPatientPrescriptionList(org_id int64, keywords string, record_date int64, page int64, limit int64, sch_type int64) (patients []*VMHisHospitalPrescriptionInfo, err error, total int64) {
1400 1400
 	offset := (page - 1) * limit
1401 1401
 	db := readDb.Model(&VMHisHospitalPrescriptionInfo{}).Where("his_prescription_info.user_org_id = ? AND his_prescription_info.status = 1 AND his_prescription_info.record_date = ? AND his_prescription_info.p_type <> 1 ", org_id, record_date)
1402
+
1402 1403
 	if len(keywords) > 0 {
1403 1404
 		keywords = "%" + keywords + "%"
1404 1405
 		db = db.Joins("JOIN xt_patients  On his_prescription_info.patient_id = xt_patients.id  AND xt_patients.name like ?", keywords)
1405 1406
 	}
1407
+	if sch_type > 0 {
1408
+		db = db.Joins("JOIN xt_schedule  On xt_schedule.status = 1 AND his_prescription_info.patient_id = xt_schedule.patient_id AND xt_schedule.schedule_date = ?  AND xt_schedule.schedule_type = ?", record_date, sch_type)
1409
+	}
1406 1410
 	db = db.Preload("Patients", "xt_patients.user_org_id = ? AND xt_patients.status = 1", org_id)
1407 1411
 	db = db.Preload("HisPrescription", "his_prescription.user_org_id = ? AND his_prescription.status = 1 AND his_prescription.p_type <> 1", org_id)
1408 1412
 	db = db.Count(&total)
1409
-	err = db.Limit(limit).Offset(offset).Find(&patients).Error
1413
+	err = db.Limit(limit).Offset(offset).Group("his_prescription_info.id").Find(&patients).Error
1410 1414
 	return
1411 1415
 }
1412 1416