123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563 |
- package service
-
- import (
- "bytes"
- "encoding/json"
- "fmt"
- "gdyb/models"
- "github.com/jinzhu/gorm"
- "io/ioutil"
- "net/http"
- "net/url"
- "strings"
- "time"
- )
-
- func SavePatientMessageInfo() (string, string) {
-
- //input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputData["patType"] = "1" // 就诊凭证编号
- inputData["patIdNo"] = "440510199211080038" // 开始时间
- inputData["patName"] = "测试患者4 " // 人员姓名
-
- inputData["patMobile"] = "13535547902" // 人员姓名
- inputData["patSex"] = "M" // 人员姓名
- inputData["patMarriage"] = "1" // 人员姓名
- inputData["birthday"] = "1992-10-23" // 人员姓名
- inputData["patAddress"] = "11111" // 人员姓名
- inputData["thirdPartyID"] = "6936" // 人员姓名
- inputData["patAge"] = "30" // 人员姓名
- //input["req"] = inputData
-
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewReader(bytesData)
- var url string
- gdyb_url := "http://218.104.146.179:9091/esb/listener/savePatientMessageInfo"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("GET", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("code", "Xmrjyy")
-
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
-
- func SaveReg(reg models.Reg) (string, string) {
-
- //input := make(map[string]interface{})
- inputData := make(map[string]interface{})
-
- inputData["deptId"] = reg.DeptId
- inputData["clinicUnitId"] = ""
- inputData["healthCardNo"] = ""
- fmt.Println(reg.PatientId)
- inputData["patientId"] = reg.PatientId
- inputData["patientName"] = reg.PatientName
- inputData["idCardNo"] = reg.IdCardNo
- inputData["phone"] = ""
- inputData["doctorId"] = ""
- inputData["doctorLevelCode"] = ""
- inputData["regDate"] = reg.RegDate
-
- inputData["shiftCode"] = ""
- inputData["startTime"] = ""
- inputData["endTime"] = ""
-
- inputData["scheduleId"] = ""
- inputData["periodId"] = ""
-
- inputData["svObjectId"] = ""
- inputData["diseaseId"] = ""
- inputData["regFee"] = reg.RegFee
-
- inputData["treatFee"] = reg.TreatFee
- inputData["operatorId"] = reg.OperatorId
- inputData["remark"] = "血透"
-
- inputData["orderType"] = "0"
- inputData["clinicCode"] = ""
- inputData["infoSeq"] = ""
-
- //input["Request"] = inputData
-
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewReader(bytesData)
- var url string
- gdyb_url := "http://218.104.146.179:9091/esb/listener/saveReg"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("code", "Xmrjyy")
-
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
- func GetWaitPayDetail() (string, string) {
-
- //input := make(map[string]interface{})
- inputData := make(map[string]interface{})
-
- inputData["clinicSeq"] = "30445" // 就诊凭证编号
- inputData["prescriptionId"] = "" // 开始时间
- inputData["patientId"] = "701822660170096645" // 人员姓名
-
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewReader(bytesData)
- var url string
- gdyb_url := "http://218.104.146.179:9091/esb/listener/getWaitPayDetail"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("code", "Xmrjyy")
-
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
- func OpKeepAccounts(number string, cus []*models.NewCustomTwo) (string, string) {
-
- inputData := make(map[string]interface{})
- feedetail := make([]map[string]interface{}, 0)
- for _, item := range cus {
- feedetailInfo := make(map[string]interface{})
- feedetailInfo["itemCode"] = item.MedListCodg
- feedetailInfo["num"] = item.Cut
- feedetail = append(feedetail, feedetailInfo)
- }
- inputData["item"] = feedetail
- inputData["clinicSeq"] = number // 就诊凭证编号
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewReader(bytesData)
- var url string
- gdyb_url := "http://218.104.146.179:9091/esb/listener/opKeepAccounts"
- url = gdyb_url
-
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("code", "Xmrjyy")
-
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
- func OpCancelKeepAccounts(setl_id string, op_name string, op_code string) (string, string) {
- inputData := make(map[string]interface{})
- inputData["docId"] = setl_id
- inputData["operCode"] = "111"
- inputData["operName"] = "2222"
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewReader(bytesData)
- var url string
- gdyb_url := "http://218.104.146.179:9091/esb/listener/opCancelKeepAccounts"
- url = gdyb_url
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("code", "Xmrjyy")
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
-
- func UpdateHisPatientStatusten(his *models.VMHisPatient) {
- writeDb.Save(&his)
- }
-
- func GetUnSettleHisPrescriptionFive(org_id int64, patient_id int64, record_date int64, p_type int64) (prescription []models.HisPrescription, err error) {
- err = readDb.Model(&models.HisPrescription{}).
- Preload("VMHisPrescriptionInfo","status = 1").
- Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
- return db.Where("status = 1 AND user_org_id = ? and is_self_drug <> 1", org_id).Preload("BaseDrugLib", "status=1")
- }).
- Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
- return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject").Preload("GoodInfo", "status=1")
- }).
- Where("user_org_id = ? AND status = 1 AND record_date = ? AND patient_id = ? AND order_status <> 2 AND order_status <> 3 and order_status <> 5 AND p_type = ?", org_id, record_date, patient_id, p_type).
- Find(&prescription).Error
- return
- }
- func GetUnSettleHisPrescriptionFiveone(id int64) (prescription []models.HisPrescription, err error) {
- err = readDb.Model(&models.HisPrescription{}).
- Preload("VMHisPrescriptionInfo","status = 1").
- Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
- return db.Where("status = 1 and is_self_drug <> 1").Preload("BaseDrugLib", "status=1")
- }).
- Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
- return db.Where("status = 1").Preload("HisProject").Preload("GoodInfo", "status=1")
- }).
- Where("id = ?", id).
- Find(&prescription).Error
- return
- }
-
-
-
- func GetUnSettleMonthHisPrescription(org_id int64, patient_id int64, start_date int64, end_date int64) (prescription []models.HisPrescription, err error) {
- err = readDb.Model(&models.HisPrescription{}).
- Preload("VMHisPrescriptionInfo","status = 1").
- Preload("HisAdditionalCharge", func(db *gorm.DB) *gorm.DB {
- return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("XtHisAddtionConfig", "status=1")
- }).
- Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
- return db.Where("status = 1 AND user_org_id = ? and is_self_drug <> 1 ", org_id).Preload("BaseDrugLib", "status=1")
- }).
- Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
- return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject").Preload("GoodInfo", "status=1").Preload("XtHisProjectTeam", "status = 1")
- }).
- Where("user_org_id = ? AND status = 1 AND record_date >= ? AND record_date <= ? AND patient_id = ? AND order_status <> 2 AND order_status <> 5 AND p_type <> 1", org_id, start_date, end_date, patient_id).
- Find(&prescription).Error
- return
- }
-
- func GetHisOrderFour(patient_id string, infoSeq string, docId string) (order models.HisOrder, err error) {
- if len(docId) > 0 {
- err = readDb.Model(&models.HisOrder{}).Where("mdtrt_id = ? AND psn_no = ? AND setl_id = ? AND status = 1", infoSeq, patient_id, docId).First(&order).Error
- } else {
- err = readDb.Model(&models.HisOrder{}).Where("mdtrt_id = ? AND psn_no = ? AND status = 1 ", infoSeq, patient_id).First(&order).Error
- }
- return
- }
-
- func GetHisPatientForCoordinate(id_card_no string) (string, string) {
-
- //input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputData["idcard"] = id_card_no // 就诊凭证编号
-
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewReader(bytesData)
- var url string
- gdyb_url := "http://218.104.146.179:9091/esb/listener/getPatientType"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("GET", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("code", "Xmrjyy")
-
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
-
-
- //查询患者列表
- func GetNMGHisPatientForCoordinate(VAA01 int64,VAA07 int64,ACF01 int64,keyword string) (string, string) {
-
- //input := make(map[string]interface{})
- inputData := make(map[string]interface{})
-
- inputData["vaa01"] = VAA01 // 就诊凭证编号
- inputData["vaa07"] = VAA07 // 就诊凭证编号
- inputData["acf01"] = ACF01// 就诊凭证编号
- inputData["keyword"] = keyword // 就诊凭证编号
-
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewBuffer(bytesData)
- var url string
- gdyb_url := "http://192.168.100.199:8080/HO/HOClinical/v1/QueryPat"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIT0RTV1NlcnZlciIsImV4cCI6NzczNjI2NzE1ODUsIm5iZiI6MTY3NjI3MTI4NSwiaWF0IjoxNjc2MjcxNTg1LCJ1c2VyY29kZSI6IjEwMDAwMSIsInJvbGVzIjoicm9sZTEiLCJjdXN0b20xIjoidmFsdWUxIiwidXNlcm5hbWUiOiLlnZDmoIdIT-ezu-e7nyIsImx2dyI6IjMwMjQwMDAwIn0.s9upThmOj_t2ZqC5_s7UIXbIdphQ6b4XE-nqQaUs5RTTA8jr2UtMlYZkV4B1b0J1maReMnENaJ3hud5Tfw7eug")
- request.Header.Set("Accept", "*/*")
-
- fmt.Println(request)
- fmt.Println(request.Header)
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- defer resp.Body.Close()
- fmt.Println(resp)
- fmt.Println("resp.Status")
- fmt.Println(resp.Status)
- fmt.Println("resp.Body")
-
- fmt.Println(resp.Body)
-
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
-
-
-
- func GetDeptEmp() (string, string) {
-
- //input := make(map[string]interface{})
- inputData := make(map[string]interface{})
-
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewBuffer(bytesData)
- var url string
- gdyb_url := "http://192.168.100.199:8080/HO/HOClinical/v1/GetDeptEmp"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIT0RTV1NlcnZlciIsImV4cCI6NzczNjI2NzE1ODUsIm5iZiI6MTY3NjI3MTI4NSwiaWF0IjoxNjc2MjcxNTg1LCJ1c2VyY29kZSI6IjEwMDAwMSIsInJvbGVzIjoicm9sZTEiLCJjdXN0b20xIjoidmFsdWUxIiwidXNlcm5hbWUiOiLlnZDmoIdIT-ezu-e7nyIsImx2dyI6IjMwMjQwMDAwIn0.s9upThmOj_t2ZqC5_s7UIXbIdphQ6b4XE-nqQaUs5RTTA8jr2UtMlYZkV4B1b0J1maReMnENaJ3hud5Tfw7eug")
- request.Header.Set("Accept", "*/*")
-
- fmt.Println(request)
- fmt.Println(request.Header)
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- defer resp.Body.Close()
- fmt.Println(resp)
- fmt.Println("resp.Status")
- fmt.Println(resp.Status)
- fmt.Println("resp.Body")
-
- fmt.Println(resp.Body)
-
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
- func GetDrugInterval() (string, string) {
-
- //input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- //inputData["BCE41"] = ”“ // 就诊凭证编号
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewBuffer(bytesData)
- var url string
- gdyb_url := "http://192.168.100.199:8080/HO/HOClinical/v1/GetDrugInterval"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIT0RTV1NlcnZlciIsImV4cCI6NzczNjI2NzE1ODUsIm5iZiI6MTY3NjI3MTI4NSwiaWF0IjoxNjc2MjcxNTg1LCJ1c2VyY29kZSI6IjEwMDAwMSIsInJvbGVzIjoicm9sZTEiLCJjdXN0b20xIjoidmFsdWUxIiwidXNlcm5hbWUiOiLlnZDmoIdIT-ezu-e7nyIsImx2dyI6IjMwMjQwMDAwIn0.s9upThmOj_t2ZqC5_s7UIXbIdphQ6b4XE-nqQaUs5RTTA8jr2UtMlYZkV4B1b0J1maReMnENaJ3hud5Tfw7eug")
- request.Header.Set("Accept", "*/*")
-
- fmt.Println(request)
- fmt.Println(request.Header)
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- defer resp.Body.Close()
- fmt.Println(resp)
- fmt.Println("resp.Status")
- fmt.Println(resp.Status)
- fmt.Println("resp.Body")
-
- fmt.Println(resp.Body)
-
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
- func GetUsage() (string, string) {
-
- //input := make(map[string]interface{})
- inputData := make(map[string]interface{})
-
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewBuffer(bytesData)
- var url string
- gdyb_url := "http://192.168.100.199:8080/HO/HOClinical/v1/GetUsage"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIT0RTV1NlcnZlciIsImV4cCI6NzczNjI2NzE1ODUsIm5iZiI6MTY3NjI3MTI4NSwiaWF0IjoxNjc2MjcxNTg1LCJ1c2VyY29kZSI6IjEwMDAwMSIsInJvbGVzIjoicm9sZTEiLCJjdXN0b20xIjoidmFsdWUxIiwidXNlcm5hbWUiOiLlnZDmoIdIT-ezu-e7nyIsImx2dyI6IjMwMjQwMDAwIn0.s9upThmOj_t2ZqC5_s7UIXbIdphQ6b4XE-nqQaUs5RTTA8jr2UtMlYZkV4B1b0J1maReMnENaJ3hud5Tfw7eug")
- request.Header.Set("Accept", "*/*")
-
- fmt.Println(request)
- fmt.Println(request.Header)
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- defer resp.Body.Close()
- fmt.Println(resp)
- fmt.Println("resp.Status")
- fmt.Println(resp.Status)
- fmt.Println("resp.Body")
-
- fmt.Println(resp.Body)
-
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
- func GetDrugs() (string, string) {
-
- //input := make(map[string]interface{})
- inputData := make(map[string]interface{})
-
-
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewBuffer(bytesData)
- var url string
- gdyb_url := "http://192.168.100.199:8080/HO/HOClinical/v1/GetDrugs"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIT0RTV1NlcnZlciIsImV4cCI6NzczNjI2NzE1ODUsIm5iZiI6MTY3NjI3MTI4NSwiaWF0IjoxNjc2MjcxNTg1LCJ1c2VyY29kZSI6IjEwMDAwMSIsInJvbGVzIjoicm9sZTEiLCJjdXN0b20xIjoidmFsdWUxIiwidXNlcm5hbWUiOiLlnZDmoIdIT-ezu-e7nyIsImx2dyI6IjMwMjQwMDAwIn0.s9upThmOj_t2ZqC5_s7UIXbIdphQ6b4XE-nqQaUs5RTTA8jr2UtMlYZkV4B1b0J1maReMnENaJ3hud5Tfw7eug")
- request.Header.Set("Accept", "*/*")
-
- //fmt.Println(request)
- //fmt.Println(request.Header)
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- defer resp.Body.Close()
-
-
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- str := string(respBytes)
- return str, inputLog
-
- }
- func GetProject() (string, string) {
-
- //input := make(map[string]interface{})
- inputData := make(map[string]interface{})
-
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- //inputLog = string(bytesData)
-
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewBuffer(bytesData)
- var url string
- gdyb_url := "http://192.168.100.199:8080/HO/HOClinical/v1/GetProject"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIT0RTV1NlcnZlciIsImV4cCI6NzczNjI2NzE1ODUsIm5iZiI6MTY3NjI3MTI4NSwiaWF0IjoxNjc2MjcxNTg1LCJ1c2VyY29kZSI6IjEwMDAwMSIsInJvbGVzIjoicm9sZTEiLCJjdXN0b20xIjoidmFsdWUxIiwidXNlcm5hbWUiOiLlnZDmoIdIT-ezu-e7nyIsImx2dyI6IjMwMjQwMDAwIn0.s9upThmOj_t2ZqC5_s7UIXbIdphQ6b4XE-nqQaUs5RTTA8jr2UtMlYZkV4B1b0J1maReMnENaJ3hud5Tfw7eug")
- request.Header.Set("Accept", "*/*")
-
-
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- defer resp.Body.Close()
-
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- str := string(respBytes)
- return str, inputLog
-
- }
-
-
-
- //开医嘱版本1
- //func UploadNMGPrescriptionForCoordinate(info models.UploadInfo) (string, string) {
- //
- //
- // inputData := make(map[string]interface{})
- //
- //
- // presInfos := make([]map[string]interface{}, 0)
- //
- //
- // for _, item := range info.ChargeList {
- // inputDataPresInfo := make(map[string]interface{})
- // inputDataPresInfo["bbx01"] = item.Bbx01
- // inputDataPresInfo["vaf21"] = item.Vaf21
- // inputDataPresInfo["vaf22"] = item.Vaf22
- // inputDataPresInfo["vaf42"] = item.Vaf42
- // presInfos = append(presInfos, inputDataPresInfo)
- // }
- // inputData["vaa01"] = info.Vaa01 // 就诊凭证编号
- // inputData["vaa07"] = info.Vaa07 // 就诊凭证编号
- // inputData["acf01"] = info.Acf01 // 就诊凭证编号
- // inputData["vaa05"] = info.Vaa05 // 就诊凭证编号
- // inputData["bck01"] = info.Bck01 // 就诊凭证编号
- // inputData["bce01a"] = info.Bce01a // 就诊凭证编号
- // inputData["bck01a"] = info.Bck01a // 就诊凭证编号
- // inputData["vafReqList"] = presInfos // 就诊凭证编号
- // var inputLog string
- // bytesData, err := json.Marshal(inputData)
- // inputLog = string(bytesData)
- // fmt.Println(string(bytesData))
- // if err != nil {
- // fmt.Println(err.Error())
- // return err.Error(), ""
- // }
- // reader := bytes.NewReader(bytesData)
- // var url string
- // gdyb_url := "http://192.168.100.199:8080/HO/HOClinical/v1/VAF_New"
- //
- // //gdyb_url := "http://218.104.146.179:9091/esb/listener/sendPretreat"
- // url = gdyb_url
- //
- // //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- // request, err := http.NewRequest("POST", url, reader)
- // if err != nil {
- // fmt.Println(err.Error())
- // return err.Error(), ""
- // }
- //
- // request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- // request.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIT0RTV1NlcnZlciIsImV4cCI6NzczNjI2NzE1ODUsIm5iZiI6MTY3NjI3MTI4NSwiaWF0IjoxNjc2MjcxNTg1LCJ1c2VyY29kZSI6IjEwMDAwMSIsInJvbGVzIjoicm9sZTEiLCJjdXN0b20xIjoidmFsdWUxIiwidXNlcm5hbWUiOiLlnZDmoIdIT-ezu-e7nyIsImx2dyI6IjMwMjQwMDAwIn0.s9upThmOj_t2ZqC5_s7UIXbIdphQ6b4XE-nqQaUs5RTTA8jr2UtMlYZkV4B1b0J1maReMnENaJ3hud5Tfw7eug")
- // request.Header.Set("Accept", "*/*")
- // client := http.Client{}
- // resp, err := client.Do(request)
- // if err != nil {
- // fmt.Println(err.Error())
- // return err.Error(), ""
- // }
- // respBytes, err := ioutil.ReadAll(resp.Body)
- // if err != nil {
- // fmt.Println(err.Error())
- // return err.Error(), ""
- // }
- // fmt.Println(string(respBytes))
- // str := string(respBytes)
- // return str, inputLog
- //
- //}
-
- //开医嘱版本2
- func UploadNMGPrescriptionForCoordinatetwo(cmdid string, xml_date string) (string, string) {
-
-
- //inputData := make(map[string]interface{})
-
- //requestBody := fmt.Sprintf(`{"cmdid": "%s", "data": "%s"}`, cmdid, xml_date)
- //requestBody = url.QueryEscape(requestBody)
- //reader := bytes.NewReader(bytesData)
- var urls string
- gdyb_url := "http://192.168.100.199:8080/HO/HOClinical/v1/HODoctorAdvice"
-
- //gdyb_url := "http://218.104.146.179:9091/esb/listener/sendPretreat"
- urls = gdyb_url
-
- values := url.Values{}
- values.Set("cmdid", cmdid)
- values.Set("data", xml_date)
- dataStr := values.Encode()
- fmt.Println(xml_date)
- fmt.Println(dataStr)
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
-
- request, err := http.NewRequest("POST", urls, bytes.NewBufferString(string(dataStr)))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/x-www-form-urlencoded")
- request.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIT0RTV1NlcnZlciIsImV4cCI6NzczNjI2NzE1ODUsIm5iZiI6MTY3NjI3MTI4NSwiaWF0IjoxNjc2MjcxNTg1LCJ1c2VyY29kZSI6IjEwMDAwMSIsInJvbGVzIjoicm9sZTEiLCJjdXN0b20xIjoidmFsdWUxIiwidXNlcm5hbWUiOiLlnZDmoIdIT-ezu-e7nyIsImx2dyI6IjMwMjQwMDAwIn0.s9upThmOj_t2ZqC5_s7UIXbIdphQ6b4XE-nqQaUs5RTTA8jr2UtMlYZkV4B1b0J1maReMnENaJ3hud5Tfw7eug")
- request.Header.Set("Accept", "*/*")
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, dataStr
-
- }
-
- //查询医嘱
- func QueryNMGPrescriptionForCoordinate(ACF01 int64, vaf01List []string, cbm01 string) (string, string) {
-
- inputData := make(map[string]interface{})
-
-
- inputData["ACF01"] = ACF01 // 就诊凭证编号
- inputData["vaf01List"] = vaf01List // 就诊凭证编号
- inputData["cbm01"] = cbm01 // 就诊凭证编号
-
-
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewReader(bytesData)
- var url string
- gdyb_url := "http://192.168.100.199:8080/HO/HOClinical/v1/VAF_Query"
-
- //gdyb_url := "http://218.104.146.179:9091/esb/listener/sendPretreat"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIT0RTV1NlcnZlciIsImV4cCI6NzczNjI2NzE1ODUsIm5iZiI6MTY3NjI3MTI4NSwiaWF0IjoxNjc2MjcxNTg1LCJ1c2VyY29kZSI6IjEwMDAwMSIsInJvbGVzIjoicm9sZTEiLCJjdXN0b20xIjoidmFsdWUxIiwidXNlcm5hbWUiOiLlnZDmoIdIT-ezu-e7nyIsImx2dyI6IjMwMjQwMDAwIn0.s9upThmOj_t2ZqC5_s7UIXbIdphQ6b4XE-nqQaUs5RTTA8jr2UtMlYZkV4B1b0J1maReMnENaJ3hud5Tfw7eug")
- request.Header.Set("Accept", "*/*")
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
-
- //删除医嘱
- func CancleNMGPrescriptionForCoordinate(ACF01 int64, cbm01 string) (string, string) {
-
- inputData := make(map[string]interface{})
- //
- //if len(vaf01List) == 0{
- inputData["ACF01"] = ACF01 // 就诊凭证编号
- inputData["vaf01List"] = "" // 就诊凭证编号
- inputData["cbm01"] = cbm01 // 就诊凭证编号
-
- //}else{
- // inputData["ACF01"] = ACF01 // 就诊凭证编号
- // inputData["vaf01List"] = vaf01List // 就诊凭证编号
- // inputData["cbm01"] = cbm01 // 就诊凭证编号
- //}
-
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewReader(bytesData)
- var url string
- gdyb_url := "http://192.168.100.199:8080/HO/HOClinical/v1/VAF_Del"
-
- //gdyb_url := "http://218.104.146.179:9091/esb/listener/sendPretreat"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIT0RTV1NlcnZlciIsImV4cCI6NzczNjI2NzE1ODUsIm5iZiI6MTY3NjI3MTI4NSwiaWF0IjoxNjc2MjcxNTg1LCJ1c2VyY29kZSI6IjEwMDAwMSIsInJvbGVzIjoicm9sZTEiLCJjdXN0b20xIjoidmFsdWUxIiwidXNlcm5hbWUiOiLlnZDmoIdIT-ezu-e7nyIsImx2dyI6IjMwMjQwMDAwIn0.s9upThmOj_t2ZqC5_s7UIXbIdphQ6b4XE-nqQaUs5RTTA8jr2UtMlYZkV4B1b0J1maReMnENaJ3hud5Tfw7eug")
- request.Header.Set("Accept", "*/*")
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
-
-
- //删除医嘱版本2
- //func CancleNMGPrescriptionForCoordinatetwo(ACF01 int, cbm01 string,vaf01List []string) (string, string) {
- //
- // inputData := make(map[string]interface{})
- // //
- // //if len(vaf01List) == 0{
- // inputData["ACF01"] = ACF01 // 就诊凭证编号
- // inputData["vaf01List"] = "" // 就诊凭证编号
- // inputData["cbm01"] = cbm01 // 就诊凭证编号
- //
- // //}else{
- // // inputData["ACF01"] = ACF01 // 就诊凭证编号
- // // inputData["vaf01List"] = vaf01List // 就诊凭证编号
- // // inputData["cbm01"] = cbm01 // 就诊凭证编号
- // //}
- //
- // var inputLog string
- // bytesData, err := json.Marshal(inputData)
- // inputLog = string(bytesData)
- // fmt.Println(string(bytesData))
- // if err != nil {
- // fmt.Println(err.Error())
- // return err.Error(), ""
- // }
- // reader := bytes.NewReader(bytesData)
- // var url string
- // gdyb_url := "http://192.168.100.199:8080/HO/HOClinical/v1/VAF_Del"
- //
- // //gdyb_url := "http://218.104.146.179:9091/esb/listener/sendPretreat"
- // url = gdyb_url
- //
- // //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- // request, err := http.NewRequest("POST", url, reader)
- // if err != nil {
- // fmt.Println(err.Error())
- // return err.Error(), ""
- // }
- //
- // request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- // request.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIT0RTV1NlcnZlciIsImV4cCI6NzczNjI2NzE1ODUsIm5iZiI6MTY3NjI3MTI4NSwiaWF0IjoxNjc2MjcxNTg1LCJ1c2VyY29kZSI6IjEwMDAwMSIsInJvbGVzIjoicm9sZTEiLCJjdXN0b20xIjoidmFsdWUxIiwidXNlcm5hbWUiOiLlnZDmoIdIT-ezu-e7nyIsImx2dyI6IjMwMjQwMDAwIn0.s9upThmOj_t2ZqC5_s7UIXbIdphQ6b4XE-nqQaUs5RTTA8jr2UtMlYZkV4B1b0J1maReMnENaJ3hud5Tfw7eug")
- // request.Header.Set("Accept", "*/*")
- // client := http.Client{}
- // resp, err := client.Do(request)
- // if err != nil {
- // fmt.Println(err.Error())
- // return err.Error(), ""
- // }
- // respBytes, err := ioutil.ReadAll(resp.Body)
- // if err != nil {
- // fmt.Println(err.Error())
- // return err.Error(), ""
- // }
- // fmt.Println(string(respBytes))
- // str := string(respBytes)
- // return str, inputLog
- //
- //}
-
-
- func CancleNMGPrescriptionForCoordinatetwo(cmdid string, xml_date string) (string, string) {
-
-
- //inputData := make(map[string]interface{})
-
- //requestBody := fmt.Sprintf(`{"cmdid": "%s", "data": "%s"}`, cmdid, xml_date)
- //requestBody = url.QueryEscape(requestBody)
- //reader := bytes.NewReader(bytesData)
- var urls string
- gdyb_url := "http://192.168.100.199:8080/HO/HOClinical/v1/HODoctorAdvice"
-
- //gdyb_url := "http://218.104.146.179:9091/esb/listener/sendPretreat"
- urls = gdyb_url
-
- values := url.Values{}
- values.Set("cmdid", cmdid)
- values.Set("data", xml_date)
- dataStr := values.Encode()
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", urls, strings.NewReader(dataStr))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/x-www-form-urlencoded")
- request.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIT0RTV1NlcnZlciIsImV4cCI6NzczNjI2NzE1ODUsIm5iZiI6MTY3NjI3MTI4NSwiaWF0IjoxNjc2MjcxNTg1LCJ1c2VyY29kZSI6IjEwMDAwMSIsInJvbGVzIjoicm9sZTEiLCJjdXN0b20xIjoidmFsdWUxIiwidXNlcm5hbWUiOiLlnZDmoIdIT-ezu-e7nyIsImx2dyI6IjMwMjQwMDAwIn0.s9upThmOj_t2ZqC5_s7UIXbIdphQ6b4XE-nqQaUs5RTTA8jr2UtMlYZkV4B1b0J1maReMnENaJ3hud5Tfw7eug")
- request.Header.Set("Accept", "*/*")
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, dataStr
-
- }
-
-
- func Createzuobiao(zuobiao *models.HisZuobiaoAdvice){
- writeDb.Save(&zuobiao)
-
- }
-
- func Getzuobiao(user_org_id int64,patient_id int64,start_time int64,end_time int64, ids string,vaa01 string, vaa07 string)(zuobiao models.HisZuobiaoAdvice,err error){
- err = readDb.Model(&models.HisZuobiaoAdvice{}).Where("user_org_id = ? and patient_id = ? and start_time = ? and end_time = ? and status = 1 and cbm01 = ? and vaa01 = ? and vaa07 = ?",user_org_id,patient_id,start_time,end_time,ids,vaa01,vaa07).Last(&zuobiao).Error
- return
- }
-
-
- func Getzuobiaobyid(id int64)(zuobiao models.HisZuobiaoAdvice,err error){
- err = readDb.Model(&models.HisZuobiaoAdvice{}).Where("id = ?",id).Last(&zuobiao).Error
- return
- }
-
-
-
- //查询诊断
- func QueryNMGDiagnoseForCoordinate(ACF01 int64, vaa01 string, vaa07 string) (string, string) {
-
- inputData := make(map[string]interface{})
- inputData["ACF01"] = ACF01 // 就诊凭证编号
- inputData["vaa01"] = vaa01 // 就诊凭证编号
- inputData["vaa07"] = vaa07 // 就诊凭证编号
-
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewReader(bytesData)
- var url string
- gdyb_url := "http://192.168.100.199:8080/HO/HOClinical/v1/VAO_Query"
-
- //gdyb_url := "http://218.104.146.179:9091/esb/listener/sendPretreat"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIT0RTV1NlcnZlciIsImV4cCI6NzczNjI2NzE1ODUsIm5iZiI6MTY3NjI3MTI4NSwiaWF0IjoxNjc2MjcxNTg1LCJ1c2VyY29kZSI6IjEwMDAwMSIsInJvbGVzIjoicm9sZTEiLCJjdXN0b20xIjoidmFsdWUxIiwidXNlcm5hbWUiOiLlnZDmoIdIT-ezu-e7nyIsImx2dyI6IjMwMjQwMDAwIn0.s9upThmOj_t2ZqC5_s7UIXbIdphQ6b4XE-nqQaUs5RTTA8jr2UtMlYZkV4B1b0J1maReMnENaJ3hud5Tfw7eug")
- request.Header.Set("Accept", "*/*")
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
-
- //查询检验
- func QueryNMGChenckForCoordinate(ACF01 int64, vaa01 string, vaa07 string,bfc03s string) (string, string) {
-
- inputData := make(map[string]interface{})
- inputData["ACF01"] = ACF01 // 就诊凭证编号
- inputData["vaa01"] = vaa01 // 就诊凭证编号
- inputData["vaa07"] = vaa07 // 就诊凭证编号
- inputData["bfc03s"] = bfc03s // 就诊凭证编号
-
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewReader(bytesData)
- var url string
- gdyb_url := "http://192.168.100.199:8080/HO/HOClinical/v1/LAC_Query"
-
- //gdyb_url := "http://218.104.146.179:9091/esb/listener/sendPretreat"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIT0RTV1NlcnZlciIsImV4cCI6NzczNjI2NzE1ODUsIm5iZiI6MTY3NjI3MTI4NSwiaWF0IjoxNjc2MjcxNTg1LCJ1c2VyY29kZSI6IjEwMDAwMSIsInJvbGVzIjoicm9sZTEiLCJjdXN0b20xIjoidmFsdWUxIiwidXNlcm5hbWUiOiLlnZDmoIdIT-ezu-e7nyIsImx2dyI6IjMwMjQwMDAwIn0.s9upThmOj_t2ZqC5_s7UIXbIdphQ6b4XE-nqQaUs5RTTA8jr2UtMlYZkV4B1b0J1maReMnENaJ3hud5Tfw7eug")
- request.Header.Set("Accept", "*/*")
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
-
- //血库记账接口
- func NMGSettleForCoordinate(info models.UploadInfo) (string, string) {
- fmt.Println(info)
-
- inputData := make(map[string]interface{})
- inputData["acf01"] = info.Acf01 // 就诊凭证编号
- inputData["bce01"] = info.Bce01 // 就诊凭证编号
- inputData["bck01"] = info.Bck01 // 就诊凭证编号
- inputData["vaa07"] = info.Vaa07 // 就诊凭证编号
- inputData["chargeList"] = info.ChargeListtwo // 就诊凭证编号
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewReader(bytesData)
- var url string
- gdyb_url := "http://192.168.100.199:8080/HO/HOClinical/v1/VAI_New"
-
- //gdyb_url := "http://218.104.146.179:9091/esb/listener/sendPretreat"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIT0RTV1NlcnZlciIsImV4cCI6NzczNjI2NzE1ODUsIm5iZiI6MTY3NjI3MTI4NSwiaWF0IjoxNjc2MjcxNTg1LCJ1c2VyY29kZSI6IjEwMDAwMSIsInJvbGVzIjoicm9sZTEiLCJjdXN0b20xIjoidmFsdWUxIiwidXNlcm5hbWUiOiLlnZDmoIdIT-ezu-e7nyIsImx2dyI6IjMwMjQwMDAwIn0.s9upThmOj_t2ZqC5_s7UIXbIdphQ6b4XE-nqQaUs5RTTA8jr2UtMlYZkV4B1b0J1maReMnENaJ3hud5Tfw7eug")
- request.Header.Set("Accept", "*/*")
-
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
-
- //销账
- func NMGCancleSettleForCoordinate(ACF01 int64,VAI01 string ) (string, string) {
-
- inputData := make(map[string]interface{})
- inputData["ACF01"] = ACF01 // 就诊凭证编号
- inputData["VAI01"] = VAI01 // 就诊凭证编号
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewReader(bytesData)
- var url string
- gdyb_url := "http://192.168.100.199:8080/HO/HOClinical/v1/VAI_Del"
-
- //gdyb_url := "http://218.104.146.179:9091/esb/listener/sendPretreat"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- //request.Header.Set("code", "Xmrjyy")
- request.Header.Set("Authorization", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJIT0RTV1NlcnZlciIsImV4cCI6NzczNjI2NzE1ODUsIm5iZiI6MTY3NjI3MTI4NSwiaWF0IjoxNjc2MjcxNTg1LCJ1c2VyY29kZSI6IjEwMDAwMSIsInJvbGVzIjoicm9sZTEiLCJjdXN0b20xIjoidmFsdWUxIiwidXNlcm5hbWUiOiLlnZDmoIdIT-ezu-e7nyIsImx2dyI6IjMwMjQwMDAwIn0.s9upThmOj_t2ZqC5_s7UIXbIdphQ6b4XE-nqQaUs5RTTA8jr2UtMlYZkV4B1b0J1maReMnENaJ3hud5Tfw7eug")
- request.Header.Set("Accept", "*/*")
-
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
-
-
-
- func UploadPrescriptionForCoordinate(info models.UploadInfo) (string, string) {
-
- //input := make(map[string]interface{})
- inputData := make(map[string]interface{})
-
- diags := make([]map[string]interface{}, 0)
- //diags := make([]map[string]interface{}, 0)
-
- presInfos := make([]map[string]interface{}, 0)
-
- for _, item := range info.Diag {
- inputDataDiag := make(map[string]interface{})
- inputDataDiag["vao06"] = item.Vao06
- inputDataDiag["bak02"] = item.Bak02
- diags = append(diags, inputDataDiag)
- }
-
- for _, item := range info.PresInfo {
- inputDataPresInfo := make(map[string]interface{})
- inputDataPresInfo["cbm06"] = item.Cbm06
- inputDataPresInfo["cbm07"] = item.Cbm06
- inputDataPresInfo["cbmid"] = item.Cbmid
- presDetails := make([]map[string]interface{}, 0)
-
- for _, subItem := range item.PresDetail {
- inputDataPresDetail := make(map[string]interface{})
- inputDataPresDetail["vaf59"] = subItem.Vaf59
- Items := make([]map[string]interface{}, 0)
- for _, subSubItem := range subItem.Item {
- inputDataItem := make(map[string]interface{})
- inputDataItem["bbx01"] = subSubItem.Bbx01
- inputDataItem["bda01"] = subSubItem.Bda01
- inputDataItem["bby01"] = subSubItem.Bby01
- inputDataItem["bck01b"] = subSubItem.Bck01b
- inputDataItem["bck01d"] = subSubItem.Bck01d
- inputDataItem["bdi01"] = subSubItem.Bdi01
- inputDataItem["rownr"] = subSubItem.Rownr
- inputDataItem["vaf11"] = subSubItem.Vaf11
- inputDataItem["vaf14"] = subSubItem.Vaf14
- inputDataItem["vaf15"] = subSubItem.Vaf15
- inputDataItem["vaf17"] = subSubItem.Vaf17
- inputDataItem["vaf18"] = subSubItem.Vaf18
- inputDataItem["vaf19"] = subSubItem.Vaf19
- inputDataItem["vaf20"] = subSubItem.Vaf20
- inputDataItem["vaf21"] = subSubItem.Vaf21
- inputDataItem["vaf22"] = subSubItem.Vaf22
- inputDataItem["vaf32"] = subSubItem.Vaf32
- inputDataItem["vaf35"] = subSubItem.Vaf35
- inputDataItem["vaf36"] = subSubItem.Vaf36
- inputDataItem["vaf58"] = subSubItem.Vaf58
- inputDataItem["vaf61"] = subSubItem.Vaf61
- Items = append(Items, inputDataItem)
-
- }
- inputDataPresDetail["item"] = Items
- presDetails = append(presDetails, inputDataPresDetail)
- }
- inputDataPresInfo["presDetail"] = presDetails
- presInfos = append(presInfos, inputDataPresInfo)
- }
-
- inputData["vaa01"] = info.Vaa01 // 就诊凭证编号
- inputData["Fasong"] = info.Fasong // 就诊凭证编号
- inputData["vaa07"] = info.Vaa07 // 就诊凭证编号
- inputData["bck01c"] = info.Bck01c // 就诊凭证编号
- inputData["bce02a"] = "1001" // 就诊凭证编号
-
- inputData["diag"] = diags // 就诊凭证编号
- inputData["presInfo"] = presInfos // 就诊凭证编号
-
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewReader(bytesData)
- var url string
- gdyb_url := "http://218.104.146.179:9091/esb/listener/sendPretreat"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("code", "Xmrjyy")
-
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
-
- func UploadPrescriptionForCoordinateHospital(info models.UploadInfo) (string, string) {
-
- //input := make(map[string]interface{})
- inputData := make(map[string]interface{})
-
- diags := make([]map[string]interface{}, 0)
- //diags := make([]map[string]interface{}, 0)
-
- presInfos := make([]map[string]interface{}, 0)
-
- for _, item := range info.Diag {
- inputDataDiag := make(map[string]interface{})
- inputDataDiag["vao06"] = item.Vao06
- inputDataDiag["bak02"] = item.Bak02
- diags = append(diags, inputDataDiag)
- }
-
- for _, item := range info.PresInfo {
- inputDataPresInfo := make(map[string]interface{})
- inputDataPresInfo["cbm06"] = item.Cbm06
- inputDataPresInfo["cbm07"] = item.Cbm06
- inputDataPresInfo["cbmid"] = item.Cbmid
- presDetails := make([]map[string]interface{}, 0)
-
- for _, subItem := range item.PresDetail {
- inputDataPresDetail := make(map[string]interface{})
- inputDataPresDetail["vaf59"] = subItem.Vaf59
- Items := make([]map[string]interface{}, 0)
- for _, subSubItem := range subItem.Item {
- inputDataItem := make(map[string]interface{})
- inputDataItem["bbx01"] = subSubItem.Bbx01
- inputDataItem["bda01"] = subSubItem.Bda01
- inputDataItem["bby01"] = subSubItem.Bby01
- inputDataItem["bck01b"] = subSubItem.Bck01b
- inputDataItem["bck01d"] = subSubItem.Bck01d
- inputDataItem["bdi01"] = subSubItem.Bdi01
- inputDataItem["rownr"] = subSubItem.Rownr
- inputDataItem["vaf11"] = subSubItem.Vaf11
- inputDataItem["vaf14"] = subSubItem.Vaf14
- inputDataItem["vaf15"] = subSubItem.Vaf15
- inputDataItem["vaf17"] = subSubItem.Vaf17
- inputDataItem["vaf18"] = subSubItem.Vaf18
- inputDataItem["vaf19"] = subSubItem.Vaf19
- inputDataItem["vaf20"] = subSubItem.Vaf20
- inputDataItem["vaf21"] = subSubItem.Vaf21
- inputDataItem["vaf22"] = subSubItem.Vaf22
- inputDataItem["vaf32"] = subSubItem.Vaf32
- inputDataItem["vaf35"] = subSubItem.Vaf35
- inputDataItem["vaf36"] = subSubItem.Vaf36
- inputDataItem["vaf58"] = subSubItem.Vaf58
- inputDataItem["vaf61"] = subSubItem.Vaf61
- Items = append(Items, inputDataItem)
-
- }
- inputDataPresDetail["item"] = Items
- presDetails = append(presDetails, inputDataPresDetail)
- }
- inputDataPresInfo["presDetail"] = presDetails
- presInfos = append(presInfos, inputDataPresInfo)
- }
-
- inputData["vaa01"] = info.Vaa01 // 就诊凭证编号
- inputData["Fasong"] = info.Fasong // 就诊凭证编号
- inputData["vaa07"] = info.Vaa07 // 就诊凭证编号
- inputData["bck01c"] = info.Bck01c // 就诊凭证编号
- inputData["bce02a"] = "1001" // 就诊凭证编号
-
- inputData["diag"] = diags // 就诊凭证编号
- inputData["presInfo"] = presInfos // 就诊凭证编号
-
- var inputLog string
- bytesData, err := json.Marshal(inputData)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- reader := bytes.NewReader(bytesData)
- var url string
- gdyb_url := "http://218.104.146.179:9091/esb/listener/saveOrdInfoIp"
- url = gdyb_url
-
- //url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
- request, err := http.NewRequest("POST", url, reader)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
- request.Header.Set("code", "Xmrjyy")
-
- client := http.Client{}
- resp, err := client.Do(request)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- respBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- fmt.Println(string(respBytes))
- str := string(respBytes)
- return str, inputLog
-
- }
-
- func UpDatePrescriptionNumberForCoordinate(user_org_id int64, ids []int64, number string) (err error) {
- err = writeDb.Model(&models.HisPrescription{}).Where("user_org_id = ? AND status = 1 AND id in (?)", user_org_id, ids).Updates(map[string]interface{}{"batch_number": number, "mtime": time.Now().Unix(), "order_status": 6}).Error
- return
- }
-
- func FindPatientPrescriptionInfoTwo(org_id int64, patient_id int64, record_date int64, p_type int64) (info models.HisPrescriptionInfo, err error) {
- err = readDb.Model(&models.HisPrescriptionInfo{}).Where("user_org_id = ? AND status = 1 AND record_date = ? AND patient_id = ? AND p_type = ? ", org_id, record_date, patient_id, p_type).First(&info).Error
- return
-
- }
-
- func GetExecutionFrequencyByName(name string, org_id int64) (ef models.ExecutionFrequencyDic, err error) {
- err = readDb.Model(&models.ExecutionFrequencyDic{}).Where("org_id = ? AND name = ?", org_id, name).First(&ef).Error
- return
- }
- func UpdataHisPateintTwo(his *models.VMHisPatient) {
- writeDb.Save(&his)
- }
-
- func UpdataHisPateintThree(his *models.HisPatient) {
- writeDb.Save(&his)
- }
-
- func UpDateHisPrescriptionInfoNumbertwo(user_org_id int64, id int64, number string, record_time int64, his_patient_id int64) (err error) {
- err = writeDb.Model(&models.HisPrescriptionInfo{}).Where("user_org_id = ? AND status = 1 AND his_patient_id = ? AND record_date = ?", user_org_id, his_patient_id, record_time).Updates(map[string]interface{}{"batch_number": number, "prescription_status": 3, "mtime": time.Now().Unix()}).Error
-
- return
- }
-
- func UpdataOrderStatusThreef(number string, user_org_id int64) (err error) {
- err = writeDb.Model(&models.HisPrescription{}).Where("status = 1 AND batch_number = ? AND user_org_id = ?", number, user_org_id).Updates(map[string]interface{}{"order_status": 5, "mtime": time.Now().Unix()}).Error
- err = writeDb.Model(&models.HisPrescriptionInfo{}).Where("status = 1 AND batch_number = ? AND user_org_id = ?", number, user_org_id).Updates(map[string]interface{}{"prescription_status": 5, "mtime": time.Now().Unix()}).Error
- return
- }
-
- func UpdataOrderStatustwo(id int64, number string, user_org_id int64) (err error) {
- err = writeDb.Model(&models.HisOrder{}).Where("status = 1 AND id = ? AND user_org_id = ?", id, user_org_id).Updates(map[string]interface{}{"order_status": 3, "mtime": time.Now().Unix(), "status": 0}).Error
- //err = writeDb.Model(&models.HisPatient{}).Where("status = 1 AND number = ?", number).Updates(map[string]interface{}{"mtime": time.Now().Unix(), "status": 0}).Error
- err = writeDb.Model(&models.HisPrescription{}).Where("status = 1 AND batch_number = ? AND user_org_id = ?", number, user_org_id).Updates(map[string]interface{}{"order_status": 1, "mtime": time.Now().Unix()}).Error
- err = writeDb.Model(&models.HisPrescriptionInfo{}).Where("status = 1 AND batch_number = ? AND user_org_id = ?", number, user_org_id).Updates(map[string]interface{}{"prescription_status": 1, "mtime": time.Now().Unix()}).Error
- return
- }
-
- func GetHisPatientByIdThree(id int64) (models.HisPatient, error) {
- patient := models.HisPatient{}
- err := XTReadDB().Model(&patient).Where("id = ? and status = 1", id).First(&patient).Error
- return patient, err
- }
-
-
- func GetDrugwayDicByName(name string, org_id int64) (ef models.DrugwayDic, err error) {
- err = readDb.Model(&models.DrugwayDic{}).Where("org_id = ? AND name = ?", org_id, name).First(&ef).Error
- return
- }
-
-
- func GetResultRecord(date string) (record []models.CmResult, err error) {
- err = nmDataBase.Model(&models.CmResult{}).Where("inspect_date >= ?",date).Find(&record).Error
- return
- }
|