Browse Source

Merge branch '20201014_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20201014_xt_api_new_branch

csx 4 years ago
parent
commit
05a0f68f83
3 changed files with 7 additions and 6 deletions
  1. 5 6
      controllers/his_project_api_controller.go
  2. 1 0
      models/his_models.go
  3. 1 0
      service/his_service.go

+ 5 - 6
controllers/his_project_api_controller.go View File

@@ -1041,9 +1041,8 @@ func (this *HisProjectApiController) GetDoctorAdvicePrint() {
1041 1041
 	adminUserInfo := this.GetAdminUserInfo()
1042 1042
 	advicePrint, err := service.GetDoctorAdvicePrint(patient_id, recordDateTime, idStrs, adminUserInfo.CurrentOrgId)
1043 1043
 	projectlist, err := service.GetAllProjectList(adminUserInfo.CurrentOrgId)
1044
-	//doctorPorject, err := service.GetDoctorProjectItem(patient_id, recordDateTime)
1045
-	//patient, err := service.GetBloodPatientByPatient(patient_id)
1046
-	//prescriptionInfo, err := service.GetPrscriptionInfo(patient_id, recordDateTime)
1044
+	//prescriptionInfo, _ := service.GetPrscriptionInfo(patient_id, recordDateTime)
1045
+	hisPatient, _ := service.GetHisPatientById(patient_id)
1047 1046
 	if err != nil {
1048 1047
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
1049 1048
 		return
@@ -1051,9 +1050,7 @@ func (this *HisProjectApiController) GetDoctorAdvicePrint() {
1051 1050
 	this.ServeSuccessJSON(map[string]interface{}{
1052 1051
 		"advicePrint": advicePrint,
1053 1052
 		"projectlist": projectlist,
1054
-		//"patient":          patient,
1055
-		//"doctorPorject":    doctorPorject,
1056
-		//"prescriptionInfo": prescriptionInfo,
1053
+		"hisPatient":  hisPatient,
1057 1054
 	})
1058 1055
 }
1059 1056
 
@@ -1324,6 +1321,7 @@ func (this *HisProjectApiController) GetChargePrint() {
1324 1321
 	chargePrint, err := service.GetChargePrint(recordDateTime, patient_id, adminUserInfo.CurrentOrgId)
1325 1322
 	prescription, err := service.GetHisPrescriptionNight(adminUserInfo.CurrentOrgId, patient_id, recordDateTime, prescription_id)
1326 1323
 	patient, err := service.GetPatientByID(adminUserInfo.CurrentOrgId, patient_id)
1324
+	hisPatient, err := service.GetHisPatientById(patient_id)
1327 1325
 	if err != nil {
1328 1326
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
1329 1327
 		return
@@ -1332,6 +1330,7 @@ func (this *HisProjectApiController) GetChargePrint() {
1332 1330
 		"list":         chargePrint,
1333 1331
 		"prescription": prescription,
1334 1332
 		"patient":      patient,
1333
+		"hisPatient":   hisPatient,
1335 1334
 	})
1336 1335
 }
1337 1336
 

+ 1 - 0
models/his_models.go View File

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

+ 1 - 0
service/his_service.go View File

@@ -680,6 +680,7 @@ func GetHisPrescriptionNight(org_id int64, patient_id int64, record_date int64,
680 680
 		Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
681 681
 			return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1")
682 682
 		}).
683
+		Preload("HisAdditionalCharge", "status = 1 AND user_org_id = ?", org_id).
683 684
 		Where("user_org_id = ? AND status = 1 AND record_date = ? AND patient_id = ?", org_id, record_date, patient_id).
684 685
 		Find(&prescription).Error
685 686
 	return