|
@@ -67,6 +67,8 @@ func PublicApiRegistRouters() {
|
67
|
67
|
|
68
|
68
|
beego.Router("/groupno", &PublicApiController{}, "get:HandleGroupNo")
|
69
|
69
|
|
|
70
|
+ beego.Router("/handle10215", &PublicApiController{}, "get:Handle10215")
|
|
71
|
+
|
70
|
72
|
//beego.Router("/handelOrder", &PublicApiController{}, "get:HandleOrder")
|
71
|
73
|
|
72
|
74
|
}
|
|
@@ -609,15 +611,16 @@ func (c *PublicApiController) HandleData() {
|
609
|
611
|
}
|
610
|
612
|
|
611
|
613
|
func (c *PublicApiController) HandleGroupNo() {
|
612
|
|
- pts, _ := service.GetHisPrescriptionTemplateTwo()
|
613
|
|
- for _, item := range pts {
|
614
|
|
- if len(item.HisPrescriptionAdviceTemplate) > 0 {
|
615
|
|
- for index, subItem := range item.HisPrescriptionAdviceTemplate {
|
616
|
|
- subItem.Groupno = int64(index + 1)
|
617
|
|
- service.SaveAdviceTemplate(subItem)
|
618
|
|
- }
|
619
|
|
- }
|
620
|
|
- }
|
|
614
|
+ //service.GetAllPatientChargeDetails(10138, 1634054400)
|
|
615
|
+ //pts, _ := service.GetHisPrescriptionTemplateTwo()
|
|
616
|
+ //for _, item := range pts {
|
|
617
|
+ // if len(item.HisPrescriptionAdviceTemplate) > 0 {
|
|
618
|
+ // for index, subItem := range item.HisPrescriptionAdviceTemplate {
|
|
619
|
+ // subItem.Groupno = int64(index + 1)
|
|
620
|
+ // service.SaveAdviceTemplate(subItem)
|
|
621
|
+ // }
|
|
622
|
+ // }
|
|
623
|
+ //}
|
621
|
624
|
}
|
622
|
625
|
|
623
|
626
|
func InitRoleAndPurviews(org_ids []int64) {
|
|
@@ -1757,3 +1760,275 @@ func PathExists(path string) (bool, error) {
|
1757
|
1760
|
}
|
1758
|
1761
|
return false, err
|
1759
|
1762
|
}
|
|
1763
|
+
|
|
1764
|
+func (c *PublicApiController) Handle10215() {
|
|
1765
|
+
|
|
1766
|
+ //projects,_ := service.GetAllInfo(10215,2284)
|
|
1767
|
+ //
|
|
1768
|
+ //for _, item := range projects{
|
|
1769
|
+ // service.UpdateStatus(item.ID, item.PrescriptionId)
|
|
1770
|
+ //}
|
|
1771
|
+ //projects_two,_ := service.GetAllInfo(10215,2277)
|
|
1772
|
+ //
|
|
1773
|
+ //for _, item := range projects_two{
|
|
1774
|
+ // service.UpdateStatus(item.ID, item.PrescriptionId)
|
|
1775
|
+ //}
|
|
1776
|
+
|
|
1777
|
+ //service.GetAllInfo(10215,2284)
|
|
1778
|
+ //service.GetAllInfo(10215,2277)
|
|
1779
|
+
|
|
1780
|
+ his, _ := service.GetAllPT(10215)
|
|
1781
|
+ for _, item := range his {
|
|
1782
|
+
|
|
1783
|
+ info := &models.HisPrescriptionInfoTemplate{
|
|
1784
|
+ UserOrgId: item.UserOrgId,
|
|
1785
|
+ RecordDate: 0,
|
|
1786
|
+ PatientId: item.PatientId,
|
|
1787
|
+ Status: 1,
|
|
1788
|
+ Ctime: time.Now().Unix(),
|
|
1789
|
+ Mtime: time.Now().Unix(),
|
|
1790
|
+ Type: 2,
|
|
1791
|
+ Creator: 0,
|
|
1792
|
+ Modifier: 0,
|
|
1793
|
+ PType: 0,
|
|
1794
|
+ PTemplateId: item.ID,
|
|
1795
|
+ MedType: "14",
|
|
1796
|
+ }
|
|
1797
|
+ service.CreateHisPrescriptionInfoTemplate(info)
|
|
1798
|
+
|
|
1799
|
+ pro := &models.HisPrescriptionProjectTemplate{
|
|
1800
|
+ ProjectId: 1750,
|
|
1801
|
+ Price: 6.00,
|
|
1802
|
+ UserOrgId: 10215,
|
|
1803
|
+ Status: 1,
|
|
1804
|
+ Ctime: time.Now().Unix(),
|
|
1805
|
+ Mtime: time.Now().Unix(),
|
|
1806
|
+ PatientId: item.PatientId,
|
|
1807
|
+ RecordDate: 0,
|
|
1808
|
+ Count: 1,
|
|
1809
|
+ FeedetlSn: "",
|
|
1810
|
+ MedListCodg: "",
|
|
1811
|
+ SingleDose: "1",
|
|
1812
|
+ DeliveryWay: "",
|
|
1813
|
+ ExecutionFrequency: "",
|
|
1814
|
+ Day: "1",
|
|
1815
|
+ Remark: "",
|
|
1816
|
+ Unit: "",
|
|
1817
|
+ Type: 2,
|
|
1818
|
+ PrescriptionId: info.ID,
|
|
1819
|
+ FrequencyType: 1,
|
|
1820
|
+ DayCount: 0,
|
|
1821
|
+ WeekDay: "",
|
|
1822
|
+ }
|
|
1823
|
+ service.CreateHisPrescriptionProjectTemplate(pro)
|
|
1824
|
+
|
|
1825
|
+ pro2 := &models.HisPrescriptionProjectTemplate{
|
|
1826
|
+ ProjectId: 2462,
|
|
1827
|
+ Price: 4.94,
|
|
1828
|
+ UserOrgId: 10215,
|
|
1829
|
+ Status: 1,
|
|
1830
|
+ Ctime: time.Now().Unix(),
|
|
1831
|
+ Mtime: time.Now().Unix(),
|
|
1832
|
+ PatientId: item.PatientId,
|
|
1833
|
+ RecordDate: 0,
|
|
1834
|
+ Count: 1,
|
|
1835
|
+ FeedetlSn: "",
|
|
1836
|
+ MedListCodg: "",
|
|
1837
|
+ SingleDose: "1",
|
|
1838
|
+ DeliveryWay: "",
|
|
1839
|
+ ExecutionFrequency: "",
|
|
1840
|
+ Day: "1",
|
|
1841
|
+ Remark: "",
|
|
1842
|
+ Unit: "",
|
|
1843
|
+ Type: 3,
|
|
1844
|
+ PrescriptionId: info.ID,
|
|
1845
|
+ FrequencyType: 1,
|
|
1846
|
+ DayCount: 0,
|
|
1847
|
+ WeekDay: "",
|
|
1848
|
+ }
|
|
1849
|
+ service.CreateHisPrescriptionProjectTemplate(pro2)
|
|
1850
|
+ //
|
|
1851
|
+ //
|
|
1852
|
+ infos, _ := service.GetAllPTInfo(10215, item.ID)
|
|
1853
|
+ // // fmt.Println(infos)
|
|
1854
|
+ for _, subItem := range infos {
|
|
1855
|
+
|
|
1856
|
+ if len(subItem.HisPrescriptionAdviceTemplate) > 0 && len(subItem.HisPrescriptionProjectTemplate) == 0 {
|
|
1857
|
+
|
|
1858
|
+ for _, ssubItem := range subItem.HisPrescriptionAdviceTemplate {
|
|
1859
|
+
|
|
1860
|
+ if ssubItem.DrugId == 1234 {
|
|
1861
|
+ pro := &models.HisPrescriptionProjectTemplate{
|
|
1862
|
+ ProjectId: 2326,
|
|
1863
|
+ Price: 0.86,
|
|
1864
|
+ UserOrgId: ssubItem.UserOrgId,
|
|
1865
|
+ Status: 1,
|
|
1866
|
+ Ctime: time.Now().Unix(),
|
|
1867
|
+ Mtime: time.Now().Unix(),
|
|
1868
|
+ PatientId: ssubItem.PatientId,
|
|
1869
|
+ RecordDate: ssubItem.AdviceDate,
|
|
1870
|
+ Count: 1,
|
|
1871
|
+ FeedetlSn: "",
|
|
1872
|
+ MedListCodg: "",
|
|
1873
|
+ SingleDose: "1",
|
|
1874
|
+ DeliveryWay: "",
|
|
1875
|
+ ExecutionFrequency: "",
|
|
1876
|
+ Day: "1",
|
|
1877
|
+ Remark: "",
|
|
1878
|
+ Unit: "",
|
|
1879
|
+ Type: 3,
|
|
1880
|
+ PrescriptionId: info.ID,
|
|
1881
|
+ FrequencyType: ssubItem.FrequencyType,
|
|
1882
|
+ DayCount: ssubItem.DayCount,
|
|
1883
|
+ WeekDay: ssubItem.WeekDay,
|
|
1884
|
+ }
|
|
1885
|
+ service.CreateHisPrescriptionProjectTemplate(pro)
|
|
1886
|
+
|
|
1887
|
+ }
|
|
1888
|
+ if ssubItem.DrugId == 1288 {
|
|
1889
|
+
|
|
1890
|
+ pro := &models.HisPrescriptionProjectTemplate{
|
|
1891
|
+ ProjectId: 2326,
|
|
1892
|
+ Price: 0.86,
|
|
1893
|
+ UserOrgId: ssubItem.UserOrgId,
|
|
1894
|
+ Status: 1,
|
|
1895
|
+ Ctime: time.Now().Unix(),
|
|
1896
|
+ Mtime: time.Now().Unix(),
|
|
1897
|
+ PatientId: ssubItem.PatientId,
|
|
1898
|
+ RecordDate: ssubItem.AdviceDate,
|
|
1899
|
+ Count: 1,
|
|
1900
|
+ FeedetlSn: "",
|
|
1901
|
+ MedListCodg: "",
|
|
1902
|
+ SingleDose: "1",
|
|
1903
|
+ DeliveryWay: "",
|
|
1904
|
+ ExecutionFrequency: "",
|
|
1905
|
+ Day: "1",
|
|
1906
|
+ Remark: "",
|
|
1907
|
+ Unit: "",
|
|
1908
|
+ Type: 3,
|
|
1909
|
+ PrescriptionId: info.ID,
|
|
1910
|
+ FrequencyType: ssubItem.FrequencyType,
|
|
1911
|
+ DayCount: ssubItem.DayCount,
|
|
1912
|
+ WeekDay: ssubItem.WeekDay,
|
|
1913
|
+ }
|
|
1914
|
+ service.CreateHisPrescriptionProjectTemplate(pro)
|
|
1915
|
+
|
|
1916
|
+ }
|
|
1917
|
+ if ssubItem.DrugId == 1306 {
|
|
1918
|
+
|
|
1919
|
+ pro := &models.HisPrescriptionProjectTemplate{
|
|
1920
|
+ ProjectId: 2325,
|
|
1921
|
+ Price: 1.11,
|
|
1922
|
+ UserOrgId: ssubItem.UserOrgId,
|
|
1923
|
+ Status: 1,
|
|
1924
|
+ Ctime: time.Now().Unix(),
|
|
1925
|
+ Mtime: time.Now().Unix(),
|
|
1926
|
+ PatientId: ssubItem.PatientId,
|
|
1927
|
+ RecordDate: ssubItem.AdviceDate,
|
|
1928
|
+ Count: 1,
|
|
1929
|
+ FeedetlSn: "",
|
|
1930
|
+ MedListCodg: "",
|
|
1931
|
+ SingleDose: "1",
|
|
1932
|
+ DeliveryWay: "",
|
|
1933
|
+ ExecutionFrequency: "",
|
|
1934
|
+ Day: "1",
|
|
1935
|
+ Remark: "",
|
|
1936
|
+ Unit: "",
|
|
1937
|
+ Type: 3,
|
|
1938
|
+ PrescriptionId: info.ID,
|
|
1939
|
+ FrequencyType: ssubItem.FrequencyType,
|
|
1940
|
+ DayCount: ssubItem.DayCount,
|
|
1941
|
+ WeekDay: ssubItem.WeekDay,
|
|
1942
|
+ }
|
|
1943
|
+ service.CreateHisPrescriptionProjectTemplate(pro)
|
|
1944
|
+
|
|
1945
|
+ pro2 := &models.HisPrescriptionProjectTemplate{
|
|
1946
|
+ ProjectId: 1727,
|
|
1947
|
+ Price: 2.50,
|
|
1948
|
+ UserOrgId: ssubItem.UserOrgId,
|
|
1949
|
+ Status: 1,
|
|
1950
|
+ Ctime: time.Now().Unix(),
|
|
1951
|
+ Mtime: time.Now().Unix(),
|
|
1952
|
+ PatientId: ssubItem.PatientId,
|
|
1953
|
+ RecordDate: ssubItem.AdviceDate,
|
|
1954
|
+ Count: 1,
|
|
1955
|
+ FeedetlSn: "",
|
|
1956
|
+ MedListCodg: "",
|
|
1957
|
+ SingleDose: "1",
|
|
1958
|
+ DeliveryWay: "",
|
|
1959
|
+ ExecutionFrequency: "",
|
|
1960
|
+ Day: "1",
|
|
1961
|
+ Remark: "",
|
|
1962
|
+ Unit: "",
|
|
1963
|
+ Type: 2,
|
|
1964
|
+ PrescriptionId: info.ID,
|
|
1965
|
+ FrequencyType: ssubItem.FrequencyType,
|
|
1966
|
+ DayCount: ssubItem.DayCount,
|
|
1967
|
+ WeekDay: ssubItem.WeekDay,
|
|
1968
|
+ }
|
|
1969
|
+ service.CreateHisPrescriptionProjectTemplate(pro2)
|
|
1970
|
+
|
|
1971
|
+ }
|
|
1972
|
+ if ssubItem.DrugId == 1291 {
|
|
1973
|
+
|
|
1974
|
+ pro := &models.HisPrescriptionProjectTemplate{
|
|
1975
|
+ ProjectId: 2322,
|
|
1976
|
+ Price: 0.68,
|
|
1977
|
+ UserOrgId: ssubItem.UserOrgId,
|
|
1978
|
+ Status: 1,
|
|
1979
|
+ Ctime: time.Now().Unix(),
|
|
1980
|
+ Mtime: time.Now().Unix(),
|
|
1981
|
+ PatientId: ssubItem.PatientId,
|
|
1982
|
+ RecordDate: ssubItem.AdviceDate,
|
|
1983
|
+ Count: 1,
|
|
1984
|
+ FeedetlSn: "",
|
|
1985
|
+ MedListCodg: "",
|
|
1986
|
+ SingleDose: "1",
|
|
1987
|
+ DeliveryWay: "",
|
|
1988
|
+ ExecutionFrequency: "",
|
|
1989
|
+ Day: "1",
|
|
1990
|
+ Remark: "",
|
|
1991
|
+ Unit: "",
|
|
1992
|
+ Type: 3,
|
|
1993
|
+ PrescriptionId: info.ID,
|
|
1994
|
+ FrequencyType: ssubItem.FrequencyType,
|
|
1995
|
+ DayCount: ssubItem.DayCount,
|
|
1996
|
+ WeekDay: ssubItem.WeekDay,
|
|
1997
|
+ }
|
|
1998
|
+ service.CreateHisPrescriptionProjectTemplate(pro)
|
|
1999
|
+
|
|
2000
|
+ pro2 := &models.HisPrescriptionProjectTemplate{
|
|
2001
|
+ ProjectId: 1727,
|
|
2002
|
+ Price: 2.50,
|
|
2003
|
+ UserOrgId: ssubItem.UserOrgId,
|
|
2004
|
+ Status: 1,
|
|
2005
|
+ Ctime: time.Now().Unix(),
|
|
2006
|
+ Mtime: time.Now().Unix(),
|
|
2007
|
+ PatientId: ssubItem.PatientId,
|
|
2008
|
+ RecordDate: ssubItem.AdviceDate,
|
|
2009
|
+ Count: 1,
|
|
2010
|
+ FeedetlSn: "",
|
|
2011
|
+ MedListCodg: "",
|
|
2012
|
+ SingleDose: "1",
|
|
2013
|
+ DeliveryWay: "",
|
|
2014
|
+ ExecutionFrequency: "",
|
|
2015
|
+ Day: "1",
|
|
2016
|
+ Remark: "",
|
|
2017
|
+ Unit: "",
|
|
2018
|
+ Type: 2,
|
|
2019
|
+ PrescriptionId: info.ID,
|
|
2020
|
+ FrequencyType: ssubItem.FrequencyType,
|
|
2021
|
+ DayCount: ssubItem.DayCount,
|
|
2022
|
+ WeekDay: ssubItem.WeekDay,
|
|
2023
|
+ }
|
|
2024
|
+ service.CreateHisPrescriptionProjectTemplate(pro2)
|
|
2025
|
+ }
|
|
2026
|
+ }
|
|
2027
|
+
|
|
2028
|
+ }
|
|
2029
|
+
|
|
2030
|
+ }
|
|
2031
|
+
|
|
2032
|
+ }
|
|
2033
|
+
|
|
2034
|
+}
|