Browse Source

提交代码

陈少旭 1 week ago
parent
commit
dc6ce1f388
1 changed files with 19 additions and 1 deletions
  1. 19 1
      controllers/his_api_controller.go

+ 19 - 1
controllers/his_api_controller.go View File

@@ -11306,6 +11306,23 @@ func (this *HisApiController) GetLastOrNextHisPrescription() {
11306 11306
 	}
11307 11307
 }
11308 11308
 
11309
+func RemoveRepeatedPurviewElementByHP(arr []service.VMOtherHisPrescriptionInfo) (newArr []service.VMOtherHisPrescriptionInfo) {
11310
+	newArr = make([]service.VMOtherHisPrescriptionInfo, 0)
11311
+	for i := 0; i < len(arr); i++ {
11312
+		repeat := false
11313
+		for j := i + 1; j < len(arr); j++ {
11314
+			if arr[i].PatientId == arr[j].PatientId && arr[i].RecordDate == arr[j].RecordDate {
11315
+				repeat = true
11316
+				break
11317
+			}
11318
+		}
11319
+		if !repeat {
11320
+			newArr = append(newArr, arr[i])
11321
+		}
11322
+	}
11323
+	return
11324
+}
11325
+
11309 11326
 func (this *HisApiController) GetCallHisPrescription() {
11310 11327
 	patient_id, _ := this.GetInt64("patient_id", 0)
11311 11328
 	timeLayout := "2006-01-02"
@@ -11317,8 +11334,9 @@ func (this *HisApiController) GetCallHisPrescription() {
11317 11334
 
11318 11335
 	endtime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
11319 11336
 	adminUserInfo := this.GetAdminUserInfo()
11320
-	prescriptions, err := service.GetCallHisPrescriptions(startime.Unix(), endtime.Unix(), adminUserInfo.CurrentOrgId, patient_id, p_type)
11337
+	new_prescriptions, err := service.GetCallHisPrescriptions(startime.Unix(), endtime.Unix(), adminUserInfo.CurrentOrgId, patient_id, p_type)
11321 11338
 
11339
+	prescriptions := RemoveRepeatedPurviewElementByHP(new_prescriptions)
11322 11340
 	//if
11323 11341
 	//storeConfig, _ := service.GetAllStoreHouseConfig(adminUserInfo.CurrentOrgId)
11324 11342
 	//