|
@@ -2806,7 +2806,8 @@ func (c *HisApiController) GetPutOnRecordList() {
|
2806
|
2806
|
|
2807
|
2807
|
|
2808
|
2808
|
func (c *HisApiController) PostProjectInformation() {
|
2809
|
|
-
|
|
2809
|
+ adminUser := c.GetAdminUserInfo()
|
|
2810
|
+ orgId := adminUser.CurrentOrgId
|
2810
|
2811
|
dataBody := make(map[string]interface{}, 0)
|
2811
|
2812
|
err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
|
2812
|
2813
|
if err != nil {
|
|
@@ -2817,7 +2818,7 @@ func (c *HisApiController) PostProjectInformation() {
|
2817
|
2818
|
var projectList []*models.HisProject
|
2818
|
2819
|
var total_goods []interface{}
|
2819
|
2820
|
tempProjects := dataBody["projects"].([]interface{})
|
2820
|
|
-
|
|
2821
|
+ fmt.Println("666666666666", tempProjects)
|
2821
|
2822
|
total_goods = tempProjects
|
2822
|
2823
|
for index, projectMap := range tempProjects {
|
2823
|
2824
|
|
|
@@ -2846,8 +2847,9 @@ func (c *HisApiController) PostProjectInformation() {
|
2846
|
2847
|
|
2847
|
2848
|
project.ProjectName = project_name
|
2848
|
2849
|
|
2849
|
|
- price := projectM["price"].(float64)
|
|
2850
|
+ prices := projectM["price"].(string)
|
2850
|
2851
|
|
|
2852
|
+ price, _ := strconv.ParseFloat(prices, 64)
|
2851
|
2853
|
if price <= 0 {
|
2852
|
2854
|
err_log := models.ExportErrLog{
|
2853
|
2855
|
LogType: 6,
|
|
@@ -2874,7 +2876,7 @@ func (c *HisApiController) PostProjectInformation() {
|
2874
|
2876
|
err_log := models.ExportErrLog{
|
2875
|
2877
|
LogType: 6,
|
2876
|
2878
|
UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
2877
|
|
- ErrMsg: "第" + strconv.Itoa(index+3) + "行" + "的单位不能为空",
|
|
2879
|
+ ErrMsg: "第" + strconv.Itoa(index+3) + "行" + "的单位不能为空或内容与系统不匹配",
|
2878
|
2880
|
Status: 1,
|
2879
|
2881
|
CreateTime: time.Now().Unix(),
|
2880
|
2882
|
UpdateTime: time.Now().Unix(),
|
|
@@ -2885,17 +2887,12 @@ func (c *HisApiController) PostProjectInformation() {
|
2885
|
2887
|
}
|
2886
|
2888
|
project.Unit = unit
|
2887
|
2889
|
|
2888
|
|
- if projectM["cost_classify_id"] == nil || reflect.TypeOf(projectM["cost_classify_id"]).String() != "float64" {
|
2889
|
|
- utils.ErrorLog("cost_classify_id")
|
2890
|
|
- return
|
2891
|
|
- }
|
2892
|
|
-
|
2893
|
|
- cost_classify_id := int64(projectM["cost_classify_id"].(float64))
|
2894
|
|
- if cost_classify_id <= 0 {
|
|
2890
|
+ cost_classify := projectM["cost_classify"].(string)
|
|
2891
|
+ if len(cost_classify) == 0 {
|
2895
|
2892
|
err_log := models.ExportErrLog{
|
2896
|
2893
|
LogType: 6,
|
2897
|
2894
|
UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
2898
|
|
- ErrMsg: "第" + strconv.Itoa(index+3) + "行" + "的费用类别不能为空",
|
|
2895
|
+ ErrMsg: "第" + strconv.Itoa(index+3) + "行" + "的费用类别不能为空或内容与系统不匹配",
|
2899
|
2896
|
Status: 1,
|
2900
|
2897
|
CreateTime: time.Now().Unix(),
|
2901
|
2898
|
UpdateTime: time.Now().Unix(),
|
|
@@ -2904,13 +2901,51 @@ func (c *HisApiController) PostProjectInformation() {
|
2904
|
2901
|
service.CreateExportErrLog(&err_log)
|
2905
|
2902
|
continue
|
2906
|
2903
|
}
|
|
2904
|
+ var costClassify = "费用类别"
|
|
2905
|
+ var cost_classify_id int64
|
|
2906
|
+
|
|
2907
|
+ costClassifyConfig, _ := service.GetDrugDataConfig(0, costClassify)
|
|
2908
|
+
|
|
2909
|
+ if len(cost_classify) != 0 {
|
|
2910
|
+ _, errcode := service.IsExistDicConfig(costClassifyConfig.ID, cost_classify, orgId)
|
|
2911
|
+ if errcode == gorm.ErrRecordNotFound {
|
|
2912
|
+ dataconfig := models.DictDataconfig{
|
|
2913
|
+ ParentId: costClassifyConfig.ID,
|
|
2914
|
+ Module: "system",
|
|
2915
|
+ OrgId: orgId,
|
|
2916
|
+ Name: cost_classify,
|
|
2917
|
+ FieldName: "",
|
|
2918
|
+ Value: index + 50,
|
|
2919
|
+ CreatedTime: "",
|
|
2920
|
+ UpdatedTime: "",
|
|
2921
|
+ CreateUserId: adminUser.AdminUser.Id,
|
|
2922
|
+ Status: 1,
|
|
2923
|
+ Remark: "",
|
|
2924
|
+ DeleteIdSystem: 0,
|
|
2925
|
+ Title: "",
|
|
2926
|
+ Content: "",
|
|
2927
|
+ Order: 0,
|
|
2928
|
+ Code: "",
|
|
2929
|
+ }
|
|
2930
|
+ service.CreatedDicConfig(&dataconfig)
|
|
2931
|
+ }
|
|
2932
|
+ }
|
|
2933
|
+
|
|
2934
|
+ costClassList, _ := service.GetParentDataConfig(costClassifyConfig.ID, orgId)
|
|
2935
|
+
|
|
2936
|
+ for _, it := range costClassList {
|
|
2937
|
+ if cost_classify == it.Name {
|
|
2938
|
+ cost_classify_id = int64(it.Value)
|
|
2939
|
+ }
|
|
2940
|
+ }
|
2907
|
2941
|
project.CostClassify = cost_classify_id
|
2908
|
|
- executive_section_id := int64(projectM["executive_section_id"].(float64))
|
2909
|
|
- if executive_section_id <= 0 {
|
|
2942
|
+
|
|
2943
|
+ executive_section := projectM["executive_section"].(string)
|
|
2944
|
+ if len(executive_section) == 0 {
|
2910
|
2945
|
err_log := models.ExportErrLog{
|
2911
|
2946
|
LogType: 6,
|
2912
|
2947
|
UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
2913
|
|
- ErrMsg: "第" + strconv.Itoa(index+3) + "行" + "的费用类别不能为空",
|
|
2948
|
+ ErrMsg: "第" + strconv.Itoa(index+3) + "行" + "的费用类别不能为空或内容与系统不匹配",
|
2914
|
2949
|
Status: 1,
|
2915
|
2950
|
CreateTime: time.Now().Unix(),
|
2916
|
2951
|
UpdateTime: time.Now().Unix(),
|
|
@@ -2920,15 +2955,31 @@ func (c *HisApiController) PostProjectInformation() {
|
2920
|
2955
|
continue
|
2921
|
2956
|
}
|
2922
|
2957
|
|
2923
|
|
- project.ExecutiveSection = executive_section_id
|
2924
|
|
-
|
2925
|
|
- if projectM["medical_insurance_level_id"] == nil || reflect.TypeOf(projectM["medical_insurance_level_id"]).String() != "float64" {
|
2926
|
|
- utils.ErrorLog("medical_insurance_level_id")
|
2927
|
|
- return
|
|
2958
|
+ if len(executive_section) != 0 {
|
|
2959
|
+
|
|
2960
|
+ _, errcodedepart := service.GetDepartMentByName(executive_section, orgId)
|
|
2961
|
+ if errcodedepart == gorm.ErrRecordNotFound {
|
|
2962
|
+ department := models.XtHisDepartment{
|
|
2963
|
+ Name: executive_section,
|
|
2964
|
+ Status: 1,
|
|
2965
|
+ UserOrgId: adminUser.CurrentOrgId,
|
|
2966
|
+ CreatedTime: time.Now().Unix(),
|
|
2967
|
+ }
|
|
2968
|
+ service.CreateDePartment(&department)
|
|
2969
|
+ }
|
|
2970
|
+ }
|
|
2971
|
+ var executive_section_id int64
|
|
2972
|
+ departMentList, _ := service.GetAllDepartMent(orgId)
|
|
2973
|
+ for _, it := range departMentList {
|
|
2974
|
+ if executive_section == it.Name {
|
|
2975
|
+ executive_section_id = it.ID
|
|
2976
|
+ }
|
2928
|
2977
|
}
|
|
2978
|
+ project.ExecutiveSection = executive_section_id
|
2929
|
2979
|
|
2930
|
|
- medical_insurance_level_id := int64(projectM["medical_insurance_level_id"].(float64))
|
2931
|
|
- if executive_section_id <= 0 {
|
|
2980
|
+ medical_coverage := projectM["medical_coverage"].(string)
|
|
2981
|
+ fmt.Println("3333333333333", medical_coverage)
|
|
2982
|
+ if len(medical_coverage) == 0 {
|
2932
|
2983
|
err_log := models.ExportErrLog{
|
2933
|
2984
|
LogType: 6,
|
2934
|
2985
|
UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
|
@@ -2942,13 +2993,180 @@ func (c *HisApiController) PostProjectInformation() {
|
2942
|
2993
|
continue
|
2943
|
2994
|
}
|
2944
|
2995
|
|
2945
|
|
- project.MedicalCoverage = medical_insurance_level_id
|
|
2996
|
+ var medicalCoverage = "医保等级"
|
|
2997
|
+ var medical_coverage_id int64
|
|
2998
|
+
|
|
2999
|
+ medicalCoverageConfig, _ := service.GetDrugDataConfig(0, medicalCoverage)
|
|
3000
|
+ if len(medical_coverage) != 0 {
|
|
3001
|
+
|
|
3002
|
+ _, errormedicalcoverage := service.IsExistDicConfig(medicalCoverageConfig.ID, medical_coverage, orgId)
|
|
3003
|
+ if errormedicalcoverage == gorm.ErrRecordNotFound {
|
|
3004
|
+ dataconfig := models.DictDataconfig{
|
|
3005
|
+ ParentId: medicalCoverageConfig.ID,
|
|
3006
|
+ Module: "system",
|
|
3007
|
+ OrgId: orgId,
|
|
3008
|
+ Name: medical_coverage,
|
|
3009
|
+ FieldName: "",
|
|
3010
|
+ Value: index + 50,
|
|
3011
|
+ CreatedTime: "",
|
|
3012
|
+ UpdatedTime: "",
|
|
3013
|
+ CreateUserId: adminUser.AdminUser.Id,
|
|
3014
|
+ Status: 1,
|
|
3015
|
+ Remark: "",
|
|
3016
|
+ DeleteIdSystem: 0,
|
|
3017
|
+ Title: "",
|
|
3018
|
+ Content: "",
|
|
3019
|
+ Order: 0,
|
|
3020
|
+ Code: "",
|
|
3021
|
+ }
|
|
3022
|
+ service.CreatedDicConfig(&dataconfig)
|
|
3023
|
+ }
|
|
3024
|
+ }
|
|
3025
|
+ medicalCoverageList, _ := service.GetParentDataConfig(medicalCoverageConfig.ID, orgId)
|
|
3026
|
+ for _, it := range medicalCoverageList {
|
|
3027
|
+ if medical_coverage == it.Name {
|
|
3028
|
+ medical_coverage_id = int64(it.Value)
|
|
3029
|
+ }
|
|
3030
|
+ }
|
|
3031
|
+ project.MedicalCoverage = medical_coverage_id
|
|
3032
|
+
|
|
3033
|
+ pinyin := projectM["pinyin"].(string)
|
|
3034
|
+ project.Pinyin = pinyin
|
|
3035
|
+
|
|
3036
|
+ wubi := projectM["wubi"].(string)
|
|
3037
|
+ project.Wubi = wubi
|
|
3038
|
+
|
|
3039
|
+ statistical_classification := projectM["statistical_classification"].(string)
|
|
3040
|
+
|
|
3041
|
+ var statisticalClassification = "统计分类"
|
|
3042
|
+ var statistical_classification_id int64
|
|
3043
|
+ classiFication, _ := service.GetDrugDataConfig(0, statisticalClassification)
|
|
3044
|
+ if len(statistical_classification) != 0 {
|
|
3045
|
+
|
|
3046
|
+ _, classificationerrcodes := service.IsExistDicConfig(classiFication.ID, statistical_classification, orgId)
|
|
3047
|
+
|
|
3048
|
+ if classificationerrcodes == gorm.ErrRecordNotFound {
|
|
3049
|
+ dataconfig := models.DictDataconfig{
|
|
3050
|
+ ParentId: classiFication.ID,
|
|
3051
|
+ Module: "system",
|
|
3052
|
+ OrgId: orgId,
|
|
3053
|
+ Name: statistical_classification,
|
|
3054
|
+ FieldName: "",
|
|
3055
|
+ Value: index + 50,
|
|
3056
|
+ CreatedTime: "",
|
|
3057
|
+ UpdatedTime: "",
|
|
3058
|
+ CreateUserId: adminUser.AdminUser.Id,
|
|
3059
|
+ Status: 1,
|
|
3060
|
+ Remark: "",
|
|
3061
|
+ DeleteIdSystem: 0,
|
|
3062
|
+ Title: "",
|
|
3063
|
+ Content: "",
|
|
3064
|
+ Order: 0,
|
|
3065
|
+ Code: "",
|
|
3066
|
+ }
|
|
3067
|
+ service.CreatedDicConfig(&dataconfig)
|
|
3068
|
+ }
|
2946
|
3069
|
|
|
3070
|
+ }
|
|
3071
|
+ classiFicationList, _ := service.GetParentDataConfig(classiFication.ID, orgId)
|
|
3072
|
+
|
|
3073
|
+ for _, it := range classiFicationList {
|
|
3074
|
+ if statistical_classification == it.Name {
|
|
3075
|
+
|
|
3076
|
+ statistical_classification_id = int64(it.Value)
|
|
3077
|
+ }
|
|
3078
|
+ }
|
|
3079
|
+
|
|
3080
|
+ project.StatisticalClassification = statistical_classification_id
|
|
3081
|
+
|
|
3082
|
+ disease_directory := int64(projectM["disease_directory"].(float64))
|
|
3083
|
+ project.DiseaseDirectory = disease_directory
|
|
3084
|
+
|
|
3085
|
+ is_record := int64(projectM["is_record"].(float64))
|
|
3086
|
+ project.IsRecord = is_record
|
|
3087
|
+
|
|
3088
|
+ medical_code := projectM["medical_code"].(string)
|
|
3089
|
+ project.Wubi = medical_code
|
|
3090
|
+
|
|
3091
|
+ tube_color := projectM["tube_color"].(string)
|
|
3092
|
+
|
|
3093
|
+ var tubeColor = "试管颜色"
|
|
3094
|
+ var tube_color_id int64
|
|
3095
|
+ tubeColorConfig, _ := service.GetDrugDataConfig(0, tubeColor)
|
|
3096
|
+ if len(tube_color) != 0 {
|
|
3097
|
+ _, errcodetube := service.IsExistDicConfig(tubeColorConfig.ID, tube_color, orgId)
|
|
3098
|
+ if errcodetube == gorm.ErrRecordNotFound {
|
|
3099
|
+ dataconfig := models.DictDataconfig{
|
|
3100
|
+ ParentId: tubeColorConfig.ID,
|
|
3101
|
+ Module: "system",
|
|
3102
|
+ OrgId: orgId,
|
|
3103
|
+ Name: tube_color,
|
|
3104
|
+ FieldName: "",
|
|
3105
|
+ Value: index + 50,
|
|
3106
|
+ CreatedTime: "",
|
|
3107
|
+ UpdatedTime: "",
|
|
3108
|
+ CreateUserId: adminUser.AdminUser.Id,
|
|
3109
|
+ Status: 1,
|
|
3110
|
+ Remark: "",
|
|
3111
|
+ DeleteIdSystem: 0,
|
|
3112
|
+ Title: "",
|
|
3113
|
+ Content: "",
|
|
3114
|
+ Order: 0,
|
|
3115
|
+ Code: "",
|
|
3116
|
+ }
|
|
3117
|
+ service.CreatedDicConfig(&dataconfig)
|
|
3118
|
+ }
|
|
3119
|
+
|
|
3120
|
+ }
|
|
3121
|
+
|
|
3122
|
+ tubeColorList, _ := service.GetParentDataConfig(tubeColorConfig.ID, orgId)
|
|
3123
|
+ for _, it := range tubeColorList {
|
|
3124
|
+ if tube_color == it.Name {
|
|
3125
|
+ tube_color_id = int64(it.Value)
|
|
3126
|
+ }
|
|
3127
|
+ }
|
|
3128
|
+
|
|
3129
|
+ project.TubeColor = tube_color_id
|
|
3130
|
+
|
|
3131
|
+ execution_frequency := projectM["execution_frequency"].(string)
|
|
3132
|
+ project.Wubi = execution_frequency
|
|
3133
|
+
|
|
3134
|
+ delivery_way := projectM["delivery_way"].(string)
|
|
3135
|
+ project.DeliveryWay = delivery_way
|
|
3136
|
+
|
|
3137
|
+ number_days := projectM["number_days"].(string)
|
|
3138
|
+ project.NumberDays = number_days
|
|
3139
|
+
|
|
3140
|
+ total := projectM["total"].(string)
|
|
3141
|
+ project.Total = total
|
|
3142
|
+
|
|
3143
|
+ medical_status := int64(projectM["medical_status"].(float64))
|
|
3144
|
+ project.TubeColor = medical_status
|
|
3145
|
+
|
|
3146
|
+ category := int64(projectM["category"].(float64))
|
|
3147
|
+ project.Category = category
|
|
3148
|
+
|
|
3149
|
+ specail_project := int64(projectM["specail_project"].(float64))
|
|
3150
|
+ project.SpecailProject = specail_project
|
|
3151
|
+
|
|
3152
|
+ social_security_directory_code := projectM["social_security_directory_code"].(string)
|
|
3153
|
+ fmt.Println("社保目录编码22222222222", social_security_directory_code)
|
|
3154
|
+ project.SocialSecurityDirectoryCode = social_security_directory_code
|
|
3155
|
+
|
|
3156
|
+ remark := projectM["remark"].(string)
|
|
3157
|
+ project.Remark = remark
|
|
3158
|
+
|
|
3159
|
+ record_date := c.GetString("record_date")
|
|
3160
|
+ timeLayout := "2006-01-02"
|
|
3161
|
+ loc, _ := time.LoadLocation("Local")
|
|
3162
|
+
|
|
3163
|
+ theTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
|
|
3164
|
+ project.RecordDate = theTime.Unix()
|
2947
|
3165
|
projectList = append(projectList, &project)
|
2948
|
3166
|
}
|
2949
|
|
- adminUser := c.GetAdminUserInfo()
|
2950
|
|
- orgId := adminUser.CurrentOrgId
|
|
3167
|
+
|
2951
|
3168
|
export_time := time.Now().Unix()
|
|
3169
|
+
|
2952
|
3170
|
errLogs, _ := service.FindPatientExportLog(c.GetAdminUserInfo().CurrentOrgId, export_time)
|
2953
|
3171
|
if len(projectList) > 0 {
|
2954
|
3172
|
for _, item := range projectList {
|