|
@@ -749,19 +749,19 @@ func (this *HisProjectApiController) SaveHisPatient() {
|
749
|
749
|
IsNeedCostOfProduction: cost_checked,
|
750
|
750
|
TreatmentCost: medicalExpense_float,
|
751
|
751
|
MedicalInsuranceNumber: medicalinsurancecard,
|
752
|
|
- Name: name,
|
753
|
|
- RegisterType: register,
|
754
|
|
- RegisterCost: registrationfees_float,
|
755
|
|
- BalanceAccountsType: settlementValue,
|
756
|
|
- Gender: sex,
|
757
|
|
- Total: totals_float,
|
758
|
|
- UserOrgId: orgId,
|
759
|
|
- Status: 1,
|
760
|
|
- RecordDate: nowtime,
|
761
|
|
- IsReturn: 1,
|
762
|
|
- Ctime: time.Now().Unix(),
|
763
|
|
- Phone: phone,
|
764
|
|
- SocialType: social_type,
|
|
752
|
+ Name: name,
|
|
753
|
+ RegisterType: register,
|
|
754
|
+ RegisterCost: registrationfees_float,
|
|
755
|
+ BalanceAccountsType: settlementValue,
|
|
756
|
+ Gender: sex,
|
|
757
|
+ Total: totals_float,
|
|
758
|
+ UserOrgId: orgId,
|
|
759
|
+ Status: 1,
|
|
760
|
+ RecordDate: nowtime,
|
|
761
|
+ IsReturn: 1,
|
|
762
|
+ Ctime: time.Now().Unix(),
|
|
763
|
+ Phone: phone,
|
|
764
|
+ SocialType: social_type,
|
765
|
765
|
}
|
766
|
766
|
err := service.CreateHisPatient(&patient)
|
767
|
767
|
lastPatient, err := service.GetLastPatient(orgId)
|
|
@@ -794,17 +794,17 @@ func (this *HisProjectApiController) SaveHisPatient() {
|
794
|
794
|
IsNeedCostOfProduction: cost_checked,
|
795
|
795
|
TreatmentCost: medicalExpense_float,
|
796
|
796
|
MedicalInsuranceNumber: medicalinsurancecard,
|
797
|
|
- Name: name,
|
798
|
|
- RegisterType: register,
|
799
|
|
- RegisterCost: registrationfees_float,
|
800
|
|
- BalanceAccountsType: settlementValue,
|
801
|
|
- Gender: sex,
|
802
|
|
- Total: totals_float,
|
803
|
|
- UserOrgId: orgId,
|
804
|
|
- PatientId: bloodPatient.ID,
|
805
|
|
- Ctime: time.Now().Unix(),
|
806
|
|
- Phone: phone,
|
807
|
|
- SocialType: social_type,
|
|
797
|
+ Name: name,
|
|
798
|
+ RegisterType: register,
|
|
799
|
+ RegisterCost: registrationfees_float,
|
|
800
|
+ BalanceAccountsType: settlementValue,
|
|
801
|
+ Gender: sex,
|
|
802
|
+ Total: totals_float,
|
|
803
|
+ UserOrgId: orgId,
|
|
804
|
+ PatientId: bloodPatient.ID,
|
|
805
|
+ Ctime: time.Now().Unix(),
|
|
806
|
+ Phone: phone,
|
|
807
|
+ SocialType: social_type,
|
808
|
808
|
}
|
809
|
809
|
err := service.CreateHisPatient(&patient)
|
810
|
810
|
if err != nil {
|
|
@@ -993,25 +993,34 @@ func (this *HisProjectApiController) GetDoctorAdvicePrint() {
|
993
|
993
|
|
994
|
994
|
patient_id, _ := this.GetInt64("patient_id")
|
995
|
995
|
record_date := this.GetString("record_date")
|
|
996
|
+ schIDStr := this.GetString("ids")
|
|
997
|
+ if len(schIDStr) == 0 {
|
|
998
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
999
|
+ return
|
|
1000
|
+ }
|
|
1001
|
+ idStrs := strings.Split(schIDStr, ",")
|
|
1002
|
+
|
996
|
1003
|
timeLayout := "2006-01-02"
|
997
|
1004
|
loc, _ := time.LoadLocation("Local")
|
998
|
1005
|
theTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
|
999
|
1006
|
recordDateTime := theTime.Unix()
|
1000
|
|
- prescription_id, _ := this.GetInt64("prescription_id")
|
1001
|
|
- advicePrint, err := service.GetDoctorAdvicePrint(patient_id, recordDateTime, prescription_id)
|
1002
|
|
-
|
1003
|
|
- doctorPorject, err := service.GetDoctorProjectItem(patient_id, recordDateTime)
|
1004
|
|
- patient, err := service.GetBloodPatientByPatient(patient_id)
|
1005
|
|
- prescriptionInfo, err := service.GetPrscriptionInfo(patient_id, recordDateTime)
|
|
1007
|
+ //prescription_id, _ := this.GetInt64("prescription_id")
|
|
1008
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
1009
|
+ advicePrint, err := service.GetDoctorAdvicePrint(patient_id, recordDateTime, idStrs)
|
|
1010
|
+ projectlist, err := service.GetAllProjectList(adminUserInfo.CurrentOrgId)
|
|
1011
|
+ //doctorPorject, err := service.GetDoctorProjectItem(patient_id, recordDateTime)
|
|
1012
|
+ //patient, err := service.GetBloodPatientByPatient(patient_id)
|
|
1013
|
+ //prescriptionInfo, err := service.GetPrscriptionInfo(patient_id, recordDateTime)
|
1006
|
1014
|
if err != nil {
|
1007
|
1015
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
1008
|
1016
|
return
|
1009
|
1017
|
}
|
1010
|
1018
|
this.ServeSuccessJSON(map[string]interface{}{
|
1011
|
|
- "advicePrint": advicePrint,
|
1012
|
|
- "patient": patient,
|
1013
|
|
- "doctorPorject": doctorPorject,
|
1014
|
|
- "prescriptionInfo": prescriptionInfo,
|
|
1019
|
+ "advicePrint": advicePrint,
|
|
1020
|
+ "projectlist": projectlist,
|
|
1021
|
+ //"patient": patient,
|
|
1022
|
+ //"doctorPorject": doctorPorject,
|
|
1023
|
+ //"prescriptionInfo": prescriptionInfo,
|
1015
|
1024
|
})
|
1016
|
1025
|
}
|
1017
|
1026
|
|
|
@@ -1036,7 +1045,7 @@ func (this *HisProjectApiController) PostPrintHisTemplate() {
|
1036
|
1045
|
adminUserInfo := this.GetAdminUserInfo()
|
1037
|
1046
|
orgId := adminUserInfo.CurrentOrgId
|
1038
|
1047
|
_, errcode := service.GetHisTemplateId(template_id, orgId)
|
1039
|
|
- fmt.Println("errcode0-------", errcode)
|
|
1048
|
+ fmt.Println("errcode", errcode)
|
1040
|
1049
|
if errcode == gorm.ErrRecordNotFound {
|
1041
|
1050
|
template := models.XtHisTemplate{
|
1042
|
1051
|
TemplateId: template_id,
|