Browse Source

Merge remote-tracking branch 'origin/20220812' into 20220812

XMLWAN 2 years ago
parent
commit
ae9ec00420

+ 4 - 0
enums/error_code.go View File

@@ -260,6 +260,8 @@ const ( // ErrorCode
260 260
 
261 261
 	ErrorCodeDeleteMedicineWrong   = 3900003
262 262
 	ErrorCodeDeletePChargeWrongTwo = 3900004
263
+
264
+	ErrorCodeHisPatientNoRegException = 4000000
263 265
 )
264 266
 
265 267
 var ErrCodeMsgs = map[int]string{
@@ -508,6 +510,8 @@ var ErrCodeMsgs = map[int]string{
508 510
 	ErrorCodeDeletePChargeWrong:    "处方中包含收费处方或已经上传的处方,无法删除",
509 511
 	ErrorCodeDeleteMedicineWrong:   "该药品已经发药,无法删除",
510 512
 	ErrorCodeDeletePChargeWrongTwo: "该医嘱所属处方已经收费或已经上传的处方,无法删除",
513
+
514
+	ErrorCodeHisPatientNoRegException: "该患者尚未挂号,请先挂号",
511 515
 }
512 516
 
513 517
 type SGJError struct {

+ 1 - 0
models/dialysis.go View File

@@ -1181,6 +1181,7 @@ type HisDoctorAdvice struct {
1181 1181
 	Way                   int64              `gorm:"column:way" json:"way" form:"way"`
1182 1182
 	DrugId                int64              `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
1183 1183
 	DrugNameId            int64              `gorm:"column:drug_name_id" json:"drug_name_id" form:"drug_name_id"`
1184
+	ExecutionFrequencyId  int64              `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
1184 1185
 }
1185 1186
 
1186 1187
 func (HisDoctorAdvice) TableName() string {

+ 1 - 0
models/drug_pharmacy_management_models.go View File

@@ -195,6 +195,7 @@ type PharmacyHisDoctorAdviceInfo struct {
195 195
 	IsMedicine            int64   `gorm:"column:is_medicine" json:"is_medicine" form:"is_medicine"`
196 196
 	Mtime                 int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
197 197
 	AdviceId              int64   `gorm:"column:advice_id" json:"advice_id" form:"advice_id"`
198
+	ExecutionFrequencyId  int64   `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
198 199
 }
199 200
 
200 201
 func (PharmacyHisDoctorAdviceInfo) TableName() string {

+ 14 - 12
models/his_charge_models.go View File

@@ -1,18 +1,19 @@
1 1
 package models
2 2
 
3 3
 type HisChargePrescriptionProject struct {
4
-	ID                int64             `gorm:"column:id" json:"id" form:"id"`
5
-	ProjectId         int64             `gorm:"column:project_id" json:"project_id" form:"project_id"`
6
-	UserOrgId         int64             `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
7
-	Status            int64             `gorm:"column:status" json:"status" form:"status"`
8
-	PatientId         int64             `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
9
-	RecordDate        int64             `gorm:"column:record_date" json:"record_date" form:"record_date"`
10
-	Count             string            `gorm:"column:count" json:"count" form:"count"`
11
-	Type              int64             `gorm:"column:type" json:"type" form:"type"`
12
-	Unit              string            `gorm:"column:unit" json:"unit" form:"unit"`
13
-	Remark            string            `gorm:"column:remark" json:"remark" form:"remark"`
14
-	HisChargeProject  HisChargeProject  `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"project"`
15
-	HisChargeGoodInfo HisChargeGoodInfo `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"good_info"`
4
+	ID                   int64             `gorm:"column:id" json:"id" form:"id"`
5
+	ProjectId            int64             `gorm:"column:project_id" json:"project_id" form:"project_id"`
6
+	UserOrgId            int64             `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
7
+	Status               int64             `gorm:"column:status" json:"status" form:"status"`
8
+	PatientId            int64             `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
9
+	RecordDate           int64             `gorm:"column:record_date" json:"record_date" form:"record_date"`
10
+	Count                string            `gorm:"column:count" json:"count" form:"count"`
11
+	Type                 int64             `gorm:"column:type" json:"type" form:"type"`
12
+	Unit                 string            `gorm:"column:unit" json:"unit" form:"unit"`
13
+	Remark               string            `gorm:"column:remark" json:"remark" form:"remark"`
14
+	HisChargeProject     HisChargeProject  `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"project"`
15
+	HisChargeGoodInfo    HisChargeGoodInfo `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"good_info"`
16
+	ExecutionFrequencyId int64             `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
16 17
 }
17 18
 
18 19
 func (HisChargePrescriptionProject) TableName() string {
@@ -31,6 +32,7 @@ type HisChargeDoctorAdviceInfo struct {
31 32
 	AdviceDate            int64  `gorm:"column:advice_date" json:"advice_date" form:"advice_date"`
32 33
 	Drug                  Drug   `gorm:"ForeignKey:ID;AssociationForeignKey:DrugId" json:"drug"`
33 34
 	IsMedicine            int64  `gorm:"column:is_medicine" json:"is_medicine" form:"is_medicine"`
35
+	ExecutionFrequencyId  int64  `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
34 36
 }
35 37
 
36 38
 func (HisChargeDoctorAdviceInfo) TableName() string {

+ 88 - 32
models/his_models.go View File

@@ -256,6 +256,7 @@ type HisDoctorAdviceInfo struct {
256 256
 	LmtUsedFlag           int64                  `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
257 257
 	HisOrderInfo          HisOrderInfo           `gorm:"ForeignKey:AdviceId;AssociationForeignKey:ID" json:"order_info"`
258 258
 	IsMedicine            int64                  `gorm:"column:is_medicine" json:"is_medicine" form:"is_medicine"`
259
+	ExecutionFrequencyId  int64                  `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
259 260
 }
260 261
 
261 262
 func (HisDoctorAdviceInfo) TableName() string {
@@ -803,10 +804,11 @@ type HisPrintPrescriptionProject struct {
803 804
 
804 805
 	XtHisProjectTeam XtHisProjectTeam `gorm:"ForeignKey:TeamId;AssociationForeignKey:ID" json:"team"`
805 806
 
806
-	FrequencyType int64  `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
807
-	DayCount      int64  `gorm:"column:day_count" json:"day_count" form:"day_count"`
808
-	WeekDay       string `gorm:"column:week_day" json:"week_day" form:"week_day"`
809
-	IsCheckTeam   int64  `gorm:"-" json:"is_check_team" form:"is_check_team"`
807
+	FrequencyType        int64  `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
808
+	DayCount             int64  `gorm:"column:day_count" json:"day_count" form:"day_count"`
809
+	WeekDay              string `gorm:"column:week_day" json:"week_day" form:"week_day"`
810
+	IsCheckTeam          int64  `gorm:"-" json:"is_check_team" form:"is_check_team"`
811
+	ExecutionFrequencyId int64  `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
810 812
 }
811 813
 
812 814
 func (HisPrintPrescriptionProject) TableName() string {
@@ -851,11 +853,12 @@ type HisPrescriptionProject struct {
851 853
 
852 854
 	XtHisProjectTeam XtHisProjectTeam `gorm:"ForeignKey:TeamId;AssociationForeignKey:ID" json:"team"`
853 855
 
854
-	FrequencyType int64        `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
855
-	DayCount      int64        `gorm:"column:day_count" json:"day_count" form:"day_count"`
856
-	WeekDay       string       `gorm:"column:week_day" json:"week_day" form:"week_day"`
857
-	IsCheckTeam   int64        `gorm:"-" json:"is_check_team" form:"is_check_team"`
858
-	HisOrderInfo  HisOrderInfo `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"order_info"`
856
+	FrequencyType        int64        `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
857
+	DayCount             int64        `gorm:"column:day_count" json:"day_count" form:"day_count"`
858
+	WeekDay              string       `gorm:"column:week_day" json:"week_day" form:"week_day"`
859
+	IsCheckTeam          int64        `gorm:"-" json:"is_check_team" form:"is_check_team"`
860
+	HisOrderInfo         HisOrderInfo `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"order_info"`
861
+	ExecutionFrequencyId int64        `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
859 862
 }
860 863
 
861 864
 func (HisPrescriptionProject) TableName() string {
@@ -1932,11 +1935,12 @@ type NewCustomHisPrescriptionProject struct {
1932 1935
 
1933 1936
 	XtHisProjectTeam XtHisProjectTeam `gorm:"ForeignKey:TeamId;AssociationForeignKey:ID" json:"team"`
1934 1937
 
1935
-	FrequencyType int64        `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
1936
-	DayCount      int64        `gorm:"column:day_count" json:"day_count" form:"day_count"`
1937
-	WeekDay       string       `gorm:"column:week_day" json:"week_day" form:"week_day"`
1938
-	IsCheckTeam   int64        `gorm:"-" json:"is_check_team" form:"is_check_team"`
1939
-	HisOrderInfo  HisOrderInfo `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"order_info"`
1938
+	FrequencyType        int64        `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
1939
+	DayCount             int64        `gorm:"column:day_count" json:"day_count" form:"day_count"`
1940
+	WeekDay              string       `gorm:"column:week_day" json:"week_day" form:"week_day"`
1941
+	IsCheckTeam          int64        `gorm:"-" json:"is_check_team" form:"is_check_team"`
1942
+	HisOrderInfo         HisOrderInfo `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"order_info"`
1943
+	ExecutionFrequencyId int64        `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
1940 1944
 }
1941 1945
 
1942 1946
 func (NewCustomHisPrescriptionProject) TableName() string {
@@ -1964,24 +1968,25 @@ func (HisYidiClearRecord) TableName() string {
1964 1968
 }
1965 1969
 
1966 1970
 type HisPrescriptionProjectTwo struct {
1967
-	ID             int64   `gorm:"column:id" json:"id" form:"id"`
1968
-	ProjectId      int64   `gorm:"column:project_id" json:"project_id" form:"project_id"`
1969
-	Price          float64 `gorm:"column:price" json:"price" form:"price"`
1970
-	UserOrgId      int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1971
-	Status         int64   `gorm:"column:status" json:"status" form:"status"`
1972
-	PatientId      int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1973
-	RecordDate     int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
1974
-	PrescriptionId int64   `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
1975
-	Count          string  `gorm:"column:count" json:"count" form:"count"`
1976
-	FeedetlSn      string  `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
1977
-	Type           int64   `gorm:"column:type" json:"type" form:"type"`
1978
-	Doctor         int64   `gorm:"column:doctor" json:"doctor" form:"doctor"`
1979
-	ExecutionTime  int64   `gborm:"column:execution_time" json:"execution_time" form:"execution_time"`
1980
-	ExecutionStaff int64   `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
1981
-	ExecutionState int64   `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
1982
-	CheckTime      int64   `gorm:"column:check_time" json:"check_time" form:"check_time"`
1983
-	CheckState     int64   `gorm:"column:check_state" json:"check_state" form:"check_state"`
1984
-	Checker        int64   `gorm:"column:checker" json:"checker" form:"checker"`
1971
+	ID                   int64   `gorm:"column:id" json:"id" form:"id"`
1972
+	ProjectId            int64   `gorm:"column:project_id" json:"project_id" form:"project_id"`
1973
+	Price                float64 `gorm:"column:price" json:"price" form:"price"`
1974
+	UserOrgId            int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1975
+	Status               int64   `gorm:"column:status" json:"status" form:"status"`
1976
+	PatientId            int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1977
+	RecordDate           int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
1978
+	PrescriptionId       int64   `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
1979
+	Count                string  `gorm:"column:count" json:"count" form:"count"`
1980
+	FeedetlSn            string  `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
1981
+	Type                 int64   `gorm:"column:type" json:"type" form:"type"`
1982
+	Doctor               int64   `gorm:"column:doctor" json:"doctor" form:"doctor"`
1983
+	ExecutionTime        int64   `gborm:"column:execution_time" json:"execution_time" form:"execution_time"`
1984
+	ExecutionStaff       int64   `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
1985
+	ExecutionState       int64   `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
1986
+	CheckTime            int64   `gorm:"column:check_time" json:"check_time" form:"check_time"`
1987
+	CheckState           int64   `gorm:"column:check_state" json:"check_state" form:"check_state"`
1988
+	Checker              int64   `gorm:"column:checker" json:"checker" form:"checker"`
1989
+	ExecutionFrequencyId int64   `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
1985 1990
 }
1986 1991
 
1987 1992
 func (HisPrescriptionProjectTwo) TableName() string {
@@ -2369,3 +2374,54 @@ type HisHospitalCheckRecordTwenty struct {
2369 2374
 func (HisHospitalCheckRecordTwenty) TableName() string {
2370 2375
 	return "his_hospital_check_record"
2371 2376
 }
2377
+
2378
+type UploadInfo struct {
2379
+	Bce02a   string `json:"bce02a"`
2380
+	Bck01c   string `json:"bck01c"`
2381
+	Diag     []*Diag
2382
+	Fasong   string `json:"fasong"`
2383
+	PresInfo []*PresInfo
2384
+	Vaa01    int `json:"vaa01"`
2385
+	Vaa07    int `json:"vaa07"`
2386
+}
2387
+
2388
+type Diag struct {
2389
+	Bak02 string `json:"bak02"`
2390
+	Vao06 string `json:"vao06"`
2391
+}
2392
+
2393
+type PresDetail struct {
2394
+	Item  []*Item
2395
+	Vaf59 string `json:"vaf59"`
2396
+}
2397
+
2398
+type PresInfo struct {
2399
+	Cbm06      string `json:"cbm06"`
2400
+	Cbm07      string `json:"cbm07"`
2401
+	Cbmid      string `json:"cbmid"`
2402
+	PresDetail []*PresDetail
2403
+}
2404
+
2405
+type Item struct {
2406
+	Bbx01  string `json:"bbx01"`
2407
+	Bby01  string `json:"bby01"`
2408
+	Bck01b string `json:"bck01b"`
2409
+	Bck01d string `json:"bck01d"`
2410
+	Bda01  string `json:"bda01"`
2411
+	Bdi01  string `json:"bdi01"`
2412
+	Rownr  string `json:"rownr"`
2413
+	Vaf11  string `json:"vaf11"`
2414
+	Vaf14  string `json:"vaf14"`
2415
+	Vaf15  string `json:"vaf15"`
2416
+	Vaf17  string `json:"vaf17"`
2417
+	Vaf18  int    `json:"vaf18"`
2418
+	Vaf19  string `json:"vaf19"`
2419
+	Vaf20  string `json:"vaf20"`
2420
+	Vaf21  string `json:"vaf21"`
2421
+	Vaf22  string `json:"vaf22"`
2422
+	Vaf32  string `json:"vaf32"`
2423
+	Vaf35  string `json:"vaf35"`
2424
+	Vaf36  string `json:"vaf36"`
2425
+	Vaf58  string `json:"vaf58"`
2426
+	Vaf61  string `json:"vaf61"`
2427
+}

+ 35 - 33
models/his_summary_models.go View File

@@ -179,39 +179,40 @@ func (VmHisOrderInfo) TableName() string {
179 179
 }
180 180
 
181 181
 type VmHisPrescriptionProject struct {
182
-	ID                 int64   `gorm:"column:id" json:"id" form:"id"`
183
-	ProjectId          int64   `gorm:"column:project_id" json:"project_id" form:"project_id"`
184
-	Price              float64 `gorm:"column:price" json:"price" form:"price"`
185
-	UserOrgId          int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
186
-	Status             int64   `gorm:"column:status" json:"status" form:"status"`
187
-	Ctime              int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
188
-	Mtime              int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
189
-	PatientId          int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
190
-	HisPatientId       int64   `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
191
-	RecordDate         int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
192
-	PrescriptionId     int64   `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
193
-	Count              string  `gorm:"column:count" json:"count" form:"count"`
194
-	FeedetlSn          string  `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
195
-	MedListCodg        string  `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
196
-	SingleDose         string  `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
197
-	DeliveryWay        string  `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
198
-	ExecutionFrequency string  `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
199
-	Day                string  `gorm:"column:day" json:"day" form:"day"`
200
-	Remark             string  `gorm:"column:remark" json:"remark" form:"remark"`
201
-	Unit               string  `gorm:"column:unit" json:"unit" form:"unit"`
202
-	Type               int64   `gorm:"column:type" json:"type" form:"type"`
203
-	Doctor             int64   `gorm:"column:doctor" json:"doctor" form:"doctor"`
204
-	ExecutionTime      int64   `gorm:"column:execution_time" json:"execution_time" form:"execution_time"`
205
-	ExecutionStaff     int64   `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
206
-	ExecutionState     int64   `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
207
-	CheckTime          int64   `gorm:"column:check_time" json:"check_time" form:"check_time"`
208
-	CheckState         int64   `gorm:"column:check_state" json:"check_state" form:"check_state"`
209
-	Checker            int64   `gorm:"column:checker" json:"checker" form:"checker"`
210
-	StartTime          int64   `gorm:"column:start_time" json:"start_time" form:"start_time"`
211
-	TeamId             int64   `gorm:"column:team_id" json:"team_id" form:"team_id"`
212
-	FrequencyType      int64   `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
213
-	DayCount           int64   `gorm:"column:day_count" json:"day_count" form:"day_count"`
214
-	WeekDay            string  `gorm:"column:week_day" json:"week_day" form:"week_day"`
182
+	ID                   int64   `gorm:"column:id" json:"id" form:"id"`
183
+	ProjectId            int64   `gorm:"column:project_id" json:"project_id" form:"project_id"`
184
+	Price                float64 `gorm:"column:price" json:"price" form:"price"`
185
+	UserOrgId            int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
186
+	Status               int64   `gorm:"column:status" json:"status" form:"status"`
187
+	Ctime                int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
188
+	Mtime                int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
189
+	PatientId            int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
190
+	HisPatientId         int64   `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
191
+	RecordDate           int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
192
+	PrescriptionId       int64   `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
193
+	Count                string  `gorm:"column:count" json:"count" form:"count"`
194
+	FeedetlSn            string  `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
195
+	MedListCodg          string  `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
196
+	SingleDose           string  `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
197
+	DeliveryWay          string  `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
198
+	ExecutionFrequency   string  `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
199
+	Day                  string  `gorm:"column:day" json:"day" form:"day"`
200
+	Remark               string  `gorm:"column:remark" json:"remark" form:"remark"`
201
+	Unit                 string  `gorm:"column:unit" json:"unit" form:"unit"`
202
+	Type                 int64   `gorm:"column:type" json:"type" form:"type"`
203
+	Doctor               int64   `gorm:"column:doctor" json:"doctor" form:"doctor"`
204
+	ExecutionTime        int64   `gorm:"column:execution_time" json:"execution_time" form:"execution_time"`
205
+	ExecutionStaff       int64   `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
206
+	ExecutionState       int64   `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
207
+	CheckTime            int64   `gorm:"column:check_time" json:"check_time" form:"check_time"`
208
+	CheckState           int64   `gorm:"column:check_state" json:"check_state" form:"check_state"`
209
+	Checker              int64   `gorm:"column:checker" json:"checker" form:"checker"`
210
+	StartTime            int64   `gorm:"column:start_time" json:"start_time" form:"start_time"`
211
+	TeamId               int64   `gorm:"column:team_id" json:"team_id" form:"team_id"`
212
+	FrequencyType        int64   `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
213
+	DayCount             int64   `gorm:"column:day_count" json:"day_count" form:"day_count"`
214
+	WeekDay              string  `gorm:"column:week_day" json:"week_day" form:"week_day"`
215
+	ExecutionFrequencyId int64   `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
215 216
 }
216 217
 
217 218
 func (VmHisPrescriptionProject) TableName() string {
@@ -276,6 +277,7 @@ type VmHisDoctorAdviceInfo struct {
276 277
 	Mtime                 int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
277 278
 	AdviceId              int64   `gorm:"column:advice_id" json:"advice_id" form:"advice_id"`
278 279
 	IsMedicine            int64   `gorm:"column:is_medicine" json:"is_medicine" form:"is_medicine"`
280
+	ExecutionFrequencyId  int64   `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
279 281
 }
280 282
 
281 283
 func (VmHisDoctorAdviceInfo) TableName() string {

+ 36 - 34
models/stock_models.go View File

@@ -1309,6 +1309,7 @@ type BloodHisDoctorAdviceInfo struct {
1309 1309
 	Way                   int64                       `gorm:"column:way" json:"way" form:"way"`
1310 1310
 	HospApprFlag          int64                       `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
1311 1311
 	LmtUsedFlag           int64                       `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
1312
+	ExecutionFrequencyId  int64                       `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
1312 1313
 }
1313 1314
 
1314 1315
 func (BloodHisDoctorAdviceInfo) TableName() string {
@@ -1316,40 +1317,41 @@ func (BloodHisDoctorAdviceInfo) TableName() string {
1316 1317
 }
1317 1318
 
1318 1319
 type BloodHisPrescriptionProject struct {
1319
-	ID                 int64                          `gorm:"column:id" json:"id" form:"id"`
1320
-	ProjectId          int64                          `gorm:"column:project_id" json:"project_id" form:"project_id"`
1321
-	Price              float64                        `gorm:"column:price" json:"price" form:"price"`
1322
-	UserOrgId          int64                          `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1323
-	Status             int64                          `gorm:"column:status" json:"status" form:"status"`
1324
-	Ctime              int64                          `gorm:"column:ctime" json:"ctime" form:"ctime"`
1325
-	Mtime              int64                          `gorm:"column:mtime" json:"mtime" form:"mtime"`
1326
-	PatientId          int64                          `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1327
-	HisPatientId       int64                          `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
1328
-	RecordDate         int64                          `gorm:"column:record_date" json:"record_date" form:"record_date"`
1329
-	PrescriptionId     int64                          `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
1330
-	Count              string                         `gorm:"column:count" json:"count" form:"count"`
1331
-	FeedetlSn          string                         `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
1332
-	MedListCodg        string                         `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
1333
-	SingleDose         string                         `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
1334
-	DeliveryWay        string                         `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
1335
-	ExecutionFrequency string                         `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
1336
-	Day                string                         `gorm:"column:day" json:"day" form:"day"`
1337
-	Remark             string                         `gorm:"column:remark" json:"remark" form:"remark"`
1338
-	Unit               string                         `gorm:"column:unit" json:"unit" form:"unit"`
1339
-	Type               int64                          `gorm:"column:type" json:"type" form:"type"`
1340
-	Doctor             int64                          `gorm:"column:doctor" json:"doctor" form:"doctor"`
1341
-	ExecutionTime      int64                          `gorm:"column:execution_time" json:"execution_time" form:"execution_time"`
1342
-	ExecutionStaff     int64                          `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
1343
-	ExecutionState     int64                          `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
1344
-	CheckTime          int64                          `gorm:"column:check_time" json:"check_time" form:"check_time"`
1345
-	CheckState         int64                          `gorm:"column:check_state" json:"check_state" form:"check_state"`
1346
-	Checker            int64                          `gorm:"column:checker" json:"checker" form:"checker"`
1347
-	StartTime          int64                          `gorm:"column:start_time" json:"start_time" form:"start_time"`
1348
-	TeamId             int64                          `gorm:"column:team_id" json:"team_id" form:"team_id"`
1349
-	FrequencyType      int64                          `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
1350
-	DayCount           int64                          `gorm:"column:day_count" json:"day_count" form:"day_count"`
1351
-	WeekDay            string                         `gorm:"column:week_day" json:"week_day" form:"week_day"`
1352
-	ChildDoctorAdvice  []*BloodHisPrescriptionProject `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ProjectId" json:"child"`
1320
+	ID                   int64                          `gorm:"column:id" json:"id" form:"id"`
1321
+	ProjectId            int64                          `gorm:"column:project_id" json:"project_id" form:"project_id"`
1322
+	Price                float64                        `gorm:"column:price" json:"price" form:"price"`
1323
+	UserOrgId            int64                          `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1324
+	Status               int64                          `gorm:"column:status" json:"status" form:"status"`
1325
+	Ctime                int64                          `gorm:"column:ctime" json:"ctime" form:"ctime"`
1326
+	Mtime                int64                          `gorm:"column:mtime" json:"mtime" form:"mtime"`
1327
+	PatientId            int64                          `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1328
+	HisPatientId         int64                          `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
1329
+	RecordDate           int64                          `gorm:"column:record_date" json:"record_date" form:"record_date"`
1330
+	PrescriptionId       int64                          `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
1331
+	Count                string                         `gorm:"column:count" json:"count" form:"count"`
1332
+	FeedetlSn            string                         `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
1333
+	MedListCodg          string                         `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
1334
+	SingleDose           string                         `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
1335
+	DeliveryWay          string                         `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
1336
+	ExecutionFrequency   string                         `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
1337
+	Day                  string                         `gorm:"column:day" json:"day" form:"day"`
1338
+	Remark               string                         `gorm:"column:remark" json:"remark" form:"remark"`
1339
+	Unit                 string                         `gorm:"column:unit" json:"unit" form:"unit"`
1340
+	Type                 int64                          `gorm:"column:type" json:"type" form:"type"`
1341
+	Doctor               int64                          `gorm:"column:doctor" json:"doctor" form:"doctor"`
1342
+	ExecutionTime        int64                          `gorm:"column:execution_time" json:"execution_time" form:"execution_time"`
1343
+	ExecutionStaff       int64                          `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
1344
+	ExecutionState       int64                          `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
1345
+	CheckTime            int64                          `gorm:"column:check_time" json:"check_time" form:"check_time"`
1346
+	CheckState           int64                          `gorm:"column:check_state" json:"check_state" form:"check_state"`
1347
+	Checker              int64                          `gorm:"column:checker" json:"checker" form:"checker"`
1348
+	StartTime            int64                          `gorm:"column:start_time" json:"start_time" form:"start_time"`
1349
+	TeamId               int64                          `gorm:"column:team_id" json:"team_id" form:"team_id"`
1350
+	FrequencyType        int64                          `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
1351
+	DayCount             int64                          `gorm:"column:day_count" json:"day_count" form:"day_count"`
1352
+	WeekDay              string                         `gorm:"column:week_day" json:"week_day" form:"week_day"`
1353
+	ChildDoctorAdvice    []*BloodHisPrescriptionProject `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ProjectId" json:"child"`
1354
+	ExecutionFrequencyId int64                          `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
1353 1355
 }
1354 1356
 
1355 1357
 func (BloodHisPrescriptionProject) TableName() string {

+ 161 - 0
service/coordinate_service.go View File

@@ -8,6 +8,7 @@ import (
8 8
 	"github.com/jinzhu/gorm"
9 9
 	"io/ioutil"
10 10
 	"net/http"
11
+	"time"
11 12
 )
12 13
 
13 14
 func SavePatientMessageInfo() (string, string) {
@@ -329,3 +330,163 @@ func GetHisOrderFour(patient_id string, infoSeq string, docId string) (order mod
329 330
 	}
330 331
 	return
331 332
 }
333
+
334
+func GetHisPatientForCoordinate(id_card_no string) (string, string) {
335
+
336
+	//input := make(map[string]interface{})
337
+	inputData := make(map[string]interface{})
338
+	inputData["idcard"] = id_card_no // 就诊凭证编号
339
+
340
+	var inputLog string
341
+	bytesData, err := json.Marshal(inputData)
342
+	inputLog = string(bytesData)
343
+	fmt.Println(string(bytesData))
344
+	if err != nil {
345
+		fmt.Println(err.Error())
346
+		return err.Error(), ""
347
+	}
348
+	reader := bytes.NewReader(bytesData)
349
+	var url string
350
+	gdyb_url := "http://218.104.146.179:9091/esb/listener/getPatientType"
351
+	url = gdyb_url
352
+
353
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
354
+	request, err := http.NewRequest("GET", url, reader)
355
+	if err != nil {
356
+		fmt.Println(err.Error())
357
+		return err.Error(), ""
358
+	}
359
+
360
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
361
+	request.Header.Set("code", "Xmrjyy")
362
+
363
+	client := http.Client{}
364
+	resp, err := client.Do(request)
365
+	if err != nil {
366
+		fmt.Println(err.Error())
367
+		return err.Error(), ""
368
+	}
369
+	respBytes, err := ioutil.ReadAll(resp.Body)
370
+	if err != nil {
371
+		fmt.Println(err.Error())
372
+		return err.Error(), ""
373
+	}
374
+	fmt.Println(string(respBytes))
375
+	str := string(respBytes)
376
+	return str, inputLog
377
+
378
+}
379
+func UploadPrescriptionForCoordinate(info models.UploadInfo) (string, string) {
380
+
381
+	//input := make(map[string]interface{})
382
+	inputData := make(map[string]interface{})
383
+
384
+	diags := make([]map[string]interface{}, 0)
385
+	//diags := make([]map[string]interface{}, 0)
386
+
387
+	presInfos := make([]map[string]interface{}, 0)
388
+
389
+	for _, item := range info.Diag {
390
+		inputDataDiag := make(map[string]interface{})
391
+		inputDataDiag["vao06"] = item.Vao06
392
+		inputDataDiag["bak02"] = item.Bak02
393
+		diags = append(diags, inputDataDiag)
394
+	}
395
+
396
+	for _, item := range info.PresInfo {
397
+		inputDataPresInfo := make(map[string]interface{})
398
+		inputDataPresInfo["cbm06"] = item.Cbm06
399
+		inputDataPresInfo["cbm07"] = item.Cbm06
400
+		inputDataPresInfo["cbmid"] = item.Cbmid
401
+		presDetails := make([]map[string]interface{}, 0)
402
+
403
+		for _, subItem := range item.PresDetail {
404
+			inputDataPresDetail := make(map[string]interface{})
405
+			inputDataPresDetail["vaf59"] = subItem.Vaf59
406
+			Items := make([]map[string]interface{}, 0)
407
+			for _, subSubItem := range subItem.Item {
408
+				inputDataItem := make(map[string]interface{})
409
+				inputDataItem["bbx01"] = subSubItem.Bbx01
410
+				inputDataItem["bda01"] = subSubItem.Bda01
411
+				inputDataItem["bby01"] = subSubItem.Bby01
412
+				inputDataItem["bck01b"] = subSubItem.Bck01b
413
+				inputDataItem["bck01d"] = subSubItem.Bck01d
414
+				inputDataItem["bdi01"] = subSubItem.Bdi01
415
+				inputDataItem["rownr"] = subSubItem.Rownr
416
+				inputDataItem["vaf11"] = subSubItem.Vaf11
417
+				inputDataItem["vaf14"] = subSubItem.Vaf14
418
+				inputDataItem["vaf15"] = subSubItem.Vaf15
419
+				inputDataItem["vaf17"] = subSubItem.Vaf17
420
+				inputDataItem["vaf18"] = subSubItem.Vaf18
421
+				inputDataItem["vaf19"] = subSubItem.Vaf19
422
+				inputDataItem["vaf20"] = subSubItem.Vaf20
423
+				inputDataItem["vaf21"] = subSubItem.Vaf21
424
+				inputDataItem["vaf22"] = subSubItem.Vaf22
425
+				inputDataItem["vaf32"] = subSubItem.Vaf32
426
+				inputDataItem["vaf35"] = subSubItem.Vaf35
427
+				inputDataItem["vaf36"] = subSubItem.Vaf36
428
+				inputDataItem["vaf58"] = subSubItem.Vaf58
429
+				inputDataItem["vaf61"] = subSubItem.Vaf61
430
+				Items = append(Items, inputDataItem)
431
+
432
+			}
433
+			inputDataPresDetail["item"] = Items
434
+			presDetails = append(presDetails, inputDataPresDetail)
435
+		}
436
+		inputDataPresInfo["presDetail"] = presDetails
437
+		presInfos = append(presInfos, inputDataPresInfo)
438
+	}
439
+
440
+	inputData["vaa01"] = info.Vaa01   // 就诊凭证编号
441
+	inputData["Fasong"] = info.Fasong // 就诊凭证编号
442
+	inputData["vaa07"] = info.Vaa07   // 就诊凭证编号
443
+	inputData["bck01c"] = info.Bck01c // 就诊凭证编号
444
+	inputData["bce02a"] = "1001"      // 就诊凭证编号
445
+
446
+	inputData["diag"] = diags         // 就诊凭证编号
447
+	inputData["presInfo"] = presInfos // 就诊凭证编号
448
+
449
+	var inputLog string
450
+	bytesData, err := json.Marshal(inputData)
451
+	inputLog = string(bytesData)
452
+	fmt.Println(string(bytesData))
453
+	if err != nil {
454
+		fmt.Println(err.Error())
455
+		return err.Error(), ""
456
+	}
457
+	reader := bytes.NewReader(bytesData)
458
+	var url string
459
+	gdyb_url := "http://218.104.146.179:9091/esb/listener/sendPretreat"
460
+	url = gdyb_url
461
+
462
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
463
+	request, err := http.NewRequest("POST", url, reader)
464
+	if err != nil {
465
+		fmt.Println(err.Error())
466
+		return err.Error(), ""
467
+	}
468
+
469
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
470
+	request.Header.Set("code", "Xmrjyy")
471
+
472
+	client := http.Client{}
473
+	resp, err := client.Do(request)
474
+	if err != nil {
475
+		fmt.Println(err.Error())
476
+		return err.Error(), ""
477
+	}
478
+	respBytes, err := ioutil.ReadAll(resp.Body)
479
+	if err != nil {
480
+		fmt.Println(err.Error())
481
+		return err.Error(), ""
482
+	}
483
+	fmt.Println(string(respBytes))
484
+	str := string(respBytes)
485
+	return str, inputLog
486
+
487
+}
488
+
489
+func UpDatePrescriptionNumberForCoordinate(user_org_id int64, ids []int64, number string) (err error) {
490
+	err = writeDb.Model(&models.HisPrescription{}).Where("user_org_id = ? AND status = 1 AND id in (?)", user_org_id, ids).Updates(map[string]interface{}{"batch_number": number, "mtime": time.Now().Unix(), "order_status": 6}).Error
491
+	return
492
+}

+ 5 - 0
service/data.go View File

@@ -343,3 +343,8 @@ func CreateContinueSchedule(schedule *models.ContinueSchedule) error {
343 343
 	err := writeDb.Model(&schedule).Create(&schedule).Error
344 344
 	return err
345 345
 }
346
+
347
+func GetExecutionFrequencyByName(name string, org_id int64) (ef models.ExecutionFrequencyDic, err error) {
348
+	err = readDb.Model(&models.ExecutionFrequencyDic{}).Where("org_id = ? AND name = ?", org_id, name).First(&ef).Error
349
+	return
350
+}

+ 9 - 4
service/his_service.go View File

@@ -1699,6 +1699,7 @@ type HisDoctorAdviceInfo struct {
1699 1699
 	Drug                 Drug                 `gorm:"ForeignKey:ID;AssociationForeignKey:DrugId" json:"drug"`
1700 1700
 	VMHisPrescriptionTwo VMHisPrescriptionTwo `gorm:"ForeignKey:ID;AssociationForeignKey:PrescriptionId" json:"prescription"`
1701 1701
 	IsMedicine           int64                `gorm:"column:is_medicine" json:"is_medicine" form:"is_medicine"`
1702
+	ExecutionFrequencyId int64                `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
1702 1703
 }
1703 1704
 
1704 1705
 func (HisDoctorAdviceInfo) TableName() string {
@@ -1742,9 +1743,10 @@ type HisPrescriptionProject struct {
1742 1743
 	StartTime      int64 `gorm:"column:start_time" json:"start_time" form:"start_time"`
1743 1744
 	TeamId         int64 `gorm:"column:team_id" json:"team_id" form:"team_id"`
1744 1745
 
1745
-	FrequencyType int64  `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
1746
-	DayCount      int64  `gorm:"column:day_count" json:"day_count" form:"day_count"`
1747
-	WeekDay       string `gorm:"column:week_day" json:"week_day" form:"week_day"`
1746
+	FrequencyType        int64  `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
1747
+	DayCount             int64  `gorm:"column:day_count" json:"day_count" form:"day_count"`
1748
+	WeekDay              string `gorm:"column:week_day" json:"week_day" form:"week_day"`
1749
+	ExecutionFrequencyId int64  `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
1748 1750
 }
1749 1751
 
1750 1752
 func (HisPrescriptionProject) TableName() string {
@@ -2080,7 +2082,7 @@ func GetNewAllChargeHisPatientList(org_id int64, keywords string, record_date in
2080 2082
 	db = db.Preload("HisPatient", func(db *gorm.DB) *gorm.DB {
2081 2083
 		return db.Where("status = 1 AND user_org_id = ? AND record_date = ?", org_id, record_date).Preload("VMHisOrders", "user_org_id = ? AND status = 1 AND settle_accounts_date = ? ", org_id, record_date)
2082 2084
 	})
2083
-	db = db.Preload("HisPrescription", "user_org_id = ? AND status = 1 AND record_date = ? AND p_type <> 1 AND order_status <>", org_id, record_date)
2085
+	db = db.Preload("HisPrescription", "user_org_id = ? AND status = 1 AND record_date = ? AND p_type <> 1 AND order_status = 2", org_id, record_date)
2084 2086
 	err = db.Preload("VMHisPrescriptionInfo", "user_org_id = ? AND status = 1 AND record_date = ? AND p_type <> 1", org_id, record_date).Find(&patients).Error
2085 2087
 
2086 2088
 	for _, item := range patients {
@@ -2347,6 +2349,9 @@ func SaveHisOrder(his *models.HisOrder) (err error) {
2347 2349
 	err = writeDb.Save(&his).Error
2348 2350
 	return
2349 2351
 }
2352
+func UpdataHisPateintTwo(his *models.VMHisPatient) {
2353
+	writeDb.Save(&his)
2354
+}
2350 2355
 
2351 2356
 func GetPrescriptionByIds(ids []string, org_id int64) (prescription []*models.HisPrescription, err error) {
2352 2357
 	err = readDb.Model(&models.HisPrescription{}).

+ 9 - 8
service/mobile_dialysis_service.go View File

@@ -314,14 +314,15 @@ func (VMDoctorAdvice) TableName() string {
314 314
 }
315 315
 
316 316
 type VMHisDoctorAdviceInfo struct {
317
-	ID             int64 `gorm:"column:id" json:"id" form:"id"`
318
-	UserOrgId      int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
319
-	PatientId      int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
320
-	HisPatientId   int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
321
-	ExecutionTime  int64 `gorm:"column:execution_time" json:"execution_time" form:"execution_time"`
322
-	ExecutionStaff int64 `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
323
-	ExecutionState int64 `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
324
-	IsMedicine     int64 `gorm:"column:is_medicine" json:"is_medicine" form:"is_medicine"`
317
+	ID                   int64 `gorm:"column:id" json:"id" form:"id"`
318
+	UserOrgId            int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
319
+	PatientId            int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
320
+	HisPatientId         int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
321
+	ExecutionTime        int64 `gorm:"column:execution_time" json:"execution_time" form:"execution_time"`
322
+	ExecutionStaff       int64 `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
323
+	ExecutionState       int64 `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
324
+	IsMedicine           int64 `gorm:"column:is_medicine" json:"is_medicine" form:"is_medicine"`
325
+	ExecutionFrequencyId int64 `gorm:"column:execution_frequency_id" json:"execution_frequency_id" form:"execution_frequency_id"`
325 326
 }
326 327
 
327 328
 func (VMHisDoctorAdviceInfo) TableName() string {