1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161 |
- package controllers
-
- import (
- "XT_New/enums"
- "XT_New/models"
- "XT_New/service"
- "XT_New/utils"
- "encoding/json"
- "fmt"
- "github.com/jinzhu/gorm"
- "strconv"
- "time"
- )
-
- type CommonApiController struct {
- BaseAuthAPIController
- }
-
- func (this *CommonApiController) GetInspectionMajor() {
- adminInfo := this.GetAdminUserInfo()
- orgid := adminInfo.CurrentOrgId
- major, err := service.GetInspectionMajor(orgid)
- if len(major) == 0 {
- major, _ := service.GetInspectionMajor(0)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "inspection": major,
- })
- }
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "inspection": major,
- })
- }
-
- func (this *CommonApiController) GetInspectionMinor() {
- id, _ := this.GetInt64("id")
- adminInfo := this.GetAdminUserInfo()
- orgId := adminInfo.CurrentOrgId
- //查询该机构是否存在小项
- major, _ := service.GetInspectionMajor(orgId)
- if len(major) == 0 {
- minor, err := service.GetInspectionMinor(id, 0)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "inspection": minor,
- })
- } else {
- minor, err := service.GetInspectionMinor(id, orgId)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "inspection": minor,
- })
- }
-
- }
-
- func (this *CommonApiController) GetInspectionRange() {
- id, _ := this.GetInt64("id")
- fmt.Println("id", id)
- inspectionRange, err := service.GetInspectionRange(id)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "inspectionRange": inspectionRange,
- })
- }
-
- func (this *CommonApiController) SaveConfiguration() {
- adminInfo := this.GetAdminUserInfo()
- orgid := adminInfo.CurrentOrgId
- dataBody := make(map[string]interface{}, 0)
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
- fmt.Println("err", err)
- inspectionmajor := int64(dataBody["inspectionMajor"].(float64))
-
- inspectionMinor := int64(dataBody["inspectionMinor"].(float64))
-
- minrange := dataBody["min_range"].(string)
-
- largerange := dataBody["large_range"].(string)
- fmt.Println("largerange", largerange)
- sort := dataBody["sort"].(string)
- sorts, err := strconv.ParseInt(sort, 10, 64)
-
- checktype := int64(dataBody["check_type"].(float64))
-
- rangvalue := dataBody["range_value"].(string)
-
- if rangvalue == "0" {
- rangvalue = ""
- }
- // 参与集成的机构根据小项id获取item_id
- itemid, err := service.GetItemid(inspectionMinor)
- //查询小项是否有值
- fmt.Println("小项id", itemid.ItemId)
- major, err := service.GetInspectionMajor(orgid)
- if len(major) == 0 {
- _, errcode := service.GetConfigurationById(inspectionmajor, inspectionMinor, orgid)
- if errcode == gorm.ErrRecordNotFound {
- standard := models.XtQualityControlStandard{
- InspectionMajor: inspectionmajor,
- InspectionMinor: inspectionMinor,
- MinRange: minrange,
- LargeRange: largerange,
- Sort: sorts,
- UserOrgId: orgid,
- Status: 1,
- RangeType: checktype,
- RangeValue: rangvalue,
- CreatedTime: time.Now().Unix(),
- IsStatus: 1,
- }
- fmt.Println(standard)
- err = service.SaveInspection(&standard)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "standard": standard,
- })
- } else if errcode == nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
- return
- }
- } else {
- _, errcode := service.GetConfigurationById(inspectionmajor, inspectionMinor, orgid)
- if errcode == gorm.ErrRecordNotFound {
- standard := models.XtQualityControlStandard{
- InspectionMajor: inspectionmajor,
- InspectionMinor: itemid.ItemId,
- MinRange: minrange,
- LargeRange: largerange,
- Sort: sorts,
- UserOrgId: orgid,
- Status: 1,
- RangeType: checktype,
- RangeValue: rangvalue,
- CreatedTime: time.Now().Unix(),
- IsStatus: 1,
- }
- fmt.Println(standard)
- err = service.SaveInspection(&standard)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "standard": standard,
- })
- } else if errcode == nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
- return
- }
- }
-
- }
-
- func (this *CommonApiController) GetConfigurationlist() {
- limit, _ := this.GetInt64("limit")
- page, _ := this.GetInt64("page")
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- major, _ := service.GetInspectionMajor(orgid)
- if len(major) == 0 {
- configurationlist, total, err := service.GetConfigurationlist(orgid, limit, page)
- pressure, err := service.GetDefaultBloodPressure(orgid)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "configurationlist": configurationlist,
- "total": total,
- "pressure": pressure,
- })
- } else {
- configurationlist, total, err := service.GetConfigurationListTwo(orgid, limit, page)
- pressure, err := service.GetDefaultBloodPressure(orgid)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "configurationlist": configurationlist,
- "total": total,
- "pressure": pressure,
- })
- }
-
- }
-
- func (this *CommonApiController) GetConfigurationDetail() {
- id, _ := this.GetInt64("id")
- fmt.Println("id是", id)
- orgId := this.GetAdminUserInfo().CurrentOrgId
- detail, err := service.GetConfigurationDetail(id)
- major, err := service.GetInspectionMajor(orgId)
- var vid = 0
- if len(major) == 0 {
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "configurationdetail": detail,
- "vid": vid,
- })
- } else {
- itemId, err := service.GetIdByItemId(detail.InspectionMinor, orgId)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "configurationdetail": detail,
- "vid": itemId.ID,
- })
- }
-
- }
-
- func (this *CommonApiController) GetAllInspectionminor() {
-
- info := this.GetAdminUserInfo()
- orgid := info.CurrentOrgId
- major, _ := service.GetInspectionMajor(orgid)
-
- if len(major) == 0 {
- minor, err := service.GetAllInspectionMinor(0)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "minor": minor,
- })
- } else {
- minor, err := service.GetAllInspectionMinor(orgid)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "minor": minor,
- })
- }
-
- }
-
- func (this *CommonApiController) UpdateConfiguration() {
- id, _ := this.GetInt64("id")
- dataBody := make(map[string]interface{}, 0)
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
- inspectionmajor := int64(dataBody["inspectionMajor"].(float64))
- inspectionMinor := int64(dataBody["inspectionMinor"].(float64))
- minrange := dataBody["min_range"].(string)
- largerange := dataBody["large_range"].(string)
- sort := int64(dataBody["sort"].(float64))
- rangvalue := dataBody["range_value"].(string)
- if rangvalue == "0" {
- rangvalue = ""
- }
- rangtype := int64(dataBody["check_type"].(float64))
- adminInfo := this.GetAdminUserInfo()
- orgId := adminInfo.CurrentOrgId
- configuration, err := service.GetConfigurationByIdTwo(inspectionmajor, inspectionMinor, orgId)
- fmt.Println("err", err)
- if configuration.ID > 0 && configuration.ID != id {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- major, err := service.GetInspectionMajor(orgId)
- if len(major) == 0 {
- standard := models.XtQualityControlStandard{
- InspectionMajor: inspectionmajor,
- InspectionMinor: inspectionMinor,
- MinRange: minrange,
- LargeRange: largerange,
- Sort: sort,
- RangeValue: rangvalue,
- RangeType: rangtype,
- Status: 1,
- UserOrgId: orgId,
- CreatedTime: time.Now().Unix(),
- UpdatedTime: time.Now().Unix(),
- }
- err = service.UpdarteConfiguration(&standard, id)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "standard": standard,
- })
- } else {
- itemid, _ := service.GetItemid(inspectionMinor)
- standard := models.XtQualityControlStandard{
- InspectionMajor: inspectionmajor,
- InspectionMinor: itemid.ItemId,
- MinRange: minrange,
- LargeRange: largerange,
- Sort: sort,
- RangeValue: rangvalue,
- RangeType: rangtype,
- Status: 1,
- UserOrgId: orgId,
- CreatedTime: time.Now().Unix(),
- UpdatedTime: time.Now().Unix(),
- }
- err = service.UpdarteConfiguration(&standard, id)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "standard": standard,
- })
- }
-
- }
-
- func (this *CommonApiController) DeleteConfiguration() {
- id, _ := this.GetInt64("id")
- err := service.DeleteConfiguration(id)
- if err != nil {
- this.ServeFailJsonSend(enums.ErrorCodeDBDelete, "删除失败")
- return
- }
- returnData := make(map[string]interface{}, 0)
- returnData["msg"] = "ok"
- this.ServeSuccessJSON(returnData)
- return
- }
-
- func (this *CommonApiController) GetAllInspectiondata() {
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
-
- //查询该机构是否有数据
- _, errcode := service.GetAllInspectionData(orgid)
- if errcode == gorm.ErrRecordNotFound {
- inspection, err := service.GetAllInspectiondatatwo(0)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "inspection": inspection,
- })
- } else if errcode == nil {
- inspection, err := service.GetAllInspectiondatatwo(orgid)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "inspection": inspection,
- })
- }
-
- }
-
- func (this *CommonApiController) SaveCheckConfiguration() {
- dataBody := make(map[string]interface{}, 0)
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
- fmt.Println("err", err)
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- inspectionmajor := int64(dataBody["inspectionMajor"].(float64))
- //fmt.Println("大项", inspectionmajor)
- frequency := dataBody["frequency"].(string)
- //fmt.Println("凭次", frequency)
- sort := dataBody["sort"].(string)
- sorts, err := strconv.ParseInt(sort, 10, 64)
- //fmt.Println("sort", sort)
- _, errcode := service.GetInspectionMajorById(inspectionmajor, orgid)
- if errcode == gorm.ErrRecordNotFound {
- configuration := models.XtCheckConfiguration{
- InspectionMajor: inspectionmajor,
- InspectionFrequency: frequency,
- Sort: sorts,
- UserOrgId: orgid,
- Status: 1,
- CreatedTime: time.Now().Unix(),
- }
- err := service.CreateCheckConfiguration(&configuration)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "configuration": configuration,
- })
- } else if errcode == nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
- return
- }
- }
-
- func (this *CommonApiController) GetAllCheckList() {
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- //fmt.Println("org", orgid)
- page, _ := this.GetInt64("page")
- limit, _ := this.GetInt64("limit")
- major, _ := service.GetInspectionMajor(orgid)
- if len(major) == 0 {
- checklist, total, err := service.GetAllChekcListTwo(orgid, page, limit)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "checklist": checklist,
- "total": total,
- })
- } else {
- checkList, total, err := service.GetAllCheckList(orgid, page, limit)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "checklist": checkList,
- "total": total,
- })
- }
-
- }
-
- func (this *CommonApiController) GetCheckdetail() {
-
- id, _ := this.GetInt64("id")
- detail, err := service.GetCheckDetail(id)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "checkdetail": detail,
- })
- }
-
- func (this *CommonApiController) UpdateCheck() {
- id, _ := this.GetInt64("id")
- fmt.Println(id)
- dataBody := make(map[string]interface{}, 0)
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
- fmt.Println(err)
- inspectionmajor := int64(dataBody["inspectionMajor"].(float64))
- //fmt.Println("大项", inspectionmajor)
- frequency := dataBody["frequency"].(string)
- //fmt.Println("凭次", frequency)
- sort := int64(dataBody["sort"].(float64))
- //fmt.Println("sort", sort)
- adminInfo := this.GetAdminUserInfo()
- orgId := adminInfo.CurrentOrgId
- Inspection, err := service.GetInspectionMajorByIdTwo(inspectionmajor, orgId)
- if Inspection.ID > 0 && Inspection.ID != id {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- configuration := models.XtCheckConfiguration{
- InspectionMajor: inspectionmajor,
- InspectionFrequency: frequency,
- Sort: sort,
- }
-
- err = service.UpdateCheck(&configuration, id)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "configuration": configuration,
- })
- }
-
- func (this *CommonApiController) DeleteCheck() {
- id, _ := this.GetInt64("id")
- err := service.DeleteCheck(id)
- if err != nil {
- this.ServeFailJsonSend(enums.ErrorCodeDBDelete, "删除失败")
- return
- }
- returnData := make(map[string]interface{}, 0)
- returnData["msg"] = "ok"
- this.ServeSuccessJSON(returnData)
- return
- }
-
- func (this *CommonApiController) GetDialysisModeType() {
- timeLayout := "2006-01-02"
- loc, _ := time.LoadLocation("Local")
- startime := this.GetString("startime")
- endtime := this.GetString("endtime")
-
- startTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", startime+" 00:00:00", loc)
- startimes := startTimes.Unix()
-
- endtimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", endtime+" 00:00:00", loc)
- endtimeData := endtimes.Unix()
-
- lapsetotype, _ := this.GetInt64("lapsetotype")
- sourcetype, _ := this.GetInt64("sourcetype")
-
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- //统计透析总量
- total, _ := service.GetDialysiTotal(startimes, endtimeData, orgid, lapsetotype, sourcetype)
- //var mode models.PatientPrescriptionCountStruct
- //mode.Count = total
- modeType, err := service.GetDialysisCountMode(startimes, endtimeData, orgid, lapsetotype, sourcetype)
-
- //var total models.PatientPrescriptionCountStruct
- //for _, item := range modeType {
- // total.Count = total.Count + item.Count
- //}
-
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "total": total,
- "modetype": modeType,
- })
- }
-
- func (this *CommonApiController) GetTotalLapseCount() {
- timeLayout := "2006-01-02"
- loc, _ := time.LoadLocation("Local")
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- startime := this.GetString("startime")
- startTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", startime+" 00:00:00", loc)
- startnunix := startTimes.Unix()
- endtime := this.GetString("endtime")
- endtimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", endtime+" 23:59:59", loc)
- endunix := endtimes.Unix()
- lapsetotype, _ := this.GetInt64("lapsetotype")
- sourcetype, _ := this.GetInt64("sourcetype")
- //统计该机构的转出人数
- patients, err := service.GetTotalRollOutPatients(orgid, startnunix, endunix, lapsetotype, sourcetype)
-
- //统计该机构转出病人
- patienttwo, err := service.GetTotalRollOutPatientsTwo(orgid, startnunix, endunix, lapsetotype, sourcetype)
- count := service.GetPatientTotalCount(orgid, lapsetotype, sourcetype)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- //统计当前机构转出的人数
- rollout, err := service.GetCountRollout(orgid, startnunix, endunix, lapsetotype, sourcetype)
- this.ServeSuccessJSON(map[string]interface{}{
- "patients": patients,
- "count": count,
- "patienttwo": patienttwo,
- "rollout": rollout,
- })
- }
-
- func (this *CommonApiController) GetTotalSexCount() {
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- fmt.Println("orgid", orgid)
- startime, _ := this.GetInt64("startime")
- fmt.Println("开始时间", startime)
- endtime, _ := this.GetInt64("endtime")
- fmt.Println("结束时间", endtime)
- lapsetotype, _ := this.GetInt64("lapsetotype")
- sourcetype, _ := this.GetInt64("sourcetype")
- total := service.GetPatientTotalCount(orgid, lapsetotype, sourcetype)
-
- _, totalSex, err := service.GetManPatientTotal(orgid, lapsetotype, sourcetype)
-
- _, totalWoman, err := service.GetWoManPatientTotal(orgid, lapsetotype, sourcetype)
-
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "total": total,
- "totalSex": totalSex,
- "totalWoman": totalWoman,
- })
- }
-
- func (this *CommonApiController) GetTotalInfectiouscount() {
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- fmt.Println("orgid", orgid)
- timeLayout := "2006-01-02"
- loc, _ := time.LoadLocation("Local")
- startime := this.GetString("startime")
- startTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", startime+" 00:00:00", loc)
- startnunix := startTimes.Unix()
- endtime := this.GetString("endtime")
- endtimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", endtime+" 23:59:59", loc)
- endunix := endtimes.Unix()
- lapsetotype, _ := this.GetInt64("lapsetotype")
- sourcetype, _ := this.GetInt64("sourcetype")
-
- //统计透析总人数
- total := service.GetPatientTotalCount(orgid, lapsetotype, sourcetype)
- //统计透析人数传染病所占比例
- count, err := service.GetPatientInfectiousCount(orgid, startnunix, endunix, lapsetotype, sourcetype)
- //统计其他
- _, otherTotal, err := service.GetPatientOtherInfectious(orgid)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "total": total,
- "count": count,
- "otherTotal": otherTotal,
- })
- }
-
- func (this *CommonApiController) GetTotalAgeCount() {
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- fmt.Println("orgid", orgid)
- startime, _ := this.GetInt64("startime")
- fmt.Println("开始时间", startime)
- endtime, _ := this.GetInt64("endtime")
- fmt.Println("结束时间", endtime)
- lapsetotype, _ := this.GetInt64("lapsetotype")
- sourcetype, _ := this.GetInt64("sourcetype")
- //统计透析总人数
- total := service.GetPatientTotalCount(orgid, lapsetotype, sourcetype)
-
- agecount, err := service.GetTotalAgeCount(orgid, lapsetotype, sourcetype)
- //two, err := service.GetTotalAgeCountTwo(orgid, startime, endtime)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "total": total,
- "ageCount": agecount,
- })
- }
-
- func (this *CommonApiController) GetTotalDialysisCount() {
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- fmt.Println("org", orgid)
- startime, _ := this.GetInt64("startime")
- fmt.Println(startime)
- endtime, _ := this.GetInt64("endtime")
- fmt.Println(endtime)
- recordDateStr := time.Now().Format("2006-01-02")
- recordDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
- fmt.Println("parseDateErr", parseDateErr)
- nowtime := recordDate.Unix()
- lapsetotype, _ := this.GetInt64("lapsetotype")
- sourcetype, _ := this.GetInt64("sourcetype")
- //统计透析总人数
- total := service.GetPatientTotalCount(orgid, lapsetotype, sourcetype)
- fmt.Println("total", total)
- //获取该机构下的所有病人数据
- patients, err := service.GetTotalDialysisAgeCount(orgid)
- fmt.Println("patients", patients)
-
- //统计透年龄
- dataage, _ := service.GetDialysisAgeData(orgid, lapsetotype, sourcetype)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "total": total,
- "patients": patients,
- "nowtime": nowtime,
- "dataage": dataage,
- })
- }
-
- func (this *CommonApiController) GetCurentOrgPatients() {
-
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- patients, err := service.GetCurentOrgPatients(orgid)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "patients": patients,
- })
- }
-
- func (this *CommonApiController) GetDialysislist() {
- startime := this.GetString("startime")
-
- endtime := this.GetString("endtime")
-
- startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
- fmt.Println("parseDateErr", parseDateErr)
- statime := startDate.Unix()
-
- endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
- entime := endDate.Unix()
-
- page, _ := this.GetInt64("page")
-
- limit, _ := this.GetInt64("limit")
- fmt.Println(limit)
- adminUser := this.GetAdminUserInfo()
- orgId := adminUser.CurrentOrgId
- count, _ := service.TotalDialysisCount(statime, entime, orgId)
- dialysislist, total, err := service.GetDialysisList(statime, entime, page, limit, orgId)
- prescriptionList, _ := service.GetAllDialysisList(statime, entime, orgId)
- list, totallist, _ := service.GetDialysisPatientList(statime, entime, page, limit, orgId)
- //获取每个病人每个透析模式的数据
- modeIdCount, parseDateErr := service.GetModeIdCount(statime, entime, orgId, page, 1000)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "dialysislist": dialysislist,
- "total": total,
- "list": list,
- "totallist": totallist,
- "prescriptionList": prescriptionList,
- "count": count,
- "modeIdCount": modeIdCount,
- })
- }
-
- func (this *CommonApiController) GetLastSort() {
-
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- standard, err := service.GetLastSort(orgid)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "standard": standard,
- })
- }
-
- func (this *CommonApiController) GetLastCheckList() {
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- checkList, err := service.GetLastCheckList(orgid)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "checkList": checkList,
- })
- }
-
- func (this *CommonApiController) GetDialysisDetailById() {
- adminUser := this.GetAdminUserInfo()
- orgId := adminUser.CurrentOrgId
- id, _ := this.GetInt64("id")
- fmt.Println("id", id)
- startime := this.GetString("startime")
- fmt.Println(startime)
- endtime := this.GetString("endtime")
- startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
- fmt.Println("parseDateErr", parseDateErr)
- statime := startDate.Unix()
- fmt.Println("开始时间", statime)
- endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
-
- entime := endDate.Unix()
- fmt.Println("开始时间", statime)
- fmt.Println(endtime)
- limit, _ := this.GetInt64("limit")
- fmt.Println("limit", limit)
- page, _ := this.GetInt64("page")
- fmt.Println("page", page)
- patients, total, err := service.GetDialysisDetailById(id, orgId, statime, entime, limit, page)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "patients": patients,
- "total": total,
- })
- }
-
- func (this *CommonApiController) GetPrescritionByName() {
- adminUser := this.GetAdminUserInfo()
- orgId := adminUser.CurrentOrgId
-
- patientid, _ := this.GetInt64("patientid")
- startime := this.GetString("startime")
- fmt.Println(startime)
- endtime := this.GetString("endtime")
- startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
- fmt.Println("parseDateErr", parseDateErr)
- statime := startDate.Unix()
- fmt.Println("开始时间", statime)
- endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
-
- entime := endDate.Unix()
-
- limit, _ := this.GetInt64("limit")
-
- page, _ := this.GetInt64("page")
-
- patient, total, err := service.GetPrescritionByName(orgId, patientid, statime, entime, limit, page)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "patient": patient,
- "total": total,
- })
- }
-
- func (this *CommonApiController) GetStatistics() {
- adminUser := this.GetAdminUserInfo()
- orgId := adminUser.CurrentOrgId
-
- startime := this.GetString("start_time")
-
- endtime := this.GetString("end_time")
- startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
- fmt.Println("parseDateErr", parseDateErr)
- statime := startDate.Unix()
-
- endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
- entime := endDate.Unix()
-
- value, _ := this.GetInt64("value")
-
- limit, _ := this.GetInt64("limit")
-
- page, _ := this.GetInt64("page")
-
- modeId, _ := this.GetInt64("mode_id")
- treatinfo, total, err := service.GetTreateInfo(orgId, statime, entime, value, limit, page)
- statistics, ttd, _ := service.GetStatistics(orgId, statime, entime, modeId)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "statistics": statistics,
- "ttd": ttd,
- "total": total,
- "treatinfo": treatinfo,
- })
- }
-
- func (this *CommonApiController) GetInspectionTatolCount() {
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- startime := this.GetString("startime")
- fmt.Println(startime)
- endtime := this.GetString("endtime")
- fmt.Print("endtime", endtime)
- patientid, _ := this.GetInt64("patientid")
- startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
- fmt.Println("parseDateErr", parseDateErr)
- statime := startDate.Unix()
- secondQuarterEndStr := endtime + " 23:59:59"
- secondQuarterEnds, parseDateErr := utils.ParseTimeStringToTime("2006-01-02 15:04:05", secondQuarterEndStr)
- entime := secondQuarterEnds.Unix()
-
- references, err := service.GetInspectionTotalCount(orgid)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- counts, err := service.GetInspectionProjectCount(orgid, statime, entime, patientid)
-
- this.ServeSuccessJSON(map[string]interface{}{
- "Inspection": references,
- "counts": counts,
- })
- }
-
- func (this *CommonApiController) GetInspectionDetailById() {
- adminUser := this.GetAdminUserInfo()
- orgId := adminUser.CurrentOrgId
- id, _ := this.GetInt64("id")
- fmt.Println("id", id)
- startime := this.GetString("startime")
- endtime := this.GetString("endtime")
- startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
- fmt.Println("parseDateErr", parseDateErr)
- statime := startDate.Unix()
- fmt.Println("开始时间", statime)
- secondQuarterEndStr := endtime + " 23:59:59"
- secondQuarterEnds, parseDateErr := utils.ParseTimeStringToTime("2006-01-02 15:04:05", secondQuarterEndStr)
- entime := secondQuarterEnds.Unix()
- patientdetail, err := service.GetInspectionDetailById(id, orgId, statime, entime)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "patientdetail": patientdetail,
- })
- }
-
- func (this *CommonApiController) GetSearchPatientInfo() {
- adminUser := this.GetAdminUserInfo()
- orgId := adminUser.CurrentOrgId
- //keyword := this.GetString("keyword")
- //fmt.Println("keyword", keyword)
- patientid, _ := this.GetInt64("patientid")
- startime := this.GetString("startime")
- endtime := this.GetString("endtime")
- startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
- fmt.Println("parseDateErr", parseDateErr)
- statime := startDate.Unix()
- fmt.Println("开始时间", statime)
- //endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
- //entime := endDate.Unix()
- //fmt.Println("结束日期", entime)
- secondQuarterEndStr := endtime + " 23:59:59"
- secondQuarterEnds, parseDateErr := utils.ParseTimeStringToTime("2006-01-02 15:04:05", secondQuarterEndStr)
- entime := secondQuarterEnds.Unix()
- PatientsInfo, err := service.GetSearchPatientInfo(orgId, patientid, statime, entime)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "PatientsInfo": PatientsInfo,
- })
- }
-
- func (this *CommonApiController) GetAllMajorInspection() {
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- inspection, err := service.GetMajorInspectionByOrgid(orgid)
- if len(inspection) == 0 {
- inspect, err := service.GetDefaultByOrgId(0)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "inspection": inspect,
- })
- } else {
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "inspection": inspection,
- })
- }
- }
-
- func (this *CommonApiController) GetPatientList() {
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- startime := this.GetString("startime")
- endtime := this.GetString("endtime")
- startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
- fmt.Println("parseDateErr", parseDateErr)
- statime := startDate.Unix()
- fmt.Println("开始时间", statime)
- //endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
- // //entime := endDate.Unix()
- endTimeYMDHmsStr := endtime + " 23:59:59"
- endDate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endTimeYMDHmsStr)
- entime := endDate.Unix()
- fmt.Println("结束日期", entime)
- limit, _ := this.GetInt64("limit")
- fmt.Println("limit", limit)
- page, _ := this.GetInt64("page")
- fmt.Println("page", page)
- patientInfo, total, err := service.GetPatientListData(orgid, statime, entime, limit, page)
-
- info, _ := service.GetPatientListInfo(orgid, statime, entime, limit, page)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "patientInfo": patientInfo,
- "total": total,
- "list": info,
- })
- }
-
- func (this *CommonApiController) GetPatientDetailCheck() {
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- id, _ := this.GetInt64("id")
- startime := this.GetString("startime")
- endtime := this.GetString("endtime")
- startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
- fmt.Println("parseDateErr", parseDateErr)
- statime := startDate.Unix()
- fmt.Println("开始时间", statime)
- //endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
- //entime := endDate.Unix()
- //fmt.Println("结束日期", entime)
- endTimeYMDHmsStr := endtime + " 23:59:59"
- endDate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endTimeYMDHmsStr)
- entime := endDate.Unix()
- checkDetail, err := service.GetPatientDetailCheck(id, orgid, statime, entime)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "checkDetail": checkDetail,
- })
- }
-
- func (this *CommonApiController) GetSearchDetailCheck() {
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- keyword := this.GetString("keyword")
- startime := this.GetString("startime")
- endtime := this.GetString("endtime")
- startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
- fmt.Println("parseDateErr", parseDateErr)
- statime := startDate.Unix()
- fmt.Println("开始时间", statime)
- endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
- entime := endDate.Unix()
- fmt.Println("结束日期", entime)
- checkDetail, err := service.GetSearchDetailCheck(orgid, keyword, statime, entime)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "checkDetail": checkDetail,
- })
- }
-
- func (this *CommonApiController) GetNormData() {
- orgid := this.GetAdminUserInfo().CurrentOrgId
- //获取系统数据
- normdata, err := service.GetNormDataByOrgId(orgid)
- //获取血压数据
- bloodPressure, err := service.GetDefaultBloodPressure(orgid)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "normdata": normdata,
- "bloodPressure": bloodPressure,
- })
- //if len(normdata) == 0 {
- // normdata, err := service.GetNormData(0)
- // if err != nil {
- // this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- // return
- // }
- // this.ServeSuccessJSON(map[string]interface{}{
- // "normdata": normdata,
- // })
- //} else {
- // normdata, err := service.GetNormDataByOrgId(orgid)
- // if err != nil {
- // this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- // return
- // }
- // this.ServeSuccessJSON(map[string]interface{}{
- // "normdata": normdata,
- // })
- //}
-
- }
-
- func (this *CommonApiController) GetFirstQuarter() {
- orgid := this.GetAdminUserInfo().CurrentOrgId
- lapseto, _ := this.GetInt64("lapseto")
- origin, _ := this.GetInt64("origin")
-
- fmt.Println("转归", lapseto)
- startime := this.GetString("startime")
-
- startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
- fmt.Println("parseDateErr", parseDateErr)
- statime := startDate.Unix()
-
- endtime := this.GetString("endtime")
-
- endTimeYMDHmsStr := endtime + " 23:59:59"
- endDate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endTimeYMDHmsStr)
- entime := endDate.Unix()
- fmt.Println("结束日期", entime)
- //统计数值类型的数据
- count, err := service.GetQuarterTotalCount(orgid, statime, entime, lapseto, origin)
- //统计rang_type== 2
- countwo, _ := service.GetQuarterTotalCountTwo(orgid, statime, entime, lapseto, origin)
-
- //获取收缩压数据
- systolic, systolicTotal, parseDateErr := service.GetSystolicBloodPressureTwo(orgid, statime, entime, lapseto, origin)
- //统计收缩压合格的数据
- //systolic, sysstandTotal, parseDateErr := service.GetStandSystolicBloodPressure(orgid, statime, entime)
-
- //获取舒张压数据
- diastolic, diastotal, parseDateErr := service.GetDiastolicBloodPressureTwo(orgid, statime, entime, lapseto, origin)
- //获取合格舒张压数据
- //diastolic, diasstandtotal, parseDateErr := service.GetDiastolicStandPressure(orgid, statime, entime)
- normData, _ := service.GetNormData(orgid)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "count": count,
- "countwo": countwo,
- "systolic": systolic,
- "systolicTotal": systolicTotal,
- "diastolic": diastolic,
- "diastotal": diastotal,
- "normData": normData,
- })
- }
-
- func (this *CommonApiController) GetProjectList() {
- startime := this.GetString("startime")
- fmt.Println("startime", startime)
- startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
- fmt.Println("parseDateErr", parseDateErr)
- statime := startDate.Unix()
- fmt.Println("开始时间", statime)
- endtime := this.GetString("endtime")
- fmt.Println("endtime", endtime)
- endTimeYMDHmsStr := endtime + " 23:59:59"
- endDate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endTimeYMDHmsStr)
- entime := endDate.Unix()
-
- adminInfo := this.GetAdminUserInfo()
- orgid := adminInfo.CurrentOrgId
-
- lapseto, _ := this.GetInt64("lapseto")
- fmt.Println("lapseto", lapseto)
- itemtype, _ := this.GetInt64("itemtype")
- fmt.Println("type", itemtype)
- modetype, _ := this.GetInt64("modetype")
- fmt.Println("modetype", modetype)
-
- firstQuarterStart := this.GetString("first_quarter_start")
- firstQuarterStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", firstQuarterStart)
- firstQuarterStartUnix := firstQuarterStartStr.Unix()
-
- fisrtQuarterEnd := this.GetString("first_qurter_end")
- fisrtQuarterEndStr := fisrtQuarterEnd + " 23:59:59"
- fisrtQuarterEnds, parseDateErr := utils.ParseTimeStringToTime("2006-01-02 15:04:05", fisrtQuarterEndStr)
- fisrtQuarterEndStrUnix := fisrtQuarterEnds.Unix()
-
- secondeQuarterStart := this.GetString("second_qurter_start")
- secondeQuarterStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", secondeQuarterStart)
- secondeQuarterStartUnix := secondeQuarterStartStr.Unix()
-
- secondQuarterEnd := this.GetString("second_qurter_end")
- secondQuarterEndStr := secondQuarterEnd + " 23:59:59"
- secondQuarterEnds, parseDateErr := utils.ParseTimeStringToTime("2006-01-02 15:04:05", secondQuarterEndStr)
- secondQuarterEndStrUnix := secondQuarterEnds.Unix()
- fmt.Println("第二季度结束时间", secondQuarterEndStrUnix)
-
- threeQuarterStart := this.GetString("three_qurter_start")
- threeQuarterStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", threeQuarterStart)
- threeQuarterStartUnix := threeQuarterStartStr.Unix()
-
- threeQuarterEnd := this.GetString("three_qurter_end")
- threeQuarterEndStr := threeQuarterEnd + " 23:59:59"
- threeQuarterEnds, parseDateErr := utils.ParseTimeStringToTime("2006-01-02 15:04:05", threeQuarterEndStr)
- threeQuarterEndStrUnix := threeQuarterEnds.Unix()
-
- fourQuarterStart := this.GetString("four_qurter_start")
- fourQuarterStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", fourQuarterStart)
- fourQuarterStartUnix := fourQuarterStartStr.Unix()
-
- fourQuarterEnd := this.GetString("four_qurter_end")
- fourQuarterEndStr := fourQuarterEnd + " 23:59:59"
- fourQuarterEnds, parseDateErr := utils.ParseTimeStringToTime("2006-01-02 15:04:05", fourQuarterEndStr)
- fourQuarterEndStrUnix := fourQuarterEnds.Unix()
- //fmt.Println("第四季度结束时间", fourQuarterEndStrUnix)
- rangetype, parseDateErr := this.GetInt64("range_type")
- //按季度统计
- if rangetype == 1 {
- //统计总共
- list, err := service.GetProjectList(orgid, lapseto, modetype, statime, entime, firstQuarterStartUnix, fisrtQuarterEndStrUnix, secondeQuarterStartUnix, secondQuarterEndStrUnix, threeQuarterStartUnix, threeQuarterEndStrUnix, fourQuarterStartUnix, fourQuarterEndStrUnix)
- //统计达标个数
- standList, err := service.GetProjectStandList(orgid, lapseto, modetype, statime, entime, firstQuarterStartUnix, fisrtQuarterEndStrUnix, secondeQuarterStartUnix, secondQuarterEndStrUnix, threeQuarterStartUnix, threeQuarterEndStrUnix, fourQuarterStartUnix, fourQuarterEndStrUnix)
-
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
- "list": list,
- "standList": standList,
- })
- }
-
- if rangetype == 2 {
- list, err := service.GetProjectListOne(orgid, lapseto, modetype, statime, entime, firstQuarterStartUnix, fisrtQuarterEndStrUnix, secondeQuarterStartUnix, secondQuarterEndStrUnix, threeQuarterStartUnix, threeQuarterEndStrUnix, fourQuarterStartUnix, fourQuarterEndStrUnix)
- //统计达标个数
- standList, err := service.GetProjectStandListOne(orgid, lapseto, modetype, statime, entime, firstQuarterStartUnix, fisrtQuarterEndStrUnix, secondeQuarterStartUnix, secondQuarterEndStrUnix, threeQuarterStartUnix, threeQuarterEndStrUnix, fourQuarterStartUnix, fourQuarterEndStrUnix)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
- "list": list,
- "standList": standList,
- })
- }
- }
-
- func (this *CommonApiController) GetMonthProjectList() {
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
-
- lapseto, _ := this.GetInt64("lapseto")
- fmt.Println("lapseto", lapseto)
- itemtype, _ := this.GetInt64("itemtype")
- fmt.Println("itemtype", itemtype)
- modetype, _ := this.GetInt64("modetype")
-
- januaryStart := this.GetString("januaryStart")
-
- januaryStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", januaryStart)
- januaryStartStrUnix := januaryStartStr.Unix()
-
- januaryEnd := this.GetString("januaryEnd")
-
- januaryEndStr := januaryEnd + " 23:59:59"
- januaryEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", januaryEndStr)
- januaryEndStrUnix := januaryEndStrs.Unix()
-
- febStart := this.GetString("febStart")
-
- febStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", febStart)
- febStartStrStrUnix := febStartStr.Unix()
-
- febEnd := this.GetString("febEnd")
-
- febEndStr := febEnd + " 23:59:59"
- febEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", febEndStr)
- febEndStrUnix := febEndStrs.Unix()
-
- marchStart := this.GetString("marchStart")
-
- marchStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", marchStart)
- marchStartStrUnix := marchStartStr.Unix()
-
- marchEnd := this.GetString("marchEnd")
-
- marchEndStr := marchEnd + " 23:59:59"
- marchEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", marchEndStr)
- marchEndStrUnix := marchEndStrs.Unix()
-
- aprStart := this.GetString("aprStart")
-
- aprStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", aprStart)
- aprStartStrUnix := aprStartStr.Unix()
-
- aprEnd := this.GetString("aprEnd")
-
- aprEndStr := aprEnd + " 23:59:59"
- aprEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", aprEndStr)
- aprEndStrsUnix := aprEndStrs.Unix()
-
- mayStart := this.GetString("mayStart")
-
- mayStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", mayStart)
- mayStartStrUnix := mayStartStr.Unix()
-
- mayEnd := this.GetString("mayEnd")
-
- mayEndStr := mayEnd + " 23:59:59"
- mayEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", mayEndStr)
- mayEndStrsUnix := mayEndStrs.Unix()
-
- junStart := this.GetString("junStart")
-
- junStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", junStart)
- junStartStrUnix := junStartStr.Unix()
-
- junEnd := this.GetString("junEnd")
-
- junEndStr := junEnd + " 23:59:59"
- junEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", junEndStr)
- junEndStrsUnix := junEndStrs.Unix()
-
- julStart := this.GetString("julStart")
-
- julStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", julStart)
- julStartStrUnix := julStartStr.Unix()
-
- julEnd := this.GetString("julEnd")
-
- julEndStr := julEnd + " 23:59:59"
- julEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", julEndStr)
- julEndStrsUnix := julEndStrs.Unix()
-
- augStart := this.GetString("augStart")
-
- augStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", augStart)
- augStartStrUnix := augStartStr.Unix()
-
- augEnd := this.GetString("augEnd")
-
- augEndStr := augEnd + " 23:59:59"
- augEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", augEndStr)
- augEndStrsUnix := augEndStrs.Unix()
-
- sepStart := this.GetString("sepStart")
-
- sepStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", sepStart)
- sepStartStrUnix := sepStartStr.Unix()
-
- sepEnd := this.GetString("sepEnd")
-
- sepEndStr := sepEnd + " 23:59:59"
- sepEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", sepEndStr)
- sepEndStrsUnix := sepEndStrs.Unix()
-
- octStart := this.GetString("octStart")
-
- octStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", octStart)
- octStartStrUnix := octStartStr.Unix()
-
- octEnd := this.GetString("octEnd")
-
- octEndStr := octEnd + " 23:59:59"
- octEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", octEndStr)
- octEndStrsUnix := octEndStrs.Unix()
-
- novStart := this.GetString("novStart")
-
- novStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", novStart)
- novStartStrUnix := novStartStr.Unix()
-
- novEnd := this.GetString("novEnd")
-
- novEndStr := novEnd + " 23:59:59"
- novEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", novEndStr)
- novEndStrsUnix := novEndStrs.Unix()
-
- decStart := this.GetString("decStart")
-
- decStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", decStart)
- decStartStrUnix := decStartStr.Unix()
- fmt.Println("12月使", decStartStrUnix)
- decEnd := this.GetString("decEnd")
-
- decEndStr := decEnd + " 23:59:59"
- decEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", decEndStr)
- decEndStrsUnix := decEndStrs.Unix()
-
- rangetype, _ := this.GetInt64("range_type")
-
- if rangetype == 1 {
- //统计总共
- monthlist, err := service.GetMonthProjectList(orgid, lapseto, modetype, januaryStartStrUnix, januaryEndStrUnix, febStartStrStrUnix, febEndStrUnix, marchStartStrUnix, marchEndStrUnix, aprStartStrUnix, aprEndStrsUnix, mayStartStrUnix, mayEndStrsUnix, junStartStrUnix, junEndStrsUnix, julStartStrUnix, julEndStrsUnix, augStartStrUnix, augEndStrsUnix, sepStartStrUnix, sepEndStrsUnix, octStartStrUnix, octEndStrsUnix, novStartStrUnix, novEndStrsUnix, decStartStrUnix, decEndStrsUnix)
- //统计不合格
- monthNolist, err := service.GetMonthProjectListTwo(orgid, lapseto, modetype, januaryStartStrUnix, januaryEndStrUnix, febStartStrStrUnix, febEndStrUnix, marchStartStrUnix, marchEndStrUnix, aprStartStrUnix, aprEndStrsUnix, mayStartStrUnix, mayEndStrsUnix, junStartStrUnix, junEndStrsUnix, julStartStrUnix, julEndStrsUnix, augStartStrUnix, augEndStrsUnix, sepStartStrUnix, sepEndStrsUnix, octStartStrUnix, octEndStrsUnix, novStartStrUnix, novEndStrsUnix, decStartStrUnix, decEndStrsUnix)
- fmt.Println("monthnolist", monthNolist)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
- "monthlist": monthlist,
- "monthNolist": monthNolist,
- })
- }
-
- if rangetype == 2 {
- monthlist, err := service.GetMonthProjectListOne(orgid, lapseto, modetype, januaryStartStrUnix, januaryEndStrUnix, febStartStrStrUnix, febEndStrUnix, marchStartStrUnix, marchEndStrUnix, aprStartStrUnix, aprEndStrsUnix, mayStartStrUnix, mayEndStrsUnix, junStartStrUnix, junEndStrsUnix, julStartStrUnix, julEndStrsUnix, augStartStrUnix, augEndStrsUnix, sepStartStrUnix, sepEndStrsUnix, octStartStrUnix, octEndStrsUnix, novStartStrUnix, novEndStrsUnix, decStartStrUnix, decEndStrsUnix)
- monthNolist, err := service.GetMonthProjectListThree(orgid, lapseto, modetype, januaryStartStrUnix, januaryEndStrUnix, febStartStrStrUnix, febEndStrUnix, marchStartStrUnix, marchEndStrUnix, aprStartStrUnix, aprEndStrsUnix, mayStartStrUnix, mayEndStrsUnix, junStartStrUnix, junEndStrsUnix, julStartStrUnix, julEndStrsUnix, augStartStrUnix, augEndStrsUnix, sepStartStrUnix, sepEndStrsUnix, octStartStrUnix, octEndStrsUnix, novStartStrUnix, novEndStrsUnix, decStartStrUnix, decEndStrsUnix)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
- "monthlist": monthlist,
- "monthNolist": monthNolist,
- })
- }
-
- }
-
- func (this *CommonApiController) GetPatientscontrol() {
-
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
-
- lapstor, _ := this.GetInt64("lapstor")
-
- startime := this.GetString("startime")
-
- startimeStr, _ := utils.ParseTimeStringToTime("2006-01-02", startime)
- startimeStrUnix := startimeStr.Unix()
-
- endtime := this.GetString("endtime")
- fmt.Println("结束时间", endtime)
- endtimeStr := endtime + " 23:59:59"
- endtimeStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endtimeStr)
- endtimeStrsUnix := endtimeStrs.Unix()
-
- page, _ := this.GetInt64("page")
-
- limit, _ := this.GetInt64("limit")
-
- patients, total, err := service.GetPatientsControl(orgid, lapstor, startimeStrUnix, endtimeStrsUnix, page, limit)
- control, err := service.GetLastPatientsControl(orgid, lapstor, startimeStrUnix, endtimeStrsUnix)
-
- infectiousControl, err := service.GetInfectiousControl(orgid, lapstor, startimeStrUnix, endtimeStrsUnix)
-
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
- "patients": patients,
- "total": total,
- "control": control,
- "infectiousControl": infectiousControl,
- })
- }
-
- func (this *CommonApiController) GetCartogramList() {
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- //fmt.Println("orgid", orgid)
- lapstor, _ := this.GetInt64("lapstor")
- fmt.Println("lapstor", lapstor)
- startime := this.GetString("startime")
- //fmt.Println("开始时间", startime)
- startimeStr, _ := utils.ParseTimeStringToTime("2006-01-02", startime)
- startimeStrUnix := startimeStr.Unix()
- //fmt.Println("时间搓", startimeStrUnix)
- endtime := this.GetString("endtime")
- //fmt.Println("结束时间", endtime)
- endtimeStr := endtime + " 23:59:59"
- endtimeStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endtimeStr)
- endtimeStrsUnix := endtimeStrs.Unix()
- //fmt.Println("结束时间搓", endtimeStrsUnix)
- //limit, _ := this.GetInt64("limit")
- //page, _ := this.GetInt64("page")
-
- //统计总共
- _, total, err := service.GetTotalPatientsControl(orgid, startimeStrUnix, endtimeStrsUnix)
- //fmt.Println("total=================", total)
- //统计rangetype= 1
- _, standtotal, err := service.GetStandControl(orgid, startimeStrUnix, endtimeStrsUnix)
- //fmt.Println(standtotal)
- _, standtotalOne, err := service.GetStandControlOne(orgid, startimeStrUnix, endtimeStrsUnix)
- //fmt.Println(standtotalOne)
- //cartogramlist, err := service.GetLastPatientsControl(orgid, lapstor, startimeStrUnix, endtimeStrsUnix)
- //infectiouscontrol, err := service.GetInfectiousPatientsControl(orgid, lapstor, startimeStrUnix, endtimeStrsUnix)
- //_, total, err := service.GetPatientsControl(orgid, lapstor, startimeStrUnix, endtimeStrsUnix, page, limit)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
- "total": total,
- "standtotal": standtotal,
- "standtotalOne": standtotalOne,
- })
- }
-
- func (this *CommonApiController) GetPatientContor() {
-
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- fmt.Println(orgid)
- lapstor, _ := this.GetInt64("lapstor")
- fmt.Println("lapstor", lapstor)
- patientid, _ := this.GetInt64("patientid")
- startime := this.GetString("startime")
-
- startimeStr, _ := utils.ParseTimeStringToTime("2006-01-02", startime)
- startimeStrUnix := startimeStr.Unix()
-
- endtime := this.GetString("endtime")
- //fmt.Println("结束时间", endtime)
- endtimeStr := endtime + " 23:59:59"
- endtimeStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endtimeStr)
- endtimeStrsUnix := endtimeStrs.Unix()
-
- patients, err := service.GetPatientNames(orgid, patientid)
- patientcontorDetail, err := service.GetLastPatientsControlTwo(orgid, patientid, startimeStrUnix, endtimeStrsUnix)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
- "patientcontorDetail": patientcontorDetail,
- "name": patients.Name,
- })
- }
-
- func (this *CommonApiController) GetQualityControl() {
-
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- fmt.Println(orgid)
- patientid, _ := this.GetInt64("patientid")
- startime, _ := this.GetInt64("startime")
- //fmt.Println("startime", startime)
- endtime, _ := this.GetInt64("endtime")
- //fmt.Println("endtime", endtime)
- itemid, _ := this.GetInt64("itemid")
- //fmt.Println("itemid", itemid)
- inspectdate, _ := this.GetInt64("inspectdate")
-
- list, err := service.GetQualityControlById(orgid, patientid, startime, endtime, itemid, inspectdate)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
-
- "list": list,
- })
- }
-
- func (this *CommonApiController) GetTreatlist() {
- adminuser := this.GetAdminUserInfo()
- orgId := adminuser.CurrentOrgId
- startime := this.GetString("start_time")
-
- endtime := this.GetString("end_time")
- startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
- fmt.Println("parseDateErr", parseDateErr)
- statime := startDate.Unix()
-
- endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
- entime := endDate.Unix()
-
- value, _ := this.GetInt64("value")
- fmt.Println("value", value)
-
- list, err := service.GetTreatList(orgId, statime, entime, value)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
-
- "list": list,
- })
- }
-
- func (this *CommonApiController) GetPatientComplianceDetail() {
- adminUser := this.GetAdminUserInfo()
- orgid := adminUser.CurrentOrgId
- fmt.Println(orgid)
- patientid, _ := this.GetInt64("patientid")
- startime, _ := this.GetInt64("startime")
- fmt.Println("startime", startime)
- endtime, _ := this.GetInt64("endtime")
- fmt.Println("endtime", endtime)
- itemid, _ := this.GetInt64("itemid")
- fmt.Println("itemid", itemid)
-
- list, err := service.GetPatientComplianceDetail(orgid, patientid, startime, endtime, itemid)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
-
- "list": list,
- })
- }
-
- func (this *CommonApiController) GetBloodPressureDetail() {
- id, _ := this.GetInt64("id")
- blooddetail, err := service.GetBloodPressureDetail(id)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
-
- "blooddetail": blooddetail,
- })
- }
-
- func (this *CommonApiController) UpdateBloodPrussre() {
- id, _ := this.GetInt64("id")
- fmt.Println("id", id)
- dataBody := make(map[string]interface{}, 0)
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
- fmt.Println("err", err)
- inspectionmajor := int64(dataBody["inspectionMajor"].(float64))
- fmt.Println("inspectionmajor", inspectionmajor)
- inspectionminor := int64(dataBody["inspectionMinor"].(float64))
- fmt.Println("inspectionminor", inspectionminor)
- largerange := dataBody["large_range"].(string)
- fmt.Println(largerange)
- minrange := dataBody["min_range"].(string)
- fmt.Print(minrange)
- sort := int64(dataBody["sort"].(float64))
- fmt.Print("sort", sort)
- standard := models.XtQualityControlStandard{
- InspectionMajor: inspectionmajor,
- InspectionMinor: inspectionminor,
- MinRange: minrange,
- Sort: sort,
- LargeRange: largerange,
- }
- err = service.UpdateBloodPressure(&standard, id)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
-
- "standard": standard,
- })
- }
-
- func (this *CommonApiController) GetBloodPressureList() {
- adminUser := this.GetAdminUserInfo()
- orgId := adminUser.CurrentOrgId
- bloodType, _ := this.GetInt64("bloodType")
- fmt.Println(bloodType)
- firstQuarterStart := this.GetString("first_quarter_start")
- firstQuarterStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", firstQuarterStart)
- firstQuarterStartUnix := firstQuarterStartStr.Unix()
- fmt.Println("第一季度", firstQuarterStartUnix)
- fisrtQuarterEnd := this.GetString("first_qurter_end")
- fisrtQuarterEndStr := fisrtQuarterEnd + " 23:59:59"
- fisrtQuarterEnds, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", fisrtQuarterEndStr)
- fisrtQuarterEndStrUnix := fisrtQuarterEnds.Unix()
- fmt.Println("fisrtQuarterEndStrUnix", fisrtQuarterEndStrUnix)
- secondeQuarterStart := this.GetString("second_qurter_start")
- secondeQuarterStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", secondeQuarterStart)
- secondeQuarterStartUnix := secondeQuarterStartStr.Unix()
- fmt.Println("secondeQuarterStartUnix", secondeQuarterStartUnix)
- secondQuarterEnd := this.GetString("second_qurter_end")
- secondQuarterEndStr := secondQuarterEnd + " 23:59:59"
- secondQuarterEnds, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", secondQuarterEndStr)
- secondQuarterEndStrUnix := secondQuarterEnds.Unix()
- fmt.Println("第二季度结束时间", secondQuarterEndStrUnix)
-
- threeQuarterStart := this.GetString("three_qurter_start")
- threeQuarterStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", threeQuarterStart)
- threeQuarterStartUnix := threeQuarterStartStr.Unix()
- fmt.Println("第三季度", threeQuarterStartUnix)
- threeQuarterEnd := this.GetString("three_qurter_end")
- threeQuarterEndStr := threeQuarterEnd + " 23:59:59"
- threeQuarterEnds, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", threeQuarterEndStr)
- threeQuarterEndStrUnix := threeQuarterEnds.Unix()
- fmt.Println("第三季度", threeQuarterEndStrUnix)
- fourQuarterStart := this.GetString("four_qurter_start")
- fourQuarterStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", fourQuarterStart)
- fourQuarterStartUnix := fourQuarterStartStr.Unix()
- fmt.Println("第四季度", fourQuarterStartUnix)
- fourQuarterEnd := this.GetString("four_qurter_end")
- fourQuarterEndStr := fourQuarterEnd + " 23:59:59"
- fourQuarterEnds, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", fourQuarterEndStr)
- fourQuarterEndStrUnix := fourQuarterEnds.Unix()
- fmt.Println("第四季度", fourQuarterEndStrUnix)
- if bloodType == -1 {
- //统计收缩压第一季度的总数
- firstList, firstTotal, err := service.GetSystolicBloodPressure(orgId, firstQuarterStartUnix, fisrtQuarterEndStrUnix)
- //统计收缩压第一季合格的总数
- //_, firstStandTotal, err := service.GetStandSystolicBloodPressure(orgId, firstQuarterStartUnix, fisrtQuarterEndStrUnix)
- //统计第二季收缩压总数
- secondelist, secondeTotal, err := service.GetSystolicBloodPressure(orgId, secondeQuarterStartUnix, secondQuarterEndStrUnix)
- //第二季度合格总数
- //_, secondeStandTotal, err := service.GetStandSystolicBloodPressure(orgId, secondeQuarterStartUnix, secondQuarterEndStrUnix)
- //统计第三季收缩压总数
- threelist, threeTotal, err := service.GetSystolicBloodPressure(orgId, threeQuarterStartUnix, threeQuarterEndStrUnix)
- //第三季度合格数
- //_, threeStandTotal, err := service.GetStandSystolicBloodPressure(orgId, threeQuarterStartUnix, threeQuarterEndStrUnix)
- //第四季度总数
- fourlist, fourTotal, err := service.GetSystolicBloodPressure(orgId, fourQuarterStartUnix, fourQuarterEndStrUnix)
- //第四季度合格总数
- //_, fourStandTotal, err := service.GetStandSystolicBloodPressure(orgId, fourQuarterStartUnix, fourQuarterEndStrUnix)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
- "firstTotal": firstTotal,
- "firstList": firstList,
- "secondelist": secondelist,
- "secondeTotal": secondeTotal,
- "threelist": threelist,
- "threeTotal": threeTotal,
- "fourTotal": fourTotal,
- "fourlist": fourlist,
- })
- }
-
- if bloodType == -2 {
- //统计舒张压第一季度的总数
- firstList, firstTotal, err := service.GetDiastolicBloodPressure(orgId, firstQuarterStartUnix, fisrtQuarterEndStrUnix)
- //_, firstStandTotal, err := service.GetDiastolicStandPressure(orgId, firstQuarterStartUnix, fisrtQuarterEndStrUnix)
- secondelist, secondeTotal, err := service.GetDiastolicBloodPressure(orgId, secondeQuarterStartUnix, secondQuarterEndStrUnix)
- //_, secondeStandTotal, err := service.GetDiastolicStandPressure(orgId, secondeQuarterStartUnix, secondQuarterEndStrUnix)
- threelist, threeTotal, err := service.GetDiastolicBloodPressure(orgId, threeQuarterStartUnix, threeQuarterEndStrUnix)
- //_, threeStandTotal, err := service.GetDiastolicStandPressure(orgId, threeQuarterStartUnix, threeQuarterEndStrUnix)
- fourlist, fourTotal, err := service.GetDiastolicBloodPressure(orgId, fourQuarterStartUnix, fourQuarterEndStrUnix)
- //_, fourStandTotal, err := service.GetDiastolicStandPressure(orgId, fourQuarterStartUnix, fourQuarterEndStrUnix)
-
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
- "firstTotal": firstTotal,
- "firstList": firstList,
- "secondelist": secondelist,
- "secondeTotal": secondeTotal,
- "threelist": threelist,
- "threeTotal": threeTotal,
- "fourTotal": fourTotal,
- "fourlist": fourlist,
- })
- }
- }
-
- func (this *CommonApiController) GetMonthBloodList() {
-
- bloodtype, _ := this.GetInt64("bloodType")
- fmt.Println(bloodtype)
- januaryStart := this.GetString("januaryStart")
-
- januaryStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", januaryStart)
- januaryStartStrUnix := januaryStartStr.Unix()
- fmt.Println(januaryStartStrUnix)
- januaryEnd := this.GetString("januaryEnd")
-
- januaryEndStr := januaryEnd + " 23:59:59"
- januaryEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", januaryEndStr)
- januaryEndStrUnix := januaryEndStrs.Unix()
- fmt.Println(januaryEndStrUnix)
- febStart := this.GetString("febStart")
-
- febStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", febStart)
- febStartStrStrUnix := febStartStr.Unix()
- fmt.Println(febStartStrStrUnix)
- febEnd := this.GetString("febEnd")
-
- febEndStr := febEnd + " 23:59:59"
- febEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", febEndStr)
- febEndStrUnix := febEndStrs.Unix()
- fmt.Println(febEndStrUnix)
- marchStart := this.GetString("marchStart")
-
- marchStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", marchStart)
- marchStartStrUnix := marchStartStr.Unix()
- fmt.Println(marchStartStrUnix)
- marchEnd := this.GetString("marchEnd")
-
- marchEndStr := marchEnd + " 23:59:59"
- marchEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", marchEndStr)
- marchEndStrUnix := marchEndStrs.Unix()
- fmt.Println(marchEndStrUnix)
- aprStart := this.GetString("aprStart")
-
- aprStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", aprStart)
- aprStartStrUnix := aprStartStr.Unix()
- fmt.Println(aprStartStrUnix)
- aprEnd := this.GetString("aprEnd")
-
- aprEndStr := aprEnd + " 23:59:59"
- aprEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", aprEndStr)
- aprEndStrsUnix := aprEndStrs.Unix()
- fmt.Println(aprEndStrsUnix)
- mayStart := this.GetString("mayStart")
-
- mayStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", mayStart)
- mayStartStrUnix := mayStartStr.Unix()
- fmt.Println(mayStartStrUnix)
- mayEnd := this.GetString("mayEnd")
-
- mayEndStr := mayEnd + " 23:59:59"
- mayEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", mayEndStr)
- mayEndStrsUnix := mayEndStrs.Unix()
- fmt.Println(mayEndStrsUnix)
- junStart := this.GetString("junStart")
-
- junStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", junStart)
- junStartStrUnix := junStartStr.Unix()
- fmt.Println(junStartStrUnix)
- junEnd := this.GetString("junEnd")
-
- junEndStr := junEnd + " 23:59:59"
- junEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", junEndStr)
- junEndStrsUnix := junEndStrs.Unix()
- fmt.Println(junEndStrsUnix)
- julStart := this.GetString("julStart")
-
- julStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", julStart)
- julStartStrUnix := julStartStr.Unix()
- fmt.Println(julStartStrUnix)
- julEnd := this.GetString("julEnd")
-
- julEndStr := julEnd + " 23:59:59"
- julEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", julEndStr)
- julEndStrsUnix := julEndStrs.Unix()
- fmt.Println(julEndStrsUnix)
- augStart := this.GetString("augStart")
-
- augStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", augStart)
- augStartStrUnix := augStartStr.Unix()
- fmt.Print(augStartStrUnix)
- augEnd := this.GetString("augEnd")
-
- augEndStr := augEnd + " 23:59:59"
- augEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", augEndStr)
- augEndStrsUnix := augEndStrs.Unix()
- fmt.Println(augEndStrsUnix)
- sepStart := this.GetString("sepStart")
-
- sepStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", sepStart)
- sepStartStrUnix := sepStartStr.Unix()
- fmt.Println(sepStartStrUnix)
- sepEnd := this.GetString("sepEnd")
-
- sepEndStr := sepEnd + " 23:59:59"
- sepEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", sepEndStr)
- sepEndStrsUnix := sepEndStrs.Unix()
- fmt.Println(sepEndStrsUnix)
- octStart := this.GetString("octStart")
-
- octStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", octStart)
- octStartStrUnix := octStartStr.Unix()
- fmt.Println(octStartStrUnix)
- octEnd := this.GetString("octEnd")
-
- octEndStr := octEnd + " 23:59:59"
- octEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", octEndStr)
- octEndStrsUnix := octEndStrs.Unix()
- fmt.Println(octEndStrsUnix)
- novStart := this.GetString("novStart")
-
- novStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", novStart)
- novStartStrUnix := novStartStr.Unix()
- fmt.Println(novStartStrUnix)
- novEnd := this.GetString("novEnd")
-
- novEndStr := novEnd + " 23:59:59"
- novEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", novEndStr)
- novEndStrsUnix := novEndStrs.Unix()
- fmt.Println(novEndStrsUnix)
- decStart := this.GetString("decStart")
-
- decStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", decStart)
- decStartStrUnix := decStartStr.Unix()
- fmt.Println("12月使", decStartStrUnix)
- decEnd := this.GetString("decEnd")
-
- decEndStr := decEnd + " 23:59:59"
- decEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", decEndStr)
- decEndStrsUnix := decEndStrs.Unix()
- fmt.Println(decEndStrsUnix)
-
- adminUser := this.GetAdminUserInfo()
- orgId := adminUser.CurrentOrgId
- //统计收缩压
- if bloodtype == -1 {
- //统计收缩压一月总数
- januarylist, januaryTotal, err := service.GetSystolicBloodPressure(orgId, januaryStartStrUnix, januaryEndStrUnix)
- //_, januaryStandTotal, err := service.GetStandSystolicBloodPressure(orgId, januaryStartStrUnix, januaryEndStrUnix)
-
- //二月
- feblist, febTotal, err := service.GetSystolicBloodPressure(orgId, febStartStrStrUnix, febEndStrUnix)
- //_, febStandTotal, err := service.GetStandSystolicBloodPressure(orgId, febStartStrStrUnix, febEndStrUnix)
-
- //三月
- marchlist, marchTotal, err := service.GetSystolicBloodPressure(orgId, marchStartStrUnix, marchEndStrUnix)
- //_, marchStandTotal, err := service.GetStandSystolicBloodPressure(orgId, marchStartStrUnix, marchEndStrUnix)
-
- //四月
- aprlist, aprTotal, err := service.GetSystolicBloodPressure(orgId, aprStartStrUnix, aprEndStrsUnix)
- //_, aprStandTotal, err := service.GetStandSystolicBloodPressure(orgId, aprStartStrUnix, aprEndStrsUnix)
-
- //五月
- maylist, mayTotal, err := service.GetSystolicBloodPressure(orgId, mayStartStrUnix, mayEndStrsUnix)
- //_, mayStandTotal, err := service.GetStandSystolicBloodPressure(orgId, mayStartStrUnix, mayEndStrsUnix)
-
- //六月
- junlist, junTotal, err := service.GetSystolicBloodPressure(orgId, junStartStrUnix, junEndStrsUnix)
- //_, junStandTotal, err := service.GetStandSystolicBloodPressure(orgId, junStartStrUnix, junEndStrsUnix)
- //7月
- jullist, julTotal, err := service.GetSystolicBloodPressure(orgId, julStartStrUnix, julEndStrsUnix)
- //_, julStandTotal, err := service.GetStandSystolicBloodPressure(orgId, julStartStrUnix, julEndStrsUnix)
-
- //8月
- auglist, augTotal, err := service.GetSystolicBloodPressure(orgId, augStartStrUnix, augEndStrsUnix)
- //_, augStandTotal, err := service.GetStandSystolicBloodPressure(orgId, augStartStrUnix, augEndStrsUnix)
-
- //9月
- seplist, sepTotal, err := service.GetSystolicBloodPressure(orgId, sepStartStrUnix, sepEndStrsUnix)
- //_, sepStandTotal, err := service.GetStandSystolicBloodPressure(orgId, sepStartStrUnix, sepEndStrsUnix)
- //10月
- octlist, octTotal, err := service.GetSystolicBloodPressure(orgId, octStartStrUnix, octEndStrsUnix)
- //_, octStandTotal, err := service.GetStandSystolicBloodPressure(orgId, octStartStrUnix, octEndStrsUnix)
- //11月
- novlist, novTotal, err := service.GetSystolicBloodPressure(orgId, novStartStrUnix, novEndStrsUnix)
- //_, novStandTotal, err := service.GetStandSystolicBloodPressure(orgId, novStartStrUnix, novEndStrsUnix)
- //12月
- declist, decTotal, err := service.GetSystolicBloodPressure(orgId, decStartStrUnix, decEndStrsUnix)
- //_, decStandTotal, err := service.GetStandSystolicBloodPressure(orgId, decStartStrUnix, decEndStrsUnix)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
- "januaryTotal": januaryTotal,
- "januarylist": januarylist,
- "febTotal": febTotal,
- "feblist": feblist,
- "marchTotal": marchTotal,
- "marchlist": marchlist,
- "aprTotal": aprTotal,
- "aprlist": aprlist,
- "mayTotal": mayTotal,
- "maylist": maylist,
- "junTotal": junTotal,
- "junlist": junlist,
- "julTotal": julTotal,
- "jullist": jullist,
- "augTotal": augTotal,
- "auglist": auglist,
- "sepTotal": sepTotal,
- "seplist": seplist,
- "octTotal": octTotal,
- "octlist": octlist,
- "novTotal": novTotal,
- "novlist": novlist,
- "decTotal": decTotal,
- "declist": declist,
- })
- }
-
- //统计舒张压
- if bloodtype == -2 {
- //统计收缩压一月总数
- januarylist, januaryTotal, err := service.GetDiastolicBloodPressure(orgId, januaryStartStrUnix, januaryEndStrUnix)
- //_, januaryStandTotal, err := service.GetDiastolicStandPressure(orgId, januaryStartStrUnix, januaryEndStrUnix)
-
- //二月
- feblist, febTotal, err := service.GetDiastolicBloodPressure(orgId, febStartStrStrUnix, febEndStrUnix)
- //_, febStandTotal, err := service.GetDiastolicStandPressure(orgId, febStartStrStrUnix, febEndStrUnix)
-
- //三月
- marchlist, marchTotal, err := service.GetDiastolicBloodPressure(orgId, marchStartStrUnix, marchEndStrUnix)
- //_, marchStandTotal, err := service.GetDiastolicStandPressure(orgId, marchStartStrUnix, marchEndStrUnix)
-
- //四月
- aprlist, aprTotal, err := service.GetDiastolicBloodPressure(orgId, aprStartStrUnix, aprEndStrsUnix)
- //_, aprStandTotal, err := service.GetDiastolicStandPressure(orgId, aprStartStrUnix, aprEndStrsUnix)
-
- //五月
- maylist, mayTotal, err := service.GetDiastolicBloodPressure(orgId, mayStartStrUnix, mayEndStrsUnix)
- //_, mayStandTotal, err := service.GetDiastolicStandPressure(orgId, mayStartStrUnix, mayEndStrsUnix)
-
- //六月
- junlist, junTotal, err := service.GetDiastolicBloodPressure(orgId, junStartStrUnix, junEndStrsUnix)
- //_, junStandTotal, err := service.GetDiastolicStandPressure(orgId, junStartStrUnix, junEndStrsUnix)
- //7月
- jullist, julTotal, err := service.GetDiastolicBloodPressure(orgId, julStartStrUnix, julEndStrsUnix)
- //_, julStandTotal, err := service.GetDiastolicStandPressure(orgId, julStartStrUnix, julEndStrsUnix)
-
- //8月
- auglist, augTotal, err := service.GetDiastolicBloodPressure(orgId, augStartStrUnix, augEndStrsUnix)
- //_, augStandTotal, err := service.GetDiastolicStandPressure(orgId, augStartStrUnix, augEndStrsUnix)
-
- //9月
- seplist, sepTotal, err := service.GetDiastolicBloodPressure(orgId, sepStartStrUnix, sepEndStrsUnix)
- //_, sepStandTotal, err := service.GetDiastolicStandPressure(orgId, sepStartStrUnix, sepEndStrsUnix)
- //10月
- octlist, octTotal, err := service.GetDiastolicBloodPressure(orgId, octStartStrUnix, octEndStrsUnix)
- //_, octStandTotal, err := service.GetDiastolicStandPressure(orgId, octStartStrUnix, octEndStrsUnix)
- //11月
- novlist, novTotal, err := service.GetDiastolicBloodPressure(orgId, novStartStrUnix, novEndStrsUnix)
- //_, novStandTotal, err := service.GetDiastolicStandPressure(orgId, novStartStrUnix, novEndStrsUnix)
- //12月
- declist, decTotal, err := service.GetDiastolicBloodPressure(orgId, decStartStrUnix, decEndStrsUnix)
- //_, decStandTotal, err := service.GetDiastolicStandPressure(orgId, decStartStrUnix, decEndStrsUnix)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
- "januaryTotal": januaryTotal,
- "januarylist": januarylist,
- "febTotal": febTotal,
- "feblist": feblist,
- "marchTotal": marchTotal,
- "marchlist": marchlist,
- "aprTotal": aprTotal,
- "aprlist": aprlist,
- "mayTotal": mayTotal,
- "maylist": maylist,
- "junTotal": junTotal,
- "junlist": junlist,
- "julTotal": julTotal,
- "jullist": jullist,
- "augTotal": augTotal,
- "auglist": auglist,
- "sepTotal": sepTotal,
- "seplist": seplist,
- "octTotal": octTotal,
- "octlist": octlist,
- "novTotal": novTotal,
- "novlist": novlist,
- "decTotal": decTotal,
- "declist": declist,
- })
- }
- }
-
- func (this *CommonApiController) GetIdsListTwo() {
- dataBody := make(map[string]interface{}, 0)
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
- fmt.Println(err)
- adminInfo := this.GetAdminUserInfo()
- orgId := adminInfo.CurrentOrgId
- patientid, _ := this.GetInt64("patientid")
- idlist := dataBody["ids"].([]interface{})
-
- var vlist []interface{}
- for _, contagion := range idlist {
- id := int64(contagion.(float64))
- list, _ := service.GetInspectionMoninList(id, orgId, patientid)
- vlist = append(vlist, list)
- }
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "vlist": vlist,
- })
-
- }
-
- func (this *CommonApiController) GetTreatModeList() {
-
- start_time, _ := this.GetInt64("start_time")
- end_time, _ := this.GetInt64("end_time")
- adminUserInfo := this.GetAdminUserInfo()
- orgId := adminUserInfo.CurrentOrgId
- list, err := service.GetTreatModeList(start_time, end_time, orgId)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "list": list,
- })
- }
-
- func (this *CommonApiController) GetCountModeId() {
-
- start_time, _ := this.GetInt64("start_time")
- end_time, _ := this.GetInt64("end_time")
- mode_id, _ := this.GetInt64("mode_id")
- adminUserInfo := this.GetAdminUserInfo()
- orgId := adminUserInfo.CurrentOrgId
- fmt.Println("start_time", start_time)
- fmt.Println("end_time", end_time)
- fmt.Println("mode_id", mode_id)
-
- modeCount, err := service.GetCountModeId(start_time, end_time, mode_id, orgId)
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "modeCount": modeCount,
- })
- }
-
- func (this *CommonApiController) GetRolloutCount() {
-
- start_time, _ := this.GetInt64("start_time")
- end_time, _ := this.GetInt64("end_time")
- lapsetotype, _ := this.GetInt64("lapsetotype")
- sourcetype, _ := this.GetInt64("sourcetype")
- adminUserInfo := this.GetAdminUserInfo()
- orgId := adminUserInfo.CurrentOrgId
-
- //统计当前机构转出的人数
- rollout, err := service.GetCountRollout(orgId, start_time, end_time, lapsetotype, sourcetype)
-
- if err != nil {
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
- return
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "rollout": rollout,
- })
- }
-
- func (this *CommonApiController) GetCheckExamine() {
- //check_type, _ := this.GetInt64("check_type")
- //start_time, _ := this.GetInt64("start_time")
- //end_time, _ := this.GetInt64("end_time")
- //total, _ := service.GetAllPatientCount(this.GetAdminUserInfo().CurrentOrgId)
- //xcg_total := service.GetCheckExaminePercent(start_time, end_time, this.GetAdminUserInfo().CurrentOrgId, 1) //血常规
- //xysh_total := service.GetCheckExaminePercent(start_time, end_time, this.GetAdminUserInfo().CurrentOrgId, 2) //血液生化
- //ipth_total := service.GetCheckExaminePercent(start_time, end_time, this.GetAdminUserInfo().CurrentOrgId, 3) //全段甲状旁腺激素
- //xqtdb_total := service.GetCheckExaminePercent(start_time, end_time, this.GetAdminUserInfo().CurrentOrgId, 4) //血清铁蛋白和转铁蛋白饱和度
- //xqqbdb_total := service.GetCheckExaminePercent(start_time, end_time, this.GetAdminUserInfo().CurrentOrgId, 5) //血清前白蛋白
- //cfydb_total := service.GetCheckExaminePercent(start_time, end_time, this.GetAdminUserInfo().CurrentOrgId, 6) //c反应蛋白
- //
- }
|