소스 검색

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

28169 6 일 전
부모
커밋
cbe7b1366e
4개의 변경된 파일71개의 추가작업 그리고 13개의 파일을 삭제
  1. 54 0
      go.mod
  2. 12 8
      models/his_charge_models.go
  3. 2 2
      service/his_charge_service.go
  4. 3 3
      service/his_summary_service.go

+ 54 - 0
go.mod 파일 보기

@@ -0,0 +1,54 @@
1
+module XT_New
2
+
3
+go 1.22.2
4
+
5
+require (
6
+	github.com/astaxie/beego v1.12.3
7
+	github.com/go-redis/redis v6.15.9+incompatible
8
+	github.com/jinzhu/gorm v1.9.16
9
+	github.com/mozillazg/go-pinyin v0.20.0
10
+	github.com/robfig/cron v1.2.0
11
+	github.com/shopspring/decimal v1.4.0
12
+	golang.org/x/sync v0.8.0
13
+)
14
+
15
+require (
16
+	github.com/andybalholm/brotli v1.0.1 // indirect
17
+	github.com/beorn7/perks v1.0.1 // indirect
18
+	github.com/cespare/xxhash/v2 v2.1.1 // indirect
19
+	github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
20
+	github.com/gaodengyun/goldencloud-sdk-go v0.0.0-20210105054202-d73593575e57 // indirect
21
+	github.com/go-sql-driver/mysql v1.5.0 // indirect
22
+	github.com/golang/protobuf v1.4.2 // indirect
23
+	github.com/golang/snappy v0.0.2 // indirect
24
+	github.com/hashicorp/golang-lru v0.5.4 // indirect
25
+	github.com/jinzhu/inflection v1.0.0 // indirect
26
+	github.com/json-iterator/go v1.1.10 // indirect
27
+	github.com/klauspost/compress v1.11.4 // indirect
28
+	github.com/klauspost/pgzip v1.2.5 // indirect
29
+	github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
30
+	github.com/mholt/archiver/v3 v3.5.1 // indirect
31
+	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
32
+	github.com/modern-go/reflect2 v1.0.1 // indirect
33
+	github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
34
+	github.com/nwaples/rardecode v1.1.0 // indirect
35
+	github.com/pierrec/lz4/v4 v4.1.2 // indirect
36
+	github.com/prometheus/client_golang v1.7.0 // indirect
37
+	github.com/prometheus/client_model v0.2.0 // indirect
38
+	github.com/prometheus/common v0.10.0 // indirect
39
+	github.com/prometheus/procfs v0.1.3 // indirect
40
+	github.com/richardlehane/mscfb v1.0.4 // indirect
41
+	github.com/richardlehane/msoleps v1.0.4 // indirect
42
+	github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect
43
+	github.com/ulikunitz/xz v0.5.9 // indirect
44
+	github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
45
+	github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d // indirect
46
+	github.com/xuri/excelize/v2 v2.9.0 // indirect
47
+	github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 // indirect
48
+	golang.org/x/crypto v0.28.0 // indirect
49
+	golang.org/x/net v0.30.0 // indirect
50
+	golang.org/x/sys v0.26.0 // indirect
51
+	golang.org/x/text v0.19.0 // indirect
52
+	google.golang.org/protobuf v1.23.0 // indirect
53
+	gopkg.in/yaml.v2 v2.2.8 // indirect
54
+)

+ 12 - 8
models/his_charge_models.go 파일 보기

@@ -227,6 +227,7 @@ type HisChargeProject struct {
227 227
 	Unit            string `gorm:"column:unit" json:"unit" form:"unit"`
228 228
 	MedicalCoverage int64  `gorm:"column:medical_coverage" json:"medical_coverage" form:"medical_coverage"`
229 229
 	CostClassify    int64  `gorm:"column:cost_classify" json:"cost_classify" form:"cost_classify"`
230
+	MedicalCode     string `gorm:"column:medical_code" json:"medical_code" form:"medical_code"`
230 231
 }
231 232
 
