12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171 |
- 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)
- fmt.Println("major22222222222222222222222222222222222222", major)
- 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)
-
- //按排班
- scheduleCount, _ := service.GetScheduleModeIdCount(statime, entime, orgId, page, 1000)
-
- scheduleList, _ := service.GetDialysisScheduleList(statime, entime, page, limit, orgId)
- 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,
- "scheduleCount": scheduleCount,
- "scheduleList": scheduleList,
- })
- }
-
- 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)
- fmt.Println("countwowowowoowowowowoww", count)
- //统计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反应蛋白
- //
- }
|