|
@@ -2236,100 +2236,100 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
2236
|
2236
|
}
|
2237
|
2237
|
|
2238
|
2238
|
////针对异常未出库问题的脚本
|
2239
|
|
- if adminInfo.Org.Id == 10644 {
|
2240
|
|
-
|
2241
|
|
- newadviceInfo := &models.HisDoctorAdviceInfo{
|
2242
|
|
- ID: advice.ID,
|
2243
|
|
- UserOrgId: advice.UserOrgId,
|
2244
|
|
- PatientId: advice.PatientId,
|
2245
|
|
- HisPatientId: advice.HisPatientId,
|
2246
|
|
- AdviceType: advice.AdviceType,
|
2247
|
|
- AdviceDate: advice.AdviceDate,
|
2248
|
|
- StartTime: advice.StartTime,
|
2249
|
|
- AdviceName: advice.AdviceName,
|
2250
|
|
- AdviceDesc: advice.AdviceDesc,
|
2251
|
|
- ReminderDate: advice.ReminderDate,
|
2252
|
|
- SingleDose: advice.SingleDose,
|
2253
|
|
- SingleDoseUnit: advice.SingleDoseUnit,
|
2254
|
|
- PrescribingNumber: advice.PrescribingNumber,
|
2255
|
|
- PrescribingNumberUnit: advice.PrescribingNumberUnit,
|
2256
|
|
- DeliveryWay: advice.DeliveryWay,
|
2257
|
|
- ExecutionFrequency: advice.ExecutionFrequency,
|
2258
|
|
- AdviceDoctor: advice.AdviceDoctor,
|
2259
|
|
- Status: advice.Status,
|
2260
|
|
- CreatedTime: advice.CreatedTime,
|
2261
|
|
- UpdatedTime: advice.UpdatedTime,
|
2262
|
|
- AdviceAffirm: advice.AdviceAffirm,
|
2263
|
|
- Remark: advice.Remark,
|
2264
|
|
- StopTime: advice.StopTime,
|
2265
|
|
- StopReason: advice.StopReason,
|
2266
|
|
- StopDoctor: advice.StopDoctor,
|
2267
|
|
- StopState: advice.StopState,
|
2268
|
|
- ParentId: advice.ParentId,
|
2269
|
|
- ExecutionTime: advice.ExecutionTime,
|
2270
|
|
- ExecutionStaff: advice.ExecutionStaff,
|
2271
|
|
- ExecutionState: advice.ExecutionState,
|
2272
|
|
- Checker: advice.Checker,
|
2273
|
|
- RecordDate: advice.RecordDate,
|
2274
|
|
- DialysisOrderId: advice.DialysisOrderId,
|
2275
|
|
- CheckTime: advice.CheckTime,
|
2276
|
|
- CheckState: advice.CheckState,
|
2277
|
|
- DrugSpec: advice.DrugSpec,
|
2278
|
|
- DrugSpecUnit: advice.DrugSpecUnit,
|
2279
|
|
- Groupno: advice.Groupno,
|
2280
|
|
- RemindType: advice.RemindType,
|
2281
|
|
- FrequencyType: advice.FrequencyType,
|
2282
|
|
- DayCount: advice.DayCount,
|
2283
|
|
- WeekDay: advice.WeekDay,
|
2284
|
|
- TemplateId: advice.TemplateId,
|
2285
|
|
- Modifier: advice.Modifier,
|
2286
|
|
- DrugId: advice.DrugId,
|
2287
|
|
- Price: advice.Price,
|
2288
|
|
- PrescriptionId: advice.PrescriptionId,
|
2289
|
|
- MedListCodg: advice.MedListCodg,
|
2290
|
|
- FeedetlSn: advice.FeedetlSn,
|
2291
|
|
- Day: advice.DayCount,
|
2292
|
|
- ChildDoctorAdvice: nil,
|
2293
|
|
- Drug: models.Drug{},
|
2294
|
|
- Diagnosis: advice.Diagnosis,
|
2295
|
|
- Way: advice.Way,
|
2296
|
|
- HospApprFlag: advice.HospApprFlag,
|
2297
|
|
- LmtUsedFlag: advice.LmtUsedFlag,
|
2298
|
|
- HisOrderInfo: models.HisOrderInfo{},
|
2299
|
|
- IsMedicine: advice.IsMedicine,
|
2300
|
|
- ExecutionFrequencyId: advice.ExecutionFrequencyId,
|
2301
|
|
- Child: nil,
|
2302
|
|
- IsSettle: advice.IsSettle,
|
2303
|
|
- IsMobile: advice.IsMobile,
|
2304
|
|
- IsSelfDrug: advice.IsSelfDrug,
|
2305
|
|
- DrugWayCount: advice.DrugWayCount,
|
2306
|
|
- }
|
2307
|
|
- outListExport, _ := service.GetWarehouseOutListExport(advice.DrugId, advice.PatientId, advice.AdviceDate, advice.ID)
|
2308
|
|
- fmt.Println(outListExport)
|
2309
|
|
- //var out_count int64
|
2310
|
|
- //if len(outListExport) > 0 {
|
2311
|
|
- // for _, item := range outListExport {
|
2312
|
|
- // if item.CountUnit == medical.MaxUnit && medical.MaxUnit != medical.MinUnit {
|
2313
|
|
- // out_count = item.Count * medical.MinNumber
|
2314
|
|
- // }
|
2315
|
|
- // if item.CountUnit == medical.MinUnit && medical.MaxUnit != medical.MinUnit {
|
2316
|
|
- // out_count = item.Count
|
2317
|
|
- // }
|
2318
|
|
- // if item.CountUnit == medical.MaxUnit && medical.MaxUnit == medical.MinUnit {
|
2319
|
|
- // out_count = item.Count * medical.MinNumber
|
2320
|
|
- // }
|
2321
|
|
- //
|
2322
|
|
- // }
|
2323
|
|
- //}
|
2324
|
|
- //按最小单位出库
|
2325
|
|
- //var cha_count = total_count - out_count
|
2326
|
|
-
|
2327
|
|
- var cha_count = 100
|
2328
|
|
- fmt.Println("cha_count--------------------------------------", cha_count)
|
2329
|
|
- newadviceInfo.PrescribingNumber = float64(cha_count)
|
2330
|
|
- newadviceInfo.PrescribingNumberUnit = medical.MinUnit
|
2331
|
|
- service.NewHisDrugsDelivery(advice.UserOrgId, creater, newadviceInfo, tx)
|
2332
|
|
- }
|
|
2239
|
+ //if adminInfo.Org.Id == 10644 {
|
|
2240
|
+ //
|
|
2241
|
+ // newadviceInfo := &models.HisDoctorAdviceInfo{
|
|
2242
|
+ // ID: advice.ID,
|
|
2243
|
+ // UserOrgId: advice.UserOrgId,
|
|
2244
|
+ // PatientId: advice.PatientId,
|
|
2245
|
+ // HisPatientId: advice.HisPatientId,
|
|
2246
|
+ // AdviceType: advice.AdviceType,
|
|
2247
|
+ // AdviceDate: advice.AdviceDate,
|
|
2248
|
+ // StartTime: advice.StartTime,
|
|
2249
|
+ // AdviceName: advice.AdviceName,
|
|
2250
|
+ // AdviceDesc: advice.AdviceDesc,
|
|
2251
|
+ // ReminderDate: advice.ReminderDate,
|
|
2252
|
+ // SingleDose: advice.SingleDose,
|
|
2253
|
+ // SingleDoseUnit: advice.SingleDoseUnit,
|
|
2254
|
+ // PrescribingNumber: advice.PrescribingNumber,
|
|
2255
|
+ // PrescribingNumberUnit: advice.PrescribingNumberUnit,
|
|
2256
|
+ // DeliveryWay: advice.DeliveryWay,
|
|
2257
|
+ // ExecutionFrequency: advice.ExecutionFrequency,
|
|
2258
|
+ // AdviceDoctor: advice.AdviceDoctor,
|
|
2259
|
+ // Status: advice.Status,
|
|
2260
|
+ // CreatedTime: advice.CreatedTime,
|
|
2261
|
+ // UpdatedTime: advice.UpdatedTime,
|
|
2262
|
+ // AdviceAffirm: advice.AdviceAffirm,
|
|
2263
|
+ // Remark: advice.Remark,
|
|
2264
|
+ // StopTime: advice.StopTime,
|
|
2265
|
+ // StopReason: advice.StopReason,
|
|
2266
|
+ // StopDoctor: advice.StopDoctor,
|
|
2267
|
+ // StopState: advice.StopState,
|
|
2268
|
+ // ParentId: advice.ParentId,
|
|
2269
|
+ // ExecutionTime: advice.ExecutionTime,
|
|
2270
|
+ // ExecutionStaff: advice.ExecutionStaff,
|
|
2271
|
+ // ExecutionState: advice.ExecutionState,
|
|
2272
|
+ // Checker: advice.Checker,
|
|
2273
|
+ // RecordDate: advice.RecordDate,
|
|
2274
|
+ // DialysisOrderId: advice.DialysisOrderId,
|
|
2275
|
+ // CheckTime: advice.CheckTime,
|
|
2276
|
+ // CheckState: advice.CheckState,
|
|
2277
|
+ // DrugSpec: advice.DrugSpec,
|
|
2278
|
+ // DrugSpecUnit: advice.DrugSpecUnit,
|
|
2279
|
+ // Groupno: advice.Groupno,
|
|
2280
|
+ // RemindType: advice.RemindType,
|
|
2281
|
+ // FrequencyType: advice.FrequencyType,
|
|
2282
|
+ // DayCount: advice.DayCount,
|
|
2283
|
+ // WeekDay: advice.WeekDay,
|
|
2284
|
+ // TemplateId: advice.TemplateId,
|
|
2285
|
+ // Modifier: advice.Modifier,
|
|
2286
|
+ // DrugId: advice.DrugId,
|
|
2287
|
+ // Price: advice.Price,
|
|
2288
|
+ // PrescriptionId: advice.PrescriptionId,
|
|
2289
|
+ // MedListCodg: advice.MedListCodg,
|
|
2290
|
+ // FeedetlSn: advice.FeedetlSn,
|
|
2291
|
+ // Day: advice.DayCount,
|
|
2292
|
+ // ChildDoctorAdvice: nil,
|
|
2293
|
+ // Drug: models.Drug{},
|
|
2294
|
+ // Diagnosis: advice.Diagnosis,
|
|
2295
|
+ // Way: advice.Way,
|
|
2296
|
+ // HospApprFlag: advice.HospApprFlag,
|
|
2297
|
+ // LmtUsedFlag: advice.LmtUsedFlag,
|
|
2298
|
+ // HisOrderInfo: models.HisOrderInfo{},
|
|
2299
|
+ // IsMedicine: advice.IsMedicine,
|
|
2300
|
+ // ExecutionFrequencyId: advice.ExecutionFrequencyId,
|
|
2301
|
+ // Child: nil,
|
|
2302
|
+ // IsSettle: advice.IsSettle,
|
|
2303
|
+ // IsMobile: advice.IsMobile,
|
|
2304
|
+ // IsSelfDrug: advice.IsSelfDrug,
|
|
2305
|
+ // DrugWayCount: advice.DrugWayCount,
|
|
2306
|
+ // }
|
|
2307
|
+ // outListExport, _ := service.GetWarehouseOutListExport(advice.DrugId, advice.PatientId, advice.AdviceDate, advice.ID)
|
|
2308
|
+ // fmt.Println(outListExport)
|
|
2309
|
+ // //var out_count int64
|
|
2310
|
+ // //if len(outListExport) > 0 {
|
|
2311
|
+ // // for _, item := range outListExport {
|
|
2312
|
+ // // if item.CountUnit == medical.MaxUnit && medical.MaxUnit != medical.MinUnit {
|
|
2313
|
+ // // out_count = item.Count * medical.MinNumber
|
|
2314
|
+ // // }
|
|
2315
|
+ // // if item.CountUnit == medical.MinUnit && medical.MaxUnit != medical.MinUnit {
|
|
2316
|
+ // // out_count = item.Count
|
|
2317
|
+ // // }
|
|
2318
|
+ // // if item.CountUnit == medical.MaxUnit && medical.MaxUnit == medical.MinUnit {
|
|
2319
|
+ // // out_count = item.Count * medical.MinNumber
|
|
2320
|
+ // // }
|
|
2321
|
+ // //
|
|
2322
|
+ // // }
|
|
2323
|
+ // //}
|
|
2324
|
+ // //按最小单位出库
|
|
2325
|
+ // //var cha_count = total_count - out_count
|
|
2326
|
+ //
|
|
2327
|
+ // var cha_count = 100
|
|
2328
|
+ // fmt.Println("cha_count--------------------------------------", cha_count)
|
|
2329
|
+ // newadviceInfo.PrescribingNumber = float64(cha_count)
|
|
2330
|
+ // newadviceInfo.PrescribingNumberUnit = medical.MinUnit
|
|
2331
|
+ // service.NewHisDrugsDelivery(advice.UserOrgId, creater, newadviceInfo, tx)
|
|
2332
|
+ //}
|
2333
|
2333
|
|
2334
|
2334
|
}
|
2335
|
2335
|
}
|