Преглед на файлове

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

csx преди 4 години
родител
ревизия
05a0f68f83
променени са 3 файла, в които са добавени 7 реда и са изтрити 6 реда
  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 Целия файл

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

+ 1 - 0
models/his_models.go Целия файл

315
 	HisDoctorAdviceInfo    []*HisDoctorAdviceInfo    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"advices"`
315
 	HisDoctorAdviceInfo    []*HisDoctorAdviceInfo    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"advices"`
316
 	HisPrescriptionProject []*HisPrescriptionProject `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"project"`
316
 	HisPrescriptionProject []*HisPrescriptionProject `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"project"`
317
 	HisAdditionalCharge    []*HisAdditionalCharge    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"addition"`
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
 func (HisPrescription) TableName() string {
321
 func (HisPrescription) TableName() string {

+ 1 - 0
service/his_service.go Целия файл

680
 		Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
680
 		Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
681
 			return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1")
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
 		Where("user_org_id = ? AND status = 1 AND record_date = ? AND patient_id = ?", org_id, record_date, patient_id).
684
 		Where("user_org_id = ? AND status = 1 AND record_date = ? AND patient_id = ?", org_id, record_date, patient_id).
684
 		Find(&prescription).Error
685
 		Find(&prescription).Error
685
 	return
686
 	return