|
@@ -14,6 +14,7 @@ import (
|
14
|
14
|
"XT_New/models"
|
15
|
15
|
"XT_New/service"
|
16
|
16
|
"XT_New/utils"
|
|
17
|
+ "github.com/astaxie/beego/config"
|
17
|
18
|
"github.com/jinzhu/gorm"
|
18
|
19
|
"github.com/mozillazg/go-pinyin"
|
19
|
20
|
|
|
@@ -8661,34 +8662,82 @@ func (this *PatientApiController) GetAutoPatientContent() {
|
8661
|
8662
|
|
8662
|
8663
|
lastBefor, _ := service.GetPatientLastBefor(patient_id, startTime, endTime, orgId)
|
8663
|
8664
|
|
8664
|
|
- this.ServeSuccessJSON(map[string]interface{}{
|
8665
|
|
- "prescription": prescription,
|
8666
|
|
- "berfor": berfor,
|
8667
|
|
- "monitorList": monitorList,
|
8668
|
|
- "dryweightList": dryweightList,
|
8669
|
|
- "inpectionList": inpectionList,
|
8670
|
|
- "dialysisOrder": dialysisOrder,
|
8671
|
|
- "patient": patient,
|
8672
|
|
- "longAdvice": longAdvice,
|
8673
|
|
- "groupPrescriptionList": groupPrescriptionList,
|
8674
|
|
- "after": after,
|
8675
|
|
- "max_blood_flow_volume": monitor.BloodFlowVolume,
|
8676
|
|
- "max_befor_systolic_blood_pressure": maxBeforSystolicBloodPressure.SystolicBloodPressure,
|
8677
|
|
- "min_befor_systolic_blood_pressure": minBeforSystolicBloodPressure.SystolicBloodPressure,
|
8678
|
|
- "max_befor_diastolic_blood_pressure": maxBeforDiastolicBloodPressure.DiastolicBloodPressure,
|
8679
|
|
- "min_befor_diastolic_blood_pressure": minBeforDiastolicBloodPressure.DiastolicBloodPressure,
|
8680
|
|
- "max_after_systolic_blood_pressure": maxAfterSystolicBloodPressure.SystolicBloodPressure,
|
8681
|
|
- "min_after_systolic_blood_pressure": minAfterSystolicBloodPressure.SystolicBloodPressure,
|
8682
|
|
- "max_after_diastolic_blood_pressure": maxAfterDiastolicBloodPressure.DiastolicBloodPressure,
|
8683
|
|
- "min_after_diastolic_blood_pressure": minAfterDiastolicBloodPressure.DiastolicBloodPressure,
|
8684
|
|
- "max_monitor_systolic_blood_pressure": maxMonitorSystolicBloodPressure.SystolicBloodPressure,
|
8685
|
|
- "min_monitor_systolic_blood_pressure": minMonitorSystolicBloodPressure.SystolicBloodPressure,
|
8686
|
|
- "max_monitor_diastolic_blood_pressure": maxMonitorDiastolicBloodPressure.DiastolicBloodPressure,
|
8687
|
|
- "min_monitor_diastolic_blood_pressure": minMonitorDiastolicBloodPressure.DiastolicBloodPressure,
|
8688
|
|
- "lastDryWeight": lastDryWeight,
|
8689
|
|
- "patientVascularAccess": patientVascularAccess,
|
8690
|
|
- "lastBefor": lastBefor,
|
8691
|
|
- })
|
|
8665
|
+ _, configs := service.FindXTHisRecordByOrgId(orgId)
|
|
8666
|
+
|
|
8667
|
+ //血透
|
|
8668
|
+ if configs.IsOpen != 1 {
|
|
8669
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8670
|
+ "prescription": prescription,
|
|
8671
|
+ "berfor": berfor,
|
|
8672
|
+ "monitorList": monitorList,
|
|
8673
|
+ "dryweightList": dryweightList,
|
|
8674
|
+ "inpectionList": inpectionList,
|
|
8675
|
+ "dialysisOrder": dialysisOrder,
|
|
8676
|
+ "patient": patient,
|
|
8677
|
+ "longAdvice": longAdvice,
|
|
8678
|
+ "groupPrescriptionList": groupPrescriptionList,
|
|
8679
|
+ "after": after,
|
|
8680
|
+ "max_blood_flow_volume": monitor.BloodFlowVolume,
|
|
8681
|
+ "max_befor_systolic_blood_pressure": maxBeforSystolicBloodPressure.SystolicBloodPressure,
|
|
8682
|
+ "min_befor_systolic_blood_pressure": minBeforSystolicBloodPressure.SystolicBloodPressure,
|
|
8683
|
+ "max_befor_diastolic_blood_pressure": maxBeforDiastolicBloodPressure.DiastolicBloodPressure,
|
|
8684
|
+ "min_befor_diastolic_blood_pressure": minBeforDiastolicBloodPressure.DiastolicBloodPressure,
|
|
8685
|
+ "max_after_systolic_blood_pressure": maxAfterSystolicBloodPressure.SystolicBloodPressure,
|
|
8686
|
+ "min_after_systolic_blood_pressure": minAfterSystolicBloodPressure.SystolicBloodPressure,
|
|
8687
|
+ "max_after_diastolic_blood_pressure": maxAfterDiastolicBloodPressure.DiastolicBloodPressure,
|
|
8688
|
+ "min_after_diastolic_blood_pressure": minAfterDiastolicBloodPressure.DiastolicBloodPressure,
|
|
8689
|
+ "max_monitor_systolic_blood_pressure": maxMonitorSystolicBloodPressure.SystolicBloodPressure,
|
|
8690
|
+ "min_monitor_systolic_blood_pressure": minMonitorSystolicBloodPressure.SystolicBloodPressure,
|
|
8691
|
+ "max_monitor_diastolic_blood_pressure": maxMonitorDiastolicBloodPressure.DiastolicBloodPressure,
|
|
8692
|
+ "min_monitor_diastolic_blood_pressure": minMonitorDiastolicBloodPressure.DiastolicBloodPressure,
|
|
8693
|
+ "lastDryWeight": lastDryWeight,
|
|
8694
|
+ "patientVascularAccess": patientVascularAccess,
|
|
8695
|
+ "lastBefor": lastBefor,
|
|
8696
|
+ })
|
|
8697
|
+ }
|
|
8698
|
+
|
|
8699
|
+ //his
|
|
8700
|
+ if configs.IsOpen == 1 {
|
|
8701
|
+
|
|
8702
|
+ hisadvice, _ := service.GetHisPrecriptionadviceList(orgId, patient_id, startTime, endTime)
|
|
8703
|
+ if len(hisadvice) > 0 {
|
|
8704
|
+ if len(hisadvice) > 0 {
|
|
8705
|
+ for _, item := range hisadvice {
|
|
8706
|
+ baseDrug, _ := service.GetBasedrugByIdOne(item.DrugId, orgId)
|
|
8707
|
+ item.StartTime = item.CreatedTime
|
|
8708
|
+ item.AdviceDesc = baseDrug.Dose + baseDrug.DoseUnit + "*" + config.ToString(baseDrug.MinNumber) + baseDrug.MinUnit + "/" + baseDrug.MaxUnit
|
|
8709
|
+ }
|
|
8710
|
+ }
|
|
8711
|
+ }
|
|
8712
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8713
|
+ "prescription": prescription,
|
|
8714
|
+ "berfor": berfor,
|
|
8715
|
+ "monitorList": monitorList,
|
|
8716
|
+ "dryweightList": dryweightList,
|
|
8717
|
+ "inpectionList": inpectionList,
|
|
8718
|
+ "dialysisOrder": dialysisOrder,
|
|
8719
|
+ "patient": patient,
|
|
8720
|
+ "longAdvice": hisadvice,
|
|
8721
|
+ "groupPrescriptionList": groupPrescriptionList,
|
|
8722
|
+ "after": after,
|
|
8723
|
+ "max_blood_flow_volume": monitor.BloodFlowVolume,
|
|
8724
|
+ "max_befor_systolic_blood_pressure": maxBeforSystolicBloodPressure.SystolicBloodPressure,
|
|
8725
|
+ "min_befor_systolic_blood_pressure": minBeforSystolicBloodPressure.SystolicBloodPressure,
|
|
8726
|
+ "max_befor_diastolic_blood_pressure": maxBeforDiastolicBloodPressure.DiastolicBloodPressure,
|
|
8727
|
+ "min_befor_diastolic_blood_pressure": minBeforDiastolicBloodPressure.DiastolicBloodPressure,
|
|
8728
|
+ "max_after_systolic_blood_pressure": maxAfterSystolicBloodPressure.SystolicBloodPressure,
|
|
8729
|
+ "min_after_systolic_blood_pressure": minAfterSystolicBloodPressure.SystolicBloodPressure,
|
|
8730
|
+ "max_after_diastolic_blood_pressure": maxAfterDiastolicBloodPressure.DiastolicBloodPressure,
|
|
8731
|
+ "min_after_diastolic_blood_pressure": minAfterDiastolicBloodPressure.DiastolicBloodPressure,
|
|
8732
|
+ "max_monitor_systolic_blood_pressure": maxMonitorSystolicBloodPressure.SystolicBloodPressure,
|
|
8733
|
+ "min_monitor_systolic_blood_pressure": minMonitorSystolicBloodPressure.SystolicBloodPressure,
|
|
8734
|
+ "max_monitor_diastolic_blood_pressure": maxMonitorDiastolicBloodPressure.DiastolicBloodPressure,
|
|
8735
|
+ "min_monitor_diastolic_blood_pressure": minMonitorDiastolicBloodPressure.DiastolicBloodPressure,
|
|
8736
|
+ "lastDryWeight": lastDryWeight,
|
|
8737
|
+ "patientVascularAccess": patientVascularAccess,
|
|
8738
|
+ "lastBefor": lastBefor,
|
|
8739
|
+ })
|
|
8740
|
+ }
|
8692
|
8741
|
|
8693
|
8742
|
}
|
8694
|
8743
|
|
|
@@ -8888,11 +8937,50 @@ func (this *PatientApiController) GetPatientAdviceList() {
|
8888
|
8937
|
endTime = theTime.Unix()
|
8889
|
8938
|
}
|
8890
|
8939
|
|
8891
|
|
- advicelist, _ := service.GetPatientAdviceList(patient_id, orgId, startTime, endTime, advice_type)
|
|
8940
|
+ _, configs := service.FindXTHisRecordByOrgId(orgId)
|
|
8941
|
+
|
|
8942
|
+ if configs.IsOpen == 1 {
|
|
8943
|
+
|
|
8944
|
+ if advice_type == 1 {
|
|
8945
|
+ hisLongadvicelist, _ := service.GetHisPrecriptionadviceList(orgId, patient_id, startTime, endTime)
|
|
8946
|
+ if len(hisLongadvicelist) > 0 {
|
|
8947
|
+ for _, item := range hisLongadvicelist {
|
|
8948
|
+ item.StartTime = item.CreatedTime
|
|
8949
|
+ baseDrug, _ := service.GetBasedrugByIdOne(item.DrugId, orgId)
|
|
8950
|
+ item.AdviceDesc = baseDrug.Dose + baseDrug.DoseUnit + "*" + config.ToString(baseDrug.MinNumber) + baseDrug.MinUnit + "/" + baseDrug.MaxUnit
|
|
8951
|
+ }
|
|
8952
|
+ }
|
|
8953
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8954
|
+ "advicelist": hisLongadvicelist,
|
|
8955
|
+ })
|
|
8956
|
+ return
|
|
8957
|
+ } else {
|
|
8958
|
+ fmt.Println("hhhhhh")
|
|
8959
|
+ advicelist, _ := service.GetHisadviceList(orgId, patient_id, startTime, endTime)
|
|
8960
|
+ if len(advicelist) > 0 {
|
|
8961
|
+ for _, item := range advicelist {
|
|
8962
|
+ item.StartTime = item.CreatedTime
|
|
8963
|
+ baseDrug, _ := service.GetBasedrugByIdOne(item.DrugId, orgId)
|
|
8964
|
+ item.AdviceDesc = baseDrug.Dose + baseDrug.DoseUnit + "*" + config.ToString(baseDrug.MinNumber) + baseDrug.MinUnit + "/" + baseDrug.MaxUnit
|
|
8965
|
+ }
|
|
8966
|
+ }
|
|
8967
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8968
|
+ "advicelist": advicelist,
|
|
8969
|
+ })
|
|
8970
|
+ return
|
|
8971
|
+ }
|
|
8972
|
+
|
|
8973
|
+ }
|
|
8974
|
+
|
|
8975
|
+ if configs.IsOpen != 1 {
|
|
8976
|
+ advicelist, _ := service.GetPatientAdviceList(patient_id, orgId, startTime, endTime, advice_type)
|
|
8977
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
8978
|
+ "advicelist": advicelist,
|
|
8979
|
+ })
|
|
8980
|
+ return
|
|
8981
|
+ }
|
|
8982
|
+ return
|
8892
|
8983
|
|
8893
|
|
- this.ServeSuccessJSON(map[string]interface{}{
|
8894
|
|
- "advicelist": advicelist,
|
8895
|
|
- })
|
8896
|
8984
|
}
|
8897
|
8985
|
|
8898
|
8986
|
func (this *PatientApiController) GetPatientInspectionList() {
|