|
@@ -3,6 +3,7 @@ package service
|
3
|
3
|
import (
|
4
|
4
|
"XT_New/models"
|
5
|
5
|
"github.com/jinzhu/gorm"
|
|
6
|
+ "strings"
|
6
|
7
|
"time"
|
7
|
8
|
)
|
8
|
9
|
|
|
@@ -1082,3 +1083,57 @@ func GetHisPrescriptionByPatientID(patientID int64, orgID int64) (info models.Hi
|
1082
|
1083
|
err = readDb.Model(&models.HisPrescriptionInfo{}).Where("user_org_id = ? AND patient_id = ? AND status = 1", orgID, patientID).Preload("XtHisDepartment", "status = 1").Last(&info).Error
|
1083
|
1084
|
return
|
1084
|
1085
|
}
|
|
1086
|
+
|
|
1087
|
+type VMHisProjectTeam struct {
|
|
1088
|
+ ID int64 `gorm:"column:id" json:"id" form:"id"`
|
|
1089
|
+ ProjectTeam string `gorm:"column:project_team" json:"project_team" form:"project_team"`
|
|
1090
|
+ Price float64 `gorm:"column:price" json:"price" form:"price"`
|
|
1091
|
+ Pinyin string `gorm:"column:pinyin" json:"pinyin" form:"pinyin"`
|
|
1092
|
+ Wubi string `gorm:"column:wubi" json:"wubi" form:"wubi"`
|
|
1093
|
+ TubeColor int64 `gorm:"column:tube_color" json:"tube_color" form:"tube_color"`
|
|
1094
|
+ TeamType int64 `gorm:"column:team_type" json:"team_type" form:"team_type"`
|
|
1095
|
+ Remark string `gorm:"column:remark" json:"remark" form:"remark"`
|
|
1096
|
+ UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
|
1097
|
+ Status int64 `gorm:"column:status" json:"status" form:"status"`
|
|
1098
|
+ CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
|
|
1099
|
+ UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
|
|
1100
|
+ ProjectId string `gorm:"column:project_id" json:"project_id" form:"project_id"`
|
|
1101
|
+ VMHisProject []*VMHisProject
|
|
1102
|
+}
|
|
1103
|
+
|
|
1104
|
+func (VMHisProjectTeam) TableName() string {
|
|
1105
|
+ return "xt_his_project_team"
|
|
1106
|
+}
|
|
1107
|
+
|
|
1108
|
+type VMHisProject struct {
|
|
1109
|
+ ID int64 `gorm:"column:id" json:"id" form:"id"`
|
|
1110
|
+ ProjectName string `gorm:"column:project_name" json:"project_name" form:"project_name"`
|
|
1111
|
+ Price float64 `gorm:"column:price" json:"price" form:"price"`
|
|
1112
|
+ Unit string `gorm:"column:unit" json:"unit" form:"unit"`
|
|
1113
|
+ CostClassify int64 `gorm:"column:cost_classify" json:"cost_classify" form:"cost_classify"`
|
|
1114
|
+ StatisticalClassification int64 `gorm:"column:statistical_classification" json:"statistical_classification" form:"statistical_classification"`
|
|
1115
|
+ UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
|
|
1116
|
+ Status int64 `gorm:"column:status" json:"status" form:"status"`
|
|
1117
|
+ SingleDose string `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
|
|
1118
|
+ ExecutionFrequency string `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
|
|
1119
|
+ DeliveryWay string `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
|
|
1120
|
+ NumberDays string `gorm:"column:number_days" json:"number_days" form:"number_days"`
|
|
1121
|
+ MedicalCode string `gorm:"column:medical_code" json:"medical_code" form:"medical_code"`
|
|
1122
|
+}
|
|
1123
|
+
|
|
1124
|
+func (VMHisProject) TableName() string {
|
|
1125
|
+ return "xt_his_project"
|
|
1126
|
+}
|
|
1127
|
+
|
|
1128
|
+func GetAllProjectTeamList(orgid int64) (project []*VMHisProjectTeam, err error) {
|
|
1129
|
+ err = XTReadDB().Model(&VMHisProjectTeam{}).Where("user_org_id = ? and status = 1", orgid).Find(&project).Error
|
|
1130
|
+ for _, item := range project {
|
|
1131
|
+ var project_item *VMHisProject
|
|
1132
|
+ ids := strings.Split(item.ProjectId, ",")
|
|
1133
|
+ for _, id := range ids {
|
|
1134
|
+ XTReadDB().Model(&VMSchedule{}).Where("user_org_id = ? and status = 1 AND id = ?", id).First(&project_item)
|
|
1135
|
+ item.VMHisProject = append(item.VMHisProject, project_item)
|
|
1136
|
+ }
|
|
1137
|
+ }
|
|
1138
|
+ return
|
|
1139
|
+}
|