1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844 |
- #include "PhmsSession.h"
- #include "Poco/DOM/Document.h"
- #include "Poco/DOM/Text.h"
- #include "Poco/DOM/Element.h"
- #include "Poco/DOM/ProcessingInstruction.h"
- #include "Poco/DOM/DOMWriter.h"
- #include "Poco/ASCIIEncoding.h"
- #include "Poco/DOM/DOMParser.h"
- #include "Poco/DOM/NodeIterator.h"
- #include "Poco/SAX/InputSource.h"
- #include "Poco/DOM/Node.h"
- #include "Poco/DOM/NodeFilter.h"
- #include "ErrorCode.h"
- #include "Poco/Exception.h"
- #include "Poco/XML/XMLWriter.h"
- #include "Poco/Util/IniFileConfiguration.h"
- #include "Poco/AutoPtr.h"
- #include "Poco/Base64Encoder.h"
- #include "Poco/ASCIIEncoding.h"
- #include "Poco/UTF8Encoding.h"
- #include "Poco/TextConverter.h"
- #include "Poco/TextEncoding.h"
- #include "Poco/GBKEncoding.h"
- #include "Poco/KOI8REncoding.h"
- #include "Poco/StreamCopier.h"
- #include "Poco/File.h"
- #include "Poco/Crypto/Cipher.h"
- #include "Poco/Crypto/CipherFactory.h"
- #include "Poco/Crypto/CipherKey.h"
- #include "Poco/DateTime.h"
- #include "Poco/DateTimeFormatter.h"
- #include "Poco/Timestamp.h"
- #include "Poco/Timezone.h"
- #include "Poco/Timespan.h"
- #include "Poco/URI.h"
- #include <sstream>
- #include <fstream>
- #include "Util.h"
- #include "PhmsLogger.h"
- #include "SessionIdManager.h"
- #include "AllObjectManagerUtil.h"
- #include "json/json.h"
- #include "json/value.h"
- #include "json/writer.h"
- #include "GlobalTerminalLogoString.h"
- using Poco::XML::Document;
- using Poco::XML::Text;
- using Poco::XML::Element;
- using Poco::XML::ProcessingInstruction;
- using Poco::XML::DOMWriter;
- using Poco::ASCIIEncoding;
- using Poco::XML::DOMParser;
- using Poco::XML::NodeIterator;
- using Poco::XML::InputSource;
- using Poco::XML::Node;
- using Poco::XML::NodeFilter;
- using Poco::Exception;
- using Poco::TimeoutException;
- using Poco::FileNotFoundException;
- using Poco::XML::XMLWriter;
- using Poco::Util::IniFileConfiguration;
- using Poco::AutoPtr;
- using Poco::Base64Encoder;
- using Poco::TextConverter;
- using Poco::ASCIIEncoding;
- using Poco::UTF8Encoding;
- using Poco::StreamCopier;
- using Poco::TextEncoding;
- using Poco::GBKEncoding;
- using Poco::KOI8REncoding;
- using Poco::File;
- using Poco::Crypto::Cipher;
- using Poco::Crypto::CipherFactory;
- using Poco::Crypto::CipherKey;
- using Poco::DateTime;
- using Poco::DateTimeFormatter;
- using Poco::Timestamp;
- using Poco::Timezone;
- using Poco::Timespan;
- using Poco::URI;
- string CPhmsSession::m_stringKey = "5b1b25bf9447a5002ca129a7f9523459";
- string CPhmsSession::m_stringToken_XiKang = "";
- string CPhmsSession::m_stringClientId_XiKang = "";
- string CPhmsSession::m_stringClientSecret_XiKang = "";
- string CPhmsSession::m_stringGWSecretKey = "";
- CPhmsSession::CPhmsSession(void):m_nSaveType(0), m_enumPhmsCommandType(MAIN_TYPE), m_bUseIp(false), m_enumNetConfigType(ORIGINAL_PHMS)
- {
- //获得ssl环境
- {
- string stringWorkingDir = CUtil::GetCurrentAppDir();
- CNetConfig netConfig;
- this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, false);
- m_bSsl = netConfig.GetSsl();
- }
- m_pHttpSession = new CHttpSession(m_bSsl);
- }
- CPhmsSession::~CPhmsSession(void)
- {
- delete m_pHttpSession;
- }
- //Setter
- void CPhmsSession::SetSaveType(int nSaveType)
- {
- m_nSaveType = nSaveType;
- }
- void CPhmsSession::SetFilePath(string stringFilePath)
- {
- m_stringFilePath = stringFilePath;
- }
- void CPhmsSession::SetSessionId(string stringSessionId)
- {
- m_stringSessionId = stringSessionId;
- }
- void CPhmsSession::SetGWSessionId(string stringSessionId)
- {
- m_stringGWSessionId = stringSessionId;
- }
- void CPhmsSession::SetCommandType(EnumPhmsCommandType enumCommandType)
- {
- m_enumPhmsCommandType = enumCommandType;
- }
- void CPhmsSession::SetXmlCommandType(EnumXmlCommandType enumXmlCommandType)
- {
- m_enumXmlCommandType = enumXmlCommandType;
- }
- void CPhmsSession::SetXmlCommandType_Telecom(EnumXmlCommandType_Telecom enumXmlCommandType_Telecom)
- {
- m_enumXmlCommandType_Telecom = enumXmlCommandType_Telecom;
- }
- void CPhmsSession::SetXinJieCommandType(EnumXinJieCommandType enumXinJieCommandType)
- {
- m_enumXinJieCommandType = enumXinJieCommandType;
- }
- void CPhmsSession::SetGuanXinCommandType(EnumGuanXinCommandType enumGuanXinCommandType)
- {
- m_enumGuanXinCommandType = enumGuanXinCommandType;
- }
- void CPhmsSession::SetXiKangCommandType(EnumXiKangCommandType enumXiKangCommandType)
- {
- m_enumXiKangCommandType = enumXiKangCommandType;
- }
- void CPhmsSession::SetNetConfigType(EnumNetConfigType enumNetConfigType)
- {
- m_enumNetConfigType = enumNetConfigType;
- }
- void CPhmsSession::SetUseIp(bool bUseIp)
- {
- m_bUseIp = bUseIp;
- }
- void CPhmsSession::SetGWSecretKey(string stringGWSecretKey)
- {
- CPhmsSession::m_stringGWSecretKey = stringGWSecretKey;
- }
- //Getter
- int CPhmsSession::GetSaveType()
- {
- return m_nSaveType;
- }
- string CPhmsSession::GetContent()
- {
- return m_stringContent;
- }
- string CPhmsSession::GetSessionId()
- {
- return m_stringSessionId;
- }
- string CPhmsSession::GetGWSessionId()
- {
- return m_stringGWSessionId;
- }
- EnumPhmsCommandType CPhmsSession::GetCommandType()
- {
- return m_enumPhmsCommandType;
- }
- EnumXmlCommandType CPhmsSession::GetXmlCommandType()
- {
- return m_enumXmlCommandType;
- }
- EnumXmlCommandType_Telecom CPhmsSession::GetXmlCommandType_Telecom()
- {
- return m_enumXmlCommandType_Telecom;
- }
- EnumXinJieCommandType CPhmsSession::GetXinJieCommandType()
- {
- return m_enumXinJieCommandType;
- }
- EnumGuanXinCommandType CPhmsSession::GetGuanXinCommandType()
- {
- return m_enumGuanXinCommandType;
- }
- EnumNetConfigType CPhmsSession::GetNetConfigType()
- {
- return m_enumNetConfigType;
- }
- string CPhmsSession::GetIp()
- {
- return m_stringIp;
- }
- string CPhmsSession::GetGWSecretKey()
- {
- return CPhmsSession::m_stringGWSecretKey;
- }
- //private member function
- int CPhmsSession::ExecutePhmsSession(CPhmsRequest& phmsRequest, CPhmsResponse& phmsResponse, bool bMustSsl)
- {
- CNetConfig netConfig;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- //设置网络环境
- try
- {
- string stringWorkingDir = CUtil::GetCurrentAppDir();
- EnumNetConfigType enumNetConfigType = this->GetNetConfigType();
- nRet = this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl, enumNetConfigType);
- //nRet = this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
- if(bMustSsl)
- {
- if(!m_bSsl)
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(bMustSsl);
- m_bSsl = bMustSsl;
- }
- }
- else
- {
- if(m_bSsl != netConfig.GetSsl())
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(netConfig.GetSsl());
- m_bSsl = netConfig.GetSsl();
- }
- }
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_NO_NET_CONFIG_FILE;
- }
-
- istream* pInputStream = NULL;
- if(!phmsRequest.ValidataPhmsRequest())
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_PHMS_REQUEST_VALIDATE_FAIL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_PHMS_REQUEST_VALIDATE_FAIL;
- }
- nRet = m_pHttpSession->ExecuteHttpSession(netConfig, phmsRequest, pInputStream);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- m_stringIp = netConfig.GetIp();
- nRet = phmsResponse.SetPhmsResponse(pInputStream, this);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ExecuteXmlSession(string stringXmlContent, bool bMustSsl)
- {
- CNetConfig netConfig;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- //设置网络环境
- try
- {
- string stringWorkingDir = CUtil::GetCurrentAppDir();
- EnumNetConfigType enumNetConfigType = this->GetNetConfigType();
- nRet = this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl, enumNetConfigType);
- //nRet = this->GetXmlNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
- if(bMustSsl)
- {
- if(!m_bSsl)
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(bMustSsl);
- m_bSsl = bMustSsl;
- }
- }
- else
- {
- if(m_bSsl != netConfig.GetSsl())
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(netConfig.GetSsl());
- m_bSsl = netConfig.GetSsl();
- }
- }
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_NO_NET_CONFIG_FILE;
- }
- istream* pInputStream = NULL;
- nRet = m_pHttpSession->ExecuteXmlHttpSession(netConfig, stringXmlContent, pInputStream);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = NoPhmsGetResult(pInputStream);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ExecuteXmlSession_Telecom(string stringXmlContent, bool bMustSsl)
- {
- CNetConfig netConfig;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- //设置网络环境
- try
- {
- string stringWorkingDir = CUtil::GetCurrentAppDir();
- EnumNetConfigType enumNetConfigType = this->GetNetConfigType();
- nRet = this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl, enumNetConfigType);
- //nRet = this->GetXmlNetConfig_Telecom(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
- if(bMustSsl)
- {
- if(!m_bSsl)
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(bMustSsl);
- m_bSsl = bMustSsl;
- }
- }
- else
- {
- if(m_bSsl != netConfig.GetSsl())
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(netConfig.GetSsl());
- m_bSsl = netConfig.GetSsl();
- }
- }
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_NO_NET_CONFIG_FILE;
- }
- istream* pInputStream = NULL;
- //nRet = m_pHttpSession->ExecuteXmlHttpSession(netConfig, stringXmlContent, pInputStream);
- map<string, string> mapParam;
- mapParam["requestXML"] = stringXmlContent;
- nRet = m_pHttpSession->ExecuteFormHttpSession(netConfig, mapParam, pInputStream);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = NoPhmsGetResult(pInputStream);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ExecuteGuanXinSession(map<string, string> mapParam, string stringDataPath, bool bMustSsl)
- {
- CNetConfig netConfig;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- //设置网络环境
- try
- {
- string stringWorkingDir = CUtil::GetCurrentAppDir();
- EnumNetConfigType enumNetConfigType = this->GetNetConfigType();
- nRet = this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl, enumNetConfigType);
- //nRet = this->GetGuanXinNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
- if(bMustSsl)
- {
- if(!m_bSsl)
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(bMustSsl);
- m_bSsl = bMustSsl;
- }
- }
- else
- {
- if(m_bSsl != netConfig.GetSsl())
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(netConfig.GetSsl());
- m_bSsl = netConfig.GetSsl();
- }
- }
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_NO_NET_CONFIG_FILE;
- }
- istream* pInputStream = NULL;
- // if(m_enumGuanXinCommandType == ACCESSTOKEN)
- // {
- // string stringUrl = netConfig.GetUrl();
- // //有时间改成map遍历,赶时间,先凑合着
- // stringUrl += "?grant_type=password&username=";
- // stringUrl += mapParam["username"];
- // stringUrl += "&password=";
- // stringUrl += mapParam["password"];
- // netConfig.SetUrl(stringUrl);
- // nRet = m_pHttpSession->ExecuteNoPhmsHttpSession(netConfig, pInputStream, false, m_stringFilePath);
- // }
- // else
- // {
- // nRet = m_pHttpSession->ExecuteFormHttpSession(netConfig, mapParam, pInputStream);
- // }
- nRet = m_pHttpSession->ExecuteFormHttpSession(netConfig, mapParam, stringDataPath, pInputStream);
-
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = NoPhmsGetResult(pInputStream);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ExecuteXiKangSession(map<string, string> mapParam, string stringDataPath, string stringUrlOpenId, bool bMustSsl)
- {
- CNetConfig netConfig;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- //设置网络环境
- try
- {
- string stringWorkingDir = CUtil::GetCurrentAppDir();
- EnumNetConfigType enumNetConfigType = this->GetNetConfigType();
- nRet = this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl, enumNetConfigType);
- //nRet = this->GetXiKangNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- if(netConfig.GetUrl().find("{openID}") != string::npos)
- {
- string stringUrl = netConfig.GetUrl();
- if(stringUrlOpenId.size() != 0)
- {
- CUtil::ReplaceString(stringUrl, "{openID}", stringUrlOpenId);
- netConfig.SetUrl(stringUrl);
- }
- else
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_XIKANG_URL_OPENID_NULL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_XIKANG_URL_OPENID_NULL;
- }
- }
- if(netConfig.GetUrl().find("{ecgID}") != string::npos)
- {
- string stringUrl = netConfig.GetUrl();
- if(stringUrlOpenId.size() != 0)
- {
- CUtil::ReplaceString(stringUrl, "{ecgID}", stringUrlOpenId);
- netConfig.SetUrl(stringUrl);
- }
- else
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_XIKANG_URL_OPENID_NULL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_XIKANG_URL_OPENID_NULL;
- }
- }
- Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
- if(bMustSsl)
- {
- if(!m_bSsl)
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(bMustSsl);
- m_bSsl = bMustSsl;
- }
- }
- else
- {
- if(m_bSsl != netConfig.GetSsl())
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(netConfig.GetSsl());
- m_bSsl = netConfig.GetSsl();
- }
- }
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_NO_NET_CONFIG_FILE;
- }
- istream* pInputStream = NULL;
- string stringHttpBody;
-
- //所有向熙康提交的数据全部转为utf-8编码
- map<string, string>::iterator iterA = mapParam.begin();
- for(iterA; iterA!=mapParam.end(); iterA++)
- {
- string stringUtf8Value;
- CUtil::GBKToUTF8(iterA->second, stringUtf8Value);
- if(m_enumXiKangCommandType == SEARCH_PATIENT_ID_XIKANG)
- {
- string stringEncodeUtf8Value;
- URI::encode(stringUtf8Value, "", stringEncodeUtf8Value);
- stringUtf8Value = stringEncodeUtf8Value;
- }
- mapParam[iterA->first] = stringUtf8Value;
- }
- //使用token,处理参数
- if(m_enumXiKangCommandType != GET_TOKEN_XIKANG)
- {
- if(m_enumXiKangCommandType!=LOGIN_XIKANG && m_enumXiKangCommandType!=GET_PATIENT_ID_XIKANG &&
- m_enumXiKangCommandType!=GET_PATIENT_INFO_XIKANG && m_enumXiKangCommandType!=SEARCH_PATIENT_ID_XIKANG &&
- /*m_enumXiKangCommandType!=GET_CASE_LIST_XIKANG && m_enumXiKangCommandType!=SUBMIT_CASE_XIKANG && */
- m_enumXiKangCommandType!=UPLOAD_FILE_XIKANG && m_enumXiKangCommandType!=GET_REPORT_URL_XIKANG)
- {
- map<string, string>::iterator iter = mapParam.begin();
- stringHttpBody = iter->second;
- mapParam.clear();
- }
- DateTime dt;
- //dt += Timespan(Timezone::utcOffset(), 0);
- mapParam["time"] = CUtil::Int64ToString(dt.timestamp().epochMicroseconds());
- mapParam["access_token"] = m_stringToken_XiKang;
- string stringParamString;
- string stringMd5;
- map<string, string>::iterator iter = mapParam.begin();
- for(iter; iter!=mapParam.end(); iter++)
- {
- stringParamString += iter->first;
- stringParamString += "=";
- if(m_enumXiKangCommandType == SEARCH_PATIENT_ID_XIKANG)
- {
- string stringDecodeUtf8Value;
- URI::decode(iter->second, stringDecodeUtf8Value);
- stringParamString += stringDecodeUtf8Value;
- }
- else
- {
- stringParamString += iter->second;
- }
- }
- stringParamString += CPhmsSession::m_stringClientSecret_XiKang;
- stringMd5 = CUtil::GetMd5(stringParamString.c_str(), stringParamString.size());
- std::transform(stringMd5.begin(), stringMd5.end(), stringMd5.begin(),::tolower);
- mapParam["sign"] = stringMd5;
- }
- //不同的m_enumXiKangCommandType,区分get和post
- if(m_enumXiKangCommandType==LOGIN_XIKANG || m_enumXiKangCommandType==GET_PATIENT_ID_XIKANG ||
- m_enumXiKangCommandType==GET_PATIENT_INFO_XIKANG || m_enumXiKangCommandType==SEARCH_PATIENT_ID_XIKANG ||
- m_enumXiKangCommandType==GET_REPORT_URL_XIKANG)
- {
- nRet = m_pHttpSession->ExeceteGetHttpSession(netConfig, mapParam, pInputStream);
- }
- else if(m_enumXiKangCommandType==GET_TOKEN_XIKANG || /*m_enumXiKangCommandType==GET_CASE_LIST_XIKANG || */
- /*m_enumXiKangCommandType==SUBMIT_CASE_XIKANG || */m_enumXiKangCommandType==UPLOAD_FILE_XIKANG)
- {
- nRet = m_pHttpSession->ExecuteFormHttpSession(netConfig, mapParam, stringDataPath, pInputStream);
- }
- else
- {
- nRet = m_pHttpSession->ExeceteCommonPostSession(netConfig, mapParam, "application/json", stringHttpBody, pInputStream);
- }
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = NoPhmsGetResult(pInputStream);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ExecuteXinJieSession(string stringBase64Content, bool bMustSsl)
- {
- CNetConfig netConfig;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- //设置网络环境
- try
- {
- string stringWorkingDir = CUtil::GetCurrentAppDir();
- EnumNetConfigType enumNetConfigType = this->GetNetConfigType();
- nRet = this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl, enumNetConfigType);
- //nRet = this->GetXinJieNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
- if(bMustSsl)
- {
- if(!m_bSsl)
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(bMustSsl);
- m_bSsl = bMustSsl;
- }
- }
- else
- {
- if(m_bSsl != netConfig.GetSsl())
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(netConfig.GetSsl());
- m_bSsl = netConfig.GetSsl();
- }
- }
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_NO_NET_CONFIG_FILE;
- }
- istream* pInputStream = NULL;
- nRet = m_pHttpSession->ExecuteXmlHttpSession(netConfig, stringBase64Content, pInputStream);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = NoPhmsGetResult(pInputStream);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- //非PHMS协议接口
- int CPhmsSession::ExecuteNoPhmsSession(string stringUrl, int bContinue, bool bMustSsl)
- {
- CNetConfig netConfig;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- //设置网络环境
- try
- {
- string stringWorkingDir = CUtil::GetCurrentAppDir();
- nRet = this->GetNoPhmsNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, stringUrl, bMustSsl);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
- if(bMustSsl)
- {
- if(!m_bSsl)
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(bMustSsl);
- m_bSsl = bMustSsl;
- }
- }
- else
- {
- if(m_bSsl != netConfig.GetSsl())
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(netConfig.GetSsl());
- m_bSsl = netConfig.GetSsl();
- }
- }
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_NO_NET_CONFIG_FILE;
- }
- istream* pInputStream = NULL;
- nRet = m_pHttpSession->ExecuteNoPhmsHttpSession(netConfig, pInputStream, bContinue, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = NoPhmsGetResult(pInputStream);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ExecuteFormHttpSession(string stringHost, string stringUrl, map<string, string> mapParam, bool bMustSsl)
- {
- CNetConfig netConfig;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- //设置网络环境
- try
- {
- string stringWorkingDir = CUtil::GetCurrentAppDir();
- nRet = this->GetFormNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, stringHost, stringUrl, bMustSsl);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
- if(bMustSsl)
- {
- if(!m_bSsl)
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(bMustSsl);
- m_bSsl = bMustSsl;
- }
- }
- else
- {
- if(m_bSsl != netConfig.GetSsl())
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(netConfig.GetSsl());
- m_bSsl = netConfig.GetSsl();
- }
- }
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_NO_NET_CONFIG_FILE;
- }
- istream* pInputStream = NULL;
- nRet = m_pHttpSession->ExecuteFormHttpSession(netConfig, mapParam, pInputStream);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = NoPhmsGetResult(pInputStream);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetSessionId(int nSaveType, string stringContent, string stringFilePath)
- {
- int nRet = 0;
- m_stringSessionId = "";
- nRet = CUtil::GetXmlFieldVaule(nSaveType, stringContent, stringFilePath, "sid", m_stringSessionId);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- if(m_stringSessionId.size() == 0)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_SID), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_NO_SID;
- }
- return nRet;
- }
- string CPhmsSession::GetXiKangToken(int nSaveType, string stringContent, string stringFilePath)
- {
- map<string, string> mapResult;
- CUtil::ParseJsonObjectWithoutArray(nSaveType, stringContent, stringFilePath, mapResult);
- return mapResult["access_token"];
- }
- int CPhmsSession::GetRequestXml(AutoPtr<Document> pDoc, string& stringXmlContent)
- {
- string stringWorkingDir = CUtil::GetCurrentAppDir();
- string stringIniFilePath = stringWorkingDir+"PhmsConfig.ini";
- AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringIniFilePath, "gbk");
- string stringEncoding = iniFile->getString("OTHER.Encoding", "GBK");
- DOMWriter domWriter;
- //ProcessingInstruction和XMLWriter::WRITE_XML_DECLARATION 只用一个就好,都用会写两个头
- domWriter.setOptions(XMLWriter::WRITE_XML_DECLARATION | XMLWriter::PRETTY_PRINT);
- domWriter.setNewLine(XMLWriter::NEWLINE_CRLF);
- domWriter.setIndent(" ");
- TextEncoding* pEnvEncoding = TextEncoding::find(stringEncoding);
- TextEncoding* pUtf8Encoding = TextEncoding::find("UTF-8");
- //domWriter.setEncoding(stringEncoding, *pEnvEncoding);
- domWriter.setEncoding("UTF-8", *pUtf8Encoding);
- domWriter.setInputEncoding(*pEnvEncoding);
-
- std::ostringstream oStringStream;
- Base64Encoder encoderBase64(oStringStream);
- encoderBase64.rdbuf()->setLineLength(0);
- try
- {
- domWriter.writeNode(encoderBase64,pDoc);
- // ostringstream oStringStreamXmlContent;
- // domWriter.writeNode(oStringStreamXmlContent, pDoc);
- // CPhmsLogger::GetPhmsLogger()->WriteLog(oStringStreamXmlContent.str(), __FUNCTION__, __FILE__, __LINE__);
- // domWriter.writeNode(cout, pDoc);
- // cout<<endl<<endl;
- }
- catch(Exception& e)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_WRITE_XML_ERROR), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_WRITE_XML_ERROR;
- }
- encoderBase64.close();
- stringXmlContent = oStringStream.str();
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetRequestXml(string stringFilePath, string& stringXmlContent)
- {
-
- std::ostringstream oStringStream;
- Base64Encoder encoderBase64(oStringStream);
- encoderBase64.rdbuf()->setLineLength(0);
- try
- {
- std::ifstream ifStream;
- ifStream.exceptions(ios::badbit);
- ifStream.open(stringFilePath.c_str());
- StreamCopier::copyStream(ifStream, encoderBase64);
- }
- catch(Exception& e)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_WRITE_XML_ERROR), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_WRITE_XML_ERROR;
- }
- catch (ios::failure& e)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(e.what(), __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_READ_FAIL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_FILE_READ_FAIL;
- }
- encoderBase64.close();
- stringXmlContent = oStringStream.str();
- //体检机组的xml趋势文件转码并修改xml编码声明
- string stringWorkingDir = CUtil::GetCurrentAppDir();
- string stringIniFilePath = stringWorkingDir+"PhmsConfig.ini";
- AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringIniFilePath, "gbk");
- string stringEncoding = iniFile->getString("OTHER.Encoding", "GBK");
- TextEncoding* pEnvEncoding = TextEncoding::find(stringEncoding);
- TextEncoding* pUtf8Encoding = TextEncoding::find("UTF-8");
- TextConverter converter(*pEnvEncoding, *pUtf8Encoding);
- string stringTempXmlContent;
- converter.convert(stringXmlContent, stringTempXmlContent);
- string stringSrc = "encoding=\"";
- stringSrc += stringEncoding;
- stringSrc += "\"?>";
- string stringDst = "encoding=\"UTF-8\"?>";
- CUtil::ReplaceString(stringTempXmlContent, stringSrc, stringDst);
- stringXmlContent = stringTempXmlContent;
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetRequestXmlNoBase64(Poco::AutoPtr<Poco::XML::Document> pDoc, string& stringXmlContent, bool bUtf8)
- {
- string stringWorkingDir = CUtil::GetCurrentAppDir();
- string stringIniFilePath = stringWorkingDir+"PhmsConfig.ini";
- AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringIniFilePath, "gbk");
- string stringEncoding = iniFile->getString("OTHER.Encoding", "GBK");
- DOMWriter domWriter;
- //ProcessingInstruction和XMLWriter::WRITE_XML_DECLARATION 只用一个就好,都用会写两个头
- domWriter.setOptions(XMLWriter::WRITE_XML_DECLARATION/*XMLWriter::CANONICAL_XML*/ | XMLWriter::PRETTY_PRINT);
- domWriter.setNewLine(XMLWriter::NEWLINE_CRLF);
- domWriter.setIndent(" ");
- TextEncoding* pEnvEncoding = TextEncoding::find(stringEncoding);
-
- UTF8Encoding utf8Encoding;
- if(bUtf8)
- {
- domWriter.setEncoding("UTF-8", utf8Encoding);
- domWriter.setInputEncoding(*pEnvEncoding);
- }
- else
- {
- domWriter.setEncoding(stringEncoding, *pEnvEncoding);
- domWriter.setInputEncoding(*pEnvEncoding);
- }
-
- std::ostringstream oStringStream;
- try
- {
- domWriter.writeNode(oStringStream,pDoc);
- ofstream of;
- of.open("./Request.xml", ios_base::binary|ios_base::trunc);
- domWriter.writeNode(of, pDoc);
- of.close();
- // domWriter.writeNode(cout, pDoc);
- // cout<<endl<<endl;
- }
- catch(Exception& e)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_WRITE_XML_ERROR), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_WRITE_XML_ERROR;
- }
- stringXmlContent = oStringStream.str();
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetRequestXmlForAESAndBase64(Poco::AutoPtr<Poco::XML::Document> pDoc, string& stringXmlContent)
- {
- string stringWorkingDir = CUtil::GetCurrentAppDir();
- string stringIniFilePath = stringWorkingDir+"PhmsConfig.ini";
- AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringIniFilePath, "gbk");
- string stringEncoding = iniFile->getString("OTHER.Encoding", "GBK");
- DOMWriter domWriter;
- //ProcessingInstruction和XMLWriter::WRITE_XML_DECLARATION 只用一个就好,都用会写两个头
- domWriter.setOptions(XMLWriter::WRITE_XML_DECLARATION | XMLWriter::PRETTY_PRINT);
- domWriter.setNewLine(XMLWriter::NEWLINE_CRLF);
- domWriter.setIndent(" ");
- TextEncoding* pEnvEncoding = TextEncoding::find(stringEncoding);
- domWriter.setEncoding(stringEncoding, *pEnvEncoding);
- domWriter.setInputEncoding(*pEnvEncoding);
- std::ostringstream oStringStream;
- try
- {
- domWriter.writeNode(oStringStream,pDoc);
- }
- catch(Exception& e)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_WRITE_XML_ERROR), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_WRITE_XML_ERROR;
- }
- string stringIn = oStringStream.str();
- //使用0102030405060708作为密钥进行AES加密,并将加密的结果进行base64编码
- CipherKey::ByteVec secret;
- CipherKey::ByteVec vi;
- string::iterator iter;
- string stringSecret = "0102030405060708";
- for(iter=stringSecret.begin(); iter!=stringSecret.end(); iter++)
- {
- secret.push_back(*iter);
- vi.push_back(*iter);
- }
- Cipher::Ptr pCipher = CipherFactory::defaultFactory().createCipher(CipherKey("aes128", secret, vi));
- std::string stringOut = pCipher->encryptString(stringIn, Cipher::ENC_BASE64);
-
- for(iter=stringOut.begin(); iter!=stringOut.end(); iter++)
- {
- if(*iter == '*')
- {
- *iter = '+';
- }
- }
- stringXmlContent = stringOut;
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetNetConfig(string stringFilePath, CNetConfig& netConfig, bool bMustSsl, EnumNetConfigType enumNetConfigType)
- {
- switch(enumNetConfigType)
- {
- case GW_FORM:
- return GetGWNetConfig(stringFilePath, netConfig, bMustSsl);
- case DIRECTLY_TO_HIS:
- return GetDirectlyToHisConfig(stringFilePath, netConfig, bMustSsl);
- case XINJIE_XML:
- return GetXinJieNetConfig(stringFilePath, netConfig, bMustSsl);
- case XIKANG_FORM:
- return GetXiKangNetConfig(stringFilePath, netConfig, bMustSsl);
- case GUANXIN_FORM:
- return GetGuanXinNetConfig(stringFilePath, netConfig, bMustSsl);
- case TELECOM_XML:
- return GetXmlNetConfig_Telecom(stringFilePath, netConfig, bMustSsl);
- case DAOYI_XML:
- return GetXmlNetConfig(stringFilePath, netConfig, bMustSsl);
- case ORIGINAL_PHMS:
- default:
- return GetNetConfig(stringFilePath, netConfig, bMustSsl);
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetNetConfig(string stringFilePath, CNetConfig& netConfig, bool bMustSsl)
- {
- try
- {
- AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
- string stringContent;
- unsigned short nContent;
- istringstream iStringStream;
- if(g_stringContecServerAddr.size() == 0)
- {
- if(!m_bUseIp && m_enumPhmsCommandType==LOGIN_TYPE)
- {
- stringContent = iniFile->getString("NET.SERVER_NAME", "data2.contec365.com");
- if(stringContent.size() == 0)
- {
- stringContent = "data2.contec365.com";
- }
- }
- else
- {
- string stringPriorIp = CAllObjectManagerUtil::GetPriorIp();
- if(stringPriorIp.size() != 0)
- {
- stringContent = stringPriorIp;
- }
- else
- {
- if(iniFile->has("NET.IP"))
- {
- stringContent = iniFile->getString("NET.IP", "");
- if(stringContent.size() == 0)
- {
- stringContent = iniFile->getString("NET.SERVER_NAME", "data2.contec365.com");
- if(stringContent.size() == 0)
- {
- stringContent = "data2.contec365.com";
- }
- }
- }
- else
- {
- stringContent = iniFile->getString("NET.SERVER_NAME", "data2.contec365.com");
- if(stringContent.size() == 0)
- {
- stringContent = "data2.contec365.com";
- }
- }
- }
- }
- netConfig.SetAddr(stringContent);
- stringContent = iniFile->getString("NET.SERVER_NAME", "data2.contec365.com");
- if(stringContent.size() == 0)
- {
- stringContent = "data2.contec365.com";
- }
- netConfig.SetHost(stringContent);
- }
- else
- {
- netConfig.SetAddr(g_stringContecServerAddr);
- netConfig.SetHost(g_stringContecServerAddr);
- }
- if(!bMustSsl)
- {
- stringContent = iniFile->getString("NET.SSL", "0");
- if(stringContent == "1")
- {
- netConfig.SetSsl(true);
- }
- else
- {
- netConfig.SetSsl(false);
- }
- if(g_stringContecServerPort.size() == 0)
- {
- if(netConfig.GetSsl())
- {
- stringContent = iniFile->getString("NET.SSL_PORT", "443");
- }
- else
- {
- stringContent = iniFile->getString("NET.PORT", "80");
- }
-
- }
- else
- {
- stringContent = g_stringContecServerPort;
- }
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetPort(nContent);
- }
- else
- {
- netConfig.SetSsl(true);
- stringContent = iniFile->getString("NET.SSL_PORT", "443");
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetPort(nContent);
- }
-
- switch(m_enumPhmsCommandType)
- {
- case LOGIN_TYPE:
- stringContent = iniFile->getString("NET.LOGIN_URI", "/login.php");
- break;
- case MAIN_TYPE:
- stringContent = iniFile->getString("NET.MAIN_URI", "/main.php");
- break;
- case CHANGE_INFO_TYPE:
- stringContent = iniFile->getString("NET.LOGIN_URI", "/login.php");
- break;
- case REGISTER_TYPE:
- stringContent = iniFile->getString("NET.REGISTER_URI", "/register.php");
- break;
- default:
- stringContent = iniFile->getString("NET.MAIN_URI", "/main.php");
- break;
- }
- netConfig.SetUrl(stringContent);
- stringContent = iniFile->getString("GENERAL.NETWORK", "0");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- switch (nContent)
- {
- case 0:
- netConfig.SetProxyType(NO_PROXY);
- break;
- case 1:
- netConfig.SetProxyType(HTTP_PROXY);
- break;
- case 2:
- netConfig.SetProxyType(SOCK_PROXY);
- break;
- default:
- netConfig.SetProxyType(NO_PROXY);
- break;
- }
- stringContent = iniFile->getString("PROXY.IP", "");
- netConfig.SetProxyAddr(stringContent);
- stringContent = iniFile->getString("PROXY.PORT", "");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetProxyPort(nContent);
- stringContent = iniFile->getString("PROXY.USERNAME", "");
- netConfig.SetProxyUsername(stringContent);
- stringContent = iniFile->getString("PROXY.PASSWORD", "");
- netConfig.SetProxyPassword(stringContent);
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- throw;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetNoPhmsNetConfig(string stringFilePath, CNetConfig& netConfig, string stringUrl, bool bMustSsl)
- {
- try
- {
- AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
- string stringContent;
- unsigned short nContent;
- istringstream iStringStream;
- if(stringUrl[0] =='/' || stringUrl.find("file://")!=string::npos || stringUrl.find("data2.contec365.com")!=string::npos)
- {
- if(g_stringContecServerAddr.size() == 0)
- {
- string stringPriorIp = CAllObjectManagerUtil::GetPriorIp();
- if(stringPriorIp.size() != 0)
- {
- stringContent = stringPriorIp;
- }
- else
- {
- if(iniFile->has("NET.IP"))
- {
- stringContent = iniFile->getString("NET.IP", "");
- if(stringContent.size() == 0)
- {
- stringContent = iniFile->getString("NET.SERVER_NAME", "data2.contec365.com");
- if(stringContent.size() == 0)
- {
- stringContent = "data2.contec365.com";
- }
- }
- }
- else
- {
- stringContent = iniFile->getString("NET.SERVER_NAME", "data2.contec365.com");
- if(stringContent.size() == 0)
- {
- stringContent = "data2.contec365.com";
- }
- }
- }
- netConfig.SetAddr(stringContent);
- stringContent = iniFile->getString("NET.SERVER_NAME", "data2.contec365.com");
- if(stringContent.size() == 0)
- {
- stringContent = "data2.contec365.com";
- }
- netConfig.SetHost(stringContent);
- }
- else
- {
- netConfig.SetAddr(g_stringContecServerAddr);
- netConfig.SetHost(g_stringContecServerAddr);
- }
- if(!bMustSsl)
- {
- if(g_stringContecServerPort.size() == 0)
- {
- stringContent = iniFile->getString("NET.PORT", "80");
- }
- else
- {
- stringContent = g_stringContecServerPort;
- }
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetPort(nContent);
- stringContent = iniFile->getString("NET.SSL", "0");
- if(stringContent == "1")
- {
- netConfig.SetSsl(true);
- }
- else
- {
- netConfig.SetSsl(false);
- }
- }
- else
- {
- netConfig.SetPort(443);
- netConfig.SetSsl(true);
- }
- netConfig.SetUrl(stringUrl);
- }
- else
- {
- string stringHTTPMark = "http://";
- if(stringUrl.find(stringHTTPMark) != string::npos)
- {
- stringUrl = stringUrl.substr(stringHTTPMark.size(), stringUrl.size()-stringHTTPMark.size());
- }
- if(stringUrl.find(":")!=string::npos && stringUrl.find(":")<stringUrl.find("/"))
- {
- stringContent = stringUrl.substr(0, stringUrl.find(":"));
- netConfig.SetAddr(stringContent);
- netConfig.SetHost(stringContent);
- stringContent = stringUrl.substr(stringUrl.find(":")+1, stringUrl.find("/")-stringUrl.find(":")-1);
- netConfig.SetPort(CUtil::StringToULong(stringContent));
- }
- else
- {
- stringContent = stringUrl.substr(0, stringUrl.find("/"));
- netConfig.SetAddr(stringContent);
- netConfig.SetHost(stringContent);
- netConfig.SetPort(80);
- }
- netConfig.SetSsl(false);
- stringContent = stringUrl.substr(stringUrl.find("/"), string::npos);
- netConfig.SetUrl(stringContent);
- }
- stringContent = iniFile->getString("GENERAL.NETWORK", "0");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- switch (nContent)
- {
- case 0:
- netConfig.SetProxyType(NO_PROXY);
- break;
- case 1:
- netConfig.SetProxyType(HTTP_PROXY);
- break;
- case 2:
- netConfig.SetProxyType(SOCK_PROXY);
- break;
- default:
- netConfig.SetProxyType(NO_PROXY);
- break;
- }
- stringContent = iniFile->getString("PROXY.IP", "");
- netConfig.SetProxyAddr(stringContent);
- stringContent = iniFile->getString("PROXY.PORT", "");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetProxyPort(nContent);
- stringContent = iniFile->getString("PROXY.USERNAME", "");
- netConfig.SetProxyUsername(stringContent);
- stringContent = iniFile->getString("PROXY.PASSWORD", "");
- netConfig.SetProxyPassword(stringContent);
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- throw;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetXmlNetConfig(string stringFilePath, CNetConfig& netConfig, bool bMustSsl)
- {
- try
- {
- AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
- string stringContent;
- unsigned short nContent;
- istringstream iStringStream;
- stringContent = iniFile->getString("NET.XML_SERVER_NAME", "crm.999120.net");
- netConfig.SetAddr(stringContent);
- netConfig.SetHost(stringContent);
- if(!bMustSsl)
- {
- stringContent = iniFile->getString("NET.XML_PORT", "80");
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetPort(nContent);
- stringContent = iniFile->getString("NET.SSL", "0");
- if(stringContent == "1")
- {
- netConfig.SetSsl(true);
- }
- else
- {
- netConfig.SetSsl(false);
- }
- }
- else
- {
- netConfig.SetPort(443);
- netConfig.SetSsl(true);
- }
- switch(m_enumXmlCommandType)
- {
- case SELECT_DOCTOR_TYPE:
- stringContent = iniFile->getString("NET.XML_SELECT_DOCTOR_URI", "/interface/select_doctor_new.aspx");
- break;
- case PAY_VERIFICATION_TYPE:
- stringContent = iniFile->getString("NET.XML_PAY_VERIFICATION_URI", "/interface/pay_verification_new.aspx");
- break;
- case PAY_VERIFICATION_CASE_TYPE:
- stringContent = iniFile->getString("NET.XML_PAY_VERIFICATION_CASE_URI", "/interface/pay_verification_case_new.aspx");
- break;
- default:
- stringContent = "";
- break;
- }
- netConfig.SetUrl(stringContent);
- stringContent = iniFile->getString("GENERAL.NETWORK", "0");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- switch (nContent)
- {
- case 0:
- netConfig.SetProxyType(NO_PROXY);
- break;
- case 1:
- netConfig.SetProxyType(HTTP_PROXY);
- break;
- case 2:
- netConfig.SetProxyType(SOCK_PROXY);
- break;
- default:
- netConfig.SetProxyType(NO_PROXY);
- break;
- }
- stringContent = iniFile->getString("PROXY.IP", "");
- netConfig.SetProxyAddr(stringContent);
- stringContent = iniFile->getString("PROXY.PORT", "");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetProxyPort(nContent);
- stringContent = iniFile->getString("PROXY.USERNAME", "");
- netConfig.SetProxyUsername(stringContent);
- stringContent = iniFile->getString("PROXY.PASSWORD", "");
- netConfig.SetProxyPassword(stringContent);
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- throw;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetXmlNetConfig_Telecom(string stringFilePath, CNetConfig& netConfig, bool bMustSsl)
- {
- try
- {
- AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
- string stringContent;
- unsigned short nContent;
- istringstream iStringStream;
- stringContent = iniFile->getString("NET.XML_TELECOM_SERVER", "61.178.98.104");
- netConfig.SetAddr(stringContent);
- netConfig.SetHost(stringContent);
- if(!bMustSsl)
- {
- stringContent = iniFile->getString("NET.XML_TELECOM_PORT", "8088");
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetPort(nContent);
- stringContent = iniFile->getString("NET.XML_TELECOM_SSL", "0");
- if(stringContent == "1")
- {
- netConfig.SetSsl(true);
- }
- else
- {
- netConfig.SetSsl(false);
- }
- }
- else
- {
- netConfig.SetPort(443);
- netConfig.SetSsl(true);
- }
- switch(m_enumXmlCommandType_Telecom)
- {
- case USER_AUTH:
- stringContent = iniFile->getString("NET.XML_TELECOM_AUTH", "/lecare-sync/user/userAuthorize");
- break;
- case SYNC_BP:
- stringContent = iniFile->getString("NET.XML_TELECOM_BP", "/lecare-sync/syncBloodPress");
- break;
- case SYNC_BO:
- stringContent = iniFile->getString("NET.XML_TELECOM_BO", "/lecare-sync/syncBloodOxygen");
- break;
- case SYNC_HW:
- stringContent = iniFile->getString("NET.XML_TELECOM_HW", "/lecare-sync/syncHeightWeight");
- break;
- case SYNC_BS:
- stringContent = iniFile->getString("NET.XML_TELECOM_BS", "/lecare-sync/syncBloodGlucose");
- break;
- case SYNC_LUNG:
- stringContent = iniFile->getString("NET.XML_TELECOM_LUNG", "/lecare-sync/syncLungfunction");
- break;
- case SYNC_ECG:
- stringContent = iniFile->getString("NET.XML_TELECOM_ECG", "/lecare-sync/syncEcg");
- break;
- }
- netConfig.SetUrl(stringContent);
- stringContent = iniFile->getString("GENERAL.NETWORK", "0");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- switch (nContent)
- {
- case 0:
- netConfig.SetProxyType(NO_PROXY);
- break;
- case 1:
- netConfig.SetProxyType(HTTP_PROXY);
- break;
- case 2:
- netConfig.SetProxyType(SOCK_PROXY);
- break;
- default:
- netConfig.SetProxyType(NO_PROXY);
- break;
- }
- stringContent = iniFile->getString("PROXY.IP", "");
- netConfig.SetProxyAddr(stringContent);
- stringContent = iniFile->getString("PROXY.PORT", "");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetProxyPort(nContent);
- stringContent = iniFile->getString("PROXY.USERNAME", "");
- netConfig.SetProxyUsername(stringContent);
- stringContent = iniFile->getString("PROXY.PASSWORD", "");
- netConfig.SetProxyPassword(stringContent);
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- throw;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetXinJieNetConfig(string stringFilePath, CNetConfig& netConfig, bool bMustSsl)
- {
- try
- {
- AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
- string stringContent;
- unsigned short nContent;
- istringstream iStringStream;
- stringContent = iniFile->getString("NET.XINJIE_SERVER_NAME", "36.33.16.12");
- netConfig.SetAddr(stringContent);
- netConfig.SetHost(stringContent);
- if(!bMustSsl)
- {
- stringContent = iniFile->getString("NET.SSL", "0");
- if(stringContent == "1")
- {
- netConfig.SetSsl(true);
- }
- else
- {
- netConfig.SetSsl(false);
- }
- if(netConfig.GetSsl())
- {
- stringContent = iniFile->getString("NET.XINJIE_SERVER_SSL_PORT", "443");
- }
- else
- {
- stringContent = iniFile->getString("NET.XINJIE_SERVER_PORT", "9508");
- }
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetPort(nContent);
- }
- else
- {
- stringContent = iniFile->getString("NET.XINJIE_SERVER_SSL_PORT", "443");
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetPort(nContent);
- netConfig.SetSsl(true);
- }
- switch(m_enumXinJieCommandType)
- {
- case VALIDATE_PAY:
- stringContent = iniFile->getString("NET.XINJIE_PAY_VERIFICATION_URI", "/dataSynchronization/checkRrn.do");
- break;
- case NOTIFY_PAY:
- stringContent = iniFile->getString("NET.XINJIE_PAY_NOTIFY_URI", "/dataSynchronization/uploadSuccessfully.do");
- break;
- }
-
- netConfig.SetUrl(stringContent);
- stringContent = iniFile->getString("GENERAL.NETWORK", "0");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- switch (nContent)
- {
- case 0:
- netConfig.SetProxyType(NO_PROXY);
- break;
- case 1:
- netConfig.SetProxyType(HTTP_PROXY);
- break;
- case 2:
- netConfig.SetProxyType(SOCK_PROXY);
- break;
- default:
- netConfig.SetProxyType(NO_PROXY);
- break;
- }
- stringContent = iniFile->getString("PROXY.IP", "");
- netConfig.SetProxyAddr(stringContent);
- stringContent = iniFile->getString("PROXY.PORT", "");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetProxyPort(nContent);
- stringContent = iniFile->getString("PROXY.USERNAME", "");
- netConfig.SetProxyUsername(stringContent);
- stringContent = iniFile->getString("PROXY.PASSWORD", "");
- netConfig.SetProxyPassword(stringContent);
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- throw;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetGuanXinNetConfig(string stringFilePath, CNetConfig& netConfig, bool bMustSsl)
- {
- try
- {
- AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
- string stringContent;
- unsigned short nContent;
- istringstream iStringStream;
- //stringContent = iniFile->getString("NET.GUANXIN_SERVER_NAME", "114.247.234.148");
- switch(m_enumGuanXinCommandType)
- {
- case ACCESSTOKEN:
- case PERSONINFO:
- case SESSION:
- case UPLOADPERSONINFO:
- stringContent = iniFile->getString("NET.GUANXIN_SERVER_NAME", "114.247.234.153");
- break;
- case UPLOADECG:
- case UPLOADNONECG:
- case UPLOADMONITOR:
- stringContent = iniFile->getString("NET.GUANXIN_SERVER_NAME2", "114.247.234.153");
- break;
- }
-
- netConfig.SetAddr(stringContent);
- netConfig.SetHost(stringContent);
- // if(m_enumGuanXinCommandType != PERSONINFO)
- // {
- // stringContent = iniFile->getString("NET.GUANXIN_PORT_TOKEN", "8044");
- // }
- // else
- // {
- // stringContent = iniFile->getString("NET.GUANXIN_PORT_INFO", "8049");
- // }
- switch(m_enumGuanXinCommandType)
- {
- case ACCESSTOKEN:
- case PERSONINFO:
- case SESSION:
- case UPLOADPERSONINFO:
- stringContent = iniFile->getString("NET.GUANXIN_PORT_TOKEN", "8081");
- break;
- case UPLOADECG:
- case UPLOADNONECG:
- case UPLOADMONITOR:
- stringContent = iniFile->getString("NET.GUANXIN_PORT_TOKEN2", "8081");
- break;
- }
-
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetPort(nContent);
- if(!bMustSsl)
- {
- netConfig.SetSsl(false);
- }
- else
- {
- netConfig.SetSsl(true);
- }
- switch(m_enumGuanXinCommandType)
- {
- case ACCESSTOKEN:
- //stringContent = iniFile->getString("NET.GUANXIN_ACCESSTOKEN_URI", "/auth-service/oauth/2.0/token");
- stringContent = iniFile->getString("NET.GUANXIN_ACCESSTOKEN_URI", "/chss/web/ytjlogin");
- break;
- case PERSONINFO:
- //stringContent = iniFile->getString("NET.GUANXIN_PERSONINFO_URI", "/chss/web/findMember");
- stringContent = iniFile->getString("NET.GUANXIN_PERSONINFO_URI", "/chss/web/findMember");
- break;
- case SESSION:
- //stringContent = iniFile->getString("NET.GUANXIN_SESSION_URI", "/auth-service/oauth/2.0/session");
- break;
- case UPLOADECG:
- stringContent = iniFile->getString("NET.GUANXIN_UPLOADECG_URI", "/ytj/execute/uploadECGData");
- break;
- case UPLOADNONECG:
- stringContent = iniFile->getString("NET.GUANXIN_UPLOADNONECG_URI", "/ytj/execute/uploadOtherData");
- break;
- case UPLOADMONITOR:
- stringContent = iniFile->getString("NET.GUANXIN_UPLOADMONITOR_URI", "/ytj/execute/uploadCheckData");
- break;
- case UPLOADPERSONINFO:
- stringContent = iniFile->getString("NET.GUANXIN_UPLOADPERSONINFO_URI", "/ytj/execute/uploadPersonInfo");
- break;
- }
- netConfig.SetUrl(stringContent);
- stringContent = iniFile->getString("GENERAL.NETWORK", "0");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- switch (nContent)
- {
- case 0:
- netConfig.SetProxyType(NO_PROXY);
- break;
- case 1:
- netConfig.SetProxyType(HTTP_PROXY);
- break;
- case 2:
- netConfig.SetProxyType(SOCK_PROXY);
- break;
- default:
- netConfig.SetProxyType(NO_PROXY);
- break;
- }
- stringContent = iniFile->getString("PROXY.IP", "");
- netConfig.SetProxyAddr(stringContent);
- stringContent = iniFile->getString("PROXY.PORT", "");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetProxyPort(nContent);
- stringContent = iniFile->getString("PROXY.USERNAME", "");
- netConfig.SetProxyUsername(stringContent);
- stringContent = iniFile->getString("PROXY.PASSWORD", "");
- netConfig.SetProxyPassword(stringContent);
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- throw;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetXiKangNetConfig(string stringFilePath, CNetConfig& netConfig, bool bMustSsl)
- {
- try
- {
- AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
- string stringContent;
- unsigned short nContent;
- istringstream iStringStream;
- switch(m_enumXiKangCommandType)
- {
- case GET_TOKEN_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_TOKEN_SERVER_NAME", "dlpassport.xikang.com");
- break;
- case LOGIN_XIKANG:
- case REGISTER_PATIENT_XIKANG:
- case REGISTER_PATIENT_INFO_XIKANG:
- case BIND_PATIENT_XIKANG:
- case GET_PATIENT_ID_XIKANG:
- case GET_PATIENT_INFO_XIKANG:
- case SEARCH_PATIENT_ID_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_OPENAPI_SERVER_NAME", "dlopen.xikang.com");
- break;
- case GET_CASE_LIST_XIKANG:
- case SUBMIT_CASE_XIKANG:
- case GET_REPORT_URL_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_DHEALTH_SERVER_NAME", "xk.xikang.com");
- break;
- case UPLOAD_FILE_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_UPLOADFILE_SERVER_NAME", "tycyl.xikang.com");
- break;
- default:
- stringContent = iniFile->getString("NET.XIKANG_API_SERVER_NAME", "xxxxx");
- break;
- }
- netConfig.SetAddr(stringContent);
- netConfig.SetHost(stringContent);
-
- switch(m_enumXiKangCommandType)
- {
- case GET_TOKEN_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_TOKEN_PORT", "80");
- break;
- default:
- stringContent = iniFile->getString("NET.XIAKNG_API_PORT", "80");
- break;
- }
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetPort(nContent);
- if(!bMustSsl)
- {
- netConfig.SetSsl(false);
- }
- else
- {
- netConfig.SetSsl(true);
- }
- switch(m_enumXiKangCommandType)
- {
- case GET_TOKEN_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_TOKEN_URI", "/oauth/token");
- break;
- case LOGIN_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_LOGIN_URI", "/openapi/person/account");
- break;
- case REGISTER_PATIENT_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_REGISTER_URI", "/openapi/person/member");
- break;
- case REGISTER_PATIENT_INFO_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_REGISTER_INFO_URI", "/openapi/person/account/{openID}");
- break;
- case BIND_PATIENT_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_BIND_PATIENT_URL", "/openapi/person/membercaregiver/addMemberCaregiver");
- break;
- case GET_PATIENT_ID_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_GET_PATIENT_ID_URI", "/openapi/person/membercaregiver/findMemberCaregiver");
- break;
- case SEARCH_PATIENT_ID_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_SEARCH_PATIENT_ID_URI", "/openapi/person/member/getOpenID");
- break;
- case GET_PATIENT_INFO_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_GET_PATIENT_INFO_URL", "/openapi/person/member/{openID}");
- break;
- //以下为dHealth接口,暂时未加uploadfile接口
- case GET_CASE_LIST_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_GET_CASE_LIST_URI", "/hcservice/rest/ecg/ecgCnst");
- break;
- case SUBMIT_CASE_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_SUBMIT_CASE_URI", "/hcservice/rest/ecg/addEcg");
- break;
- case GET_REPORT_URL_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_GET_REPORT_URL_URI", "/hcservice/rest/ecg/report/{ecgID}");
- break;
- case UPLOAD_FILE_XIKANG:
- stringContent = iniFile->getString("NET.XIKANG_UPLOAD_FILE_URI", "/kt-tmfs/tmfs/ufile");
- break;
- }
- netConfig.SetUrl(stringContent);
- stringContent = iniFile->getString("GENERAL.NETWORK", "0");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- switch (nContent)
- {
- case 0:
- netConfig.SetProxyType(NO_PROXY);
- break;
- case 1:
- netConfig.SetProxyType(HTTP_PROXY);
- break;
- case 2:
- netConfig.SetProxyType(SOCK_PROXY);
- break;
- default:
- netConfig.SetProxyType(NO_PROXY);
- break;
- }
- stringContent = iniFile->getString("PROXY.IP", "");
- netConfig.SetProxyAddr(stringContent);
- stringContent = iniFile->getString("PROXY.PORT", "");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetProxyPort(nContent);
- stringContent = iniFile->getString("PROXY.USERNAME", "");
- netConfig.SetProxyUsername(stringContent);
- stringContent = iniFile->getString("PROXY.PASSWORD", "");
- netConfig.SetProxyPassword(stringContent);
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- throw;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetFormNetConfig(string stringFilePath, CNetConfig& netConfig, string stringHost, string stringUrl, bool bMustSsl)
- {
- try
- {
- AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
- string stringContent;
- unsigned short nContent;
- istringstream iStringStream;
- stringContent = stringHost;
- netConfig.SetAddr(stringContent);
- netConfig.SetHost(stringContent);
- if(!bMustSsl)
- {
- stringContent = iniFile->getString("NET.FORM_PORT", "80");
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetPort(nContent);
- stringContent = iniFile->getString("NET.SSL", "0");
- if(stringContent == "1")
- {
- netConfig.SetSsl(true);
- }
- else
- {
- netConfig.SetSsl(false);
- }
- }
- else
- {
- netConfig.SetPort(443);
- netConfig.SetSsl(true);
- }
- stringContent = stringUrl;
- netConfig.SetUrl(stringContent);
- stringContent = iniFile->getString("GENERAL.NETWORK", "0");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- switch (nContent)
- {
- case 0:
- netConfig.SetProxyType(NO_PROXY);
- break;
- case 1:
- netConfig.SetProxyType(HTTP_PROXY);
- break;
- case 2:
- netConfig.SetProxyType(SOCK_PROXY);
- break;
- default:
- netConfig.SetProxyType(NO_PROXY);
- break;
- }
- stringContent = iniFile->getString("PROXY.IP", "");
- netConfig.SetProxyAddr(stringContent);
- stringContent = iniFile->getString("PROXY.PORT", "");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetProxyPort(nContent);
- stringContent = iniFile->getString("PROXY.USERNAME", "");
- netConfig.SetProxyUsername(stringContent);
- stringContent = iniFile->getString("PROXY.PASSWORD", "");
- netConfig.SetProxyPassword(stringContent);
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- throw;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetGWNetConfig(string stringFilePath, CNetConfig& netConfig, bool bMustSsl)
- {
- try
- {
- AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
- string stringContent;
- unsigned short nContent;
- istringstream iStringStream;
- stringContent = iniFile->getString("NET.GW_SERVER_NAME", "127.0.0.1");
- netConfig.SetAddr(stringContent);
- netConfig.SetHost(stringContent);
- if(!bMustSsl)
- {
- stringContent = iniFile->getString("NET.GW_PORT", "80");
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetPort(nContent);
- netConfig.SetSsl(false);
- }
- else
- {
- stringContent = iniFile->getString("NET.GW_SSL_PORT", "443");
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetPort(nContent);
- netConfig.SetSsl(true);
- }
- stringContent = iniFile->getString("NET.GW_COMMON_PATH", "/xxxx/");
- netConfig.SetUrl(stringContent);
- stringContent = iniFile->getString("GENERAL.NETWORK", "0");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- switch (nContent)
- {
- case 0:
- netConfig.SetProxyType(NO_PROXY);
- break;
- case 1:
- netConfig.SetProxyType(HTTP_PROXY);
- break;
- case 2:
- netConfig.SetProxyType(SOCK_PROXY);
- break;
- default:
- netConfig.SetProxyType(NO_PROXY);
- break;
- }
- stringContent = iniFile->getString("PROXY.IP", "");
- netConfig.SetProxyAddr(stringContent);
- stringContent = iniFile->getString("PROXY.PORT", "");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetProxyPort(nContent);
- stringContent = iniFile->getString("PROXY.USERNAME", "");
- netConfig.SetProxyUsername(stringContent);
- stringContent = iniFile->getString("PROXY.PASSWORD", "");
- netConfig.SetProxyPassword(stringContent);
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- throw;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetDirectlyToHisConfig(string stringFilePath, CNetConfig& netConfig, bool bMustSsl)
- {
- try
- {
- AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
- string stringContent;
- unsigned short nContent;
- istringstream iStringStream;
- stringContent = iniFile->getString("NET.TOHIS_SERVER_NAME", "127.0.0.1");
- netConfig.SetAddr(stringContent);
- netConfig.SetHost(stringContent);
- if(!bMustSsl)
- {
- stringContent = iniFile->getString("NET.TOHIS_PORT", "80");
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetPort(nContent);
- netConfig.SetSsl(false);
- }
- else
- {
- stringContent = iniFile->getString("NET.TOHIS_SSL_PORT", "443");
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetPort(nContent);
- netConfig.SetSsl(true);
- }
- stringContent = iniFile->getString("NET.TOHIS_GET_PATIENT_INFO_FROM_HIS", "/xxxx");
- netConfig.SetUrl(stringContent);
- stringContent = iniFile->getString("GENERAL.NETWORK", "0");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- switch (nContent)
- {
- case 0:
- netConfig.SetProxyType(NO_PROXY);
- break;
- case 1:
- netConfig.SetProxyType(HTTP_PROXY);
- break;
- case 2:
- netConfig.SetProxyType(SOCK_PROXY);
- break;
- default:
- netConfig.SetProxyType(NO_PROXY);
- break;
- }
- stringContent = iniFile->getString("PROXY.IP", "");
- netConfig.SetProxyAddr(stringContent);
- stringContent = iniFile->getString("PROXY.PORT", "");
- iStringStream.clear();
- iStringStream.str(stringContent);
- iStringStream>>nContent;
- netConfig.SetProxyPort(nContent);
- stringContent = iniFile->getString("PROXY.USERNAME", "");
- netConfig.SetProxyUsername(stringContent);
- stringContent = iniFile->getString("PROXY.PASSWORD", "");
- netConfig.SetProxyPassword(stringContent);
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- throw;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::NoPhmsGetResult(istream* pInputStream, int bContinue)
- {
- int nRet = PHMS_SUCCESSFUL_RESULT;
- switch(m_nSaveType)
- {
- case 0:
- //残余的响应内容也收回来,防止影响下次接收
- nRet = NoPhmsInputStreamToString(pInputStream, m_stringContent);
- break;
- case 1:
- nRet = NoPhmsInputStreamToString(pInputStream, m_stringContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- break;
- case 2:
- if(bContinue)
- {
- nRet = NoPhmsInputStreamToFile(pInputStream, m_stringFilePath, false);
- }
- else
- {
- nRet = NoPhmsInputStreamToFile(pInputStream, m_stringFilePath, true);
- }
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- break;
- default:
- break;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::NoPhmsInputStreamToString(istream* pInputStream, string& stringContent)
- {
- //流形式实现
- ostringstream oStringStream;
- oStringStream.exceptions(ios::failbit|ios::badbit);
- pInputStream->exceptions(ios::badbit);
- try
- {
- StreamCopier::copyStream(*pInputStream, oStringStream);
- }
- catch(const std::ios::failure& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e.what(), __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_INPUT_STREAM_FAIL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_INPUT_STREAM_FAIL;
- }
- catch(const TimeoutException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_RECV_TIMEOUT), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_RECV_TIMEOUT;
- }
- catch(const Exception& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_RECV_FAIL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_RECV_FAIL;
- }
- stringContent = oStringStream.str();
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::NoPhmsInputStreamToFile(istream* pInputStream, string& stringFilePath, bool bFileClearBeforeWrite)
- {
- try
- {
- File fileTarget(stringFilePath, "gbk");
- fileTarget.createFile();
- }
- catch(Exception& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_OPEN_FAIL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_FILE_OPEN_FAIL;
- }
- ofstream ofLocalTargetFile;
- ofLocalTargetFile.exceptions(ios::failbit|ios::badbit);
- pInputStream->exceptions(ios::goodbit);
- try
- {
- if(bFileClearBeforeWrite)
- {
- ofLocalTargetFile.open(stringFilePath.c_str(), ios_base::trunc|ios_base::binary);
- }
- else
- {
- //locale localePre = ofLocalTargetFile.imbue(locale(""));//imbue不起作用
- ofLocalTargetFile.open(stringFilePath.c_str(), ios_base::app|ios_base::binary);
- //ofLocalTargetFile.imbue(localePre);
- }
- }
- catch(const ios::failure& error)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(error.what(), __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_OPEN_FAIL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_FILE_OPEN_FAIL;
- }
- pInputStream->exceptions(ios::badbit);
- ofLocalTargetFile.exceptions(ios::failbit|ios::badbit);
- try
- {
- StreamCopier::copyStream(*pInputStream, ofLocalTargetFile);
- }
- catch(const std::ios::failure& e)
- {
- ofLocalTargetFile.close();
- CPhmsLogger::GetPhmsLogger()->WriteLog(e.what(), __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_INPUT_STREAM_FAIL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_INPUT_STREAM_FAIL;
- }
- catch(const TimeoutException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_RECV_TIMEOUT), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_RECV_TIMEOUT;
- }
- catch(const Exception& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_RECV_FAIL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_RECV_FAIL;
- }
- try
- {
- ofLocalTargetFile.flush();
- }
- catch(const ios::failure& error)
- {
- //写日志
- ofLocalTargetFile.close();
- CPhmsLogger::GetPhmsLogger()->WriteLog(error.what(), __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_WRITE_FAIL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_FILE_WRITE_FAIL;
- }
- ofLocalTargetFile.close();
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetHttpExceptionInfo(int& nCode, string& stringMsgName, string& stringMsgText)
- {
- return m_pHttpSession->GetHttpExceptionInfo(nCode, stringMsgName, stringMsgText);
- }
- int CPhmsSession::AbortSession()
- {
- Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
- return m_pHttpSession->AbortSession();
- }
- //public member function
- int CPhmsSession::Login(string stringRole, string stringUsername, string stringPassword, string stringLanguage, string stringToken, bool bMustSsl)
- {
- AutoPtr<Document> pDoc = new Document;
- ////AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildRole = pDoc->createElement("role");
- AutoPtr<Element> pChildLoginId = pDoc->createElement("loginid");
- AutoPtr<Element> pChildPwd = pDoc->createElement("pwd");
- AutoPtr<Element> pChildLanguage = pDoc->createElement("lang");
- AutoPtr<Element> pChildToken = pDoc->createElement("token");
- AutoPtr<Text> pTextRole = pDoc->createTextNode(stringRole);
- AutoPtr<Text> pTextUsername = pDoc->createTextNode(stringUsername);
- AutoPtr<Text> pTextPassword = pDoc->createTextNode(stringPassword);
- AutoPtr<Text> pTextLanguage = pDoc->createTextNode(stringLanguage);
- AutoPtr<Text> pTextToken = pDoc->createTextNode(stringToken);
- pChildRole->appendChild(pTextRole);
- pChildLoginId->appendChild(pTextUsername);
- pChildPwd->appendChild(pTextPassword);
- pChildLanguage->appendChild(pTextLanguage);
- pChildToken->appendChild(pTextToken);
- pRoot->appendChild(pChildRole);
- pRoot->appendChild(pChildLoginId);
- pRoot->appendChild(pChildPwd);
- pRoot->appendChild(pChildLanguage);
- pRoot->appendChild(pChildToken);
- ////pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- //构造PhmsRequest
- string stringSessionId(32, '0');
- CPhmsRequestHead phmsRequestHead("10", "1002", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- //为什么登录的签名是32个0呢????????
- //因为服务器计算签名需要在session中保存由用户名和密码计算出来的md5,调登录时接口未登录,所以签名为32个0
- //phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- m_enumPhmsCommandType = LOGIN_TYPE;//目前只有登录命令是LOGIN_TYPE,改变个人信息命令是CHANGE_INFO_TYPE,用户注册命令是REGISTER_TYPE
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse, bMustSsl);
- m_enumPhmsCommandType = MAIN_TYPE;//其余命令都是MAIN_TYPE
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- //只有登录命令才需要,保存当前在线的用户名和密码,无论是否能正常登录,这样能保证GetResult中验证签名的时候能够正常计算签名
- CPhmsRequest::SetUsername(stringUsername);
- CPhmsRequest::SetPassword(stringPassword);
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- //只有登录(1002)和注册并登录(1086)命令才需要,解析返回的xml,得到sessionid
- nRet = this->GetSessionId(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CSessionIdManager::HandleSessionSync(m_stringSessionId);
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::MechineRegister(string stringCountry, string stringAreaId, string stringArea,
- string stringDevice, string stringSignature, string stringSerialnum)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCountry = pDoc->createElement("country");
- AutoPtr<Element> pChildAreaId = pDoc->createElement("areaid");
- AutoPtr<Element> pChildArea = pDoc->createElement("area");
- AutoPtr<Element> pChildDevice = pDoc->createElement("device");
- AutoPtr<Element> pChildSignature = pDoc->createElement("signature");
- AutoPtr<Element> pChildSerialnum = pDoc->createElement("serialnum");
- AutoPtr<Text> pTextCountry = pDoc->createTextNode(stringCountry);
- AutoPtr<Text> pTextAreaId = pDoc->createTextNode(stringAreaId);
- AutoPtr<Text> pTextArea = pDoc->createTextNode(stringArea);
- AutoPtr<Text> pTextDevice = pDoc->createTextNode(stringDevice);
- AutoPtr<Text> pTextSignature = pDoc->createTextNode(stringSignature);
- AutoPtr<Text> pTextSerialnum = pDoc->createTextNode(stringSerialnum);
- pChildCountry->appendChild(pTextCountry);
- pChildAreaId->appendChild(pTextAreaId);
- pChildArea->appendChild(pTextArea);
- pChildDevice->appendChild(pTextDevice);
- pChildSignature->appendChild(pTextSignature);
- pChildSerialnum->appendChild(pTextSerialnum);
- pRoot->appendChild(pChildCountry);
- pRoot->appendChild(pChildAreaId);
- pRoot->appendChild(pChildArea);
- pRoot->appendChild(pChildDevice);
- pRoot->appendChild(pChildSignature);
- pRoot->appendChild(pChildSerialnum);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- //pDoc->collectGarbage();
- string stringSessionId(32, '0');
- CPhmsRequestHead phmsRequestHead("10", "1001", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- // phmsRequest.GenerateAndSetSign();//签名为32个的原因同登录接口一样
- CPhmsResponse phmsResponse;
- m_enumPhmsCommandType = REGISTER_TYPE;//目前只有登录命令是LOGIN_TYPE,改变个人信息命令是CHANGE_INFO_TYPE,用户注册命令是REGISTER_TYPE
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- m_enumPhmsCommandType = MAIN_TYPE;//其余都是MAIN_TYPE
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::Logout()
- {
- CPhmsRequestHead phmsRequestHead("10", "1003", m_stringSessionId, "10");
- CPhmsRequestBody phmsRequestBody("");
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- m_stringSessionId = "";
- CSessionIdManager::HandleSessionSync("");
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::SetDoctorSign(string stringMd5, string stringFilePath)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildMd5 = pDoc->createElement("md5");
- AutoPtr<Text> pTextMd5 = pDoc->createTextNode(stringMd5);
- pChildMd5->appendChild(pTextMd5);
- pRoot->appendChild(pChildMd5);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1004", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, stringFilePath);
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::SetDoctorPhoto(string stringMd5, string stringFilePath)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildMd5 = pDoc->createElement("md5");
- AutoPtr<Text> pTextMd5 = pDoc->createTextNode(stringMd5);
- pChildMd5->appendChild(pTextMd5);
- pRoot->appendChild(pChildMd5);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1005", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, stringFilePath);
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ApplyNewCase(string stringName, string stringThirdId, string stringDataType, string stringDataTypeName, string stringNotes, string stringHospitalId,
- string stringHospitalName, string stringDoctorId, string stringDoctorName, string stringCheckTime, string stringOtherParams,string stringDeviceId,
- string stringDeviceName, string stringMd5, string stringCaseOrigin, string stringYzlb, string stringSex, string stringApplicationNo, string stringAutoMatic)
- {
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringName:"+stringName, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringThirdId:"+stringThirdId, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringDataType:"+stringDataType, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringDataTypeName:"+stringDataTypeName, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringNotes:"+stringNotes, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringHospitalId:"+stringHospitalId, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringHospitalName:"+stringHospitalName, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringDoctorId:"+stringDoctorId, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringDoctorName:"+stringDoctorName, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringCheckTime:"+stringCheckTime, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringOtherParams:"+stringOtherParams, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringDeviceId:"+stringDeviceId, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringDeviceName:"+stringDeviceName, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringMd5:"+stringMd5, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringCaseOrigin:"+stringCaseOrigin, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringYzlb:"+stringYzlb, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringSex:"+stringSex, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringApplicationNo:"+stringApplicationNo, __FUNCTION__, __FILE__, __LINE__);
- // CPhmsLogger::GetPhmsLogger()->WriteLog("stringAutoMatic:"+stringAutoMatic, __FUNCTION__, __FILE__, __LINE__);
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildName = pDoc->createElement("name");
- AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
- AutoPtr<Element> pChildDataType = pDoc->createElement("datatype");
- AutoPtr<Element> pChildDataTypeName = pDoc->createElement("datatypename");
- AutoPtr<Element> pChildNotes = pDoc->createElement("notes");
- AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
- AutoPtr<Element> pChildHospitalName = pDoc->createElement("hname");
- AutoPtr<Element> pChildDoctorId = pDoc->createElement("doctorid");
- AutoPtr<Element> pChildDoctorName = pDoc->createElement("dname");
- AutoPtr<Element> pChildCheckTime = pDoc->createElement("checktime");
- AutoPtr<Element> pChildOtherParams = pDoc->createElement("otherparams");
- AutoPtr<Element> pChildDeviceId = pDoc->createElement("deviceid");
- AutoPtr<Element> pChildDeviceName = pDoc->createElement("devicename");
- AutoPtr<Element> pChildMd5 = pDoc->createElement("md5");
- AutoPtr<Element> pChildCaseOrigin = pDoc->createElement("caseorigin");
- AutoPtr<Element> pChildYzlb = pDoc->createElement("yzlb");
- AutoPtr<Element> pChildSex = pDoc->createElement("sex");
- AutoPtr<Element> pChildApplicationNo = pDoc->createElement("applicationno");
- AutoPtr<Element> pChildAutoMatic = pDoc->createElement("isautomatic");
- AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
- AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
- AutoPtr<Text> pTextDataType = pDoc->createTextNode(stringDataType);
- AutoPtr<Text> pTextDataTypeName = pDoc->createTextNode(stringDataTypeName);
- AutoPtr<Text> pTextNotes = pDoc->createTextNode(stringNotes);
- AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
- AutoPtr<Text> pTextHospitalName = pDoc->createTextNode(stringHospitalName);
- AutoPtr<Text> pTextDoctorId = pDoc->createTextNode(stringDoctorId);
- AutoPtr<Text> pTextDoctorName = pDoc->createTextNode(stringDoctorName);
- AutoPtr<Text> pTextCheckTime = pDoc->createTextNode(stringCheckTime);
- // //stringOtherParams参数更改xml编码声明,目的是编码统一
- // string stringWorkingDir = CUtil::GetCurrentAppDir();
- // string stringIniFilePath = stringWorkingDir+"PhmsConfig.ini";
- // AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringIniFilePath, "gbk");
- // string stringEncoding = iniFile->getString("OTHER.Encoding", "GBK");
- // string stringSrc = "encoding=\"";
- // stringSrc += stringEncoding;
- // stringSrc += "\"?>";
- // string stringDst = "encoding=\"UTF-8\"?>";
- // CUtil::ReplaceString(stringOtherParams, stringSrc, stringDst);
- AutoPtr<Text> pTextOtherParams = pDoc->createTextNode(stringOtherParams);
- AutoPtr<Text> pTextDeviceId = pDoc->createTextNode(stringDeviceId);
- AutoPtr<Text> pTextDeviceName = pDoc->createTextNode(stringDeviceName);
- AutoPtr<Text> pTextMd5 = pDoc->createTextNode(stringMd5);
- AutoPtr<Text> pTextCaseOrigin = pDoc->createTextNode(stringCaseOrigin);
- AutoPtr<Text> pTextYzlb = pDoc->createTextNode(stringYzlb);
- AutoPtr<Text> pTextSex = pDoc->createTextNode(stringSex);
- AutoPtr<Text> pTextApplicationNo = pDoc->createTextNode(stringApplicationNo);
- AutoPtr<Text> pTextAutoMatic = pDoc->createTextNode(stringAutoMatic);
- pChildName->appendChild(pTextName);
- pChildThirdId->appendChild(pTextThirdId);
- pChildDataType->appendChild(pTextDataType);
- pChildDataTypeName->appendChild(pTextDataTypeName);
- pChildNotes->appendChild(pTextNotes);
- pChildHospitalId->appendChild(pTextHospitalId);
- pChildHospitalName->appendChild(pTextHospitalName);
- pChildDoctorId->appendChild(pTextDoctorId);
- pChildDoctorName->appendChild(pTextDoctorName);
- pChildCheckTime->appendChild(pTextCheckTime);
- pChildOtherParams->appendChild(pTextOtherParams);
- pChildDeviceId->appendChild(pTextDeviceId);
- pChildDeviceName->appendChild(pTextDeviceName);
- pChildMd5->appendChild(pTextMd5);
- pChildCaseOrigin->appendChild(pTextCaseOrigin);
- pChildYzlb->appendChild(pTextYzlb);
- pChildSex->appendChild(pTextSex);
- pChildApplicationNo->appendChild(pTextApplicationNo);
- pChildAutoMatic->appendChild(pTextAutoMatic);
- pRoot->appendChild(pChildName);
- pRoot->appendChild(pChildThirdId);
- pRoot->appendChild(pChildDataType);
- pRoot->appendChild(pChildDataTypeName);
- pRoot->appendChild(pChildNotes);
- pRoot->appendChild(pChildHospitalId);
- pRoot->appendChild(pChildHospitalName);
- pRoot->appendChild(pChildDoctorId);
- pRoot->appendChild(pChildDoctorName);
- pRoot->appendChild(pChildCheckTime);
- pRoot->appendChild(pChildOtherParams);
- pRoot->appendChild(pChildDeviceId);
- pRoot->appendChild(pChildDeviceName);
- pRoot->appendChild(pChildMd5);
- pRoot->appendChild(pChildCaseOrigin);
- pRoot->appendChild(pChildYzlb);
- pRoot->appendChild(pChildSex);
- pRoot->appendChild(pChildApplicationNo);
- pRoot->appendChild(pChildAutoMatic);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1006", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UploadCaseSegment(string stringCaseId, string stringOrder, string stringTotalSize, string stringServerUri, string stringStart1,
- string stringEnd1, string stringMd51, string stringStart2, string stringEnd2, string stringMd52, string stringStart3,
- string stringEnd3,string stringMd53, string stringFilePath)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildOrder = pDoc->createElement("order");
- AutoPtr<Element> pChildTotalSize = pDoc->createElement("totalsize");
- AutoPtr<Element> pChildServerUri = pDoc->createElement("serveruri");
- AutoPtr<Element> pChildPart1 = pDoc->createElement("md51");
- AutoPtr<Element> pGrandChildStart1= pDoc->createElement("start");
- AutoPtr<Element> pGrandChildEnd1 = pDoc->createElement("end");
- AutoPtr<Element> pGrandChildMd51 = pDoc->createElement("md5");
- AutoPtr<Element> pChildPart2 = pDoc->createElement("md52");
- AutoPtr<Element> pGrandChildStart2= pDoc->createElement("start");
- AutoPtr<Element> pGrandChildEnd2 = pDoc->createElement("end");
- AutoPtr<Element> pGrandChildMd52 = pDoc->createElement("md5");
- AutoPtr<Element> pChildPart3 = pDoc->createElement("md53");
- AutoPtr<Element> pGrandChildStart3= pDoc->createElement("start");
- AutoPtr<Element> pGrandChildEnd3 = pDoc->createElement("end");
- AutoPtr<Element> pGrandChildMd53 = pDoc->createElement("md5");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextOrder = pDoc->createTextNode(stringOrder);
- AutoPtr<Text> pTextTotalSize = pDoc->createTextNode(stringTotalSize);
- AutoPtr<Text> pTextServerUri = pDoc->createTextNode(stringServerUri);
- AutoPtr<Text> pTextStart1 = pDoc->createTextNode(stringStart1);
- AutoPtr<Text> pTextEnd1 = pDoc->createTextNode(stringEnd1);
- AutoPtr<Text> pTextMd51 = pDoc->createTextNode(stringMd51);
- AutoPtr<Text> pTextStart2 = pDoc->createTextNode(stringStart2);
- AutoPtr<Text> pTextEnd2 = pDoc->createTextNode(stringEnd2);
- AutoPtr<Text> pTextMd52 = pDoc->createTextNode(stringMd52);
- AutoPtr<Text> pTextStart3 = pDoc->createTextNode(stringStart3);
- AutoPtr<Text> pTextEnd3 = pDoc->createTextNode(stringEnd3);
- AutoPtr<Text> pTextMd53 = pDoc->createTextNode(stringMd53);
- pChildCaseId->appendChild(pTextCaseId);
- pChildOrder->appendChild(pTextOrder);
- pChildTotalSize->appendChild(pTextTotalSize);
- pChildServerUri->appendChild(pTextServerUri);
- pGrandChildStart1->appendChild(pTextStart1);
- pGrandChildEnd1->appendChild(pTextEnd1);
- pGrandChildMd51->appendChild(pTextMd51);
- pGrandChildStart2->appendChild(pTextStart2);
- pGrandChildEnd2->appendChild(pTextEnd2);
- pGrandChildMd52->appendChild(pTextMd52);
- pGrandChildStart3->appendChild(pTextStart3);
- pGrandChildEnd3->appendChild(pTextEnd3);
- pGrandChildMd53->appendChild(pTextMd53);
- pChildPart1->appendChild(pGrandChildStart1);
- pChildPart1->appendChild(pGrandChildEnd1);
- pChildPart1->appendChild(pGrandChildMd51);
- pChildPart2->appendChild(pGrandChildStart2);
- pChildPart2->appendChild(pGrandChildEnd2);
- pChildPart2->appendChild(pGrandChildMd52);
- pChildPart3->appendChild(pGrandChildStart3);
- pChildPart3->appendChild(pGrandChildEnd3);
- pChildPart3->appendChild(pGrandChildMd53);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildOrder);
- pRoot->appendChild(pChildTotalSize);
- pRoot->appendChild(pChildServerUri);
- pRoot->appendChild(pChildPart1);
- pRoot->appendChild(pChildPart2);
- pRoot->appendChild(pChildPart3);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1007", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, stringFilePath);
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::CaseHoldPlace(string stringCaseId, string stringReceiverId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCase = pDoc->createElement("case");
- AutoPtr<Element> pGrandChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pGrandChildReceiverId = pDoc->createElement("receiverid");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
- pGrandChildCaseId->appendChild(pTextCaseId);
- pGrandChildReceiverId->appendChild(pTextReceiverId);
- pChildCase->appendChild(pGrandChildCaseId);
- pChildCase->appendChild(pGrandChildReceiverId);
- pRoot->appendChild(pChildCase);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1008", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetAutoDownloadCase(string stringCaseType,string stringSenderId,string stringCaseOrigin)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildcasetype = pDoc->createElement("casetype");
- AutoPtr<Element> pChildsenderid = pDoc->createElement("senderid");
- AutoPtr<Element> pChildcaseorigin = pDoc->createElement("caseorigin");
- AutoPtr<Text> pTextcasetype = pDoc->createTextNode(stringCaseType);
- AutoPtr<Text> pTextsenderid = pDoc->createTextNode(stringSenderId);
- AutoPtr<Text> pTextcaseorigin = pDoc->createTextNode(stringCaseOrigin);
- pChildcasetype->appendChild(pTextcasetype);
- pChildsenderid->appendChild(pTextsenderid);
- pChildcaseorigin->appendChild(pTextcaseorigin);
- pRoot->appendChild(pChildcasetype);
- pRoot->appendChild(pChildsenderid);
- pRoot->appendChild(pChildcaseorigin);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1009", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::DownloadCaseBegin(string stringCaseId, string stringReceiverId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
- pChildCaseId->appendChild(pTextCaseId);
- pChildReceiverId->appendChild(pTextReceiverId);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildReceiverId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1010", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::DownloadFileSegment(string stringUri, string stringStart, string stringEnd)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUri = pDoc->createElement("uri");
- AutoPtr<Element> pChildStart = pDoc->createElement("start");
- AutoPtr<Element> pChildEnd = pDoc->createElement("end");
- AutoPtr<Text> pTextUri = pDoc->createTextNode(stringUri);
- AutoPtr<Text> pTextStart = pDoc->createTextNode(stringStart);
- AutoPtr<Text> pTextEnd = pDoc->createTextNode(stringEnd);
- pChildUri->appendChild(pTextUri);
- pChildStart->appendChild(pTextStart);
- pChildEnd->appendChild(pTextEnd);
- pRoot->appendChild(pChildUri);
- pRoot->appendChild(pChildStart);
- pRoot->appendChild(pChildEnd);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1011", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath, false, false);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::DownloadCaseComplete(string stringCaseId, string stringReceiverId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
- pChildCaseId->appendChild(pTextCaseId);
- pChildReceiverId->appendChild(pTextReceiverId);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildReceiverId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1012", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::InvalidCase(string stringCaseId, string stringReceiverId, string stringReason)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
- AutoPtr<Element> pChildReason = pDoc->createElement("reason");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
- AutoPtr<Text> pTextReason = pDoc->createTextNode(stringReason);
- pChildCaseId->appendChild(pTextCaseId);
- pChildReceiverId->appendChild(pTextReceiverId);
- pChildReason->appendChild(pTextReason);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildReceiverId);
- pRoot->appendChild(pChildReason);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1013", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::TransmitCase(string stringCaseId, string stringReceiverId, string stringForwardToH, string stringForwardToHospitalName,
- string stringForwandToD, string stringForwardToDoctorName)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
- AutoPtr<Element> pChildForwardToH = pDoc->createElement("forwardtoh");
- AutoPtr<Element> pChildForwardToHospitalName = pDoc->createElement("forwardtohn");
- AutoPtr<Element> pChildForwardToD = pDoc->createElement("forwardtod");
- AutoPtr<Element> pChildForwardToDoctorName = pDoc->createElement("forwardtodn");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
- AutoPtr<Text> pTextForwardToH = pDoc->createTextNode(stringForwardToH);
- AutoPtr<Text> pTextForwardToHospitalName = pDoc->createTextNode(stringForwardToHospitalName);
- AutoPtr<Text> pTextForwardToD = pDoc->createTextNode(stringForwandToD);
- AutoPtr<Text> pTextForwardToDoctorName = pDoc->createTextNode(stringForwardToDoctorName);
- pChildCaseId->appendChild(pTextCaseId);
- pChildReceiverId->appendChild(pTextReceiverId);
- pChildForwardToH->appendChild(pTextForwardToH);
- pChildForwardToHospitalName->appendChild(pTextForwardToHospitalName);
- pChildForwardToD->appendChild(pTextForwardToD);
- pChildForwardToDoctorName->appendChild(pTextForwardToDoctorName);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildReceiverId);
- pRoot->appendChild(pChildForwardToH);
- pRoot->appendChild(pChildForwardToHospitalName);
- pRoot->appendChild(pChildForwardToD);
- pRoot->appendChild(pChildForwardToDoctorName);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1014", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::Rollback(string stringCaseId, string stringReceiverId, string stringBackTo)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
- AutoPtr<Element> pChildBackTo = pDoc->createElement("backto");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
- AutoPtr<Text> pTextBackTo = pDoc->createTextNode(stringBackTo);
- pChildCaseId->appendChild(pTextCaseId);
- pChildReceiverId->appendChild(pTextReceiverId);
- pChildBackTo->appendChild(pTextBackTo);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildReceiverId);
- pRoot->appendChild(pChildBackTo);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1015", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetHospitalListOfGroup(string stringGroupId, string stringType, string stringCaseType, string stringPageTo, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildGroupId = pDoc->createElement("hgroupid");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
- AutoPtr<Element> pChilePageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextGroupId = pDoc->createTextNode(stringGroupId);
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildGroupId->appendChild(pTextGroupId);
- pChildType->appendChild(pTextType);
- pChildCaseType->appendChild(pTextCaseType);
- pChildPageTo->appendChild(pTextPageTo);
- pChilePageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildGroupId);
- pRoot->appendChild(pChildType);
- pRoot->appendChild(pChildCaseType);
- pRoot->appendChild(pChildPageTo);
- pRoot->appendChild(pChilePageSize);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1016", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetDoctorListOfHospital(string stringHospitalId, string stringDoctorId, string stringCaseType, string stringDoctorType, string stringPageTo, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
- AutoPtr<Element> pChildDoctorId = pDoc->createElement("doctorid");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Element> pChildDoctorType = pDoc->createElement("doctortype");
- AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
- AutoPtr<Element> pChilePageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
- AutoPtr<Text> pTextDoctorId = pDoc->createTextNode(stringDoctorId);
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- AutoPtr<Text> pTextDoctorType = pDoc->createTextNode(stringDoctorType);
- AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildHospitalId->appendChild(pTextHospitalId);
- pChildDoctorId->appendChild(pTextDoctorId);
- pChildCaseType->appendChild(pTextCaseType);
- pChildDoctorType->appendChild(pTextDoctorType);
- pChildPageTo->appendChild(pTextPageTo);
- pChilePageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildHospitalId);
- pRoot->appendChild(pChildDoctorId);
- pRoot->appendChild(pChildCaseType);
- pRoot->appendChild(pChildDoctorType);
- pRoot->appendChild(pChildPageTo);
- pRoot->appendChild(pChilePageSize);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1017", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::AnalyzeBegin(string stringCaseId, string stringReceiverId, string stringCaseType)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- pChildCaseId->appendChild(pTextCaseId);
- pChildReceiverId->appendChild(pTextReceiverId);
- pChildCaseType->appendChild(pTextCaseType);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildReceiverId);
- pRoot->appendChild(pChildCaseType);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1018", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::AnalyzeComplete(string stringCaseId, string stringReceiverId, string stringCaseType)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- pChildCaseId->appendChild(pTextCaseId);
- pChildReceiverId->appendChild(pTextReceiverId);
- pChildCaseType->appendChild(pTextCaseType);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildReceiverId);
- pRoot->appendChild(pChildCaseType);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1019", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ApplyNewReport(string stringCaseId, string stringReceiverId, string stringDiagnosis, string stringMd5, string stringDigitalSign, string stringTimestampSign, string stringCaseType)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
- AutoPtr<Element> pChildDiagnosis = pDoc->createElement("diagnostic");
- AutoPtr<Element> pChildMd5 = pDoc->createElement("md5");
- AutoPtr<Element> pChildDigitalSign = pDoc->createElement("digitalsign");
- AutoPtr<Element> pChildTimestampSign = pDoc->createElement("timestampsign");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
- // //stringDiagnosis参数更改xml编码声明,目的是编码统一
- // string stringWorkingDir = CUtil::GetCurrentAppDir();
- // string stringIniFilePath = stringWorkingDir+"PhmsConfig.ini";
- // AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringIniFilePath, "gbk");
- // string stringEncoding = iniFile->getString("OTHER.Encoding", "GBK");
- // string stringSrc = "encoding=\"";
- // stringSrc += stringEncoding;
- // stringSrc += "\"?>";
- // string stringDst = "encoding=\"UTF-8\"?>";
- // CUtil::ReplaceString(stringDiagnosis, stringSrc, stringDst);
- AutoPtr<Text> pTextDiagnosis = pDoc->createTextNode(stringDiagnosis);
- AutoPtr<Text> pTextMd5 = pDoc->createTextNode(stringMd5);
- AutoPtr<Text> pTextDigitalSign = pDoc->createTextNode(stringDigitalSign);
- AutoPtr<Text> pTextTimestampSign = pDoc->createTextNode(stringTimestampSign);
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- pChildCaseId->appendChild(pTextCaseId);
- pChildReceiverId->appendChild(pTextReceiverId);
- pChildDiagnosis->appendChild(pTextDiagnosis);
- pChildMd5->appendChild(pTextMd5);
- pChildDigitalSign->appendChild(pTextDigitalSign);
- pChildTimestampSign->appendChild(pTextTimestampSign);
- pChildCaseType->appendChild(pTextCaseType);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildReceiverId);
- pRoot->appendChild(pChildDiagnosis);
- pRoot->appendChild(pChildMd5);
- pRoot->appendChild(pChildDigitalSign);
- pRoot->appendChild(pChildTimestampSign);
- pRoot->appendChild(pChildCaseType);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1020", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UploadReportSegment(string stringCaseId, string stringReceiverId, string stringCaseType, string stringReportId, string stringOrder, string stringTotalSize,
- string stringServerUri, string stringStart1, string stringEnd1, string stringMd51, string stringStart2, string stringEnd2,
- string stringMd52, string stringStart3, string stringEnd3, string stringMd53, string stringFilePath, string stringFileType)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
- AutoPtr<Element> pChildOrder = pDoc->createElement("order");
- AutoPtr<Element> pChildTotalSize = pDoc->createElement("totalsize");
- AutoPtr<Element> pChildServerUri = pDoc->createElement("serveruri");
- AutoPtr<Element> pChildPart1 = pDoc->createElement("md51");
- AutoPtr<Element> pGrandChildStart1= pDoc->createElement("start");
- AutoPtr<Element> pGrandChildEnd1 = pDoc->createElement("end");
- AutoPtr<Element> pGrandChildMd51 = pDoc->createElement("md5");
- AutoPtr<Element> pChildPart2 = pDoc->createElement("md52");
- AutoPtr<Element> pGrandChildStart2= pDoc->createElement("start");
- AutoPtr<Element> pGrandChildEnd2 = pDoc->createElement("end");
- AutoPtr<Element> pGrandChildMd52 = pDoc->createElement("md5");
- AutoPtr<Element> pChildPart3 = pDoc->createElement("md53");
- AutoPtr<Element> pGrandChildStart3= pDoc->createElement("start");
- AutoPtr<Element> pGrandChildEnd3 = pDoc->createElement("end");
- AutoPtr<Element> pGrandChildMd53 = pDoc->createElement("md5");
- AutoPtr<Element> pChildFileType = pDoc->createElement("filetype");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
- AutoPtr<Text> pTextOrder = pDoc->createTextNode(stringOrder);
- AutoPtr<Text> pTextTotalSize = pDoc->createTextNode(stringTotalSize);
- AutoPtr<Text> pTextServerUri = pDoc->createTextNode(stringServerUri);
- AutoPtr<Text> pTextStart1 = pDoc->createTextNode(stringStart1);
- AutoPtr<Text> pTextEnd1 = pDoc->createTextNode(stringEnd1);
- AutoPtr<Text> pTextMd51 = pDoc->createTextNode(stringMd51);
- AutoPtr<Text> pTextStart2 = pDoc->createTextNode(stringStart2);
- AutoPtr<Text> pTextEnd2 = pDoc->createTextNode(stringEnd2);
- AutoPtr<Text> pTextMd52 = pDoc->createTextNode(stringMd52);
- AutoPtr<Text> pTextStart3 = pDoc->createTextNode(stringStart3);
- AutoPtr<Text> pTextEnd3 = pDoc->createTextNode(stringEnd3);
- AutoPtr<Text> pTextMd53 = pDoc->createTextNode(stringMd53);
- AutoPtr<Text> pTextFileType = pDoc->createTextNode(stringFileType);
- pChildCaseId->appendChild(pTextCaseId);
- pChildReceiverId->appendChild(pTextReceiverId);
- pChildCaseType->appendChild(pTextCaseType);
- pChildReportId->appendChild(pTextReportId);
- pChildOrder->appendChild(pTextOrder);
- pChildTotalSize->appendChild(pTextTotalSize);
- pChildServerUri->appendChild(pTextServerUri);
- pGrandChildStart1->appendChild(pTextStart1);
- pGrandChildEnd1->appendChild(pTextEnd1);
- pGrandChildMd51->appendChild(pTextMd51);
- pGrandChildStart2->appendChild(pTextStart2);
- pGrandChildEnd2->appendChild(pTextEnd2);
- pGrandChildMd52->appendChild(pTextMd52);
- pGrandChildStart3->appendChild(pTextStart3);
- pGrandChildEnd3->appendChild(pTextEnd3);
- pGrandChildMd53->appendChild(pTextMd53);
- pChildPart1->appendChild(pGrandChildStart1);
- pChildPart1->appendChild(pGrandChildEnd1);
- pChildPart1->appendChild(pGrandChildMd51);
- pChildPart2->appendChild(pGrandChildStart2);
- pChildPart2->appendChild(pGrandChildEnd2);
- pChildPart2->appendChild(pGrandChildMd52);
- pChildPart3->appendChild(pGrandChildStart3);
- pChildPart3->appendChild(pGrandChildEnd3);
- pChildPart3->appendChild(pGrandChildMd53);
- pChildFileType->appendChild(pTextFileType);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildReceiverId);
- pRoot->appendChild(pChildCaseType);
- pRoot->appendChild(pChildReportId);
- pRoot->appendChild(pChildOrder);
- pRoot->appendChild(pChildTotalSize);
- pRoot->appendChild(pChildServerUri);
- pRoot->appendChild(pChildPart1);
- pRoot->appendChild(pChildPart2);
- pRoot->appendChild(pChildPart3);
- pRoot->appendChild(pChildFileType);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1021", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, stringFilePath);
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::DownloadReportBegin(string stringCaseId, string stringReportId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
- pChildCaseId->appendChild(pTextCaseId);
- pChildReportId->appendChild(pTextReportId);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildReportId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1022", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::DownloadReportComplete(string stringCaseId, string stringReportId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
- pChildCaseId->appendChild(pTextCaseId);
- pChildReportId->appendChild(pTextReportId);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildReportId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1023", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetAlreadyUploadFileSize(string stringServerUri)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildServerUri = pDoc->createElement("serveruri");
- AutoPtr<Text> pTextServerUri = pDoc->createTextNode(stringServerUri);
- pChildServerUri->appendChild(pTextServerUri);
- pRoot->appendChild(pChildServerUri);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1024", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetReviewReportList(string stringReportStartDate, string stringReportEndDate, string stringReviewStartDate, string stringReviewEndDate,
- string stringReviewState, string stringCaseType, string stringPtName, string stringSenderId, string stringYzlb, string stringAId, string stringReviewerId,
- string stringReceiverId, string stringCaseId, string stringPageTo, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildReportStartDate = pDoc->createElement("reportstartdate");
- AutoPtr<Element> pChildReportEndDate = pDoc->createElement("reportenddate");
- AutoPtr<Element> pChildReviewStartDate = pDoc->createElement("reviewstartdate");
- AutoPtr<Element> pChildReviewEndDate = pDoc->createElement("reviewenddate");
- AutoPtr<Element> pChildReviewState = pDoc->createElement("reviewstate");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Element> pChildPtName = pDoc->createElement("ptname");
- AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
- AutoPtr<Element> pChildYzlb = pDoc->createElement("yzlb");
- AutoPtr<Element> pChildAId = pDoc->createElement("applicationno");
- AutoPtr<Element> pChildReviewerId = pDoc->createElement("reviewerid");
- AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextReportStartDate = pDoc->createTextNode(stringReportStartDate);
- AutoPtr<Text> pTextReportEndDate = pDoc->createTextNode(stringReportEndDate);
- AutoPtr<Text> pTextReviewStartDate = pDoc->createTextNode(stringReviewStartDate);
- AutoPtr<Text> pTextReviewEndDate = pDoc->createTextNode(stringReviewEndDate);
- AutoPtr<Text> pTextReviewState = pDoc->createTextNode(stringReviewState);
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- AutoPtr<Text> pTextPtName = pDoc->createTextNode(stringPtName);
- AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
- AutoPtr<Text> pTextYzlb = pDoc->createTextNode(stringYzlb);
- AutoPtr<Text> pTextAId = pDoc->createTextNode(stringAId);
- AutoPtr<Text> pTextReviewerId = pDoc->createTextNode(stringReviewerId);
- AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildReportStartDate->appendChild(pTextReportStartDate);
- pChildReportEndDate->appendChild(pTextReportEndDate);
- pChildReviewStartDate->appendChild(pTextReviewStartDate);
- pChildReviewEndDate->appendChild(pTextReviewEndDate);
- pChildReviewState->appendChild(pTextReviewState);
- pChildCaseType->appendChild(pTextCaseType);
- pChildPtName->appendChild(pTextPtName);
- pChildSenderId->appendChild(pTextSenderId);
- pChildYzlb->appendChild(pTextYzlb);
- pChildAId->appendChild(pTextAId);
- pChildReviewerId->appendChild(pTextReviewerId);
- pChildReceiverId->appendChild(pTextReceiverId);
- pChildCaseId->appendChild(pTextCaseId);
- pChildPageTo->appendChild(pTextPageTo);
- pChildPageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildReportStartDate);
- pRoot->appendChild(pChildReportEndDate);
- pRoot->appendChild(pChildReviewStartDate);
- pRoot->appendChild(pChildReviewEndDate);
- pRoot->appendChild(pChildReviewState);
- pRoot->appendChild(pChildCaseType);
- pRoot->appendChild(pChildPtName);
- pRoot->appendChild(pChildSenderId);
- pRoot->appendChild(pChildYzlb);
- pRoot->appendChild(pChildAId);
- pRoot->appendChild(pChildReviewerId);
- pRoot->appendChild(pChildReceiverId);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildPageTo);
- pRoot->appendChild(pChildPageSize);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1025", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ReviewReport(string stringReportId, string stringReviewState, string stringPath, string stringDiagnostic,
- string stringDigitalSign, string stringTimeStampSign)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
- AutoPtr<Element> pChildReviewState = pDoc->createElement("reviewstate");
- AutoPtr<Element> pChildPath = pDoc->createElement("path");
- AutoPtr<Element> pChildDiagnostic = pDoc->createElement("diagnostic");
- AutoPtr<Element> pChildDigitalSign = pDoc->createElement("digitalsign");
- AutoPtr<Element> pChildTimeStampSign = pDoc->createElement("timestampsign");
- AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
- AutoPtr<Text> pTextReviewState = pDoc->createTextNode(stringReviewState);
- AutoPtr<Text> pTextPath = pDoc->createTextNode(stringPath);
- AutoPtr<Text> pTextDiagnostic = pDoc->createTextNode(stringDiagnostic);
- AutoPtr<Text> pTextDigitalSign = pDoc->createTextNode(stringDigitalSign);
- AutoPtr<Text> pTextTimeStampSign = pDoc->createTextNode(stringTimeStampSign);
- pChildReportId->appendChild(pTextReportId);
- pChildReviewState->appendChild(pTextReviewState);
- pChildPath->appendChild(pTextPath);
- pChildDiagnostic->appendChild(pTextDiagnostic);
- pChildDigitalSign->appendChild(pTextDigitalSign);
- pChildTimeStampSign->appendChild(pTextTimeStampSign);
- pRoot->appendChild(pChildReportId);
- pRoot->appendChild(pChildReviewState);
- pRoot->appendChild(pChildPath);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1026", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetReportStateOfCase(string stringCaseId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- pChildCaseId->appendChild(pTextCaseId);
- pRoot->appendChild(pChildCaseId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1027", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetCaseListOfDoctor(string stringCaseId, string stringCaseType, string stringCaseSource, string stringCaseState, string stringPatientName,
- string stringSenderId, string stringReceiverId, string stringStartDate, string stringEndDate, string stringCheckStartDate, string stringCheckEndDate,
- string stringSenderName, string stringDiagnostic, string stringCaseOrigin, string stringYzlb, string stringAId, string stringSex, string stringOrderBy, string stringThirdId,
- string stringLang, string stringIsFullName, string stringPageTo, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Element> pChildCaseSource = pDoc->createElement("casesource");
- AutoPtr<Element> pChildCaseState = pDoc->createElement("casestate");
- AutoPtr<Element> pChildPatientName = pDoc->createElement("ptname");
- AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
- AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
- AutoPtr<Element> pChildStartDate = pDoc->createElement("startdate");
- AutoPtr<Element> pChildEndDate = pDoc->createElement("enddate");
- AutoPtr<Element> pChildCheckStartDate = pDoc->createElement("checkstartdate");
- AutoPtr<Element> pChildCheckEndDate = pDoc->createElement("checkenddate");
- AutoPtr<Element> pChildSenderName = pDoc->createElement("sendername");
- AutoPtr<Element> pChildDiagnostic = pDoc->createElement("diagnostic");
- AutoPtr<Element> pChildCaseOrigin = pDoc->createElement("caseorigin");
- AutoPtr<Element> pChildYzlb = pDoc->createElement("yzlb");
- AutoPtr<Element> pChildAId = pDoc->createElement("applicationno");
- AutoPtr<Element> pChildSex = pDoc->createElement("sex");
- AutoPtr<Element> pChildOrderBy = pDoc->createElement("orderby");
- AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
- AutoPtr<Element> pChildLang = pDoc->createElement("lang");
- AutoPtr<Element> PChildIsFullName = pDoc->createElement("isfullname");
- AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- AutoPtr<Text> pTextCaseSource = pDoc->createTextNode(stringCaseSource);
- AutoPtr<Text> pTextCaseState = pDoc->createTextNode(stringCaseState);
- AutoPtr<Text> pTextPatientName = pDoc->createTextNode(stringPatientName);
- AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
- AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
- AutoPtr<Text> pTextStartDate = pDoc->createTextNode(stringStartDate);
- AutoPtr<Text> pTextEndDate = pDoc->createTextNode(stringEndDate);
- AutoPtr<Text> pTextCheckStartDate = pDoc->createTextNode(stringCheckStartDate);
- AutoPtr<Text> pTextCheckEndDate = pDoc->createTextNode(stringCheckEndDate);
- AutoPtr<Text> pTextSenderName = pDoc->createTextNode(stringSenderName);
- AutoPtr<Text> pTextDiagnostic = pDoc->createTextNode(stringDiagnostic);
- AutoPtr<Text> pTextCaseOrigin = pDoc->createTextNode(stringCaseOrigin);
- AutoPtr<Text> pTextYzlb = pDoc->createTextNode(stringYzlb);
- AutoPtr<Text> pTextAId = pDoc->createTextNode(stringAId);
- AutoPtr<Text> pTextSex = pDoc->createTextNode(stringSex);
- AutoPtr<Text> pTextOrderBy = pDoc->createTextNode(stringOrderBy);
- AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
- AutoPtr<Text> pTextLang = pDoc->createTextNode(stringLang);
- AutoPtr<Text> PTextIsFullName = pDoc->createTextNode(stringIsFullName);
- AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildCaseId->appendChild(pTextCaseId);
- pChildCaseType->appendChild(pTextCaseType);
- pChildCaseSource->appendChild(pTextCaseSource);
- pChildCaseState->appendChild(pTextCaseState);
- pChildPatientName->appendChild(pTextPatientName);
- pChildSenderId->appendChild(pTextSenderId);
- pChildReceiverId->appendChild(pTextReceiverId);
- pChildStartDate->appendChild(pTextStartDate);
- pChildEndDate->appendChild(pTextEndDate);
- pChildCheckStartDate->appendChild(pTextCheckStartDate);
- pChildCheckEndDate->appendChild(pTextCheckEndDate);
- pChildSenderName->appendChild(pTextSenderName);
- pChildDiagnostic->appendChild(pTextDiagnostic);
- pChildCaseOrigin->appendChild(pTextCaseOrigin);
- pChildYzlb->appendChild(pTextYzlb);
- pChildAId->appendChild(pTextAId);
- pChildSex->appendChild(pTextSex);
- pChildOrderBy->appendChild(pTextOrderBy);
- pChildThirdId->appendChild(pTextThirdId);
- pChildLang->appendChild(pTextLang);
- PChildIsFullName->appendChild(PTextIsFullName);
- pChildPageTo->appendChild(pTextPageTo);
- pChildPageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildCaseType);
- pRoot->appendChild(pChildCaseSource);
- pRoot->appendChild(pChildCaseState);
- pRoot->appendChild(pChildPatientName);
- pRoot->appendChild(pChildSenderId);
- pRoot->appendChild(pChildReceiverId);
- pRoot->appendChild(pChildStartDate);
- pRoot->appendChild(pChildEndDate);
- pRoot->appendChild(pChildCheckStartDate);
- pRoot->appendChild(pChildCheckEndDate);
- pRoot->appendChild(pChildSenderName);
- pRoot->appendChild(pChildDiagnostic);
- pRoot->appendChild(pChildCaseOrigin);
- pRoot->appendChild(pChildYzlb);
- pRoot->appendChild(pChildAId);
- pRoot->appendChild(pChildSex);
- pRoot->appendChild(pChildOrderBy);
- pRoot->appendChild(pChildThirdId);
- pRoot->appendChild(pChildLang);
- pRoot->appendChild(PChildIsFullName);
- pRoot->appendChild(pChildPageTo);
- pRoot->appendChild(pChildPageSize);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1028", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetHospitalInfo(string stringHospitalId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
- AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
- pChildHospitalId->appendChild(pTextHospitalId);
- pRoot->appendChild(pChildHospitalId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1029", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UploadIm(string stringSenderId, string stringSenderName, string stringReceiverId, string stringMsgDirection, string stringMsgType,
- string stringMsgContent, string stringCaseId, string stringCaseType)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
- AutoPtr<Element> pChildSenderName = pDoc->createElement("sendername");
- AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
- AutoPtr<Element> pChildMsgDirection = pDoc->createElement("msgdirection");
- AutoPtr<Element> pChildMsgType = pDoc->createElement("msgtype");
- AutoPtr<Element> pChildMstContent = pDoc->createElement("msgcontent");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
- AutoPtr<Text> pTextSenderName = pDoc->createTextNode(stringSenderName);
- AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
- AutoPtr<Text> pTextMsgDirection = pDoc->createTextNode(stringMsgDirection);
- AutoPtr<Text> pTextMsgType = pDoc->createTextNode(stringMsgType);
- AutoPtr<Text> pTextMsgContent = pDoc->createTextNode(stringMsgContent);
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- pChildSenderId->appendChild(pTextSenderId);
- pChildSenderName->appendChild(pTextSenderName);
- pChildReceiverId->appendChild(pTextReceiverId);
- pChildMsgDirection->appendChild(pTextMsgDirection);
- pChildMsgType->appendChild(pTextMsgType);
- pChildMstContent->appendChild(pTextMsgContent);
- pChildCaseId->appendChild(pTextCaseId);
- pChildCaseType->appendChild(pTextCaseType);
- pRoot->appendChild(pChildSenderId);
- pRoot->appendChild(pChildSenderName);
- pRoot->appendChild(pChildReceiverId);
- pRoot->appendChild(pChildMsgDirection);
- pRoot->appendChild(pChildMsgType);
- pRoot->appendChild(pChildMstContent);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildCaseType);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1030", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetImList(string stringSenderId, string stringCaseId, string stringCaseType, string stringMsgDirection, string stringMsgType)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Element> pChildMsgType = pDoc->createElement("msgtype");
- AutoPtr<Element> pChildMsgDirection = pDoc->createElement("msgdirection");
- AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- AutoPtr<Text> pTextMsgType = pDoc->createTextNode(stringMsgType);
- AutoPtr<Text> pTextMsgDirection = pDoc->createTextNode(stringMsgDirection);
- pChildSenderId->appendChild(pTextSenderId);
- pChildCaseId->appendChild(pTextCaseId);
- pChildCaseType->appendChild(pTextCaseType);
- pChildMsgType->appendChild(pTextMsgType);
- pChildMsgDirection->appendChild(pTextMsgDirection);
- pRoot->appendChild(pChildSenderId);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildCaseType);
- pRoot->appendChild(pChildMsgType);
- pRoot->appendChild(pChildMsgDirection);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1031", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetImList2(string stringNextId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
- AutoPtr<Element> pChildVersion = pDoc->createElement("version");
- AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
- AutoPtr<Text> pTextVersion = pDoc->createTextNode("2");
- pChildNextId->appendChild(pTextNextId);
- pChildVersion->appendChild(pTextVersion);
- pRoot->appendChild(pChildNextId);
- pRoot->appendChild(pChildVersion);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1031", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ImDownloadComplete(string stringId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildId = pDoc->createElement("id");
- AutoPtr<Text> pTextId = pDoc->createTextNode(stringId);
- pChildId->appendChild(pTextId);
- pRoot->appendChild(pChildId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1032", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::SendPhoneMsg(string stringCaseId, string stringPhone, string stringMsg)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildPhone = pDoc->createElement("phone");
- AutoPtr<Element> pChildMsg = pDoc->createElement("msg");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextPhone = pDoc->createTextNode(stringPhone);
- AutoPtr<Text> pTextMsg = pDoc->createTextNode(stringMsg);
- pChildCaseId->appendChild(pTextCaseId);
- pChildPhone->appendChild(pTextPhone);
- pChildMsg->appendChild(pTextMsg);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildPhone);
- pRoot->appendChild(pChildMsg);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1033", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UploadTrendData(string stringCardId, string stringDeviceId, string stringDeviceName, string stringCaseId, vector<RECORD_DATA> vRecordData)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCardId = pDoc->createElement("cardid");
- AutoPtr<Element> pChildDeviceId = pDoc->createElement("deviceid");
- AutoPtr<Element> pChildDeviceName = pDoc->createElement("devicename");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Text> pTextCardId = pDoc->createTextNode(stringCardId);
- AutoPtr<Text> pTextDeviceId = pDoc->createTextNode(stringDeviceId);
- AutoPtr<Text> pTextDeviceName = pDoc->createTextNode(stringDeviceName);
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- pChildCardId->appendChild(pTextCardId);
- pChildDeviceId->appendChild(pTextDeviceId);
- pChildDeviceName->appendChild(pTextDeviceName);
- pChildCaseId->appendChild(pTextCaseId);
- pRoot->appendChild(pChildCardId);
- pRoot->appendChild(pChildDeviceId);
- pRoot->appendChild(pChildDeviceName);
- pRoot->appendChild(pChildCaseId);
- //构造pChildRecord
- vector<RECORD_DATA>::const_iterator iter;
- for(iter=vRecordData.begin(); iter!=vRecordData.end(); iter++)
- {
- AutoPtr<Element> pChildRecord = pDoc->createElement("record");
- AutoPtr<Element> pGrandHr = pDoc->createElement("hr");
- AutoPtr<Element> pGrandWeight = pDoc->createElement("weight");
- AutoPtr<Element> pGrandHeight = pDoc->createElement("height");
- AutoPtr<Element> pGrandTemp = pDoc->createElement("temp");
- AutoPtr<Element> pGrandResp = pDoc->createElement("resp");
- AutoPtr<Element> pGrandChol = pDoc->createElement("chol");
- AutoPtr<Element> pGrandUa = pDoc->createElement("ua");
- AutoPtr<Element> pGrandBloodSugar = pDoc->createElement("bloodsugar");
- AutoPtr<Element> pGrand2BloodSugar = pDoc->createElement("bloodsugar");
- AutoPtr<Element> pGrand2Flag = pDoc->createElement("flag");
- AutoPtr<Element> pGrandSpo2 = pDoc->createElement("spo2");
- AutoPtr<Element> pGrand2Spo2 = pDoc->createElement("spo2");
- AutoPtr<Element> pGrand2Pr = pDoc->createElement("pr");
- AutoPtr<Element> pGrandBp = pDoc->createElement("bp");
- AutoPtr<Element> pGrand2Sys = pDoc->createElement("sys");
- AutoPtr<Element> pGrand2Mean = pDoc->createElement("mean");
- AutoPtr<Element> pGrand2Dia = pDoc->createElement("dia");
- AutoPtr<Element> pGrandFetal = pDoc->createElement("fetal");
- AutoPtr<Element> pGrand2FetalHeartRate = pDoc->createElement("fetalheartrate");
- AutoPtr<Element> pGrand2PalacePressure = pDoc->createElement("palacepressure");
- AutoPtr<Element> pGrand2Quickening = pDoc->createElement("quickening");
- AutoPtr<Element> pGrandFvc = pDoc->createElement("fvc");
- AutoPtr<Element> pGrand2Fvc = pDoc->createElement("fvc");
- AutoPtr<Element> pGrand2Fev1 = pDoc->createElement("fev1");
- AutoPtr<Element> pGrand2Pef = pDoc->createElement("pef");
- AutoPtr<Element> pGrand2Fev1Rate = pDoc->createElement("fev1rate");
- AutoPtr<Element> pGrand2Fef25 = pDoc->createElement("fef25");
- AutoPtr<Element> pGrand2Fef2575 = pDoc->createElement("fef2575");
- AutoPtr<Element> pGrand2Fef75 = pDoc->createElement("fef75");
- AutoPtr<Element> pGrandPedometer = pDoc->createElement("pedometer");
- AutoPtr<Element> pGrand2Steps = pDoc->createElement("steps");
- AutoPtr<Element> pGrand2Distance = pDoc->createElement("distance");
- AutoPtr<Element> pGrand2Calories = pDoc->createElement("calories");
- AutoPtr<Element> pGrandUrine = pDoc->createElement("urine");
- AutoPtr<Element> pGrand2Value = pDoc->createElement("value");
- AutoPtr<Element> pGrand2ValueAdd = pDoc->createElement("valueadd");
- AutoPtr<Element> pGrand2ValueNew = pDoc->createElement("valuenew");
- AutoPtr<Element> pGrandHrConclusion = pDoc->createElement("hrconclusion");
- AutoPtr<Element> pGrand2HrValue = pDoc->createElement("value");
- AutoPtr<Element> pGrand2Conclusion = pDoc->createElement("conclusion");
- AutoPtr<Element> pGrandBloodTest = pDoc->createElement("blood_test");
- AutoPtr<Element> pGrand2CHOL = pDoc->createElement("CHOL");
- AutoPtr<Element> pGrand2HDL = pDoc->createElement("HDL");
- AutoPtr<Element> pGrand2TG = pDoc->createElement("TG");
- AutoPtr<Element> pGrand2LDL = pDoc->createElement("LDL");
- AutoPtr<Element> pGrand2HB = pDoc->createElement("HB");
- AutoPtr<Element> pGrand2HCT = pDoc->createElement("HCT");
- AutoPtr<Element> pGrandChekcTime = pDoc->createElement("checktime");
- AutoPtr<Text> pTextHr = pDoc->createTextNode(CUtil::DoubleToString(iter->hr));
- AutoPtr<Text> pTextWeight = pDoc->createTextNode(CUtil::DoubleToString(iter->weight));
- AutoPtr<Text> pTextHeight = pDoc->createTextNode(CUtil::DoubleToString(iter->height));
- AutoPtr<Text> pTextTemp = pDoc->createTextNode(CUtil::DoubleToString(iter->temp));
- AutoPtr<Text> pTextResp = pDoc->createTextNode(CUtil::DoubleToString(iter->resp));
- AutoPtr<Text> pTextChol = pDoc->createTextNode(CUtil::DoubleToString(iter->chol));
- AutoPtr<Text> pTextUa = pDoc->createTextNode(CUtil::DoubleToString(iter->ua));
- AutoPtr<Text> pTextBloodSugar = pDoc->createTextNode(CUtil::DoubleToString(iter->bloodsugerData.bloodsuger));
- AutoPtr<Text> pTextFlag = pDoc->createTextNode(iter->bloodsugerData.flag);
- AutoPtr<Text> pTextSpo2 = pDoc->createTextNode(CUtil::DoubleToString(iter->spo2Data.spo2));
- AutoPtr<Text> pTextPr = pDoc->createTextNode(CUtil::DoubleToString(iter->spo2Data.pr));
- AutoPtr<Text> pTextSys = pDoc->createTextNode(CUtil::DoubleToString(iter->bpData.sys));
- AutoPtr<Text> pTextMean = pDoc->createTextNode(CUtil::DoubleToString(iter->bpData.mean));
- AutoPtr<Text> pTextDia = pDoc->createTextNode(CUtil::DoubleToString(iter->bpData.dia));
- AutoPtr<Text> pTextFetalHeartRate = pDoc->createTextNode(CUtil::DoubleToString(iter->fetalData.fetalHeartRate));
- AutoPtr<Text> pTextPalacePressure = pDoc->createTextNode(CUtil::DoubleToString(iter->fetalData.palacePressure));
- AutoPtr<Text> pTextQuickening = pDoc->createTextNode(CUtil::DoubleToString(iter->fetalData.quickening));
- AutoPtr<Text> pTextFvc = pDoc->createTextNode(CUtil::DoubleToString(iter->fvcData.fvc));
- AutoPtr<Text> pTextFev1 = pDoc->createTextNode(CUtil::DoubleToString(iter->fvcData.fev1));
- AutoPtr<Text> pTextPef = pDoc->createTextNode(CUtil::DoubleToString(iter->fvcData.pef));
- AutoPtr<Text> pTextFev1Rate = pDoc->createTextNode(CUtil::DoubleToString(iter->fvcData.fev1Rate));
- AutoPtr<Text> pTextFef25 = pDoc->createTextNode(CUtil::DoubleToString(iter->fvcData.fef25));
- AutoPtr<Text> pTextFef2575 = pDoc->createTextNode(CUtil::DoubleToString(iter->fvcData.fef2575));
- AutoPtr<Text> pTextFef75 = pDoc->createTextNode(CUtil::DoubleToString(iter->fvcData.fef75));
- AutoPtr<Text> pTextSteps = pDoc->createTextNode(CUtil::DoubleToString(iter->pedometerData.setps));
- AutoPtr<Text> pTextDistance = pDoc->createTextNode(CUtil::DoubleToString(iter->pedometerData.distance));
- AutoPtr<Text> pTextCalories = pDoc->createTextNode(CUtil::DoubleToString(iter->pedometerData.calories));
- AutoPtr<Text> pTextValue = pDoc->createTextNode(iter->urineData.urineValue);
- AutoPtr<Text> pTextValueAdd = pDoc->createTextNode(iter->urineData.urineValueAdd);
- AutoPtr<Text> pTextValueNew = pDoc->createTextNode(iter->urineData.urineValueNew);
- AutoPtr<Text> pTextHrValue = pDoc->createTextNode(CUtil::DoubleToString(iter->hrConclusion.vaule));
- AutoPtr<Text> pTextConclusion = pDoc->createTextNode(iter->hrConclusion.conclusion);
- AutoPtr<Text> pTextCHOL = pDoc->createTextNode(CUtil::DoubleToString(iter->bloodTest.CHOL));
- AutoPtr<Text> pTextHDL = pDoc->createTextNode(CUtil::DoubleToString(iter->bloodTest.HDL));
- AutoPtr<Text> pTextTG = pDoc->createTextNode(CUtil::DoubleToString(iter->bloodTest.TG));
- AutoPtr<Text> pTextLDL = pDoc->createTextNode(CUtil::DoubleToString(iter->bloodTest.LDL));
- AutoPtr<Text> pTextHB = pDoc->createTextNode(CUtil::DoubleToString(iter->bloodTest.HB));
- AutoPtr<Text> pTextHCT = pDoc->createTextNode(CUtil::DoubleToString(iter->bloodTest.HCT));
- AutoPtr<Text> pTextCheckTime = pDoc->createTextNode(iter->checkTime);
- pGrandHr->appendChild(pTextHr);
- pGrandWeight->appendChild(pTextWeight);
- pGrandHeight->appendChild(pTextHeight);
- pGrandTemp->appendChild(pTextTemp);
- pGrandResp->appendChild(pTextResp);
- pGrandChol->appendChild(pTextChol);
- pGrandUa->appendChild(pTextUa);
- pGrand2BloodSugar->appendChild(pTextBloodSugar);
- pGrand2Flag->appendChild(pTextFlag);
- pGrandBloodSugar->appendChild(pGrand2BloodSugar);
- pGrandBloodSugar->appendChild(pGrand2Flag);
- pGrand2Spo2->appendChild(pTextSpo2);
- pGrand2Pr->appendChild(pTextPr);
- pGrandSpo2->appendChild(pGrand2Spo2);
- pGrandSpo2->appendChild(pGrand2Pr);
- pGrand2Sys->appendChild(pTextSys);
- pGrand2Mean->appendChild(pTextMean);
- pGrand2Dia->appendChild(pTextDia);
- pGrandBp->appendChild(pGrand2Sys);
- pGrandBp->appendChild(pGrand2Mean);
- pGrandBp->appendChild(pGrand2Dia);
- pGrand2FetalHeartRate->appendChild(pTextFetalHeartRate);
- pGrand2PalacePressure->appendChild(pTextPalacePressure);
- pGrand2Quickening->appendChild(pTextQuickening);
- pGrandFetal->appendChild(pGrand2FetalHeartRate);
- pGrandFetal->appendChild(pGrand2PalacePressure);
- pGrandFetal->appendChild(pGrand2Quickening);
- pGrand2Fvc->appendChild(pTextFvc);
- pGrand2Fev1->appendChild(pTextFev1);
- pGrand2Pef->appendChild(pTextPef);
- pGrand2Fev1Rate->appendChild(pTextFev1Rate);
- pGrand2Fef25->appendChild(pTextFef25);
- pGrand2Fef2575->appendChild(pTextFef2575);
- pGrand2Fef75->appendChild(pTextFef75);
- pGrandFvc->appendChild(pGrand2Fvc);
- pGrandFvc->appendChild(pGrand2Fev1);
- pGrandFvc->appendChild(pGrand2Pef);
- pGrandFvc->appendChild(pGrand2Fev1Rate);
- pGrandFvc->appendChild(pGrand2Fef25);
- pGrandFvc->appendChild(pGrand2Fef2575);
- pGrandFvc->appendChild(pGrand2Fef75);
- pGrand2Steps->appendChild(pTextSteps);
- pGrand2Distance->appendChild(pTextDistance);
- pGrand2Calories->appendChild(pTextCalories);
- pGrandPedometer->appendChild(pGrand2Steps);
- pGrandPedometer->appendChild(pGrand2Distance);
- pGrandPedometer->appendChild(pGrand2Calories);
- pGrand2Value->appendChild(pTextValue);
- pGrand2ValueAdd->appendChild(pTextValueAdd);
- pGrand2ValueNew->appendChild(pTextValueNew);
- pGrandUrine->appendChild(pGrand2Value);
- pGrandUrine->appendChild(pGrand2ValueAdd);
- pGrandUrine->appendChild(pGrand2ValueNew);
- pGrand2HrValue->appendChild(pTextHrValue);
- pGrand2Conclusion->appendChild(pTextConclusion);
- pGrandHrConclusion->appendChild(pGrand2HrValue);
- pGrandHrConclusion->appendChild(pGrand2Conclusion);
- pGrand2CHOL->appendChild(pTextCHOL);
- pGrand2HDL->appendChild(pTextHDL);
- pGrand2TG->appendChild(pTextTG);
- pGrand2LDL->appendChild(pTextLDL);
- pGrand2HB->appendChild(pTextHB);
- pGrand2HCT->appendChild(pTextHCT);
- pGrandBloodTest->appendChild(pGrand2CHOL);
- pGrandBloodTest->appendChild(pGrand2HDL);
- pGrandBloodTest->appendChild(pGrand2TG);
- pGrandBloodTest->appendChild(pGrand2LDL);
- pGrandBloodTest->appendChild(pGrand2HB);
- pGrandBloodTest->appendChild(pGrand2HCT);
- pGrandChekcTime->appendChild(pTextCheckTime);
- pChildRecord->appendChild(pGrandHr);
- pChildRecord->appendChild(pGrandWeight);
- pChildRecord->appendChild(pGrandHeight);
- pChildRecord->appendChild(pGrandTemp);
- pChildRecord->appendChild(pGrandResp);
- pChildRecord->appendChild(pGrandChol);
- pChildRecord->appendChild(pGrandUa);
- pChildRecord->appendChild(pGrandBloodSugar);
- pChildRecord->appendChild(pGrandSpo2);
- pChildRecord->appendChild(pGrandBp);
- pChildRecord->appendChild(pGrandFetal);
- pChildRecord->appendChild(pGrandFvc);
- pChildRecord->appendChild(pGrandPedometer);
- pChildRecord->appendChild(pGrandUrine);
- pChildRecord->appendChild(pGrandHrConclusion);
- pChildRecord->appendChild(pGrandBloodTest);
- pChildRecord->appendChild(pGrandChekcTime);
- pRoot->appendChild(pChildRecord);
- }
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1034", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UploadTrendDataString(string stringCardId, string stringDeviceId, string stringDeviceName, string stringCaseId, vector<RECORD_DATA_STRING> vRecordData)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCardId = pDoc->createElement("cardid");
- AutoPtr<Element> pChildDeviceId = pDoc->createElement("deviceid");
- AutoPtr<Element> pChildDeviceName = pDoc->createElement("devicename");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Text> pTextCardId = pDoc->createTextNode(stringCardId);
- AutoPtr<Text> pTextDeviceId = pDoc->createTextNode(stringDeviceId);
- AutoPtr<Text> pTextDeviceName = pDoc->createTextNode(stringDeviceName);
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- pChildCardId->appendChild(pTextCardId);
- pChildDeviceId->appendChild(pTextDeviceId);
- pChildDeviceName->appendChild(pTextDeviceName);
- pChildCaseId->appendChild(pTextCaseId);
- pRoot->appendChild(pChildCardId);
- pRoot->appendChild(pChildDeviceId);
- pRoot->appendChild(pChildDeviceName);
- pRoot->appendChild(pChildCaseId);
- //构造pChildRecord
- vector<RECORD_DATA_STRING>::const_iterator iter;
- for(iter=vRecordData.begin(); iter!=vRecordData.end(); iter++)
- {
- AutoPtr<Element> pChildRecord = pDoc->createElement("record");
- AutoPtr<Element> pGrandHr = pDoc->createElement("hr");
- AutoPtr<Element> pGrandWeight = pDoc->createElement("weight");
- AutoPtr<Element> pGrandHeight = pDoc->createElement("height");
- AutoPtr<Element> pGrandTemp = pDoc->createElement("temp");
- AutoPtr<Element> pGrandResp = pDoc->createElement("resp");
- AutoPtr<Element> pGrandChol = pDoc->createElement("chol");
- AutoPtr<Element> pGrandUa = pDoc->createElement("ua");
- AutoPtr<Element> pGrandAg = pDoc->createElement("ag");
- AutoPtr<Element> pGrandBloodSugar = pDoc->createElement("bloodsugar");
- AutoPtr<Element> pGrand2BloodSugar = pDoc->createElement("bloodsugar");
- AutoPtr<Element> pGrand2Flag = pDoc->createElement("flag");
- AutoPtr<Element> pGrandSpo2 = pDoc->createElement("spo2");
- AutoPtr<Element> pGrand2Spo2 = pDoc->createElement("spo2");
- AutoPtr<Element> pGrand2Pr = pDoc->createElement("pr");
- AutoPtr<Element> pGrandBp = pDoc->createElement("bp");
- AutoPtr<Element> pGrand2Sys = pDoc->createElement("sys");
- AutoPtr<Element> pGrand2Mean = pDoc->createElement("mean");
- AutoPtr<Element> pGrand2Dia = pDoc->createElement("dia");
- AutoPtr<Element> pGrandFetal = pDoc->createElement("fetal");
- AutoPtr<Element> pGrand2FetalHeartRate = pDoc->createElement("fetalheartrate");
- AutoPtr<Element> pGrand2PalacePressure = pDoc->createElement("palacepressure");
- AutoPtr<Element> pGrand2Quickening = pDoc->createElement("quickening");
- AutoPtr<Element> pGrandFvc = pDoc->createElement("fvc");
- AutoPtr<Element> pGrand2Fvc = pDoc->createElement("fvc");
- AutoPtr<Element> pGrand2Fev1 = pDoc->createElement("fev1");
- AutoPtr<Element> pGrand2Pef = pDoc->createElement("pef");
- AutoPtr<Element> pGrand2Fev1Rate = pDoc->createElement("fev1rate");
- AutoPtr<Element> pGrand2Fef25 = pDoc->createElement("fef25");
- AutoPtr<Element> pGrand2Fef2575 = pDoc->createElement("fef2575");
- AutoPtr<Element> pGrand2Fef75 = pDoc->createElement("fef75");
- AutoPtr<Element> pGrandPedometer = pDoc->createElement("pedometer");
- AutoPtr<Element> pGrand2Steps = pDoc->createElement("steps");
- AutoPtr<Element> pGrand2Distance = pDoc->createElement("distance");
- AutoPtr<Element> pGrand2Calories = pDoc->createElement("calories");
- AutoPtr<Element> pGrandUrine = pDoc->createElement("urine");
- AutoPtr<Element> pGrand2Value = pDoc->createElement("value");
- AutoPtr<Element> pGrand2ValueAdd = pDoc->createElement("valueadd");
- AutoPtr<Element> pGrand2ValueNew = pDoc->createElement("valuenew");
- AutoPtr<Element> pGrandHrConclusion = pDoc->createElement("hrconclusion");
- AutoPtr<Element> pGrand2HrValue = pDoc->createElement("value");
- AutoPtr<Element> pGrand2Conclusion = pDoc->createElement("conclusion");
- AutoPtr<Element> pGrandBloodTest = pDoc->createElement("blood_test");
- AutoPtr<Element> pGrand2CHOL = pDoc->createElement("CHOL");
- AutoPtr<Element> pGrand2HDL = pDoc->createElement("HDL");
- AutoPtr<Element> pGrand2TG = pDoc->createElement("TG");
- AutoPtr<Element> pGrand2LDL = pDoc->createElement("LDL");
- AutoPtr<Element> pGrand2HB = pDoc->createElement("HB");
- AutoPtr<Element> pGrand2HCT = pDoc->createElement("HCT");
- AutoPtr<Element> pGrandChekcTime = pDoc->createElement("checktime");
- AutoPtr<Text> pTextHr = pDoc->createTextNode(iter->hr);
- AutoPtr<Text> pTextWeight = pDoc->createTextNode(iter->weight);
- AutoPtr<Text> pTextHeight = pDoc->createTextNode(iter->height);
- AutoPtr<Text> pTextTemp = pDoc->createTextNode(iter->temp);
- AutoPtr<Text> pTextResp = pDoc->createTextNode(iter->resp);
- AutoPtr<Text> pTextChol = pDoc->createTextNode(iter->chol);
- AutoPtr<Text> pTextUa = pDoc->createTextNode(iter->ua);
- AutoPtr<Text> pTextAg = pDoc->createTextNode(iter->ag);
- AutoPtr<Text> pTextBloodSugar = pDoc->createTextNode(iter->bloodsugerData.bloodsuger);
- AutoPtr<Text> pTextFlag = pDoc->createTextNode(iter->bloodsugerData.flag);
- AutoPtr<Text> pTextSpo2 = pDoc->createTextNode(iter->spo2Data.spo2);
- AutoPtr<Text> pTextPr = pDoc->createTextNode(iter->spo2Data.pr);
- AutoPtr<Text> pTextSys = pDoc->createTextNode(iter->bpData.sys);
- AutoPtr<Text> pTextMean = pDoc->createTextNode(iter->bpData.mean);
- AutoPtr<Text> pTextDia = pDoc->createTextNode(iter->bpData.dia);
- AutoPtr<Text> pTextFetalHeartRate = pDoc->createTextNode(iter->fetalData.fetalHeartRate);
- AutoPtr<Text> pTextPalacePressure = pDoc->createTextNode(iter->fetalData.palacePressure);
- AutoPtr<Text> pTextQuickening = pDoc->createTextNode(iter->fetalData.quickening);
- AutoPtr<Text> pTextFvc = pDoc->createTextNode(iter->fvcData.fvc);
- AutoPtr<Text> pTextFev1 = pDoc->createTextNode(iter->fvcData.fev1);
- AutoPtr<Text> pTextPef = pDoc->createTextNode(iter->fvcData.pef);
- AutoPtr<Text> pTextFev1Rate = pDoc->createTextNode(iter->fvcData.fev1Rate);
- AutoPtr<Text> pTextFef25 = pDoc->createTextNode(iter->fvcData.fef25);
- AutoPtr<Text> pTextFef2575 = pDoc->createTextNode(iter->fvcData.fef2575);
- AutoPtr<Text> pTextFef75 = pDoc->createTextNode(iter->fvcData.fef75);
- AutoPtr<Text> pTextSteps = pDoc->createTextNode(iter->pedometerData.setps);
- AutoPtr<Text> pTextDistance = pDoc->createTextNode(iter->pedometerData.distance);
- AutoPtr<Text> pTextCalories = pDoc->createTextNode(iter->pedometerData.calories);
- AutoPtr<Text> pTextValue = pDoc->createTextNode(iter->urineData.urineValue);
- AutoPtr<Text> pTextValueAdd = pDoc->createTextNode(iter->urineData.urineValueAdd);
- AutoPtr<Text> pTextValueNew = pDoc->createTextNode(iter->urineData.urineValueNew);
- AutoPtr<Text> pTextHrValue = pDoc->createTextNode(iter->hrConclusion.vaule);
- AutoPtr<Text> pTextConclusion = pDoc->createTextNode(iter->hrConclusion.conclusion);
- AutoPtr<Text> pTextCHOL = pDoc->createTextNode(iter->bloodTest.CHOL);
- AutoPtr<Text> pTextHDL = pDoc->createTextNode(iter->bloodTest.HDL);
- AutoPtr<Text> pTextTG = pDoc->createTextNode(iter->bloodTest.TG);
- AutoPtr<Text> pTextLDL = pDoc->createTextNode(iter->bloodTest.LDL);
- AutoPtr<Text> pTextHB = pDoc->createTextNode(iter->bloodTest.HB);
- AutoPtr<Text> pTextHCT = pDoc->createTextNode(iter->bloodTest.HCT);
- AutoPtr<Text> pTextCheckTime = pDoc->createTextNode(iter->checkTime);
- pGrandHr->appendChild(pTextHr);
- pGrandWeight->appendChild(pTextWeight);
- pGrandHeight->appendChild(pTextHeight);
- pGrandTemp->appendChild(pTextTemp);
- pGrandResp->appendChild(pTextResp);
- pGrandChol->appendChild(pTextChol);
- pGrandUa->appendChild(pTextUa);
- pGrandAg->appendChild(pTextAg);
- pGrand2BloodSugar->appendChild(pTextBloodSugar);
- pGrand2Flag->appendChild(pTextFlag);
- pGrandBloodSugar->appendChild(pGrand2BloodSugar);
- pGrandBloodSugar->appendChild(pGrand2Flag);
- pGrand2Spo2->appendChild(pTextSpo2);
- pGrand2Pr->appendChild(pTextPr);
- pGrandSpo2->appendChild(pGrand2Spo2);
- pGrandSpo2->appendChild(pGrand2Pr);
- pGrand2Sys->appendChild(pTextSys);
- pGrand2Mean->appendChild(pTextMean);
- pGrand2Dia->appendChild(pTextDia);
- pGrandBp->appendChild(pGrand2Sys);
- pGrandBp->appendChild(pGrand2Mean);
- pGrandBp->appendChild(pGrand2Dia);
- pGrand2FetalHeartRate->appendChild(pTextFetalHeartRate);
- pGrand2PalacePressure->appendChild(pTextPalacePressure);
- pGrand2Quickening->appendChild(pTextQuickening);
- pGrandFetal->appendChild(pGrand2FetalHeartRate);
- pGrandFetal->appendChild(pGrand2PalacePressure);
- pGrandFetal->appendChild(pGrand2Quickening);
- pGrand2Fvc->appendChild(pTextFvc);
- pGrand2Fev1->appendChild(pTextFev1);
- pGrand2Pef->appendChild(pTextPef);
- pGrand2Fev1Rate->appendChild(pTextFev1Rate);
- pGrand2Fef25->appendChild(pTextFef25);
- pGrand2Fef2575->appendChild(pTextFef2575);
- pGrand2Fef75->appendChild(pTextFef75);
- pGrandFvc->appendChild(pGrand2Fvc);
- pGrandFvc->appendChild(pGrand2Fev1);
- pGrandFvc->appendChild(pGrand2Pef);
- pGrandFvc->appendChild(pGrand2Fev1Rate);
- pGrandFvc->appendChild(pGrand2Fef25);
- pGrandFvc->appendChild(pGrand2Fef2575);
- pGrandFvc->appendChild(pGrand2Fef75);
- pGrand2Steps->appendChild(pTextSteps);
- pGrand2Distance->appendChild(pTextDistance);
- pGrand2Calories->appendChild(pTextCalories);
- pGrandPedometer->appendChild(pGrand2Steps);
- pGrandPedometer->appendChild(pGrand2Distance);
- pGrandPedometer->appendChild(pGrand2Calories);
- pGrand2Value->appendChild(pTextValue);
- pGrand2ValueAdd->appendChild(pTextValueAdd);
- pGrand2ValueNew->appendChild(pTextValueNew);
- pGrandUrine->appendChild(pGrand2Value);
- pGrandUrine->appendChild(pGrand2ValueAdd);
- pGrandUrine->appendChild(pGrand2ValueNew);
- pGrand2HrValue->appendChild(pTextHrValue);
- pGrand2Conclusion->appendChild(pTextConclusion);
- pGrandHrConclusion->appendChild(pGrand2HrValue);
- pGrandHrConclusion->appendChild(pGrand2Conclusion);
- pGrand2CHOL->appendChild(pTextCHOL);
- pGrand2HDL->appendChild(pTextHDL);
- pGrand2TG->appendChild(pTextTG);
- pGrand2LDL->appendChild(pTextLDL);
- pGrand2HB->appendChild(pTextHB);
- pGrand2HCT->appendChild(pTextHCT);
- pGrandBloodTest->appendChild(pGrand2CHOL);
- pGrandBloodTest->appendChild(pGrand2HDL);
- pGrandBloodTest->appendChild(pGrand2TG);
- pGrandBloodTest->appendChild(pGrand2LDL);
- pGrandBloodTest->appendChild(pGrand2HB);
- pGrandBloodTest->appendChild(pGrand2HCT);
- pGrandChekcTime->appendChild(pTextCheckTime);
- pChildRecord->appendChild(pGrandHr);
- pChildRecord->appendChild(pGrandWeight);
- pChildRecord->appendChild(pGrandHeight);
- pChildRecord->appendChild(pGrandTemp);
- pChildRecord->appendChild(pGrandResp);
- pChildRecord->appendChild(pGrandChol);
- pChildRecord->appendChild(pGrandUa);
- pChildRecord->appendChild(pGrandAg);
- pChildRecord->appendChild(pGrandBloodSugar);
- pChildRecord->appendChild(pGrandSpo2);
- pChildRecord->appendChild(pGrandBp);
- pChildRecord->appendChild(pGrandFetal);
- pChildRecord->appendChild(pGrandFvc);
- pChildRecord->appendChild(pGrandPedometer);
- pChildRecord->appendChild(pGrandUrine);
- pChildRecord->appendChild(pGrandHrConclusion);
- pChildRecord->appendChild(pGrandBloodTest);
- pChildRecord->appendChild(pGrandChekcTime);
- pRoot->appendChild(pChildRecord);
- }
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1034", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UploadTrendDataFile(string stringFilePath)
- {
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(stringFilePath, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1034", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UploadAudioSegment(string stringMsgId, string stringOrder, string stringTotalSize, string stringServerUri, string stringStart1,
- string stringEnd1, string stringMd51, string stringStart2, string stringEnd2, string stringMd52, string stringStart3,
- string stringEnd3, string stringMd53, string stringFilePath)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildMsgId = pDoc->createElement("msgid");
- AutoPtr<Element> pChildOrder = pDoc->createElement("order");
- AutoPtr<Element> pChildTotalSize = pDoc->createElement("totalsize");
- AutoPtr<Element> pChildServerUri = pDoc->createElement("serveruri");
- AutoPtr<Element> pChildPart1 = pDoc->createElement("md51");
- AutoPtr<Element> pGrandChildStart1= pDoc->createElement("start");
- AutoPtr<Element> pGrandChildEnd1 = pDoc->createElement("end");
- AutoPtr<Element> pGrandChildMd51 = pDoc->createElement("md5");
- AutoPtr<Element> pChildPart2 = pDoc->createElement("md52");
- AutoPtr<Element> pGrandChildStart2= pDoc->createElement("start");
- AutoPtr<Element> pGrandChildEnd2 = pDoc->createElement("end");
- AutoPtr<Element> pGrandChildMd52 = pDoc->createElement("md5");
- AutoPtr<Element> pChildPart3 = pDoc->createElement("md53");
- AutoPtr<Element> pGrandChildStart3= pDoc->createElement("start");
- AutoPtr<Element> pGrandChildEnd3 = pDoc->createElement("end");
- AutoPtr<Element> pGrandChildMd53 = pDoc->createElement("md5");
- AutoPtr<Text> pTextMsgId = pDoc->createTextNode(stringMsgId);
- AutoPtr<Text> pTextOrder = pDoc->createTextNode(stringOrder);
- AutoPtr<Text> pTextTotalSize = pDoc->createTextNode(stringTotalSize);
- AutoPtr<Text> pTextServerUri = pDoc->createTextNode(stringServerUri);
- AutoPtr<Text> pTextStart1 = pDoc->createTextNode(stringStart1);
- AutoPtr<Text> pTextEnd1 = pDoc->createTextNode(stringEnd1);
- AutoPtr<Text> pTextMd51 = pDoc->createTextNode(stringMd51);
- AutoPtr<Text> pTextStart2 = pDoc->createTextNode(stringStart2);
- AutoPtr<Text> pTextEnd2 = pDoc->createTextNode(stringEnd2);
- AutoPtr<Text> pTextMd52 = pDoc->createTextNode(stringMd52);
- AutoPtr<Text> pTextStart3 = pDoc->createTextNode(stringStart3);
- AutoPtr<Text> pTextEnd3 = pDoc->createTextNode(stringEnd3);
- AutoPtr<Text> pTextMd53 = pDoc->createTextNode(stringMd53);
- pChildMsgId->appendChild(pTextMsgId);
- pChildOrder->appendChild(pTextOrder);
- pChildTotalSize->appendChild(pTextTotalSize);
- pChildServerUri->appendChild(pTextServerUri);
- pGrandChildStart1->appendChild(pTextStart1);
- pGrandChildEnd1->appendChild(pTextEnd1);
- pGrandChildMd51->appendChild(pTextMd51);
- pGrandChildStart2->appendChild(pTextStart2);
- pGrandChildEnd2->appendChild(pTextEnd2);
- pGrandChildMd52->appendChild(pTextMd52);
- pGrandChildStart3->appendChild(pTextStart3);
- pGrandChildEnd3->appendChild(pTextEnd3);
- pGrandChildMd53->appendChild(pTextMd53);
- pChildPart1->appendChild(pGrandChildStart1);
- pChildPart1->appendChild(pGrandChildEnd1);
- pChildPart1->appendChild(pGrandChildMd51);
- pChildPart2->appendChild(pGrandChildStart2);
- pChildPart2->appendChild(pGrandChildEnd2);
- pChildPart2->appendChild(pGrandChildMd52);
- pChildPart3->appendChild(pGrandChildStart3);
- pChildPart3->appendChild(pGrandChildEnd3);
- pChildPart3->appendChild(pGrandChildMd53);
- pRoot->appendChild(pChildMsgId);
- pRoot->appendChild(pChildOrder);
- pRoot->appendChild(pChildTotalSize);
- pRoot->appendChild(pChildServerUri);
- pRoot->appendChild(pChildPart1);
- pRoot->appendChild(pChildPart2);
- pRoot->appendChild(pChildPart3);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1035", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, stringFilePath);
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UploadAdvice(string stringUserId, string stringUsername, string stringMsg, string stringType, string stringIsSendMsg)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUserId = pDoc->createElement("userid");
- AutoPtr<Element> pChildUsername = pDoc->createElement("username");
- AutoPtr<Element> pChildMsg = pDoc->createElement("msg");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Element> pChildIsSendMsg = pDoc->createElement("issendmsg");
- AutoPtr<Text> pTextUserId = pDoc->createTextNode(stringUserId);
- AutoPtr<Text> pTextUsername = pDoc->createTextNode(stringUsername);
- AutoPtr<Text> pTextMsg = pDoc->createTextNode(stringMsg);
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- AutoPtr<Text> pTextIsSendMsg = pDoc->createTextNode(stringIsSendMsg);
- pChildUserId->appendChild(pTextUserId);
- pChildUsername->appendChild(pTextUsername);
- pChildMsg->appendChild(pTextMsg);
- pChildType->appendChild(pTextType);
- pChildIsSendMsg->appendChild(pTextIsSendMsg);
- pRoot->appendChild(pChildUserId);
- pRoot->appendChild(pChildUsername);
- pRoot->appendChild(pChildMsg);
- pRoot->appendChild(pChildType);
- pRoot->appendChild(pChildIsSendMsg);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1036", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetAdvice(string stringSgId, string stringUserId, string stringDoctorId, string stringDownloadState, string stringType, string stringStartDate,
- string stringEndDate, string stringPageTo, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildSgId = pDoc->createElement("sgid");
- AutoPtr<Element> pChildUserId = pDoc->createElement("userid");
- AutoPtr<Element> pChildDoctorId = pDoc->createElement("doctorid");
- AutoPtr<Element> pChildDownloadState = pDoc->createElement("downstate");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Element> pChildStartDate = pDoc->createElement("startdate");
- AutoPtr<Element> pChildEndDate = pDoc->createElement("enddate");
- AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextSgId = pDoc->createTextNode(stringSgId);
- AutoPtr<Text> pTextUserId = pDoc->createTextNode(stringUserId);
- AutoPtr<Text> pTextDoctorId = pDoc->createTextNode(stringDoctorId);
- AutoPtr<Text> pTextDownloadState = pDoc->createTextNode(stringDownloadState);
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- AutoPtr<Text> pTextStartDate = pDoc->createTextNode(stringStartDate);
- AutoPtr<Text> pTextEndDate = pDoc->createTextNode(stringEndDate);
- AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildSgId->appendChild(pTextSgId);
- pChildUserId->appendChild(pTextUserId);
- pChildDoctorId->appendChild(pTextDoctorId);
- pChildDownloadState->appendChild(pTextDownloadState);
- pChildType->appendChild(pTextType);
- pChildStartDate->appendChild(pTextStartDate);
- pChildEndDate->appendChild(pTextEndDate);
- pChildPageTo->appendChild(pTextPageTo);
- pChildPageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildSgId);
- pRoot->appendChild(pChildUserId);
- pRoot->appendChild(pChildDoctorId);
- pRoot->appendChild(pChildDownloadState);
- pRoot->appendChild(pChildType);
- pRoot->appendChild(pChildStartDate);
- pRoot->appendChild(pChildEndDate);
- pRoot->appendChild(pChildPageTo);
- pRoot->appendChild(pChildPageSize);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1037", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::DownloadAdviceComplete(string stringAdviceId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildAdviceId = pDoc->createElement("sgid");
- AutoPtr<Text> pTextAdviceId = pDoc->createTextNode(stringAdviceId);
- pChildAdviceId->appendChild(pTextAdviceId);
- pRoot->appendChild(pChildAdviceId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1038", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetReportListOfCase(string stringCaseId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- pChildCaseId->appendChild(pTextCaseId);
- pRoot->appendChild(pChildCaseId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1039", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- //接口有变动,加了一个参数senderid,表示要查找信息的人,如为空表示自己
- int CPhmsSession::GetSelfInfo(string stringSenderId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
- AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
- pChildSenderId->appendChild(pTextSenderId);
- pRoot->appendChild(pChildSenderId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
-
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1040", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ChangePwd(string stringOldPassword, string stringNewPassword)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildOldPassword = pDoc->createElement("oldpwd");
- AutoPtr<Element> pChildNewPassword = pDoc->createElement("newpwd");
- AutoPtr<Text> pTextOldPassword = pDoc->createTextNode(stringOldPassword);
- AutoPtr<Text> pTextNewPassword = pDoc->createTextNode(stringNewPassword);
- pChildOldPassword->appendChild(pTextOldPassword);
- pChildNewPassword->appendChild(pTextNewPassword);
- pRoot->appendChild(pChildOldPassword);
- pRoot->appendChild(pChildNewPassword);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1041", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- m_enumPhmsCommandType = CHANGE_INFO_TYPE;//目前只有登录命令是LOGIN_TYPE,改变个人信息命令是CHANGE_INFO_TYPE,用户注册命令是REGISTER_TYPE
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- m_enumPhmsCommandType = MAIN_TYPE;//其余都是MAIN_TYPE
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::DoctorChangeSelfInfo(string stringName, string stringSex, string stringTel, string stringBirthYear, string stringPosition,
- string stringNotes, string stringAgentId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildName = pDoc->createElement("name");
- AutoPtr<Element> pChildSex = pDoc->createElement("sex");
- AutoPtr<Element> pChildTel = pDoc->createElement("tel");
- AutoPtr<Element> pChildBirthYear = pDoc->createElement("birthyear");
- AutoPtr<Element> pChildPosition = pDoc->createElement("position");
- AutoPtr<Element> pChildNotes= pDoc->createElement("notes");
- AutoPtr<Element> pChildAgentId = pDoc->createElement("agentid");
- AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
- AutoPtr<Text> pTextSex = pDoc->createTextNode(stringSex);
- AutoPtr<Text> pTextTel = pDoc->createTextNode(stringTel);
- AutoPtr<Text> pTextBirthYead = pDoc->createTextNode(stringBirthYear);
- AutoPtr<Text> pTextPosition = pDoc->createTextNode(stringPosition);
- AutoPtr<Text> pTextNotes = pDoc->createTextNode(stringNotes);
- AutoPtr<Text> pTextAgentId = pDoc->createTextNode(stringAgentId);
- pChildName->appendChild(pTextName);
- pChildSex->appendChild(pTextSex);
- pChildTel->appendChild(pTextTel);
- pChildBirthYear->appendChild(pTextBirthYead);
- pChildPosition->appendChild(pTextPosition);
- pChildNotes->appendChild(pTextNotes);
- pChildAgentId->appendChild(pTextAgentId);
- pRoot->appendChild(pChildName);
- pRoot->appendChild(pChildSex);
- pRoot->appendChild(pChildTel);
- pRoot->appendChild(pChildBirthYear);
- pRoot->appendChild(pChildPosition);
- pRoot->appendChild(pChildNotes);
- pRoot->appendChild(pChildAgentId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1042", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::CliniqueChangeSelfInfo(string stringPersonId, string stringName, string stringTel, string stringNotes)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildPersonId = pDoc->createElement("pid");
- AutoPtr<Element> pChildName = pDoc->createElement("name");
- AutoPtr<Element> pChildTel = pDoc->createElement("tel");
- AutoPtr<Element> pChildNotes= pDoc->createElement("notes");
- AutoPtr<Text> pTextPersonId = pDoc->createTextNode(stringPersonId);
- AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
- AutoPtr<Text> pTextTel = pDoc->createTextNode(stringTel);
- AutoPtr<Text> pTextNotes = pDoc->createTextNode(stringNotes);
- pChildPersonId->appendChild(pTextPersonId);
- pChildName->appendChild(pTextName);
- pChildTel->appendChild(pTextTel);
- pChildNotes->appendChild(pTextNotes);
- pRoot->appendChild(pChildPersonId);
- pRoot->appendChild(pChildName);
- pRoot->appendChild(pChildTel);
- pRoot->appendChild(pChildNotes);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1043", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::CardUserChangeSelfInfo(string stringPersonId, string stringName, string stringSex, string stringTel, string stringBirthday,
- string stringAddress, string stringLmp, string stringToken, string stringHeight, string stringWeight, string stringPhoto,
- string stringVCodeBeFollowed, string stringHospitalId, string stringOtherInfo)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildPersonId = pDoc->createElement("pid");
- AutoPtr<Element> pChildName = pDoc->createElement("name");
- AutoPtr<Element> pChildSex = pDoc->createElement("sex");
- AutoPtr<Element> pChildTel = pDoc->createElement("tel");
- AutoPtr<Element> pChildBirthday = pDoc->createElement("birthday");
- AutoPtr<Element> pChildAddress = pDoc->createElement("address");
- AutoPtr<Element> pChildLmp = pDoc->createElement("lmp");
- AutoPtr<Element> pChildToken = pDoc->createElement("token");
- AutoPtr<Element> pChildHeight = pDoc->createElement("height");
- AutoPtr<Element> pChildWeight = pDoc->createElement("weight");
- AutoPtr<Element> pChildPhoto = pDoc->createElement("photo");
- AutoPtr<Element> pChildVCodeBeFollowed = pDoc->createElement("vcode_be_followed");
- AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
- AutoPtr<Element> pChildOtherInfo = pDoc->createElement("other_info");
- AutoPtr<Text> pTextPersonId = pDoc->createTextNode(stringPersonId);
- AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
- AutoPtr<Text> pTextSex = pDoc->createTextNode(stringSex);
- AutoPtr<Text> pTextTel = pDoc->createTextNode(stringTel);
- AutoPtr<Text> pTextBirthday = pDoc->createTextNode(stringBirthday);
- AutoPtr<Text> pTextAddress= pDoc->createTextNode(stringAddress);
- AutoPtr<Text> pTextLmp = pDoc->createTextNode(stringLmp);
- AutoPtr<Text> pTextToken = pDoc->createTextNode(stringToken);
- AutoPtr<Text> pTextHeight = pDoc->createTextNode(stringHeight);
- AutoPtr<Text> pTextWeight = pDoc->createTextNode(stringWeight);
- AutoPtr<Text> pTextPhoto = pDoc->createTextNode(stringPhoto);
- AutoPtr<Text> pTextVCodeBeFollowed = pDoc->createTextNode(stringVCodeBeFollowed);
- AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
- AutoPtr<Text> pTextOtherInfo = pDoc->createTextNode(stringOtherInfo);
- pChildPersonId->appendChild(pTextPersonId);
- pChildName->appendChild(pTextName);
- pChildSex->appendChild(pTextSex);
- pChildTel->appendChild(pTextTel);
- pChildBirthday->appendChild(pTextBirthday);
- pChildAddress->appendChild(pTextAddress);
- pChildLmp->appendChild(pTextLmp);
- pChildToken->appendChild(pTextToken);
- pChildHeight->appendChild(pTextHeight);
- pChildWeight->appendChild(pTextWeight);
- pChildPhoto->appendChild(pTextPhoto);
- pChildVCodeBeFollowed->appendChild(pTextVCodeBeFollowed);
- pChildHospitalId->appendChild(pTextHospitalId);
- pChildOtherInfo->appendChild(pTextOtherInfo);
- pRoot->appendChild(pChildPersonId);
- pRoot->appendChild(pChildName);
- pRoot->appendChild(pChildSex);
- pRoot->appendChild(pChildTel);
- pRoot->appendChild(pChildBirthday);
- pRoot->appendChild(pChildAddress);
- pRoot->appendChild(pChildLmp);
- pRoot->appendChild(pChildToken);
- pRoot->appendChild(pChildHeight);
- pRoot->appendChild(pChildWeight);
- pRoot->appendChild(pChildPhoto);
- pRoot->appendChild(pChildVCodeBeFollowed);
- pRoot->appendChild(pChildHospitalId);
- pRoot->appendChild(pChildOtherInfo);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1044", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetCaseListOfUser(string stringCaseId, string stringCaseType, string stringCaseState, string stringThirdId, string stringName,
- string stringStartDate, string stringEndDate, string stringCheckStartDate, string stringCheckEndDate, string stringCaseOrigin,
- string stringYzlb, string stringSex, string stringIsRead, string stringOrderBy, string stringPageTo, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Element> pChildCaseState = pDoc->createElement("casestate");
- AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
- AutoPtr<Element> pChildName = pDoc->createElement("name");
- AutoPtr<Element> pChildStartDate = pDoc->createElement("startdate");
- AutoPtr<Element> pChildEndDate = pDoc->createElement("enddate");
- AutoPtr<Element> pChildCheckStartDate = pDoc->createElement("checkstartdate");
- AutoPtr<Element> pChildCheckEndDate = pDoc->createElement("checkenddate");
- AutoPtr<Element> pChildCaseOrigin = pDoc->createElement("caseorigin");
- AutoPtr<Element> pChildYzlb = pDoc->createElement("yzlb");
- AutoPtr<Element> pChildSex = pDoc->createElement("sex");
- AutoPtr<Element> pChildIsRead = pDoc->createElement("isread");
- AutoPtr<Element> pChildOrderBy = pDoc->createElement("orderby");
- AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- AutoPtr<Text> pTextCaseState = pDoc->createTextNode(stringCaseState);
- AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
- AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
- AutoPtr<Text> pTextStartDate = pDoc->createTextNode(stringStartDate);
- AutoPtr<Text> pTextEndDate = pDoc->createTextNode(stringEndDate);
- AutoPtr<Text> pTextCheckStartDate = pDoc->createTextNode(stringCheckStartDate);
- AutoPtr<Text> pTextCheckEndDate = pDoc->createTextNode(stringCheckEndDate);
- AutoPtr<Text> pTextCaseOrigin = pDoc->createTextNode(stringCaseOrigin);
- AutoPtr<Text> pTextYzlb = pDoc->createTextNode(stringYzlb);
- AutoPtr<Text> pTextSex = pDoc->createTextNode(stringSex);
- AutoPtr<Text> pTextIsRead = pDoc->createTextNode(stringIsRead);
- AutoPtr<Text> pTextOrderBy = pDoc->createTextNode(stringOrderBy);
- AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildCaseId->appendChild(pTextCaseId);
- pChildCaseType->appendChild(pTextCaseType);
- pChildCaseState->appendChild(pTextCaseState);
- pChildThirdId->appendChild(pTextThirdId);
- pChildName->appendChild(pTextName);
- pChildStartDate->appendChild(pTextStartDate);
- pChildEndDate->appendChild(pTextEndDate);
- pChildCheckStartDate->appendChild(pTextCheckStartDate);
- pChildCheckEndDate->appendChild(pTextCheckEndDate);
- pChildCaseOrigin->appendChild(pTextCaseOrigin);
- pChildYzlb->appendChild(pTextYzlb);
- pChildSex->appendChild(pTextSex);
- pChildIsRead->appendChild(pTextIsRead);
- pChildOrderBy->appendChild(pTextOrderBy);
- pChildPageTo->appendChild(pTextPageTo);
- pChildPageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildCaseType);
- pRoot->appendChild(pChildCaseState);
- pRoot->appendChild(pChildThirdId);
- pRoot->appendChild(pChildName);
- pRoot->appendChild(pChildStartDate);
- pRoot->appendChild(pChildEndDate);
- pRoot->appendChild(pChildCheckStartDate);
- pRoot->appendChild(pChildCheckEndDate);
- pRoot->appendChild(pChildCaseOrigin);
- pRoot->appendChild(pChildYzlb);
- pRoot->appendChild(pChildSex);
- pRoot->appendChild(pChildIsRead);
- pRoot->appendChild(pChildOrderBy);
- pRoot->appendChild(pChildPageTo);
- pRoot->appendChild(pChildPageSize);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1045", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetReportListOfUser(string stringReportId, string stringReportStartDate, string stringReportEndDate, string stringCaseType,
- string stringState, string stringOrderBy, string stringPageTo, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
- AutoPtr<Element> pChildReportStartDate = pDoc->createElement("reportstartdate");
- AutoPtr<Element> pChildReportEndDate = pDoc->createElement("reportenddate");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Element> pChildState = pDoc->createElement("state");
- AutoPtr<Element> pChildOrderBy = pDoc->createElement("orderby");
- AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
- AutoPtr<Text> pTextReportStartDate = pDoc->createTextNode(stringReportStartDate);
- AutoPtr<Text> pTextReportEndDate = pDoc->createTextNode(stringReportEndDate);
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- AutoPtr<Text> pTextState = pDoc->createTextNode(stringState);
- AutoPtr<Text> pTextOrderBy = pDoc->createTextNode(stringOrderBy);
- AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildReportId->appendChild(pTextReportId);
- pChildReportStartDate->appendChild(pTextReportStartDate);
- pChildReportEndDate->appendChild(pTextReportEndDate);
- pChildCaseType->appendChild(pTextCaseType);
- pChildState->appendChild(pTextState);
- pChildOrderBy->appendChild(pTextOrderBy);
- pChildPageTo->appendChild(pTextPageTo);
- pChildPageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildReportId);
- pRoot->appendChild(pChildReportStartDate);
- pRoot->appendChild(pChildReportEndDate);
- pRoot->appendChild(pChildCaseType);
- pRoot->appendChild(pChildState);
- pRoot->appendChild(pChildOrderBy);
- pRoot->appendChild(pChildPageTo);
- pRoot->appendChild(pChildPageSize);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1046", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetCardUserList(string stringCardId, string stringSenderId, string stringPersonId, string stringTel, string stringName, string stringType,
- string stringPageTo, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCardId = pDoc->createElement("cardid");
- AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
- AutoPtr<Element> pChildPersonId = pDoc->createElement("pid");
- AutoPtr<Element> pChildTel = pDoc->createElement("tel");
- AutoPtr<Element> pChildName = pDoc->createElement("name");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextCardId = pDoc->createTextNode(stringCardId);
- AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
- AutoPtr<Text> pTextPersonId = pDoc->createTextNode(stringPersonId);
- AutoPtr<Text> pTextTel = pDoc->createTextNode(stringTel);
- AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildCardId->appendChild(pTextCardId);
- pChildSenderId->appendChild(pTextSenderId);
- pChildPersonId->appendChild(pTextPersonId);
- pChildTel->appendChild(pTextTel);
- pChildName->appendChild(pTextName);
- pChildType->appendChild(pTextType);
- pChildPageTo->appendChild(pTextPageTo);
- pChildPageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildCardId);
- pRoot->appendChild(pChildSenderId);
- pRoot->appendChild(pChildPersonId);
- pRoot->appendChild(pChildTel);
- pRoot->appendChild(pChildName);
- pRoot->appendChild(pChildType);
- pRoot->appendChild(pChildPageTo);
- pRoot->appendChild(pChildPageSize);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1047", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::KeepSession()
- {
- CPhmsRequestHead phmsRequestHead("10", "1048", m_stringSessionId, "10");
- CPhmsRequestBody phmsRequestBody("");
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::MarkCaseException(string stringCaseId, string stringReceiverId, int nResultFlag)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
- AutoPtr<Element> pChildSymptoms = pDoc->createElement("symptoms");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
- string stringResultFlag = CUtil::UIntToString(nResultFlag);
- AutoPtr<Text> pTextSymptoms = pDoc->createTextNode(stringResultFlag);
- pChildCaseId->appendChild(pTextCaseId);
- pChildReceiverId->appendChild(pTextReceiverId);
- pChildSymptoms->appendChild(pTextSymptoms);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildReceiverId);
- pRoot->appendChild(pChildSymptoms);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1049", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::MarkReportRead(string stringReportId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
- AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
- pChildReportId->appendChild(pTextReportId);
- pRoot->appendChild(pChildReportId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1050", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::Feedback(string stringTitle, string stringNotes, string stringPhone, string stringFilePath)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildTitle = pDoc->createElement("title");
- AutoPtr<Element> pChildNotes = pDoc->createElement("notes");
- AutoPtr<Element> pChildPhone = pDoc->createElement("phone");
- AutoPtr<Text> pTextTitle = pDoc->createTextNode(stringTitle);
- AutoPtr<Text> pTextNotes = pDoc->createTextNode(stringNotes);
- AutoPtr<Text> pTextPhone = pDoc->createTextNode(stringPhone);
- pChildTitle->appendChild(pTextTitle);
- pChildNotes->appendChild(pTextNotes);
- pChildPhone->appendChild(pTextPhone);
- pRoot->appendChild(pChildTitle);
- pRoot->appendChild(pChildNotes);
- pRoot->appendChild(pChildPhone);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1051", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, stringFilePath);
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UploadTrendData2(string stringTargetPath)
- {
- ifstream ifTarget;
- ostringstream ostringTarget;
- Base64Encoder encoderBase64(ostringTarget);
- encoderBase64.rdbuf()->setLineLength(0);
- try
- {
- ifTarget.exceptions(ios::badbit);
- ifTarget.open(stringTargetPath.c_str(), ios_base::in|ios_base::binary);
- StreamCopier::copyStream(ifTarget, encoderBase64);
- ifTarget.close();
- }
- catch (ios_base::failure& e)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(e.what(), __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_READ_FAIL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_FILE_READ_FAIL;
- }
- encoderBase64.close();
- string stringXmlContent = ostringTarget.str();
- int nRet = PHMS_SUCCESSFUL_RESULT;
- CPhmsRequestHead phmsRequestHead("10", "1052", m_stringSessionId, "12");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetAllTeamList()
- {
- CPhmsRequestHead phmsRequestHead("10", "1053", m_stringSessionId, "10");
- CPhmsRequestBody phmsRequestBody("");
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetDoctorListOfTeam(string stringTeamId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildTeamId = pDoc->createElement("teamid");
- AutoPtr<Text> pTextTeamId = pDoc->createTextNode(stringTeamId);
- pChildTeamId->appendChild(pTextTeamId);
- pRoot->appendChild(pChildTeamId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1054", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetEventStream(string stringCaseId, string stringOriginalHospital)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildSourceHospital = pDoc->createElement("horgorder");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextOriginalHospital = pDoc->createTextNode(stringOriginalHospital);
- pChildCaseId->appendChild(pTextCaseId);
- pChildSourceHospital->appendChild(pTextOriginalHospital);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildSourceHospital);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1055", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetCaseTypeList(string stringLanguage)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildLanguage = pDoc->createElement("lang");
- AutoPtr<Text> pTextLanguage = pDoc->createTextNode(stringLanguage);
- pChildLanguage->appendChild(pTextLanguage);
- pRoot->appendChild(pChildLanguage);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1056", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::DoctorHandledCaseStatistics(string stringCaseType, string stringStartTime, string stringEndTime)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Element> pChildStartTime = pDoc->createElement("startdate");
- AutoPtr<Element> pChildEndTime = pDoc->createElement("enddate");
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- AutoPtr<Text> pTextStartTime = pDoc->createTextNode(stringStartTime);
- AutoPtr<Text> pTextEndTime = pDoc->createTextNode(stringEndTime);
- pChildCaseType->appendChild(pTextCaseType);
- pChildStartTime->appendChild(pTextStartTime);
- pChildEndTime->appendChild(pTextEndTime);
- pRoot->appendChild(pChildCaseType);
- pRoot->appendChild(pChildStartTime);
- pRoot->appendChild(pChildEndTime);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1057", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UserRegister(string stringPhone, string stringName, string stringHeigth)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildPhone = pDoc->createElement("phone");
- AutoPtr<Element> pChildName = pDoc->createElement("name");
- AutoPtr<Element> pChildHeigth = pDoc->createElement("heigth");
- AutoPtr<Text> pTextPhone = pDoc->createTextNode(stringPhone);
- AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
- AutoPtr<Text> pTextHeigth = pDoc->createTextNode(stringHeigth);
- pChildPhone->appendChild(pTextPhone);
- pChildName->appendChild(pTextName);
- pChildHeigth->appendChild(pTextHeigth);
- pRoot->appendChild(pChildPhone);
- pRoot->appendChild(pChildName);
- pRoot->appendChild(pChildHeigth);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- CPhmsRequestHead phmsRequestHead("10", "1058", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- //phmsRequest.GenerateAndSetSign();签名为32个0的原因与登录一致
- CPhmsResponse phmsResponse;
- m_enumPhmsCommandType = REGISTER_TYPE;//目前只有登录命令是LOGIN_TYPE,改变个人信息命令是CHANGE_INFO_TYPE,用户注册命令是REGISTER_TYPE
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- m_enumPhmsCommandType = MAIN_TYPE;//其余都是MAIN_TYPE
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetTrendData(string stringUId, string stringInterUId, string stringTrendType, string stringStartDate, string stringEndDate, string stringNextId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUId = pDoc->createElement("uid");
- AutoPtr<Element> pChildInterUId = pDoc->createElement("interuid");
- AutoPtr<Element> pChildTrendType = pDoc->createElement("trendtype");
- AutoPtr<Element> pChildStartDate = pDoc->createElement("startdate");
- AutoPtr<Element> pChildEndDate = pDoc->createElement("enddate");
- AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
- AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
- AutoPtr<Text> pTextInterUId = pDoc->createTextNode(stringInterUId);
- AutoPtr<Text> pTextTrendType = pDoc->createTextNode(stringTrendType);
- AutoPtr<Text> pTextStartDate = pDoc->createTextNode(stringStartDate);
- AutoPtr<Text> pTextEndDate = pDoc->createTextNode(stringEndDate);
- AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
- pChildUId->appendChild(pTextUId);
- pChildInterUId->appendChild(pTextInterUId);
- pChildTrendType->appendChild(pTextTrendType);
- pChildStartDate->appendChild(pTextStartDate);
- pChildEndDate->appendChild(pTextEndDate);
- pChildNextId->appendChild(pTextNextId);
- pRoot->appendChild(pChildUId);
- pRoot->appendChild(pChildInterUId);
- pRoot->appendChild(pChildTrendType);
- pRoot->appendChild(pChildStartDate);
- pRoot->appendChild(pChildEndDate);
- pRoot->appendChild(pChildNextId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1059", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetLastPhysiologicalData()
- {
- CPhmsRequestHead phmsRequestHead("10", "1060", m_stringSessionId, "10");
- CPhmsRequestBody phmsRequestBody("");
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetHealthDegree(string stringUId, string stringInterUId, string stringDate)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUId = pDoc->createElement("uid");
- AutoPtr<Element> pChildInterUId = pDoc->createElement("interuid");
- AutoPtr<Element> pChildDate = pDoc->createElement("date");
- AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
- AutoPtr<Text> pTextInterUId = pDoc->createTextNode(stringInterUId);
- AutoPtr<Text> pTextDate = pDoc->createTextNode(stringDate);
- pChildUId->appendChild(pTextUId);
- pChildInterUId->appendChild(pTextInterUId);
- pChildDate->appendChild(pTextDate);
- pRoot->appendChild(pChildUId);
- pRoot->appendChild(pChildInterUId);
- pRoot->appendChild(pChildDate);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1061", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetUserOfNoAdviceAndMostData(string stringDays)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildDays = pDoc->createElement("days");
- AutoPtr<Text> pTextDays = pDoc->createTextNode(stringDays);
- pChildDays->appendChild(pTextDays);
- pRoot->appendChild(pChildDays);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1062", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::AdviceDelay(string stringUId, string stringMinutes)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUId = pDoc->createElement("uid");
- AutoPtr<Element> pChildMinutes = pDoc->createElement("minutes");
- AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
- AutoPtr<Text> pTextMinutes = pDoc->createTextNode(stringMinutes);
- pChildUId->appendChild(pTextUId);
- pChildMinutes->appendChild(pTextMinutes);
- pRoot->appendChild(pChildUId);
- pRoot->appendChild(pChildMinutes);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1063", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::AdviceComplete(string stringUId, string stringOptionType, string stringAdvice)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUId = pDoc->createElement("uid");
- AutoPtr<Element> pChildOptionType = pDoc->createElement("optype");
- AutoPtr<Element> pChildAdvice = pDoc->createElement("advice");
- AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
- AutoPtr<Text> pTextOptionType = pDoc->createTextNode(stringOptionType);
- AutoPtr<Text> pTextAdvice = pDoc->createTextNode(stringAdvice);
- pChildUId->appendChild(pTextUId);
- pChildOptionType->appendChild(pTextOptionType);
- pChildAdvice->appendChild(pTextAdvice);
- pRoot->appendChild(pChildUId);
- pRoot->appendChild(pChildOptionType);
- pRoot->appendChild(pChildAdvice);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1064", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetUserListOfNoAdvice(string stringDays, string stringPageTo, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildDays = pDoc->createElement("days");
- AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextDays = pDoc->createTextNode(stringDays);
- AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildDays->appendChild(pTextDays);
- pChildPageTo->appendChild(pTextPageTo);
- pChildPageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildDays);
- pRoot->appendChild(pChildPageTo);
- pRoot->appendChild(pChildPageSize);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1065", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::AdviceBegin(string stringUId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUId = pDoc->createElement("uid");
- AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
- pChildUId->appendChild(pTextUId);
- pRoot->appendChild(pChildUId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1066", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetUserListOfAdvicing(string stringPageTo, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildPageTo->appendChild(pTextPageTo);
- pChildPageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildPageTo);
- pRoot->appendChild(pChildPageSize);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1067", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::VerifyThirdId(string stringUId, string stringType)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUId = pDoc->createElement("uid");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- pChildUId->appendChild(pTextUId);
- pChildType->appendChild(pTextType);
- pRoot->appendChild(pChildUId);
- pRoot->appendChild(pChildType);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- CPhmsRequestHead phmsRequestHead("10", "1068", stringSessionId/*m_stringSessionId*/, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- //phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::PersonIdRegister(string stringType, string stringRegFrom, string stringPersonId, string stringName, string stringSex, string stringBirthday, string stringAddress,
- string stringPhone, string stringHeigth, string stringUploadUnitId, string stringHospitalId, string stringHGroupId,string stringScode, string stringWxUId, string stringLmp, string stringWeight, string stringPassword,
- string stringThirdCode, string stringIsRegister)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Element> pChildRegFrom = pDoc->createElement("regfrom");
- AutoPtr<Element> pChildPersonId = pDoc->createElement("personid");
- AutoPtr<Element> pChildName = pDoc->createElement("name");
- AutoPtr<Element> pChildSex = pDoc->createElement("sex");
- AutoPtr<Element> pChildBirthday = pDoc->createElement("birthday");
- AutoPtr<Element> pChildAddress = pDoc->createElement("address");
- AutoPtr<Element> pChildPhone = pDoc->createElement("phone");
- AutoPtr<Element> pChildHeigth = pDoc->createElement("height");
- AutoPtr<Element> pChildUploadUnitId = pDoc->createElement("upload_unitid");
- AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
- AutoPtr<Element> pChildHGroupId = pDoc->createElement("hgroupid");
- AutoPtr<Element> pChildScode = pDoc->createElement("scode");
- AutoPtr<Element> pChildWxUId = pDoc->createElement("wxuid");
- AutoPtr<Element> pChildLmp = pDoc->createElement("lmp");
- AutoPtr<Element> pChildWeight = pDoc->createElement("weight");
- AutoPtr<Element> pChildPassword = pDoc->createElement("password");
- AutoPtr<Element> pChildThirdCode = pDoc->createElement("thirdcode");
- AutoPtr<Element> pChildIsRegister = pDoc->createElement("isregister");
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- AutoPtr<Text> pTextRegFrom = pDoc->createTextNode(stringRegFrom);
- AutoPtr<Text> pTextPersonId = pDoc->createTextNode(stringPersonId);
- AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
- AutoPtr<Text> pTextSex = pDoc->createTextNode(stringSex);
- AutoPtr<Text> pTextBirthday = pDoc->createTextNode(stringBirthday);
- AutoPtr<Text> pTextAddress = pDoc->createTextNode(stringAddress);
- AutoPtr<Text> pTextPhone = pDoc->createTextNode(stringPhone);
- AutoPtr<Text> pTextHeigth = pDoc->createTextNode(stringHeigth);
- AutoPtr<Text> pTextUploadUnitId = pDoc->createTextNode(stringUploadUnitId);
- AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
- AutoPtr<Text> pTextHGroupId = pDoc->createTextNode(stringHGroupId);
- AutoPtr<Text> pTextScode = pDoc->createTextNode(stringScode);
- AutoPtr<Text> pTextWxUId = pDoc->createTextNode(stringWxUId);
- AutoPtr<Text> pTextLmp = pDoc->createTextNode(stringLmp);
- AutoPtr<Text> pTextWeight = pDoc->createTextNode(stringWeight);
- AutoPtr<Text> pTextPassword = pDoc->createTextNode(stringPassword);
- AutoPtr<Text> pTextThirdCode = pDoc->createTextNode(stringThirdCode);
- AutoPtr<Text> pTextIsRegister = pDoc->createTextNode(stringIsRegister);
- pChildType->appendChild(pTextType);
- pChildRegFrom->appendChild(pTextRegFrom);
- pChildPersonId->appendChild(pTextPersonId);
- pChildName->appendChild(pTextName);
- pChildSex->appendChild(pTextSex);
- pChildBirthday->appendChild(pTextBirthday);
- pChildAddress->appendChild(pTextAddress);
- pChildPhone->appendChild(pTextPhone);
- pChildHeigth->appendChild(pTextHeigth);
- pChildUploadUnitId->appendChild(pTextUploadUnitId);
- pChildHospitalId->appendChild(pTextHospitalId);
- pChildHGroupId->appendChild(pTextHGroupId);
- pChildScode->appendChild(pTextScode);
- pChildWxUId->appendChild(pTextWxUId);
- pChildLmp->appendChild(pTextLmp);
- pChildWeight->appendChild(pTextWeight);
- pChildPassword->appendChild(pTextPassword);
- pChildThirdCode->appendChild(pTextThirdCode);
- pChildIsRegister->appendChild(pTextIsRegister);
- pRoot->appendChild(pChildType);
- pRoot->appendChild(pChildRegFrom);
- pRoot->appendChild(pChildPersonId);
- pRoot->appendChild(pChildName);
- pRoot->appendChild(pChildSex);
- pRoot->appendChild(pChildBirthday);
- pRoot->appendChild(pChildAddress);
- pRoot->appendChild(pChildPhone);
- pRoot->appendChild(pChildHeigth);
- pRoot->appendChild(pChildUploadUnitId);
- pRoot->appendChild(pChildHospitalId);
- pRoot->appendChild(pChildHGroupId);
- pRoot->appendChild(pChildScode);
- pRoot->appendChild(pChildWxUId);
- pRoot->appendChild(pChildLmp);
- pRoot->appendChild(pChildWeight);
- pRoot->appendChild(pChildPassword);
- pRoot->appendChild(pChildThirdCode);
- pRoot->appendChild(pChildIsRegister);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- CPhmsRequestHead phmsRequestHead("10", "1069", stringSessionId, "11");
- if(stringType=="1")
- {
- phmsRequestHead.SetSessionId(m_stringSessionId);
- }
- if(stringType=="4" || stringType=="5")
- {
- if(m_stringSessionId.size() != 0)
- {
- phmsRequestHead.SetSessionId(m_stringSessionId);
- }
- }
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(stringType=="1" || ((stringType=="4" || stringType=="5") && m_stringSessionId.size() != 0))
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetVerificationCode(string stringType, string stringPhone)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Element> pChildPhone = pDoc->createElement("phone");
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- AutoPtr<Text> pTextPhone = pDoc->createTextNode(stringPhone);
- pChildType->appendChild(pTextType);
- pChildPhone->appendChild(pTextPhone);
- pRoot->appendChild(pChildType);
- pRoot->appendChild(pChildPhone);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- CPhmsRequestHead phmsRequestHead("10", "1070", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- //phmsRequest.GenerateAndSetSign();签名为32个0的原因与登录一样
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetAskList(string stringAskType, string stringAskEnd, string stringDoctorId, string stringIsAsk, string stringUserId, string stringStartTime, string stringEndTime, string stringPageTo, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildAskType = pDoc->createElement("asktype");
- AutoPtr<Element> pChildAskEnd = pDoc->createElement("askend");
- AutoPtr<Element> pChildDoctorId = pDoc->createElement("doctorid");
- AutoPtr<Element> pChildIsAsk = pDoc->createElement("isask");
- AutoPtr<Element> pChildUserId = pDoc->createElement("userid");
- AutoPtr<Element> pChildStartTime = pDoc->createElement("starttime");
- AutoPtr<Element> pChildEndTime = pDoc->createElement("endtime");
- AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextAskType = pDoc->createTextNode(stringAskType);
- AutoPtr<Text> pTextAskEnd = pDoc->createTextNode(stringAskEnd);
- AutoPtr<Text> pTextDoctorId = pDoc->createTextNode(stringDoctorId);
- AutoPtr<Text> pTextIsAsk = pDoc->createTextNode(stringIsAsk);
- AutoPtr<Text> pTextUserId = pDoc->createTextNode(stringUserId);
- AutoPtr<Text> pTextStartTime = pDoc->createTextNode(stringStartTime);
- AutoPtr<Text> pTextEndTime = pDoc->createTextNode(stringEndTime);
- AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildAskType->appendChild(pTextAskType);
- pChildAskEnd->appendChild(pTextAskEnd);
- pChildDoctorId->appendChild(pTextDoctorId);
- pChildIsAsk->appendChild(pTextIsAsk);
- pChildUserId->appendChild(pTextUserId);
- pChildStartTime->appendChild(pTextStartTime);
- pChildEndTime->appendChild(pTextEndTime);
- pChildPageTo->appendChild(pTextPageTo);
- pChildPageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildAskType);
- pRoot->appendChild(pChildAskEnd);
- pRoot->appendChild(pChildDoctorId);
- pRoot->appendChild(pChildIsAsk);
- pRoot->appendChild(pChildUserId);
- pRoot->appendChild(pChildStartTime);
- pRoot->appendChild(pChildEndTime);
- pRoot->appendChild(pChildPageTo);
- pRoot->appendChild(pChildPageSize);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1071", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetAskDetail(string stringAskId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildAskId = pDoc->createElement("askid");
- AutoPtr<Element> pChildIsAsked = pDoc->createElement("isasked");
- AutoPtr<Element> pChildDoctorId = pDoc->createElement("doctorid");
- AutoPtr<Text> pTextAskId = pDoc->createTextNode(stringAskId);
- AutoPtr<Text> pTextIsAsked = pDoc->createTextNode("");
- AutoPtr<Text> pTextDoctorId = pDoc->createTextNode("");
- pChildAskId->appendChild(pTextAskId);
- pChildIsAsked->appendChild(pTextIsAsked);
- pChildDoctorId->appendChild(pTextDoctorId);
- pRoot->appendChild(pChildAskId);
- pRoot->appendChild(pChildIsAsked);
- pRoot->appendChild(pChildDoctorId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1072", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetQuestionList(string stringDoctorId, string stringReportType, string stringAskId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildDoctorId = pDoc->createElement("doctorid");
- AutoPtr<Element> pChildReportType = pDoc->createElement("reporttype");
- AutoPtr<Element> pChildAskId = pDoc->createElement("askid");
- AutoPtr<Text> pTextDoctorId = pDoc->createTextNode(stringDoctorId);
- AutoPtr<Text> pTextReportType = pDoc->createTextNode(stringReportType);
- AutoPtr<Text> pTextAskId = pDoc->createTextNode(stringAskId);
- pChildDoctorId->appendChild(pTextDoctorId);
- pChildReportType->appendChild(pTextReportType);
- pChildAskId->appendChild(pTextAskId);
- pRoot->appendChild(pChildDoctorId);
- pRoot->appendChild(pChildReportType);
- pRoot->appendChild(pChildAskId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1073", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::SubmitQuestion(string stringUserId, string stringAdvise, string stringReportType, string stringAskId, string stringAskedId, string stringDoctorPhotoPath)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUserId = pDoc->createElement("userid");
- AutoPtr<Element> pChildAdvise = pDoc->createElement("advise");
- AutoPtr<Element> pChildReportType = pDoc->createElement("reporttype");
- AutoPtr<Element> pChildAskId = pDoc->createElement("askid");
- AutoPtr<Element> pChildAskedId = pDoc->createElement("askedid");
- AutoPtr<Element> pChildDoctorPhoto = pDoc->createElement("doctorphoto");;
- AutoPtr<Text> pTextUserId = pDoc->createTextNode(stringUserId);
- AutoPtr<Text> pTextAdvise = pDoc->createTextNode(stringAdvise);
- AutoPtr<Text> pTextReportType = pDoc->createTextNode(stringReportType);
- AutoPtr<Text> pTextAskId = pDoc->createTextNode(stringAskId);
- AutoPtr<Text> pTextAskedId = pDoc->createTextNode(stringAskedId);
- AutoPtr<Text> pTextDoctorPhoto = pDoc->createTextNode(stringDoctorPhotoPath);
- pChildUserId->appendChild(pTextUserId);
- pChildAdvise->appendChild(pTextAdvise);
- pChildReportType->appendChild(pTextReportType);
- pChildAskId->appendChild(pTextAskId);
- pChildAskedId->appendChild(pTextAskedId);
- pChildDoctorPhoto->appendChild(pTextDoctorPhoto);
- pRoot->appendChild(pChildUserId);
- pRoot->appendChild(pChildAdvise);
- pRoot->appendChild(pChildReportType);
- pRoot->appendChild(pChildAskId);
- pRoot->appendChild(pChildAskedId);
- pRoot->appendChild(pChildDoctorPhoto);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1074", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetDataDictionary()
- {
- CPhmsRequestHead phmsRequestHead("10", "1075", m_stringSessionId, "10");
- CPhmsRequestBody phmsRequestBody("");
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::LoggingHealthBaseInfo(string stringUserId, string stringWeblock, string stringNation, string stringProfression, string stringCrowd, string stringBloodType,
- string stringJwsJiBing, string stringJwsShouShu, string stringJwsWaiShang, string stringJwsShuXue, string stringJwsBaoLuShi, string stringJwsBaoLuShiBz,
- string stringJwsYiChuanJiBing, string stringGmsGuoMinShi, string stringGmsGuoMinShiBz, string stringJzsFuQin, string stringJzsFuQinBz, string stringJzsMuQin,
- string stringJzsMuQinBz, string stringJzsXdjm, string stringJzsXdjmBz, string stringJzsZiNv, string stringJzsZiNvBz, string stringJzsQiTa)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUserId = pDoc->createElement("userid");
- AutoPtr<Element> pChildWeblock = pDoc->createElement("wedlock");
- AutoPtr<Element> pChildNation = pDoc->createElement("nation");
- AutoPtr<Element> pChildProfression = pDoc->createElement("profession");
- AutoPtr<Element> pChildCrowd = pDoc->createElement("crowd");
- AutoPtr<Element> pChildBloodType = pDoc->createElement("bloodtype");
- AutoPtr<Element> pChildJwsJiBing = pDoc->createElement("jws_jibing");
- AutoPtr<Element> pChildJwsShouShu = pDoc->createElement("jws_shoushu");
- AutoPtr<Element> pChildJwsWaiShang = pDoc->createElement("jws_waishang");
- AutoPtr<Element> pChildJwsShuXue = pDoc->createElement("jws_shuxue");
- AutoPtr<Element> pChildJwsBaoLuShi = pDoc->createElement("jws_baolushi");
- AutoPtr<Element> pChildJwsBaoLuShiBz = pDoc->createElement("jws_baolushi_bz");
- AutoPtr<Element> pChildJwsYiChuanJiBing = pDoc->createElement("jws_yichuanjibing");
- AutoPtr<Element> pChildGmsGuoMinShi = pDoc->createElement("gms_guominshi");
- AutoPtr<Element> pChildGmsGuoMinShiBz = pDoc->createElement("gms_guominshi_bz");
- AutoPtr<Element> pChildJzsFuQin = pDoc->createElement("jzs_fuqin");
- AutoPtr<Element> pChildJzsFuQinBz = pDoc->createElement("jzs_fuqin_bz");
- AutoPtr<Element> pChildJzsMuQin = pDoc->createElement("jzs_muqin");
- AutoPtr<Element> pChildJzsMuQinBz = pDoc->createElement("jzs_muqin_bz");
- AutoPtr<Element> pChildJzsXdjm = pDoc->createElement("jzs_xdjm");
- AutoPtr<Element> pChildJzsXdjmBz = pDoc->createElement("jzs_xdjm_bz");
- AutoPtr<Element> pChildJzsZiNv = pDoc->createElement("jzs_zinv");
- AutoPtr<Element> pChildJzsZiNvBz = pDoc->createElement("jzs_zinv_bz");
- AutoPtr<Element> pChildJzsQiTa = pDoc->createElement("jzs_qita");
- AutoPtr<Text> pTextUserId = pDoc->createTextNode(stringUserId);
- AutoPtr<Text> pTextWeblock = pDoc->createTextNode(stringWeblock);
- AutoPtr<Text> pTextNation = pDoc->createTextNode(stringNation);
- AutoPtr<Text> pTextProfression = pDoc->createTextNode(stringProfression);
- AutoPtr<Text> pTextCrowd = pDoc->createTextNode(stringCrowd);
- AutoPtr<Text> pTextBloodType = pDoc->createTextNode(stringBloodType);
- AutoPtr<Text> pTextJwsJiBing = pDoc->createTextNode(stringJwsJiBing);
- AutoPtr<Text> pTextJwsShouShu = pDoc->createTextNode(stringJwsShouShu);
- AutoPtr<Text> pTextJwsWaiShang = pDoc->createTextNode(stringJwsWaiShang);
- AutoPtr<Text> pTextJwsShuXue = pDoc->createTextNode(stringJwsShuXue);
- AutoPtr<Text> pTextJwsBaoLuShi = pDoc->createTextNode(stringJwsBaoLuShi);
- AutoPtr<Text> pTextJwsBaoLuShiBz = pDoc->createTextNode(stringJwsBaoLuShiBz);
- AutoPtr<Text> pTextJwsYiChuanJiBing = pDoc->createTextNode(stringJwsYiChuanJiBing);
- AutoPtr<Text> pTextGmsGuoMinShi = pDoc->createTextNode(stringGmsGuoMinShi);
- AutoPtr<Text> pTextGmsGuoMinShiBz = pDoc->createTextNode(stringGmsGuoMinShiBz);
- AutoPtr<Text> pTextJzsFuQin = pDoc->createTextNode(stringJzsFuQin);
- AutoPtr<Text> pTextJzsFuQinBz = pDoc->createTextNode(stringJzsFuQinBz);
- AutoPtr<Text> pTextJzsMuQin = pDoc->createTextNode(stringJzsMuQin);
- AutoPtr<Text> pTextJzsMuQinBz = pDoc->createTextNode(stringJzsMuQinBz);
- AutoPtr<Text> pTextJzsXdjm = pDoc->createTextNode(stringJzsXdjm);
- AutoPtr<Text> pTextJzsXdjmBz = pDoc->createTextNode(stringJzsXdjmBz);
- AutoPtr<Text> pTextJzsZiNv = pDoc->createTextNode(stringJzsZiNv);
- AutoPtr<Text> pTextJzsZiNvBz = pDoc->createTextNode(stringJzsZiNvBz);
- AutoPtr<Text> pTextJzsQiTa = pDoc->createTextNode(stringJzsQiTa);
- pChildUserId->appendChild(pTextUserId);
- pChildWeblock->appendChild(pTextWeblock);
- pChildNation->appendChild(pTextNation);
- pChildProfression->appendChild(pTextProfression);
- pChildCrowd->appendChild(pTextCrowd);
- pChildBloodType->appendChild(pTextBloodType);
- pChildJwsJiBing->appendChild(pTextJwsJiBing);
- pChildJwsShouShu->appendChild(pTextJwsShouShu);
- pChildJwsWaiShang->appendChild(pTextJwsWaiShang);
- pChildJwsShuXue->appendChild(pTextJwsShuXue);
- pChildJwsBaoLuShi->appendChild(pTextJwsBaoLuShi);
- pChildJwsBaoLuShiBz->appendChild(pTextJwsBaoLuShiBz);
- pChildJwsYiChuanJiBing->appendChild(pTextJwsYiChuanJiBing);
- pChildGmsGuoMinShi->appendChild(pTextGmsGuoMinShi);
- pChildGmsGuoMinShiBz->appendChild(pTextGmsGuoMinShiBz);
- pChildJzsFuQin->appendChild(pTextJzsFuQin);
- pChildJzsFuQinBz->appendChild(pTextJzsFuQinBz);
- pChildJzsMuQin->appendChild(pTextJzsMuQin);
- pChildJzsMuQinBz->appendChild(pTextJzsMuQinBz);
- pChildJzsXdjm->appendChild(pTextJzsXdjm);
- pChildJzsXdjmBz->appendChild(pTextJzsXdjmBz);
- pChildJzsZiNv->appendChild(pTextJzsZiNv);
- pChildJzsZiNvBz->appendChild(pTextJzsZiNvBz);
- pChildJzsQiTa->appendChild(pTextJzsQiTa);
- pRoot->appendChild(pChildUserId);
- pRoot->appendChild(pChildWeblock);
- pRoot->appendChild(pChildNation);
- pRoot->appendChild(pChildProfression);
- pRoot->appendChild(pChildCrowd);
- pRoot->appendChild(pChildBloodType);
- pRoot->appendChild(pChildJwsJiBing);
- pRoot->appendChild(pChildJwsShouShu);
- pRoot->appendChild(pChildJwsWaiShang);
- pRoot->appendChild(pChildJwsShuXue);
- pRoot->appendChild(pChildJwsBaoLuShi);
- pRoot->appendChild(pChildJwsBaoLuShiBz);
- pRoot->appendChild(pChildJwsYiChuanJiBing);
- pRoot->appendChild(pChildGmsGuoMinShi);
- pRoot->appendChild(pChildGmsGuoMinShiBz);
- pRoot->appendChild(pChildJzsFuQin);
- pRoot->appendChild(pChildJzsFuQinBz);
- pRoot->appendChild(pChildJzsMuQin);
- pRoot->appendChild(pChildJzsMuQinBz);
- pRoot->appendChild(pChildJzsXdjm);
- pRoot->appendChild(pChildJzsXdjmBz);
- pRoot->appendChild(pChildJzsZiNv);
- pRoot->appendChild(pChildJzsZiNvBz);
- pRoot->appendChild(pChildJzsQiTa);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1076", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::LoggingHealthCurrentInfo(string stringUserId, string stringShfsYinShi, string stringShfsXlzk, string stringShfsXlzkBz, string stringShfsXltz, string stringShfsXiYan,
- string stringShfsYinJiu, string stringShfsSyqk, string stringShfsYunDong, string stringShfsYunDongShiJian, string stringSysjcDanGuChun, string stringSysjcXueChangGui,
- string stringSysjcXueChangGuiBz, string stringSysjcNiaoChangGui, string stringSysjcNiaoChangGuiBz, string stringSysjcQiTa, string stringYongYao, string stringZhuYuan,
- string stringJkwtNaoXueGuan, string stringJkwtNaoXueGuanBz, string stringJkwtShenZang, string stringJkwtShenZangBz, string stringJkwtXinZang, string stringJkwtXinZangBz,
- string stringJkwtXueGuan, string stringJkwtXueGuanBz, string stringJkwtYanBu, string stringJkwtYanBuBz, string stringJkwtShenJing, string stringJkwtQiTa, string stringDate)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUserId = pDoc->createElement("userid");
- AutoPtr<Element> pChildShfsYinShi = pDoc->createElement("shfs_yinshi");
- AutoPtr<Element> pChildShfsXlzk = pDoc->createElement("shfs_xinlizhuangkuang");
- AutoPtr<Element> pChildShfsXlzkBz = pDoc->createElement("shfs_xlzk_bz");
- AutoPtr<Element> pChildShfsXltz = pDoc->createElement("shfs_xltz");
- AutoPtr<Element> pChildShfsXiYan = pDoc->createElement("shfs_xiyan");
- AutoPtr<Element> pChildShfsYinJiu = pDoc->createElement("shfs_yinjiu");
- AutoPtr<Element> pChildShfsSyqk = pDoc->createElement("shfs_syqk");
- AutoPtr<Element> pChildShfsYunDong = pDoc->createElement("shfs_yundong");
- AutoPtr<Element> pChildShfsYunDongShiJian = pDoc->createElement("shfs_yundongshijian");
- AutoPtr<Element> pChildSysjcDanGuChun = pDoc->createElement("sysjc_danguchun");
- AutoPtr<Element> pChildSysjcXueChangGui = pDoc->createElement("sysjc_xuechanggui");
- AutoPtr<Element> pChildSysjcXueChangGuiBz = pDoc->createElement("sysjc_xuechanggui_bz");
- AutoPtr<Element> pChildSysjcNiaoChangGui = pDoc->createElement("sysjc_niaochanggui");
- AutoPtr<Element> pChildSysjcNiaoChangGuiBz = pDoc->createElement("sysjc_niaochanggui_bz");
- AutoPtr<Element> pChildSysjcQiTa = pDoc->createElement("sysjc_qita");
- AutoPtr<Element> pChildYongYao = pDoc->createElement("yongyao");
- AutoPtr<Element> pChildZhuYuan = pDoc->createElement("zhuyuan");
- AutoPtr<Element> pChildJkwtNaoXueGuan = pDoc->createElement("jkwt_naoxueguan");
- AutoPtr<Element> pChildJkwtNaoXueGuanBz = pDoc->createElement("jkwt_naoxueguan_bz");
- AutoPtr<Element> pChildJkwtShenZang = pDoc->createElement("jkwt_shenzang");
- AutoPtr<Element> pChildJkwtShenZangBz = pDoc->createElement("jkwt_shenzang_bz");
- AutoPtr<Element> pChildJkwtXinZang = pDoc->createElement("jkwt_xinzang");
- AutoPtr<Element> pChildJkwtXinZangBz = pDoc->createElement("jkwt_xinzang_bz");
- AutoPtr<Element> pChildJkwtXueGuan = pDoc->createElement("jkwt_xueguan");
- AutoPtr<Element> pChildJkwtXueGuanBz = pDoc->createElement("jkwt_xueguan_bz");
- AutoPtr<Element> pChildJkwtYanBu = pDoc->createElement("jkwt_yanbu");
- AutoPtr<Element> pChildJkwtYanBuBz = pDoc->createElement("jkwt_yanbu_bz");
- AutoPtr<Element> pChildJkwtShenJing = pDoc->createElement("jkwt_shenjing");
- AutoPtr<Element> pChildJkwtQiTa = pDoc->createElement("jkwt_qita");
- AutoPtr<Element> pChildDate = pDoc->createElement("date");
- AutoPtr<Text> pTextUserId = pDoc->createTextNode(stringUserId);
- AutoPtr<Text> pTextShfsYinShi = pDoc->createTextNode(stringShfsYinShi);
- AutoPtr<Text> pTextShfsXlzk = pDoc->createTextNode(stringShfsXlzk);
- AutoPtr<Text> pTextShfsXlzkBz = pDoc->createTextNode(stringShfsXlzkBz);
- AutoPtr<Text> pTextShfsXltz = pDoc->createTextNode(stringShfsXltz);
- AutoPtr<Text> pTextShfsXiYan = pDoc->createTextNode(stringShfsXiYan);
- AutoPtr<Text> pTextShfsYinJiu = pDoc->createTextNode(stringShfsYinJiu);
- AutoPtr<Text> pTextShfsSyqk = pDoc->createTextNode(stringShfsSyqk);
- AutoPtr<Text> pTextShfsYunDong = pDoc->createTextNode(stringShfsYunDong);
- AutoPtr<Text> pTextShfsYunDongShiJian = pDoc->createTextNode(stringShfsYunDongShiJian);
- AutoPtr<Text> pTextSysjcDanGuChun = pDoc->createTextNode(stringSysjcDanGuChun);
- AutoPtr<Text> pTextSysjcXueChangGui = pDoc->createTextNode(stringSysjcXueChangGui);
- AutoPtr<Text> pTextSysjcXueChangGuiBz = pDoc->createTextNode(stringSysjcXueChangGuiBz);
- AutoPtr<Text> pTextSysjcNiaoChangGui = pDoc->createTextNode(stringSysjcNiaoChangGui);
- AutoPtr<Text> pTextSysjcNiaoChangGuiBz = pDoc->createTextNode(stringSysjcNiaoChangGuiBz);
- AutoPtr<Text> pTextSysjcQiTa = pDoc->createTextNode(stringSysjcQiTa);
- AutoPtr<Text> pTextYongYao = pDoc->createTextNode(stringYongYao);
- AutoPtr<Text> pTextZhuYuan = pDoc->createTextNode(stringZhuYuan);
- AutoPtr<Text> pTextJkwtNaoXueGuan = pDoc->createTextNode(stringJkwtNaoXueGuan);
- AutoPtr<Text> pTextJkwtNaoXueGuanBz = pDoc->createTextNode(stringJkwtNaoXueGuanBz);
- AutoPtr<Text> pTextJkwtShenZang = pDoc->createTextNode(stringJkwtShenZang);
- AutoPtr<Text> pTextJkwtShenZangBz = pDoc->createTextNode(stringJkwtShenZangBz);
- AutoPtr<Text> pTextJkwtXinZang = pDoc->createTextNode(stringJkwtXinZang);
- AutoPtr<Text> pTextJkwtXinZangBz = pDoc->createTextNode(stringJkwtXinZangBz);
- AutoPtr<Text> pTextJkwtXueGuan = pDoc->createTextNode(stringJkwtXueGuan);
- AutoPtr<Text> pTextJkwtXueGuanBz = pDoc->createTextNode(stringJkwtXueGuanBz);
- AutoPtr<Text> pTextJkwtYanBu = pDoc->createTextNode(stringJkwtYanBu);
- AutoPtr<Text> pTextJkwtYanBuBz = pDoc->createTextNode(stringJkwtYanBuBz);
- AutoPtr<Text> pTextJkwtShenJing = pDoc->createTextNode(stringJkwtShenJing);
- AutoPtr<Text> pTextJkwtQiTa = pDoc->createTextNode(stringJkwtQiTa);
- AutoPtr<Text> pTextDate = pDoc->createTextNode(stringDate);
- pChildUserId->appendChild(pTextUserId);
- pChildShfsYinShi->appendChild(pTextShfsYinShi);
- pChildShfsXlzk->appendChild(pTextShfsXlzk);
- pChildShfsXlzkBz->appendChild(pTextShfsXlzkBz);
- pChildShfsXltz->appendChild(pTextShfsXltz);
- pChildShfsXiYan->appendChild(pTextShfsXiYan);
- pChildShfsYinJiu->appendChild(pTextShfsYinJiu);
- pChildShfsSyqk->appendChild(pTextShfsSyqk);
- pChildShfsYunDong->appendChild(pTextShfsYunDong);
- pChildShfsYunDongShiJian->appendChild(pTextShfsYunDongShiJian);
- pChildSysjcDanGuChun->appendChild(pTextSysjcDanGuChun);
- pChildSysjcXueChangGui->appendChild(pTextSysjcXueChangGui);
- pChildSysjcXueChangGuiBz->appendChild(pTextSysjcXueChangGuiBz);
- pChildSysjcNiaoChangGui->appendChild(pTextSysjcNiaoChangGui);
- pChildSysjcNiaoChangGuiBz->appendChild(pTextSysjcNiaoChangGuiBz);
- pChildSysjcQiTa->appendChild(pTextSysjcQiTa);
- pChildYongYao->appendChild(pTextYongYao);
- pChildZhuYuan->appendChild(pTextZhuYuan);
- pChildJkwtNaoXueGuan->appendChild(pTextJkwtNaoXueGuan);
- pChildJkwtNaoXueGuanBz->appendChild(pTextJkwtNaoXueGuanBz);
- pChildJkwtShenZang->appendChild(pTextJkwtShenZang);
- pChildJkwtShenZangBz->appendChild(pTextJkwtShenZangBz);
- pChildJkwtXinZang->appendChild(pTextJkwtXinZang);
- pChildJkwtXinZangBz->appendChild(pTextJkwtXinZangBz);
- pChildJkwtXueGuan->appendChild(pTextJkwtXueGuan);
- pChildJkwtXueGuanBz->appendChild(pTextJkwtXueGuanBz);
- pChildJkwtYanBu->appendChild(pTextJkwtYanBu);
- pChildJkwtYanBuBz->appendChild(pTextJkwtYanBuBz);
- pChildJkwtShenJing->appendChild(pTextJkwtShenJing);
- pChildJkwtQiTa->appendChild(pTextJkwtQiTa);
- pChildDate->appendChild(pTextDate);
- pRoot->appendChild(pChildUserId);
- pRoot->appendChild(pChildShfsYinShi);
- pRoot->appendChild(pChildShfsXlzk);
- pRoot->appendChild(pChildShfsXlzkBz);
- pRoot->appendChild(pChildShfsXltz);
- pRoot->appendChild(pChildShfsXiYan);
- pRoot->appendChild(pChildShfsYinJiu);
- pRoot->appendChild(pChildShfsSyqk);
- pRoot->appendChild(pChildShfsYunDong);
- pRoot->appendChild(pChildShfsYunDongShiJian);
- pRoot->appendChild(pChildSysjcDanGuChun);
- pRoot->appendChild(pChildSysjcXueChangGui);
- pRoot->appendChild(pChildSysjcXueChangGuiBz);
- pRoot->appendChild(pChildSysjcNiaoChangGui);
- pRoot->appendChild(pChildSysjcNiaoChangGuiBz);
- pRoot->appendChild(pChildSysjcQiTa);
- pRoot->appendChild(pChildYongYao);
- pRoot->appendChild(pChildZhuYuan);
- pRoot->appendChild(pChildJkwtNaoXueGuan);
- pRoot->appendChild(pChildJkwtNaoXueGuanBz);
- pRoot->appendChild(pChildJkwtShenZang);
- pRoot->appendChild(pChildJkwtShenZangBz);
- pRoot->appendChild(pChildJkwtXinZang);
- pRoot->appendChild(pChildJkwtXinZangBz);
- pRoot->appendChild(pChildJkwtXueGuan);
- pRoot->appendChild(pChildJkwtXueGuanBz);
- pRoot->appendChild(pChildJkwtYanBu);
- pRoot->appendChild(pChildJkwtYanBuBz);
- pRoot->appendChild(pChildJkwtShenJing);
- pRoot->appendChild(pChildJkwtQiTa);
- pRoot->appendChild(pChildDate);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1077", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetCliniqueListOfHospital(string stringHospitalId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
- AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
- pChildHospitalId->appendChild(pTextHospitalId);
- pRoot->appendChild(pChildHospitalId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1078", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetStatisticsInfo(string stringTypeId, string stringMonth, string stringMonthDay, string stringPageTo, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildTypeId = pDoc->createElement("typeid");
- AutoPtr<Element> pChildMonth = pDoc->createElement("statisticsdate");
- AutoPtr<Element> pChildMonthDay = pDoc->createElement("statisticsstartdate");
- AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextTypeId = pDoc->createTextNode(stringTypeId);
- AutoPtr<Text> pTextMonth = pDoc->createTextNode(stringMonth);
- AutoPtr<Text> pTextMonthDay = pDoc->createTextNode(stringMonthDay);
- AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildTypeId->appendChild(pTextTypeId);
- pChildMonth->appendChild(pTextMonth);
- pChildMonthDay->appendChild(pTextMonthDay);
- pChildPageTo->appendChild(pTextPageTo);
- pChildPageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildTypeId);
- pRoot->appendChild(pChildMonth);
- pRoot->appendChild(pChildMonthDay);
- pRoot->appendChild(pChildPageTo);
- pRoot->appendChild(pChildPageSize);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1079", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UpdateCaseInfo(string stringHospitalId, string stringCaseId, string stringOtherParam, string stringFlag, string stringNotes, string stringReceiverId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildNotes = pDoc->createElement("notes");
- AutoPtr<Element> pChildOtherParam = pDoc->createElement("otherparam");
- AutoPtr<Element> pChildFlag = pDoc->createElement("flag");
- AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
- AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextNotes = pDoc->createTextNode(stringNotes);
- AutoPtr<Text> pTextOtherParam = pDoc->createTextNode(stringOtherParam);
- AutoPtr<Text> pTextFlag = pDoc->createTextNode(stringFlag);
- AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
- pChildHospitalId->appendChild(pTextHospitalId);
- pChildCaseId->appendChild(pTextCaseId);
- pChildNotes->appendChild(pTextNotes);
- pChildOtherParam->appendChild(pTextOtherParam);
- pChildFlag->appendChild(pTextFlag);
- pChildReceiverId->appendChild(pTextReceiverId);
- pRoot->appendChild(pChildHospitalId);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildNotes);
- pRoot->appendChild(pChildOtherParam);
- pRoot->appendChild(pChildFlag);
- pRoot->appendChild(pChildReceiverId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1080", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetUserHealthList(string stringNextId, string stringTypeId, string stringSecondTypeId, string stringName, string stringSex, string strinThirdIdType,
- string stringThirdId, string stringHospitalId,
- string stringUnitSenderId, string stringIsData, string stringIntervalTime, string stringPopulations, string stringContractDoctor, string stringIsContract, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
- AutoPtr<Element> pChildTypeId = pDoc->createElement("typeid");
- AutoPtr<Element> pChildSecondTypeId = pDoc->createElement("secondtypeid");
- AutoPtr<Element> pChildName = pDoc->createElement("name");
- AutoPtr<Element> pChildSex = pDoc->createElement("sex");
- AutoPtr<Element> pChildThirdIdType = pDoc->createElement("thirdidtype");
- AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
- AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
- AutoPtr<Element> pChildUnitSenderId = pDoc->createElement("unitsenderid");
- AutoPtr<Element> pChildIsData = pDoc->createElement("isdata");
- AutoPtr<Element> pChildIntervalTime = pDoc->createElement("intervaltime");
- AutoPtr<Element> pChildPopulations = pDoc->createElement("populations");
- AutoPtr<Element> pChildContractDoctor = pDoc->createElement("contractdoctor");
- AutoPtr<Element> pChildIsContract = pDoc->createElement("iscontract");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
-
- AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
- AutoPtr<Text> pTextTypeId = pDoc->createTextNode(stringTypeId);
- AutoPtr<Text> pTextSecondTypeId = pDoc->createTextNode(stringSecondTypeId);
- AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
- AutoPtr<Text> pTextSex = pDoc->createTextNode(stringSex);
- AutoPtr<Text> pTextThirdIdType = pDoc->createTextNode(strinThirdIdType);
- AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
- AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
- AutoPtr<Text> pTextUnitSenderId = pDoc->createTextNode(stringUnitSenderId);
- AutoPtr<Text> pTextIsData = pDoc->createTextNode(stringIsData);
- AutoPtr<Text> pTextIntervalTime = pDoc->createTextNode(stringIntervalTime);
- AutoPtr<Text> pTextPopulations = pDoc->createTextNode(stringPopulations);
- AutoPtr<Text> pTextContractDoctor = pDoc->createTextNode(stringContractDoctor);
- AutoPtr<Text> pTextIsContract = pDoc->createTextNode(stringIsContract);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
-
- pChildNextId->appendChild(pTextNextId);
- pChildTypeId->appendChild(pTextTypeId);
- pChildSecondTypeId->appendChild(pTextSecondTypeId);
- pChildName->appendChild(pTextName);
- pChildSex->appendChild(pTextSex);
- pChildThirdIdType->appendChild(pTextThirdIdType);
- pChildThirdId->appendChild(pTextThirdId);
- pChildHospitalId->appendChild(pTextHospitalId);
- pChildUnitSenderId->appendChild(pTextUnitSenderId);
- pChildIsData->appendChild(pTextIsData);
- pChildIntervalTime->appendChild(pTextIntervalTime);
- pChildPopulations->appendChild(pTextPopulations);
- pChildContractDoctor->appendChild(pTextContractDoctor);
- pChildIsContract->appendChild(pTextIsContract);
- pChildPageSize->appendChild(pTextPageSize);
-
- pRoot->appendChild(pChildNextId);
- pRoot->appendChild(pChildTypeId);
- pRoot->appendChild(pChildSecondTypeId);
- pRoot->appendChild(pChildName);
- pRoot->appendChild(pChildSex);
- pRoot->appendChild(pChildThirdIdType);
- pRoot->appendChild(pChildThirdId);
- pRoot->appendChild(pChildHospitalId);
- pRoot->appendChild(pChildUnitSenderId);
- pRoot->appendChild(pChildIsData);
- pRoot->appendChild(pChildIntervalTime);
- pRoot->appendChild(pChildPopulations);
- pRoot->appendChild(pChildContractDoctor);
- pRoot->appendChild(pChildIsContract);
- pRoot->appendChild(pChildPageSize);
-
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1081", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetAdviceImplemention(string stringThirdId, string stringHospitalId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
- AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
- AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
- AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
- pChildThirdId->appendChild(pTextThirdId);
- pChildHospitalId->appendChild(pTextHospitalId);
- pRoot->appendChild(pChildThirdId);
- pRoot->appendChild(pChildHospitalId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1082", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ChangePersonType(string stringThirdId, string stringPeopleType, string stringHospitalId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
- AutoPtr<Element> pChildPeopleType = pDoc->createElement("peopletype");
- AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
- AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
- AutoPtr<Text> pTextPeopleType = pDoc->createTextNode(stringPeopleType);
- AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
- pChildThirdId->appendChild(pTextThirdId);
- pChildPeopleType->appendChild(pTextPeopleType);
- pChildHospitalId->appendChild(pTextHospitalId);
- pRoot->appendChild(pChildThirdId);
- pRoot->appendChild(pChildPeopleType);
- pRoot->appendChild(pChildHospitalId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1083", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::SetNextVisitTime(string stringThirdId, string stringInterViewTime, string stringHospitalId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
- AutoPtr<Element> pChildInterViewDate = pDoc->createElement("interviewdate");
- AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
- AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
- AutoPtr<Text> pTextInterViewDate = pDoc->createTextNode(stringInterViewTime);
- AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
- pChildThirdId->appendChild(pTextThirdId);
- pChildInterViewDate->appendChild(pTextInterViewDate);
- pChildHospitalId->appendChild(pTextHospitalId);
- pRoot->appendChild(pChildThirdId);
- pRoot->appendChild(pChildInterViewDate);
- pRoot->appendChild(pChildHospitalId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1084", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetPersonTypeList(string stringLanguage)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildLang = pDoc->createElement("lang");
- AutoPtr<Text> pTextLang = pDoc->createTextNode(stringLanguage);
- pChildLang->appendChild(pTextLang);
- pRoot->appendChild(pChildLang);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1085", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::PersonIdRegisterAndLogin(string stringRole, string stringPId, string stringName, string stringSex, string stringBirthday, string stringAddress, string stringDeviceId, string stringMd5,
- string stringLang, string stringRegFrom)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildDeviceId = pDoc->createElement("deviceid");
- AutoPtr<Element> pChildRegFrom = pDoc->createElement("regfrom");
- AutoPtr<Element> pChildPId = pDoc->createElement("pid");
- AutoPtr<Element> pChildName = pDoc->createElement("name");
- AutoPtr<Element> pChildSex = pDoc->createElement("sex");
- AutoPtr<Element> pChildBirthday = pDoc->createElement("birthday");
- AutoPtr<Element> pChildAddress = pDoc->createElement("address");
- AutoPtr<Element> pChildLang = pDoc->createElement("lang");
- AutoPtr<Element> pChildRole = pDoc->createElement("role");
- AutoPtr<Element> pChildMd5 = pDoc->createElement("md5");
- AutoPtr<Text> pTextDeviceId = pDoc->createTextNode(stringDeviceId);
- AutoPtr<Text> pTextRegFrom = pDoc->createTextNode(stringRegFrom);
- AutoPtr<Text> pTextPId = pDoc->createTextNode(stringPId);
- AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
- AutoPtr<Text> pTextSex = pDoc->createTextNode(stringSex);
- AutoPtr<Text> pTextBirthday = pDoc->createTextNode(stringBirthday);
- AutoPtr<Text> pTextAddress = pDoc->createTextNode(stringAddress);
- AutoPtr<Text> pTextLang = pDoc->createTextNode(stringLang);
- AutoPtr<Text> pTextRole = pDoc->createTextNode(stringRole);
- AutoPtr<Text> pTextMd5 = pDoc->createTextNode(stringMd5);
- pChildDeviceId->appendChild(pTextDeviceId);
- pChildRegFrom->appendChild(pTextRegFrom);
- pChildPId->appendChild(pTextPId);
- pChildName->appendChild(pTextName);
- pChildSex->appendChild(pTextSex);
- pChildBirthday->appendChild(pTextBirthday);
- pChildAddress->appendChild(pTextAddress);
- pChildLang->appendChild(pTextLang);
- pChildRole->appendChild(pTextRole);
- pChildMd5->appendChild(pTextMd5);
- pRoot->appendChild(pChildDeviceId);
- pRoot->appendChild(pChildRegFrom);
- pRoot->appendChild(pChildPId);
- pRoot->appendChild(pChildName);
- pRoot->appendChild(pChildSex);
- pRoot->appendChild(pChildBirthday);
- pRoot->appendChild(pChildAddress);
- pRoot->appendChild(pChildLang);
- pRoot->appendChild(pChildRole);
- pRoot->appendChild(pChildMd5);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- CPhmsRequestHead phmsRequestHead("10", "1086", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- // phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- m_enumPhmsCommandType = LOGIN_TYPE;//目前只有登录命令是LOGIN_TYPE,改变个人信息命令是CHANGE_INFO_TYPE,用户注册命令是REGISTER_TYPE
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- m_enumPhmsCommandType = MAIN_TYPE;//其余命令都是MAIN_TYPE
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequest::SetUsername(stringPId);
- CPhmsRequest::SetPassword("");
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- //只有登录(1002)和注册并登录(1086)命令才需要,解析返回的xml,得到sessionid
- nRet = this->GetSessionId(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CSessionIdManager::HandleSessionSync(m_stringSessionId);
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::CardBindPhone(string stringPhone, string stringScode)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildPhone = pDoc->createElement("phone");
- AutoPtr<Element> pChildScode = pDoc->createElement("scode");
- AutoPtr<Text> pTextPhone = pDoc->createTextNode(stringPhone);
- AutoPtr<Text> pTextSCode = pDoc->createTextNode(stringScode);
- pChildPhone->appendChild(pTextPhone);
- pChildScode->appendChild(pTextSCode);
- pRoot->appendChild(pChildPhone);
- pRoot->appendChild(pChildScode);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1088", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ResetPassword(string stringPhone, string stringScode, string stringNewPwd)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildPhone = pDoc->createElement("phone");
- AutoPtr<Element> pChildScode = pDoc->createElement("scode");
- AutoPtr<Element> pChildNewPwd = pDoc->createElement("newpwd");
- AutoPtr<Text> pTextPhone = pDoc->createTextNode(stringPhone);
- AutoPtr<Text> pTextSCode = pDoc->createTextNode(stringScode);
- AutoPtr<Text> pTextNewPwd = pDoc->createTextNode(stringNewPwd);
- pChildPhone->appendChild(pTextPhone);
- pChildScode->appendChild(pTextSCode);
- pChildNewPwd->appendChild(pTextNewPwd);
- pRoot->appendChild(pChildPhone);
- pRoot->appendChild(pChildScode);
- pRoot->appendChild(pChildNewPwd);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- CPhmsRequestHead phmsRequestHead("10", "1089", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- //phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UploadDaily(string stringType, string stringCreateTime, string stringFiles)
- {
- int nRet = PHMS_SUCCESSFUL_RESULT;
- //首先生成子xml文件,并获得内容
- // string stringSubXmlContent;
- // AutoPtr<Document> pSubDoc = new Document;
- // //AutoPtr<ProcessingInstruction> pSubPi = pSubDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- // AutoPtr<Element> pSubRoot = pSubDoc->createElement("files");
- // AutoPtr<Element> pSubChildMood = pSubDoc->createElement("feeling");
- // AutoPtr<Text> pSubTextMood = pSubDoc->createTextNode(stringMood);
- // pSubChildMood->appendChild(pSubTextMood);
- // pSubRoot->appendChild(pSubChildMood);
- // vector<string>::iterator iter;
- // for(iter=vFileLocalPath.begin(); iter!=vFileLocalPath.end(); iter++)
- // {
- // AutoPtr<Element> pSubChildFile = pSubDoc->createElement("file");
- // AutoPtr<Element> pSubGrandChildUri = pSubDoc->createElement("uri");
- // AutoPtr<Text> pSubTextUri = pSubDoc->createTextNode(*iter);
- // pSubGrandChildUri->appendChild(pSubTextUri);
- // pSubChildFile->appendChild(pSubGrandChildUri);
- // pSubRoot->appendChild(pSubChildFile);
- // }
- // //pSubDoc->appendChild(pSubPi);
- // pSubDoc->appendChild(pSubRoot);
- // nRet = this->GetRequestXmlNoBase64(pSubDoc, stringSubXmlContent, false);
- // if(nRet != PHMS_SUCCESSFUL_RESULT)
- // {
- // CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- // return nRet;
- // }
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Element> pChildCreateTime = pDoc->createElement("createtime");
- AutoPtr<Element> pChildFiles = pDoc->createElement("files");
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- AutoPtr<Text> pTextCreateTime = pDoc->createTextNode(stringCreateTime);
- AutoPtr<Text> pTextFiles = pDoc->createTextNode(stringFiles);
- pChildType->appendChild(pTextType);
- pChildCreateTime->appendChild(pTextCreateTime);
- pChildFiles->appendChild(pTextFiles);
- pRoot->appendChild(pChildType);
- pRoot->appendChild(pChildCreateTime);
- pRoot->appendChild(pChildFiles);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
-
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "1090", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetDateListOfDaily(string stringYear, string stringMonth)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildYear = pDoc->createElement("year");
- AutoPtr<Element> pChildMonth = pDoc->createElement("month");
- AutoPtr<Text> pTextYear = pDoc->createTextNode(stringYear);
- AutoPtr<Text> pTextMonth = pDoc->createTextNode(stringMonth);
- pChildYear->appendChild(pTextYear);
- pChildMonth->appendChild(pTextMonth);
- pRoot->appendChild(pChildYear);
- pRoot->appendChild(pChildMonth);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "1091", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetDailyOfDate(string stringDate, string stringType)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildDate = pDoc->createElement("date");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Text> pTextDate = pDoc->createTextNode(stringDate);
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- pChildDate->appendChild(pTextDate);
- pChildType->appendChild(pTextType);
- pRoot->appendChild(pChildDate);
- pRoot->appendChild(pChildType);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "1092", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ShareDaily(string stringType, string stringCreateTime)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Element> pChildCreateTime = pDoc->createElement("createtime");
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- AutoPtr<Text> pTextCreateTime = pDoc->createTextNode(stringCreateTime);
- pChildType->appendChild(pTextType);
- pChildCreateTime->appendChild(pTextCreateTime);
- pRoot->appendChild(pChildType);
- pRoot->appendChild(pChildCreateTime);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "1093", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::DeleteDaily(string stringType, string stringDate)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Element> pChildDate = pDoc->createElement("day");
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- AutoPtr<Text> pTextDate = pDoc->createTextNode(stringDate);
- pChildType->appendChild(pTextType);
- pChildDate->appendChild(pTextDate);
- pRoot->appendChild(pChildType);
- pRoot->appendChild(pChildDate);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "1094", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::PhoneScanQR(string stringQRCode)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildQRCode = pDoc->createElement("qrcode");
- AutoPtr<Text> pTextQRCode = pDoc->createTextNode(stringQRCode);
- pChildQRCode->appendChild(pTextQRCode);
- pRoot->appendChild(pChildQRCode);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "1095", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::PhoneScanQRVerify(string stringQRCode)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildQRCode = pDoc->createElement("qrcode");
- AutoPtr<Text> pTextQRCode = pDoc->createTextNode(stringQRCode);
- pChildQRCode->appendChild(pTextQRCode);
- pRoot->appendChild(pChildQRCode);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "1096", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ApplyQRCode(string stringType, string stringScene)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Element> pChildData = pDoc->createElement("data");
- AutoPtr<Element> pGrandChildScene = pDoc->createElement("scene");
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- AutoPtr<Text> pTextScene = pDoc->createTextNode(stringScene);
- pChildType->appendChild(pTextType);
- pGrandChildScene->appendChild(pTextScene);
- pChildData->appendChild(pGrandChildScene);
- pRoot->appendChild(pChildType);
- pRoot->appendChild(pChildData);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "1097", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ValidateUserAccount(string stringLoginId, string stringPassword, string stringRole)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildRole = pDoc->createElement("role");
- AutoPtr<Element> pChildLoginId = pDoc->createElement("loginid");
- AutoPtr<Element> pChildPwd = pDoc->createElement("pwd");
- AutoPtr<Text> pTextRole = pDoc->createTextNode(stringRole);
- AutoPtr<Text> pTextLoginId = pDoc->createTextNode(stringLoginId);
- AutoPtr<Text> pTextPwd = pDoc->createTextNode(stringPassword);
- pChildRole->appendChild(pTextRole);
- pChildLoginId->appendChild(pTextLoginId);
- pChildPwd->appendChild(pTextPwd);
- pRoot->appendChild(pChildRole);
- pRoot->appendChild(pChildLoginId);
- pRoot->appendChild(pChildPwd);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "1099", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse, true);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::RegisterBluetoothDevice(string stringUniqueSN, string stringSerial, string stringBluetoothAddress, string stringBluetoothName, string stringDeviceType)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUniqueSN = pDoc->createElement("uniquesn");
- AutoPtr<Element> pChildSerial = pDoc->createElement("serial");
- AutoPtr<Element> pChildBluetoothAddress = pDoc->createElement("bluetoothaddress");
- AutoPtr<Element> pChildBluetoothName = pDoc->createElement("bluetoothname");
- AutoPtr<Element> pChildDeviceType = pDoc->createElement("devicetype");
- AutoPtr<Text> pTextUniqueSN = pDoc->createTextNode(stringUniqueSN);
- AutoPtr<Text> pTextSerial = pDoc->createTextNode(stringSerial);
- AutoPtr<Text> pTextBluetoothAddress = pDoc->createTextNode(stringBluetoothAddress);
- AutoPtr<Text> pTextBluetoothName = pDoc->createTextNode(stringBluetoothName);
- AutoPtr<Text> pTextDeviceType = pDoc->createTextNode(stringDeviceType);
- pChildUniqueSN->appendChild(pTextUniqueSN);
- pChildSerial->appendChild(pTextSerial);
- pChildBluetoothAddress->appendChild(pTextBluetoothAddress);
- pChildBluetoothName->appendChild(pTextBluetoothName);
- pChildDeviceType->appendChild(pTextDeviceType);
- pRoot->appendChild(pChildUniqueSN);
- pRoot->appendChild(pChildSerial);
- pRoot->appendChild(pChildBluetoothAddress);
- pRoot->appendChild(pChildBluetoothName);
- pRoot->appendChild(pChildDeviceType);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1100", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetBluetoothInfoOfDevice(string stringUniqueSN)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUniqueSN = pDoc->createElement("uniquesn");
- AutoPtr<Text> pTextUniqueSN = pDoc->createTextNode(stringUniqueSN);
- pChildUniqueSN->appendChild(pTextUniqueSN);
- pRoot->appendChild(pChildUniqueSN);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1101", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ChangeDeviceType(string stringUniqueSN, string stringDeviceType)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUniqueSN = pDoc->createElement("uniquesn");
- AutoPtr<Element> pChildDeviceType = pDoc->createElement("devicetype");
- AutoPtr<Text> pTextUniqueSN = pDoc->createTextNode(stringUniqueSN);
- AutoPtr<Text> pTextDeviceType = pDoc->createTextNode(stringDeviceType);
- pChildUniqueSN->appendChild(pTextUniqueSN);
- pChildDeviceType->appendChild(pTextDeviceType);
- pRoot->appendChild(pChildUniqueSN);
- pRoot->appendChild(pChildDeviceType);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1102", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UnregisterBluetoothDevice(string stringUniqueSN)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUniqueSN = pDoc->createElement("uniquesn");
- AutoPtr<Text> pTextUniqueSN = pDoc->createTextNode(stringUniqueSN);
- pChildUniqueSN->appendChild(pTextUniqueSN);
- pRoot->appendChild(pChildUniqueSN);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1103", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetHospitalListOfArea(string stringAreaId, string stringRank, string stringBeta)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildAreaId = pDoc->createElement("areaid");
- AutoPtr<Element> pChildRank = pDoc->createElement("rank");
- AutoPtr<Element> pChildBeta = pDoc->createElement("beta");
- AutoPtr<Text> pTextAreaId = pDoc->createTextNode(stringAreaId);
- AutoPtr<Text> pTextRank = pDoc->createTextNode(stringRank);
- AutoPtr<Text> pTextBeta = pDoc->createTextNode(stringBeta);
- pChildAreaId->appendChild(pTextAreaId);
- pChildRank->appendChild(pTextRank);
- pChildBeta->appendChild(pTextBeta);
- pRoot->appendChild(pChildAreaId);
- pRoot->appendChild(pChildRank);
- pRoot->appendChild(pChildBeta);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- CPhmsRequestHead phmsRequestHead("10", "1104", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- //phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UploadCommonFileSegment(string stringType, string stringExtra, string stringOrder, string stringTotalSize,
- string stringServerUri, string stringStart1, string stringEnd1, string stringMd51, string stringStart2, string stringEnd2, string stringMd52, string stringStart3, string stringEnd3, string stringMd53, string stringFilePath, string stringFileType)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Element> pChildExtra = pDoc->createElement("extra");
- AutoPtr<Element> pChildOrder = pDoc->createElement("order");
- AutoPtr<Element> pChildTotalSize = pDoc->createElement("totalsize");
- AutoPtr<Element> pChildServerUri = pDoc->createElement("serveruri");
- AutoPtr<Element> pChildPart1 = pDoc->createElement("md51");
- AutoPtr<Element> pGrandChildStart1= pDoc->createElement("start");
- AutoPtr<Element> pGrandChildEnd1 = pDoc->createElement("end");
- AutoPtr<Element> pGrandChildMd51 = pDoc->createElement("md5");
- AutoPtr<Element> pChildPart2 = pDoc->createElement("md52");
- AutoPtr<Element> pGrandChildStart2= pDoc->createElement("start");
- AutoPtr<Element> pGrandChildEnd2 = pDoc->createElement("end");
- AutoPtr<Element> pGrandChildMd52 = pDoc->createElement("md5");
- AutoPtr<Element> pChildPart3 = pDoc->createElement("md53");
- AutoPtr<Element> pGrandChildStart3= pDoc->createElement("start");
- AutoPtr<Element> pGrandChildEnd3 = pDoc->createElement("end");
- AutoPtr<Element> pGrandChildMd53 = pDoc->createElement("md5");
- AutoPtr<Element> pChildFileType = pDoc->createElement("filetype");
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- AutoPtr<Text> pTextExtra = pDoc->createTextNode(stringExtra);
- AutoPtr<Text> pTextOrder = pDoc->createTextNode(stringOrder);
- AutoPtr<Text> pTextTotalSize = pDoc->createTextNode(stringTotalSize);
- AutoPtr<Text> pTextServerUri = pDoc->createTextNode(stringServerUri);
- AutoPtr<Text> pTextStart1 = pDoc->createTextNode(stringStart1);
- AutoPtr<Text> pTextEnd1 = pDoc->createTextNode(stringEnd1);
- AutoPtr<Text> pTextMd51 = pDoc->createTextNode(stringMd51);
- AutoPtr<Text> pTextStart2 = pDoc->createTextNode(stringStart2);
- AutoPtr<Text> pTextEnd2 = pDoc->createTextNode(stringEnd2);
- AutoPtr<Text> pTextMd52 = pDoc->createTextNode(stringMd52);
- AutoPtr<Text> pTextStart3 = pDoc->createTextNode(stringStart3);
- AutoPtr<Text> pTextEnd3 = pDoc->createTextNode(stringEnd3);
- AutoPtr<Text> pTextMd53 = pDoc->createTextNode(stringMd53);
- AutoPtr<Text> pTextFileType = pDoc->createTextNode(stringFileType);
- pChildType->appendChild(pTextType);
- pChildExtra->appendChild(pTextExtra);
- pChildOrder->appendChild(pTextOrder);
- pChildTotalSize->appendChild(pTextTotalSize);
- pChildServerUri->appendChild(pTextServerUri);
- pGrandChildStart1->appendChild(pTextStart1);
- pGrandChildEnd1->appendChild(pTextEnd1);
- pGrandChildMd51->appendChild(pTextMd51);
- pGrandChildStart2->appendChild(pTextStart2);
- pGrandChildEnd2->appendChild(pTextEnd2);
- pGrandChildMd52->appendChild(pTextMd52);
- pGrandChildStart3->appendChild(pTextStart3);
- pGrandChildEnd3->appendChild(pTextEnd3);
- pGrandChildMd53->appendChild(pTextMd53);
- pChildPart1->appendChild(pGrandChildStart1);
- pChildPart1->appendChild(pGrandChildEnd1);
- pChildPart1->appendChild(pGrandChildMd51);
- pChildPart2->appendChild(pGrandChildStart2);
- pChildPart2->appendChild(pGrandChildEnd2);
- pChildPart2->appendChild(pGrandChildMd52);
- pChildPart3->appendChild(pGrandChildStart3);
- pChildPart3->appendChild(pGrandChildEnd3);
- pChildPart3->appendChild(pGrandChildMd53);
- pChildFileType->appendChild(pTextFileType);
- pRoot->appendChild(pChildType);
- pRoot->appendChild(pChildExtra);
- pRoot->appendChild(pChildOrder);
- pRoot->appendChild(pChildTotalSize);
- pRoot->appendChild(pChildServerUri);
- pRoot->appendChild(pChildPart1);
- pRoot->appendChild(pChildPart2);
- pRoot->appendChild(pChildPart3);
- pRoot->appendChild(pChildFileType);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1105", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, stringFilePath);
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::SearchSomebody(string stringUserId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUId = pDoc->createElement("uid");
- AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUserId);
- pChildUId->appendChild(pTextUId);
- pRoot->appendChild(pChildUId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1106", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::FollowSomebody(string stringUserId, string stringUsername, string stringNickname, string stringVCode)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUId = pDoc->createElement("uid");
- AutoPtr<Element> pChildUName = pDoc->createElement("uname");
- AutoPtr<Element> pChildNickname = pDoc->createElement("nickname");
- AutoPtr<Element> pChildVCode = pDoc->createElement("vcode");
- AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUserId);
- AutoPtr<Text> pTextUName = pDoc->createTextNode(stringUsername);
- AutoPtr<Text> pTextNickname = pDoc->createTextNode(stringNickname);
- AutoPtr<Text> pTextVCode = pDoc->createTextNode(stringVCode);
- pChildUId->appendChild(pTextUId);
- pChildUName->appendChild(pTextUName);
- pChildNickname->appendChild(pTextNickname);
- pChildVCode->appendChild(pTextVCode);
- pRoot->appendChild(pChildUId);
- pRoot->appendChild(pChildUName);
- pRoot->appendChild(pChildNickname);
- pRoot->appendChild(pChildVCode);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1107", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::MyFollowing(string stringUserId, string stringNextId, string stringFType)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUId = pDoc->createElement("uid");
- AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
- AutoPtr<Element> pChildFType = pDoc->createElement("ftype");
- AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUserId);
- AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
- AutoPtr<Text> pTextFType = pDoc->createTextNode(stringFType);
- pChildUId->appendChild(pTextUId);
- pChildNextId->appendChild(pTextNextId);
- pChildFType->appendChild(pTextFType);
- pRoot->appendChild(pChildUId);
- pRoot->appendChild(pChildNextId);
- pRoot->appendChild(pChildFType);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1108", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::MyFans(string stringUserId, string stringNextId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUId = pDoc->createElement("uid");
- AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
- AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUserId);
- AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
- pChildUId->appendChild(pTextUId);
- pChildNextId->appendChild(pTextNextId);
- pRoot->appendChild(pChildUId);
- pRoot->appendChild(pChildNextId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1109", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ChangeNicknameOfFollowed(string stringUserId, string stringNickname)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUId = pDoc->createElement("uid");
- AutoPtr<Element> pChildNickname = pDoc->createElement("nickname");
- AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUserId);
- AutoPtr<Text> pTextNickname = pDoc->createTextNode(stringNickname);
- pChildUId->appendChild(pTextUId);
- pChildNickname->appendChild(pTextNickname);
- pRoot->appendChild(pChildUId);
- pRoot->appendChild(pChildNickname);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1110", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::CancelFollowing(string stringUserId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUId = pDoc->createElement("uid");
- AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUserId);
- pChildUId->appendChild(pTextUId);
- pRoot->appendChild(pChildUId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1111", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::PublishHealthyKnowledge(vector<HEALTHY_KNOWLEDGE> vHealthKnowledge)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- for(int i=0; i<vHealthKnowledge.size(); i++)
- {
- AutoPtr<Element> pChildMsg = pDoc->createElement("msg");
- AutoPtr<Element> pGrandChildTitle = pDoc->createElement("title");
- AutoPtr<Element> pGrandChildDescription = pDoc->createElement("description");
- AutoPtr<Element> pGrandChildUrl = pDoc->createElement("url");
- AutoPtr<Element> pGrandChildPicUrl = pDoc->createElement("picurl");
- AutoPtr<Text> pTextTitle = pDoc->createTextNode(vHealthKnowledge[i].title);
- AutoPtr<Text> pTextDescription = pDoc->createTextNode(vHealthKnowledge[i].description);
- AutoPtr<Text> pTextUrl = pDoc->createTextNode(vHealthKnowledge[i].url);
- AutoPtr<Text> pTextPicUrl = pDoc->createTextNode(vHealthKnowledge[i].picurl);
- pGrandChildTitle->appendChild(pTextTitle);
- pGrandChildDescription->appendChild(pTextDescription);
- pGrandChildUrl->appendChild(pTextUrl);
- pGrandChildPicUrl->appendChild(pTextPicUrl);
- pChildMsg->appendChild(pGrandChildTitle);
- pChildMsg->appendChild(pGrandChildDescription);
- pChildMsg->appendChild(pGrandChildUrl);
- pChildMsg->appendChild(pGrandChildPicUrl);
- pRoot->appendChild(pChildMsg);
- }
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1112", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetListOfHealthyKnowledge(string stringSenderId, string stringNextId, string stringIds, string stringPageSize, string stringOrderBy)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
- AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
- AutoPtr<Element> pChildIds = pDoc->createElement("ids");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
- AutoPtr<Element> pChildOrderBy = pDoc->createElement("orderby");
- AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
- AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
- AutoPtr<Text> pTextIds = pDoc->createTextNode(stringIds);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- AutoPtr<Text> pTextOrderBy = pDoc->createTextNode(stringOrderBy);
- pChildSenderId->appendChild(pTextSenderId);
- pChildNextId->appendChild(pTextNextId);
- pChildIds->appendChild(pTextIds);
- pChildPageSize->appendChild(pTextPageSize);
- pChildOrderBy->appendChild(pTextOrderBy);
- pRoot->appendChild(pChildSenderId);
- pRoot->appendChild(pChildNextId);
- pRoot->appendChild(pChildIds);
- pRoot->appendChild(pChildPageSize);
- pRoot->appendChild(pChildOrderBy);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1113", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GenerateOrDeletePngZlibReport(string stringServerPath, string stringFlag)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildReportPath = pDoc->createElement("reportpath");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Text> pTextReportPath = pDoc->createTextNode(stringServerPath);
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringFlag);
- pChildReportPath->appendChild(pTextReportPath);
- pChildType->appendChild(pTextType);
- pRoot->appendChild(pChildReportPath);
- pRoot->appendChild(pChildType);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", /*"1114"*/"", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetDailyList(string stringType, string stringStartDate, string stringEndDate, string stringOrderBy, string stringNextId, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Element> pChildStartDate = pDoc->createElement("startdate");
- AutoPtr<Element> pChildEndDate = pDoc->createElement("enddate");
- AutoPtr<Element> pChildOrderBy = pDoc->createElement("orderby");
- AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- AutoPtr<Text> pTextStartDate = pDoc->createTextNode(stringStartDate);
- AutoPtr<Text> pTextEndDate = pDoc->createTextNode(stringEndDate);
- AutoPtr<Text> pTextOrderBy = pDoc->createTextNode(stringOrderBy);
- AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildType->appendChild(pTextType);
- pChildStartDate->appendChild(pTextStartDate);
- pChildEndDate->appendChild(pTextEndDate);
- pChildOrderBy->appendChild(pTextOrderBy);
- pChildNextId->appendChild(pTextNextId);
- pChildPageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildType);
- pRoot->appendChild(pChildStartDate);
- pRoot->appendChild(pChildEndDate);
- pRoot->appendChild(pChildOrderBy);
- pRoot->appendChild(pChildNextId);
- pRoot->appendChild(pChildPageSize);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1114", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetCardUserReportList(string stringReportId, string stringReportStartDate, string stringReportEndDate, string stringCaseType, string stringState, string stringOrderBy,
- string stringThirdIdType, string stringThirdId, string stringNextId, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
- AutoPtr<Element> pChildReportStartDate = pDoc->createElement("reportstartdate");
- AutoPtr<Element> pChildReportEndDate = pDoc->createElement("reportenddate");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Element> pChildState = pDoc->createElement("state");
- AutoPtr<Element> pChildOrderBy = pDoc->createElement("orderby");
- AutoPtr<Element> pChildThirdIdType = pDoc->createElement("thirdidtype");
- AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
- AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
- AutoPtr<Text> pTextReportStartDate = pDoc->createTextNode(stringReportStartDate);
- AutoPtr<Text> pTextReportEndDate = pDoc->createTextNode(stringReportEndDate);
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- AutoPtr<Text> pTextState = pDoc->createTextNode(stringState);
- AutoPtr<Text> pTextOrderBy = pDoc->createTextNode(stringOrderBy);
- AutoPtr<Text> pTextThirdIdType = pDoc->createTextNode(stringThirdIdType);
- AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
- AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildReportId->appendChild(pTextReportId);
- pChildReportStartDate->appendChild(pTextReportStartDate);
- pChildReportEndDate->appendChild(pTextReportEndDate);
- pChildCaseType->appendChild(pTextCaseType);
- pChildState->appendChild(pTextState);
- pChildOrderBy->appendChild(pTextOrderBy);
- pChildThirdIdType->appendChild(pTextThirdIdType);
- pChildThirdId->appendChild(pTextThirdId);
- pChildNextId->appendChild(pTextNextId);
- pChildPageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildReportId);
- pRoot->appendChild(pChildReportStartDate);
- pRoot->appendChild(pChildReportEndDate);
- pRoot->appendChild(pChildCaseType);
- pRoot->appendChild(pChildState);
- pRoot->appendChild(pChildOrderBy);
- pRoot->appendChild(pChildThirdIdType);
- pRoot->appendChild(pChildThirdId);
- pRoot->appendChild(pChildNextId);
- pRoot->appendChild(pChildPageSize);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1115", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ChangeViewLikeCollectCount(string stringHealthTipId, string stringUri, string stringTitle, string stringLike, string stringRead, string stringCollect)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildHealthTipId = pDoc->createElement("healthtip_id");
- AutoPtr<Element> pChildUri = pDoc->createElement("uri");
- AutoPtr<Element> pChildTitle = pDoc->createElement("title");
- AutoPtr<Element> pChildLike = pDoc->createElement("like");
- AutoPtr<Element> pChildRead = pDoc->createElement("read");
- AutoPtr<Element> pChildCollect = pDoc->createElement("collect");
- AutoPtr<Text> pTextHealthTipId = pDoc->createTextNode(stringHealthTipId);
- AutoPtr<Text> pTextUri = pDoc->createTextNode(stringUri);
- AutoPtr<Text> pTextTitle = pDoc->createTextNode(stringTitle);
- AutoPtr<Text> pTextLike = pDoc->createTextNode(stringLike);
- AutoPtr<Text> pTextRead = pDoc->createTextNode(stringRead);
- AutoPtr<Text> pTextCollect = pDoc->createTextNode(stringCollect);
- pChildHealthTipId->appendChild(pTextHealthTipId);
- pChildUri->appendChild(pTextUri);
- pChildTitle->appendChild(pTextTitle);
- pChildLike->appendChild(pTextLike);
- pChildRead->appendChild(pTextRead);
- pChildCollect->appendChild(pTextCollect);
- pRoot->appendChild(pChildHealthTipId);
- pRoot->appendChild(pChildUri);
- pRoot->appendChild(pChildTitle);
- pRoot->appendChild(pChildLike);
- pRoot->appendChild(pChildRead);
- pRoot->appendChild(pChildCollect);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1116", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ChangeAdviceExecutiveState(string stringSgId, string stringState)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildSgId = pDoc->createElement("sgid");
- AutoPtr<Element> pChildState = pDoc->createElement("state");
- AutoPtr<Text> pTextSgId = pDoc->createTextNode(stringSgId);
- AutoPtr<Text> pTextState = pDoc->createTextNode(stringState);
- pChildSgId->appendChild(pTextSgId);
- pChildState->appendChild(pTextState);
- pRoot->appendChild(pChildSgId);
- pRoot->appendChild(pChildState);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1117", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetTrendRangeValue()
- {
- CPhmsRequestHead phmsRequestHead("10", "1118", m_stringSessionId, "10");
- CPhmsRequestBody phmsRequestBody("");
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetCliniqueReportList(string stringCliniqueSenderId, string stringStartDate,
- string stringEndDate, string stringState, string stringName, string stringPatientSourceCode, string stringYzlb, string stringPIdType, string stringPId, string stringHb, string stringASectionId, string stringNextId, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
- AutoPtr<Element> pChildStartDate = pDoc->createElement("startdate");
- AutoPtr<Element> pChildEndDate = pDoc->createElement("enddate");
- AutoPtr<Element> pChildState = pDoc->createElement("state");
- AutoPtr<Element> pChildName = pDoc->createElement("cname");
- AutoPtr<Element> pChildPatientSourceCode = pDoc->createElement("patientsourceid");
- AutoPtr<Element> pChildYzlb = pDoc->createElement("yzlb");
- AutoPtr<Element> pChildPIdType = pDoc->createElement("pidtype");
- AutoPtr<Element> pChildPId = pDoc->createElement("pid");
- AutoPtr<Element> pChildHb = pDoc->createElement("hb");
- AutoPtr<Element> pChildASectionId = pDoc->createElement("asectionid");
- AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringCliniqueSenderId);
- AutoPtr<Text> pTextStartDate = pDoc->createTextNode(stringStartDate);
- AutoPtr<Text> pTextEndDate = pDoc->createTextNode(stringEndDate);
- AutoPtr<Text> pTextState = pDoc->createTextNode(stringState);
- AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
- AutoPtr<Text> pTextPatientSourceCode = pDoc->createTextNode(stringPatientSourceCode);
- AutoPtr<Text> pTextYzlb = pDoc->createTextNode(stringYzlb);
- AutoPtr<Text> pTextPIdType = pDoc->createTextNode(stringPIdType);
- AutoPtr<Text> pTextPId = pDoc->createTextNode(stringPId);
- AutoPtr<Text> pTextHb = pDoc->createTextNode(stringHb);
- AutoPtr<Text> pTextASectionId = pDoc->createTextNode(stringASectionId);
- AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildSenderId->appendChild(pTextSenderId);
- pChildStartDate->appendChild(pTextStartDate);
- pChildEndDate->appendChild(pTextEndDate);
- pChildState->appendChild(pTextState);
- pChildName->appendChild(pTextName);
- pChildPatientSourceCode->appendChild(pTextPatientSourceCode);
- pChildYzlb->appendChild(pTextYzlb);
- pChildPIdType->appendChild(pTextPIdType);
- pChildPId->appendChild(pTextPId);
- pChildHb->appendChild(pTextHb);
- pChildASectionId->appendChild(pTextASectionId);
- pChildNextId->appendChild(pTextNextId);
- pChildPageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildSenderId);
- pRoot->appendChild(pChildStartDate);
- pRoot->appendChild(pChildEndDate);
- pRoot->appendChild(pChildState);
- pRoot->appendChild(pChildName);
- pRoot->appendChild(pChildPatientSourceCode);
- pRoot->appendChild(pChildYzlb);
- pRoot->appendChild(pChildPIdType);
- pRoot->appendChild(pChildPId);
- pRoot->appendChild(pChildHb);
- pRoot->appendChild(pChildASectionId);
- pRoot->appendChild(pChildNextId);
- pRoot->appendChild(pChildPageSize);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1119", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetUserListBindingOrNot(string stringNextId, string stringPageSize, string stringIsBind, string stringIsActive)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildIsBind = pDoc->createElement("isbind");
- AutoPtr<Element> pChildIsActive = pDoc->createElement("isactive");
- AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextIsBind = pDoc->createTextNode(stringIsBind);
- AutoPtr<Text> pTextIsActive = pDoc->createTextNode(stringIsActive);
- AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildIsBind->appendChild(pTextIsBind);
- pChildIsActive->appendChild(pTextIsActive);
- pChildNextId->appendChild(pTextNextId);
- pChildPageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildNextId);
- pRoot->appendChild(pChildPageSize);
- pRoot->appendChild(pChildIsBind);
- pRoot->appendChild(pChildIsActive);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1120", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::BindUser(string stringUId, string stringUName)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUId = pDoc->createElement("uid");
- AutoPtr<Element> pChildUName = pDoc->createElement("uname");
- AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
- AutoPtr<Text> pTextUName = pDoc->createTextNode(stringUName);
- pChildUId->appendChild(pTextUId);
- pChildUName->appendChild(pTextUName);
- pRoot->appendChild(pChildUId);
- pRoot->appendChild(pChildUName);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1121", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UnbindUser(string stringUId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUId = pDoc->createElement("uid");
- AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
- pChildUId->appendChild(pTextUId);
- pRoot->appendChild(pChildUId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1122", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetCardUserListOfCustomer(string stringThirdId, string stringName, string stringCaseType, string stringStartDate, string stringEndDate, string stringNextId, string stringPageSize)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
- AutoPtr<Element> pChildName = pDoc->createElement("name");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Element> pChildStartDate = pDoc->createElement("startdate");
- AutoPtr<Element> pChildEndDate = pDoc->createElement("enddate");
- AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
- AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
- AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
- AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- AutoPtr<Text> pTextStartDate = pDoc->createTextNode(stringStartDate);
- AutoPtr<Text> pTextEndDate = pDoc->createTextNode(stringEndDate);
- AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
- AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
- pChildThirdId->appendChild(pTextThirdId);
- pChildName->appendChild(pTextName);
- pChildCaseType->appendChild(pTextCaseType);
- pChildStartDate->appendChild(pTextStartDate);
- pChildEndDate->appendChild(pTextEndDate);
- pChildNextId->appendChild(pTextNextId);
- pChildPageSize->appendChild(pTextPageSize);
- pRoot->appendChild(pChildThirdId);
- pRoot->appendChild(pChildName);
- pRoot->appendChild(pChildCaseType);
- pRoot->appendChild(pChildStartDate);
- pRoot->appendChild(pChildEndDate);
- pRoot->appendChild(pChildNextId);
- pRoot->appendChild(pChildPageSize);
-
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1124", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::SearchCaseAdvanced(string stringHospitalId, string stringDiagnostic,
- string stringName, string stringSex, QUERY_RANGE rangeAge, QUERY_RANGE rangeCreateTime, string stringMode,
- string stringCaseType, QUERY_ECG ecg, string stringFrom, string stringSize)
- {
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- //构造json
- Json::Value jRoot;
- Json::FastWriter jWriter;
-
- jRoot["hospitalid"] = CUtil::EnvToUtf8(stringHospitalId);
- jRoot["diagnostic"] = CUtil::EnvToUtf8(stringDiagnostic);
- jRoot["name"] = CUtil::EnvToUtf8(stringName);
- jRoot["sex"] = CUtil::EnvToUtf8(stringSex);
- Json::Value jAge;
- jAge["gte"] = CUtil::EnvToUtf8(rangeAge.lowerLimit);
- jAge["lte"] = CUtil::EnvToUtf8(rangeAge.upperLimit);
- jRoot["age"] = jAge;
- Json::Value jCreateTime;
- jCreateTime["gte"] = CUtil::EnvToUtf8(rangeCreateTime.lowerLimit);
- jCreateTime["lte"] = CUtil::EnvToUtf8(rangeCreateTime.upperLimit);
- jRoot["createtime"] = jCreateTime;
- jRoot["mode"] = CUtil::EnvToUtf8(stringMode);
- Json::Value jCaseType;
- jCaseType["id"] = CUtil::EnvToUtf8(stringCaseType);
- Json::Value HR;
- HR["gte"] = CUtil::EnvToUtf8(ecg.hr.lowerLimit);
- HR["lte"] = CUtil::EnvToUtf8(ecg.hr.upperLimit);
- jCaseType["HR"] = HR;
- Json::Value PR_Int;
- PR_Int["gte"] = CUtil::EnvToUtf8(ecg.pr_int.lowerLimit);
- PR_Int["lte"] = CUtil::EnvToUtf8(ecg.pr_int.upperLimit);
- jCaseType["PR_Int"] = PR_Int;
- Json::Value QT_Int;
- QT_Int["gte"] = CUtil::EnvToUtf8(ecg.qt_int.lowerLimit);
- QT_Int["lte"] = CUtil::EnvToUtf8(ecg.qt_int.upperLimit);
- jCaseType["QT_Int"] = QT_Int;
- jCaseType["PR_Int"] = PR_Int;
- Json::Value QTc_Int;
- QTc_Int["gte"] = CUtil::EnvToUtf8(ecg.qtc_int.lowerLimit);
- QTc_Int["lte"] = CUtil::EnvToUtf8(ecg.qtc_int.upperLimit);
- jCaseType["QTc_Int"] = QTc_Int;
- Json::Value P_Dur;
- P_Dur["gte"] = CUtil::EnvToUtf8(ecg.p_dur.lowerLimit);
- P_Dur["lte"] = CUtil::EnvToUtf8(ecg.p_dur.upperLimit);
- jCaseType["P_Dur"] = P_Dur;
- Json::Value QRS_Dur;
- QRS_Dur["gte"] = CUtil::EnvToUtf8(ecg.qrs_dur.lowerLimit);
- QRS_Dur["lte"] = CUtil::EnvToUtf8(ecg.qrs_dur.upperLimit);
- jCaseType["QRS_Dur"] = QRS_Dur;
- Json::Value P_Axis;
- P_Axis["gte"] = CUtil::EnvToUtf8(ecg.p_axis.lowerLimit);
- P_Axis["lte"] = CUtil::EnvToUtf8(ecg.p_axis.upperLimit);
- jCaseType["P_Axis"] = P_Axis;
- Json::Value QRS_Axis;
- QRS_Axis["gte"] = CUtil::EnvToUtf8(ecg.qrs_axis.lowerLimit);
- QRS_Axis["lte"] = CUtil::EnvToUtf8(ecg.qrs_axis.upperLimit);
- jCaseType["QRS_Axis"] = QRS_Axis;
- Json::Value T_Axis;
- T_Axis["gte"] = CUtil::EnvToUtf8(ecg.t_axis.lowerLimit);
- T_Axis["lte"] = CUtil::EnvToUtf8(ecg.t_axis.upperLimit);
- jCaseType["T_Axis"] = T_Axis;
- Json::Value RV5;
- RV5["gte"] = CUtil::EnvToUtf8(ecg.rv5.lowerLimit);
- RV5["lte"] = CUtil::EnvToUtf8(ecg.rv5.upperLimit);
- jCaseType["RV5"] = RV5;
- Json::Value SV1;
- SV1["gte"] = CUtil::EnvToUtf8(ecg.sv1.lowerLimit);
- SV1["lte"] = CUtil::EnvToUtf8(ecg.sv1.upperLimit);
- jCaseType["SV1"] = SV1;
- jRoot["casetype"] = jCaseType;
- jRoot["from"] = CUtil::EnvToUtf8(stringFrom);
- jRoot["size"] = CUtil::EnvToUtf8(stringSize);
- stringXmlContent = jWriter.write(jRoot);
- CPhmsLogger::GetPhmsLogger()->WriteLog(stringXmlContent, __FUNCTION__, __FILE__, __LINE__);
- std::ostringstream oStringStream;
- Base64Encoder encoderBase64(oStringStream);
- encoderBase64.rdbuf()->setLineLength(0);
- istringstream istr(stringXmlContent);
- StreamCopier::copyStream(istr, encoderBase64);
- encoderBase64.close();
- stringXmlContent = oStringStream.str();
- CPhmsLogger::GetPhmsLogger()->WriteLog(stringXmlContent, __FUNCTION__, __FILE__, __LINE__);
-
- CPhmsRequestHead phmsRequestHead("10", "1123", m_stringSessionId, "13");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::SearchCaseAdvancedString(string stringHospitalId, string stringDiagnostic,
- string stringName, string stringSex, string stringJsonAge, string stringJsonCreateTime, string stringMode,
- string stringCaseType, string stringJsonEcg, string stringFrom, string stringSize)
- {
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- //构造json
- Json::Value jRoot;
- Json::FastWriter jWriter;
- Json::Reader jReader;
- try
- {
- jRoot["hospitalid"] = CUtil::EnvToUtf8(stringHospitalId);
- jRoot["diagnostic"] = CUtil::EnvToUtf8(stringDiagnostic);
- jRoot["name"] = CUtil::EnvToUtf8(stringName);
- jRoot["sex"] = CUtil::EnvToUtf8(stringSex);
- Json::Value jAge;
- // jAge["gte"] = CUtil::EnvToUtf8(rangeAge.lowerLimit);
- // jAge["lte"] = CUtil::EnvToUtf8(rangeAge.upperLimit);
- // jRoot["age"] = jAge;
- jReader.parse(stringJsonAge, jAge);
- Json::Value::Members arrayMemberAge = jAge.getMemberNames();
- for(Json::Value::Members::iterator iter = arrayMemberAge.begin(); iter != arrayMemberAge.end(); ++iter) //遍历json成员
- {
- jRoot[*iter] = jAge[*iter];
- }
- // jRoot.append(jAge);
- Json::Value jCreateTime;
- // jCreateTime["gte"] = CUtil::EnvToUtf8(rangeCreateTime.lowerLimit);
- // jCreateTime["lte"] = CUtil::EnvToUtf8(rangeCreateTime.upperLimit);
- // jRoot["createtime"] = jCreateTime;
- jReader.parse(stringJsonCreateTime, jCreateTime);
- Json::Value::Members arrayMemberCreateTime = jCreateTime.getMemberNames();
- for(Json::Value::Members::iterator iter = arrayMemberCreateTime.begin(); iter != arrayMemberCreateTime.end(); ++iter) //遍历json成员
- {
- jRoot[*iter] = jCreateTime[*iter];
- }
- // jRoot.append(jCreateTime);
- jRoot["mode"] = CUtil::EnvToUtf8(stringMode);
- Json::Value jCaseType;
- jCaseType["id"] = CUtil::EnvToUtf8(stringCaseType);
- // Json::Value HR;
- // HR["gte"] = CUtil::EnvToUtf8(ecg.hr.lowerLimit);
- // HR["lte"] = CUtil::EnvToUtf8(ecg.hr.upperLimit);
- // jCaseType["HR"] = HR;
- // Json::Value PR_Int;
- // PR_Int["gte"] = CUtil::EnvToUtf8(ecg.pr_int.lowerLimit);
- // PR_Int["lte"] = CUtil::EnvToUtf8(ecg.pr_int.upperLimit);
- // jCaseType["PR_Int"] = PR_Int;
- // Json::Value QT_Int;
- // QT_Int["gte"] = CUtil::EnvToUtf8(ecg.qt_int.lowerLimit);
- // QT_Int["lte"] = CUtil::EnvToUtf8(ecg.qt_int.upperLimit);
- // jCaseType["QT_Int"] = QT_Int;
- // jCaseType["PR_Int"] = PR_Int;
- // Json::Value QTc_Int;
- // QTc_Int["gte"] = CUtil::EnvToUtf8(ecg.qtc_int.lowerLimit);
- // QTc_Int["lte"] = CUtil::EnvToUtf8(ecg.qtc_int.upperLimit);
- // jCaseType["QTc_Int"] = QTc_Int;
- // Json::Value P_Dur;
- // P_Dur["gte"] = CUtil::EnvToUtf8(ecg.p_dur.lowerLimit);
- // P_Dur["lte"] = CUtil::EnvToUtf8(ecg.p_dur.upperLimit);
- // jCaseType["P_Dur"] = P_Dur;
- // Json::Value QRS_Dur;
- // QRS_Dur["gte"] = CUtil::EnvToUtf8(ecg.qrs_dur.lowerLimit);
- // QRS_Dur["lte"] = CUtil::EnvToUtf8(ecg.qrs_dur.upperLimit);
- // jCaseType["QRS_Dur"] = QRS_Dur;
- // Json::Value P_Axis;
- // P_Axis["gte"] = CUtil::EnvToUtf8(ecg.p_axis.lowerLimit);
- // P_Axis["lte"] = CUtil::EnvToUtf8(ecg.p_axis.upperLimit);
- // jCaseType["P_Axis"] = P_Axis;
- // Json::Value QRS_Axis;
- // QRS_Axis["gte"] = CUtil::EnvToUtf8(ecg.qrs_axis.lowerLimit);
- // QRS_Axis["lte"] = CUtil::EnvToUtf8(ecg.qrs_axis.upperLimit);
- // jCaseType["QRS_Axis"] = QRS_Axis;
- // Json::Value T_Axis;
- // T_Axis["gte"] = CUtil::EnvToUtf8(ecg.t_axis.lowerLimit);
- // T_Axis["lte"] = CUtil::EnvToUtf8(ecg.t_axis.upperLimit);
- // jCaseType["T_Axis"] = T_Axis;
- // Json::Value RV5;
- // RV5["gte"] = CUtil::EnvToUtf8(ecg.rv5.lowerLimit);
- // RV5["lte"] = CUtil::EnvToUtf8(ecg.rv5.upperLimit);
- // jCaseType["RV5"] = RV5;
- // Json::Value SV1;
- // SV1["gte"] = CUtil::EnvToUtf8(ecg.sv1.lowerLimit);
- // SV1["lte"] = CUtil::EnvToUtf8(ecg.sv1.upperLimit);
- // jCaseType["SV1"] = SV1;
- Json::Value jEcg;
- jReader.parse(stringJsonEcg, jEcg);
- Json::Value::Members arrayMemberECG = jEcg.getMemberNames();
- for(Json::Value::Members::iterator iter = arrayMemberECG.begin(); iter != arrayMemberECG.end(); ++iter) //遍历json成员
- {
- jCaseType[*iter] = jEcg[*iter];
- }
- // jCaseType.append(jEcg);
- jRoot["casetype"] = jCaseType;
- jRoot["from"] = CUtil::EnvToUtf8(stringFrom);
- jRoot["size"] = CUtil::EnvToUtf8(stringSize);
- stringXmlContent = jWriter.write(jRoot);
- CPhmsLogger::GetPhmsLogger()->WriteLog(stringXmlContent, __FUNCTION__, __FILE__, __LINE__);
- }
- catch(...)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog("Json Handle Exception", __FUNCTION__, __FILE__, __LINE__);
- }
- std::ostringstream oStringStream;
- Base64Encoder encoderBase64(oStringStream);
- encoderBase64.rdbuf()->setLineLength(0);
- istringstream istr(stringXmlContent);
- StreamCopier::copyStream(istr, encoderBase64);
- encoderBase64.close();
- stringXmlContent = oStringStream.str();
- CPhmsLogger::GetPhmsLogger()->WriteLog(stringXmlContent, __FUNCTION__, __FILE__, __LINE__);
- CPhmsRequestHead phmsRequestHead("10", "1123", m_stringSessionId, "13");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetPayCode(string stringType, string stringCaseId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- pChildType->appendChild(pTextType);
- pChildCaseId->appendChild(pTextCaseId);
- pRoot->appendChild(pChildType);
- pRoot->appendChild(pChildCaseId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1125", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetOrderInfo(string stringType, string stringCaseId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- pChildType->appendChild(pTextType);
- pChildCaseId->appendChild(pTextCaseId);
- pRoot->appendChild(pChildType);
- pRoot->appendChild(pChildCaseId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1126", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::SignDoctor(string stringUId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUId = pDoc->createElement("uid");
- AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
- pChildUId->appendChild(pTextUId);
- pRoot->appendChild(pChildUId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1127", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::RefundFee(string stringType, string stringCaseId, string stringRefundFee)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildType = pDoc->createElement("type");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildRefundFee = pDoc->createElement("refund_fee");
- AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextRefundFee = pDoc->createTextNode(stringRefundFee);
- pChildType->appendChild(pTextType);
- pChildCaseId->appendChild(pTextCaseId);
- pChildRefundFee->appendChild(pTextRefundFee);
- pRoot->appendChild(pChildType);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildRefundFee);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1128", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::HoldPlaceReview(string stringReportId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
- AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
- pChildReportId->appendChild(pTextReportId);
- pRoot->appendChild(pChildReportId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1129", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::RollBackReview(string stringReportId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
- AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
- pChildReportId->appendChild(pTextReportId);
- pRoot->appendChild(pChildReportId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1130", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ResetReviewHoldPlace(string stringReportId, string stringOccupantId, string stringOccupantName, string stringSuperKey)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
- AutoPtr<Element> pChildOccupantId = pDoc->createElement("occupant_id");
- AutoPtr<Element> pChildOccupantName = pDoc->createElement("occupant_name");
- AutoPtr<Element> pChildSuperKey = pDoc->createElement("super_key");
- AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
- AutoPtr<Text> pTextOccupantId = pDoc->createTextNode(stringOccupantId);
- AutoPtr<Text> pTextOccupantName = pDoc->createTextNode(stringOccupantName);
- AutoPtr<Text> pTextSuperKey = pDoc->createTextNode(stringSuperKey);
- pChildReportId->appendChild(pTextReportId);
- pChildOccupantId->appendChild(pTextOccupantId);
- pChildOccupantName->appendChild(pTextOccupantName);
- pChildSuperKey->appendChild(pTextSuperKey);
- pRoot->appendChild(pChildReportId);
- pRoot->appendChild(pChildOccupantId);
- pRoot->appendChild(pChildOccupantName);
- pRoot->appendChild(pChildSuperKey);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1131", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ResetCaseHoldPlace(string stringCaseId, string stringReceiverId, string stringOccupantId, string stringOccupantName, string stringSuperKey)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
- AutoPtr<Element> pChildOccupantId = pDoc->createElement("occupant_id");
- AutoPtr<Element> pChildOccupantName = pDoc->createElement("occupant_name");
- AutoPtr<Element> pChildSuperKey = pDoc->createElement("super_key");
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
- AutoPtr<Text> pTextOccupantId = pDoc->createTextNode(stringOccupantId);
- AutoPtr<Text> pTextOccupantName = pDoc->createTextNode(stringOccupantName);
- AutoPtr<Text> pTextSuperKey = pDoc->createTextNode(stringSuperKey);
- pChildCaseId->appendChild(pTextCaseId);
- pChildReceiverId->appendChild(pTextReceiverId);
- pChildOccupantId->appendChild(pTextOccupantId);
- pChildOccupantName->appendChild(pTextOccupantName);
- pChildSuperKey->appendChild(pTextSuperKey);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildReceiverId);
- pRoot->appendChild(pChildOccupantId);
- pRoot->appendChild(pChildOccupantName);
- pRoot->appendChild(pChildSuperKey);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1132", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::AddTag(string stringTagName, string stringTagDescription)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildTagName = pDoc->createElement("favoritename");
- AutoPtr<Element> pChildDescription = pDoc->createElement("description");
- AutoPtr<Text> pTextTagName = pDoc->createTextNode(stringTagName);
- AutoPtr<Text> pTextDescription = pDoc->createTextNode(stringTagDescription);
- pChildTagName->appendChild(pTextTagName);
- pChildDescription->appendChild(pTextDescription);
- pRoot->appendChild(pChildTagName);
- pRoot->appendChild(pChildDescription);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1133", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetTagList(string stringSenderId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
- AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
- pChildSenderId->appendChild(pTextSenderId);
- pRoot->appendChild(pChildSenderId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1134", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::AddCaseToTag(string stringTagId, string stringTagName, string stringCaseId, string stringCaseType, string stringCaseTypeName, string stringPatientName)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildTagId = pDoc->createElement("favoritetid");
- AutoPtr<Element> pChildTagName = pDoc->createElement("favoritetname");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Element> pChildCaseTypeName = pDoc->createElement("casetypename");
- AutoPtr<Element> pChildPatientName = pDoc->createElement("patientname");
- AutoPtr<Text> pTextTagId = pDoc->createTextNode(stringTagId);
- AutoPtr<Text> pTextTagName = pDoc->createTextNode(stringTagName);
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- AutoPtr<Text> pTextCaseTypeName = pDoc->createTextNode(stringCaseTypeName);
- AutoPtr<Text> pTextPatientName = pDoc->createTextNode(stringPatientName);
- pChildTagId->appendChild(pTextTagId);
- pChildTagName->appendChild(pTextTagName);
- pChildCaseId->appendChild(pTextCaseId);
- pChildCaseType->appendChild(pTextCaseType);
- pChildCaseTypeName->appendChild(pTextCaseTypeName);
- pChildPatientName->appendChild(pTextPatientName);
- pRoot->appendChild(pChildTagId);
- pRoot->appendChild(pChildTagName);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildCaseType);
- pRoot->appendChild(pChildCaseTypeName);
- pRoot->appendChild(pChildPatientName);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1135", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetCaseListOfTag(string stringTagId, string stringSenderId, string stringCaseType)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildTagId = pDoc->createElement("tagid");
- AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
- AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
- AutoPtr<Text> pTextTagId = pDoc->createTextNode(stringTagId);
- AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
- AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
- pChildTagId->appendChild(pTextTagId);
- pChildSenderId->appendChild(pTextSenderId);
- pChildCaseType->appendChild(pTextCaseType);
- pRoot->appendChild(pChildTagId);
- pRoot->appendChild(pChildSenderId);
- pRoot->appendChild(pChildCaseType);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- CPhmsRequestHead phmsRequestHead("10", "1136", m_stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- phmsRequest.GenerateAndSetSign();
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- // int CPhmsSession::CreateSession_GuanXin(string stringUsername, string stringPassword)
- // {
- // map<string, string> mapParam;
- // mapParam["username"] = stringUsername;
- // mapParam["password"] = stringPassword;
- // int nRet = PHMS_SUCCESSFUL_RESULT;
- // this->SetGuanXinCommandType(SESSION);
- // nRet = ExecuteGuanXinSession(mapParam);
- // if(nRet != PHMS_SUCCESSFUL_RESULT)
- // {
- // //写日志
- // CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- // return nRet;
- // }
- // return PHMS_SUCCESSFUL_RESULT;
- // }
- int CPhmsSession::GetAccessToken_GuanXin(string stringUsername, string stringPassword)
- {
- map<string, string> mapParam;
- //mapParam["grant_type"]="password";
- mapParam["username"] = stringUsername;
- mapParam["password"] = stringPassword;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- this->SetGuanXinCommandType(ACCESSTOKEN);
- this->SetNetConfigType(GUANXIN_FORM);
- nRet = ExecuteGuanXinSession(mapParam, "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetPersonInfo_GuanXin(string stringAccessToken, string stringPersonName, string stringPersonGender, string stringPersonIdentity, string stringPersonBirthDate)
- {
- // string stringJsonContent;
- // Json::Value root;
- // root["accessToken"] = stringAccessToken;
- // root["personName"] = stringPersonName;
- // root["personGender"] = stringPersonGender;
- // root["personIdentity"] = stringPersonIdentity;
- // root["personBirthDate"] = stringPersonBirthDate;
- // stringJsonContent = root.toStyledString();
- map<string, string> mapParam;
- // mapParam["personInfo"]=stringJsonContent;
- mapParam["accessToken"] = stringAccessToken;
- mapParam["personName"] = stringPersonName;
- mapParam["personGender"] = stringPersonGender;
- mapParam["personIdentity"] = stringPersonIdentity;
- mapParam["personBirthDate"] = stringPersonBirthDate;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- this->SetGuanXinCommandType(PERSONINFO);
- this->SetNetConfigType(GUANXIN_FORM);
- nRet = ExecuteGuanXinSession(mapParam, "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UploadECGData_GuanXin(string stringECGXmlPath, string stringECGDataPath)
- {
- map<string, string> mapParam;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- if(stringECGDataPath.size()==0 || CUtil::GetFileSize(stringECGDataPath)==0)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_OPEN_FAIL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_FILE_OPEN_FAIL;
- }
- ifstream iFStream;
- ostringstream oStringStream;
- iFStream.open(stringECGXmlPath.c_str());
- StreamCopier::copyStream(iFStream, oStringStream);
- iFStream.close();
- string stringXmlContent = oStringStream.str();
- nRet = CUtil::GetMapFromRequestXml(stringXmlContent, "root", mapParam);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetGuanXinCommandType(UPLOADECG);
- this->SetNetConfigType(GUANXIN_FORM);
- nRet = ExecuteGuanXinSession(mapParam, stringECGDataPath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UploadOtherData_GuanXin(string stringOtherXmlPath)
- {
- map<string, string> mapParam;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- if(stringOtherXmlPath.size()==0 || CUtil::GetFileSize(stringOtherXmlPath)==0)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_OPEN_FAIL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_FILE_OPEN_FAIL;
- }
- ifstream iFStream;
- ostringstream oStringStream;
- iFStream.open(stringOtherXmlPath.c_str());
- StreamCopier::copyStream(iFStream, oStringStream);
- iFStream.close();
- string stringXmlContent = oStringStream.str();
- nRet = CUtil::GetMapFromRequestXml(stringXmlContent, "root", mapParam);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetGuanXinCommandType(UPLOADNONECG);
- this->SetNetConfigType(GUANXIN_FORM);
- nRet = ExecuteGuanXinSession(mapParam, "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UploadCheckData_GuanXin(string stringCheckXmlPath)
- {
- map<string, string> mapParam;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- if(stringCheckXmlPath.size()==0 || CUtil::GetFileSize(stringCheckXmlPath)==0)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_OPEN_FAIL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_FILE_OPEN_FAIL;
- }
- ifstream iFStream;
- ostringstream oStringStream;
- iFStream.open(stringCheckXmlPath.c_str());
- StreamCopier::copyStream(iFStream, oStringStream);
- iFStream.close();
- string stringXmlContent = oStringStream.str();
- nRet = CUtil::GetMapFromRequestXml(stringXmlContent, "root", mapParam);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetGuanXinCommandType(UPLOADMONITOR);
- this->SetNetConfigType(GUANXIN_FORM);
- nRet = ExecuteGuanXinSession(mapParam, "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UploadPersonInfo_GuanXin(string stringPersonInfoXmlPath)
- {
- map<string, string> mapParam;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- if(stringPersonInfoXmlPath.size()==0 || CUtil::GetFileSize(stringPersonInfoXmlPath)==0)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_OPEN_FAIL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_FILE_OPEN_FAIL;
- }
- ifstream iFStream;
- ostringstream oStringStream;
- iFStream.open(stringPersonInfoXmlPath.c_str());
- StreamCopier::copyStream(iFStream, oStringStream);
- iFStream.close();
- string stringXmlContent = oStringStream.str();
- nRet = CUtil::GetMapFromRequestXml(stringXmlContent, "root", mapParam);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetGuanXinCommandType(UPLOADPERSONINFO);
- this->SetNetConfigType(GUANXIN_FORM);
- nRet = ExecuteGuanXinSession(mapParam, "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::SetCliniqueState(string stringCliniqueId, string stringState)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCliniqueId = pDoc->createElement("unitid");
- AutoPtr<Element> pChildState = pDoc->createElement("state");
- AutoPtr<Text> pTextCliniqueId = pDoc->createTextNode(stringCliniqueId);
- AutoPtr<Text> pTextState = pDoc->createTextNode(stringState);
- pChildCliniqueId->appendChild(pTextCliniqueId);
- pChildState->appendChild(pTextState);
- pRoot->appendChild(pChildCliniqueId);
- pRoot->appendChild(pChildState);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "2201", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetPatientInfoByAppNum(string stringHospitalId, string stringOrderType, string stringOrderId, string stringReqDepart, string stringOrderState, string stringCheckType, string stringStartDate, string stringEndDate, string stringClinicId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
- AutoPtr<Element> pChildOrderType = pDoc->createElement("order_type");
- AutoPtr<Element> pChildOrderId = pDoc->createElement("order_id");
- AutoPtr<Element> pChildReqDepart = pDoc->createElement("req_depart");
- AutoPtr<Element> pChildOrderState = pDoc->createElement("order_state");
- AutoPtr<Element> pChildCheckType = pDoc->createElement("check_type");
- AutoPtr<Element> pChildStartDate = pDoc->createElement("startdate");
- AutoPtr<Element> pChildEndDate = pDoc->createElement("enddate");
- AutoPtr<Element> pClinicId = pDoc->createElement("clinic_id");
- AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
- AutoPtr<Text> pTextOrderType = pDoc->createTextNode(stringOrderType);
- AutoPtr<Text> pTextOrderId = pDoc->createTextNode(stringOrderId);
- AutoPtr<Text> pTextReqDepart = pDoc->createTextNode(stringReqDepart);
- AutoPtr<Text> pTextOrderState = pDoc->createTextNode(stringOrderState);
- AutoPtr<Text> pTextCheckType = pDoc->createTextNode(stringCheckType);
- AutoPtr<Text> pTextStartDate = pDoc->createTextNode(stringStartDate);
- AutoPtr<Text> pTextEndDate = pDoc->createTextNode(stringEndDate);
- AutoPtr<Text> pTextClinicId = pDoc->createTextNode(stringClinicId);
- pChildHospitalId->appendChild(pTextHospitalId);
- pChildOrderType->appendChild(pTextOrderType);
- pChildOrderId->appendChild(pTextOrderId);
- pChildReqDepart->appendChild(pTextReqDepart);
- pChildOrderState->appendChild(pTextOrderState);
- pChildCheckType->appendChild(pTextCheckType);
- pChildStartDate->appendChild(pTextStartDate);
- pChildEndDate->appendChild(pTextEndDate);
- pClinicId->appendChild(pTextClinicId);
- pRoot->appendChild(pChildHospitalId);
- pRoot->appendChild(pChildOrderType);
- pRoot->appendChild(pChildOrderId);
- pRoot->appendChild(pChildReqDepart);
- pRoot->appendChild(pChildOrderState);
- pRoot->appendChild(pChildCheckType);
- pRoot->appendChild(pChildStartDate);
- pRoot->appendChild(pChildEndDate);
- pRoot->appendChild(pClinicId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "2202", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetPatientInfoByAppNumToHis(string stringHospitalId, string stringOrderType, string stringOrderId)
- {
- int nRet = PHMS_SUCCESSFUL_RESULT;
- string stringId;
- string stringIdType;
- nRet = CUtil::ParseStandardQueryString(stringOrderId, stringId, stringIdType);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildId = pDoc->createElement("id");
- AutoPtr<Element> pChildIdType = pDoc->createElement("id_type");
- AutoPtr<Element> pChildOrderType = pDoc->createElement("order_type");
- AutoPtr<Text> pTextId = pDoc->createTextNode(stringId);
- AutoPtr<Text> pTextIdType = pDoc->createTextNode(stringIdType);
- AutoPtr<Text> pTextOrderType = pDoc->createTextNode(stringOrderType);
- pChildId->appendChild(pTextId);
- pChildIdType->appendChild(pTextIdType);
- pChildOrderType->appendChild(pTextOrderType);
- pRoot->appendChild(pChildId);
- pRoot->appendChild(pChildIdType);
- pRoot->appendChild(pChildOrderType);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
-
- nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetNetConfigType(DIRECTLY_TO_HIS);
- //暂时使用GetXmlNetConfig读取网络配置,所以不能与导医服务器连用,其实应该有类似SetXmlCommandType的SetXmlServer/Port
- //而且SSL采用通用配置,不能单独配置
- nRet = ExecuteXmlSession(stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetPatientInfoByAppNumToPhmsAndHis(string stringHospitalId, string stringOrderType, string stringOrderId)
- {
- this->SetNetConfigType(DIRECTLY_TO_HIS);
- return this->GetPatientInfoByAppNum(stringHospitalId, stringOrderType, stringOrderId, "", "", "", "", "", "");
- }
- int CPhmsSession::ApplyCheck(string stringCliniqueId, string stringOrderId, string stringOrderType)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCliniqueId = pDoc->createElement("unitid");
- AutoPtr<Element> pChildOrderType = pDoc->createElement("order_type");
- AutoPtr<Element> pChildOrderId = pDoc->createElement("order_id");
- AutoPtr<Text> pTextCliniqueId = pDoc->createTextNode(stringCliniqueId);
- AutoPtr<Text> pTextOrderType = pDoc->createTextNode(stringOrderType);
- AutoPtr<Text> pTextOrderId = pDoc->createTextNode(stringOrderId);
- pChildCliniqueId->appendChild(pTextCliniqueId);
- pChildOrderType->appendChild(pTextOrderType);
- pChildOrderId->appendChild(pTextOrderId);
- pRoot->appendChild(pChildCliniqueId);
- pRoot->appendChild(pChildOrderType);
- pRoot->appendChild(pChildOrderId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "2203", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- if(nRet != 220303)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- }
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetWaitingCheck(string stringCliniqueId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCliniqueId = pDoc->createElement("unitid");
- AutoPtr<Text> pTextCliniqueId = pDoc->createTextNode(stringCliniqueId);
- pChildCliniqueId->appendChild(pTextCliniqueId);
- pRoot->appendChild(pChildCliniqueId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "2204", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- if(nRet!=220403 && nRet!=220405)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- }
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetCliniqueState(string stringCliniqueId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildCliniqueId = pDoc->createElement("unitid");
- AutoPtr<Text> pTextCliniqueId = pDoc->createTextNode(stringCliniqueId);
- pChildCliniqueId->appendChild(pTextCliniqueId);
- pRoot->appendChild(pChildCliniqueId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "2205", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::NotifyCaseState(string stringHospitalId, string stringOrderType, string stringOrderId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
- AutoPtr<Element> pChildOrderType = pDoc->createElement("order_type");
- AutoPtr<Element> pChildOrderId = pDoc->createElement("order_id");
- AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
- AutoPtr<Text> pTextOrderType = pDoc->createTextNode(stringOrderType);
- AutoPtr<Text> pTextOrderId = pDoc->createTextNode(stringOrderId);
- pChildHospitalId->appendChild(pTextHospitalId);
- pChildOrderType->appendChild(pTextOrderType);
- pChildOrderId->appendChild(pTextOrderId);
- pRoot->appendChild(pChildHospitalId);
- pRoot->appendChild(pChildOrderType);
- pRoot->appendChild(pChildOrderId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "2206", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::NotifyReportState(string stringReportId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
- AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
- pChildReportId->appendChild(pTextReportId);
- pRoot->appendChild(pChildReportId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "2207", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::NotifyAppState(string stringUnitId, string stringOrderId, string stringOrderType, string stringState)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildUnitId = pDoc->createElement("unitid");
- AutoPtr<Element> pChildOrderId = pDoc->createElement("order_id");
- AutoPtr<Element> pChildOrderType = pDoc->createElement("order_type");
- AutoPtr<Element> pChildState = pDoc->createElement("state");
- AutoPtr<Text> pTextUnitId = pDoc->createTextNode(stringUnitId);
- AutoPtr<Text> pTextOrderType = pDoc->createTextNode(stringOrderType);
- AutoPtr<Text> pTextOrderId = pDoc->createTextNode(stringOrderId);
- AutoPtr<Text> pTextState = pDoc->createTextNode(stringState);
- pChildUnitId->appendChild(pTextUnitId);
- pChildOrderType->appendChild(pTextOrderType);
- pChildOrderId->appendChild(pTextOrderId);
- pChildState->appendChild(pTextState);
- pRoot->appendChild(pChildUnitId);
- pRoot->appendChild(pChildOrderId);
- pRoot->appendChild(pChildOrderType);
- pRoot->appendChild(pChildState);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "2208", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::VerifyAppState(string stringOrderId, string stringOrderType)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildOrderId = pDoc->createElement("order_id");
- AutoPtr<Element> pChildOrderType = pDoc->createElement("order_type");
- AutoPtr<Text> pTextOrderType = pDoc->createTextNode(stringOrderType);
- AutoPtr<Text> pTextOrderId = pDoc->createTextNode(stringOrderId);
- pChildOrderType->appendChild(pTextOrderType);
- pChildOrderId->appendChild(pTextOrderId);
- pRoot->appendChild(pChildOrderId);
- pRoot->appendChild(pChildOrderType);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "2209", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetHisReportState(string stringHospitalId, string stringOrderType, string stringOrderId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
- AutoPtr<Element> pChildOrderType = pDoc->createElement("order_type");
- AutoPtr<Element> pChildOrderId = pDoc->createElement("order_id");
- AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
- AutoPtr<Text> pTextOrderType = pDoc->createTextNode(stringOrderType);
- AutoPtr<Text> pTextOrderId = pDoc->createTextNode(stringOrderId);
- pChildHospitalId->appendChild(pTextHospitalId);
- pChildOrderType->appendChild(pTextOrderType);
- pChildOrderId->appendChild(pTextOrderId);
- pRoot->appendChild(pChildHospitalId);
- pRoot->appendChild(pChildOrderType);
- pRoot->appendChild(pChildOrderId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "2211", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::SetHisCriticalValue(string stringHospitalId, string stringCaseId, string stringCriticalValues)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
- AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
- AutoPtr<Element> pChildCriticalValues = pDoc->createElement("critical_values");
- AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
- AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
- AutoPtr<Text> pTextCriticalValues = pDoc->createTextNode(stringCriticalValues);
- pChildHospitalId->appendChild(pTextHospitalId);
- pChildCaseId->appendChild(pTextCaseId);
- pChildCriticalValues->appendChild(pTextCriticalValues);
- pRoot->appendChild(pChildHospitalId);
- pRoot->appendChild(pChildCaseId);
- pRoot->appendChild(pChildCriticalValues);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXml(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- string stringSessionId(32, '0');
- if(m_stringSessionId.size() != 0)
- {
- stringSessionId = m_stringSessionId;
- }
- CPhmsRequestHead phmsRequestHead("10", "2212", stringSessionId, "11");
- CPhmsRequestBody phmsRequestBody(stringXmlContent);
- CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
- if(m_stringSessionId.size() != 0)
- {
- phmsRequest.GenerateAndSetSign();
- }
- CPhmsResponse phmsResponse;
- nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetDoctorList_999120(string stringKtCliniqueId, string stringCaseTypeId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildTopic = pDoc->createElement("topic");
- AutoPtr<Element> pChildDetail = pDoc->createElement("detail");
- AutoPtr<Element> pChildSign = pDoc->createElement("sign");
- AutoPtr<Element> pGrandChildVersion = pDoc->createElement("version");
- AutoPtr<Element> pGrandChildCharset = pDoc->createElement("charset");
- AutoPtr<Element> pGrandChildDevice = pDoc->createElement("device");
- AutoPtr<Element> pGrandChildKtCliniqueId = pDoc->createElement("kt_cliniqueid");
- AutoPtr<Element> pGrandChildSignContent = pDoc->createElement("signcontent");
- AutoPtr<Text> pTextVersion = pDoc->createTextNode("1.0");
- AutoPtr<Text> pTextCharset = pDoc->createTextNode("GBK");
- AutoPtr<Text> pTextDevice = pDoc->createTextNode(stringCaseTypeId);
- AutoPtr<Text> pTextKtCliniqueId = pDoc->createTextNode(stringKtCliniqueId);
- string stringSignSrc;
- stringSignSrc = "version=1.0&charset=GBK";
- stringSignSrc += "&kt_cliniqueid=";
- stringSignSrc += stringKtCliniqueId;
- stringSignSrc += "&device=";
- stringSignSrc += stringCaseTypeId;
- stringSignSrc += "&poskey=";
- stringSignSrc += m_stringKey;
- // std::cout<<stringSignSrc<<std::endl;
- AutoPtr<Text> pTextSignContent = pDoc->createTextNode(CUtil::GetMd5(stringSignSrc.c_str(), stringSignSrc.size()));
- pGrandChildVersion->appendChild(pTextVersion);
- pGrandChildCharset->appendChild(pTextCharset);
- pGrandChildDevice->appendChild(pTextDevice);
- pGrandChildKtCliniqueId->appendChild(pTextKtCliniqueId);
- pGrandChildSignContent->appendChild(pTextSignContent);
- pChildTopic->appendChild(pGrandChildVersion);
- pChildTopic->appendChild(pGrandChildCharset);
- pChildTopic->appendChild(pGrandChildDevice);
- pChildDetail->appendChild(pGrandChildKtCliniqueId);
- pChildSign->appendChild(pGrandChildSignContent);
- pRoot->appendChild(pChildTopic);
- pRoot->appendChild(pChildDetail);
- pRoot->appendChild(pChildSign);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXmlCommandType(SELECT_DOCTOR_TYPE);
- this->SetNetConfigType(DAOYI_XML);
- nRet = ExecuteXmlSession(stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ValidatePay_999120(string stringConsumeId, string stringKtCliniqueId, string stringCardNumber, string stringKtDoctorId, string stringConsumeMoney, string stringCaseTypeId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildTopic = pDoc->createElement("topic");
- AutoPtr<Element> pChildDetail = pDoc->createElement("detail");
- AutoPtr<Element> pChildSign = pDoc->createElement("sign");
- AutoPtr<Element> pGrandChildVersion = pDoc->createElement("version");
- AutoPtr<Element> pGrandChildCharset = pDoc->createElement("charset");
- AutoPtr<Element> pGrandChildDevice = pDoc->createElement("device");
- AutoPtr<Element> pGrandChildConsumeId = pDoc->createElement("consume_id");
- AutoPtr<Element> pGrandChildKtCliniqueId = pDoc->createElement("kt_cliniqueid");
- AutoPtr<Element> pGrandChildCardNumber = pDoc->createElement("cardnumber");
- AutoPtr<Element> pGrandChildKtDoctorId = pDoc->createElement("kt_doctorid");
- AutoPtr<Element> pGrandChildConsumeMoney = pDoc->createElement("consumemoney");
- AutoPtr<Element> pGrandChildSignContent = pDoc->createElement("signcontent");
- AutoPtr<Text> pTextVersion = pDoc->createTextNode("1.0");
- AutoPtr<Text> pTextCharset = pDoc->createTextNode("GBK");
- AutoPtr<Text> pTextDevice = pDoc->createTextNode(stringCaseTypeId);
- AutoPtr<Text> pTextConsumeId = pDoc->createTextNode(stringConsumeId);
- AutoPtr<Text> pTextKtCliniqueId = pDoc->createTextNode(stringKtCliniqueId);
- AutoPtr<Text> pTextCardNumber = pDoc->createTextNode(stringCardNumber);
- AutoPtr<Text> pTextKtDoctorId = pDoc->createTextNode(stringKtDoctorId);
- AutoPtr<Text> pTextConsumeMoney = pDoc->createTextNode(stringConsumeMoney);
- string stringSignSrc;
- stringSignSrc = "version=1.0&charset=GBK";
- stringSignSrc += "&consume_id=";
- stringSignSrc += stringConsumeId;
- stringSignSrc += "&kt_cliniqueid=";
- stringSignSrc += stringKtCliniqueId;
- stringSignSrc += "&cardnumber=";
- stringSignSrc += stringCardNumber;
- stringSignSrc += "&kt_doctorid=";
- stringSignSrc += stringKtDoctorId;
- stringSignSrc += "&consumemoney=";
- stringSignSrc += stringConsumeMoney;
- stringSignSrc += "&device=";
- stringSignSrc += stringCaseTypeId;
- stringSignSrc += "&poskey=";
- stringSignSrc += m_stringKey;
- // std::cout<<stringSignSrc<<std::endl;
- AutoPtr<Text> pTextSignContent = pDoc->createTextNode(CUtil::GetMd5(stringSignSrc.c_str(), stringSignSrc.size()));
- pGrandChildVersion->appendChild(pTextVersion);
- pGrandChildCharset->appendChild(pTextCharset);
- pGrandChildDevice->appendChild(pTextDevice);
- pGrandChildConsumeId->appendChild(pTextConsumeId);
- pGrandChildKtCliniqueId->appendChild(pTextKtCliniqueId);
- pGrandChildCardNumber->appendChild(pTextCardNumber);
- pGrandChildKtDoctorId->appendChild(pTextKtDoctorId);
- pGrandChildConsumeMoney->appendChild(pTextConsumeMoney);
- pGrandChildSignContent->appendChild(pTextSignContent);
- pChildTopic->appendChild(pGrandChildVersion);
- pChildTopic->appendChild(pGrandChildCharset);
- pChildTopic->appendChild(pGrandChildDevice);
- pChildDetail->appendChild(pGrandChildConsumeId);
- pChildDetail->appendChild(pGrandChildKtCliniqueId);
- pChildDetail->appendChild(pGrandChildCardNumber);
- pChildDetail->appendChild(pGrandChildKtDoctorId);
- pChildDetail->appendChild(pGrandChildConsumeMoney);
- pChildSign->appendChild(pGrandChildSignContent);
- pRoot->appendChild(pChildTopic);
- pRoot->appendChild(pChildDetail);
- pRoot->appendChild(pChildSign);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXmlCommandType(PAY_VERIFICATION_TYPE);
- this->SetNetConfigType(DAOYI_XML);
- nRet = ExecuteXmlSession(stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UpdateCaseForConsumerRecord_999120(string stringConsumeId, string stringKtCaseId, string stringCaseTypeId)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("request");
- AutoPtr<Element> pChildTopic = pDoc->createElement("topic");
- AutoPtr<Element> pChildDetail = pDoc->createElement("detail");
- AutoPtr<Element> pChildSign = pDoc->createElement("sign");
- AutoPtr<Element> pGrandChildVersion = pDoc->createElement("version");
- AutoPtr<Element> pGrandChildCharset = pDoc->createElement("charset");
- AutoPtr<Element> pGrandChildDevice = pDoc->createElement("device");
- AutoPtr<Element> pGrandChildConsumeId = pDoc->createElement("consume_id");
- AutoPtr<Element> pGrandChildKtCaseId = pDoc->createElement("kt_case_id");
- AutoPtr<Element> pGrandChildSignContent = pDoc->createElement("signcontent");
- AutoPtr<Text> pTextVersion = pDoc->createTextNode("1.0");
- AutoPtr<Text> pTextCharset = pDoc->createTextNode("GBK");
- AutoPtr<Text> pTextDevice = pDoc->createTextNode(stringCaseTypeId);
- AutoPtr<Text> pTextConsumeId = pDoc->createTextNode(stringConsumeId);
- AutoPtr<Text> pTextKtCaseId = pDoc->createTextNode(stringKtCaseId);
- string stringSignSrc;
- stringSignSrc = "version=1.0&charset=GBK";
- stringSignSrc += "&consume_id=";
- stringSignSrc += stringConsumeId;
- stringSignSrc += "&kt_case_id=";
- stringSignSrc += stringKtCaseId;
- stringSignSrc += "&device=";
- stringSignSrc += stringCaseTypeId;
- stringSignSrc += "&poskey=";
- stringSignSrc += m_stringKey;
- // std::cout<<stringSignSrc<<std::endl;
- AutoPtr<Text> pTextSignContent = pDoc->createTextNode(CUtil::GetMd5(stringSignSrc.c_str(), stringSignSrc.size()));
- pGrandChildVersion->appendChild(pTextVersion);
- pGrandChildCharset->appendChild(pTextCharset);
- pGrandChildDevice->appendChild(pTextDevice);
- pGrandChildConsumeId->appendChild(pTextConsumeId);
- pGrandChildKtCaseId->appendChild(pTextKtCaseId);
- pGrandChildSignContent->appendChild(pTextSignContent);
- pChildTopic->appendChild(pGrandChildVersion);
- pChildTopic->appendChild(pGrandChildCharset);
- pChildTopic->appendChild(pGrandChildDevice);
- pChildDetail->appendChild(pGrandChildConsumeId);
- pChildDetail->appendChild(pGrandChildKtCaseId);
- pChildSign->appendChild(pGrandChildSignContent);
- pRoot->appendChild(pChildTopic);
- pRoot->appendChild(pChildDetail);
- pRoot->appendChild(pChildSign);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXmlCommandType(PAY_VERIFICATION_CASE_TYPE);
- this->SetNetConfigType(DAOYI_XML);
- nRet = ExecuteXmlSession(stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ValidatePay_XinJie(string stringRrn, string stringLocalDate)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("xml");
- AutoPtr<Element> pChildRrn = pDoc->createElement("rrn");
- AutoPtr<Element> pChildLocalDate = pDoc->createElement("localdate");
- AutoPtr<Text> pTextRrn = pDoc->createTextNode(stringRrn);
- AutoPtr<Text> pTextLocalDate = pDoc->createTextNode(stringLocalDate);
- pChildRrn->appendChild(pTextRrn);
- pChildLocalDate->appendChild(pTextLocalDate);
- pRoot->appendChild(pChildRrn);
- pRoot->appendChild(pChildLocalDate);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXmlForAESAndBase64(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXinJieCommandType(VALIDATE_PAY);
- this->SetNetConfigType(XINJIE_XML);
- nRet = ExecuteXinJieSession(stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::NotifyCheck_XinJie(string stringRrn, string stringLocalDate)
- {
- AutoPtr<Document> pDoc = new Document;
- //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
- AutoPtr<Element> pRoot = pDoc->createElement("xml");
- AutoPtr<Element> pChildRrn = pDoc->createElement("rrn");
- AutoPtr<Element> pChildLocalDate = pDoc->createElement("localdate");
- AutoPtr<Text> pTextRrn = pDoc->createTextNode(stringRrn);
- AutoPtr<Text> pTextLocalDate = pDoc->createTextNode(stringLocalDate);
- pChildRrn->appendChild(pTextRrn);
- pChildLocalDate->appendChild(pTextLocalDate);
- pRoot->appendChild(pChildRrn);
- pRoot->appendChild(pChildLocalDate);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXmlForAESAndBase64(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXinJieCommandType(NOTIFY_PAY);
- this->SetNetConfigType(XINJIE_XML);
- nRet = ExecuteXinJieSession(stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UserAuthorize_Telecom(string stringPersonId, string stringName, string stringNation, string stringAddress, string stringRoomId)
- {
- bool bNfc = false;
- if(stringName.size()==0 && stringNation.size()==0 && stringAddress.size()==0)
- {
- bNfc = true;
- }
- DateTime dt;
- dt += Timespan(Timezone::utcOffset(), 0);
- string stringDateTime = DateTimeFormatter::format(dt, "%Y-%m-%d %H:%M:%S");
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='utf-8'");
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Element> pChildTimeStamp = pDoc->createElement("TimeStamp");
- AutoPtr<Element> pChildAccessCode = pDoc->createElement("AccessCode");
- AutoPtr<Element> pChildAuthType = pDoc->createElement("AuthType");
- AutoPtr<Element> pChildAuthData = pDoc->createElement("AuthData");
- AutoPtr<Element> pGrandChildName = 0;
- AutoPtr<Element> pGrandChildNation = 0;
- AutoPtr<Element> pGrandChildAddress = 0;
- AutoPtr<Element> pGrandChildProofNum = 0;
- if(!bNfc)
- {
- pGrandChildName = pDoc->createElement("Name");
- pGrandChildNation = pDoc->createElement("Nation");
- pGrandChildAddress = pDoc->createElement("Address");
- pGrandChildProofNum = pDoc->createElement("ProofNum");
- }
- AutoPtr<Element> pChildRoomId = pDoc->createElement("RoomId");
- AutoPtr<Text> pTextTimeStamp = pDoc->createTextNode(stringDateTime);
- AutoPtr<Text> pTextAccessCode = pDoc->createTextNode("CONTEC");
- AutoPtr<Text> pTextAuthType = 0;
- if(!bNfc)
- {
- pTextAuthType = pDoc->createTextNode("08");
- }
- else
- {
- pTextAuthType = pDoc->createTextNode("01");
- }
- AutoPtr<Text> pTextName = 0;
- AutoPtr<Text> pTextNation = 0;
- AutoPtr<Text> pTextAddress = 0;
- AutoPtr<Text> pTextProofNum = 0;
- AutoPtr<Text> pTextNfcId = 0;
- if(!bNfc)
- {
- pTextName = pDoc->createTextNode(stringName);
- pTextNation = pDoc->createTextNode(stringNation);
- pTextAddress = pDoc->createTextNode(stringAddress);
- pTextProofNum = pDoc->createTextNode(stringPersonId);
- }
- else
- {
- pTextNfcId = pDoc->createTextNode(stringPersonId);
- }
- AutoPtr<Text> pTextRoomId = pDoc->createTextNode(stringRoomId);
- pChildTimeStamp->appendChild(pTextTimeStamp);
- pChildAccessCode->appendChild(pTextAccessCode);
- pChildAuthType->appendChild(pTextAuthType);
- if(!bNfc)
- {
- pGrandChildName->appendChild(pTextName);
- pGrandChildNation->appendChild(pTextNation);
- pGrandChildAddress->appendChild(pTextAddress);
- pGrandChildProofNum->appendChild(pTextProofNum);
- pChildAuthData->appendChild(pGrandChildName);
- pChildAuthData->appendChild(pGrandChildNation);
- pChildAuthData->appendChild(pGrandChildAddress);
- pChildAuthData->appendChild(pGrandChildProofNum);
- }
- else
- {
- pChildAuthData->appendChild(pTextNfcId);
- }
- pChildRoomId->appendChild(pTextRoomId);
- pRoot->appendChild(pChildTimeStamp);
- pRoot->appendChild(pChildAccessCode);
- pRoot->appendChild(pChildAuthType);
- pRoot->appendChild(pChildAuthData);
- pRoot->appendChild(pChildRoomId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent, true);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXmlCommandType_Telecom(USER_AUTH);
- this->SetNetConfigType(TELECOM_XML);
- nRet = ExecuteXmlSession_Telecom(stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::BloodPressureUpload_Telecom(string stringPersonType, string stringPersonId, string stringSBP, string stringDBP, string stringAverageValue, string stringPulseRate, string stringDetectionTime,
- string stringEquCode, string stringRoomId)
- {
- DateTime dt;
- dt += Timespan(Timezone::utcOffset(), 0);
- string stringDateTime = DateTimeFormatter::format(dt, "%Y-%m-%d %H:%M:%S");
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='utf-8'");
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Element> pChildTimeStamp = pDoc->createElement("TimeStamp");
- AutoPtr<Element> pChildAccessCode = pDoc->createElement("AccessCode");
- AutoPtr<Element> pChildDiscernType = pDoc->createElement("UserDiscernType");
- AutoPtr<Element> pChildDiscernData = pDoc->createElement("UserDiscernData");
- AutoPtr<Element> pChildSBP = pDoc->createElement("SBP");
- AutoPtr<Element> pChildDBP = pDoc->createElement("DBP");
- AutoPtr<Element> pChildAverageValue = pDoc->createElement("AverageValue");
- AutoPtr<Element> pChildPulseRate = pDoc->createElement("PulseRate");
- AutoPtr<Element> pChildDetectionTime = pDoc->createElement("DetectionTime");
- AutoPtr<Element> pChildDetectionResult = pDoc->createElement("DetectionResult");
- AutoPtr<Element> pChildEquCode = pDoc->createElement("EquCode");
- AutoPtr<Element> pChildId = pDoc->createElement("Id");
- AutoPtr<Element> pChildRoomId = pDoc->createElement("RoomId");
- AutoPtr<Text> pTextTimeStamp = pDoc->createTextNode(stringDateTime);
- AutoPtr<Text> pTextAccessCode = pDoc->createTextNode("CONTEC");
- AutoPtr<Text> pTextDiscernType = 0;
- pTextDiscernType = pDoc->createTextNode(stringPersonType);
- // if(nCardType == 1)
- // {
- // pTextDiscernType = pDoc->createTextNode("01");
- // }
- // else
- // {
- // pTextDiscernType = pDoc->createTextNode("02");
- // }
- AutoPtr<Text> pTextDiscernData = pDoc->createTextNode(stringPersonId);
- AutoPtr<Text> pTextSBP = pDoc->createTextNode(stringSBP);
- AutoPtr<Text> pTextDBP = pDoc->createTextNode(stringDBP);
- AutoPtr<Text> pTextAverageValue = pDoc->createTextNode(stringAverageValue);
- AutoPtr<Text> pTextPulseRate = pDoc->createTextNode(stringPulseRate);
- AutoPtr<Text> pTextDetectionTime = pDoc->createTextNode(stringDetectionTime);
- AutoPtr<Text> pTextDetectionResutl = pDoc->createTextNode("");
- AutoPtr<Text> pTextEquCode = pDoc->createTextNode(stringEquCode);
- AutoPtr<Text> pTextId = pDoc->createTextNode("");
- AutoPtr<Text> pTextRoomId = pDoc->createTextNode(stringRoomId);
- pChildTimeStamp->appendChild(pTextTimeStamp);
- pChildAccessCode->appendChild(pTextAccessCode);
- pChildDiscernType->appendChild(pTextDiscernType);
- pChildDiscernData->appendChild(pTextDiscernData);
- pChildSBP->appendChild(pTextSBP);
- pChildDBP->appendChild(pTextDBP);
- pChildAverageValue->appendChild(pTextAverageValue);
- pChildPulseRate->appendChild(pTextPulseRate);
- pChildDetectionTime->appendChild(pTextDetectionTime);
- pChildDetectionResult->appendChild(pTextDetectionResutl);
- pChildEquCode->appendChild(pTextEquCode);
- pChildId->appendChild(pTextId);
- pChildRoomId->appendChild(pTextRoomId);
- pRoot->appendChild(pChildTimeStamp);
- pRoot->appendChild(pChildAccessCode);
- pRoot->appendChild(pChildDiscernType);
- pRoot->appendChild(pChildDiscernData);
- pRoot->appendChild(pChildSBP);
- pRoot->appendChild(pChildDBP);
- pRoot->appendChild(pChildAverageValue);
- pRoot->appendChild(pChildPulseRate);
- pRoot->appendChild(pChildDetectionTime);
- pRoot->appendChild(pChildDetectionResult);
- pRoot->appendChild(pChildEquCode);
- pRoot->appendChild(pChildId);
- pRoot->appendChild(pChildRoomId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXmlCommandType_Telecom(SYNC_BP);
- this->SetNetConfigType(TELECOM_XML);
- nRet = ExecuteXmlSession_Telecom(stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::BloodOxygenUpload_Telecom(string stringPersonType, string stringPersonId, string stringBloodOxygen, string stringPulseRate, string stringDetectionTime,
- string stringEquCode, string stringRoomId)
- {
- DateTime dt;
- dt += Timespan(Timezone::utcOffset(), 0);
- string stringDateTime = DateTimeFormatter::format(dt, "%Y-%m-%d %H:%M:%S");
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='utf-8'");
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Element> pChildTimeStamp = pDoc->createElement("TimeStamp");
- AutoPtr<Element> pChildAccessCode = pDoc->createElement("AccessCode");
- AutoPtr<Element> pChildDiscernType = pDoc->createElement("UserDiscernType");
- AutoPtr<Element> pChildDiscernData = pDoc->createElement("UserDiscernData");
- AutoPtr<Element> pChildBloodOxygen = pDoc->createElement("BloodOxygen");
- AutoPtr<Element> pChildPulseRate = pDoc->createElement("PulseRate");
- AutoPtr<Element> pChildDetectionTime = pDoc->createElement("DetectionTime");
- AutoPtr<Element> pChildDetectionResult = pDoc->createElement("DetectionResult");
- AutoPtr<Element> pChildEquCode = pDoc->createElement("EquCode");
- AutoPtr<Element> pChildId = pDoc->createElement("Id");
- AutoPtr<Element> pChildRoomId = pDoc->createElement("RoomId");
- AutoPtr<Text> pTextTimeStamp = pDoc->createTextNode(stringDateTime);
- AutoPtr<Text> pTextAccessCode = pDoc->createTextNode("CONTEC");
- AutoPtr<Text> pTextDiscernType = 0;
- pTextDiscernType = pDoc->createTextNode(stringPersonType);
- // if(nCardType == 1)
- // {
- // pTextDiscernType = pDoc->createTextNode("01");
- // }
- // else
- // {
- // pTextDiscernType = pDoc->createTextNode("02");
- // }
- AutoPtr<Text> pTextDiscernData = pDoc->createTextNode(stringPersonId);
- AutoPtr<Text> pTextBloodOxygen = pDoc->createTextNode(stringBloodOxygen);
- AutoPtr<Text> pTextPulseRate = pDoc->createTextNode(stringPulseRate);
- AutoPtr<Text> pTextDetectionTime = pDoc->createTextNode(stringDetectionTime);
- AutoPtr<Text> pTextDetectionResutl = pDoc->createTextNode("");
- AutoPtr<Text> pTextEquCode = pDoc->createTextNode(stringEquCode);
- AutoPtr<Text> pTextId = pDoc->createTextNode("");
- AutoPtr<Text> pTextRoomId = pDoc->createTextNode(stringRoomId);
- pChildTimeStamp->appendChild(pTextTimeStamp);
- pChildAccessCode->appendChild(pTextAccessCode);
- pChildDiscernType->appendChild(pTextDiscernType);
- pChildDiscernData->appendChild(pTextDiscernData);
- pChildBloodOxygen->appendChild(pTextBloodOxygen);
- pChildPulseRate->appendChild(pTextPulseRate);
- pChildDetectionTime->appendChild(pTextDetectionTime);
- pChildDetectionResult->appendChild(pTextDetectionResutl);
- pChildEquCode->appendChild(pTextEquCode);
- pChildId->appendChild(pTextId);
- pChildRoomId->appendChild(pTextRoomId);
- pRoot->appendChild(pChildTimeStamp);
- pRoot->appendChild(pChildAccessCode);
- pRoot->appendChild(pChildDiscernType);
- pRoot->appendChild(pChildDiscernData);
- pRoot->appendChild(pChildBloodOxygen);
- pRoot->appendChild(pChildPulseRate);
- pRoot->appendChild(pChildDetectionTime);
- pRoot->appendChild(pChildDetectionResult);
- pRoot->appendChild(pChildEquCode);
- pRoot->appendChild(pChildId);
- pRoot->appendChild(pChildRoomId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXmlCommandType_Telecom(SYNC_BO);
- this->SetNetConfigType(TELECOM_XML);
- nRet = ExecuteXmlSession_Telecom(stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::BloodSugarUpload_Telecom(string stringPersonType, string stringPersonId, string stringBloodSugar, string stringDetectionTime,
- string stringEquCode, string stringRoomId)
- {
- DateTime dt;
- dt += Timespan(Timezone::utcOffset(), 0);
- string stringDateTime = DateTimeFormatter::format(dt, "%Y-%m-%d %H:%M:%S");
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='utf-8'");
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Element> pChildTimeStamp = pDoc->createElement("TimeStamp");
- AutoPtr<Element> pChildAccessCode = pDoc->createElement("AccessCode");
- AutoPtr<Element> pChildDiscernType = pDoc->createElement("UserDiscernType");
- AutoPtr<Element> pChildDiscernData = pDoc->createElement("UserDiscernData");
- AutoPtr<Element> pChildBloodGlucose = pDoc->createElement("BloodGlucose");
- AutoPtr<Element> pChildTestType = pDoc->createElement("TestType");
- AutoPtr<Element> pChildDetectionTime = pDoc->createElement("DetectionTime");
- AutoPtr<Element> pChildDetectionResult = pDoc->createElement("DetectionResult");
- AutoPtr<Element> pChildEquCode = pDoc->createElement("EquCode");
- AutoPtr<Element> pChildId = pDoc->createElement("Id");
- AutoPtr<Element> pChildRoomId = pDoc->createElement("RoomId");
- AutoPtr<Text> pTextTimeStamp = pDoc->createTextNode(stringDateTime);
- AutoPtr<Text> pTextAccessCode = pDoc->createTextNode("CONTEC");
- AutoPtr<Text> pTextDiscernType = 0;
- pTextDiscernType = pDoc->createTextNode(stringPersonType);
- // if(nCardType == 1)
- // {
- // pTextDiscernType = pDoc->createTextNode("01");
- // }
- // else
- // {
- // pTextDiscernType = pDoc->createTextNode("02");
- // }
- AutoPtr<Text> pTextDiscernData = pDoc->createTextNode(stringPersonId);
- AutoPtr<Text> pTextBloodGlucose = pDoc->createTextNode(stringBloodSugar);
- AutoPtr<Text> pTextTestType = pDoc->createTextNode("");
- AutoPtr<Text> pTextDetectionTime = pDoc->createTextNode(stringDetectionTime);
- AutoPtr<Text> pTextDetectionResutl = pDoc->createTextNode("");
- AutoPtr<Text> pTextEquCode = pDoc->createTextNode(stringEquCode);
- AutoPtr<Text> pTextId = pDoc->createTextNode("");
- AutoPtr<Text> pTextRoomId = pDoc->createTextNode(stringRoomId);
- pChildTimeStamp->appendChild(pTextTimeStamp);
- pChildAccessCode->appendChild(pTextAccessCode);
- pChildDiscernType->appendChild(pTextDiscernType);
- pChildDiscernData->appendChild(pTextDiscernData);
- pChildBloodGlucose->appendChild(pTextBloodGlucose);
- pChildTestType->appendChild(pTextTestType);
- pChildDetectionTime->appendChild(pTextDetectionTime);
- pChildDetectionResult->appendChild(pTextDetectionResutl);
- pChildEquCode->appendChild(pTextEquCode);
- pChildId->appendChild(pTextId);
- pChildRoomId->appendChild(pTextRoomId);
- pRoot->appendChild(pChildTimeStamp);
- pRoot->appendChild(pChildAccessCode);
- pRoot->appendChild(pChildDiscernType);
- pRoot->appendChild(pChildDiscernData);
- pRoot->appendChild(pChildBloodGlucose);
- pRoot->appendChild(pChildTestType);
- pRoot->appendChild(pChildDetectionTime);
- pRoot->appendChild(pChildDetectionResult);
- pRoot->appendChild(pChildEquCode);
- pRoot->appendChild(pChildId);
- pRoot->appendChild(pChildRoomId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXmlCommandType_Telecom(SYNC_BS);
- this->SetNetConfigType(TELECOM_XML);
- nRet = ExecuteXmlSession_Telecom(stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::HeightWeightUpload_Telecom(string stringPersonType, string stringPersonId, string stringHeight, string stringWeight, string stringBMI, string stringDetectionTime,
- string stringEquCode, string stringRoomId)
- {
- DateTime dt;
- dt += Timespan(Timezone::utcOffset(), 0);
- string stringDateTime = DateTimeFormatter::format(dt, "%Y-%m-%d %H:%M:%S");
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='utf-8'");
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Element> pChildTimeStamp = pDoc->createElement("TimeStamp");
- AutoPtr<Element> pChildAccessCode = pDoc->createElement("AccessCode");
- AutoPtr<Element> pChildDiscernType = pDoc->createElement("UserDiscernType");
- AutoPtr<Element> pChildDiscernData = pDoc->createElement("UserDiscernData");
- AutoPtr<Element> pChildHeight = pDoc->createElement("Height");
- AutoPtr<Element> pChildWeight = pDoc->createElement("Weight");
- AutoPtr<Element> pChildBMI = pDoc->createElement("BMI");
- AutoPtr<Element> pChildDetectionTime = pDoc->createElement("DetectionTime");
- AutoPtr<Element> pChildDetectionResult = pDoc->createElement("DetectionResult");
- AutoPtr<Element> pChildEquCode = pDoc->createElement("EquCode");
- AutoPtr<Element> pChildId = pDoc->createElement("Id");
- AutoPtr<Element> pChildRoomId = pDoc->createElement("RoomId");
- AutoPtr<Text> pTextTimeStamp = pDoc->createTextNode(stringDateTime);
- AutoPtr<Text> pTextAccessCode = pDoc->createTextNode("CONTEC");
- AutoPtr<Text> pTextDiscernType = 0;
- pTextDiscernType = pDoc->createTextNode(stringPersonType);
- // if(nCardType == 1)
- // {
- // pTextDiscernType = pDoc->createTextNode("01");
- // }
- // else
- // {
- // pTextDiscernType = pDoc->createTextNode("02");
- // }
- AutoPtr<Text> pTextDiscernData = pDoc->createTextNode(stringPersonId);
- AutoPtr<Text> pTextHeight = pDoc->createTextNode(stringHeight);
- AutoPtr<Text> pTextWeight = pDoc->createTextNode(stringWeight);
- AutoPtr<Text> pTextBMI = pDoc->createTextNode(stringBMI);
- AutoPtr<Text> pTextDetectionTime = pDoc->createTextNode(stringDetectionTime);
- AutoPtr<Text> pTextDetectionResutl = pDoc->createTextNode("");
- AutoPtr<Text> pTextEquCode = pDoc->createTextNode(stringEquCode);
- AutoPtr<Text> pTextId = pDoc->createTextNode("");
- AutoPtr<Text> pTextRoomId = pDoc->createTextNode(stringRoomId);
- pChildTimeStamp->appendChild(pTextTimeStamp);
- pChildAccessCode->appendChild(pTextAccessCode);
- pChildDiscernType->appendChild(pTextDiscernType);
- pChildDiscernData->appendChild(pTextDiscernData);
- pChildHeight->appendChild(pTextHeight);
- pChildWeight->appendChild(pTextWeight);
- pChildBMI->appendChild(pTextBMI);
- pChildDetectionTime->appendChild(pTextDetectionTime);
- pChildDetectionResult->appendChild(pTextDetectionResutl);
- pChildEquCode->appendChild(pTextEquCode);
- pChildId->appendChild(pTextId);
- pChildRoomId->appendChild(pTextRoomId);
- pRoot->appendChild(pChildTimeStamp);
- pRoot->appendChild(pChildAccessCode);
- pRoot->appendChild(pChildDiscernType);
- pRoot->appendChild(pChildDiscernData);
- pRoot->appendChild(pChildHeight);
- pRoot->appendChild(pChildWeight);
- pRoot->appendChild(pChildBMI);
- pRoot->appendChild(pChildDetectionTime);
- pRoot->appendChild(pChildDetectionResult);
- pRoot->appendChild(pChildEquCode);
- pRoot->appendChild(pChildId);
- pRoot->appendChild(pChildRoomId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXmlCommandType_Telecom(SYNC_HW);
- this->SetNetConfigType(TELECOM_XML);
- nRet = ExecuteXmlSession_Telecom(stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::LungUpload_Telecom(string stringPersonType, string stringPersonId, string stringM_B1, string stringBSA, string stringBSA1, string stringMMF, string stringMefSeventyFive, string stringMefFifty,
- string stringMefTwentyFive, string stringMefFVST, string stringIC, string stringIRV, string stringERV, string stringFevOne, string stringFevTwo, string stringFevThree,
- string stringFevOnePer, string stringFevTwoPer, string stringFevThreePer, string stringRR, string stringFVC, string stringPEF, string stringTV, string stringVC, string stringMVV,
- string stringMV, string stringVSTHeight, string stringVSMvvBsa, string stringVSMvvOne, string stringSVC, string stringFevOneZeroFive, string stringFevOneZeroFivePer, string stringPefOne,
- string stringPefTwo, string stringPefThree, string stringFive, string stringFiveOne, string stringFiveTwo, string stringFiveThree, string stringPIF, string stringMifFifty,
- string stringDetectionTime, string stringEquCode, string stringRoomId)
- {
- DateTime dt;
- dt += Timespan(Timezone::utcOffset(), 0);
- string stringDateTime = DateTimeFormatter::format(dt, "%Y-%m-%d %H:%M:%S");
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='utf-8'");
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Element> pChildTimeStamp = pDoc->createElement("TimeStamp");
- AutoPtr<Element> pChildAccessCode = pDoc->createElement("AccessCode");
- AutoPtr<Element> pChildDiscernType = pDoc->createElement("UserDiscernType");
- AutoPtr<Element> pChildDiscernData = pDoc->createElement("UserDiscernData");
- AutoPtr<Element> pChildM_B1 = pDoc->createElement("M_B1");
- AutoPtr<Element> pChildBSA = pDoc->createElement("BSA");
- AutoPtr<Element> pChildBSA1 = pDoc->createElement("BSA1");
- AutoPtr<Element> pChildMMF = pDoc->createElement("MMF");
- AutoPtr<Element> pChildMefSeventyFive = pDoc->createElement("MefSeventyFive");
- AutoPtr<Element> pChildMefFifty = pDoc->createElement("MefFifty");
- AutoPtr<Element> pChildMefTwentyFive = pDoc->createElement("MefTwentyFive");
- AutoPtr<Element> pChildMefFVST = pDoc->createElement("MefFVST");
- AutoPtr<Element> pChildIC = pDoc->createElement("IC");
- AutoPtr<Element> pChildIRV = pDoc->createElement("IRV");
- AutoPtr<Element> pChildERV = pDoc->createElement("ERV");
- AutoPtr<Element> pChildFevOne = pDoc->createElement("FevOne");
- AutoPtr<Element> pChildFevTwo = pDoc->createElement("FevTwo");
- AutoPtr<Element> pChildFevThree = pDoc->createElement("FevThree");
- AutoPtr<Element> pChildFevOnePer = pDoc->createElement("FevOnePer");
- AutoPtr<Element> pChildFevTwoPer = pDoc->createElement("FevTwoPer");
- AutoPtr<Element> pChildFevThreePer = pDoc->createElement("FevThreePer");
- AutoPtr<Element> pChildRR = pDoc->createElement("RR");
- AutoPtr<Element> pChildFVC = pDoc->createElement("FVC");
- AutoPtr<Element> pChildPEF = pDoc->createElement("PEF");
- AutoPtr<Element> pChildTV = pDoc->createElement("TV");
- AutoPtr<Element> pChildVC = pDoc->createElement("VC");
- AutoPtr<Element> pChildMVV = pDoc->createElement("MVV");
- AutoPtr<Element> pChildMV = pDoc->createElement("MV");
- AutoPtr<Element> pChildVSTHeight = pDoc->createElement("VSTHeight");
- AutoPtr<Element> pChildVSMvvBsa = pDoc->createElement("VSMvvBsa");
- AutoPtr<Element> pChildVSMvvOne = pDoc->createElement("VSMvvOne");
- AutoPtr<Element> pChildSVC = pDoc->createElement("SVC");
- AutoPtr<Element> pChildFevOneZeroFive = pDoc->createElement("FevOneZeroFive");
- AutoPtr<Element> pChildFevOneZeroFivePer = pDoc->createElement("FevOneZeroFivePer");
- AutoPtr<Element> pChildPefOne = pDoc->createElement("PefOne");
- AutoPtr<Element> pChildPefTwo = pDoc->createElement("PefTwo");
- AutoPtr<Element> pChildPefThree = pDoc->createElement("PefThree");
- AutoPtr<Element> pChildFive = pDoc->createElement("Five");
- AutoPtr<Element> pChildFiveOne = pDoc->createElement("FiveOne");
- AutoPtr<Element> pChildFiveTwo = pDoc->createElement("FiveTwo");
- AutoPtr<Element> pChildFiveThree = pDoc->createElement("FiveThree");
- AutoPtr<Element> pChildPif = pDoc->createElement("Pif");
- AutoPtr<Element> pChildMifFifty = pDoc->createElement("MifFifty");
- AutoPtr<Element> pChildDetectionTime = pDoc->createElement("DetectionTime");
- AutoPtr<Element> pChildDetectionResult = pDoc->createElement("DetectionResult");
- AutoPtr<Element> pChildEquCode = pDoc->createElement("EquCode");
- AutoPtr<Element> pChildId = pDoc->createElement("Id");
- AutoPtr<Element> pChildRoomId = pDoc->createElement("RoomId");
- AutoPtr<Text> pTextTimeStamp = pDoc->createTextNode(stringDateTime);
- AutoPtr<Text> pTextAccessCode = pDoc->createTextNode("CONTEC");
- AutoPtr<Text> pTextDiscernType = 0;
- pTextDiscernType = pDoc->createTextNode(stringPersonType);
- // if(nCardType == 1)
- // {
- // pTextDiscernType = pDoc->createTextNode("01");
- // }
- // else
- // {
- // pTextDiscernType = pDoc->createTextNode("02");
- // }
- AutoPtr<Text> pTextDiscernData = pDoc->createTextNode(stringPersonId);
- AutoPtr<Text> pTextM_B1 = pDoc->createTextNode(stringM_B1);
- AutoPtr<Text> pTextBSA = pDoc->createTextNode(stringBSA);
- AutoPtr<Text> pTextBSA1 = pDoc->createTextNode(stringBSA1);
- AutoPtr<Text> pTextMMF = pDoc->createTextNode(stringMMF);
- AutoPtr<Text> pTextMefSeventyFive = pDoc->createTextNode(stringMefSeventyFive);
- AutoPtr<Text> pTextMefFifty = pDoc->createTextNode(stringMefFifty);
- AutoPtr<Text> pTextMefTwentyFive = pDoc->createTextNode(stringMefTwentyFive);
- AutoPtr<Text> pTextMefFVST = pDoc->createTextNode(stringMefFVST);
- AutoPtr<Text> pTextIC = pDoc->createTextNode(stringIC);
- AutoPtr<Text> pTextIRV = pDoc->createTextNode(stringIRV);
- AutoPtr<Text> pTextERV = pDoc->createTextNode(stringERV);
- AutoPtr<Text> pTextFevOne = pDoc->createTextNode(stringFevOne);
- AutoPtr<Text> pTextFevTwo = pDoc->createTextNode(stringFevTwo);
- AutoPtr<Text> pTextFevThree = pDoc->createTextNode(stringFevThree);
- AutoPtr<Text> pTextFevOnePer = pDoc->createTextNode(stringFevOnePer);
- AutoPtr<Text> pTextFevTwoPer = pDoc->createTextNode(stringFevTwoPer);
- AutoPtr<Text> pTextFevThreePer = pDoc->createTextNode(stringFevThreePer);
- AutoPtr<Text> pTextRR = pDoc->createTextNode(stringRR);
- AutoPtr<Text> pTextFVC = pDoc->createTextNode(stringFVC);
- AutoPtr<Text> pTextPEF = pDoc->createTextNode(stringPEF);
- AutoPtr<Text> pTextTV = pDoc->createTextNode(stringTV);
- AutoPtr<Text> pTextVC = pDoc->createTextNode(stringVC);
- AutoPtr<Text> pTextMVV = pDoc->createTextNode(stringMVV);
- AutoPtr<Text> pTextMV = pDoc->createTextNode(stringMV);
- AutoPtr<Text> pTextVSTHeight = pDoc->createTextNode(stringVSTHeight);
- AutoPtr<Text> pTextVSMvvBsa = pDoc->createTextNode(stringVSMvvBsa);
- AutoPtr<Text> pTextVSMvvOne = pDoc->createTextNode(stringVSMvvOne);
- AutoPtr<Text> pTextSVC = pDoc->createTextNode(stringSVC);
- AutoPtr<Text> pTextFevOneZeroFive = pDoc->createTextNode(stringFevOneZeroFive);
- AutoPtr<Text> pTextFevOneZeroFivePer = pDoc->createTextNode(stringFevOneZeroFivePer);
- AutoPtr<Text> pTextPefOne = pDoc->createTextNode(stringPefOne);
- AutoPtr<Text> pTextPefTwo = pDoc->createTextNode(stringPefTwo);
- AutoPtr<Text> pTextPefThree = pDoc->createTextNode(stringPefThree);
- AutoPtr<Text> pTextFive = pDoc->createTextNode(stringFive);
- AutoPtr<Text> pTextFiveOne = pDoc->createTextNode(stringFiveOne);
- AutoPtr<Text> pTextFiveTwo = pDoc->createTextNode(stringFiveTwo);
- AutoPtr<Text> pTextFiveThree = pDoc->createTextNode(stringFiveThree);
- AutoPtr<Text> pTextPif = pDoc->createTextNode(stringPIF);
- AutoPtr<Text> pTextMifFifty = pDoc->createTextNode(stringMifFifty);
- AutoPtr<Text> pTextDetectionTime = pDoc->createTextNode(stringDetectionTime);
- AutoPtr<Text> pTextDetectionResutl = pDoc->createTextNode("");
- AutoPtr<Text> pTextEquCode = pDoc->createTextNode(stringEquCode);
- AutoPtr<Text> pTextId = pDoc->createTextNode("");
- AutoPtr<Text> pTextRoomId = pDoc->createTextNode(stringRoomId);
- pChildTimeStamp->appendChild(pTextTimeStamp);
- pChildAccessCode->appendChild(pTextAccessCode);
- pChildDiscernType->appendChild(pTextDiscernType);
- pChildDiscernData->appendChild(pTextDiscernData);
- pChildM_B1->appendChild(pTextM_B1);
- pChildBSA->appendChild(pTextBSA);
- pChildBSA1->appendChild(pTextBSA1);
- pChildMMF->appendChild(pTextMMF);
- pChildMefSeventyFive->appendChild(pTextMefSeventyFive);
- pChildMefFifty->appendChild(pTextMefFifty);
- pChildMefTwentyFive->appendChild(pTextMefTwentyFive);
- pChildMefFVST->appendChild(pTextMefFVST);
- pChildIC->appendChild(pTextIC);
- pChildIRV->appendChild(pTextIRV);
- pChildERV->appendChild(pTextERV);
- pChildFevOne->appendChild(pTextFevOne);
- pChildFevTwo->appendChild(pTextFevTwo);
- pChildFevThree->appendChild(pTextFevThree);
- pChildFevOnePer->appendChild(pTextFevOnePer);
- pChildFevTwoPer->appendChild(pTextFevTwoPer);
- pChildFevThreePer->appendChild(pTextFevThreePer);
- pChildRR->appendChild(pTextRR);
- pChildFVC->appendChild(pTextFVC);
- pChildPEF->appendChild(pTextPEF);
- pChildTV->appendChild(pTextTV);
- pChildVC->appendChild(pTextVC);
- pChildMVV->appendChild(pTextMVV);
- pChildMV->appendChild(pTextMV);
- pChildVSTHeight->appendChild(pTextVSTHeight);
- pChildVSMvvBsa->appendChild(pTextVSMvvBsa);
- pChildVSMvvOne->appendChild(pTextVSMvvOne);
- pChildSVC->appendChild(pTextSVC);
- pChildFevOneZeroFive->appendChild(pTextFevOneZeroFive);
- pChildFevOneZeroFivePer->appendChild(pTextFevOneZeroFivePer);
- pChildPefOne->appendChild(pTextPefOne);
- pChildPefTwo->appendChild(pTextPefTwo);
- pChildPefThree->appendChild(pTextPefThree);
- pChildFive->appendChild(pTextFive);
- pChildFiveOne->appendChild(pTextFiveOne);
- pChildFiveTwo->appendChild(pTextFiveTwo);
- pChildFiveThree->appendChild(pTextFiveThree);
- pChildPif->appendChild(pTextPif);
- pChildMifFifty->appendChild(pTextMifFifty);
- pChildDetectionTime->appendChild(pTextDetectionTime);
- pChildDetectionResult->appendChild(pTextDetectionResutl);
- pChildEquCode->appendChild(pTextEquCode);
- pChildId->appendChild(pTextId);
- pChildRoomId->appendChild(pTextRoomId);
- pRoot->appendChild(pChildTimeStamp);
- pRoot->appendChild(pChildAccessCode);
- pRoot->appendChild(pChildDiscernType);
- pRoot->appendChild(pChildDiscernData);
- pRoot->appendChild(pChildM_B1);
- pRoot->appendChild(pChildBSA);
- pRoot->appendChild(pChildBSA1);
- pRoot->appendChild(pChildMMF);
- pRoot->appendChild(pChildMefSeventyFive);
- pRoot->appendChild(pChildMefFifty);
- pRoot->appendChild(pChildMefTwentyFive);
- pRoot->appendChild(pChildMefFVST);
- pRoot->appendChild(pChildIC);
- pRoot->appendChild(pChildIRV);
- pRoot->appendChild(pChildERV);
- pRoot->appendChild(pChildFevOne);
- pRoot->appendChild(pChildFevTwo);
- pRoot->appendChild(pChildFevThree);
- pRoot->appendChild(pChildFevOnePer);
- pRoot->appendChild(pChildFevTwoPer);
- pRoot->appendChild(pChildFevThreePer);
- pRoot->appendChild(pChildRR);
- pRoot->appendChild(pChildFVC);
- pRoot->appendChild(pChildPEF);
- pRoot->appendChild(pChildTV);
- pRoot->appendChild(pChildVC);
- pRoot->appendChild(pChildMVV);
- pRoot->appendChild(pChildMV);
- pRoot->appendChild(pChildVSTHeight);
- pRoot->appendChild(pChildVSMvvBsa);
- pRoot->appendChild(pChildVSMvvOne);
- pRoot->appendChild(pChildSVC);
- pRoot->appendChild(pChildFevOneZeroFive);
- pRoot->appendChild(pChildFevOneZeroFivePer);
- pRoot->appendChild(pChildPefOne);
- pRoot->appendChild(pChildPefTwo);
- pRoot->appendChild(pChildPefThree);
- pRoot->appendChild(pChildFive);
- pRoot->appendChild(pChildFiveOne);
- pRoot->appendChild(pChildFiveTwo);
- pRoot->appendChild(pChildFiveThree);
- pRoot->appendChild(pChildPif);
- pRoot->appendChild(pChildMifFifty);
- pRoot->appendChild(pChildDetectionTime);
- pRoot->appendChild(pChildDetectionResult);
- pRoot->appendChild(pChildEquCode);
- pRoot->appendChild(pChildId);
- pRoot->appendChild(pChildRoomId);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXmlCommandType_Telecom(SYNC_LUNG);
- this->SetNetConfigType(TELECOM_XML);
- nRet = ExecuteXmlSession_Telecom(stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ECGUpload_Telecom(string stringPersonType, string stringPersonId, string stringDetectionTime, string stringEquCode, string stringRoomId, TELCOM_ECG ecgData)
- {
- DateTime dt;
- dt += Timespan(Timezone::utcOffset(), 0);
- string stringDateTime = DateTimeFormatter::format(dt, "%Y-%m-%d %H:%M:%S");
- AutoPtr<Document> pDoc = new Document;
- AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='utf-8'");
- AutoPtr<Element> pRoot = pDoc->createElement("root");
- AutoPtr<Element> pChildTimeStamp = pDoc->createElement("TimeStamp");
- AutoPtr<Element> pChildAccessCode = pDoc->createElement("AccessCode");
- AutoPtr<Element> pChildDiscernType = pDoc->createElement("UserDiscernType");
- AutoPtr<Element> pChildDiscernData = pDoc->createElement("UserDiscernData");
- AutoPtr<Element> pChildDetectionTime = pDoc->createElement("DetectionTime");
- AutoPtr<Element> pChildDetectionResult = pDoc->createElement("DetectionResult");
- AutoPtr<Element> pChildEquCode = pDoc->createElement("EquCode");
- AutoPtr<Element> pChildId = pDoc->createElement("Id");
- AutoPtr<Element> pChildRoomId = pDoc->createElement("RoomId");
- AutoPtr<Element> pChildEcgLeadType = pDoc->createElement("EcgLeadType");
- AutoPtr<Element> pChildEcgLeadList = pDoc->createElement("EcgLeadList");
- AutoPtr<Text> pTextTimeStamp = pDoc->createTextNode(stringDateTime);
- AutoPtr<Text> pTextAccessCode = pDoc->createTextNode("CONTEC");
- AutoPtr<Text> pTextDiscernType = 0;
- pTextDiscernType = pDoc->createTextNode(stringPersonType);
- // if(nCardType == 1)
- // {
- // pTextDiscernType = pDoc->createTextNode("01");
- // }
- // else
- // {
- // pTextDiscernType = pDoc->createTextNode("02");
- // }
- AutoPtr<Text> pTextDiscernData = pDoc->createTextNode(stringPersonId);
- AutoPtr<Text> pTextDetectionTime = pDoc->createTextNode(stringDetectionTime);
- AutoPtr<Text> pTextDetectionResutl = pDoc->createTextNode(ecgData.result1);
- AutoPtr<Text> pTextEquCode = pDoc->createTextNode(stringEquCode);
- AutoPtr<Text> pTextId = pDoc->createTextNode("");
- AutoPtr<Text> pTextRoomId = pDoc->createTextNode(stringRoomId);
- AutoPtr<Text> pTextEcgLeadType = pDoc->createTextNode("ECG1ECG2ECG3ECG4ECG5ECG6ECG7ECG8ECG9ECG10ECG11ECG12");
- pChildTimeStamp->appendChild(pTextTimeStamp);
- pChildAccessCode->appendChild(pTextAccessCode);
- pChildDiscernType->appendChild(pTextDiscernType);
- pChildDiscernData->appendChild(pTextDiscernData);
- pChildDetectionTime->appendChild(pTextDetectionTime);
- pChildDetectionResult->appendChild(pTextDetectionResutl);
- pChildEquCode->appendChild(pTextEquCode);
- pChildId->appendChild(pTextId);
- pChildRoomId->appendChild(pTextRoomId);
- pChildEcgLeadType->appendChild(pTextEcgLeadType);
- for(int i=1; i<=ecgData.nArrayLength; i++)
- {
- AutoPtr<Element> pGrandChildEcgLeadInfo = pDoc->createElement("EcgLeadInfo");
- AutoPtr<Element> pGrand2ChildLeadId = pDoc->createElement("LeadId");
- AutoPtr<Element> pGrand2ChildLeadType = pDoc->createElement("LeadType");
- AutoPtr<Element> pGrand2ChildLeadData = pDoc->createElement("LeadData");
- AutoPtr<Element> pGrand2ChildAdRate = pDoc->createElement("AdRate");
- AutoPtr<Element> pGrand2ChildAdAccuracy = pDoc->createElement("AdAccuracy");
- AutoPtr<Element> pGrand2ChildRangeMin = pDoc->createElement("RangeMin");
- AutoPtr<Element> pGrand2ChildRangeMax = pDoc->createElement("RangeMax");
- AutoPtr<Element> pGrand2ChildHeartValue = pDoc->createElement("HeartValue");
- AutoPtr<Element> pGrand2ChildStLevel = pDoc->createElement("StLevel");
- AutoPtr<Element> pGrand2ChildPrInterval = pDoc->createElement("PrInterval");
- AutoPtr<Element> pGrand2ChildQtInterval = pDoc->createElement("QtInterval");
- AutoPtr<Element> pGrand2ChildRrInterval = pDoc->createElement("RrInterval");
- AutoPtr<Element> pGrand2ChildPWave = pDoc->createElement("PWave");
- AutoPtr<Element> pGrand2ChildRWave = pDoc->createElement("RWave");
- AutoPtr<Element> pGrand2ChildTWave = pDoc->createElement("TWave");
- AutoPtr<Element> pGrand2ChildResult1 = pDoc->createElement("Result1");
- AutoPtr<Element> pGrand2ChildResult2 = pDoc->createElement("Result2");
- AutoPtr<Element> pGrand2ChildResult3 = pDoc->createElement("Result3");
- AutoPtr<Element> pGrand2ChildResult4 = pDoc->createElement("Result4");
- AutoPtr<Element> pGrand2ChildResult5 = pDoc->createElement("Result5");
- string stringLeadType = "ECG";
- stringLeadType += CUtil::ULongToString(i);
- string stringLeadId;
- stringLeadId = CUtil::GetMd5(stringLeadType.c_str(), stringLeadType.size());
-
- AutoPtr<Text> pTextLeadId = pDoc->createTextNode(stringLeadId.substr(0, 16));
- AutoPtr<Text> pTextLeadType = pDoc->createTextNode(stringLeadType);
- AutoPtr<Text> pTextLeadData = pDoc->createTextNode(ecgData.pArrayData[i-1]);
- AutoPtr<Text> pTextAdRate = pDoc->createTextNode(ecgData.adRate);
- AutoPtr<Text> pTextAdAccuracy = pDoc->createTextNode(ecgData.adAccuracy);
- AutoPtr<Text> pTextRangeMin = pDoc->createTextNode(ecgData.rangeMin);
- AutoPtr<Text> pTextRangeMax = pDoc->createTextNode(ecgData.rangeMax);
- AutoPtr<Text> pTextHeartValue = pDoc->createTextNode(ecgData.heartValue);
- AutoPtr<Text> pTextStLevel = pDoc->createTextNode(ecgData.stLevel);
- AutoPtr<Text> pTextPrInterval = pDoc->createTextNode(ecgData.prInterval);
- AutoPtr<Text> pTextQtInterval = pDoc->createTextNode(ecgData.qtInterval);
- AutoPtr<Text> pTextRrInterval = pDoc->createTextNode(ecgData.rrInterval);
- AutoPtr<Text> pTextPWave = pDoc->createTextNode(ecgData.pWave);
- AutoPtr<Text> pTextRWave = pDoc->createTextNode(ecgData.rWave);
- AutoPtr<Text> pTextTWave = pDoc->createTextNode(ecgData.tWave);
- AutoPtr<Text> pTextResult1 = pDoc->createTextNode(""/*ecgData.result1*/);
- AutoPtr<Text> pTextResult2 = pDoc->createTextNode(ecgData.result2);
- AutoPtr<Text> pTextResult3 = pDoc->createTextNode(ecgData.result3);
- AutoPtr<Text> pTextResult4 = pDoc->createTextNode(ecgData.result4);
- AutoPtr<Text> pTextResult5 = pDoc->createTextNode(ecgData.result5);
- pGrand2ChildLeadId->appendChild(pTextLeadId);
- pGrand2ChildLeadType->appendChild(pTextLeadType);
- pGrand2ChildLeadData->appendChild(pTextLeadData);
- pGrand2ChildAdRate->appendChild(pTextAdRate);
- pGrand2ChildAdAccuracy->appendChild(pTextAdAccuracy);
- pGrand2ChildRangeMin->appendChild(pTextRangeMin);
- pGrand2ChildRangeMax->appendChild(pTextRangeMax);
- pGrand2ChildHeartValue->appendChild(pTextHeartValue);
- pGrand2ChildStLevel->appendChild(pTextStLevel);
- pGrand2ChildPrInterval->appendChild(pTextPrInterval);
- pGrand2ChildQtInterval->appendChild(pTextQtInterval);
- pGrand2ChildRrInterval->appendChild(pTextRrInterval);
- pGrand2ChildPWave->appendChild(pTextPWave);
- pGrand2ChildRWave->appendChild(pTextRWave);
- pGrand2ChildTWave->appendChild(pTextTWave);
- pGrand2ChildResult1->appendChild(pTextResult1);
- pGrand2ChildResult2->appendChild(pTextResult2);
- pGrand2ChildResult3->appendChild(pTextResult3);
- pGrand2ChildResult4->appendChild(pTextResult4);
- pGrand2ChildResult5->appendChild(pTextResult5);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildLeadId);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildLeadType);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildLeadData);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildAdRate);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildAdAccuracy);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildRangeMin);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildRangeMax);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildHeartValue);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildStLevel);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildPrInterval);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildQtInterval);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildRrInterval);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildPWave);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildRWave);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildTWave);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildResult1);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildResult2);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildResult3);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildResult4);
- pGrandChildEcgLeadInfo->appendChild(pGrand2ChildResult5);
- pChildEcgLeadList->appendChild(pGrandChildEcgLeadInfo);
- }
- pRoot->appendChild(pChildTimeStamp);
- pRoot->appendChild(pChildAccessCode);
- pRoot->appendChild(pChildDiscernType);
- pRoot->appendChild(pChildDiscernData);
- pRoot->appendChild(pChildDetectionTime);
- pRoot->appendChild(pChildDetectionResult);
- pRoot->appendChild(pChildEquCode);
- pRoot->appendChild(pChildId);
- pRoot->appendChild(pChildRoomId);
- pRoot->appendChild(pChildEcgLeadType);
- pRoot->appendChild(pChildEcgLeadList);
- //pDoc->appendChild(pi);
- pDoc->appendChild(pRoot);
- string stringXmlContent;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent, true);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXmlCommandType_Telecom(SYNC_ECG);
- this->SetNetConfigType(TELECOM_XML);
- nRet = ExecuteXmlSession_Telecom(stringXmlContent);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetToken_XiKang()
- {
- string stringClientId;
- string stringClientSecret;
- if(CPhmsSession::m_stringClientId_XiKang.size()==0 || CPhmsSession::m_stringClientSecret_XiKang.size()==0)
- {
- string stringWorkingDir = CUtil::GetCurrentAppDir();
- string stringIniFilePath = stringWorkingDir+"PhmsConfig.ini";
- AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringIniFilePath, "gbk");
- stringClientId = iniFile->getString("XIKANG.ClientId", "");
- stringClientSecret = iniFile->getString("XIKANG.CliengSecret", "");
- }
- else
- {
- stringClientId = CPhmsSession::m_stringClientId_XiKang;
- stringClientSecret = CPhmsSession::m_stringClientSecret_XiKang;
- }
- map<string, string> mapParam;
- mapParam["grant_type"] = "client_credentials";
- mapParam["scope"] = "trust";
- mapParam["client_id"] = stringClientId;
- mapParam["client_secret"] = stringClientSecret;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- this->SetXiKangCommandType(GET_TOKEN_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- //处理token
- CPhmsSession::m_stringToken_XiKang = "";
- CPhmsSession::m_stringToken_XiKang = this->GetXiKangToken(m_nSaveType, m_stringContent, m_stringFilePath);
- if(m_stringToken_XiKang.size() == 0)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_GET_TOKEN_FAIL), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_GET_TOKEN_FAIL;
- }
- CPhmsSession::m_stringClientId_XiKang = stringClientId;
- CPhmsSession::m_stringClientSecret_XiKang = stringClientSecret;
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::Login_XiKang(string stringUsername, string stringPassword)
- {
- int nRet = PHMS_SUCCESSFUL_RESULT;
- if(CPhmsSession::m_stringToken_XiKang.size() == 0)
- {
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- map<string, string> mapParam;
- mapParam["userAccount"] = stringUsername;
- mapParam["password"] = stringPassword;
- this->SetXiKangCommandType(LOGIN_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- if(nRet == COMMON_URL_NOT_FOUND)
- {
- //token失效
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXiKangCommandType(LOGIN_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- else
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::RegisterPatientId_XiKang(string stringName, string stringSex, string stringPhoneNum, string stringProofNum)
- {
- int nRet = PHMS_SUCCESSFUL_RESULT;
- if(CPhmsSession::m_stringToken_XiKang.size() == 0)
- {
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- //网络库内部处理性别名称和生日
- string stringBirthday;
- string stringYear = stringProofNum.substr(6, 4);
- string stringMonth = stringProofNum.substr(10, 2);
- string stringDay = stringProofNum.substr(12, 2);
- stringBirthday = stringYear+"-"+stringMonth+"-"+stringDay+"T08:00:00";
- string stringSexName;
- if(stringSex == "1")
- {
- stringSexName = "男";
- }
- else if(stringSex == "2")
- {
- stringSexName = "女";
- }
- else
- {
- stringSexName = "未知";
- }
- map<string, string> mapParam;
- map<string, string> mapJson;
- string stringJson;
- mapJson["personName"] = stringName;
- mapJson["genderCode"] = stringSex;
- mapJson["genderName"] = stringSexName;
- mapJson["birthday"] = stringBirthday;
- mapJson["mobileNum"] = stringPhoneNum;
- mapJson["proofCode"] = "01";
- mapJson["proofNum"] = stringProofNum;
- stringJson = CUtil::MapToJson(mapJson);
- mapParam["memberBean"] = stringJson;
- this->SetXiKangCommandType(REGISTER_PATIENT_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- if(nRet == COMMON_URL_NOT_FOUND)
- {
- //token失效
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXiKangCommandType(REGISTER_PATIENT_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- else
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::RegisterPatientInfo_XiKang(string stringPatientOpenId, string stringName, string stringSex, string stringPhoneNum, string stringProofNum, string stringPassword)
- {
- int nRet = PHMS_SUCCESSFUL_RESULT;
- if(CPhmsSession::m_stringToken_XiKang.size() == 0)
- {
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- map<string, string> mapParam;
- map<string, string> mapJson;
- string stringJson;
- mapJson["personPHRCode"] = stringPatientOpenId;
- mapJson["memberCode"] = stringPatientOpenId;
- mapJson["userFullName"] = stringName;
- //mapJson["genderCode"] = stringSex;
- mapJson["mobileNum"] = stringPhoneNum;
- mapJson["userType"] = "0";
- //mapJson["proofCode"] = "01";
- mapJson["proofNum"] = stringProofNum;
- mapJson["userPassword"] = stringPassword;
- stringJson = CUtil::MapToJson(mapJson);
- mapParam["ManagerAccount"] = stringJson;
- this->SetXiKangCommandType(REGISTER_PATIENT_INFO_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", stringPatientOpenId);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- if(nRet == COMMON_URL_NOT_FOUND)
- {
- //token失效
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXiKangCommandType(REGISTER_PATIENT_INFO_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", stringPatientOpenId);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- else
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::BindPatient_XiKang(string stringDoctorOpenId, string stringPatientOpenId)
- {
- int nRet = PHMS_SUCCESSFUL_RESULT;
- if(CPhmsSession::m_stringToken_XiKang.size() == 0)
- {
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- map<string, string> mapParam;
- map<string, string> mapJson;
- string stringJson;
- mapJson["caregiverCode"] = stringDoctorOpenId;
- mapJson["memberCode"] = stringPatientOpenId;
- stringJson = CUtil::MapToJson(mapJson);
- mapParam["memberCaregiverBean"] = stringJson;
- this->SetXiKangCommandType(BIND_PATIENT_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- if(nRet == COMMON_URL_NOT_FOUND)
- {
- //token失效
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXiKangCommandType(BIND_PATIENT_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- else
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetPatientIdList_XiKang(string stringDoctorOpenId)
- {
- int nRet = PHMS_SUCCESSFUL_RESULT;
- if(CPhmsSession::m_stringToken_XiKang.size() == 0)
- {
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- map<string, string> mapParam;
- mapParam["caregiverCode"] = stringDoctorOpenId;
- mapParam["firstResult"] = "-1";
- mapParam["pageSize"] = "5000";
- this->SetXiKangCommandType(GET_PATIENT_ID_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- if(nRet == COMMON_URL_NOT_FOUND)
- {
- //token失效
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXiKangCommandType(GET_PATIENT_ID_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- else
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetPatientInfo_XiKang(string stringPatientOpenId)
- {
- int nRet = PHMS_SUCCESSFUL_RESULT;
- if(CPhmsSession::m_stringToken_XiKang.size() == 0)
- {
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- map<string, string> mapParam;
- //mapParam["openID"] = stringPatientOpenId;
- this->SetXiKangCommandType(GET_PATIENT_INFO_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", stringPatientOpenId);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- if(nRet == COMMON_URL_NOT_FOUND)
- {
- //token失效
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXiKangCommandType(GET_PATIENT_INFO_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", stringPatientOpenId);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- else
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::SearchPatientId_XiKang(string stringKey, string stringValue)
- {
- int nRet = PHMS_SUCCESSFUL_RESULT;
- if(CPhmsSession::m_stringToken_XiKang.size() == 0)
- {
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- map<string, string> mapParam;
- mapParam["queryItem"] = stringKey;
- mapParam["queryValue"] = stringValue;
- this->SetXiKangCommandType(SEARCH_PATIENT_ID_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- if(nRet == COMMON_URL_NOT_FOUND)
- {
- //token失效
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXiKangCommandType(SEARCH_PATIENT_ID_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- else
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetCaseList_XiKang(vector<string> vPatientOpenId)
- {
- int nRet = PHMS_SUCCESSFUL_RESULT;
- if(CPhmsSession::m_stringToken_XiKang.size() == 0)
- {
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- map<string, string> mapParam;
- map<string, string> mapJson;
- string stringParamValue;
- vector<string>::iterator iter = vPatientOpenId.begin();
- int i = 0;
- for(iter; iter!=vPatientOpenId.end(); iter++)
- {
- stringParamValue += *iter;
- i++;
- if(i != vPatientOpenId.size())
- {
- stringParamValue += ",";
- }
- }
- mapJson["memberCodes"] = stringParamValue;
- mapJson["states"] = "0,1,2,3";
- mapJson["startDate"] = "0";
- mapJson["endDate"] = "0";
- string stringJson = CUtil::MapToJson(mapJson);
- mapParam["FindDetailByMemberCodes"] = stringJson;
- this->SetXiKangCommandType(GET_CASE_LIST_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- if(nRet == COMMON_URL_NOT_FOUND)
- {
- //token失效
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXiKangCommandType(GET_CASE_LIST_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- else
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::SubmitCase_XiKang(string stringPatientOpenId, string stringAdvice, string stringCaseType, string stringEcgXmlContent)
- {
- int nRet = PHMS_SUCCESSFUL_RESULT;
- if(CPhmsSession::m_stringToken_XiKang.size() == 0)
- {
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- map<string, string> mapParam;
- map<string, string> mapJson;
- mapJson["memberCode"] = stringPatientOpenId;
- mapJson["advice"] = stringAdvice;
- mapJson["cnstType"] = stringCaseType;
- DateTime dt;
- //dt += Timespan(Timezone::utcOffset(), 0);
- mapJson["testTime"] = CUtil::Int64ToString(dt.timestamp().epochMicroseconds()/1000);
- ostringstream ostr;
- Base64Encoder encoderBase64(ostr);
- encoderBase64<<stringEcgXmlContent;
- encoderBase64.close();
- string stringBase64Content = ostr.str();
- CUtil::ReplaceString(stringBase64Content, "*", "+");
- mapJson["fileContent"] = stringBase64Content;
- string stringJson = CUtil::MapToJson(mapJson);
- mapParam["AddEcgInfo"] = stringJson;
- this->SetXiKangCommandType(SUBMIT_CASE_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- if(nRet == COMMON_URL_NOT_FOUND)
- {
- //token失效
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXiKangCommandType(SUBMIT_CASE_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- else
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::GetReportFile_XiKang(string stringCaseId)
- {
- int nRet = PHMS_SUCCESSFUL_RESULT;
- if(CPhmsSession::m_stringToken_XiKang.size() == 0)
- {
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- map<string, string> mapParam;
- this->SetXiKangCommandType(GET_REPORT_URL_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", stringCaseId);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- if(nRet == COMMON_URL_NOT_FOUND)
- {
- //token失效
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXiKangCommandType(GET_REPORT_URL_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, "", stringCaseId);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- else
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::UploadFile_XiKang(string stringCaseId, string stringCaseFilePath)
- {
- int nRet = PHMS_SUCCESSFUL_RESULT;
- if(CPhmsSession::m_stringToken_XiKang.size() == 0)
- {
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- map<string, string> mapParam;
- mapParam["ecgId"] = stringCaseId;
- mapParam["authority"] = "contec";
- this->SetXiKangCommandType(UPLOAD_FILE_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, stringCaseFilePath, "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- if(nRet == COMMON_URL_NOT_FOUND)
- {
- //token失效
- nRet = this->GetToken_XiKang();
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- this->SetXiKangCommandType(UPLOAD_FILE_XIKANG);
- this->SetNetConfigType(XIKANG_FORM);
- nRet = ExecuteXiKangSession(mapParam, stringCaseFilePath, "");
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- else
- {
- //写日志
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ExecuteGWService(string stringLastPath, map<string, string> mapParam, string stringFilePath, bool bMustSsl)
- {
- CNetConfig netConfig;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- //设置网络环境
- try
- {
- string stringWorkingDir = CUtil::GetCurrentAppDir();
- EnumNetConfigType enumNetConfigType = GW_FORM;
- nRet = this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl, enumNetConfigType);
- netConfig.SetUrl(netConfig.GetUrl()+stringLastPath);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
- if(bMustSsl)
- {
- if(!m_bSsl)
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(bMustSsl);
- m_bSsl = bMustSsl;
- }
- }
- else
- {
- if(m_bSsl != netConfig.GetSsl())
- {
- delete m_pHttpSession;
- m_pHttpSession = new CHttpSession(netConfig.GetSsl());
- m_bSsl = netConfig.GetSsl();
- }
- }
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_NO_NET_CONFIG_FILE;
- }
- istream* pInputStream = NULL;
- nRet = m_pHttpSession->ExecuteFormHttpSession(netConfig, mapParam, stringFilePath, pInputStream);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = NoPhmsGetResult(pInputStream);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
- int CPhmsSession::ExecuteCommonRESTful(string stringIp, string stringPort, string stringUrl, string stringContentType, string stringPayload)
- {
- CNetConfig netConfig;
- int nRet = PHMS_SUCCESSFUL_RESULT;
- //设置网络环境
- try
- {
- netConfig.SetHost(stringIp);
- netConfig.SetAddr(stringIp);
- if(stringPort.size() == 0)
- {
- netConfig.SetPort(80);
- }
- else
- {
- netConfig.SetPort(CUtil::StringToULong(stringPort));
- }
- netConfig.SetUrl(stringUrl);
- netConfig.SetProxyType(NO_PROXY);
- netConfig.SetSsl(false);
- }
- catch(FileNotFoundException& e)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
- return COMMON_NO_NET_CONFIG_FILE;
- }
- istream* pInputStream = NULL;
- map<string, string> mapParam;
- nRet = m_pHttpSession->ExeceteCommonPostSession(netConfig, mapParam, stringContentType, stringPayload, pInputStream);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- nRet = NoPhmsGetResult(pInputStream);
- if(nRet != PHMS_SUCCESSFUL_RESULT)
- {
- CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
- return nRet;
- }
- return PHMS_SUCCESSFUL_RESULT;
- }
|