瀏覽代碼

耗材参数

XMLWAN 4 年之前
父節點
當前提交
60cda2bc41
共有 3 個文件被更改,包括 15 次插入2 次删除
  1. 13 0
      controllers/his_api_controller.go
  2. 1 1
      models/his_models.go
  3. 1 1
      service/his_project_service.go

+ 13 - 0
controllers/his_api_controller.go 查看文件

@@ -1352,9 +1352,22 @@ func (c *HisApiController) GetRegisterInfo() {
1352 1352
 			Idetinfo:    idetinfoStr,
1353 1353
 			PatientId:   patient.ID,
1354 1354
 			RecordDate:  theTime.Unix(),
1355
+			UserOrgId:   adminInfo.CurrentOrgId,
1356
+			AdminUserId: adminInfo.AdminUser.Id,
1357
+			IsReturn:    1,
1355 1358
 		}
1356 1359
 		fmt.Println(his)
1357 1360
 
1361
+		lastPatient, _ := service.GetLastPatient(adminInfo.CurrentOrgId)
1362
+		timeStr := time.Now().Format("2006-01-02")
1363
+		timeArr := strings.Split(timeStr, "-")
1364
+		var str = timeArr[0] + timeArr[1] + timeArr[2] + strconv.FormatInt(lastPatient.ID, 10)
1365
+
1366
+		hisPatient := models.HisPatient{
1367
+			Number: str,
1368
+		}
1369
+		err = service.UpdateHisPatient(lastPatient.ID, hisPatient)
1370
+
1358 1371
 		if res.Output.Iinfo == nil || len(res.Output.Iinfo) == 0 {
1359 1372
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeRegisterOneException)
1360 1373
 			return

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

@@ -317,7 +317,7 @@ type HisPrescription struct {
317 317
 	HisDoctorAdviceInfo    []*HisDoctorAdviceInfo    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"advices"`
318 318
 	HisPrescriptionProject []*HisPrescriptionProject `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"project"`
319 319
 	HisAdditionalCharge    []*HisAdditionalCharge    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"addition"`
320
-	//VMHisPrescriptionInfo  VMHisPrescriptionInfo     `gorm:"ForeignKey:PatientId,RecordDate;AssociationForeignKey:PatientId,ScheduleDate" json:"info"`
320
+	VMHisPrescriptionInfo  HisPrescriptionInfo       `gorm:"ForeignKey:PatientId,RecordDate;AssociationForeignKey:PatientId,ScheduleDate" json:"info"`
321 321
 }
322 322
 
323 323
 func (HisPrescription) TableName() string {

+ 1 - 1
service/his_project_service.go 查看文件

@@ -389,7 +389,7 @@ func GetHistPatient(orgid int64, keyword string) (hisPatient []*models.HisPatien
389 389
 
390 390
 func GetDoctorAdvicePrint(his_patient_id int64, recorddate int64, schIDs []string, orgid int64) (prescription []*models.HisPrescription, err error) {
391 391
 
392
-	err = XTReadDB().Model(&prescription).Where("patient_id = ? and record_date = ? and id in(?) and  status = 1 ", his_patient_id, recorddate, schIDs).Preload("Patients", "status = 1 and user_org_id = ?", orgid).Preload("HisDoctorAdviceInfo", "status = 1 and user_org_id = ?", orgid).Preload("HisPrescriptionProject", "status = 1 and user_org_id = ?", orgid).Preload("XtHisAdditionalCharge", "status = 1 and user_org_id = ?", orgid).Find(&prescription).Error
392
+	err = XTReadDB().Model(&prescription).Where("patient_id = ? and record_date = ? and id in(?) and  status = 1 ", his_patient_id, recorddate, schIDs).Preload("Patients", "status = 1 and user_org_id = ?", orgid).Preload("HisDoctorAdviceInfo", "status = 1 and user_org_id = ?", orgid).Preload("HisPrescriptionProject", "status = 1 and user_org_id = ?", orgid).Preload("VMHisPrescriptionInfo", "status =1 and user_org_id = ?", orgid).Preload("XtHisAdditionalCharge", "status = 1 and user_org_id = ?", orgid).Find(&prescription).Error
393 393
 
394 394
 	return prescription, err
395 395
 }