232 233
 func (HisChargeProject) TableName() string {
@@ -234,13 +235,14 @@ func (HisChargeProject) TableName() string {
234 235
 }
235 236
 
236 237
 type HisChargeGoodInfo struct {
237
-	ID                    int64  `gorm:"column:id" json:"id" form:"id"`
238
-	GoodName              string `gorm:"column:good_name" json:"good_name" form:"good_name"`
239
-	GoodUnit              int64  `gorm:"column:good_unit" json:"good_unit"`
240
-	SpecificationnName    string `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
241
-	RegisterNumber        string `gorm:"column:register_number" json:"register_number" form:"register_number"`
242
-	PackingUnit           string `gorm:"column:packing_unit" json:"packing_unit" form:"packing_unit"`
243
-	MedicalInsuranceLevel int64  `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
238
+	ID                     int64  `gorm:"column:id" json:"id" form:"id"`
239
+	GoodName               string `gorm:"column:good_name" json:"good_name" form:"good_name"`
240
+	GoodUnit               int64  `gorm:"column:good_unit" json:"good_unit"`
241
+	SpecificationnName     string `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
242
+	RegisterNumber         string `gorm:"column:register_number" json:"register_number" form:"register_number"`
243
+	PackingUnit            string `gorm:"column:packing_unit" json:"packing_unit" form:"packing_unit"`
244
+	MedicalInsuranceLevel  int64  `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
245
+	MedicalInsuranceNumber string `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
244 246
 }
245 247
 
246 248
 func (HisChargeGoodInfo) TableName() string {
@@ -508,7 +510,9 @@ type NewPDetail struct {
508 510
 	ProjectId    string  `gorm:"column:project_id" json:"project_id" form:"project_id"`
509 511
 	ItemId       string  `gorm:"column:item_id" json:"item_id" form:"item_id"`
510 512
 	MdtrtId      string  `gorm:"column:mdtrt_id" json:"mdtrt_id" form:"mdtrt_id"`
511
-	AdviceDoctor int64   `gorm:"column:advice_doctor" json:"advice_doctor" form:"advice_doctor"`
513
+	CertNo       string  `gorm:"column:cert_no" json:"cert_no" form:"cert_no"`
514
+
515
+	AdviceDoctor int64 `gorm:"column:advice_doctor" json:"advice_doctor" form:"advice_doctor"`
512 516
 }
513 517
 
514 518
 type OrderSchedule struct {

+ 2 - 2
service/his_charge_service.go 파일 보기

@@ -1157,7 +1157,7 @@ func GetAllLisDataFor10191(org_id int64) (list []models.HisLabelPrintStatusInfo,
1157 1157
 }
1158 1158
 
1159 1159
 func GetHisPrescriptionDrugDetails(org_id int64, start_time_str string, end_time_str string, start_time int64, end_time int64, patient_id int64, item_type int64) (patients []*models.NewPDetail, err error) {
1160
-	db := readDb.Table("his_doctor_advice_info as oi").Select("oo.mdtrt_id as mdtrt_id,oi.advice_doctor as advice_doctor,oo.setl_time as setl_time, drug.id as item_id,1 as p_type,oi.id as advice_id,0 as project_id,pp.id as p_id,pp.name as p_name,FROM_UNIXTIME(o.`record_date`, '%Y-%m-%d') as record_date, drug.drug_type as item_cost_type,o.med_type as med_type,oi.`prescribing_number` as cnt,oi.`price` as pric,drug.drug_name as item_name,CONCAT(drug.dose, \"\", drug.dose_unit, \"*\", drug.min_number, \"\", drug.min_unit, \"/\", drug.max_unit) as spec,o.order_status as order_status,oi.`prescribing_number_unit` as unit").
1160
+	db := readDb.Table("his_doctor_advice_info as oi").Select("pp.id_card_no as cert_no, oo.mdtrt_id as mdtrt_id,oi.advice_doctor as advice_doctor,oo.setl_time as setl_time, drug.id as item_id,1 as p_type,oi.id as advice_id,0 as project_id,pp.id as p_id,pp.name as p_name,FROM_UNIXTIME(o.`record_date`, '%Y-%m-%d') as record_date, drug.drug_type as item_cost_type,o.med_type as med_type,oi.`prescribing_number` as cnt,oi.`price` as pric,drug.drug_name as item_name,CONCAT(drug.dose, \"\", drug.dose_unit, \"*\", drug.min_number, \"\", drug.min_unit, \"/\", drug.max_unit) as spec,o.order_status as order_status,oi.`prescribing_number_unit` as unit").
1161 1161
 		Joins("JOIN xt_base_drug drug ON oi.drug_id = drug.id ")
1162 1162
 	if patient_id == 0 {
1163 1163
 		db = db.Joins("JOIN xt_patients pp on oi.patient_id = pp.id")
@@ -1183,7 +1183,7 @@ func GetHisPrescriptionDrugDetails(org_id int64, start_time_str string, end_time
1183 1183
 }
1184 1184
 
1185 1185
 func GetHisPrescriptionProjectDetails(org_id int64, start_time_str string, end_time_str string, start_time int64, end_time int64, patient_id int64, item_type int64) (patients []*models.NewPDetail, err error) {
1186
-	db := readDb.Table("`his_prescription_project` AS oi").Select("oo.mdtrt_id as mdtrt_id,oi.doctor as advice_doctor,oo.setl_time as setl_time,(case oi.type\n\t\t\tWHEN 2 THEN\n\t\t\tproject.id\n\t\t\tWHEN 3 THEN\n\t\t\tgood.id END) AS item_id,oi.type as p_type,oi.id as project_id,0 as advice_id,pp.id as p_id,(case oi.type\n\t\t\tWHEN 2 THEN\n\t\t\tproject.`cost_classify`\n\t\t\tWHEN 3 THEN\n\t\t\t-100 END) AS item_cost_type,\n\t o.med_type as med_type,\n\t oi.count AS cnt,\n \t oi.price AS pric,\n \t pp.name AS p_name, \n \tFROM_UNIXTIME(o.`record_date`,'%Y-%m-%d') as record_date,\n\t\t (case oi.type\n\tWHEN 2 THEN\n\tproject.project_name\n\tWHEN 3 THEN\n\tgood.good_name END) AS item_name,\n\t\t (case oi.type\n\tWHEN 2 THEN\n\t\"\"\n\tWHEN 3 THEN\n\tgood.`specification_name` END) AS spec,\n\toi.`unit`  as unit,o.order_status as order_status")
1186
+	db := readDb.Table("`his_prescription_project` AS oi").Select("pp.id_card_no  as cert_no,oo.mdtrt_id as mdtrt_id,oi.doctor as advice_doctor,oo.setl_time as setl_time,(case oi.type\n\t\t\tWHEN 2 THEN\n\t\t\tproject.id\n\t\t\tWHEN 3 THEN\n\t\t\tgood.id END) AS item_id,oi.type as p_type,oi.id as project_id,0 as advice_id,pp.id as p_id,(case oi.type\n\t\t\tWHEN 2 THEN\n\t\t\tproject.`cost_classify`\n\t\t\tWHEN 3 THEN\n\t\t\t-100 END) AS item_cost_type,\n\t o.med_type as med_type,\n\t oi.count AS cnt,\n \t oi.price AS pric,\n \t pp.name AS p_name, \n \tFROM_UNIXTIME(o.`record_date`,'%Y-%m-%d') as record_date,\n\t\t (case oi.type\n\tWHEN 2 THEN\n\tproject.project_name\n\tWHEN 3 THEN\n\tgood.good_name END) AS item_name,\n\t\t (case oi.type\n\tWHEN 2 THEN\n\t\"\"\n\tWHEN 3 THEN\n\tgood.`specification_name` END) AS spec,\n\toi.`unit`  as unit,o.order_status as order_status")
1187 1187
 	db = db.Joins("LEFT JOIN xt_his_project project\n\tON oi.project_id = project.id").
1188 1188
 		Joins("LEFT JOIN xt_good_information good\n\tON oi.project_id = good.id\n")
1189 1189
 	//Joins("JOIN his_order ord ON o.batch_number = ord.number ")

+ 3 - 3
service/his_summary_service.go 파일 보기

@@ -16,9 +16,9 @@ func GetHisSummaryDetailList(keyword string, item_type int64, patient_id int64,
16 16
 						return db.Preload("Drug", "status = 1").Where("status = 1 ")
17 17
 					}).Preload("HisChargePrescriptionProject", func(db *gorm.DB) *gorm.DB {
18 18
 					return db.Select("id,project_id,user_org_id,status,patient_id,record_date,count,type,unit,remark").Preload("HisChargeProject", func(db *gorm.DB) *gorm.DB {
19
-						return db.Select("id,project_name,unit,medical_coverage,cost_classify").Where("status = 1 ")
19
+						return db.Select("id,project_name,unit,medical_coverage,cost_classify,medical_code").Where("status = 1 ")
20 20
 					}).Preload("HisChargeGoodInfo", func(db *gorm.DB) *gorm.DB {
21
-						return db.Select("id,good_name,good_unit,specification_name,packing_unit,medical_insurance_level").Where("status = 1 ")
21
+						return db.Select("id,good_name,good_unit,specification_name,packing_unit,medical_insurance_level,medical_insurance_number").Where("status = 1 ")
22 22
 					}).Where("status = 1 ")
23 23
 				})
24 24
 			}).Where("status = 1  AND ctime >= ? AND ctime <= ? AND user_org_id = ? AND order_status = 2", start_time, end_time, org_id)
@@ -345,7 +345,7 @@ func GetAllHisOrderList(org_id int64, patient_id int64, start_time int64, end_ti
345 345
 		db = db.Where("settle_accounts_date >=?", start_time)
346 346
 	}
347 347
 	if end_time > 0 {
348
-		db = db.Where("settle_accounts_date<=?", end_time)
348
+		db = db.Where("settle_accounts_date <=?", end_time)
349 349
 	}
350 350
 
351 351
 	err = db.Find(&order).Error