|
@@ -1653,205 +1653,206 @@ func (c *PatientApiController) ExecDoctorAdvice() {
|
1653
|
1653
|
//查询已经执行的医嘱
|
1654
|
1654
|
advices, _ := service.GetExecutionDoctors(adminUserInfo.CurrentOrgId, patient, id)
|
1655
|
1655
|
for _, item := range advices {
|
1656
|
|
- fmt.Println("非自备要22222")
|
1657
|
|
- if item.Way == 1 {
|
1658
|
|
- out, err := service.FindDrugStockOutByIsSys(adminUserInfo.CurrentOrgId, 1, item.RecordDate)
|
1659
|
|
- if err == gorm.ErrRecordNotFound {
|
1660
|
|
- //没有记录,则创建出库单
|
1661
|
|
- timeStr := time.Now().Format("2006-01-02")
|
1662
|
|
- timeArr := strings.Split(timeStr, "-")
|
1663
|
|
- total, _ := service.FindAllDrugWarehouseOut(adminUserInfo.CurrentOrgId)
|
1664
|
|
- total = total + 1
|
1665
|
|
- warehousing_out_order := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + timeArr[0] + timeArr[1] + timeArr[2] + "000"
|
1666
|
|
- number, _ := strconv.ParseInt(warehousing_out_order, 10, 64)
|
1667
|
|
- number = number + total
|
1668
|
|
- warehousing_out_order = "YPCKD" + strconv.FormatInt(number, 10)
|
1669
|
|
- creater := adminUserInfo.AdminUser.Id
|
1670
|
|
- warehouseOut := models.DrugWarehouseOut{
|
1671
|
|
- WarehouseOutOrderNumber: warehousing_out_order,
|
1672
|
|
- OperationTime: time.Now().Unix(),
|
1673
|
|
- OrgId: adminUserInfo.CurrentOrgId,
|
1674
|
|
- Creater: creater,
|
1675
|
|
- Ctime: time.Now().Unix(),
|
1676
|
|
- Status: 1,
|
1677
|
|
- WarehouseOutTime: item.RecordDate,
|
1678
|
|
- Dealer: 0,
|
1679
|
|
- Manufacturer: 0,
|
1680
|
|
- Type: 1,
|
1681
|
|
- IsSys: 1,
|
1682
|
|
- }
|
1683
|
|
-
|
1684
|
|
- err := service.AddSigleDrugWarehouseOut(&warehouseOut)
|
1685
|
|
- if err != nil {
|
1686
|
|
- utils.TraceLog("创建出库单失败 err = %v", err)
|
1687
|
|
- } else {
|
1688
|
|
- if item.Way == 1 {
|
1689
|
|
- if item.PrescribingNumber > 0 {
|
1690
|
|
- warehouseOutInfo := &models.DrugWarehouseOutInfo{
|
1691
|
|
- WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
|
1692
|
|
- WarehouseOutId: warehouseOut.ID,
|
1693
|
|
- Status: 1,
|
1694
|
|
- Ctime: time.Now().Unix(),
|
1695
|
|
- Remark: "",
|
1696
|
|
- OrgId: adminUserInfo.CurrentOrgId,
|
1697
|
|
- Type: 1,
|
1698
|
|
- Manufacturer: 0,
|
1699
|
|
- Dealer: 0,
|
1700
|
|
- IsSys: 1,
|
1701
|
|
- SysRecordTime: item.RecordDate,
|
1702
|
|
- DrugId: item.DrugId,
|
1703
|
|
- }
|
1704
|
|
- prescribingNumber := strconv.FormatFloat(math.Abs(item.PrescribingNumber), 'f', 0, 64)
|
1705
|
|
- count, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
1706
|
|
- warehouseOutInfo.Count = count
|
1707
|
|
- stockInInfo, _ := service.FindLastDrugStockInInfoRecord(item.DrugId, adminUserInfo.CurrentOrgId)
|
1708
|
|
- warehouseOutInfo.Price = stockInInfo.Price
|
1709
|
|
- err := service.AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
|
1710
|
|
- if err == nil {
|
1711
|
|
- details := &models.DrugAutomaticReduceDetail{
|
1712
|
|
- WarehouseOutId: warehouseOutInfo.ID,
|
1713
|
|
- WarehouseOutOrderNumber: warehouseOutInfo.WarehouseOutOrderNumber,
|
1714
|
|
- PatientId: item.PatientId,
|
1715
|
|
- Ctime: time.Now().Unix(),
|
1716
|
|
- Mtime: time.Now().Unix(),
|
1717
|
|
- Status: 1,
|
1718
|
|
- RecordTime: item.RecordDate,
|
1719
|
|
- OrgId: adminUserInfo.CurrentOrgId,
|
1720
|
|
- DrugId: item.DrugId,
|
1721
|
|
- Count: count,
|
1722
|
|
- }
|
1723
|
|
- service.AddSigleDrugAutoReduceRecordInfo(details)
|
1724
|
|
- if err != nil {
|
1725
|
|
- utils.TraceLog("创建出库单失败 err = %v", err)
|
1726
|
|
- } else {
|
1727
|
|
- if item.Way == 1 {
|
1728
|
|
- if item.PrescribingNumber > 0 {
|
1729
|
|
- warehouseOutInfo := &models.DrugWarehouseOutInfo{
|
1730
|
|
- WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
|
1731
|
|
- WarehouseOutId: warehouseOut.ID,
|
1732
|
|
- Status: 1,
|
1733
|
|
- Ctime: time.Now().Unix(),
|
1734
|
|
- Remark: "",
|
1735
|
|
- OrgId: adminUserInfo.CurrentOrgId,
|
1736
|
|
- Type: 1,
|
1737
|
|
- Manufacturer: 0,
|
1738
|
|
- Dealer: 0,
|
1739
|
|
- IsSys: 1,
|
1740
|
|
- SysRecordTime: item.RecordDate,
|
1741
|
|
- DrugId: item.DrugId,
|
1742
|
|
- }
|
1743
|
|
- prescribingNumber := strconv.FormatFloat(math.Abs(item.PrescribingNumber), 'f', 0, 64)
|
1744
|
|
- count, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
1745
|
|
- warehouseOutInfo.Count = count
|
1746
|
|
- stockInInfo, _ := service.FindLastDrugStockInInfoRecord(item.DrugId, adminUserInfo.CurrentOrgId)
|
1747
|
|
- warehouseOutInfo.Price = stockInInfo.Price
|
1748
|
|
- err := service.AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
|
1749
|
|
- if err == nil {
|
1750
|
|
- details := &models.DrugAutomaticReduceDetail{
|
1751
|
|
- WarehouseOutId: warehouseOutInfo.ID,
|
1752
|
|
- WarehouseOutOrderNumber: warehouseOutInfo.WarehouseOutOrderNumber,
|
1753
|
|
- PatientId: item.PatientId,
|
1754
|
|
- Ctime: time.Now().Unix(),
|
1755
|
|
- Mtime: time.Now().Unix(),
|
1756
|
|
- Status: 1,
|
1757
|
|
- RecordTime: item.RecordDate,
|
1758
|
|
- OrgId: adminUserInfo.CurrentOrgId,
|
1759
|
|
- DrugId: item.DrugId,
|
1760
|
|
- Count: count,
|
1761
|
|
- }
|
1762
|
|
- service.AddSigleDrugAutoReduceRecordInfo(details)
|
1763
|
|
- }
|
1764
|
|
- }
|
1765
|
|
- }
|
1766
|
|
- }
|
1767
|
|
-
|
1768
|
|
- }
|
1769
|
|
- }
|
1770
|
|
- }
|
1771
|
|
- }
|
1772
|
|
- } else if err == nil {
|
1773
|
|
- if item.Way == 1 {
|
1774
|
|
- outInfo, err := service.FindDrugStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, item.DrugId, out.ID, out.WarehouseOutOrderNumber)
|
1775
|
|
- if err == gorm.ErrRecordNotFound {
|
1776
|
|
- warehouseOutInfo := &models.DrugWarehouseOutInfo{
|
1777
|
|
- WarehouseOutOrderNumber: out.WarehouseOutOrderNumber,
|
1778
|
|
- WarehouseOutId: out.ID,
|
1779
|
|
- Status: 1,
|
1780
|
|
- Ctime: time.Now().Unix(),
|
1781
|
|
- Remark: "",
|
1782
|
|
- OrgId: adminUserInfo.CurrentOrgId,
|
1783
|
|
- Type: 1,
|
1784
|
|
- Manufacturer: 0,
|
1785
|
|
- Dealer: 0,
|
1786
|
|
- IsSys: 1,
|
1787
|
|
- SysRecordTime: item.RecordDate,
|
1788
|
|
- }
|
1789
|
|
-
|
1790
|
|
- stockInInfo, _ := service.FindLastDrugStockInInfoRecord(item.DrugId, adminUserInfo.CurrentOrgId)
|
1791
|
|
- warehouseOutInfo.Price = stockInInfo.Price
|
1792
|
|
- warehouseOutInfo.DrugId = item.DrugId
|
1793
|
|
- prescribingNumber := strconv.FormatFloat(math.Abs(item.PrescribingNumber), 'f', 0, 64)
|
1794
|
|
- count, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
1795
|
|
- warehouseOutInfo.Count = count
|
1796
|
|
- err := service.AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
|
1797
|
|
- if err == nil {
|
1798
|
|
- details := &models.DrugAutomaticReduceDetail{
|
1799
|
|
- WarehouseOutId: warehouseOutInfo.ID,
|
1800
|
|
- WarehouseOutOrderNumber: warehouseOutInfo.WarehouseOutOrderNumber,
|
1801
|
|
- PatientId: item.PatientId,
|
1802
|
|
- Ctime: time.Now().Unix(),
|
1803
|
|
- Mtime: time.Now().Unix(),
|
1804
|
|
- Status: 1,
|
1805
|
|
- RecordTime: item.RecordDate,
|
1806
|
|
- OrgId: adminUserInfo.CurrentOrgId,
|
1807
|
|
- DrugId: item.DrugId,
|
1808
|
|
- Count: count,
|
1809
|
|
- }
|
1810
|
|
- service.AddSigleDrugAutoReduceRecordInfo(details)
|
1811
|
|
- }
|
1812
|
|
-
|
1813
|
|
- } else if err == nil { //记录存在,则将增加数量
|
1814
|
|
- if outInfo.ID > 0 {
|
1815
|
|
- prescribingNumber := strconv.FormatFloat(math.Abs(item.PrescribingNumber), 'f', 0, 64)
|
1816
|
|
- count, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
1817
|
|
- service.UpdateDrugStockOutInfoCount2(adminUserInfo.CurrentOrgId, outInfo.ID, count)
|
1818
|
|
- }
|
1819
|
|
-
|
1820
|
|
- count, _ := service.FindPatientDrugAutomaticReduceRecord(adminUserInfo.CurrentOrgId, item.RecordDate, item.DrugId, item.PatientId)
|
1821
|
|
- if count == 0 {
|
1822
|
|
- prescribingNumber := strconv.FormatFloat(math.Abs(item.PrescribingNumber), 'f', 0, 64)
|
1823
|
|
- count, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
1824
|
|
- details := &models.DrugAutomaticReduceDetail{
|
1825
|
|
- WarehouseOutId: outInfo.ID,
|
1826
|
|
- WarehouseOutOrderNumber: outInfo.WarehouseOutOrderNumber,
|
1827
|
|
- PatientId: item.PatientId,
|
1828
|
|
- Ctime: time.Now().Unix(),
|
1829
|
|
- Mtime: time.Now().Unix(),
|
1830
|
|
- Status: 1,
|
1831
|
|
- RecordTime: item.RecordDate,
|
1832
|
|
- OrgId: adminUserInfo.CurrentOrgId,
|
1833
|
|
- DrugId: item.DrugId,
|
1834
|
|
- Count: count,
|
1835
|
|
- }
|
1836
|
|
- service.AddSigleDrugAutoReduceRecordInfo(details)
|
1837
|
|
- } else if count == 1 {
|
1838
|
|
- prescribingNumber := strconv.FormatFloat(math.Abs(item.PrescribingNumber), 'f', 0, 64)
|
1839
|
|
- count, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
1840
|
|
- service.UpdateDrugUserInfoDetails(item.DrugId, item.RecordDate, adminUserInfo.CurrentOrgId, item.PatientId, count, &outInfo)
|
1841
|
|
- }
|
1842
|
1656
|
|
1843
|
|
- }
|
1844
|
|
- }
|
1845
|
|
- }
|
1846
|
|
- }
|
|
1657
|
+ //调用药品出库接口
|
|
1658
|
+ service.DrugsDelivery(item.UserOrgId, item)
|
|
1659
|
+
|
|
1660
|
+ //if item.Way == 1 {
|
|
1661
|
+ // out, err := service.FindDrugStockOutByIsSys(adminUserInfo.CurrentOrgId, 1, item.RecordDate)
|
|
1662
|
+ // if err == gorm.ErrRecordNotFound {
|
|
1663
|
+ // //没有记录,则创建出库单
|
|
1664
|
+ // timeStr := time.Now().Format("2006-01-02")
|
|
1665
|
+ // timeArr := strings.Split(timeStr, "-")
|
|
1666
|
+ // total, _ := service.FindAllDrugWarehouseOut(adminUserInfo.CurrentOrgId)
|
|
1667
|
+ // total = total + 1
|
|
1668
|
+ // warehousing_out_order := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + timeArr[0] + timeArr[1] + timeArr[2] + "000"
|
|
1669
|
+ // number, _ := strconv.ParseInt(warehousing_out_order, 10, 64)
|
|
1670
|
+ // number = number + total
|
|
1671
|
+ // warehousing_out_order = "YPCKD" + strconv.FormatInt(number, 10)
|
|
1672
|
+ // creater := adminUserInfo.AdminUser.Id
|
|
1673
|
+ // warehouseOut := models.DrugWarehouseOut{
|
|
1674
|
+ // WarehouseOutOrderNumber: warehousing_out_order,
|
|
1675
|
+ // OperationTime: time.Now().Unix(),
|
|
1676
|
+ // OrgId: adminUserInfo.CurrentOrgId,
|
|
1677
|
+ // Creater: creater,
|
|
1678
|
+ // Ctime: time.Now().Unix(),
|
|
1679
|
+ // Status: 1,
|
|
1680
|
+ // WarehouseOutTime: item.RecordDate,
|
|
1681
|
+ // Dealer: 0,
|
|
1682
|
+ // Manufacturer: 0,
|
|
1683
|
+ // Type: 1,
|
|
1684
|
+ // IsSys: 1,
|
|
1685
|
+ // }
|
|
1686
|
+ //
|
|
1687
|
+ // err := service.AddSigleDrugWarehouseOut(&warehouseOut)
|
|
1688
|
+ // if err != nil {
|
|
1689
|
+ // utils.TraceLog("创建出库单失败 err = %v", err)
|
|
1690
|
+ // } else {
|
|
1691
|
+ // if item.Way == 1 {
|
|
1692
|
+ // if item.PrescribingNumber > 0 {
|
|
1693
|
+ // warehouseOutInfo := &models.DrugWarehouseOutInfo{
|
|
1694
|
+ // WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
|
|
1695
|
+ // WarehouseOutId: warehouseOut.ID,
|
|
1696
|
+ // Status: 1,
|
|
1697
|
+ // Ctime: time.Now().Unix(),
|
|
1698
|
+ // Remark: "",
|
|
1699
|
+ // OrgId: adminUserInfo.CurrentOrgId,
|
|
1700
|
+ // Type: 1,
|
|
1701
|
+ // Manufacturer: 0,
|
|
1702
|
+ // Dealer: 0,
|
|
1703
|
+ // IsSys: 1,
|
|
1704
|
+ // SysRecordTime: item.RecordDate,
|
|
1705
|
+ // DrugId: item.DrugId,
|
|
1706
|
+ // }
|
|
1707
|
+ // prescribingNumber := strconv.FormatFloat(math.Abs(item.PrescribingNumber), 'f', 0, 64)
|
|
1708
|
+ // count, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
|
1709
|
+ // warehouseOutInfo.Count = count
|
|
1710
|
+ // stockInInfo, _ := service.FindLastDrugStockInInfoRecord(item.DrugId, adminUserInfo.CurrentOrgId)
|
|
1711
|
+ // warehouseOutInfo.Price = stockInInfo.Price
|
|
1712
|
+ // err := service.AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
|
|
1713
|
+ // if err == nil {
|
|
1714
|
+ // details := &models.DrugAutomaticReduceDetail{
|
|
1715
|
+ // WarehouseOutId: warehouseOutInfo.ID,
|
|
1716
|
+ // WarehouseOutOrderNumber: warehouseOutInfo.WarehouseOutOrderNumber,
|
|
1717
|
+ // PatientId: item.PatientId,
|
|
1718
|
+ // Ctime: time.Now().Unix(),
|
|
1719
|
+ // Mtime: time.Now().Unix(),
|
|
1720
|
+ // Status: 1,
|
|
1721
|
+ // RecordTime: item.RecordDate,
|
|
1722
|
+ // OrgId: adminUserInfo.CurrentOrgId,
|
|
1723
|
+ // DrugId: item.DrugId,
|
|
1724
|
+ // Count: count,
|
|
1725
|
+ // }
|
|
1726
|
+ // service.AddSigleDrugAutoReduceRecordInfo(details)
|
|
1727
|
+ // if err != nil {
|
|
1728
|
+ // utils.TraceLog("创建出库单失败 err = %v", err)
|
|
1729
|
+ // } else {
|
|
1730
|
+ // if item.Way == 1 {
|
|
1731
|
+ // if item.PrescribingNumber > 0 {
|
|
1732
|
+ // warehouseOutInfo := &models.DrugWarehouseOutInfo{
|
|
1733
|
+ // WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
|
|
1734
|
+ // WarehouseOutId: warehouseOut.ID,
|
|
1735
|
+ // Status: 1,
|
|
1736
|
+ // Ctime: time.Now().Unix(),
|
|
1737
|
+ // Remark: "",
|
|
1738
|
+ // OrgId: adminUserInfo.CurrentOrgId,
|
|
1739
|
+ // Type: 1,
|
|
1740
|
+ // Manufacturer: 0,
|
|
1741
|
+ // Dealer: 0,
|
|
1742
|
+ // IsSys: 1,
|
|
1743
|
+ // SysRecordTime: item.RecordDate,
|
|
1744
|
+ // DrugId: item.DrugId,
|
|
1745
|
+ // }
|
|
1746
|
+ // prescribingNumber := strconv.FormatFloat(math.Abs(item.PrescribingNumber), 'f', 0, 64)
|
|
1747
|
+ // count, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
|
1748
|
+ // warehouseOutInfo.Count = count
|
|
1749
|
+ // stockInInfo, _ := service.FindLastDrugStockInInfoRecord(item.DrugId, adminUserInfo.CurrentOrgId)
|
|
1750
|
+ // warehouseOutInfo.Price = stockInInfo.Price
|
|
1751
|
+ // err := service.AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
|
|
1752
|
+ // if err == nil {
|
|
1753
|
+ // details := &models.DrugAutomaticReduceDetail{
|
|
1754
|
+ // WarehouseOutId: warehouseOutInfo.ID,
|
|
1755
|
+ // WarehouseOutOrderNumber: warehouseOutInfo.WarehouseOutOrderNumber,
|
|
1756
|
+ // PatientId: item.PatientId,
|
|
1757
|
+ // Ctime: time.Now().Unix(),
|
|
1758
|
+ // Mtime: time.Now().Unix(),
|
|
1759
|
+ // Status: 1,
|
|
1760
|
+ // RecordTime: item.RecordDate,
|
|
1761
|
+ // OrgId: adminUserInfo.CurrentOrgId,
|
|
1762
|
+ // DrugId: item.DrugId,
|
|
1763
|
+ // Count: count,
|
|
1764
|
+ // }
|
|
1765
|
+ // service.AddSigleDrugAutoReduceRecordInfo(details)
|
|
1766
|
+ // }
|
|
1767
|
+ // }
|
|
1768
|
+ // }
|
|
1769
|
+ // }
|
|
1770
|
+ //
|
|
1771
|
+ // }
|
|
1772
|
+ // }
|
|
1773
|
+ // }
|
|
1774
|
+ // }
|
|
1775
|
+ // } else if err == nil {
|
|
1776
|
+ // if item.Way == 1 {
|
|
1777
|
+ // outInfo, err := service.FindDrugStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, item.DrugId, out.ID, out.WarehouseOutOrderNumber)
|
|
1778
|
+ // if err == gorm.ErrRecordNotFound {
|
|
1779
|
+ // warehouseOutInfo := &models.DrugWarehouseOutInfo{
|
|
1780
|
+ // WarehouseOutOrderNumber: out.WarehouseOutOrderNumber,
|
|
1781
|
+ // WarehouseOutId: out.ID,
|
|
1782
|
+ // Status: 1,
|
|
1783
|
+ // Ctime: time.Now().Unix(),
|
|
1784
|
+ // Remark: "",
|
|
1785
|
+ // OrgId: adminUserInfo.CurrentOrgId,
|
|
1786
|
+ // Type: 1,
|
|
1787
|
+ // Manufacturer: 0,
|
|
1788
|
+ // Dealer: 0,
|
|
1789
|
+ // IsSys: 1,
|
|
1790
|
+ // SysRecordTime: item.RecordDate,
|
|
1791
|
+ // }
|
|
1792
|
+ //
|
|
1793
|
+ // stockInInfo, _ := service.FindLastDrugStockInInfoRecord(item.DrugId, adminUserInfo.CurrentOrgId)
|
|
1794
|
+ // warehouseOutInfo.Price = stockInInfo.Price
|
|
1795
|
+ // warehouseOutInfo.DrugId = item.DrugId
|
|
1796
|
+ // prescribingNumber := strconv.FormatFloat(math.Abs(item.PrescribingNumber), 'f', 0, 64)
|
|
1797
|
+ // count, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
|
1798
|
+ // warehouseOutInfo.Count = count
|
|
1799
|
+ // err := service.AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
|
|
1800
|
+ // if err == nil {
|
|
1801
|
+ // details := &models.DrugAutomaticReduceDetail{
|
|
1802
|
+ // WarehouseOutId: warehouseOutInfo.ID,
|
|
1803
|
+ // WarehouseOutOrderNumber: warehouseOutInfo.WarehouseOutOrderNumber,
|
|
1804
|
+ // PatientId: item.PatientId,
|
|
1805
|
+ // Ctime: time.Now().Unix(),
|
|
1806
|
+ // Mtime: time.Now().Unix(),
|
|
1807
|
+ // Status: 1,
|
|
1808
|
+ // RecordTime: item.RecordDate,
|
|
1809
|
+ // OrgId: adminUserInfo.CurrentOrgId,
|
|
1810
|
+ // DrugId: item.DrugId,
|
|
1811
|
+ // Count: count,
|
|
1812
|
+ // }
|
|
1813
|
+ // service.AddSigleDrugAutoReduceRecordInfo(details)
|
|
1814
|
+ // }
|
|
1815
|
+ //
|
|
1816
|
+ // } else if err == nil { //记录存在,则将增加数量
|
|
1817
|
+ // if outInfo.ID > 0 {
|
|
1818
|
+ // prescribingNumber := strconv.FormatFloat(math.Abs(item.PrescribingNumber), 'f', 0, 64)
|
|
1819
|
+ // count, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
|
1820
|
+ // service.UpdateDrugStockOutInfoCount2(adminUserInfo.CurrentOrgId, outInfo.ID, count)
|
|
1821
|
+ // }
|
|
1822
|
+ //
|
|
1823
|
+ // count, _ := service.FindPatientDrugAutomaticReduceRecord(adminUserInfo.CurrentOrgId, item.RecordDate, item.DrugId, item.PatientId)
|
|
1824
|
+ // if count == 0 {
|
|
1825
|
+ // prescribingNumber := strconv.FormatFloat(math.Abs(item.PrescribingNumber), 'f', 0, 64)
|
|
1826
|
+ // count, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
|
1827
|
+ // details := &models.DrugAutomaticReduceDetail{
|
|
1828
|
+ // WarehouseOutId: outInfo.ID,
|
|
1829
|
+ // WarehouseOutOrderNumber: outInfo.WarehouseOutOrderNumber,
|
|
1830
|
+ // PatientId: item.PatientId,
|
|
1831
|
+ // Ctime: time.Now().Unix(),
|
|
1832
|
+ // Mtime: time.Now().Unix(),
|
|
1833
|
+ // Status: 1,
|
|
1834
|
+ // RecordTime: item.RecordDate,
|
|
1835
|
+ // OrgId: adminUserInfo.CurrentOrgId,
|
|
1836
|
+ // DrugId: item.DrugId,
|
|
1837
|
+ // Count: count,
|
|
1838
|
+ // }
|
|
1839
|
+ // service.AddSigleDrugAutoReduceRecordInfo(details)
|
|
1840
|
+ // } else if count == 1 {
|
|
1841
|
+ // prescribingNumber := strconv.FormatFloat(math.Abs(item.PrescribingNumber), 'f', 0, 64)
|
|
1842
|
+ // count, _ := strconv.ParseInt(prescribingNumber, 10, 64)
|
|
1843
|
+ // service.UpdateDrugUserInfoDetails(item.DrugId, item.RecordDate, adminUserInfo.CurrentOrgId, item.PatientId, count, &outInfo)
|
|
1844
|
+ // }
|
|
1845
|
+ //
|
|
1846
|
+ // }
|
|
1847
|
+ // }
|
|
1848
|
+ // }
|
|
1849
|
+ //}
|
1847
|
1850
|
}
|
1848
|
1851
|
}
|
1849
|
1852
|
|
1850
|
1853
|
advices, _ := service.GetExecutionDoctors(adminUserInfo.CurrentOrgId, patient, id)
|
1851
|
1854
|
for _, item := range advices {
|
1852
|
|
- fmt.Println("33333", item.ExecutionState)
|
1853
|
|
- fmt.Println("医嘱名称", item.AdviceName)
|
1854
|
|
- fmt.Println("item", item.Way)
|
|
1855
|
+
|
1855
|
1856
|
if item.Way == 2 {
|
1856
|
1857
|
if privateDrugConfig != nil && privateDrugConfig.DrugStart == 1 {
|
1857
|
1858
|
|