1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122 |
- package service
-
- import (
-
- "encoding/json"
- "fmt"
- "gdyb/models"
- "gdyb/utils/csbhttp"
-
-
- "strconv"
- "time"
- )
-
-
- func Hnyb1101(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, id_card_type int64, card_sn string, certificates string, request_url string, access_key string, cainfo string, name string, mdtrt_cert_no string) (string, string) {
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
-
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "1101"
-
- if certificates == "3" {
- inputData["mdtrt_cert_type"] = "99"
- inputData["certno"] = certNo
- inputData["psn_cert_type"] = "99"
- inputData["mdtrt_cert_no"] = mdtrt_cert_no
-
- } else {
- if id_card_type == 1 {
- inputData["mdtrt_cert_type"] = "03"
- inputData["card_sn"] = card_sn
- inputData["certno"] = certNo
- inputData["psn_cert_type"] = "01"
- inputData["mdtrt_cert_no"] = mdtrt_cert_no
-
- } else if id_card_type == 2 {
- inputData["mdtrt_cert_type"] = "02"
- inputData["card_sn"] = ""
- inputData["certno"] = certNo
- inputData["psn_cert_type"] = "01"
- inputData["mdtrt_cert_no"] = certNo
-
- }
- }
-
- inputData["begntime"] = ""
- inputData["psn_name"] = name
- input["data"] = inputData
- inputMessage["input"] = input
-
- var inputLog string
- bytesData, _ := json.Marshal(inputMessage)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- request_url = request_url + "1101"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "1101"), inputLog
- }
-
-
- func Hnybyb1101A(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, id_card_type int64, card_sn string, certificates string, request_url string, access_key string, pBusiCardInfo string, id_card_no string, cainfo string) (string, string) {
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
-
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "1101"
-
- if certificates == "3" {
- inputData["mdtrt_cert_type"] = "99"
- inputData["certno"] = certNo
- inputData["psn_cert_type"] = "99"
-
- } else {
- if id_card_type == 1 {
- inputData["mdtrt_cert_type"] = "03"
- inputData["card_sn"] = card_sn
- inputData["certno"] = id_card_no
- inputData["psn_cert_type"] = "01"
-
- } else {
- inputData["mdtrt_cert_type"] = "02"
- inputData["card_sn"] = ""
- inputData["certno"] = certNo
- inputData["psn_cert_type"] = "01"
- }
- }
-
- inputData["mdtrt_cert_no"] = certNo + "|" + pBusiCardInfo
- inputData["begntime"] = ""
- inputData["psn_name"] = ""
- input["data"] = inputData
- inputMessage["input"] = input
-
- var inputLog string
- bytesData, _ := json.Marshal(inputMessage)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- request_url = request_url + "1101"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "1101"), inputLog
- }
-
- func Hnyb1101B(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, request_url string, access_key string, Token string, cainfo string, id_card_no string) (string, string) {
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
-
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "1101"
-
- inputData["mdtrt_cert_type"] = "04"
- inputData["card_sn"] = ""
- inputData["certno"] = ""
- inputData["psn_cert_type"] = "01"
-
- inputData["mdtrt_cert_no"] = id_card_no + "|" + Token
- inputData["begntime"] = ""
- inputData["psn_name"] = ""
- input["data"] = inputData
- inputMessage["input"] = input
-
- var inputLog string
- bytesData, _ := json.Marshal(inputMessage)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- request_url = request_url + "1101"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "1101"), inputLog
- }
-
- func Hnyb1101ForEleCert(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, request_url string, access_key string, Token string, cainfo string, id_card_no string, name string) (string, string) {
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
-
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "1101"
-
- inputData["mdtrt_cert_type"] = "01"
- inputData["card_sn"] = ""
- inputData["certno"] = id_card_no
- inputData["psn_cert_type"] = "01"
- inputData["mdtrt_cert_no"] = Token
- inputData["begntime"] = ""
- inputData["psn_name"] = name
- input["data"] = inputData
- inputMessage["input"] = input
-
- var inputLog string
- bytesData, _ := json.Marshal(inputMessage)
- inputLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- request_url = request_url + "1101"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "1101"), inputLog
- }
-
-
- func Hnyb2201(psnNo string, insutype string, certNo string, org_name string, opera string, ipt_otp_no string, dept string, fixmedins_code string, dept_code string, doctor_id string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, id_card_type int64, doctor_name string, request_url string, access_key string, verify_number string, cainfo string, card_sn string) (string, string) {
- fmt.Println(opera)
-
-
- timestamp := time.Now().Unix()
- tempTime := time.Unix(timestamp, 0)
- timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
-
-
- inputMessage := SetHnInputMessage(timestamp, org_name, opera, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "2201"
- inputData["psn_no"] = psnNo
- inputData["insutype"] = insutype
- inputData["begntime"] = timeFormatOne
-
- if id_card_type == 1 {
- inputData["mdtrt_cert_type"] = "03"
- inputData["card_sn"] = card_sn
- inputData["certno"] = certNo
- inputData["mdtrt_cert_no"] = verify_number
-
- } else if id_card_type == 3 {
- inputData["mdtrt_cert_type"] = "04"
- inputData["mdtrt_cert_no"] = verify_number
- } else if id_card_type == 4 {
- inputData["mdtrt_cert_type"] = "01"
- inputData["mdtrt_cert_no"] = verify_number
- } else {
- inputData["mdtrt_cert_type"] = "02"
- inputData["mdtrt_cert_no"] = verify_number
-
- }
-
- inputData["ipt_otp_no"] = ipt_otp_no
- inputData["atddr_no"] = doctor_id
- inputData["dr_name"] = doctor_name
- inputData["dept_code"] = dept_code
- inputData["dept_name"] = dept
- inputData["caty"] = "A03.06"
- inputData["exp_content"] = ""
-
- input["data"] = inputData
- inputMessage["input"] = input
-
- var requestLog string
- bytesData, err := json.Marshal(inputMessage)
- requestLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request_url = request_url + "2201"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "2201"), requestLog
-
- }
-
-
- func Hnyb2202(psnNo string, mdtrtId string, ipt_otp_no string, org_name string, doctor string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, fixmedins_code string, request_url string, access_key string, cainfo string) (string, string) {
-
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "2202"
- inputData["psn_no"] = psnNo
- inputData["mdtrt_id"] = mdtrtId
- inputData["ipt_otp_no"] = ipt_otp_no
-
- inputData["exp_content"] = ""
-
- input["data"] = inputData
- inputMessage["input"] = input
-
- var requestLog string
-
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- requestLog = string(bytesData)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request_url = request_url + "2202"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "2202"), requestLog
- }
-
-
- func Hnyb2203(psnNo string, mdtrtId string, doctor string, department string, org_name string, med_type string, doctor_id string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, sick_code string, sick_name string, dept string, config []*models.HisXtDiagnoseConfig, request_url string, access_key string, begin_time string, cainfo string) (string, string, int64) {
-
- timestamp := time.Now().Unix()
- tempTime := time.Unix(timestamp, 0)
- timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
-
- inputMessage := SetHnInputMessage(timestamp, org_name, dept, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- diseinfo := make([]map[string]interface{}, 0)
-
- if med_type == "1111" || med_type == "1112" {
- med_type = "11"
- }
-
- inputMessage["infno"] = "2203"
- inputData["mdtrt_id"] = mdtrtId
- inputData["psn_no"] = psnNo
- inputData["med_type"] = med_type
- inputData["begntime"] = begin_time
- inputData["main_cond_dscr"] = ""
- inputData["dise_codg"] = sick_code
- inputData["dise_name"] = sick_name
- inputData["birctrl_type"] = ""
- inputData["birctrl_matn_date"] = ""
-
- for index, item := range config {
- diseinfo_sun := make(map[string]interface{})
- diseinfo_sun["diag_type"] = "1"
- diseinfo_sun["diag_srt_no"] = index
- diseinfo_sun["diag_code"] = item.CountryCode
- diseinfo_sun["diag_name"] = item.ClassName
- diseinfo_sun["diag_dept"] = department
- diseinfo_sun["dise_dor_no"] = doctor_id
- diseinfo_sun["dise_dor_name"] = doctor
- diseinfo_sun["diag_time"] = timeFormatOne
- diseinfo_sun["vali_flag"] = "1"
- diseinfo = append(diseinfo, diseinfo_sun)
- }
-
- inputData["exp_content"] = ""
-
- input["diseinfo"] = diseinfo
- input["mdtrtinfo"] = inputData
- inputMessage["input"] = input
- var requestLog string
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- requestLog = string(bytesData)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), "", 0
- }
- request_url = request_url + "2203"
-
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "2203"), requestLog, timestamp
- }
-
-
- func Hnyb2203A(psnNo string, mdtrtId string, doctor string, department string, org_name string, med_type string, doctor_id string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, sick_code string, sick_name string, dept string, config []*models.HisXtDiagnoseConfig, request_url string, access_key string, cainfo string) (string, string) {
-
- timestamp := time.Now().Unix()
- tempTime := time.Unix(timestamp, 0)
- timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
-
-
- inputMessage := SetHnInputMessage(timestamp, org_name, dept, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- diseinfo := make([]map[string]interface{}, 0)
-
- if med_type == "1111" || med_type == "1112" {
- med_type = "11"
- }
-
- inputMessage["infno"] = "2203"
- inputData["mdtrt_id"] = mdtrtId
- inputData["psn_no"] = psnNo
- inputData["med_type"] = med_type
- inputData["begntime"] = timeFormatOne
-
- inputData["main_cond_dscr"] = ""
- inputData["dise_codg"] = sick_code
- inputData["dise_name"] = sick_name
- inputData["birctrl_type"] = ""
- inputData["birctrl_matn_date"] = ""
-
- inputData["matn_type"] = ""
- inputData["geso_val"] = ""
-
- for index, item := range config {
- diseinfo_sun := make(map[string]interface{})
- diseinfo_sun["diag_type"] = "1"
- diseinfo_sun["diag_srt_no"] = index
- diseinfo_sun["diag_code"] = item.CountryCode
- diseinfo_sun["diag_name"] = item.ClassName
- diseinfo_sun["diag_dept"] = department
- diseinfo_sun["dise_dor_no"] = doctor_id
- diseinfo_sun["dise_dor_name"] = doctor
- diseinfo_sun["diag_time"] = timeFormatOne
- diseinfo_sun["vali_flag"] = "1"
- diseinfo = append(diseinfo, diseinfo_sun)
- }
-
- input["diseinfo"] = diseinfo
- input["mdtrtinfo"] = inputData
- inputMessage["input"] = input
- var requestLog string
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- requestLog = string(bytesData)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- request_url = request_url + "2203"
-
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "2203"), requestLog
- }
-
-
- func Hnyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescription, chrg_bchno string, org_name string, doctor string, dept string, fixmedins_code string, dept_code string, doctor_id string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, balance_accounts_type string, diag_code string, request_url string, access_key string, new_doctor_name string, time_stamp_2203 string, cainfo string) (string, string) {
-
-
-
-
- timestamp2 := time.Now().Unix()
-
- tempTime := time.Unix(timestamp2, 0)
- timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
- var customs []*Custom
- for _, item := range hisPrescription {
-
-
- if item.Type == 1 {
- for _, subItem := range item.HisDoctorAdviceInfo {
- if len(subItem.BaseDrugLib.MedicalInsuranceNumber) > 0 {
-
-
- cus := &Custom{
- DetItemFeeSumamt: fmt.Sprintf("%.4f", subItem.Price*subItem.PrescribingNumber),
- Cut: fmt.Sprintf("%.4f", subItem.PrescribingNumber),
- FeedetlSn: subItem.FeedetlSn,
- Price: fmt.Sprintf("%.4f", subItem.Price),
- MedListCodg: subItem.BaseDrugLib.MedicalInsuranceNumber,
- HospApprFlag: subItem.HospApprFlag,
- DoctorNumber: doctor_id,
- DoctorName: new_doctor_name,
- ProvinceDrugMedListCodg: "",
- ProvinceGoodMedListCodg: "",
- FeeOcurTime: timeFormatOne,
- }
-
- if subItem.BaseDrugLib.DrugClassify == "2" {
- cus.ProvinceDrugMedListCodg = subItem.BaseDrugLib.ProvincesCode
- }
-
- customs = append(customs, cus)
- }
- }
- }
-
- if item.Type == 2 {
- for _, subItem := range item.HisPrescriptionProject {
-
-
- if subItem.Type == 2 {
- if len(subItem.HisProject.MedicalCode) > 0 {
- cnt, _ := strconv.ParseFloat(subItem.Count, 64)
- cus := &Custom{
- DetItemFeeSumamt: fmt.Sprintf("%.4f", subItem.Price*cnt),
- Cut: fmt.Sprintf("%.4f", cnt),
- FeedetlSn: subItem.FeedetlSn,
- Price: fmt.Sprintf("%.4f", float64(subItem.Price)),
- MedListCodg: subItem.HisProject.MedicalCode,
- DoctorNumber: doctor_id,
- DoctorName: new_doctor_name,
- HospApprFlag: -1,
- ProvinceDrugMedListCodg: "",
- ProvinceGoodMedListCodg: "",
- FeeOcurTime: timeFormatOne,
- }
- customs = append(customs, cus)
- }
-
- } else if subItem.Type == 3 {
- if len(subItem.GoodInfo.MedicalInsuranceNumber) > 0 {
- cnt, _ := strconv.ParseFloat(subItem.Count, 64)
-
- cus := &Custom{
- DetItemFeeSumamt: fmt.Sprintf("%.4f", subItem.Price*cnt),
- Cut: fmt.Sprintf("%.4f", cnt),
- FeedetlSn: subItem.FeedetlSn,
- Price: fmt.Sprintf("%.4f", float64(subItem.Price)),
- MedListCodg: subItem.GoodInfo.MedicalInsuranceNumber,
- HospApprFlag: -1,
- DoctorNumber: doctor_id,
- DoctorName: new_doctor_name,
- ProvinceDrugMedListCodg: "",
- ProvinceGoodMedListCodg: subItem.GoodInfo.ProvincesCode,
- FeeOcurTime: timeFormatOne,
- }
- customs = append(customs, cus)
- }
-
- }
-
- }
- }
-
- for _, subItem := range item.HisAdditionalCharge {
- if len(subItem.XtHisAddtionConfig.Code) > 0 {
- cus := &Custom{
- DetItemFeeSumamt: fmt.Sprintf("%.4f", subItem.Price*float64(subItem.Count)),
- Cut: fmt.Sprintf("%.4f", float64(subItem.Count)),
- FeedetlSn: subItem.FeedetlSn,
- Price: fmt.Sprintf("%.4f", float64(subItem.Price)),
- MedListCodg: subItem.XtHisAddtionConfig.Code,
- HospApprFlag: -1,
- DoctorNumber: doctor_id,
- DoctorName: new_doctor_name,
- }
- customs = append(customs, cus)
- }
- }
- }
-
-
- inputMessage := SetHnInputMessage(timestamp2, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
- input := make(map[string]interface{})
- feedetail := make([]map[string]interface{}, 0)
- inputMessage["infno"] = "2204"
-
-
- for _, item := range customs {
- feedetailInfo := make(map[string]interface{})
- subfeedetailInfo := make(map[string]interface{})
-
- feedetailInfo["feedetl_sn"] = item.FeedetlSn
- feedetailInfo["mdtrt_id"] = mdtrtId
- feedetailInfo["psn_no"] = psnNo
- feedetailInfo["chrg_bchno"] = chrg_bchno
- feedetailInfo["dise_codg"] = diag_code
- feedetailInfo["rxno"] = ""
- feedetailInfo["rx_circ_flag"] = "0"
- feedetailInfo["fee_ocur_time"] = item.FeeOcurTime
- feedetailInfo["med_list_codg"] = item.MedListCodg
- feedetailInfo["medins_list_codg"] = item.MedListCodg
- feedetailInfo["det_item_fee_sumamt"] = item.DetItemFeeSumamt
- feedetailInfo["cnt"] = item.Cut
- feedetailInfo["pric"] = item.Price
- feedetailInfo["sin_dos_dscr"] = ""
- feedetailInfo["used_frqu_dscr"] = ""
- feedetailInfo["prd_days"] = "0"
- feedetailInfo["medc_way_dscr"] = ""
- feedetailInfo["bilg_dept_codg"] = dept_code
- feedetailInfo["bilg_dept_name"] = dept
- feedetailInfo["bilg_dr_codg"] = item.DoctorNumber
- feedetailInfo["bilg_dr_name"] = item.DoctorName
- feedetailInfo["acord_dept_codg"] = ""
- feedetailInfo["acord_dept_name"] = ""
- feedetailInfo["orders_dr_code"] = ""
- feedetailInfo["orders_dr_name"] = ""
- if balance_accounts_type == "8" {
- feedetailInfo["hosp_appr_flag"] = "2"
- } else {
- if item.HospApprFlag != -1 {
- if item.HospApprFlag == 1 {
- feedetailInfo["hosp_appr_flag"] = "1"
- } else if item.HospApprFlag == 2 {
- feedetailInfo["hosp_appr_flag"] = "2"
- } else if item.HospApprFlag == 3 {
- feedetailInfo["hosp_appr_flag"] = "0"
- } else {
- feedetailInfo["hosp_appr_flag"] = "1"
- }
- } else {
- feedetailInfo["hosp_appr_flag"] = "1"
- }
-
- }
-
- feedetailInfo["tcmdrug_used_way"] = ""
- feedetailInfo["etip_flag"] = ""
- feedetailInfo["etip_hosp_code"] = ""
- feedetailInfo["dscg_tkdrug_flag"] = ""
- feedetailInfo["matn_fee_flag"] = ""
- subfeedetailInfo["tcmherb_prov_code"] = item.ProvinceDrugMedListCodg
- subfeedetailInfo["mcs_prov_code"] = item.ProvinceGoodMedListCodg
- feedetailInfo["exp_content"] = subfeedetailInfo
- feedetail = append(feedetail, feedetailInfo)
- }
-
- input["feedetail"] = feedetail
- inputMessage["input"] = input
- var requestLog string
- bytesData, err := json.Marshal(inputMessage)
- requestLog = string(bytesData)
- fmt.Println(string(bytesData))
-
- if err != nil {
- fmt.Println(err.Error())
- return "", ""
- }
-
- request_url = request_url + "2204"
-
- timestamp5 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp5, string(bytesData), "2204"), requestLog
- }
-
-
- func Hnyb2205(psnNo string, mdtrtId string, chrgBchno string, org_name string, doctor string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, fixmedins_code string, request_url string, access_key string, cainfo string) (string, string) {
-
- timestamp := time.Now().Unix()
-
-
- inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "2205"
-
- inputData["mdtrt_id"] = mdtrtId
- inputData["chrg_bchno"] = "0000"
-
- inputData["psn_no"] = psnNo
- inputData["exp_content"] = ""
-
- input["data"] = inputData
- inputMessage["input"] = input
-
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
-
- var requestLog string
- requestLog = string(bytesData)
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- request_url = request_url + "2205"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "2205"), requestLog
- }
-
-
- func Hnyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, med_type string, id_card_type int64, fulamt_ownpay_amt float64, overlmt_selfpay float64, preselfpay_amt float64, inscp_scp_amt float64, certificates int64, request_url string, access_key string, verify_number string, cainfo string, acct_used_flag string) (string, string) {
-
-
- timestamp := time.Now().Unix()
-
-
- inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "2206"
- inputData["psn_no"] = psnNo
- if certificates == 3 {
- inputData["mdtrt_cert_type"] = "99"
- inputData["mdtrt_cert_no"] = certNo
- } else {
- if id_card_type == 1 {
- inputData["mdtrt_cert_type"] = "03"
- inputData["mdtrt_cert_no"] = verify_number
- } else if id_card_type == 3 {
- inputData["mdtrt_cert_type"] = "04"
- inputData["mdtrt_cert_no"] = verify_number
- } else if id_card_type == 4 {
- inputData["mdtrt_cert_type"] = "01"
- inputData["mdtrt_cert_no"] = verify_number
- } else {
- inputData["mdtrt_cert_type"] = "02"
- inputData["mdtrt_cert_no"] = certNo
- }
- }
- if insuplc_admdvs == "421300" {
- if med_type == "11" || med_type == "1112" || med_type == "1111" {
- inputData["med_type"] = "110104"
- } else if med_type == "14" {
- inputData["med_type"] = "140110"
- }
- } else {
- inputData["med_type"] = med_type
- }
-
- inputData["medfee_sumamt"] = total
- inputData["psn_setlway"] = "01"
- inputData["mdtrt_id"] = mdtrtId
- inputData["chrg_bchno"] = chrgBchno
- inputData["acct_used_flag"] = acct_used_flag
- inputData["insutype"] = insutype
- inputData["invono"] = ""
- inputData["exp_content"] = ""
-
- input["data"] = inputData
- inputMessage["input"] = input
-
- var requestLog string
-
- bytesData, err := json.Marshal(inputMessage)
-
- requestLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- request_url = request_url + "2206"
-
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "2206"), requestLog
-
- }
-
-
- func Hnyb2206Two(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, med_type string, id_card_type int64, fulamt_ownpay_amt float64, overlmt_selfpay float64, preselfpay_amt float64, inscp_scp_amt float64, certificates int64, request_url string, access_key string, verify_number string, cainfo string, card_sn string, acct_used_flag string) (string, string) {
-
-
- timestamp := time.Now().Unix()
-
-
- inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "2206"
- inputData["psn_no"] = psnNo
- if certificates == 3 {
- inputData["mdtrt_cert_type"] = "99"
- inputData["mdtrt_cert_no"] = certNo
- } else {
- if id_card_type == 1 {
- inputData["mdtrt_cert_type"] = "03"
- inputData["card_sn"] = card_sn
- inputData["mdtrt_cert_no"] = verify_number
- } else if id_card_type == 3 {
- inputData["mdtrt_cert_type"] = "04"
- inputData["mdtrt_cert_no"] = verify_number
- } else if id_card_type == 4 {
- inputData["mdtrt_cert_type"] = "01"
- inputData["mdtrt_cert_no"] = verify_number
- } else {
- inputData["mdtrt_cert_type"] = "02"
- inputData["mdtrt_cert_no"] = certNo
- }
- }
- if insuplc_admdvs == "421300" {
- if med_type == "11" || med_type == "1112" || med_type == "1111" {
- inputData["med_type"] = "110104"
- } else if med_type == "14" {
- inputData["med_type"] = "140110"
- }
- } else {
- inputData["med_type"] = med_type
- }
-
- inputData["medfee_sumamt"] = total
- inputData["psn_setlway"] = "01"
- inputData["mdtrt_id"] = mdtrtId
- inputData["chrg_bchno"] = chrgBchno
- inputData["acct_used_flag"] = acct_used_flag
- inputData["insutype"] = insutype
- inputData["invono"] = ""
- inputData["exp_content"] = ""
-
- input["data"] = inputData
- inputMessage["input"] = input
-
- var requestLog string
-
- bytesData, err := json.Marshal(inputMessage)
-
- requestLog = string(bytesData)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- request_url = request_url + "2206"
-
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "2206"), requestLog
-
- }
-
-
- func Hnyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, med_type string, id_card_type int64, fulamt_ownpay_amt float64, overlmt_selfpay float64, preselfpay_amt float64, inscp_scp_amt float64, certificates int64, acct_used_flag string, request_url string, access_key string, verify_number string, cainfo string) (string, string) {
-
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "2207"
- inputData["psn_no"] = psnNo
-
- if id_card_type == 1 {
- inputData["mdtrt_cert_type"] = "03"
- inputData["mdtrt_cert_no"] = certNo + "|" + verify_number
- } else if id_card_type == 3 {
- inputData["mdtrt_cert_type"] = "04"
- inputData["mdtrt_cert_no"] = verify_number
- } else if id_card_type == 4 {
- inputData["mdtrt_cert_type"] = "01"
- inputData["mdtrt_cert_no"] = verify_number
- } else {
- inputData["mdtrt_cert_type"] = "02"
- inputData["mdtrt_cert_no"] = certNo
- }
-
- if med_type == "1111" || med_type == "1112" {
- med_type = "11"
- }
- if insuplc_admdvs == "421300" {
- if med_type == "11" {
- inputData["med_type"] = "110104"
- } else if med_type == "14" {
- inputData["med_type"] = "140101"
- }
- } else {
- inputData["med_type"] = med_type
- }
- inputData["medfee_sumamt"] = total
- inputData["psn_setlway"] = "01"
- inputData["mdtrt_id"] = mdtrtId
- inputData["chrg_bchno"] = chrgBchno
- inputData["acct_used_flag"] = acct_used_flag
- inputData["insutype"] = insutype
- inputData["invono"] = ""
-
- inputData["fulamt_ownpay_amt"] = fulamt_ownpay_amt
- inputData["overlmt_selfpay"] = overlmt_selfpay
- inputData["preselfpay_amt"] = preselfpay_amt
- inputData["inscp_scp_amt"] = inscp_scp_amt
- inputData["exp_content"] = ""
-
- input["data"] = inputData
- inputMessage["input"] = input
-
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- request_url = request_url + "2207"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "2207"), string(bytesData)
-
- }
-
-
- func Hnyb2207Two(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, med_type string, id_card_type int64, fulamt_ownpay_amt float64, overlmt_selfpay float64, preselfpay_amt float64, inscp_scp_amt float64, certificates int64, acct_used_flag string, request_url string, access_key string, verify_number string, cainfo string, card_sn string) (string, string) {
-
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "2207"
- inputData["psn_no"] = psnNo
-
- if id_card_type == 1 {
- inputData["mdtrt_cert_type"] = "03"
- inputData["card_sn"] = card_sn
- inputData["mdtrt_cert_no"] = verify_number
-
- } else if id_card_type == 3 {
- inputData["mdtrt_cert_type"] = "04"
- inputData["mdtrt_cert_no"] = verify_number
- } else if id_card_type == 4 {
- inputData["mdtrt_cert_type"] = "01"
- inputData["mdtrt_cert_no"] = verify_number
- } else {
- inputData["mdtrt_cert_type"] = "02"
- inputData["mdtrt_cert_no"] = certNo
- }
-
- if med_type == "1111" || med_type == "1112" {
- med_type = "11"
- }
- if insuplc_admdvs == "421300" {
- if med_type == "11" {
- inputData["med_type"] = "110104"
- } else if med_type == "14" {
- inputData["med_type"] = "140101"
- }
- } else {
- inputData["med_type"] = med_type
- }
- inputData["medfee_sumamt"] = total
- inputData["psn_setlway"] = "01"
- inputData["mdtrt_id"] = mdtrtId
- inputData["chrg_bchno"] = chrgBchno
- inputData["acct_used_flag"] = acct_used_flag
- inputData["insutype"] = insutype
- inputData["invono"] = ""
-
- inputData["fulamt_ownpay_amt"] = fulamt_ownpay_amt
- inputData["overlmt_selfpay"] = overlmt_selfpay
- inputData["preselfpay_amt"] = preselfpay_amt
- inputData["inscp_scp_amt"] = inscp_scp_amt
- inputData["exp_content"] = ""
-
- input["data"] = inputData
- inputMessage["input"] = input
-
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- request_url = request_url + "2207"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "2207"), string(bytesData)
-
- }
-
- func Hnyb2207A(psnNo string, mdtrtId string, chrgBchno string, certNo string, insutype string, total string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, med_type string, id_card_type int64, fulamt_ownpay_amt float64, overlmt_selfpay float64, preselfpay_amt float64, inscp_scp_amt float64, certificates int64, acct_used_flag string, request_url string, access_key string, cainfo string) (string, string) {
-
- timestamp := time.Now().Unix()
-
-
- inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "2207A"
- inputData["psn_no"] = psnNo
- if certificates == 3 {
- inputData["mdtrt_cert_type"] = "99"
- inputData["mdtrt_cert_no"] = certNo
- } else {
- if id_card_type == 1 {
- inputData["mdtrt_cert_type"] = "03"
- inputData["mdtrt_cert_no"] = certNo
- } else {
- inputData["mdtrt_cert_type"] = "02"
- inputData["mdtrt_cert_no"] = certNo
- }
- }
- if med_type == "1111" || med_type == "1112" {
- med_type = "11"
- }
- if insuplc_admdvs == "421300" {
- if med_type == "11" {
- inputData["med_type"] = "110104"
- } else if med_type == "14" {
- inputData["med_type"] = "140101"
- }
- } else {
- inputData["med_type"] = med_type
- }
- inputData["medfee_sumamt"] = total
- inputData["psn_setlway"] = "01"
- inputData["mdtrt_id"] = mdtrtId
- inputData["chrg_bchno"] = chrgBchno
- inputData["acct_used_flag"] = acct_used_flag
- inputData["insutype"] = insutype
- inputData["invono"] = ""
-
- inputData["fulamt_ownpay_amt"] = fulamt_ownpay_amt
- inputData["overlmt_selfpay"] = overlmt_selfpay
- inputData["preselfpay_amt"] = preselfpay_amt
- inputData["inscp_scp_amt"] = inscp_scp_amt
-
- input["data"] = inputData
- inputMessage["input"] = input
-
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- request_url = request_url + "2207A"
-
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "2207A"), string(bytesData)
-
- }
-
-
- func Hnyb2208(psnNo string, mdtrtId string, setlId string, org_name string, doctor string, secret_key string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, cainfo string) (string, string) {
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "2208"
-
- inputData["psn_no"] = psnNo
- inputData["mdtrt_id"] = mdtrtId
- inputData["setl_id"] = setlId
- inputData["exp_content"] = ""
-
- input["data"] = inputData
- inputMessage["input"] = input
-
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- request_url = request_url + "2208"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "2208"), string(bytesData)
-
- }
-
- func Hnyb5203(baseParams models.BaseParams, businessParams models.BusinessParams) (string, string) {
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, baseParams.OrgName, baseParams.Doctor, baseParams.FixmedinsCode, baseParams.InsuplcAdmdvs, baseParams.MdtrtareaAdmvs, baseParams.Cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "5203"
- inputData["psn_no"] = businessParams.PsnNo
- inputData["setl_id"] = businessParams.SetlId
- inputData["mdtrt_id"] = businessParams.MdtrtId
- input["data"] = inputData
- inputMessage["input"] = input
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- baseParams.RequestUrl = baseParams.RequestUrl + "5203"
-
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(baseParams.RequestUrl, baseParams.AccessKey, baseParams.SecretKey, timestamp2, string(bytesData), "5203"), string(bytesData)
- }
-
-
- func HNHttpRequest(url string, ak string, sk string, timestamp int64, json string, infno string) string {
- fmt.Println(url)
-
- csbHP := csbhttp.NewHttpParams(url)
-
- csbHP.SetMethod("post")
-
- csbHP.SetApi(infno)
- csbHP.SetVersion("1.0.0")
-
-
-
- csbHP.AddHeader("_api_timestamp", strconv.FormatInt(timestamp, 10))
- csbHP.AddHeader("_api_name", infno)
- csbHP.AddHeader("_api_version", "1.0.0")
- csbHP.AddHeader("_api_access_key", ak)
- csbHP.AddHeader("Content-Type", "application/json;charset=UTF-8")
-
-
-
-
-
- csbHP.SetContentBody(json, nil)
-
- csbHP.SetAK(ak)
- csbHP.SetSK(sk)
-
- csbHP.Print()
-
-
- res, _, err := csbhttp.Invoke(*csbHP, strconv.FormatInt(timestamp, 10))
- fmt.Println("err:")
- fmt.Println(err)
-
-
- if err != nil {
- fmt.Println(err)
- return ""
- }
- fmt.Println(res)
- return res
- }
-
-
- func SetHnInputMessage(timestamp int64, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, cainfo string) map[string]interface{} {
-
- tempTime := time.Unix(timestamp, 0)
-
- timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
-
-
- month := time.Unix(1557042972, 0).Format("1")
- year := time.Now().Format("2006")
- month = time.Now().Format("01")
- day := time.Now().Format("02")
-
- hour := time.Now().Format("15")
- min := time.Now().Format("04")
- sec := time.Now().Format("05")
-
- msec := time.Now().Format("000")
-
-
- inputMessage := make(map[string]interface{})
- inputMessage["msgid"] = fixmedins_code + year + month + day + hour + min + sec + msec + "0"
- inputMessage["mdtrtarea_admvs"] = mdtrtarea_admvs
- inputMessage["insuplc_admdvs"] = insuplc_admdvs
- inputMessage["recer_sys_code"] = "1"
- inputMessage["dev_no"] = "1"
- inputMessage["dev_safe_info"] = "1"
- inputMessage["cainfo"] = cainfo
- inputMessage["signtype"] = "SM3"
- inputMessage["infver"] = "V1.0"
- inputMessage["opter_type"] = "1"
- inputMessage["opter"] = doctor
- inputMessage["opter_name"] = doctor
- inputMessage["inf_time"] = timeFormatOne
- inputMessage["fixmedins_code"] = fixmedins_code
- inputMessage["fixmedins_name"] = org_name
- inputMessage["fixmedins_soft_fcty"] = "深圳市领透科技有限公司"
-
- inputMessage["sign_no"] = ""
- return inputMessage
- }
-
- func Hnyb5301(psnNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, request_url string, access_key string, cainfo string) (string, string) {
-
-
- timestamp := time.Now().Unix()
-
-
-
-
-
-
-
- inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "5301"
- inputData["psn_no"] = psnNo
- input["data"] = inputData
- inputMessage["input"] = input
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
- request_url = request_url + "5301"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "5301"), string(bytesData)
-
- }
-
- func Hnyb2503(psnNo string, insutype string, org_name string, doctor string, fixmedins_code string, doctor_id string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, sick_name string, sick_code string, start_time string, end_time string, check_time string, request_url string, access_key string, cainfo string) (string, string) {
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "2503"
- inputData["psn_no"] = psnNo
- inputData["insutype"] = insutype
- inputData["opsp_dise_code"] = sick_code
- inputData["opsp_dise_name"] = sick_name
- inputData["insu_optins"] = insuplc_admdvs
- inputData["ide_fixmedins_no"] = fixmedins_code
- inputData["ide_fixmedins_name"] = org_name
- inputData["hosp_ide_date"] = check_time
- inputData["diag_dr_codg"] = doctor_id
- inputData["diag_dr_name"] = doctor
- inputData["begndate"] = start_time
- inputData["tel"] = ""
- inputData["addr"] = ""
- inputData["enddate"] = end_time
-
- input["data"] = inputData
- inputMessage["input"] = input
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- request_url = request_url + "2503"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "2503"), string(bytesData)
- }
-
- func Hnyb3201(fixmedins_setl_cnt int64, acct_pay float64, fund_pay_sumamt float64, medfee_sumamt float64, stmt_begndate string, stmt_enddate string, setl_optins string, clr_type string, insutype string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, request_url string, access_key string, secret_key string, cainfo string) (string, string) {
-
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "3201"
- inputData["insutype"] = insutype
- inputData["clr_type"] = clr_type
- inputData["setl_optins"] = setl_optins
- inputData["stmt_begndate"] = stmt_begndate
- inputData["stmt_enddate"] = stmt_enddate
- inputData["medfee_sumamt"] = fmt.Sprintf("%.2f", medfee_sumamt)
- inputData["fund_pay_sumamt"] = fmt.Sprintf("%.2f", fund_pay_sumamt)
- inputData["acct_pay"] = fmt.Sprintf("%.2f", acct_pay)
- inputData["fixmedins_setl_cnt"] = fixmedins_setl_cnt
- inputData["refd_setl_flag"] = 0
-
- input["data"] = inputData
- inputMessage["input"] = input
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- request_url = request_url + "3201"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "3201"), string(bytesData)
- }
-
- func Hnyb9001(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, admin_user_id int64, request_url string, cainfo string, access_key string) (string, string) {
-
-
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "9001"
- inputData["opter_no"] = admin_user_id
- inputData["mac"] = GetMacTwo()
- inputData["ip"] = GetLocalIpTwo()
- input["signIn"] = inputData
-
- inputMessage["input"] = input
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- request_url = request_url + "9001"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "9001"), string(bytesData)
-
- }
-
- func Hnyb3101(pd models.PatientDtos, fed models.FsiEncounterDtos, fdds []*models.FsiDiagnoseDtos, fods []*models.FsiOrderDtos, fopds []*models.FsiOperationDtosData, params models.PublicParams, trig_scen string) (string, string) {
-
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, params.FixmedinsName, params.OpterName, params.FixmedinsCode, params.InsuplcAdmdvs, params.MdtrtareaAdmvs, params.Cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- patientDtosinputData := make(map[string]interface{})
- fisEncounterDtosData := make(map[string]interface{})
- fsiDiagnoseDtosDatas := make([]map[string]interface{}, 0)
-
- fsiOrderDtosDatas := make([]map[string]interface{}, 0)
-
- fsiOperationDtosData := make(map[string]interface{})
- fsiOperationDtosDatas := make([]map[string]interface{}, 0)
-
-
- fisEncounterDtosData["mdtrt_id"] = fed.MdtrtID
- fisEncounterDtosData["medins_id"] = fed.MedinsID
- fisEncounterDtosData["medins_name"] = fed.MedinsName
- fisEncounterDtosData["medins_admdvs"] = fed.MedinsAdmdvs
- fisEncounterDtosData["medins_type"] = fed.MedinsType
- fisEncounterDtosData["medins_lv"] = fed.MedinsLv
- fisEncounterDtosData["wardarea_codg"] = fed.WardareaCodg
- fisEncounterDtosData["wardno"] = fed.Wardno
- fisEncounterDtosData["bedno"] = fed.Bedno
- fisEncounterDtosData["adm_date"] = fed.AdmDate
- fisEncounterDtosData["dscg_date"] = fed.DscgDate
- fisEncounterDtosData["dscg_main_dise_codg"] = fed.DscgMainDiseCodg
- fisEncounterDtosData["dscg_main_dise_name"] = fed.DscgMainDiseName
-
- for _, fdd := range fdds {
- fsiDiagnoseDtosData := make(map[string]interface{})
-
- fsiDiagnoseDtosData["dise_id"] = fdd.DiseID
- fsiDiagnoseDtosData["inout_dise_type"] = fdd.InoutDiseType
- fsiDiagnoseDtosData["maindise_flag"] = fdd.MaindiseFlag
- fsiDiagnoseDtosData["dias_srt_no"] = fdd.DiasSrtNo
- fsiDiagnoseDtosData["dise_codg"] = fdd.DiseCodg
- fsiDiagnoseDtosData["dise_name"] = fdd.DiseName
- fsiDiagnoseDtosData["dise_date"] = fdd.DiseDate
- fsiDiagnoseDtosDatas = append(fsiDiagnoseDtosDatas, fsiDiagnoseDtosData)
- }
-
- fisEncounterDtosData["fsi_diagnose_dtos"] = fsiDiagnoseDtosDatas
-
- fisEncounterDtosData["dr_codg"] = fed.DrCodg
- fisEncounterDtosData["adm_dept_codg"] = fed.AdmDeptCodg
- fisEncounterDtosData["adm_dept_name"] = fed.AdmDeptName
- fisEncounterDtosData["dscg_dept_codg"] = fed.DscgDeptCodg
- fisEncounterDtosData["dscg_dept_name"] = fed.DscgDeptName
- fisEncounterDtosData["med_mdtrt_type"] = fed.MedMdtrtType
- fisEncounterDtosData["med_type"] = fed.MedType
-
- for _, fod := range fods {
- fsiOrderDtosData := make(map[string]interface{})
-
- fsiOrderDtosData["rx_id"] = fod.RxID
- fsiOrderDtosData["rxno"] = fod.Rxno
- fsiOrderDtosData["grpno"] = fod.Grpno
- fsiOrderDtosData["long_drord_flag"] = fod.LongDrordFlag
- fsiOrderDtosData["hilist_type"] = fod.HilistType
- fsiOrderDtosData["chrg_type"] = fod.ChrgType
- fsiOrderDtosData["drord_bhvr"] = fod.DrordBhvr
- fsiOrderDtosData["hilist_code"] = fod.HilistCode
- fsiOrderDtosData["hilist_name"] = fod.HilistName
- fsiOrderDtosData["hilist_dosform"] = fod.HilistDosform
- fsiOrderDtosData["hilist_lv"] = fod.HilistLv
- fsiOrderDtosData["hilist_pric"] = fod.HilistPric
- fsiOrderDtosData["lv1_hosp_item_pric"] = fod.Lv1HospItemPric
- fsiOrderDtosData["lv2_hosp_item_pric"] = fod.Lv2HospItemPric
- fsiOrderDtosData["lv3_hosp_item_pric"] = fod.Lv3HospItemPric
- fsiOrderDtosData["hilist_memo"] = fod.HilistMemo
- fsiOrderDtosData["hosplist_code"] = fod.HosplistCode
- fsiOrderDtosData["hosplist_name"] = fod.HosplistName
- fsiOrderDtosData["hosplist_dosform"] = fod.HosplistDosform
- fsiOrderDtosData["cnt"] = fod.Cnt
- fsiOrderDtosData["pric"] = fod.Pric
- fsiOrderDtosData["sumamt"] = fod.Sumamt
- fsiOrderDtosData["ownpay_amt"] = fod.OwnpayAmt
- fsiOrderDtosData["selfpay_amt"] = fod.SelfpayAmt
- fsiOrderDtosData["spec"] = fod.Spec
- fsiOrderDtosData["spec_unt"] = fod.SpecUnt
- fsiOrderDtosData["drord_begn_date"] = fod.DrordBegnDate
- fsiOrderDtosData["drord_stop_date"] = fod.DrordStopDate
- fsiOrderDtosData["drord_dept_codg"] = fod.DrordDeptCodg
- fsiOrderDtosData["drord_dept_name"] = fod.DrordDeptName
- fsiOrderDtosData["drord_dr_codg"] = fod.DrordDrCodg
- fsiOrderDtosData["drord_dr_name"] = fod.DrordDrName
- fsiOrderDtosData["drord_dr_profttl"] = fod.DrordDrProfttl
- fsiOrderDtosData["curr_drord_flag"] = fod.CurrDrordFlag
- fsiOrderDtosDatas = append(fsiOrderDtosDatas, fsiOrderDtosData)
- }
- fisEncounterDtosData["fsi_order_dtos"] = fsiOrderDtosDatas
-
- fisEncounterDtosData["matn_stas"] = fed.MatnStas
- fisEncounterDtosData["medfee_sumamt"] = fed.MedfeeSumamt
- fisEncounterDtosData["ownpay_amt"] = fed.OwnpayAmt
- fisEncounterDtosData["selfpay_amt"] = fed.SelfpayAmt
- fisEncounterDtosData["acct_payamt"] = fed.AcctPayamt
- fisEncounterDtosData["ma_amt"] = fed.MaAmt
- fisEncounterDtosData["hifp_payamt"] = fed.HifpPayamt
- fisEncounterDtosData["setl_totlnum"] = fed.SetlTotlnum
- fisEncounterDtosData["insutype"] = fed.Insutype
- fisEncounterDtosData["reim_flag"] = fed.ReimFlag
- fisEncounterDtosData["out_setl_flag"] = fed.OutSetlFlag
-
-
- for _, fopd := range fopds {
- fsiOperationDtosData["setl_list_oprn_id"] = fopd.Setl_list_oprn_id
- fsiOperationDtosData["oprn_code"] = fopd.Oprn_code
- fsiOperationDtosData["oprn_name"] = fopd.Oprn_name
- fsiOperationDtosData["main_oprn_flag"] = fopd.Main_oprn_flag
- fsiOperationDtosData["oprn_date"] = fopd.Oprn_date
- fsiOperationDtosData["anst_way"] = fopd.Anst_way
- fsiOperationDtosData["oper_dr_name"] = fopd.Oper_dr_name
- fsiOperationDtosData["oper_dr_code"] = fopd.Oper_dr_code
- fsiOperationDtosData["anst_dr_name"] = fopd.Anst_dr_name
- fsiOperationDtosData["anst_dr_code"] = fopd.Anst_dr_code
- fsiOperationDtosDatas = append(fsiOperationDtosDatas, fsiOperationDtosData)
- }
- fisEncounterDtosData["fsi_operation_dtos"] = fsiOperationDtosDatas
-
- patientDtosinputData["patn_id"] = pd.PatnID
- patientDtosinputData["patn_name"] = pd.PatnName
- patientDtosinputData["gend"] = pd.Gend
- patientDtosinputData["brdy"] = pd.Brdy
- patientDtosinputData["poolarea"] = pd.Poolarea
- patientDtosinputData["curr_mdtrt_id"] = pd.CurrMdtrtID
- patientDtosinputData["fsi_his_data_dto"] = ""
- patientDtosinputData["fsi_encounter_dtos"] = fisEncounterDtosData
- inputData["syscode"] = "LinkDialysis"
- inputData["trig_scen"] = trig_scen
- inputData["rule_ids"] = ""
- inputData["task_id"] = ""
-
- inputData["patient_dtos"] = patientDtosinputData
- input["data"] = inputData
- inputMessage["infno"] = "3101"
- inputMessage["input"] = input
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- params.RequestUrl = params.RequestUrl + "3101"
- return HNHttpRequest(params.RequestUrl, params.AccessKey, params.SecretKey, timestamp, string(bytesData), "3101"), string(bytesData)
-
- }
- func Hnyb3102(pd models.PatientDtos, fed models.FsiEncounterDtos, fdds []*models.FsiDiagnoseDtos, fods []*models.FsiOrderDtos, fopds []*models.FsiOperationDtosData, params models.PublicParams, trig_scen string) (string, string) {
-
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, params.FixmedinsName, params.OpterName, params.FixmedinsCode, params.InsuplcAdmdvs, params.MdtrtareaAdmvs, params.Cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- patientDtosinputData := make(map[string]interface{})
- fisEncounterDtosData := make(map[string]interface{})
- fsiDiagnoseDtosDatas := make([]map[string]interface{}, 0)
-
- fsiOrderDtosDatas := make([]map[string]interface{}, 0)
-
- fsiOperationDtosData := make(map[string]interface{})
- fsiOperationDtosDatas := make([]map[string]interface{}, 0)
-
-
- fisEncounterDtosData["mdtrt_id"] = fed.MdtrtID
- fisEncounterDtosData["medins_id"] = fed.MedinsID
- fisEncounterDtosData["medins_name"] = fed.MedinsName
- fisEncounterDtosData["medins_admdvs"] = fed.MedinsAdmdvs
- fisEncounterDtosData["medins_type"] = fed.MedinsType
- fisEncounterDtosData["medins_lv"] = fed.MedinsLv
- fisEncounterDtosData["wardarea_codg"] = fed.WardareaCodg
- fisEncounterDtosData["wardno"] = fed.Wardno
- fisEncounterDtosData["bedno"] = fed.Bedno
- fisEncounterDtosData["adm_date"] = fed.AdmDate
- fisEncounterDtosData["dscg_date"] = fed.DscgDate
- fisEncounterDtosData["dscg_main_dise_codg"] = fed.DscgMainDiseCodg
- fisEncounterDtosData["dscg_main_dise_name"] = fed.DscgMainDiseName
-
- for _, fdd := range fdds {
- fsiDiagnoseDtosData := make(map[string]interface{})
-
- fsiDiagnoseDtosData["dise_id"] = fdd.DiseID
- fsiDiagnoseDtosData["inout_dise_type"] = fdd.InoutDiseType
- fsiDiagnoseDtosData["maindise_flag"] = fdd.MaindiseFlag
- fsiDiagnoseDtosData["dias_srt_no"] = fdd.DiasSrtNo
- fsiDiagnoseDtosData["dise_codg"] = fdd.DiseCodg
- fsiDiagnoseDtosData["dise_name"] = fdd.DiseName
- fsiDiagnoseDtosData["dise_date"] = fdd.DiseDate
- fsiDiagnoseDtosDatas = append(fsiDiagnoseDtosDatas, fsiDiagnoseDtosData)
- }
-
- fisEncounterDtosData["fsi_diagnose_dtos"] = fsiDiagnoseDtosDatas
-
- fisEncounterDtosData["dr_codg"] = fed.DrCodg
- fisEncounterDtosData["adm_dept_codg"] = fed.AdmDeptCodg
- fisEncounterDtosData["adm_dept_name"] = fed.AdmDeptName
- fisEncounterDtosData["dscg_dept_codg"] = fed.DscgDeptCodg
- fisEncounterDtosData["dscg_dept_name"] = fed.DscgDeptName
- fisEncounterDtosData["med_mdtrt_type"] = fed.MedMdtrtType
- fisEncounterDtosData["med_type"] = fed.MedType
-
- for _, fod := range fods {
- fsiOrderDtosData := make(map[string]interface{})
-
- fsiOrderDtosData["rx_id"] = fod.RxID
- fsiOrderDtosData["rxno"] = fod.Rxno
- fsiOrderDtosData["grpno"] = fod.Grpno
- fsiOrderDtosData["long_drord_flag"] = fod.LongDrordFlag
- fsiOrderDtosData["hilist_type"] = fod.HilistType
- fsiOrderDtosData["chrg_type"] = fod.ChrgType
- fsiOrderDtosData["drord_bhvr"] = fod.DrordBhvr
- fsiOrderDtosData["hilist_code"] = fod.HilistCode
- fsiOrderDtosData["hilist_name"] = fod.HilistName
- fsiOrderDtosData["hilist_dosform"] = fod.HilistDosform
- fsiOrderDtosData["hilist_lv"] = fod.HilistLv
- fsiOrderDtosData["hilist_pric"] = fod.HilistPric
- fsiOrderDtosData["lv1_hosp_item_pric"] = fod.Lv1HospItemPric
- fsiOrderDtosData["lv2_hosp_item_pric"] = fod.Lv2HospItemPric
- fsiOrderDtosData["lv3_hosp_item_pric"] = fod.Lv3HospItemPric
- fsiOrderDtosData["hilist_memo"] = fod.HilistMemo
- fsiOrderDtosData["hosplist_code"] = fod.HosplistCode
- fsiOrderDtosData["hosplist_name"] = fod.HosplistName
- fsiOrderDtosData["hosplist_dosform"] = fod.HosplistDosform
- fsiOrderDtosData["cnt"] = fod.Cnt
- fsiOrderDtosData["pric"] = fod.Pric
- fsiOrderDtosData["sumamt"] = fod.Sumamt
- fsiOrderDtosData["ownpay_amt"] = fod.OwnpayAmt
- fsiOrderDtosData["selfpay_amt"] = fod.SelfpayAmt
- fsiOrderDtosData["spec"] = fod.Spec
- fsiOrderDtosData["spec_unt"] = fod.SpecUnt
- fsiOrderDtosData["drord_begn_date"] = fod.DrordBegnDate
- fsiOrderDtosData["drord_stop_date"] = fod.DrordStopDate
- fsiOrderDtosData["drord_dept_codg"] = fod.DrordDeptCodg
- fsiOrderDtosData["drord_dept_name"] = fod.DrordDeptName
- fsiOrderDtosData["drord_dr_codg"] = fod.DrordDrCodg
- fsiOrderDtosData["drord_dr_name"] = fod.DrordDrName
- fsiOrderDtosData["drord_dr_profttl"] = fod.DrordDrProfttl
- fsiOrderDtosData["curr_drord_flag"] = fod.CurrDrordFlag
- fsiOrderDtosDatas = append(fsiOrderDtosDatas, fsiOrderDtosData)
- }
-
- fisEncounterDtosData["fsi_order_dtos"] = fsiOrderDtosDatas
-
- fisEncounterDtosData["matn_stas"] = fed.MatnStas
- fisEncounterDtosData["medfee_sumamt"] = fed.MedfeeSumamt
- fisEncounterDtosData["ownpay_amt"] = fed.OwnpayAmt
- fisEncounterDtosData["selfpay_amt"] = fed.SelfpayAmt
- fisEncounterDtosData["acct_payamt"] = fed.AcctPayamt
- fisEncounterDtosData["ma_amt"] = fed.MaAmt
- fisEncounterDtosData["hifp_payamt"] = fed.HifpPayamt
- fisEncounterDtosData["setl_totlnum"] = fed.SetlTotlnum
- fisEncounterDtosData["insutype"] = fed.Insutype
- fisEncounterDtosData["reim_flag"] = fed.ReimFlag
- fisEncounterDtosData["out_setl_flag"] = fed.OutSetlFlag
-
-
- for _, fopd := range fopds {
- fsiOperationDtosData["setl_list_oprn_id"] = fopd.Setl_list_oprn_id
- fsiOperationDtosData["oprn_code"] = fopd.Oprn_code
- fsiOperationDtosData["oprn_name"] = fopd.Oprn_name
- fsiOperationDtosData["main_oprn_flag"] = fopd.Main_oprn_flag
- fsiOperationDtosData["oprn_date"] = fopd.Oprn_date
- fsiOperationDtosData["anst_way"] = fopd.Anst_way
- fsiOperationDtosData["oper_dr_name"] = fopd.Oper_dr_name
- fsiOperationDtosData["oper_dr_code"] = fopd.Oper_dr_code
- fsiOperationDtosData["anst_dr_name"] = fopd.Anst_dr_name
- fsiOperationDtosData["anst_dr_code"] = fopd.Anst_dr_code
- fsiOperationDtosDatas = append(fsiOperationDtosDatas, fsiOperationDtosData)
- }
- fisEncounterDtosData["fsi_operation_dtos"] = fsiOperationDtosDatas
-
- patientDtosinputData["patn_id"] = pd.PatnID
- patientDtosinputData["patn_name"] = pd.PatnName
- patientDtosinputData["gend"] = pd.Gend
- patientDtosinputData["brdy"] = pd.Brdy
- patientDtosinputData["poolarea"] = pd.Poolarea
- patientDtosinputData["curr_mdtrt_id"] = pd.CurrMdtrtID
- patientDtosinputData["fsi_his_data_dto"] = ""
- patientDtosinputData["fsi_encounter_dtos"] = fisEncounterDtosData
- inputData["syscode"] = "LinkDialysis"
- inputData["trig_scen"] = trig_scen
- inputData["rule_ids"] = ""
- inputData["task_id"] = ""
- inputData["patient_dtos"] = patientDtosinputData
- input["data"] = inputData
- inputMessage["infno"] = "3102"
- inputMessage["input"] = input
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- params.RequestUrl = params.RequestUrl + "3102"
- return HNHttpRequest(params.RequestUrl, params.AccessKey, params.SecretKey, timestamp, string(bytesData), "3102"), string(bytesData)
-
- }
-
- func Hnyb4101(struct4101 Struct4101, params models.PublicParams) (string, string) {
- timestamp := time.Now().Unix()
- inputMessage := SetHnInputMessage(timestamp, params.FixmedinsName, params.OpterName, params.FixmedinsCode, params.InsuplcAdmdvs, params.MdtrtareaAdmvs, params.Cainfo)
-
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "4101A"
- year := time.Now().Format("2006")
- month := time.Now().Format("01")
- day := time.Now().Format("02")
-
- inputData["mdtrt_id"] = struct4101.MdtrtId
- inputData["setl_id"] = struct4101.SetlId
- inputData["psn_no"] = struct4101.PsnNo
-
- inputData["fixmedins_name"] = params.FixmedinsName
- inputData["fixmedins_code"] = params.FixmedinsCode
- inputData["hi_setl_lv"] = ""
- inputData["hi_no"] = struct4101.PsnNo
- inputData["medcasno"] = struct4101.PsnNo
- inputData["dcla_time"] = year + "-" + month + "-" + day
- inputData["psn_name"] = struct4101.PsnName
- inputData["gend"] = struct4101.Gend
- inputData["brdy"] = struct4101.Brdy
- inputData["age"] = struct4101.Age
- inputData["ntly"] = struct4101.Ntly
-
- inputData["resp_nurs_code"] = "N430822004867"
-
- inputData["nwb_age"] = ""
- inputData["naty"] = struct4101.Naty
- inputData["patn_cert_type"] = struct4101.PatnCertType
- inputData["certno"] = struct4101.Certno
- inputData["prfs"] = struct4101.Prfs
- inputData["curr_addr"] = ""
- inputData["emp_name"] = ""
- inputData["emp_addr"] = ""
- inputData["emp_tel"] = ""
- inputData["poscode"] = ""
- inputData["coner_name"] = struct4101.ConerName
- inputData["patn_rlts"] = struct4101.PatnRlts
- inputData["coner_addr"] = struct4101.ConerAddr
- inputData["coner_tel"] = struct4101.ConerTel
- inputData["hi_type"] = struct4101.HiType
- inputData["insuplc"] = struct4101.Insuplc
- inputData["sp_psn_type"] = ""
- inputData["nwb_adm_type"] = ""
- inputData["nwb_bir_wt"] = ""
- inputData["nwb_adm_wt"] = ""
- inputData["opsp_diag_caty"] = ""
- inputData["opsp_mdtrt_date"] = ""
- inputData["ipt_med_type"] = struct4101.IptMedType
- inputData["adm_way"] = ""
- inputData["trt_type"] = "10"
- inputData["adm_time"] = struct4101.AdmTime
- inputData["adm_caty"] = struct4101.AdmCaty
- inputData["refldept_dept"] = ""
- inputData["dscg_time"] = struct4101.AdmEndTime
- inputData["dscg_caty"] = struct4101.AdmCaty
- inputData["act_ipt_days"] = ""
- inputData["otp_wm_dise"] = ""
- inputData["wm_dise_code"] = ""
- inputData["otp_tcm_dise"] = ""
- inputData["tcm_dise_code"] = ""
- inputData["oprn_oprt_code_cnt"] = ""
- inputData["vent_used_dura"] = ""
- inputData["pwcry_bfadm_coma_dura"] = ""
- inputData["pwcry_afadm_coma_dura"] = ""
- inputData["bld_cat"] = ""
- inputData["bld_amt"] = ""
- inputData["bld_unt"] = ""
- inputData["spga_nurscare_days"] = ""
- inputData["lv1_nurscare_days"] = ""
- inputData["scd_nurscare_days"] = ""
- inputData["lv3_nurscare_days"] = ""
- inputData["acp_medins_name"] = ""
- inputData["acp_optins_code"] = ""
- inputData["bill_code"] = struct4101.BillCode
- inputData["bill_no"] = struct4101.BillNo
- inputData["biz_sn"] = struct4101.BizSn
- inputData["days_rinp_flag_31"] = ""
- inputData["days_rinp_pup_31"] = ""
- inputData["chfpdr_name"] = struct4101.DoctorName
- inputData["chfpdr_code"] = struct4101.DoctorCode
- inputData["setl_begn_date"] = struct4101.SetlBegnDate
- inputData["setl_end_date"] = struct4101.SetlEndDate
- inputData["psn_selfpay"] = struct4101.PsnSelfPay
- inputData["psn_ownpay"] = struct4101.PsnOwnPay
- inputData["acct_pay"] = struct4101.AcctPay
- inputData["hi_paymtd"] = struct4101.HiPaymtd
- inputData["hsorg"] = struct4101.Hsorg
- inputData["hsorg_opter"] = struct4101.HsorgOpter
- inputData["medins_fill_dept"] = struct4101.MedinsFillDept
- inputData["medins_fill_psn"] = struct4101.MedinsFillPsn
- inputData["psn_cashpay"] = struct4101.PsnCashpay
-
- payinfo := make([]map[string]interface{}, 0)
- for _, item := range struct4101.CustomStruct {
- payinfotemp := make(map[string]interface{})
- if item.FundPayType == "310100" || item.FundPayType == "310200" || item.FundPayType == "320100" || item.FundPayType == "330100" || item.FundPayType == "340100" || item.FundPayType == "350100" || item.FundPayType == "370100" || item.FundPayType == "390100" || item.FundPayType == "610100" || item.FundPayType == "640100" || item.FundPayType == "620100" {
- payinfotemp["fund_pay_type"] = item.FundPayType
- payinfotemp["fund_payamt"] = item.FundPayamt
- payinfo = append(payinfo, payinfotemp)
- }
- }
- opspdiseinfo := make([]map[string]interface{}, 0)
-
- opspdiseinfotemp := make(map[string]interface{})
- opspdiseinfotemp["diag_name"] = struct4101.OpspdiseinfoStruct[len(struct4101.OpspdiseinfoStruct)-1].DiagName
- opspdiseinfotemp["diag_code"] = struct4101.OpspdiseinfoStruct[len(struct4101.OpspdiseinfoStruct)-1].DiagCode
- opspdiseinfotemp["oprn_oprt_name"] = struct4101.OpspdiseinfoStruct[len(struct4101.OpspdiseinfoStruct)-1].DiagName
- opspdiseinfotemp["oprn_oprt_code"] = struct4101.OpspdiseinfoStruct[len(struct4101.OpspdiseinfoStruct)-1].DiagCode
- opspdiseinfo = append(opspdiseinfo, opspdiseinfotemp)
-
- diseinfo := make([]map[string]interface{}, 0)
- for _, item := range struct4101.Diseinfo {
- diseinfotemp := make(map[string]interface{})
- diseinfotemp["maindiag_flag"] = item.MaindiagFlag
- diseinfotemp["diag_type"] = item.DiagType
- diseinfotemp["diag_code"] = item.DiagCode
- diseinfotemp["diag_name"] = item.DiagName
- diseinfotemp["adm_cond_type"] = "3"
- diseinfo = append(diseinfo, diseinfotemp)
- }
-
- iteminfo := make([]map[string]interface{}, 0)
- for _, item := range struct4101.IteminfoStruct {
- iteminfotemp := make(map[string]interface{})
- iteminfotemp["med_chrgitm"] = item.MedChrgitm
- iteminfotemp["amt"] = item.Amt
- iteminfotemp["claa_sumfee"] = item.ClaaSumfee
- iteminfotemp["clab_amt"] = item.ClabAmt
- iteminfotemp["fulamt_ownpay_amt"] = item.FulamtOwnpayAmt
- iteminfotemp["oth_amt"] = item.OthAmt
- iteminfo = append(iteminfo, iteminfotemp)
- }
-
- oprninfo := make([]map[string]interface{}, 0)
- oprninfotemp := make(map[string]interface{})
- oprninfotemp["oprn_oprt_type"] = ""
- oprninfotemp["oprn_oprt_name"] = ""
- oprninfotemp["oprn_oprt_code"] = ""
- oprninfotemp["oprn_oprt_date"] = ""
- oprninfotemp["anst_way"] = ""
- oprninfotemp["oper_dr_name"] = ""
- oprninfotemp["oper_dr_code"] = ""
- oprninfotemp["anst_dr_name"] = ""
- oprninfotemp["anst_dr_code"] = ""
- oprninfo = append(oprninfo, oprninfotemp)
-
- icuinfo := make([]map[string]interface{}, 0)
- icuinfotemp := make(map[string]interface{})
- icuinfotemp["scs_cutd_ward_type"] = ""
- icuinfotemp["scs_cutd_inpool_time"] = ""
- icuinfotemp["scs_cutd_exit_time"] = ""
- icuinfotemp["scs_cutd_sum_dura"] = ""
- icuinfo = append(icuinfo, icuinfotemp)
-
- input["setlinfo"] = inputData
- input["payinfo"] = payinfo
- input["opspdiseinfo"] = opspdiseinfo
- input["diseinfo"] = diseinfo
- input["iteminfo"] = iteminfo
-
- inputMessage["input"] = input
- bytesData, _ := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
-
- params.RequestUrl = params.RequestUrl + "4101"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
-
- return HNHttpRequest(params.RequestUrl, params.AccessKey, params.SecretKey, timestamp2, string(bytesData), "4101"), string(bytesData)
-
- }
-
- func Hnyb3501(struct3501 models.Struct3501) (string, string) {
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, struct3501.OrgName, struct3501.Opter, struct3501.FixmedinsCode, struct3501.InsuplcAdmdvs, struct3501.MdtrtareaAdmvs, struct3501.Cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "3501"
- inputData["med_list_codg"] = struct3501.MedListCodg
- inputData["fixmedins_hilist_id"] = struct3501.FixmedinsHilistId
- inputData["fixmedins_hilist_name"] = struct3501.OrgName
- inputData["rx_flag"] = struct3501.RxFlag
- inputData["invdate"] = struct3501.Invdate
- inputData["inv_cnt"] = struct3501.InvCnt
- inputData["manu_lotnum"] = struct3501.ManuLotnum
- inputData["fixmedins_bchno"] = struct3501.FixmedinsBchno
- inputData["manu_date"] = struct3501.ManuDate
- inputData["expy_end"] = struct3501.ExpyEnd
- inputData["memo"] = ""
- input["invinfo"] = inputData
- inputMessage["input"] = input
-
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- struct3501.RequestUrl = struct3501.RequestUrl + "3501"
-
- return HNHttpRequest(struct3501.RequestUrl, struct3501.AccessKey, struct3501.SecretKey, timestamp, string(bytesData), "3501"), string(bytesData)
-
- }
- func Hnyb3502(struct3502 models.Struct3502) (string, string) {
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, struct3502.OrgName, struct3502.Opter, struct3502.FixmedinsCode, struct3502.InsuplcAdmdvs, struct3502.MdtrtareaAdmvs, struct3502.Cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "3502"
- inputData["med_list_codg"] = struct3502.MedListCodg
- inputData["inv_chg_type"] = struct3502.InvChgType
-
- inputData["fixmedins_hilist_id"] = struct3502.FixmedinsCode
- inputData["fixmedins_hilist_name"] = struct3502.OrgName
- inputData["fixmedins_bchno"] = struct3502.FixmedinsBchno
- inputData["pric"] = struct3502.Pric
- inputData["cnt"] = struct3502.Cnt
- inputData["rx_flag"] = struct3502.RxFlag
-
- inputData["inv_chg_time"] = struct3502.InvChgTime
- inputData["inv_chg_opter_name"] = ""
- inputData["memo"] = struct3502.Memo
- inputData["trdn_flag"] = ""
-
- input["invinfo"] = inputData
- inputMessage["input"] = input
-
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- struct3502.RequestUrl = struct3502.RequestUrl + "3502"
- return HNHttpRequest(struct3502.RequestUrl, struct3502.AccessKey, struct3502.SecretKey, timestamp, string(bytesData), "3502"), string(bytesData)
-
- }
-
- func Hnyb3503(struct3503 models.Struct3503) (string, string) {
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, struct3503.OrgName, struct3503.Opter, struct3503.FixmedinsCode, struct3503.InsuplcAdmdvs, struct3503.MdtrtareaAdmvs, struct3503.Cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "3503"
- inputData["med_list_codg"] = struct3503.MedListCodg
- inputData["fixmedins_hilist_id"] = struct3503.FixmedinsCode
- inputData["fixmedins_hilist_name"] = struct3503.OrgName
-
- inputData["dynt_no"] = ""
- inputData["fixmedins_bchno"] = struct3503.FixmedinsBchno
-
- inputData["spler_name"] = struct3503.SplerName
- inputData["spler_pmtno"] = ""
- inputData["manu_lotnum"] = struct3503.ManuLotnum
- inputData["prodentp_name"] = struct3503.ProdentpName
- inputData["aprvno"] = struct3503.Aprvno
- inputData["manu_date"] = struct3503.ManuDate
- inputData["expy_end"] = struct3503.ExpyEnd
-
- inputData["finl_trns_pric"] = struct3503.FinlTrnsPric
- inputData["purc_retn_cnt"] = struct3503.PurcRetnCnt
- inputData["purc_invo_codg"] = struct3503.PurcInvoCodg
- inputData["purc_invo_no"] = struct3503.PurcInvoNo
-
- inputData["rx_flag"] = struct3503.RxFlag
-
- inputData["purc_retn_stoin_time"] = struct3503.PurcRetnStoinTime
- inputData["purc_retn_opter_name"] = struct3503.PurcRetnOpterName
- inputData["prod_geay_flag"] = ""
- inputData["memo"] = ""
- input["purcinfo"] = inputData
- inputMessage["input"] = input
-
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- struct3503.RequestUrl = struct3503.RequestUrl + "3503"
- return HNHttpRequest(struct3503.RequestUrl, struct3503.AccessKey, struct3503.SecretKey, timestamp, string(bytesData), "3503"), string(bytesData)
-
- }
- func Hnyb3504(struct3504 models.Struct3504) (string, string) {
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, struct3504.OrgName, struct3504.Opter, struct3504.FixmedinsCode, struct3504.InsuplcAdmdvs, struct3504.MdtrtareaAdmvs, struct3504.Cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "3504"
- inputData["med_list_codg"] = struct3504.MedListCodg
- inputData["fixmedins_hilist_id"] = struct3504.FixmedinsHilistId
- inputData["fixmedins_hilist_name"] = struct3504.FixmedinsHilistName
- inputData["fixmedins_bchno"] = struct3504.FixmedinsBchno
- inputData["spler_name"] = struct3504.SplerName
- inputData["spler_pmtno"] = ""
-
- inputData["manu_date"] = struct3504.ManuDate
- inputData["expy_end"] = struct3504.ExpyEnd
- inputData["finl_trns_pric"] = struct3504.FinlTrnsPric
- inputData["purc_retn_cnt"] = struct3504.PurcRetnCnt
- inputData["purc_invo_codg"] = struct3504.PurcInvoCodg
- inputData["purc_invo_no"] = struct3504.PurcInvoNo
- inputData["rx_flag"] = struct3504.RxFlag
- inputData["purc_retn_stoin_time"] = struct3504.PurcRetnStoinTime
- inputData["purc_retn_opter_name"] = struct3504.PurcRetnOpterName
- inputData["medins_prod_purc_no"] = ""
- inputData["memo"] = ""
- input["purcinfo"] = inputData
- inputMessage["input"] = input
-
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- struct3504.RequestUrl = struct3504.RequestUrl + "3504"
- return HNHttpRequest(struct3504.RequestUrl, struct3504.AccessKey, struct3504.SecretKey, timestamp, string(bytesData), "3504"), string(bytesData)
-
- }
-
- func Hnyb3505(struct3505 models.Struct3505) (string, string) {
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, struct3505.OrgName, struct3505.Opter, struct3505.FixmedinsCode, struct3505.InsuplcAdmdvs, struct3505.MdtrtareaAdmvs, struct3505.Cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "3505"
- inputData["med_list_codg"] = struct3505.MedListCodg
- inputData["fixmedins_hilist_id"] = struct3505.FixmedinsCode
- inputData["fixmedins_hilist_name"] = struct3505.OrgName
- inputData["fixmedins_bchno"] = struct3505.FixmedinsCode
-
- inputData["prsc_dr_cert_type"] = struct3505.PrscDrCertType
- inputData["prsc_dr_certno"] = struct3505.PrscDrCertno
- inputData["prsc_dr_name"] = struct3505.PrscDrName
- inputData["phar_cert_type"] = struct3505.PharCertType
- inputData["phar_certno"] = struct3505.PharCertno
-
- inputData["phar_name"] = struct3505.PharName
- inputData["phar_prac_cert_no"] = struct3505.PharPracCertNo
- inputData["hi_feesetl_type"] = struct3505.HiFeesetlType
- inputData["setl_id"] = struct3505.SetlId
- inputData["mdtrt_sn"] = struct3505.MdtrtSn
- inputData["psn_no"] = struct3505.PsnNo
- inputData["psn_cert_type"] = struct3505.PsnCertType
- inputData["certno"] = struct3505.CertNo
- inputData["psn_name"] = struct3505.PsnName
- inputData["manu_lotnum"] = struct3505.ManuLotnum
- inputData["manu_date"] = struct3505.ManuDate
- inputData["expy_end"] = struct3505.ExpyEnd
-
- inputData["rx_flag"] = struct3505.RxFlag
- inputData["trdn_flag"] = struct3505.TrdnFlag
-
- inputData["finl_trns_pric"] = struct3505.FinlTrnsPric
- inputData["rxno"] = struct3505.Rxno
- inputData["rx_circ_flag"] = struct3505.RxCircFlag
-
- inputData["rtal_docno"] = struct3505.RtalDocno
- inputData["stoout_no"] = struct3505.StooutNo
-
- inputData["bchno"] = struct3505.Bchno
- inputData["drug_trac_codg"] = struct3505.DrugTracCodg
- inputData["drug_prod_barc"] = struct3505.DrugProdBarc
- inputData["shelf_posi"] = struct3505.ShelfPosi
- inputData["sel_retn_cnt"] = struct3505.SelRetnCnt
- inputData["sel_retn_time"] = struct3505.SelRetnTime
- inputData["sel_retn_opter_name"] = struct3505.SelRetnOpterName
- inputData["memo"] = struct3505.Memo
- input["selinfo"] = inputData
- inputMessage["input"] = input
-
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- struct3505.RequestUrl = struct3505.RequestUrl + "3505"
- return HNHttpRequest(struct3505.RequestUrl, struct3505.AccessKey, struct3505.SecretKey, timestamp, string(bytesData), "3505"), string(bytesData)
-
- }
- func Hnyb3506(struct3506 models.Struct3506) (string, string) {
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, struct3506.OrgName, struct3506.Opter, struct3506.FixmedinsCode, struct3506.InsuplcAdmdvs, struct3506.MdtrtareaAdmvs, struct3506.Cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "3506"
- inputData["med_list_codg"] = struct3506.MedListCodg
- inputData["fixmedins_hilist_id"] = struct3506.FixmedinsHilistId
- inputData["fixmedins_hilist_name"] = struct3506.OrgName
- inputData["fixmedins_bchno"] = struct3506.FixmedinsBchno
-
- inputData["setl_id"] = struct3506.SetlId
- inputData["psn_no"] = struct3506.PsnNo
- inputData["psn_cert_type"] = struct3506.PsnCertType
- inputData["certno"] = struct3506.Certno
- inputData["psn_name"] = struct3506.PsnName
- inputData["manu_lotnum"] = struct3506.ManuLotnum
- inputData["manu_date"] = struct3506.ManuDate
- inputData["expy_end"] = struct3506.ExpyEnd
- inputData["rx_flag"] = struct3506.RxFlag
- inputData["trdn_flag"] = struct3506.TrdnFlag
- inputData["finl_trns_pric"] = struct3506.FinlTrnsPric
- inputData["sel_retn_cnt"] = struct3506.SelRetnCnt
- inputData["sel_retn_time"] = struct3506.SelRetnTime
- inputData["sel_retn_opter_name"] = struct3506.SelRetnOpterName
- inputData["memo"] = ""
- inputData["medins_prod_sel_no"] = ""
-
- input["selinfo"] = inputData
- inputMessage["input"] = input
-
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- struct3506.RequestUrl = struct3506.RequestUrl + "3506"
- return HNHttpRequest(struct3506.RequestUrl, struct3506.AccessKey, struct3506.SecretKey, timestamp, string(bytesData), "3506"), string(bytesData)
-
- }
-
- func Hnyb3507(struct3507 models.Struct3507) (string, string) {
- timestamp := time.Now().Unix()
-
- inputMessage := SetHnInputMessage(timestamp, struct3507.OrgName, struct3507.Opter, struct3507.FixmedinsCode, struct3507.InsuplcAdmdvs, struct3507.MdtrtareaAdmvs, struct3507.Cainfo)
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "3507"
- inputData["fixmedins_bchno"] = struct3507.FixmedinsCode
- inputData["inv_data_type"] = struct3507.InvDataType
-
- input["data"] = inputData
- inputMessage["input"] = input
-
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(), ""
- }
- struct3507.RequestUrl = struct3507.RequestUrl + "3507"
- return HNHttpRequest(struct3507.RequestUrl, struct3507.AccessKey, struct3507.SecretKey, timestamp, string(bytesData), "3507"), string(bytesData)
-
- }
-
-
-
- func Hnyb3301(org_name string,opera string,fixmedins_code string,insuplc_admdvs string,mdtrtarea_admvs string,cainfo string, name string, codg string, list_type string,start_time string, ent_time string, request_url string,access_key string,secret_key string) (string,string) {
-
-
-
- timestamp := time.Now().Unix()
-
-
- inputMessage := SetHnInputMessage(timestamp, org_name, opera, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
-
-
-
-
-
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "3301"
- inputData["fixmedins_hilist_id"] = codg
- inputData["fixmedins_hilist_name"] = name
- inputData["list_type"] = list_type
- inputData["med_list_codg"] = codg
- inputData["begndate"] = start_time
- inputData["enddate"] = ent_time
-
- inputData["aprvno"] = ""
- inputData["dosform"] = ""
- inputData["exct_cont"] = ""
- inputData["item_cont"] = ""
- inputData["prcunt"] = ""
- inputData["spec"] = ""
- inputData["pacspec"] = ""
- inputData["memo"] = ""
-
- input["data"] = inputData
- inputMessage["input"] = input
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(),""
- }
-
- request_url = request_url + "3301"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "3301"), string(bytesData)
-
- }
- func Hnyb3302(org_name string,opera string,fixmedins_code string,insuplc_admdvs string,mdtrtarea_admvs string,cainfo string, name string, codg string, list_type string,start_time string, ent_time string, request_url string,access_key string,secret_key string) (string,string) {
-
-
-
- timestamp := time.Now().Unix()
-
-
- inputMessage := SetHnInputMessage(timestamp, org_name, opera, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
-
-
-
-
-
- input := make(map[string]interface{})
- inputData := make(map[string]interface{})
- inputMessage["infno"] = "3302"
- inputData["fixmedins_code"] = fixmedins_code
- inputData["fixmedins_hilist_id"] = codg
- inputData["list_type"] = list_type
- inputData["med_list_codg"] = codg
- input["data"] = inputData
- inputMessage["input"] = input
- bytesData, err := json.Marshal(inputMessage)
- fmt.Println(string(bytesData))
- if err != nil {
- fmt.Println(err.Error())
- return err.Error(),""
- }
-
- request_url = request_url + "3302"
- timestamp2 := time.Now().UnixNano() / int64(time.Millisecond)
- return HNHttpRequest(request_url, access_key, secret_key, timestamp2, string(bytesData), "3302"), string(bytesData)
-
- }
|