|
@@ -1490,7 +1490,7 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
|
1490
|
1490
|
dewater_amount = 0
|
1491
|
1491
|
}
|
1492
|
1492
|
// 计算透析处方的相关超滤量
|
1493
|
|
- schedual, _ := service.MobileGetSchedualDetail(adminUserInfo.Org.Id, patient.ID, theAssessmentDateTime)
|
|
1493
|
+ schedual, _ := service.MobileGetSchedualDetailSix(adminUserInfo.Org.Id, patient.ID, theAssessmentDateTime)
|
1494
|
1494
|
var lastDialysisPrescribe *models.DialysisPrescription
|
1495
|
1495
|
var dialysisSolution *models.DialysisSolution
|
1496
|
1496
|
var dialysisPrescribe *models.DialysisPrescription
|
|
@@ -1499,11 +1499,11 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
|
1499
|
1499
|
var mode_id int64
|
1500
|
1500
|
|
1501
|
1501
|
dialysisPrescribe, _ = service.MobileGetDialysisPrescribe(adminUserInfo.Org.Id, id, theAssessmentDateTime)
|
1502
|
|
- lastDialysisPrescribe, _ = service.MobileGetLastDialysisPrescribeByModeId(adminUserInfo.Org.Id, id, schedual.ModeId)
|
|
1502
|
+ lastDialysisPrescribe, _ = service.MobileGetLastDialysisPrescribeByModeIdSix(adminUserInfo.Org.Id, id, schedual.ModeId)
|
1503
|
1503
|
if schedual != nil {
|
1504
|
1504
|
// 获取透析模版
|
1505
|
|
- dialysisSolution, _ = service.MobileGetDialysisSolutionByModeId(adminUserInfo.Org.Id, id, schedual.ModeId)
|
1506
|
|
- system_dialysisPrescribe, _ = service.MobileGetSystemDialysisPrescribeByModeId(adminUserInfo.Org.Id, schedual.ModeId)
|
|
1505
|
+ dialysisSolution, _ = service.MobileGetDialysisSolutionByModeIdSix(adminUserInfo.Org.Id, id, schedual.ModeId)
|
|
1506
|
+ system_dialysisPrescribe, _ = service.MobileGetSystemDialysisPrescribeByModeIdSix(adminUserInfo.Org.Id, schedual.ModeId)
|
1507
|
1507
|
|
1508
|
1508
|
mode_id = schedual.ModeId
|
1509
|
1509
|
} else {
|
|
@@ -1571,11 +1571,62 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
|
1571
|
1571
|
newprescribe.Status = 1
|
1572
|
1572
|
newprescribe.DialysisDialyszers = dialysisSolution.DialysisDialyszers
|
1573
|
1573
|
newprescribe.DialysisIrrigation = dialysisSolution.DialysisIrrigation
|
|
1574
|
+ _, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, theAssessmentDateTime, adminUserInfo.Org.Id)
|
|
1575
|
+ newprescribe.ID = dialysisPrescription.ID
|
1574
|
1576
|
|
1575
|
|
- err := service.AddSigleRecord(&newprescribe)
|
1576
|
|
- if err != nil {
|
1577
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
|
1577
|
+ if dialysisPrescription.ID == 0 {
|
|
1578
|
+ fmt.Println("处方11111111111")
|
|
1579
|
+ err := service.AddSigleRecord(&newprescribe)
|
|
1580
|
+ //获取key,清空redis
|
|
1581
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
|
|
1582
|
+ redis := service.RedisClient()
|
|
1583
|
+
|
|
1584
|
+ //清空key 值
|
|
1585
|
+ redis.Set(key, "", time.Second)
|
|
1586
|
+
|
|
1587
|
+ keyOne := "scheduals_" + assessmentDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
|
|
1588
|
+ //清空key 值
|
|
1589
|
+ redis.Set(keyOne, "", time.Second)
|
|
1590
|
+
|
|
1591
|
+ keyTwo := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_solution"
|
|
1592
|
+ //清空key 值
|
|
1593
|
+ redis.Set(keyTwo, "", time.Second)
|
|
1594
|
+
|
|
1595
|
+ keySix := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":prescriptions_list_all"
|
|
1596
|
+ redis.Set(keySix, "", time.Second)
|
|
1597
|
+
|
|
1598
|
+ keySeven := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":dialysis_prescribe_by_mode"
|
|
1599
|
+ redis.Set(keySeven, "", time.Second)
|
|
1600
|
+ if err != nil {
|
|
1601
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
|
1602
|
+ }
|
|
1603
|
+ } else {
|
|
1604
|
+ err := service.UpDateDialysisPrescription(&newprescribe)
|
|
1605
|
+ //获取key,清空redis
|
|
1606
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
|
|
1607
|
+ redis := service.RedisClient()
|
|
1608
|
+
|
|
1609
|
+ //清空key 值
|
|
1610
|
+ redis.Set(key, "", time.Second)
|
|
1611
|
+
|
|
1612
|
+ keyOne := "scheduals_" + assessmentDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
|
|
1613
|
+ //清空key 值
|
|
1614
|
+ redis.Set(keyOne, "", time.Second)
|
|
1615
|
+
|
|
1616
|
+ keyTwo := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_solution"
|
|
1617
|
+ //清空key 值
|
|
1618
|
+ redis.Set(keyTwo, "", time.Second)
|
|
1619
|
+
|
|
1620
|
+ keySix := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":prescriptions_list_all"
|
|
1621
|
+ redis.Set(keySix, "", time.Second)
|
|
1622
|
+
|
|
1623
|
+ keySeven := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":dialysis_prescribe_by_mode"
|
|
1624
|
+ redis.Set(keySeven, "", time.Second)
|
|
1625
|
+ if err != nil {
|
|
1626
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
|
1627
|
+ }
|
1578
|
1628
|
}
|
|
1629
|
+
|
1579
|
1630
|
}
|
1580
|
1631
|
|
1581
|
1632
|
if dialysisPrescribe == nil && dialysisSolution == nil {
|
|
@@ -1628,7 +1679,60 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
|
1628
|
1679
|
newprescribe.Status = 1
|
1629
|
1680
|
newprescribe.DialysisIrrigation = lastDialysisPrescribe.DialysisIrrigation
|
1630
|
1681
|
newprescribe.DialysisDialyszers = lastDialysisPrescribe.DialysisDialyszers
|
1631
|
|
- err := service.AddSigleRecord(&newprescribe)
|
|
1682
|
+ _, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, theAssessmentDateTime, adminUserInfo.Org.Id)
|
|
1683
|
+ newprescribe.ID = dialysisPrescription.ID
|
|
1684
|
+ if dialysisPrescription.ID == 0 {
|
|
1685
|
+ err := service.AddSigleRecord(&newprescribe)
|
|
1686
|
+ //获取key,清空redis
|
|
1687
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
|
|
1688
|
+ redis := service.RedisClient()
|
|
1689
|
+
|
|
1690
|
+ //清空key 值
|
|
1691
|
+ redis.Set(key, "", time.Second)
|
|
1692
|
+
|
|
1693
|
+ keyOne := "scheduals_" + assessmentDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
|
|
1694
|
+ //清空key 值
|
|
1695
|
+ redis.Set(keyOne, "", time.Second)
|
|
1696
|
+
|
|
1697
|
+ keyTwo := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_solution"
|
|
1698
|
+ //清空key 值
|
|
1699
|
+ redis.Set(keyTwo, "", time.Second)
|
|
1700
|
+
|
|
1701
|
+ keySix := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":prescriptions_list_all"
|
|
1702
|
+ redis.Set(keySix, "", time.Second)
|
|
1703
|
+
|
|
1704
|
+ keySeven := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":dialysis_prescribe_by_mode"
|
|
1705
|
+ redis.Set(keySeven, "", time.Second)
|
|
1706
|
+ fmt.Println("处方2222222222")
|
|
1707
|
+ if err != nil {
|
|
1708
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
|
1709
|
+ }
|
|
1710
|
+ } else {
|
|
1711
|
+ err := service.UpDateDialysisPrescription(&newprescribe)
|
|
1712
|
+ //获取key,清空redis
|
|
1713
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
|
|
1714
|
+ redis := service.RedisClient()
|
|
1715
|
+
|
|
1716
|
+ //清空key 值
|
|
1717
|
+ redis.Set(key, "", time.Second)
|
|
1718
|
+
|
|
1719
|
+ keyOne := "scheduals_" + assessmentDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
|
|
1720
|
+ //清空key 值
|
|
1721
|
+ redis.Set(keyOne, "", time.Second)
|
|
1722
|
+
|
|
1723
|
+ keyTwo := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_solution"
|
|
1724
|
+ //清空key 值
|
|
1725
|
+ redis.Set(keyTwo, "", time.Second)
|
|
1726
|
+
|
|
1727
|
+ keySix := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":prescriptions_list_all"
|
|
1728
|
+ redis.Set(keySix, "", time.Second)
|
|
1729
|
+
|
|
1730
|
+ keySeven := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":dialysis_prescribe_by_mode"
|
|
1731
|
+ redis.Set(keySeven, "", time.Second)
|
|
1732
|
+ if err != nil {
|
|
1733
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
|
1734
|
+ }
|
|
1735
|
+ }
|
1632
|
1736
|
if err != nil {
|
1633
|
1737
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
1634
|
1738
|
}
|
|
@@ -1682,7 +1786,61 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
|
1682
|
1786
|
newprescribe.Status = 1
|
1683
|
1787
|
newprescribe.DialysisDialyszers = system_dialysisPrescribe.DialysisDialyszers
|
1684
|
1788
|
newprescribe.DialysisIrrigation = system_dialysisPrescribe.DialysisIrrigation
|
1685
|
|
- err := service.AddSigleRecord(&newprescribe)
|
|
1789
|
+ _, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, theAssessmentDateTime, adminUserInfo.Org.Id)
|
|
1790
|
+ newprescribe.ID = dialysisPrescription.ID
|
|
1791
|
+ if dialysisPrescription.ID == 0 {
|
|
1792
|
+ err := service.AddSigleRecord(&newprescribe)
|
|
1793
|
+
|
|
1794
|
+ fmt.Println("处方2222222222")
|
|
1795
|
+ //获取key,清空redis
|
|
1796
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
|
|
1797
|
+ redis := service.RedisClient()
|
|
1798
|
+
|
|
1799
|
+ //清空key 值
|
|
1800
|
+ redis.Set(key, "", time.Second)
|
|
1801
|
+
|
|
1802
|
+ keyOne := "scheduals_" + assessmentDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
|
|
1803
|
+ //清空key 值
|
|
1804
|
+ redis.Set(keyOne, "", time.Second)
|
|
1805
|
+
|
|
1806
|
+ keyTwo := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_solution"
|
|
1807
|
+ //清空key 值
|
|
1808
|
+ redis.Set(keyTwo, "", time.Second)
|
|
1809
|
+
|
|
1810
|
+ keySix := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":prescriptions_list_all"
|
|
1811
|
+ redis.Set(keySix, "", time.Second)
|
|
1812
|
+
|
|
1813
|
+ keySeven := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":dialysis_prescribe_by_mode"
|
|
1814
|
+ redis.Set(keySeven, "", time.Second)
|
|
1815
|
+ if err != nil {
|
|
1816
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
|
1817
|
+ }
|
|
1818
|
+ } else {
|
|
1819
|
+ err := service.UpDateDialysisPrescription(&newprescribe)
|
|
1820
|
+ //获取key,清空redis
|
|
1821
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
|
|
1822
|
+ redis := service.RedisClient()
|
|
1823
|
+
|
|
1824
|
+ //清空key 值
|
|
1825
|
+ redis.Set(key, "", time.Second)
|
|
1826
|
+
|
|
1827
|
+ keyOne := "scheduals_" + assessmentDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
|
|
1828
|
+ //清空key 值
|
|
1829
|
+ redis.Set(keyOne, "", time.Second)
|
|
1830
|
+
|
|
1831
|
+ keyTwo := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_solution"
|
|
1832
|
+ //清空key 值
|
|
1833
|
+ redis.Set(keyTwo, "", time.Second)
|
|
1834
|
+
|
|
1835
|
+ keySix := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":prescriptions_list_all"
|
|
1836
|
+ redis.Set(keySix, "", time.Second)
|
|
1837
|
+
|
|
1838
|
+ keySeven := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":dialysis_prescribe_by_mode"
|
|
1839
|
+ redis.Set(keySeven, "", time.Second)
|
|
1840
|
+ if err != nil {
|
|
1841
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
|
1842
|
+ }
|
|
1843
|
+ }
|
1686
|
1844
|
if err != nil {
|
1687
|
1845
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
1688
|
1846
|
}
|
|
@@ -1699,7 +1857,60 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
|
1699
|
1857
|
newprescribe.TargetUltrafiltration = dewater_amount
|
1700
|
1858
|
newprescribe.Status = 1
|
1701
|
1859
|
|
1702
|
|
- err := service.AddSigleRecord(&newprescribe)
|
|
1860
|
+ _, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, theAssessmentDateTime, adminUserInfo.Org.Id)
|
|
1861
|
+ newprescribe.ID = dialysisPrescription.ID
|
|
1862
|
+ if dialysisPrescription.ID == 0 {
|
|
1863
|
+ err := service.AddSigleRecord(&newprescribe)
|
|
1864
|
+ fmt.Println("处方44444444444")
|
|
1865
|
+ //获取key,清空redis
|
|
1866
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
|
|
1867
|
+ redis := service.RedisClient()
|
|
1868
|
+
|
|
1869
|
+ //清空key 值
|
|
1870
|
+ redis.Set(key, "", time.Second)
|
|
1871
|
+
|
|
1872
|
+ keyOne := "scheduals_" + assessmentDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
|
|
1873
|
+ //清空key 值
|
|
1874
|
+ redis.Set(keyOne, "", time.Second)
|
|
1875
|
+
|
|
1876
|
+ keyTwo := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_solution"
|
|
1877
|
+ //清空key 值
|
|
1878
|
+ redis.Set(keyTwo, "", time.Second)
|
|
1879
|
+
|
|
1880
|
+ keySix := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":prescriptions_list_all"
|
|
1881
|
+ redis.Set(keySix, "", time.Second)
|
|
1882
|
+
|
|
1883
|
+ keySeven := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":dialysis_prescribe_by_mode"
|
|
1884
|
+ redis.Set(keySeven, "", time.Second)
|
|
1885
|
+ if err != nil {
|
|
1886
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
|
1887
|
+ }
|
|
1888
|
+ } else {
|
|
1889
|
+ err := service.UpDateDialysisPrescription(&newprescribe)
|
|
1890
|
+ //获取key,清空redis
|
|
1891
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_prescribe"
|
|
1892
|
+ redis := service.RedisClient()
|
|
1893
|
+
|
|
1894
|
+ //清空key 值
|
|
1895
|
+ redis.Set(key, "", time.Second)
|
|
1896
|
+
|
|
1897
|
+ keyOne := "scheduals_" + assessmentDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
|
|
1898
|
+ //清空key 值
|
|
1899
|
+ redis.Set(keyOne, "", time.Second)
|
|
1900
|
+
|
|
1901
|
+ keyTwo := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(mode_id, 10) + ":dialysis_solution"
|
|
1902
|
+ //清空key 值
|
|
1903
|
+ redis.Set(keyTwo, "", time.Second)
|
|
1904
|
+
|
|
1905
|
+ keySix := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":prescriptions_list_all"
|
|
1906
|
+ redis.Set(keySix, "", time.Second)
|
|
1907
|
+
|
|
1908
|
+ keySeven := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(theAssessmentDateTime, 10) + ":dialysis_prescribe_by_mode"
|
|
1909
|
+ redis.Set(keySeven, "", time.Second)
|
|
1910
|
+ if err != nil {
|
|
1911
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
|
1912
|
+ }
|
|
1913
|
+ }
|
1703
|
1914
|
if err != nil {
|
1704
|
1915
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCommitFail)
|
1705
|
1916
|
}
|