|
@@ -1889,9 +1889,24 @@ func (c *HisApiController) GetRegisterInfo() {
|
1889
|
1889
|
his.Mtime = time.Now().Unix()
|
1890
|
1890
|
his.Status = 1
|
1891
|
1891
|
service.UpdateHisPatientStatus(&his)
|
1892
|
|
- lists, _ := service.GetHisPatientInfoList(adminInfo.CurrentOrgId, patient.ID, recordDateTime)
|
1893
|
|
- if len(lists) == 1 {
|
1894
|
|
- service.UpdateHisPrescriptionHisID(his.ID, patient.ID, recordDateTime, adminInfo.CurrentOrgId)
|
|
1892
|
+
|
|
1893
|
+ getYear := time.Now().Format("2006") //获取年
|
|
1894
|
+ getMonth := time.Now().Format("01") //获取月
|
|
1895
|
+ getDay := time.Now().Format("02")
|
|
1896
|
+
|
|
1897
|
+ new_time := getYear + "-" + getMonth + "-" + getDay
|
|
1898
|
+
|
|
1899
|
+ new_timestamp, _ := time.ParseInLocation(timeLayout+" 15:04:05", new_time+" 00:00:00", loc)
|
|
1900
|
+
|
|
1901
|
+ if recordDateTime < new_timestamp.Unix() {
|
|
1902
|
+ thisTime := time.Now()
|
|
1903
|
+ thisTime = thisTime.AddDate(0, 0, -7)
|
|
1904
|
+ service.UpdateHisPrescriptionHisIDTwo(his.ID, patient.ID, recordDateTime, adminInfo.CurrentOrgId, thisTime.Unix())
|
|
1905
|
+ } else if recordDateTime == new_timestamp.Unix() {
|
|
1906
|
+ lists, _ := service.GetHisPatientInfoList(adminInfo.CurrentOrgId, patient.ID, recordDateTime)
|
|
1907
|
+ if len(lists) == 1 {
|
|
1908
|
+ service.UpdateHisPrescriptionHisID(his.ID, patient.ID, recordDateTime, adminInfo.CurrentOrgId)
|
|
1909
|
+ }
|
1895
|
1910
|
}
|
1896
|
1911
|
c.ServeSuccessJSON(map[string]interface{}{
|
1897
|
1912
|
"his_info": his,
|
|
@@ -1949,6 +1964,9 @@ func (c *HisApiController) GetUploadInfo() {
|
1949
|
1964
|
sick_type, _ := c.GetInt64("sick_type")
|
1950
|
1965
|
reg_type, _ := c.GetInt64("p_type")
|
1951
|
1966
|
|
|
1967
|
+ id_str := c.GetString("ids")
|
|
1968
|
+ ids_arr := strings.Split(id_str, ",")
|
|
1969
|
+
|
1952
|
1970
|
timeLayout := "2006-01-02"
|
1953
|
1971
|
loc, _ := time.LoadLocation("Local")
|
1954
|
1972
|
theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
|
|
@@ -2071,7 +2089,13 @@ func (c *HisApiController) GetUploadInfo() {
|
2071
|
2089
|
|
2072
|
2090
|
data := make(map[string]interface{})
|
2073
|
2091
|
if settle_accounts_type == 1 { //日结
|
2074
|
|
- prescriptions, _ = service.GetNewHisPrescriptionTwo(adminUser.CurrentOrgId, his_patient_id, recordDateTime, reg_type)
|
|
2092
|
+
|
|
2093
|
+ if reg_type == 11 {
|
|
2094
|
+ prescriptions, _ = service.GetPrescriptionByIds(ids_arr, adminUser.CurrentOrgId)
|
|
2095
|
+ } else {
|
|
2096
|
+ prescriptions, _ = service.GetNewHisPrescription(adminUser.CurrentOrgId, his_patient_id, recordDateTime, strconv.Itoa(int(reg_type)))
|
|
2097
|
+ }
|
|
2098
|
+ //prescriptions, _ = service.GetNewHisPrescriptionTwo(adminUser.CurrentOrgId, his_patient_id, recordDateTime, reg_type)
|
2075
|
2099
|
data["pre"] = prescriptions
|
2076
|
2100
|
|
2077
|
2101
|
} else { //月结
|
|
@@ -2098,6 +2122,10 @@ func (c *HisApiController) GetUploadInfo() {
|
2098
|
2122
|
|
2099
|
2123
|
}
|
2100
|
2124
|
|
|
2125
|
+ if reg_type == 1111 || reg_type == 1112 {
|
|
2126
|
+ reg_type = 11
|
|
2127
|
+ }
|
|
2128
|
+
|
2101
|
2129
|
timestamp := time.Now().Unix()
|
2102
|
2130
|
tempTime := time.Unix(timestamp, 0)
|
2103
|
2131
|
timeFormat := tempTime.Format("20060102150405")
|
|
@@ -3163,6 +3191,9 @@ func (c *HisApiController) GetPreUploadInfo() {
|
3163
|
3191
|
sick_type, _ := c.GetInt64("sick_type")
|
3164
|
3192
|
reg_type, _ := c.GetInt64("p_type")
|
3165
|
3193
|
|
|
3194
|
+ id_str := c.GetString("ids")
|
|
3195
|
+ ids_arr := strings.Split(id_str, ",")
|
|
3196
|
+
|
3166
|
3197
|
timeLayout := "2006-01-02"
|
3167
|
3198
|
loc, _ := time.LoadLocation("Local")
|
3168
|
3199
|
theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
|
|
@@ -3260,9 +3291,12 @@ func (c *HisApiController) GetPreUploadInfo() {
|
3260
|
3291
|
|
3261
|
3292
|
data := make(map[string]interface{})
|
3262
|
3293
|
if settle_accounts_type == 1 { //日结
|
3263
|
|
- prescriptions, _ = service.GetNewHisPrescriptionTwo(adminUser.CurrentOrgId, his_patient_id, recordDateTime, reg_type)
|
|
3294
|
+ if reg_type == 11 {
|
|
3295
|
+ prescriptions, _ = service.GetPrescriptionByIds(ids_arr, adminUser.CurrentOrgId)
|
|
3296
|
+ } else {
|
|
3297
|
+ prescriptions, _ = service.GetNewHisPrescription(adminUser.CurrentOrgId, his_patient_id, recordDateTime, strconv.Itoa(int(reg_type)))
|
|
3298
|
+ }
|
3264
|
3299
|
data["pre"] = prescriptions
|
3265
|
|
-
|
3266
|
3300
|
} else { //月结
|
3267
|
3301
|
start_time_str := c.GetString("start_time")
|
3268
|
3302
|
end_time_str := c.GetString("end_time")
|
|
@@ -3286,6 +3320,10 @@ func (c *HisApiController) GetPreUploadInfo() {
|
3286
|
3320
|
data["pre"] = prescriptions
|
3287
|
3321
|
}
|
3288
|
3322
|
|
|
3323
|
+ if reg_type == 1111 || reg_type == 1112 {
|
|
3324
|
+ reg_type = 11
|
|
3325
|
+ }
|
|
3326
|
+
|
3289
|
3327
|
client := &http.Client{}
|
3290
|
3328
|
data["psn_no"] = his.PsnNo
|
3291
|
3329
|
data["mdtrt_id"] = his.Number
|