XMLWAN 4 anni fa
parent
commit
3f76775859
2 ha cambiato i file con 29 aggiunte e 1 eliminazioni
  1. 28 0
      models/his_models.go
  2. 1 1
      service/his_project_service.go

+ 28 - 0
models/his_models.go Vedi File

@@ -294,6 +294,7 @@ type HisPrescription struct {
294 294
 	HisPatient             VMHisPatient              `gorm:"ForeignKey:PatientId;AssociationForeignKey:patient_id" json:"hisPatient"`
295 295
 	HisDoctorAdviceInfo    []*HisDoctorAdviceInfo    `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"advices"`
296 296
 	HisPrescriptionProject []*HisPrescriptionProject `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"project"`
297
+	XtHisAdditionalCharge  []*XtHisAdditionalCharge  `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"additionalcharge"`
297 298
 }
298 299
 
299 300
 func (HisPrescription) TableName() string {
@@ -802,3 +803,30 @@ type XtHisTreatmentTemplate struct {
802 803
 func (XtHisTreatmentTemplate) TableName() string {
803 804
 	return "xt_his_treatment_template"
804 805
 }
806
+
807
+type XtHisAdditionalCharge struct {
808
+	ID                 int64   `gorm:"column:id" json:"id" form:"id"`
809
+	PatientId          int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
810
+	Price              float64 `gorm:"column:price" json:"price" form:"price"`
811
+	AdminUserId        int64   `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
812
+	UserOrgId          int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
813
+	RecordDate         int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
814
+	CreatedTime        int64   `gorm:"column:created_time" json:"created_time" form:"created_time"`
815
+	UpdatedTime        int64   `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
816
+	Status             int64   `gorm:"column:status" json:"status" form:"status"`
817
+	ItemName           string  `gorm:"column:item_name" json:"item_name" form:"item_name"`
818
+	HisPatientId       int64   `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
819
+	ItemId             int64   `gorm:"column:item_id" json:"item_id" form:"item_id"`
820
+	Creator            int64   `gorm:"column:creator" json:"creator" form:"creator"`
821
+	Modifier           int64   `gorm:"column:modifier" json:"modifier" form:"modifier"`
822
+	BatchNumber        string  `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
823
+	OrderStatus        int64   `gorm:"column:order_status" json:"order_status" form:"order_status"`
824
+	PrescriptionNumber string  `gorm:"column:prescription_number" json:"prescription_number" form:"prescription_number"`
825
+	FeedetlSn          string  `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
826
+	PrescriptionId     int64   `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
827
+	Count              int64   `gorm:"column:count" json:"count" form:"count"`
828
+}
829
+
830
+func (XtHisAdditionalCharge) TableName() string {
831
+	return "his_additional_charge"
832
+}

+ 1 - 1
service/his_project_service.go Vedi File

@@ -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) (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").Preload("HisDoctorAdviceInfo", "status = 1").Preload("HisPrescriptionProject", "status = 1").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").Preload("HisDoctorAdviceInfo", "status = 1").Preload("HisPrescriptionProject", "status = 1").Preload("XtHisAdditionalCharge", "status = 1").Find(&prescription).Error
393 393
 	//err = XTReadDB().Model(&prescription).Where("patient_id = ? and status = 1 and advice_date = ? and prescription_id = ?", his_patient_id, recorddate, prescription_id).Find(&prescription).Error
394 394
 	return prescription, err
395 395
 }