|
@@ -1,23 +1,22 @@
|
1
|
1
|
package mobile_api_controllers
|
2
|
2
|
|
3
|
3
|
import (
|
4
|
|
- "encoding/json"
|
5
|
|
- "errors"
|
6
|
|
- "fmt"
|
7
|
|
- "github.com/jinzhu/gorm"
|
8
|
|
- "reflect"
|
9
|
|
- "strconv"
|
10
|
|
- "strings"
|
11
|
|
- "time"
|
12
|
|
-
|
13
|
4
|
"XT_New/enums"
|
14
|
5
|
"XT_New/models"
|
15
|
6
|
"XT_New/service"
|
16
|
7
|
"XT_New/utils"
|
|
8
|
+ "encoding/json"
|
|
9
|
+ "errors"
|
|
10
|
+ "fmt"
|
17
|
11
|
"github.com/astaxie/beego"
|
|
12
|
+ "github.com/jinzhu/gorm"
|
18
|
13
|
"math"
|
19
|
14
|
"net/http"
|
20
|
15
|
"net/url"
|
|
16
|
+ "reflect"
|
|
17
|
+ "strconv"
|
|
18
|
+ "strings"
|
|
19
|
+ "time"
|
21
|
20
|
)
|
22
|
21
|
|
23
|
22
|
// type DialysisTestAPIController struct {
|
|
@@ -87,10 +86,9 @@ func (this *DialysisAPIController) Scheduals() {
|
87
|
86
|
defer redis.Close()
|
88
|
87
|
|
89
|
88
|
key := "scheduals_" + schedualDate + "_" + strconv.FormatInt(orgID, 10)
|
90
|
|
-
|
|
89
|
+ redis.Set(key, "", time.Second)
|
91
|
90
|
scheduals_json_str, _ := redis.Get(key).Result()
|
92
|
91
|
|
93
|
|
- redis.Set(key, "", time.Second)
|
94
|
92
|
patients, _ := service.GetAllPatientListSix(orgID)
|
95
|
93
|
if len(scheduals_json_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
|
96
|
94
|
scheduals, err := service.MobileGetDialysisScheduals(orgID, date.Unix(), schedualType)
|
|
@@ -840,6 +838,30 @@ func (c *DialysisAPIController) PostDoubleCheck() {
|
840
|
838
|
doubleCheck.Modifier = modifier
|
841
|
839
|
|
842
|
840
|
err := service.AddSigleDoubleCheck(&doubleCheck)
|
|
841
|
+
|
|
842
|
+ //针对长沙南雅
|
|
843
|
+ if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 3877 {
|
|
844
|
+ //查询未核对的医嘱
|
|
845
|
+ doctorList, _ := service.GetDoctorAdviceCheckList(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
|
846
|
+ if len(doctorList) > 0 && modifier > 0 {
|
|
847
|
+ for _, advice := range doctorList {
|
|
848
|
+ service.UpdateDoctorAdviceList(advice.ID, modifier)
|
|
849
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(advice.PatientId, 10) + ":" + strconv.FormatInt(advice.AdviceDate, 10) + ":doctor_advices"
|
|
850
|
+ redis := service.RedisClient()
|
|
851
|
+ //清空key 值
|
|
852
|
+ redis.Set(key, "", time.Second)
|
|
853
|
+ keyTwo := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(advice.AdviceDate, 10) + ":advice_list_all"
|
|
854
|
+ redis.Set(keyTwo, "", time.Second)
|
|
855
|
+ theTime := time.Now()
|
|
856
|
+ recordDate := theTime.Format("2006-01-02")
|
|
857
|
+ keyFour := "scheduals_" + recordDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
|
|
858
|
+ redis.Set(keyFour, "", time.Second)
|
|
859
|
+ defer redis.Close()
|
|
860
|
+ }
|
|
861
|
+ }
|
|
862
|
+
|
|
863
|
+ }
|
|
864
|
+
|
843
|
865
|
key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":double_check"
|
844
|
866
|
redis := service.RedisClient()
|
845
|
867
|
|
|
@@ -1389,6 +1411,7 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
1389
|
1411
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
1390
|
1412
|
|
1391
|
1413
|
is_water := c.GetString("is_water")
|
|
1414
|
+
|
1392
|
1415
|
var is_war int64
|
1393
|
1416
|
if is_water == "是" {
|
1394
|
1417
|
is_war = 1
|
|
@@ -1407,6 +1430,13 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
1407
|
1430
|
add_amount, _ := c.GetFloat("add_amount")
|
1408
|
1431
|
reduce_amount, _ := c.GetFloat("reduce_amount")
|
1409
|
1432
|
dialysis_remark := c.GetString("dialysis_remark")
|
|
1433
|
+
|
|
1434
|
+ prescribing_number, _ := c.GetFloat("prescribing_number")
|
|
1435
|
+ prescription_sodium := c.GetString("prescription_sodium")
|
|
1436
|
+ start_sodium := c.GetString("start_sodium")
|
|
1437
|
+ sodium_curve := c.GetString("sodium_curve")
|
|
1438
|
+ treatment_remark := c.GetString("treatment_remark")
|
|
1439
|
+
|
1410
|
1440
|
appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
|
1411
|
1441
|
|
1412
|
1442
|
//template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
|
|
@@ -1532,6 +1562,11 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
1532
|
1562
|
AddAmount: add_amount,
|
1533
|
1563
|
ReduceAmount: reduce_amount,
|
1534
|
1564
|
DialysisRemark: dialysis_remark,
|
|
1565
|
+ PrescribingNumber: prescribing_number,
|
|
1566
|
+ StartSodium: start_sodium,
|
|
1567
|
+ SodiumCurve: sodium_curve,
|
|
1568
|
+ TreatmentRemark: treatment_remark,
|
|
1569
|
+ PrescriptionSodium: prescription_sodium,
|
1535
|
1570
|
}
|
1536
|
1571
|
|
1537
|
1572
|
//查询最近透析准备表里是否存在 透析器 灌流器
|
|
@@ -1620,6 +1655,116 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
1620
|
1655
|
|
1621
|
1656
|
err := service.AddSigleRecord(&prescription)
|
1622
|
1657
|
|
|
1658
|
+ //长沙南雅医院,自动生成抗凝剂的临时处方
|
|
1659
|
+ if adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 {
|
|
1660
|
+
|
|
1661
|
+ advice := models.DoctorAdvice{
|
|
1662
|
+ UserOrgId: adminUserInfo.Org.Id,
|
|
1663
|
+ PatientId: id,
|
|
1664
|
+ GroupNo: 0,
|
|
1665
|
+ AdviceType: 2,
|
|
1666
|
+ RecordDate: recordDate.Unix(),
|
|
1667
|
+ AdviceDate: recordDate.Unix(),
|
|
1668
|
+ StartTime: recordDate.Unix() + 7*60*60, // 根据排班班次,给默认时间
|
|
1669
|
+ AdviceName: "", // 根据抗凝剂转换为中文 + 首剂 + 维持 + 总量
|
|
1670
|
+ AdviceDesc: "",
|
|
1671
|
+ ReminderDate: 0,
|
|
1672
|
+ SingleDose: 5000,
|
|
1673
|
+ SingleDoseUnit: "iu",
|
|
1674
|
+ DrugSpec: 0,
|
|
1675
|
+ DrugSpecUnit: "",
|
|
1676
|
+ PrescribingNumber: prescribing_number, // 前端传过来的开药数量
|
|
1677
|
+ PrescribingNumberUnit: "支",
|
|
1678
|
+ DeliveryWay: "静脉注射",
|
|
1679
|
+ ExecutionFrequency: "上机前",
|
|
1680
|
+ AdviceDoctor: 0,
|
|
1681
|
+ Status: 1,
|
|
1682
|
+ CreatedTime: time.Now().Unix(),
|
|
1683
|
+ UpdatedTime: time.Now().Unix(),
|
|
1684
|
+ IsPrescription: 1,
|
|
1685
|
+ }
|
|
1686
|
+ // 查询排班信息
|
|
1687
|
+ schedulePatient, _ := service.GetScheduleByPatient(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
|
1688
|
+ if schedulePatient.ID > 0 {
|
|
1689
|
+ if schedulePatient.ScheduleType == 1 {
|
|
1690
|
+ advice.StartTime = recordDate.Unix() + 7*60*60
|
|
1691
|
+ }
|
|
1692
|
+
|
|
1693
|
+ if schedulePatient.ScheduleType == 2 {
|
|
1694
|
+ advice.StartTime = recordDate.Unix() + 11*60*60
|
|
1695
|
+ }
|
|
1696
|
+ }
|
|
1697
|
+ // 抗凝剂名称
|
|
1698
|
+ switch anticoagulant {
|
|
1699
|
+ case 1:
|
|
1700
|
+ advice.AdviceName = "无肝素"
|
|
1701
|
+ break
|
|
1702
|
+ case 2:
|
|
1703
|
+ advice.AdviceName = "普通肝素"
|
|
1704
|
+ break
|
|
1705
|
+ case 3:
|
|
1706
|
+ advice.AdviceName = "低分子肝素"
|
|
1707
|
+ break
|
|
1708
|
+ case 4:
|
|
1709
|
+ advice.AdviceName = "阿加曲班"
|
|
1710
|
+ break
|
|
1711
|
+ case 5:
|
|
1712
|
+ advice.AdviceName = "枸橼酸钠"
|
|
1713
|
+ break
|
|
1714
|
+ case 6:
|
|
1715
|
+ advice.AdviceName = "低分子肝素钙"
|
|
1716
|
+ break
|
|
1717
|
+ case 7:
|
|
1718
|
+ advice.AdviceName = "低分子肝素钠"
|
|
1719
|
+ break
|
|
1720
|
+ case 8:
|
|
1721
|
+ advice.AdviceName = "依诺肝素"
|
|
1722
|
+ break
|
|
1723
|
+ case 9:
|
|
1724
|
+ advice.AdviceName = "达肝素"
|
|
1725
|
+ break
|
|
1726
|
+ case 10:
|
|
1727
|
+ advice.AdviceName = "体外抗凝"
|
|
1728
|
+ break
|
|
1729
|
+ case 11:
|
|
1730
|
+ advice.AdviceName = "那曲肝素"
|
|
1731
|
+ break
|
|
1732
|
+ case 12:
|
|
1733
|
+ advice.AdviceName = "无抗凝剂"
|
|
1734
|
+ break
|
|
1735
|
+ }
|
|
1736
|
+ //advice.AdviceDesc = "首剂" + strconv.FormatFloat(anticoagulant_shouji, 'f', -1, 64) + "维持" + strconv.FormatFloat(anticoagulant_weichi, 'f', -1, 64) + "总量" + strconv.FormatFloat(anticoagulant_zongliang, 'f', -1, 64)
|
|
1737
|
+
|
|
1738
|
+ if appRole.UserType == 2 || appRole.UserType == 1 || appRole.UserType == 4 {
|
|
1739
|
+ advice.AdviceDoctor = appRole.AdminUserId
|
|
1740
|
+ }
|
|
1741
|
+
|
|
1742
|
+ // 患者的临时医嘱里查找是否有抗凝剂临时医嘱
|
|
1743
|
+ advicePrescription, _ := service.GetAdvicesByPrescription(adminUserInfo.Org.Id, id, recordDate.Unix())
|
|
1744
|
+ if advicePrescription.ID > 0 && (anticoagulant == 3 || anticoagulant == 6 || anticoagulant == 7) {
|
|
1745
|
+ advice.AdviceName = "低分子肝素钠注射液"
|
|
1746
|
+ // 修改患者临时医嘱里的抗凝剂医嘱
|
|
1747
|
+ advice.ID = advicePrescription.ID
|
|
1748
|
+ service.UpdateDoctorAdvice(&advice)
|
|
1749
|
+ } else {
|
|
1750
|
+ if anticoagulant == 3 || anticoagulant == 6 || anticoagulant == 7 {
|
|
1751
|
+ advice.AdviceName = "低分子肝素钠注射液"
|
|
1752
|
+ // 新增患者临时医嘱里的抗凝剂医嘱
|
|
1753
|
+ service.CreateDoctorAdvice(&advice)
|
|
1754
|
+ }
|
|
1755
|
+
|
|
1756
|
+ }
|
|
1757
|
+
|
|
1758
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":doctor_advices"
|
|
1759
|
+ redis := service.RedisClient()
|
|
1760
|
+ defer redis.Close()
|
|
1761
|
+ //清空key 值
|
|
1762
|
+ redis.Set(key, "", time.Second)
|
|
1763
|
+ keyOne := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":advice_list_all"
|
|
1764
|
+ redis.Set(keyOne, "", time.Second)
|
|
1765
|
+
|
|
1766
|
+ }
|
|
1767
|
+
|
1623
|
1768
|
//获取key,清空redis
|
1624
|
1769
|
key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
|
1625
|
1770
|
redis := service.RedisClient()
|
|
@@ -1710,6 +1855,25 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
1710
|
1855
|
prescription.ID = dialysisPrescription.ID
|
1711
|
1856
|
|
1712
|
1857
|
err := service.UpDateDialysisPrescription(&prescription)
|
|
1858
|
+
|
|
1859
|
+ //修改处方
|
|
1860
|
+ if adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 {
|
|
1861
|
+ // 患者的临时医嘱里查找是否有抗凝剂临时医嘱
|
|
1862
|
+ advicePrescription, _ := service.GetAdvicesByPrescription(adminUserInfo.Org.Id, id, recordDate.Unix())
|
|
1863
|
+ if advicePrescription.ID > 0 {
|
|
1864
|
+
|
|
1865
|
+ service.UpdateDoctorAdvieById(advicePrescription.ID, prescribing_number)
|
|
1866
|
+
|
|
1867
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":doctor_advices"
|
|
1868
|
+ redis := service.RedisClient()
|
|
1869
|
+ defer redis.Close()
|
|
1870
|
+ //清空key 值
|
|
1871
|
+ redis.Set(key, "", time.Second)
|
|
1872
|
+ keyOne := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":advice_list_all"
|
|
1873
|
+ redis.Set(keyOne, "", time.Second)
|
|
1874
|
+ }
|
|
1875
|
+ }
|
|
1876
|
+
|
1713
|
1877
|
//获取key,清空redis
|
1714
|
1878
|
key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
|
1715
|
1879
|
redis := service.RedisClient()
|
|
@@ -1898,7 +2062,7 @@ func (c *DialysisAPIController) Finish() {
|
1898
|
2062
|
|
1899
|
2063
|
}
|
1900
|
2064
|
|
1901
|
|
- if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9675 || adminUserInfo.Org.Id == 10215 || adminUserInfo.Org.Id == 10233 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 10243 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10414 || adminUserInfo.Org.Id == 10430 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10223 {
|
|
2065
|
+ if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9675 || adminUserInfo.Org.Id == 10215 || adminUserInfo.Org.Id == 10233 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 10243 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10414 || adminUserInfo.Org.Id == 10430 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 9829 || adminUserInfo.Org.Id == 10432 {
|
1902
|
2066
|
evaluation, _ := service.MobileGetPredialysisEvaluationOne(adminUserInfo.Org.Id, id, recordDate.Unix())
|
1903
|
2067
|
if evaluation.SystolicBloodPressure == 0 {
|
1904
|
2068
|
evaluation.SystolicBloodPressure = fmonitorRecords.SystolicBloodPressure
|
|
@@ -1995,6 +2159,16 @@ func (c *DialysisAPIController) Finish() {
|
1995
|
2159
|
tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume
|
1996
|
2160
|
}
|
1997
|
2161
|
|
|
2162
|
+ if endmonitorRecords.ID > 0 && adminUserInfo.Org.Id == 9829 {
|
|
2163
|
+ tempassessmentAfterDislysis.SystolicBloodPressure = endmonitorRecords.SystolicBloodPressure
|
|
2164
|
+ tempassessmentAfterDislysis.DiastolicBloodPressure = endmonitorRecords.DiastolicBloodPressure
|
|
2165
|
+ }
|
|
2166
|
+
|
|
2167
|
+ if endmonitorRecords.ID > 0 && adminUserInfo.Org.Id == 10432 {
|
|
2168
|
+ tempassessmentAfterDislysis.SystolicBloodPressure = endmonitorRecords.SystolicBloodPressure
|
|
2169
|
+ tempassessmentAfterDislysis.DiastolicBloodPressure = endmonitorRecords.DiastolicBloodPressure
|
|
2170
|
+ }
|
|
2171
|
+
|
1998
|
2172
|
if lastAssessmentAfterDislysis != nil {
|
1999
|
2173
|
tempassessmentAfterDislysis.BloodPressureType = lastAssessmentAfterDislysis.BloodPressureType
|
2000
|
2174
|
|
|
@@ -2081,6 +2255,7 @@ func (c *DialysisAPIController) Finish() {
|
2081
|
2255
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorDialysisOrderNoEND)
|
2082
|
2256
|
return
|
2083
|
2257
|
}
|
|
2258
|
+
|
2084
|
2259
|
if dialysisOrder.Stage == 1 {
|
2085
|
2260
|
err := service.ModifyDialysisRecord(dialysisOrder.ID, nurseID, endDate.Unix(), adminUserInfo.AdminUser.Id, puncture_point_haematoma, internal_fistula, catheter, cruor, mission)
|
2086
|
2261
|
|
|
@@ -2095,6 +2270,80 @@ func (c *DialysisAPIController) Finish() {
|
2095
|
2270
|
//结束时候透析次数加1
|
2096
|
2271
|
service.UpdateSolutionByPatientId(id)
|
2097
|
2272
|
|
|
2273
|
+ //下机完自动消毒,针对长沙南雅
|
|
2274
|
+ if dialysisOrder.Stage == 1 {
|
|
2275
|
+ if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 3877 {
|
|
2276
|
+ //根据床位号获取设备型号
|
|
2277
|
+ unitType, _ := service.GetUnitType(dialysisOrder.BedID, dialysisOrder.UserOrgId)
|
|
2278
|
+ //查询使用消毒最后一条消毒记录
|
|
2279
|
+ _, err := service.GetLaseDeviceInfomation(dialysisOrder.UserOrgId, dialysisOrder.BedID, dialysisOrder.DialysisDate, dialysisOrder.SchedualType)
|
|
2280
|
+ fmt.Println("err", err)
|
|
2281
|
+ if err == gorm.ErrRecordNotFound {
|
|
2282
|
+ //查找排班
|
|
2283
|
+ scheduleByPatient, _ := service.GetScheduleByPatient(dialysisOrder.PatientId, dialysisOrder.DialysisDate, dialysisOrder.UserOrgId)
|
|
2284
|
+ //查询改设备是否有消毒计划
|
|
2285
|
+ plan, errcode := service.GetDisInfectionTime(dialysisOrder.UserOrgId, unitType.UnitType, dialysisOrder.SchedualType, scheduleByPatient.ScheduleWeek)
|
|
2286
|
+
|
|
2287
|
+ //根据床位号获取设备id
|
|
2288
|
+ addmacher, _ := service.GetEquimentIDTwo(dialysisOrder.BedID, dialysisOrder.UserOrgId)
|
|
2289
|
+
|
|
2290
|
+ //查询病人信息
|
|
2291
|
+ patients, _ := service.GetPatientInfoMation(dialysisOrder.PatientId)
|
|
2292
|
+ var con = ""
|
|
2293
|
+ if patients.IsInfectious == 0 {
|
|
2294
|
+ con = ""
|
|
2295
|
+ }
|
|
2296
|
+ if patients.IsInfectious == 1 {
|
|
2297
|
+ con = "无"
|
|
2298
|
+ }
|
|
2299
|
+ if patients.IsInfectious == 2 {
|
|
2300
|
+ con = "有"
|
|
2301
|
+ }
|
|
2302
|
+
|
|
2303
|
+ if errcode == nil {
|
|
2304
|
+ var end_time int64
|
|
2305
|
+ end_time = endDate.Unix() + plan.DisinfecTime*60
|
|
2306
|
+ //新增消毒
|
|
2307
|
+ information := models.DeviceInformation{
|
|
2308
|
+ Date: dialysisOrder.DialysisDate,
|
|
2309
|
+ Zone: dialysisOrder.ZoneId,
|
|
2310
|
+ Class: dialysisOrder.SchedualType,
|
|
2311
|
+ BedNumber: dialysisOrder.BedID,
|
|
2312
|
+ PatientId: dialysisOrder.PatientId,
|
|
2313
|
+ DialysisMode: scheduleByPatient.ModeId,
|
|
2314
|
+ LongTime: strconv.FormatInt(plan.DisinfecTime, 10),
|
|
2315
|
+ Disinfection: 1,
|
|
2316
|
+ DialysisConcentration: 1,
|
|
2317
|
+ DisinfectionStatus: 1,
|
|
2318
|
+ Move: 1,
|
|
2319
|
+ UserOrgId: dialysisOrder.UserOrgId,
|
|
2320
|
+ DisinfectType: plan.Way,
|
|
2321
|
+ DisinfectantType: plan.MachineDisinfectant,
|
|
2322
|
+ FluidPath: plan.DisinfectanWay, //液路消毒方式
|
|
2323
|
+ Disinfectant: plan.Disinfectant,
|
|
2324
|
+ Ctime: time.Now().Unix(),
|
|
2325
|
+ Status: 1,
|
|
2326
|
+ SignName: nurseID,
|
|
2327
|
+ EquimentId: addmacher.ID,
|
|
2328
|
+ DisinfectionResidue: 2,
|
|
2329
|
+ Bed: addmacher.BedNumber,
|
|
2330
|
+ StartTime: dialysisOrder.StartTime,
|
|
2331
|
+ EndTime: dialysisOrder.EndTime,
|
|
2332
|
+ Contagion: con,
|
|
2333
|
+ WeightLoss: 0,
|
|
2334
|
+ Hyperfiltratio: 0,
|
|
2335
|
+ DialysisHour: "",
|
|
2336
|
+ MachineRun: 1,
|
|
2337
|
+ DisinfecStartime: endDate.Unix(),
|
|
2338
|
+ DisinfecEndtime: end_time,
|
|
2339
|
+ }
|
|
2340
|
+ err := service.CreateInformationTwo(&information)
|
|
2341
|
+ fmt.Println("报错", err)
|
|
2342
|
+ }
|
|
2343
|
+ }
|
|
2344
|
+ }
|
|
2345
|
+ }
|
|
2346
|
+
|
2098
|
2347
|
dialysisOrder.Stage = 2
|
2099
|
2348
|
dialysisOrder.FinishNurse = nurseID
|
2100
|
2349
|
dialysisOrder.FinishCreator = adminUserInfo.AdminUser.Id
|
|
@@ -2121,6 +2370,7 @@ func (c *DialysisAPIController) Finish() {
|
2121
|
2370
|
}
|
2122
|
2371
|
|
2123
|
2372
|
}
|
|
2373
|
+
|
2124
|
2374
|
}
|
2125
|
2375
|
|
2126
|
2376
|
func (c *DialysisAPIController) GetAllZone() {
|
|
@@ -2183,6 +2433,8 @@ func (this *DialysisAPIController) StartDialysis() {
|
2183
|
2433
|
nuclein_date_str := this.GetString("nuclein_date_str")
|
2184
|
2434
|
schedule_remark := this.GetString("schedule_remark")
|
2185
|
2435
|
order_remark := this.GetString("order_remark")
|
|
2436
|
+ catheter_operation := this.GetString("catheter_operation")
|
|
2437
|
+
|
2186
|
2438
|
if patientID <= 0 || len(recordDateStr) == 0 || nurseID <= 0 || bedID <= 0 {
|
2187
|
2439
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
2188
|
2440
|
return
|
|
@@ -2384,6 +2636,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
2384
|
2636
|
NucleinDate: theNucleinDate,
|
2385
|
2637
|
ScheduleRemark: schedule_remark,
|
2386
|
2638
|
OrderRemark: order_remark,
|
|
2639
|
+ CatheterOperation: catheter_operation,
|
2387
|
2640
|
}
|
2388
|
2641
|
//查询该床位是否有人用了
|
2389
|
2642
|
_, errorscode := service.GetDialysisOrderByBedId(adminUserInfo.Org.Id, schedulestartTime, bedID, schedual_type)
|
|
@@ -2507,7 +2760,6 @@ func (this *DialysisAPIController) StartDialysis() {
|
2507
|
2760
|
if errcode == nil {
|
2508
|
2761
|
record.SystolicBloodPressure = befor.SystolicBloodPressure
|
2509
|
2762
|
record.DiastolicBloodPressure = befor.DiastolicBloodPressure
|
2510
|
|
-
|
2511
|
2763
|
record.BreathingRate = befor.BreathingRate
|
2512
|
2764
|
record.PulseFrequency = befor.PulseFrequency
|
2513
|
2765
|
record.Temperature = befor.Temperature
|
|
@@ -2516,7 +2768,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
2516
|
2768
|
|
2517
|
2769
|
// 如果当天有插入数据,则不再往透析纪录里插入数据
|
2518
|
2770
|
if newdialysisRecord.ID > 0 {
|
2519
|
|
- if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 9675 {
|
|
2771
|
+ if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9671 {
|
2520
|
2772
|
record.Temperature = 36.5
|
2521
|
2773
|
record.ArterialPressure = -100
|
2522
|
2774
|
record.DialysateTemperature = 36.5
|
|
@@ -2524,6 +2776,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
2524
|
2776
|
record.BreathingRate = "20"
|
2525
|
2777
|
record.VenousPressure = 80
|
2526
|
2778
|
record.TransmembranePressure = 60
|
|
2779
|
+ record.Dispose = catheter_operation
|
2527
|
2780
|
}
|
2528
|
2781
|
//针对新化博翔
|
2529
|
2782
|
if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10447 {
|
|
@@ -2548,6 +2801,11 @@ func (this *DialysisAPIController) StartDialysis() {
|
2548
|
2801
|
record.DiastolicBloodPressure = befor.DiastolicBloodPressure
|
2549
|
2802
|
record.BreathingRate = befor.BreathingRate
|
2550
|
2803
|
}
|
|
2804
|
+
|
|
2805
|
+ if adminUserInfo.Org.Id == 9829 {
|
|
2806
|
+ record.PulseFrequency = 80
|
|
2807
|
+ record.Temperature = 36.5
|
|
2808
|
+ }
|
2551
|
2809
|
err := service.CreateMonitor(&record)
|
2552
|
2810
|
|
2553
|
2811
|
key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":monitor_records"
|
|
@@ -2699,6 +2957,12 @@ func (c *DialysisAPIController) PostSolution() {
|
2699
|
2957
|
is_water := c.GetString("is_water")
|
2700
|
2958
|
add_amount, _ := c.GetFloat("add_amount")
|
2701
|
2959
|
reduce_amount, _ := c.GetFloat("reduce_amount")
|
|
2960
|
+
|
|
2961
|
+ prescribing_number, _ := c.GetFloat("prescribing_number")
|
|
2962
|
+ treatment_remark := c.GetString("treatment_remark")
|
|
2963
|
+ prescription_sodium := c.GetString("prescription_sodium")
|
|
2964
|
+ start_sodium := c.GetString("start_sodium")
|
|
2965
|
+ sodium_curve := c.GetString("sodium_curve")
|
2702
|
2966
|
var is_war int64
|
2703
|
2967
|
if is_water == "是" {
|
2704
|
2968
|
is_war = 1
|
|
@@ -2836,6 +3100,11 @@ func (c *DialysisAPIController) PostSolution() {
|
2836
|
3100
|
AddAmount: add_amount,
|
2837
|
3101
|
ReduceAmount: reduce_amount,
|
2838
|
3102
|
DialysisRemark: dialysis_remark,
|
|
3103
|
+ PrescribingNumber: prescribing_number,
|
|
3104
|
+ PrescriptionSodium: prescription_sodium,
|
|
3105
|
+ StartSodium: start_sodium,
|
|
3106
|
+ SodiumCurve: sodium_curve,
|
|
3107
|
+ TreatmentRemark: treatment_remark,
|
2839
|
3108
|
}
|
2840
|
3109
|
|
2841
|
3110
|
_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
|
@@ -2935,6 +3204,11 @@ func (c *DialysisAPIController) PostSolution() {
|
2935
|
3204
|
PreImpulse: impulse,
|
2936
|
3205
|
SolutionStatus: 1,
|
2937
|
3206
|
DialysisRemark: dialysis_remark,
|
|
3207
|
+ PrescribingNumber: prescribing_number,
|
|
3208
|
+ PrescriptionSodium: prescription_sodium,
|
|
3209
|
+ StartSodium: start_sodium,
|
|
3210
|
+ SodiumCurve: sodium_curve,
|
|
3211
|
+ TreatmentRemark: treatment_remark,
|
2938
|
3212
|
}
|
2939
|
3213
|
|
2940
|
3214
|
//针对河间咸的
|
|
@@ -2957,6 +3231,115 @@ func (c *DialysisAPIController) PostSolution() {
|
2957
|
3231
|
//更新状态
|
2958
|
3232
|
service.UpdateDialysisSolutionStatusTwo(dialysisSolution.ID, dialysisSolution.ModeId, dialysisSolution.UserOrgId, dialysisSolution.PatientId)
|
2959
|
3233
|
|
|
3234
|
+ //长沙南雅医院,自动生成抗凝剂的临时处方
|
|
3235
|
+ if adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 {
|
|
3236
|
+ advice := models.DoctorAdvice{
|
|
3237
|
+ UserOrgId: adminUserInfo.Org.Id,
|
|
3238
|
+ PatientId: id,
|
|
3239
|
+ GroupNo: 0,
|
|
3240
|
+ AdviceType: 2,
|
|
3241
|
+ RecordDate: recordDate.Unix(),
|
|
3242
|
+ AdviceDate: recordDate.Unix(),
|
|
3243
|
+ StartTime: recordDate.Unix() + 7*60*60, // 根据排班班次,给默认时间
|
|
3244
|
+ AdviceName: "", // 根据抗凝剂转换为中文 + 首剂 + 维持 + 总量
|
|
3245
|
+ AdviceDesc: "",
|
|
3246
|
+ ReminderDate: 0,
|
|
3247
|
+ SingleDose: 5000,
|
|
3248
|
+ SingleDoseUnit: "iu",
|
|
3249
|
+ DrugSpec: 0,
|
|
3250
|
+ DrugSpecUnit: "",
|
|
3251
|
+ PrescribingNumber: prescribing_number, // 前端传过来的开药数量
|
|
3252
|
+ PrescribingNumberUnit: "支",
|
|
3253
|
+ DeliveryWay: "静脉注射",
|
|
3254
|
+ ExecutionFrequency: "上机前",
|
|
3255
|
+ AdviceDoctor: 0,
|
|
3256
|
+ Status: 1,
|
|
3257
|
+ CreatedTime: time.Now().Unix(),
|
|
3258
|
+ UpdatedTime: time.Now().Unix(),
|
|
3259
|
+ IsPrescription: 1,
|
|
3260
|
+ }
|
|
3261
|
+ // 查询排班信息
|
|
3262
|
+ schedulePatient, _ := service.GetScheduleByPatient(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
|
3263
|
+ if schedulePatient.ID > 0 {
|
|
3264
|
+ if schedulePatient.ScheduleType == 1 {
|
|
3265
|
+ advice.StartTime = recordDate.Unix() + 7*60*60
|
|
3266
|
+ }
|
|
3267
|
+
|
|
3268
|
+ if schedulePatient.ScheduleType == 2 {
|
|
3269
|
+ advice.StartTime = recordDate.Unix() + 11*60*60
|
|
3270
|
+ }
|
|
3271
|
+ }
|
|
3272
|
+ // 抗凝剂名称
|
|
3273
|
+ switch anticoagulant {
|
|
3274
|
+ case 1:
|
|
3275
|
+ advice.AdviceName = "无肝素"
|
|
3276
|
+ break
|
|
3277
|
+ case 2:
|
|
3278
|
+ advice.AdviceName = "普通肝素"
|
|
3279
|
+ break
|
|
3280
|
+ case 3:
|
|
3281
|
+ advice.AdviceName = "低分子肝素"
|
|
3282
|
+ break
|
|
3283
|
+ case 4:
|
|
3284
|
+ advice.AdviceName = "阿加曲班"
|
|
3285
|
+ break
|
|
3286
|
+ case 5:
|
|
3287
|
+ advice.AdviceName = "枸橼酸钠"
|
|
3288
|
+ break
|
|
3289
|
+ case 6:
|
|
3290
|
+ advice.AdviceName = "低分子肝素钙"
|
|
3291
|
+ break
|
|
3292
|
+ case 7:
|
|
3293
|
+ advice.AdviceName = "低分子肝素钠"
|
|
3294
|
+ break
|
|
3295
|
+ case 8:
|
|
3296
|
+ advice.AdviceName = "依诺肝素"
|
|
3297
|
+ break
|
|
3298
|
+ case 9:
|
|
3299
|
+ advice.AdviceName = "达肝素"
|
|
3300
|
+ break
|
|
3301
|
+ case 10:
|
|
3302
|
+ advice.AdviceName = "体外抗凝"
|
|
3303
|
+ break
|
|
3304
|
+ case 11:
|
|
3305
|
+ advice.AdviceName = "那曲肝素"
|
|
3306
|
+ break
|
|
3307
|
+ case 12:
|
|
3308
|
+ advice.AdviceName = "无抗凝剂"
|
|
3309
|
+ break
|
|
3310
|
+ }
|
|
3311
|
+ //advice.AdviceDesc = "首剂" + strconv.FormatFloat(anticoagulant_shouji, 'f', -1, 64) + "维持" + strconv.FormatFloat(anticoagulant_weichi, 'f', -1, 64) + "总量" + strconv.FormatFloat(anticoagulant_zongliang, 'f', -1, 64)
|
|
3312
|
+ if appRole.UserType == 2 || appRole.UserType == 1 || appRole.UserType == 4 {
|
|
3313
|
+ advice.AdviceDoctor = appRole.AdminUserId
|
|
3314
|
+ }
|
|
3315
|
+
|
|
3316
|
+ // 患者的临时医嘱里查找是否有抗凝剂临时医嘱
|
|
3317
|
+ advicePrescription, _ := service.GetAdvicesByPrescription(adminUserInfo.Org.Id, id, recordDate.Unix())
|
|
3318
|
+
|
|
3319
|
+ if advicePrescription.ID > 0 && (anticoagulant == 3 || anticoagulant == 6 || anticoagulant == 7) {
|
|
3320
|
+
|
|
3321
|
+ advice.AdviceName = "低分子肝素钠注射液"
|
|
3322
|
+ // 修改患者临时医嘱里的抗凝剂医嘱
|
|
3323
|
+ advice.ID = advicePrescription.ID
|
|
3324
|
+ service.UpdateDoctorAdvice(&advice)
|
|
3325
|
+ } else {
|
|
3326
|
+ if anticoagulant == 3 || anticoagulant == 6 || anticoagulant == 7 {
|
|
3327
|
+ advice.AdviceName = "低分子肝素钠注射液"
|
|
3328
|
+ service.CreateDoctorAdvice(&advice)
|
|
3329
|
+ }
|
|
3330
|
+
|
|
3331
|
+ }
|
|
3332
|
+
|
|
3333
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":doctor_advices"
|
|
3334
|
+ redis := service.RedisClient()
|
|
3335
|
+ defer redis.Close()
|
|
3336
|
+ //清空key 值
|
|
3337
|
+ redis.Set(key, "", time.Second)
|
|
3338
|
+ keyOne := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":advice_list_all"
|
|
3339
|
+ redis.Set(keyOne, "", time.Second)
|
|
3340
|
+
|
|
3341
|
+ }
|
|
3342
|
+
|
2960
|
3343
|
//获取key,清空redis
|
2961
|
3344
|
key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
|
2962
|
3345
|
redis := service.RedisClient()
|
|
@@ -3164,7 +3547,7 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
|
3164
|
3547
|
record.UltrafiltrationRate = ultrafiltration_rate
|
3165
|
3548
|
}
|
3166
|
3549
|
|
3167
|
|
- if adminInfo.Org.Id == 10395 || adminInfo.Org.Id == 10138 || adminInfo.Org.Id == 10278 || adminInfo.Org.Id == 10340 || adminInfo.Org.Id == 10432 || adminInfo.Org.Id == 10441 || adminInfo.Org.Id == 10445 {
|
|
3550
|
+ if adminInfo.Org.Id == 10395 || adminInfo.Org.Id == 10138 || adminInfo.Org.Id == 10278 || adminInfo.Org.Id == 10340 || adminInfo.Org.Id == 10432 || adminInfo.Org.Id == 10441 || adminInfo.Org.Id == 10445 || adminInfo.Org.Id == 9829 {
|
3168
|
3551
|
ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 60 / 1000 / float64(totalMin) * 1000)
|
3169
|
3552
|
record.UltrafiltrationRate = ultrafiltration_rate
|
3170
|
3553
|
}
|
|
@@ -3203,6 +3586,10 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
|
3203
|
3586
|
}
|
3204
|
3587
|
|
3205
|
3588
|
}
|
|
3589
|
+ //长沙南雅累计血容量自动计算
|
|
3590
|
+ if adminInfo.Org.Id == 10340 || adminInfo.Org.Id == 9671 {
|
|
3591
|
+ record.AccumulatedBloodVolume = (record.BloodFlowVolume - 25) * (math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime)/3600) * 60) / 1000
|
|
3592
|
+ }
|
3206
|
3593
|
|
3207
|
3594
|
if template.TemplateId == 47 || template.TemplateId == 54 {
|
3208
|
3595
|
record.DisplacementQuantity = record.DisplacementQuantity + record.DisplacementQuantity
|
|
@@ -3236,6 +3623,7 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
|
3236
|
3623
|
nuclein_date_str := this.GetString("nuclein_date_str")
|
3237
|
3624
|
order_remark := this.GetString("order_remark")
|
3238
|
3625
|
schedule_remark := this.GetString("schedule_remark")
|
|
3626
|
+ catheter_operation := this.GetString("catheter_operation")
|
3239
|
3627
|
if record_id == 0 {
|
3240
|
3628
|
this.ErrorLog("id:%v", record_id)
|
3241
|
3629
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
@@ -3400,13 +3788,12 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
|
3400
|
3788
|
NucleinDate: theNucleinDate,
|
3401
|
3789
|
OrderRemark: order_remark,
|
3402
|
3790
|
ScheduleRemark: schedule_remark,
|
|
3791
|
+ CatheterOperation: catheter_operation,
|
3403
|
3792
|
}
|
3404
|
3793
|
|
|
3794
|
+ //修改床位号需要重新消毒
|
3405
|
3795
|
if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10445 {
|
3406
|
|
-
|
3407
|
|
- if tempDialysisRecord.BedID != bedID {
|
3408
|
|
- service.UpdateDeviceInformation(tempDialysisRecord.PatientId, tempDialysisRecord.DialysisDate)
|
3409
|
|
- }
|
|
3796
|
+ service.UpdateDeviceInformation(tempDialysisRecord.PatientId, tempDialysisRecord.DialysisDate)
|
3410
|
3797
|
}
|
3411
|
3798
|
|
3412
|
3799
|
updateErr := service.ModifyStartDialysisOrder(dialysisRecord)
|
|
@@ -4790,6 +5177,10 @@ func (c *DialysisAPIController) CreateStockOutInfo() {
|
4790
|
5177
|
for _, item := range consumables {
|
4791
|
5178
|
//出库
|
4792
|
5179
|
err := service.ConsumablesGoodDelivery(item.UserOrgId, patient_id, record_time, item, &warehouseOut, item.Count)
|
|
5180
|
+
|
|
5181
|
+ //err := service.ConsumableMobileDelivery(item.UserOrgId, patient_id, record_time, item, &warehouseOut, adminInfo.AdminUser.Id, item.Count)
|
|
5182
|
+ //fmt.Println("item----------------------------------count", item.Count)
|
|
5183
|
+
|
4793
|
5184
|
if err == nil {
|
4794
|
5185
|
goodErrcode := models.XtGoodErrcode{
|
4795
|
5186
|
UserOrgId: adminInfo.Org.Id,
|
|
@@ -4940,6 +5331,8 @@ func (c *DialysisAPIController) CreateStockOutInfo() {
|
4940
|
5331
|
for _, item := range consumables {
|
4941
|
5332
|
//出库
|
4942
|
5333
|
err := service.ConsumablesGoodDelivery(item.UserOrgId, patient_id, record_time, item, &out, item.Count)
|
|
5334
|
+ //err := service.ConsumableMobileDelivery(item.UserOrgId, patient_id, record_time, item, &out, adminInfo.AdminUser.Id, item.Count)
|
|
5335
|
+ //fmt.Println("item----------------------------------count", item.Count)
|
4943
|
5336
|
if err != nil {
|
4944
|
5337
|
goodErrcode := models.XtGoodErrcode{
|
4945
|
5338
|
UserOrgId: adminInfo.Org.Id,
|
|
@@ -5213,6 +5606,7 @@ func (c *DialysisAPIController) EditConsumables() {
|
5213
|
5606
|
|
5214
|
5607
|
fmt.Println("退库长度", len(cancelbefor))
|
5215
|
5608
|
fmt.Println("出库长度", len(outbefor))
|
|
5609
|
+
|
5216
|
5610
|
//退库
|
5217
|
5611
|
for _, item := range cancelbefor {
|
5218
|
5612
|
warehouseOut, _ := service.FindStockOutByIsSys(adminInfo.Org.Id, 1, record_time)
|
|
@@ -5258,7 +5652,6 @@ func (c *DialysisAPIController) EditConsumables() {
|
5258
|
5652
|
warehouseOutInfo.LicenseNumber = stockInInfo.LicenseNumber
|
5259
|
5653
|
warehouseOutInfo.WarehouseInfotId = stockInInfo.ID
|
5260
|
5654
|
//查找当天是否存在出库记录
|
5261
|
|
-
|
5262
|
5655
|
_, errcod := service.GetWarehouseOutInfoIsExistOne(item.GoodId, patient_id, record_time, 0)
|
5263
|
5656
|
|
5264
|
5657
|
if errcod == gorm.ErrRecordNotFound {
|
|
@@ -5358,6 +5751,7 @@ func (c *DialysisAPIController) EditConsumables() {
|
5358
|
5751
|
StorehouseId: houseConfig.StorehouseOutInfo,
|
5359
|
5752
|
}
|
5360
|
5753
|
exsit, errflows := service.GetStockFlowIsExsit(warehouseOutInfos.WarehouseInfotId, patient_id, record_time, item.GoodId)
|
|
5754
|
+
|
5361
|
5755
|
if errflows == gorm.ErrRecordNotFound {
|
5362
|
5756
|
//创建流水表
|
5363
|
5757
|
service.CreateStockFlowOne(stockFlow)
|
|
@@ -5478,8 +5872,6 @@ func (c *DialysisAPIController) EditConsumables() {
|
5478
|
5872
|
|
5479
|
5873
|
}
|
5480
|
5874
|
|
5481
|
|
- //比较剩余库存 和 当前相差的数量,库存剩余量大于则正常出库
|
5482
|
|
-
|
5483
|
5875
|
//查询该耗材的总库存
|
5484
|
5876
|
wareinfo, _ := service.GetStockGoodCount(item.GoodId)
|
5485
|
5877
|
// 如果库存差大于剩余库存则提示库存不足
|
|
@@ -7774,3 +8166,33 @@ func (this *DialysisAPIController) CheckSchedule() {
|
7774
|
8166
|
}
|
7775
|
8167
|
|
7776
|
8168
|
}
|
|
8169
|
+
|
|
8170
|
+func (this *DialysisAPIController) GetNewDoctorListToday() {
|
|
8171
|
+
|
|
8172
|
+ orgId := this.GetMobileAdminUserInfo().Org.Id
|
|
8173
|
+
|
|
8174
|
+ schedule_type, _ := this.GetInt64("schedule_type")
|
|
8175
|
+
|
|
8176
|
+ partion_type, _ := this.GetInt64("partion_type")
|
|
8177
|
+
|
|
8178
|
+ start_time := this.GetString("start_time")
|
|
8179
|
+ timeLayout := "2006-01-02"
|
|
8180
|
+ loc, _ := time.LoadLocation("Local")
|
|
8181
|
+ startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
8182
|
+ list, err := service.GetDialysisAdviceSchedulist(orgId, schedule_type, partion_type, startTime.Unix())
|
|
8183
|
+ _, config := service.FindXTHisRecordByOrgId(orgId)
|
|
8184
|
+ appId := this.GetMobileAdminUserInfo().App.Id
|
|
8185
|
+ doctorList, _ := service.GetAllAdminUsers(orgId, appId)
|
|
8186
|
+ if err == nil {
|
|
8187
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8188
|
+ "list": list,
|
|
8189
|
+ "config": config,
|
|
8190
|
+ "doctorList": doctorList,
|
|
8191
|
+ })
|
|
8192
|
+ return
|
|
8193
|
+
|
|
8194
|
+ } else {
|
|
8195
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
8196
|
+ return
|
|
8197
|
+ }
|
|
8198
|
+}
|