PhmsSession.cpp 539 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844
  1. #include "PhmsSession.h"
  2. #include "Poco/DOM/Document.h"
  3. #include "Poco/DOM/Text.h"
  4. #include "Poco/DOM/Element.h"
  5. #include "Poco/DOM/ProcessingInstruction.h"
  6. #include "Poco/DOM/DOMWriter.h"
  7. #include "Poco/ASCIIEncoding.h"
  8. #include "Poco/DOM/DOMParser.h"
  9. #include "Poco/DOM/NodeIterator.h"
  10. #include "Poco/SAX/InputSource.h"
  11. #include "Poco/DOM/Node.h"
  12. #include "Poco/DOM/NodeFilter.h"
  13. #include "ErrorCode.h"
  14. #include "Poco/Exception.h"
  15. #include "Poco/XML/XMLWriter.h"
  16. #include "Poco/Util/IniFileConfiguration.h"
  17. #include "Poco/AutoPtr.h"
  18. #include "Poco/Base64Encoder.h"
  19. #include "Poco/ASCIIEncoding.h"
  20. #include "Poco/UTF8Encoding.h"
  21. #include "Poco/TextConverter.h"
  22. #include "Poco/TextEncoding.h"
  23. #include "Poco/GBKEncoding.h"
  24. #include "Poco/KOI8REncoding.h"
  25. #include "Poco/StreamCopier.h"
  26. #include "Poco/File.h"
  27. #include "Poco/Crypto/Cipher.h"
  28. #include "Poco/Crypto/CipherFactory.h"
  29. #include "Poco/Crypto/CipherKey.h"
  30. #include "Poco/DateTime.h"
  31. #include "Poco/DateTimeFormatter.h"
  32. #include "Poco/Timestamp.h"
  33. #include "Poco/Timezone.h"
  34. #include "Poco/Timespan.h"
  35. #include "Poco/URI.h"
  36. #include <sstream>
  37. #include <fstream>
  38. #include "Util.h"
  39. #include "PhmsLogger.h"
  40. #include "SessionIdManager.h"
  41. #include "AllObjectManagerUtil.h"
  42. #include "json/json.h"
  43. #include "json/value.h"
  44. #include "json/writer.h"
  45. #include "GlobalTerminalLogoString.h"
  46. using Poco::XML::Document;
  47. using Poco::XML::Text;
  48. using Poco::XML::Element;
  49. using Poco::XML::ProcessingInstruction;
  50. using Poco::XML::DOMWriter;
  51. using Poco::ASCIIEncoding;
  52. using Poco::XML::DOMParser;
  53. using Poco::XML::NodeIterator;
  54. using Poco::XML::InputSource;
  55. using Poco::XML::Node;
  56. using Poco::XML::NodeFilter;
  57. using Poco::Exception;
  58. using Poco::TimeoutException;
  59. using Poco::FileNotFoundException;
  60. using Poco::XML::XMLWriter;
  61. using Poco::Util::IniFileConfiguration;
  62. using Poco::AutoPtr;
  63. using Poco::Base64Encoder;
  64. using Poco::TextConverter;
  65. using Poco::ASCIIEncoding;
  66. using Poco::UTF8Encoding;
  67. using Poco::StreamCopier;
  68. using Poco::TextEncoding;
  69. using Poco::GBKEncoding;
  70. using Poco::KOI8REncoding;
  71. using Poco::File;
  72. using Poco::Crypto::Cipher;
  73. using Poco::Crypto::CipherFactory;
  74. using Poco::Crypto::CipherKey;
  75. using Poco::DateTime;
  76. using Poco::DateTimeFormatter;
  77. using Poco::Timestamp;
  78. using Poco::Timezone;
  79. using Poco::Timespan;
  80. using Poco::URI;
  81. string CPhmsSession::m_stringKey = "5b1b25bf9447a5002ca129a7f9523459";
  82. string CPhmsSession::m_stringToken_XiKang = "";
  83. string CPhmsSession::m_stringClientId_XiKang = "";
  84. string CPhmsSession::m_stringClientSecret_XiKang = "";
  85. string CPhmsSession::m_stringGWSecretKey = "";
  86. CPhmsSession::CPhmsSession(void):m_nSaveType(0), m_enumPhmsCommandType(MAIN_TYPE), m_bUseIp(false), m_enumNetConfigType(ORIGINAL_PHMS)
  87. {
  88. //获得ssl环境
  89. {
  90. string stringWorkingDir = CUtil::GetCurrentAppDir();
  91. CNetConfig netConfig;
  92. this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, false);
  93. m_bSsl = netConfig.GetSsl();
  94. }
  95. m_pHttpSession = new CHttpSession(m_bSsl);
  96. }
  97. CPhmsSession::~CPhmsSession(void)
  98. {
  99. delete m_pHttpSession;
  100. }
  101. //Setter
  102. void CPhmsSession::SetSaveType(int nSaveType)
  103. {
  104. m_nSaveType = nSaveType;
  105. }
  106. void CPhmsSession::SetFilePath(string stringFilePath)
  107. {
  108. m_stringFilePath = stringFilePath;
  109. }
  110. void CPhmsSession::SetSessionId(string stringSessionId)
  111. {
  112. m_stringSessionId = stringSessionId;
  113. }
  114. void CPhmsSession::SetGWSessionId(string stringSessionId)
  115. {
  116. m_stringGWSessionId = stringSessionId;
  117. }
  118. void CPhmsSession::SetCommandType(EnumPhmsCommandType enumCommandType)
  119. {
  120. m_enumPhmsCommandType = enumCommandType;
  121. }
  122. void CPhmsSession::SetXmlCommandType(EnumXmlCommandType enumXmlCommandType)
  123. {
  124. m_enumXmlCommandType = enumXmlCommandType;
  125. }
  126. void CPhmsSession::SetXmlCommandType_Telecom(EnumXmlCommandType_Telecom enumXmlCommandType_Telecom)
  127. {
  128. m_enumXmlCommandType_Telecom = enumXmlCommandType_Telecom;
  129. }
  130. void CPhmsSession::SetXinJieCommandType(EnumXinJieCommandType enumXinJieCommandType)
  131. {
  132. m_enumXinJieCommandType = enumXinJieCommandType;
  133. }
  134. void CPhmsSession::SetGuanXinCommandType(EnumGuanXinCommandType enumGuanXinCommandType)
  135. {
  136. m_enumGuanXinCommandType = enumGuanXinCommandType;
  137. }
  138. void CPhmsSession::SetXiKangCommandType(EnumXiKangCommandType enumXiKangCommandType)
  139. {
  140. m_enumXiKangCommandType = enumXiKangCommandType;
  141. }
  142. void CPhmsSession::SetNetConfigType(EnumNetConfigType enumNetConfigType)
  143. {
  144. m_enumNetConfigType = enumNetConfigType;
  145. }
  146. void CPhmsSession::SetUseIp(bool bUseIp)
  147. {
  148. m_bUseIp = bUseIp;
  149. }
  150. void CPhmsSession::SetGWSecretKey(string stringGWSecretKey)
  151. {
  152. CPhmsSession::m_stringGWSecretKey = stringGWSecretKey;
  153. }
  154. //Getter
  155. int CPhmsSession::GetSaveType()
  156. {
  157. return m_nSaveType;
  158. }
  159. string CPhmsSession::GetContent()
  160. {
  161. return m_stringContent;
  162. }
  163. string CPhmsSession::GetSessionId()
  164. {
  165. return m_stringSessionId;
  166. }
  167. string CPhmsSession::GetGWSessionId()
  168. {
  169. return m_stringGWSessionId;
  170. }
  171. EnumPhmsCommandType CPhmsSession::GetCommandType()
  172. {
  173. return m_enumPhmsCommandType;
  174. }
  175. EnumXmlCommandType CPhmsSession::GetXmlCommandType()
  176. {
  177. return m_enumXmlCommandType;
  178. }
  179. EnumXmlCommandType_Telecom CPhmsSession::GetXmlCommandType_Telecom()
  180. {
  181. return m_enumXmlCommandType_Telecom;
  182. }
  183. EnumXinJieCommandType CPhmsSession::GetXinJieCommandType()
  184. {
  185. return m_enumXinJieCommandType;
  186. }
  187. EnumGuanXinCommandType CPhmsSession::GetGuanXinCommandType()
  188. {
  189. return m_enumGuanXinCommandType;
  190. }
  191. EnumNetConfigType CPhmsSession::GetNetConfigType()
  192. {
  193. return m_enumNetConfigType;
  194. }
  195. string CPhmsSession::GetIp()
  196. {
  197. return m_stringIp;
  198. }
  199. string CPhmsSession::GetGWSecretKey()
  200. {
  201. return CPhmsSession::m_stringGWSecretKey;
  202. }
  203. //private member function
  204. int CPhmsSession::ExecutePhmsSession(CPhmsRequest& phmsRequest, CPhmsResponse& phmsResponse, bool bMustSsl)
  205. {
  206. CNetConfig netConfig;
  207. int nRet = PHMS_SUCCESSFUL_RESULT;
  208. //设置网络环境
  209. try
  210. {
  211. string stringWorkingDir = CUtil::GetCurrentAppDir();
  212. EnumNetConfigType enumNetConfigType = this->GetNetConfigType();
  213. nRet = this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl, enumNetConfigType);
  214. //nRet = this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl);
  215. if(nRet != PHMS_SUCCESSFUL_RESULT)
  216. {
  217. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  218. return nRet;
  219. }
  220. Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
  221. if(bMustSsl)
  222. {
  223. if(!m_bSsl)
  224. {
  225. delete m_pHttpSession;
  226. m_pHttpSession = new CHttpSession(bMustSsl);
  227. m_bSsl = bMustSsl;
  228. }
  229. }
  230. else
  231. {
  232. if(m_bSsl != netConfig.GetSsl())
  233. {
  234. delete m_pHttpSession;
  235. m_pHttpSession = new CHttpSession(netConfig.GetSsl());
  236. m_bSsl = netConfig.GetSsl();
  237. }
  238. }
  239. }
  240. catch(FileNotFoundException& e)
  241. {
  242. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  243. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  244. return COMMON_NO_NET_CONFIG_FILE;
  245. }
  246. istream* pInputStream = NULL;
  247. if(!phmsRequest.ValidataPhmsRequest())
  248. {
  249. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_PHMS_REQUEST_VALIDATE_FAIL), __FUNCTION__, __FILE__, __LINE__);
  250. return COMMON_PHMS_REQUEST_VALIDATE_FAIL;
  251. }
  252. nRet = m_pHttpSession->ExecuteHttpSession(netConfig, phmsRequest, pInputStream);
  253. if(nRet != PHMS_SUCCESSFUL_RESULT)
  254. {
  255. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  256. return nRet;
  257. }
  258. m_stringIp = netConfig.GetIp();
  259. nRet = phmsResponse.SetPhmsResponse(pInputStream, this);
  260. if(nRet != PHMS_SUCCESSFUL_RESULT)
  261. {
  262. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  263. return nRet;
  264. }
  265. return PHMS_SUCCESSFUL_RESULT;
  266. }
  267. int CPhmsSession::ExecuteXmlSession(string stringXmlContent, bool bMustSsl)
  268. {
  269. CNetConfig netConfig;
  270. int nRet = PHMS_SUCCESSFUL_RESULT;
  271. //设置网络环境
  272. try
  273. {
  274. string stringWorkingDir = CUtil::GetCurrentAppDir();
  275. EnumNetConfigType enumNetConfigType = this->GetNetConfigType();
  276. nRet = this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl, enumNetConfigType);
  277. //nRet = this->GetXmlNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl);
  278. if(nRet != PHMS_SUCCESSFUL_RESULT)
  279. {
  280. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  281. return nRet;
  282. }
  283. Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
  284. if(bMustSsl)
  285. {
  286. if(!m_bSsl)
  287. {
  288. delete m_pHttpSession;
  289. m_pHttpSession = new CHttpSession(bMustSsl);
  290. m_bSsl = bMustSsl;
  291. }
  292. }
  293. else
  294. {
  295. if(m_bSsl != netConfig.GetSsl())
  296. {
  297. delete m_pHttpSession;
  298. m_pHttpSession = new CHttpSession(netConfig.GetSsl());
  299. m_bSsl = netConfig.GetSsl();
  300. }
  301. }
  302. }
  303. catch(FileNotFoundException& e)
  304. {
  305. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  306. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  307. return COMMON_NO_NET_CONFIG_FILE;
  308. }
  309. istream* pInputStream = NULL;
  310. nRet = m_pHttpSession->ExecuteXmlHttpSession(netConfig, stringXmlContent, pInputStream);
  311. if(nRet != PHMS_SUCCESSFUL_RESULT)
  312. {
  313. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  314. return nRet;
  315. }
  316. nRet = NoPhmsGetResult(pInputStream);
  317. if(nRet != PHMS_SUCCESSFUL_RESULT)
  318. {
  319. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  320. return nRet;
  321. }
  322. return PHMS_SUCCESSFUL_RESULT;
  323. }
  324. int CPhmsSession::ExecuteXmlSession_Telecom(string stringXmlContent, bool bMustSsl)
  325. {
  326. CNetConfig netConfig;
  327. int nRet = PHMS_SUCCESSFUL_RESULT;
  328. //设置网络环境
  329. try
  330. {
  331. string stringWorkingDir = CUtil::GetCurrentAppDir();
  332. EnumNetConfigType enumNetConfigType = this->GetNetConfigType();
  333. nRet = this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl, enumNetConfigType);
  334. //nRet = this->GetXmlNetConfig_Telecom(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl);
  335. if(nRet != PHMS_SUCCESSFUL_RESULT)
  336. {
  337. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  338. return nRet;
  339. }
  340. Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
  341. if(bMustSsl)
  342. {
  343. if(!m_bSsl)
  344. {
  345. delete m_pHttpSession;
  346. m_pHttpSession = new CHttpSession(bMustSsl);
  347. m_bSsl = bMustSsl;
  348. }
  349. }
  350. else
  351. {
  352. if(m_bSsl != netConfig.GetSsl())
  353. {
  354. delete m_pHttpSession;
  355. m_pHttpSession = new CHttpSession(netConfig.GetSsl());
  356. m_bSsl = netConfig.GetSsl();
  357. }
  358. }
  359. }
  360. catch(FileNotFoundException& e)
  361. {
  362. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  363. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  364. return COMMON_NO_NET_CONFIG_FILE;
  365. }
  366. istream* pInputStream = NULL;
  367. //nRet = m_pHttpSession->ExecuteXmlHttpSession(netConfig, stringXmlContent, pInputStream);
  368. map<string, string> mapParam;
  369. mapParam["requestXML"] = stringXmlContent;
  370. nRet = m_pHttpSession->ExecuteFormHttpSession(netConfig, mapParam, pInputStream);
  371. if(nRet != PHMS_SUCCESSFUL_RESULT)
  372. {
  373. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  374. return nRet;
  375. }
  376. nRet = NoPhmsGetResult(pInputStream);
  377. if(nRet != PHMS_SUCCESSFUL_RESULT)
  378. {
  379. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  380. return nRet;
  381. }
  382. return PHMS_SUCCESSFUL_RESULT;
  383. }
  384. int CPhmsSession::ExecuteGuanXinSession(map<string, string> mapParam, string stringDataPath, bool bMustSsl)
  385. {
  386. CNetConfig netConfig;
  387. int nRet = PHMS_SUCCESSFUL_RESULT;
  388. //设置网络环境
  389. try
  390. {
  391. string stringWorkingDir = CUtil::GetCurrentAppDir();
  392. EnumNetConfigType enumNetConfigType = this->GetNetConfigType();
  393. nRet = this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl, enumNetConfigType);
  394. //nRet = this->GetGuanXinNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl);
  395. if(nRet != PHMS_SUCCESSFUL_RESULT)
  396. {
  397. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  398. return nRet;
  399. }
  400. Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
  401. if(bMustSsl)
  402. {
  403. if(!m_bSsl)
  404. {
  405. delete m_pHttpSession;
  406. m_pHttpSession = new CHttpSession(bMustSsl);
  407. m_bSsl = bMustSsl;
  408. }
  409. }
  410. else
  411. {
  412. if(m_bSsl != netConfig.GetSsl())
  413. {
  414. delete m_pHttpSession;
  415. m_pHttpSession = new CHttpSession(netConfig.GetSsl());
  416. m_bSsl = netConfig.GetSsl();
  417. }
  418. }
  419. }
  420. catch(FileNotFoundException& e)
  421. {
  422. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  423. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  424. return COMMON_NO_NET_CONFIG_FILE;
  425. }
  426. istream* pInputStream = NULL;
  427. // if(m_enumGuanXinCommandType == ACCESSTOKEN)
  428. // {
  429. // string stringUrl = netConfig.GetUrl();
  430. // //有时间改成map遍历,赶时间,先凑合着
  431. // stringUrl += "?grant_type=password&username=";
  432. // stringUrl += mapParam["username"];
  433. // stringUrl += "&password=";
  434. // stringUrl += mapParam["password"];
  435. // netConfig.SetUrl(stringUrl);
  436. // nRet = m_pHttpSession->ExecuteNoPhmsHttpSession(netConfig, pInputStream, false, m_stringFilePath);
  437. // }
  438. // else
  439. // {
  440. // nRet = m_pHttpSession->ExecuteFormHttpSession(netConfig, mapParam, pInputStream);
  441. // }
  442. nRet = m_pHttpSession->ExecuteFormHttpSession(netConfig, mapParam, stringDataPath, pInputStream);
  443. if(nRet != PHMS_SUCCESSFUL_RESULT)
  444. {
  445. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  446. return nRet;
  447. }
  448. nRet = NoPhmsGetResult(pInputStream);
  449. if(nRet != PHMS_SUCCESSFUL_RESULT)
  450. {
  451. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  452. return nRet;
  453. }
  454. return PHMS_SUCCESSFUL_RESULT;
  455. }
  456. int CPhmsSession::ExecuteXiKangSession(map<string, string> mapParam, string stringDataPath, string stringUrlOpenId, bool bMustSsl)
  457. {
  458. CNetConfig netConfig;
  459. int nRet = PHMS_SUCCESSFUL_RESULT;
  460. //设置网络环境
  461. try
  462. {
  463. string stringWorkingDir = CUtil::GetCurrentAppDir();
  464. EnumNetConfigType enumNetConfigType = this->GetNetConfigType();
  465. nRet = this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl, enumNetConfigType);
  466. //nRet = this->GetXiKangNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl);
  467. if(nRet != PHMS_SUCCESSFUL_RESULT)
  468. {
  469. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  470. return nRet;
  471. }
  472. if(netConfig.GetUrl().find("{openID}") != string::npos)
  473. {
  474. string stringUrl = netConfig.GetUrl();
  475. if(stringUrlOpenId.size() != 0)
  476. {
  477. CUtil::ReplaceString(stringUrl, "{openID}", stringUrlOpenId);
  478. netConfig.SetUrl(stringUrl);
  479. }
  480. else
  481. {
  482. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_XIKANG_URL_OPENID_NULL), __FUNCTION__, __FILE__, __LINE__);
  483. return COMMON_XIKANG_URL_OPENID_NULL;
  484. }
  485. }
  486. if(netConfig.GetUrl().find("{ecgID}") != string::npos)
  487. {
  488. string stringUrl = netConfig.GetUrl();
  489. if(stringUrlOpenId.size() != 0)
  490. {
  491. CUtil::ReplaceString(stringUrl, "{ecgID}", stringUrlOpenId);
  492. netConfig.SetUrl(stringUrl);
  493. }
  494. else
  495. {
  496. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_XIKANG_URL_OPENID_NULL), __FUNCTION__, __FILE__, __LINE__);
  497. return COMMON_XIKANG_URL_OPENID_NULL;
  498. }
  499. }
  500. Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
  501. if(bMustSsl)
  502. {
  503. if(!m_bSsl)
  504. {
  505. delete m_pHttpSession;
  506. m_pHttpSession = new CHttpSession(bMustSsl);
  507. m_bSsl = bMustSsl;
  508. }
  509. }
  510. else
  511. {
  512. if(m_bSsl != netConfig.GetSsl())
  513. {
  514. delete m_pHttpSession;
  515. m_pHttpSession = new CHttpSession(netConfig.GetSsl());
  516. m_bSsl = netConfig.GetSsl();
  517. }
  518. }
  519. }
  520. catch(FileNotFoundException& e)
  521. {
  522. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  523. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  524. return COMMON_NO_NET_CONFIG_FILE;
  525. }
  526. istream* pInputStream = NULL;
  527. string stringHttpBody;
  528. //所有向熙康提交的数据全部转为utf-8编码
  529. map<string, string>::iterator iterA = mapParam.begin();
  530. for(iterA; iterA!=mapParam.end(); iterA++)
  531. {
  532. string stringUtf8Value;
  533. CUtil::GBKToUTF8(iterA->second, stringUtf8Value);
  534. if(m_enumXiKangCommandType == SEARCH_PATIENT_ID_XIKANG)
  535. {
  536. string stringEncodeUtf8Value;
  537. URI::encode(stringUtf8Value, "", stringEncodeUtf8Value);
  538. stringUtf8Value = stringEncodeUtf8Value;
  539. }
  540. mapParam[iterA->first] = stringUtf8Value;
  541. }
  542. //使用token,处理参数
  543. if(m_enumXiKangCommandType != GET_TOKEN_XIKANG)
  544. {
  545. if(m_enumXiKangCommandType!=LOGIN_XIKANG && m_enumXiKangCommandType!=GET_PATIENT_ID_XIKANG &&
  546. m_enumXiKangCommandType!=GET_PATIENT_INFO_XIKANG && m_enumXiKangCommandType!=SEARCH_PATIENT_ID_XIKANG &&
  547. /*m_enumXiKangCommandType!=GET_CASE_LIST_XIKANG && m_enumXiKangCommandType!=SUBMIT_CASE_XIKANG && */
  548. m_enumXiKangCommandType!=UPLOAD_FILE_XIKANG && m_enumXiKangCommandType!=GET_REPORT_URL_XIKANG)
  549. {
  550. map<string, string>::iterator iter = mapParam.begin();
  551. stringHttpBody = iter->second;
  552. mapParam.clear();
  553. }
  554. DateTime dt;
  555. //dt += Timespan(Timezone::utcOffset(), 0);
  556. mapParam["time"] = CUtil::Int64ToString(dt.timestamp().epochMicroseconds());
  557. mapParam["access_token"] = m_stringToken_XiKang;
  558. string stringParamString;
  559. string stringMd5;
  560. map<string, string>::iterator iter = mapParam.begin();
  561. for(iter; iter!=mapParam.end(); iter++)
  562. {
  563. stringParamString += iter->first;
  564. stringParamString += "=";
  565. if(m_enumXiKangCommandType == SEARCH_PATIENT_ID_XIKANG)
  566. {
  567. string stringDecodeUtf8Value;
  568. URI::decode(iter->second, stringDecodeUtf8Value);
  569. stringParamString += stringDecodeUtf8Value;
  570. }
  571. else
  572. {
  573. stringParamString += iter->second;
  574. }
  575. }
  576. stringParamString += CPhmsSession::m_stringClientSecret_XiKang;
  577. stringMd5 = CUtil::GetMd5(stringParamString.c_str(), stringParamString.size());
  578. std::transform(stringMd5.begin(), stringMd5.end(), stringMd5.begin(),::tolower);
  579. mapParam["sign"] = stringMd5;
  580. }
  581. //不同的m_enumXiKangCommandType,区分get和post
  582. if(m_enumXiKangCommandType==LOGIN_XIKANG || m_enumXiKangCommandType==GET_PATIENT_ID_XIKANG ||
  583. m_enumXiKangCommandType==GET_PATIENT_INFO_XIKANG || m_enumXiKangCommandType==SEARCH_PATIENT_ID_XIKANG ||
  584. m_enumXiKangCommandType==GET_REPORT_URL_XIKANG)
  585. {
  586. nRet = m_pHttpSession->ExeceteGetHttpSession(netConfig, mapParam, pInputStream);
  587. }
  588. else if(m_enumXiKangCommandType==GET_TOKEN_XIKANG || /*m_enumXiKangCommandType==GET_CASE_LIST_XIKANG || */
  589. /*m_enumXiKangCommandType==SUBMIT_CASE_XIKANG || */m_enumXiKangCommandType==UPLOAD_FILE_XIKANG)
  590. {
  591. nRet = m_pHttpSession->ExecuteFormHttpSession(netConfig, mapParam, stringDataPath, pInputStream);
  592. }
  593. else
  594. {
  595. nRet = m_pHttpSession->ExeceteCommonPostSession(netConfig, mapParam, "application/json", stringHttpBody, pInputStream);
  596. }
  597. if(nRet != PHMS_SUCCESSFUL_RESULT)
  598. {
  599. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  600. return nRet;
  601. }
  602. nRet = NoPhmsGetResult(pInputStream);
  603. if(nRet != PHMS_SUCCESSFUL_RESULT)
  604. {
  605. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  606. return nRet;
  607. }
  608. return PHMS_SUCCESSFUL_RESULT;
  609. }
  610. int CPhmsSession::ExecuteXinJieSession(string stringBase64Content, bool bMustSsl)
  611. {
  612. CNetConfig netConfig;
  613. int nRet = PHMS_SUCCESSFUL_RESULT;
  614. //设置网络环境
  615. try
  616. {
  617. string stringWorkingDir = CUtil::GetCurrentAppDir();
  618. EnumNetConfigType enumNetConfigType = this->GetNetConfigType();
  619. nRet = this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl, enumNetConfigType);
  620. //nRet = this->GetXinJieNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl);
  621. if(nRet != PHMS_SUCCESSFUL_RESULT)
  622. {
  623. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  624. return nRet;
  625. }
  626. Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
  627. if(bMustSsl)
  628. {
  629. if(!m_bSsl)
  630. {
  631. delete m_pHttpSession;
  632. m_pHttpSession = new CHttpSession(bMustSsl);
  633. m_bSsl = bMustSsl;
  634. }
  635. }
  636. else
  637. {
  638. if(m_bSsl != netConfig.GetSsl())
  639. {
  640. delete m_pHttpSession;
  641. m_pHttpSession = new CHttpSession(netConfig.GetSsl());
  642. m_bSsl = netConfig.GetSsl();
  643. }
  644. }
  645. }
  646. catch(FileNotFoundException& e)
  647. {
  648. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  649. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  650. return COMMON_NO_NET_CONFIG_FILE;
  651. }
  652. istream* pInputStream = NULL;
  653. nRet = m_pHttpSession->ExecuteXmlHttpSession(netConfig, stringBase64Content, pInputStream);
  654. if(nRet != PHMS_SUCCESSFUL_RESULT)
  655. {
  656. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  657. return nRet;
  658. }
  659. nRet = NoPhmsGetResult(pInputStream);
  660. if(nRet != PHMS_SUCCESSFUL_RESULT)
  661. {
  662. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  663. return nRet;
  664. }
  665. return PHMS_SUCCESSFUL_RESULT;
  666. }
  667. //非PHMS协议接口
  668. int CPhmsSession::ExecuteNoPhmsSession(string stringUrl, int bContinue, bool bMustSsl)
  669. {
  670. CNetConfig netConfig;
  671. int nRet = PHMS_SUCCESSFUL_RESULT;
  672. //设置网络环境
  673. try
  674. {
  675. string stringWorkingDir = CUtil::GetCurrentAppDir();
  676. nRet = this->GetNoPhmsNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, stringUrl, bMustSsl);
  677. if(nRet != PHMS_SUCCESSFUL_RESULT)
  678. {
  679. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  680. return nRet;
  681. }
  682. Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
  683. if(bMustSsl)
  684. {
  685. if(!m_bSsl)
  686. {
  687. delete m_pHttpSession;
  688. m_pHttpSession = new CHttpSession(bMustSsl);
  689. m_bSsl = bMustSsl;
  690. }
  691. }
  692. else
  693. {
  694. if(m_bSsl != netConfig.GetSsl())
  695. {
  696. delete m_pHttpSession;
  697. m_pHttpSession = new CHttpSession(netConfig.GetSsl());
  698. m_bSsl = netConfig.GetSsl();
  699. }
  700. }
  701. }
  702. catch(FileNotFoundException& e)
  703. {
  704. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  705. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  706. return COMMON_NO_NET_CONFIG_FILE;
  707. }
  708. istream* pInputStream = NULL;
  709. nRet = m_pHttpSession->ExecuteNoPhmsHttpSession(netConfig, pInputStream, bContinue, m_stringFilePath);
  710. if(nRet != PHMS_SUCCESSFUL_RESULT)
  711. {
  712. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  713. return nRet;
  714. }
  715. nRet = NoPhmsGetResult(pInputStream);
  716. if(nRet != PHMS_SUCCESSFUL_RESULT)
  717. {
  718. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  719. return nRet;
  720. }
  721. return PHMS_SUCCESSFUL_RESULT;
  722. }
  723. int CPhmsSession::ExecuteFormHttpSession(string stringHost, string stringUrl, map<string, string> mapParam, bool bMustSsl)
  724. {
  725. CNetConfig netConfig;
  726. int nRet = PHMS_SUCCESSFUL_RESULT;
  727. //设置网络环境
  728. try
  729. {
  730. string stringWorkingDir = CUtil::GetCurrentAppDir();
  731. nRet = this->GetFormNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, stringHost, stringUrl, bMustSsl);
  732. if(nRet != PHMS_SUCCESSFUL_RESULT)
  733. {
  734. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  735. return nRet;
  736. }
  737. Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
  738. if(bMustSsl)
  739. {
  740. if(!m_bSsl)
  741. {
  742. delete m_pHttpSession;
  743. m_pHttpSession = new CHttpSession(bMustSsl);
  744. m_bSsl = bMustSsl;
  745. }
  746. }
  747. else
  748. {
  749. if(m_bSsl != netConfig.GetSsl())
  750. {
  751. delete m_pHttpSession;
  752. m_pHttpSession = new CHttpSession(netConfig.GetSsl());
  753. m_bSsl = netConfig.GetSsl();
  754. }
  755. }
  756. }
  757. catch(FileNotFoundException& e)
  758. {
  759. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  760. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  761. return COMMON_NO_NET_CONFIG_FILE;
  762. }
  763. istream* pInputStream = NULL;
  764. nRet = m_pHttpSession->ExecuteFormHttpSession(netConfig, mapParam, pInputStream);
  765. if(nRet != PHMS_SUCCESSFUL_RESULT)
  766. {
  767. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  768. return nRet;
  769. }
  770. nRet = NoPhmsGetResult(pInputStream);
  771. if(nRet != PHMS_SUCCESSFUL_RESULT)
  772. {
  773. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  774. return nRet;
  775. }
  776. return PHMS_SUCCESSFUL_RESULT;
  777. }
  778. int CPhmsSession::GetSessionId(int nSaveType, string stringContent, string stringFilePath)
  779. {
  780. int nRet = 0;
  781. m_stringSessionId = "";
  782. nRet = CUtil::GetXmlFieldVaule(nSaveType, stringContent, stringFilePath, "sid", m_stringSessionId);
  783. if(nRet != PHMS_SUCCESSFUL_RESULT)
  784. {
  785. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  786. return nRet;
  787. }
  788. if(m_stringSessionId.size() == 0)
  789. {
  790. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_SID), __FUNCTION__, __FILE__, __LINE__);
  791. return COMMON_NO_SID;
  792. }
  793. return nRet;
  794. }
  795. string CPhmsSession::GetXiKangToken(int nSaveType, string stringContent, string stringFilePath)
  796. {
  797. map<string, string> mapResult;
  798. CUtil::ParseJsonObjectWithoutArray(nSaveType, stringContent, stringFilePath, mapResult);
  799. return mapResult["access_token"];
  800. }
  801. int CPhmsSession::GetRequestXml(AutoPtr<Document> pDoc, string& stringXmlContent)
  802. {
  803. string stringWorkingDir = CUtil::GetCurrentAppDir();
  804. string stringIniFilePath = stringWorkingDir+"PhmsConfig.ini";
  805. AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringIniFilePath, "gbk");
  806. string stringEncoding = iniFile->getString("OTHER.Encoding", "GBK");
  807. DOMWriter domWriter;
  808. //ProcessingInstruction和XMLWriter::WRITE_XML_DECLARATION 只用一个就好,都用会写两个头
  809. domWriter.setOptions(XMLWriter::WRITE_XML_DECLARATION | XMLWriter::PRETTY_PRINT);
  810. domWriter.setNewLine(XMLWriter::NEWLINE_CRLF);
  811. domWriter.setIndent(" ");
  812. TextEncoding* pEnvEncoding = TextEncoding::find(stringEncoding);
  813. TextEncoding* pUtf8Encoding = TextEncoding::find("UTF-8");
  814. //domWriter.setEncoding(stringEncoding, *pEnvEncoding);
  815. domWriter.setEncoding("UTF-8", *pUtf8Encoding);
  816. domWriter.setInputEncoding(*pEnvEncoding);
  817. std::ostringstream oStringStream;
  818. Base64Encoder encoderBase64(oStringStream);
  819. encoderBase64.rdbuf()->setLineLength(0);
  820. try
  821. {
  822. domWriter.writeNode(encoderBase64,pDoc);
  823. // ostringstream oStringStreamXmlContent;
  824. // domWriter.writeNode(oStringStreamXmlContent, pDoc);
  825. // CPhmsLogger::GetPhmsLogger()->WriteLog(oStringStreamXmlContent.str(), __FUNCTION__, __FILE__, __LINE__);
  826. // domWriter.writeNode(cout, pDoc);
  827. // cout<<endl<<endl;
  828. }
  829. catch(Exception& e)
  830. {
  831. //写日志
  832. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  833. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_WRITE_XML_ERROR), __FUNCTION__, __FILE__, __LINE__);
  834. return COMMON_WRITE_XML_ERROR;
  835. }
  836. encoderBase64.close();
  837. stringXmlContent = oStringStream.str();
  838. return PHMS_SUCCESSFUL_RESULT;
  839. }
  840. int CPhmsSession::GetRequestXml(string stringFilePath, string& stringXmlContent)
  841. {
  842. std::ostringstream oStringStream;
  843. Base64Encoder encoderBase64(oStringStream);
  844. encoderBase64.rdbuf()->setLineLength(0);
  845. try
  846. {
  847. std::ifstream ifStream;
  848. ifStream.exceptions(ios::badbit);
  849. ifStream.open(stringFilePath.c_str());
  850. StreamCopier::copyStream(ifStream, encoderBase64);
  851. }
  852. catch(Exception& e)
  853. {
  854. //写日志
  855. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  856. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_WRITE_XML_ERROR), __FUNCTION__, __FILE__, __LINE__);
  857. return COMMON_WRITE_XML_ERROR;
  858. }
  859. catch (ios::failure& e)
  860. {
  861. //写日志
  862. CPhmsLogger::GetPhmsLogger()->WriteLog(e.what(), __FUNCTION__, __FILE__, __LINE__);
  863. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_READ_FAIL), __FUNCTION__, __FILE__, __LINE__);
  864. return COMMON_FILE_READ_FAIL;
  865. }
  866. encoderBase64.close();
  867. stringXmlContent = oStringStream.str();
  868. //体检机组的xml趋势文件转码并修改xml编码声明
  869. string stringWorkingDir = CUtil::GetCurrentAppDir();
  870. string stringIniFilePath = stringWorkingDir+"PhmsConfig.ini";
  871. AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringIniFilePath, "gbk");
  872. string stringEncoding = iniFile->getString("OTHER.Encoding", "GBK");
  873. TextEncoding* pEnvEncoding = TextEncoding::find(stringEncoding);
  874. TextEncoding* pUtf8Encoding = TextEncoding::find("UTF-8");
  875. TextConverter converter(*pEnvEncoding, *pUtf8Encoding);
  876. string stringTempXmlContent;
  877. converter.convert(stringXmlContent, stringTempXmlContent);
  878. string stringSrc = "encoding=\"";
  879. stringSrc += stringEncoding;
  880. stringSrc += "\"?>";
  881. string stringDst = "encoding=\"UTF-8\"?>";
  882. CUtil::ReplaceString(stringTempXmlContent, stringSrc, stringDst);
  883. stringXmlContent = stringTempXmlContent;
  884. return PHMS_SUCCESSFUL_RESULT;
  885. }
  886. int CPhmsSession::GetRequestXmlNoBase64(Poco::AutoPtr<Poco::XML::Document> pDoc, string& stringXmlContent, bool bUtf8)
  887. {
  888. string stringWorkingDir = CUtil::GetCurrentAppDir();
  889. string stringIniFilePath = stringWorkingDir+"PhmsConfig.ini";
  890. AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringIniFilePath, "gbk");
  891. string stringEncoding = iniFile->getString("OTHER.Encoding", "GBK");
  892. DOMWriter domWriter;
  893. //ProcessingInstruction和XMLWriter::WRITE_XML_DECLARATION 只用一个就好,都用会写两个头
  894. domWriter.setOptions(XMLWriter::WRITE_XML_DECLARATION/*XMLWriter::CANONICAL_XML*/ | XMLWriter::PRETTY_PRINT);
  895. domWriter.setNewLine(XMLWriter::NEWLINE_CRLF);
  896. domWriter.setIndent(" ");
  897. TextEncoding* pEnvEncoding = TextEncoding::find(stringEncoding);
  898. UTF8Encoding utf8Encoding;
  899. if(bUtf8)
  900. {
  901. domWriter.setEncoding("UTF-8", utf8Encoding);
  902. domWriter.setInputEncoding(*pEnvEncoding);
  903. }
  904. else
  905. {
  906. domWriter.setEncoding(stringEncoding, *pEnvEncoding);
  907. domWriter.setInputEncoding(*pEnvEncoding);
  908. }
  909. std::ostringstream oStringStream;
  910. try
  911. {
  912. domWriter.writeNode(oStringStream,pDoc);
  913. ofstream of;
  914. of.open("./Request.xml", ios_base::binary|ios_base::trunc);
  915. domWriter.writeNode(of, pDoc);
  916. of.close();
  917. // domWriter.writeNode(cout, pDoc);
  918. // cout<<endl<<endl;
  919. }
  920. catch(Exception& e)
  921. {
  922. //写日志
  923. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  924. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_WRITE_XML_ERROR), __FUNCTION__, __FILE__, __LINE__);
  925. return COMMON_WRITE_XML_ERROR;
  926. }
  927. stringXmlContent = oStringStream.str();
  928. return PHMS_SUCCESSFUL_RESULT;
  929. }
  930. int CPhmsSession::GetRequestXmlForAESAndBase64(Poco::AutoPtr<Poco::XML::Document> pDoc, string& stringXmlContent)
  931. {
  932. string stringWorkingDir = CUtil::GetCurrentAppDir();
  933. string stringIniFilePath = stringWorkingDir+"PhmsConfig.ini";
  934. AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringIniFilePath, "gbk");
  935. string stringEncoding = iniFile->getString("OTHER.Encoding", "GBK");
  936. DOMWriter domWriter;
  937. //ProcessingInstruction和XMLWriter::WRITE_XML_DECLARATION 只用一个就好,都用会写两个头
  938. domWriter.setOptions(XMLWriter::WRITE_XML_DECLARATION | XMLWriter::PRETTY_PRINT);
  939. domWriter.setNewLine(XMLWriter::NEWLINE_CRLF);
  940. domWriter.setIndent(" ");
  941. TextEncoding* pEnvEncoding = TextEncoding::find(stringEncoding);
  942. domWriter.setEncoding(stringEncoding, *pEnvEncoding);
  943. domWriter.setInputEncoding(*pEnvEncoding);
  944. std::ostringstream oStringStream;
  945. try
  946. {
  947. domWriter.writeNode(oStringStream,pDoc);
  948. }
  949. catch(Exception& e)
  950. {
  951. //写日志
  952. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  953. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_WRITE_XML_ERROR), __FUNCTION__, __FILE__, __LINE__);
  954. return COMMON_WRITE_XML_ERROR;
  955. }
  956. string stringIn = oStringStream.str();
  957. //使用0102030405060708作为密钥进行AES加密,并将加密的结果进行base64编码
  958. CipherKey::ByteVec secret;
  959. CipherKey::ByteVec vi;
  960. string::iterator iter;
  961. string stringSecret = "0102030405060708";
  962. for(iter=stringSecret.begin(); iter!=stringSecret.end(); iter++)
  963. {
  964. secret.push_back(*iter);
  965. vi.push_back(*iter);
  966. }
  967. Cipher::Ptr pCipher = CipherFactory::defaultFactory().createCipher(CipherKey("aes128", secret, vi));
  968. std::string stringOut = pCipher->encryptString(stringIn, Cipher::ENC_BASE64);
  969. for(iter=stringOut.begin(); iter!=stringOut.end(); iter++)
  970. {
  971. if(*iter == '*')
  972. {
  973. *iter = '+';
  974. }
  975. }
  976. stringXmlContent = stringOut;
  977. return PHMS_SUCCESSFUL_RESULT;
  978. }
  979. int CPhmsSession::GetNetConfig(string stringFilePath, CNetConfig& netConfig, bool bMustSsl, EnumNetConfigType enumNetConfigType)
  980. {
  981. switch(enumNetConfigType)
  982. {
  983. case GW_FORM:
  984. return GetGWNetConfig(stringFilePath, netConfig, bMustSsl);
  985. case DIRECTLY_TO_HIS:
  986. return GetDirectlyToHisConfig(stringFilePath, netConfig, bMustSsl);
  987. case XINJIE_XML:
  988. return GetXinJieNetConfig(stringFilePath, netConfig, bMustSsl);
  989. case XIKANG_FORM:
  990. return GetXiKangNetConfig(stringFilePath, netConfig, bMustSsl);
  991. case GUANXIN_FORM:
  992. return GetGuanXinNetConfig(stringFilePath, netConfig, bMustSsl);
  993. case TELECOM_XML:
  994. return GetXmlNetConfig_Telecom(stringFilePath, netConfig, bMustSsl);
  995. case DAOYI_XML:
  996. return GetXmlNetConfig(stringFilePath, netConfig, bMustSsl);
  997. case ORIGINAL_PHMS:
  998. default:
  999. return GetNetConfig(stringFilePath, netConfig, bMustSsl);
  1000. }
  1001. return PHMS_SUCCESSFUL_RESULT;
  1002. }
  1003. int CPhmsSession::GetNetConfig(string stringFilePath, CNetConfig& netConfig, bool bMustSsl)
  1004. {
  1005. try
  1006. {
  1007. AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
  1008. string stringContent;
  1009. unsigned short nContent;
  1010. istringstream iStringStream;
  1011. if(g_stringContecServerAddr.size() == 0)
  1012. {
  1013. if(!m_bUseIp && m_enumPhmsCommandType==LOGIN_TYPE)
  1014. {
  1015. stringContent = iniFile->getString("NET.SERVER_NAME", "data2.contec365.com");
  1016. if(stringContent.size() == 0)
  1017. {
  1018. stringContent = "data2.contec365.com";
  1019. }
  1020. }
  1021. else
  1022. {
  1023. string stringPriorIp = CAllObjectManagerUtil::GetPriorIp();
  1024. if(stringPriorIp.size() != 0)
  1025. {
  1026. stringContent = stringPriorIp;
  1027. }
  1028. else
  1029. {
  1030. if(iniFile->has("NET.IP"))
  1031. {
  1032. stringContent = iniFile->getString("NET.IP", "");
  1033. if(stringContent.size() == 0)
  1034. {
  1035. stringContent = iniFile->getString("NET.SERVER_NAME", "data2.contec365.com");
  1036. if(stringContent.size() == 0)
  1037. {
  1038. stringContent = "data2.contec365.com";
  1039. }
  1040. }
  1041. }
  1042. else
  1043. {
  1044. stringContent = iniFile->getString("NET.SERVER_NAME", "data2.contec365.com");
  1045. if(stringContent.size() == 0)
  1046. {
  1047. stringContent = "data2.contec365.com";
  1048. }
  1049. }
  1050. }
  1051. }
  1052. netConfig.SetAddr(stringContent);
  1053. stringContent = iniFile->getString("NET.SERVER_NAME", "data2.contec365.com");
  1054. if(stringContent.size() == 0)
  1055. {
  1056. stringContent = "data2.contec365.com";
  1057. }
  1058. netConfig.SetHost(stringContent);
  1059. }
  1060. else
  1061. {
  1062. netConfig.SetAddr(g_stringContecServerAddr);
  1063. netConfig.SetHost(g_stringContecServerAddr);
  1064. }
  1065. if(!bMustSsl)
  1066. {
  1067. stringContent = iniFile->getString("NET.SSL", "0");
  1068. if(stringContent == "1")
  1069. {
  1070. netConfig.SetSsl(true);
  1071. }
  1072. else
  1073. {
  1074. netConfig.SetSsl(false);
  1075. }
  1076. if(g_stringContecServerPort.size() == 0)
  1077. {
  1078. if(netConfig.GetSsl())
  1079. {
  1080. stringContent = iniFile->getString("NET.SSL_PORT", "443");
  1081. }
  1082. else
  1083. {
  1084. stringContent = iniFile->getString("NET.PORT", "80");
  1085. }
  1086. }
  1087. else
  1088. {
  1089. stringContent = g_stringContecServerPort;
  1090. }
  1091. iStringStream.str(stringContent);
  1092. iStringStream>>nContent;
  1093. netConfig.SetPort(nContent);
  1094. }
  1095. else
  1096. {
  1097. netConfig.SetSsl(true);
  1098. stringContent = iniFile->getString("NET.SSL_PORT", "443");
  1099. iStringStream.str(stringContent);
  1100. iStringStream>>nContent;
  1101. netConfig.SetPort(nContent);
  1102. }
  1103. switch(m_enumPhmsCommandType)
  1104. {
  1105. case LOGIN_TYPE:
  1106. stringContent = iniFile->getString("NET.LOGIN_URI", "/login.php");
  1107. break;
  1108. case MAIN_TYPE:
  1109. stringContent = iniFile->getString("NET.MAIN_URI", "/main.php");
  1110. break;
  1111. case CHANGE_INFO_TYPE:
  1112. stringContent = iniFile->getString("NET.LOGIN_URI", "/login.php");
  1113. break;
  1114. case REGISTER_TYPE:
  1115. stringContent = iniFile->getString("NET.REGISTER_URI", "/register.php");
  1116. break;
  1117. default:
  1118. stringContent = iniFile->getString("NET.MAIN_URI", "/main.php");
  1119. break;
  1120. }
  1121. netConfig.SetUrl(stringContent);
  1122. stringContent = iniFile->getString("GENERAL.NETWORK", "0");
  1123. iStringStream.clear();
  1124. iStringStream.str(stringContent);
  1125. iStringStream>>nContent;
  1126. switch (nContent)
  1127. {
  1128. case 0:
  1129. netConfig.SetProxyType(NO_PROXY);
  1130. break;
  1131. case 1:
  1132. netConfig.SetProxyType(HTTP_PROXY);
  1133. break;
  1134. case 2:
  1135. netConfig.SetProxyType(SOCK_PROXY);
  1136. break;
  1137. default:
  1138. netConfig.SetProxyType(NO_PROXY);
  1139. break;
  1140. }
  1141. stringContent = iniFile->getString("PROXY.IP", "");
  1142. netConfig.SetProxyAddr(stringContent);
  1143. stringContent = iniFile->getString("PROXY.PORT", "");
  1144. iStringStream.clear();
  1145. iStringStream.str(stringContent);
  1146. iStringStream>>nContent;
  1147. netConfig.SetProxyPort(nContent);
  1148. stringContent = iniFile->getString("PROXY.USERNAME", "");
  1149. netConfig.SetProxyUsername(stringContent);
  1150. stringContent = iniFile->getString("PROXY.PASSWORD", "");
  1151. netConfig.SetProxyPassword(stringContent);
  1152. }
  1153. catch(FileNotFoundException& e)
  1154. {
  1155. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  1156. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  1157. throw;
  1158. }
  1159. return PHMS_SUCCESSFUL_RESULT;
  1160. }
  1161. int CPhmsSession::GetNoPhmsNetConfig(string stringFilePath, CNetConfig& netConfig, string stringUrl, bool bMustSsl)
  1162. {
  1163. try
  1164. {
  1165. AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
  1166. string stringContent;
  1167. unsigned short nContent;
  1168. istringstream iStringStream;
  1169. if(stringUrl[0] =='/' || stringUrl.find("file://")!=string::npos || stringUrl.find("data2.contec365.com")!=string::npos)
  1170. {
  1171. if(g_stringContecServerAddr.size() == 0)
  1172. {
  1173. string stringPriorIp = CAllObjectManagerUtil::GetPriorIp();
  1174. if(stringPriorIp.size() != 0)
  1175. {
  1176. stringContent = stringPriorIp;
  1177. }
  1178. else
  1179. {
  1180. if(iniFile->has("NET.IP"))
  1181. {
  1182. stringContent = iniFile->getString("NET.IP", "");
  1183. if(stringContent.size() == 0)
  1184. {
  1185. stringContent = iniFile->getString("NET.SERVER_NAME", "data2.contec365.com");
  1186. if(stringContent.size() == 0)
  1187. {
  1188. stringContent = "data2.contec365.com";
  1189. }
  1190. }
  1191. }
  1192. else
  1193. {
  1194. stringContent = iniFile->getString("NET.SERVER_NAME", "data2.contec365.com");
  1195. if(stringContent.size() == 0)
  1196. {
  1197. stringContent = "data2.contec365.com";
  1198. }
  1199. }
  1200. }
  1201. netConfig.SetAddr(stringContent);
  1202. stringContent = iniFile->getString("NET.SERVER_NAME", "data2.contec365.com");
  1203. if(stringContent.size() == 0)
  1204. {
  1205. stringContent = "data2.contec365.com";
  1206. }
  1207. netConfig.SetHost(stringContent);
  1208. }
  1209. else
  1210. {
  1211. netConfig.SetAddr(g_stringContecServerAddr);
  1212. netConfig.SetHost(g_stringContecServerAddr);
  1213. }
  1214. if(!bMustSsl)
  1215. {
  1216. if(g_stringContecServerPort.size() == 0)
  1217. {
  1218. stringContent = iniFile->getString("NET.PORT", "80");
  1219. }
  1220. else
  1221. {
  1222. stringContent = g_stringContecServerPort;
  1223. }
  1224. iStringStream.str(stringContent);
  1225. iStringStream>>nContent;
  1226. netConfig.SetPort(nContent);
  1227. stringContent = iniFile->getString("NET.SSL", "0");
  1228. if(stringContent == "1")
  1229. {
  1230. netConfig.SetSsl(true);
  1231. }
  1232. else
  1233. {
  1234. netConfig.SetSsl(false);
  1235. }
  1236. }
  1237. else
  1238. {
  1239. netConfig.SetPort(443);
  1240. netConfig.SetSsl(true);
  1241. }
  1242. netConfig.SetUrl(stringUrl);
  1243. }
  1244. else
  1245. {
  1246. string stringHTTPMark = "http://";
  1247. if(stringUrl.find(stringHTTPMark) != string::npos)
  1248. {
  1249. stringUrl = stringUrl.substr(stringHTTPMark.size(), stringUrl.size()-stringHTTPMark.size());
  1250. }
  1251. if(stringUrl.find(":")!=string::npos && stringUrl.find(":")<stringUrl.find("/"))
  1252. {
  1253. stringContent = stringUrl.substr(0, stringUrl.find(":"));
  1254. netConfig.SetAddr(stringContent);
  1255. netConfig.SetHost(stringContent);
  1256. stringContent = stringUrl.substr(stringUrl.find(":")+1, stringUrl.find("/")-stringUrl.find(":")-1);
  1257. netConfig.SetPort(CUtil::StringToULong(stringContent));
  1258. }
  1259. else
  1260. {
  1261. stringContent = stringUrl.substr(0, stringUrl.find("/"));
  1262. netConfig.SetAddr(stringContent);
  1263. netConfig.SetHost(stringContent);
  1264. netConfig.SetPort(80);
  1265. }
  1266. netConfig.SetSsl(false);
  1267. stringContent = stringUrl.substr(stringUrl.find("/"), string::npos);
  1268. netConfig.SetUrl(stringContent);
  1269. }
  1270. stringContent = iniFile->getString("GENERAL.NETWORK", "0");
  1271. iStringStream.clear();
  1272. iStringStream.str(stringContent);
  1273. iStringStream>>nContent;
  1274. switch (nContent)
  1275. {
  1276. case 0:
  1277. netConfig.SetProxyType(NO_PROXY);
  1278. break;
  1279. case 1:
  1280. netConfig.SetProxyType(HTTP_PROXY);
  1281. break;
  1282. case 2:
  1283. netConfig.SetProxyType(SOCK_PROXY);
  1284. break;
  1285. default:
  1286. netConfig.SetProxyType(NO_PROXY);
  1287. break;
  1288. }
  1289. stringContent = iniFile->getString("PROXY.IP", "");
  1290. netConfig.SetProxyAddr(stringContent);
  1291. stringContent = iniFile->getString("PROXY.PORT", "");
  1292. iStringStream.clear();
  1293. iStringStream.str(stringContent);
  1294. iStringStream>>nContent;
  1295. netConfig.SetProxyPort(nContent);
  1296. stringContent = iniFile->getString("PROXY.USERNAME", "");
  1297. netConfig.SetProxyUsername(stringContent);
  1298. stringContent = iniFile->getString("PROXY.PASSWORD", "");
  1299. netConfig.SetProxyPassword(stringContent);
  1300. }
  1301. catch(FileNotFoundException& e)
  1302. {
  1303. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  1304. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  1305. throw;
  1306. }
  1307. return PHMS_SUCCESSFUL_RESULT;
  1308. }
  1309. int CPhmsSession::GetXmlNetConfig(string stringFilePath, CNetConfig& netConfig, bool bMustSsl)
  1310. {
  1311. try
  1312. {
  1313. AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
  1314. string stringContent;
  1315. unsigned short nContent;
  1316. istringstream iStringStream;
  1317. stringContent = iniFile->getString("NET.XML_SERVER_NAME", "crm.999120.net");
  1318. netConfig.SetAddr(stringContent);
  1319. netConfig.SetHost(stringContent);
  1320. if(!bMustSsl)
  1321. {
  1322. stringContent = iniFile->getString("NET.XML_PORT", "80");
  1323. iStringStream.str(stringContent);
  1324. iStringStream>>nContent;
  1325. netConfig.SetPort(nContent);
  1326. stringContent = iniFile->getString("NET.SSL", "0");
  1327. if(stringContent == "1")
  1328. {
  1329. netConfig.SetSsl(true);
  1330. }
  1331. else
  1332. {
  1333. netConfig.SetSsl(false);
  1334. }
  1335. }
  1336. else
  1337. {
  1338. netConfig.SetPort(443);
  1339. netConfig.SetSsl(true);
  1340. }
  1341. switch(m_enumXmlCommandType)
  1342. {
  1343. case SELECT_DOCTOR_TYPE:
  1344. stringContent = iniFile->getString("NET.XML_SELECT_DOCTOR_URI", "/interface/select_doctor_new.aspx");
  1345. break;
  1346. case PAY_VERIFICATION_TYPE:
  1347. stringContent = iniFile->getString("NET.XML_PAY_VERIFICATION_URI", "/interface/pay_verification_new.aspx");
  1348. break;
  1349. case PAY_VERIFICATION_CASE_TYPE:
  1350. stringContent = iniFile->getString("NET.XML_PAY_VERIFICATION_CASE_URI", "/interface/pay_verification_case_new.aspx");
  1351. break;
  1352. default:
  1353. stringContent = "";
  1354. break;
  1355. }
  1356. netConfig.SetUrl(stringContent);
  1357. stringContent = iniFile->getString("GENERAL.NETWORK", "0");
  1358. iStringStream.clear();
  1359. iStringStream.str(stringContent);
  1360. iStringStream>>nContent;
  1361. switch (nContent)
  1362. {
  1363. case 0:
  1364. netConfig.SetProxyType(NO_PROXY);
  1365. break;
  1366. case 1:
  1367. netConfig.SetProxyType(HTTP_PROXY);
  1368. break;
  1369. case 2:
  1370. netConfig.SetProxyType(SOCK_PROXY);
  1371. break;
  1372. default:
  1373. netConfig.SetProxyType(NO_PROXY);
  1374. break;
  1375. }
  1376. stringContent = iniFile->getString("PROXY.IP", "");
  1377. netConfig.SetProxyAddr(stringContent);
  1378. stringContent = iniFile->getString("PROXY.PORT", "");
  1379. iStringStream.clear();
  1380. iStringStream.str(stringContent);
  1381. iStringStream>>nContent;
  1382. netConfig.SetProxyPort(nContent);
  1383. stringContent = iniFile->getString("PROXY.USERNAME", "");
  1384. netConfig.SetProxyUsername(stringContent);
  1385. stringContent = iniFile->getString("PROXY.PASSWORD", "");
  1386. netConfig.SetProxyPassword(stringContent);
  1387. }
  1388. catch(FileNotFoundException& e)
  1389. {
  1390. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  1391. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  1392. throw;
  1393. }
  1394. return PHMS_SUCCESSFUL_RESULT;
  1395. }
  1396. int CPhmsSession::GetXmlNetConfig_Telecom(string stringFilePath, CNetConfig& netConfig, bool bMustSsl)
  1397. {
  1398. try
  1399. {
  1400. AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
  1401. string stringContent;
  1402. unsigned short nContent;
  1403. istringstream iStringStream;
  1404. stringContent = iniFile->getString("NET.XML_TELECOM_SERVER", "61.178.98.104");
  1405. netConfig.SetAddr(stringContent);
  1406. netConfig.SetHost(stringContent);
  1407. if(!bMustSsl)
  1408. {
  1409. stringContent = iniFile->getString("NET.XML_TELECOM_PORT", "8088");
  1410. iStringStream.str(stringContent);
  1411. iStringStream>>nContent;
  1412. netConfig.SetPort(nContent);
  1413. stringContent = iniFile->getString("NET.XML_TELECOM_SSL", "0");
  1414. if(stringContent == "1")
  1415. {
  1416. netConfig.SetSsl(true);
  1417. }
  1418. else
  1419. {
  1420. netConfig.SetSsl(false);
  1421. }
  1422. }
  1423. else
  1424. {
  1425. netConfig.SetPort(443);
  1426. netConfig.SetSsl(true);
  1427. }
  1428. switch(m_enumXmlCommandType_Telecom)
  1429. {
  1430. case USER_AUTH:
  1431. stringContent = iniFile->getString("NET.XML_TELECOM_AUTH", "/lecare-sync/user/userAuthorize");
  1432. break;
  1433. case SYNC_BP:
  1434. stringContent = iniFile->getString("NET.XML_TELECOM_BP", "/lecare-sync/syncBloodPress");
  1435. break;
  1436. case SYNC_BO:
  1437. stringContent = iniFile->getString("NET.XML_TELECOM_BO", "/lecare-sync/syncBloodOxygen");
  1438. break;
  1439. case SYNC_HW:
  1440. stringContent = iniFile->getString("NET.XML_TELECOM_HW", "/lecare-sync/syncHeightWeight");
  1441. break;
  1442. case SYNC_BS:
  1443. stringContent = iniFile->getString("NET.XML_TELECOM_BS", "/lecare-sync/syncBloodGlucose");
  1444. break;
  1445. case SYNC_LUNG:
  1446. stringContent = iniFile->getString("NET.XML_TELECOM_LUNG", "/lecare-sync/syncLungfunction");
  1447. break;
  1448. case SYNC_ECG:
  1449. stringContent = iniFile->getString("NET.XML_TELECOM_ECG", "/lecare-sync/syncEcg");
  1450. break;
  1451. }
  1452. netConfig.SetUrl(stringContent);
  1453. stringContent = iniFile->getString("GENERAL.NETWORK", "0");
  1454. iStringStream.clear();
  1455. iStringStream.str(stringContent);
  1456. iStringStream>>nContent;
  1457. switch (nContent)
  1458. {
  1459. case 0:
  1460. netConfig.SetProxyType(NO_PROXY);
  1461. break;
  1462. case 1:
  1463. netConfig.SetProxyType(HTTP_PROXY);
  1464. break;
  1465. case 2:
  1466. netConfig.SetProxyType(SOCK_PROXY);
  1467. break;
  1468. default:
  1469. netConfig.SetProxyType(NO_PROXY);
  1470. break;
  1471. }
  1472. stringContent = iniFile->getString("PROXY.IP", "");
  1473. netConfig.SetProxyAddr(stringContent);
  1474. stringContent = iniFile->getString("PROXY.PORT", "");
  1475. iStringStream.clear();
  1476. iStringStream.str(stringContent);
  1477. iStringStream>>nContent;
  1478. netConfig.SetProxyPort(nContent);
  1479. stringContent = iniFile->getString("PROXY.USERNAME", "");
  1480. netConfig.SetProxyUsername(stringContent);
  1481. stringContent = iniFile->getString("PROXY.PASSWORD", "");
  1482. netConfig.SetProxyPassword(stringContent);
  1483. }
  1484. catch(FileNotFoundException& e)
  1485. {
  1486. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  1487. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  1488. throw;
  1489. }
  1490. return PHMS_SUCCESSFUL_RESULT;
  1491. }
  1492. int CPhmsSession::GetXinJieNetConfig(string stringFilePath, CNetConfig& netConfig, bool bMustSsl)
  1493. {
  1494. try
  1495. {
  1496. AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
  1497. string stringContent;
  1498. unsigned short nContent;
  1499. istringstream iStringStream;
  1500. stringContent = iniFile->getString("NET.XINJIE_SERVER_NAME", "36.33.16.12");
  1501. netConfig.SetAddr(stringContent);
  1502. netConfig.SetHost(stringContent);
  1503. if(!bMustSsl)
  1504. {
  1505. stringContent = iniFile->getString("NET.SSL", "0");
  1506. if(stringContent == "1")
  1507. {
  1508. netConfig.SetSsl(true);
  1509. }
  1510. else
  1511. {
  1512. netConfig.SetSsl(false);
  1513. }
  1514. if(netConfig.GetSsl())
  1515. {
  1516. stringContent = iniFile->getString("NET.XINJIE_SERVER_SSL_PORT", "443");
  1517. }
  1518. else
  1519. {
  1520. stringContent = iniFile->getString("NET.XINJIE_SERVER_PORT", "9508");
  1521. }
  1522. iStringStream.str(stringContent);
  1523. iStringStream>>nContent;
  1524. netConfig.SetPort(nContent);
  1525. }
  1526. else
  1527. {
  1528. stringContent = iniFile->getString("NET.XINJIE_SERVER_SSL_PORT", "443");
  1529. iStringStream.str(stringContent);
  1530. iStringStream>>nContent;
  1531. netConfig.SetPort(nContent);
  1532. netConfig.SetSsl(true);
  1533. }
  1534. switch(m_enumXinJieCommandType)
  1535. {
  1536. case VALIDATE_PAY:
  1537. stringContent = iniFile->getString("NET.XINJIE_PAY_VERIFICATION_URI", "/dataSynchronization/checkRrn.do");
  1538. break;
  1539. case NOTIFY_PAY:
  1540. stringContent = iniFile->getString("NET.XINJIE_PAY_NOTIFY_URI", "/dataSynchronization/uploadSuccessfully.do");
  1541. break;
  1542. }
  1543. netConfig.SetUrl(stringContent);
  1544. stringContent = iniFile->getString("GENERAL.NETWORK", "0");
  1545. iStringStream.clear();
  1546. iStringStream.str(stringContent);
  1547. iStringStream>>nContent;
  1548. switch (nContent)
  1549. {
  1550. case 0:
  1551. netConfig.SetProxyType(NO_PROXY);
  1552. break;
  1553. case 1:
  1554. netConfig.SetProxyType(HTTP_PROXY);
  1555. break;
  1556. case 2:
  1557. netConfig.SetProxyType(SOCK_PROXY);
  1558. break;
  1559. default:
  1560. netConfig.SetProxyType(NO_PROXY);
  1561. break;
  1562. }
  1563. stringContent = iniFile->getString("PROXY.IP", "");
  1564. netConfig.SetProxyAddr(stringContent);
  1565. stringContent = iniFile->getString("PROXY.PORT", "");
  1566. iStringStream.clear();
  1567. iStringStream.str(stringContent);
  1568. iStringStream>>nContent;
  1569. netConfig.SetProxyPort(nContent);
  1570. stringContent = iniFile->getString("PROXY.USERNAME", "");
  1571. netConfig.SetProxyUsername(stringContent);
  1572. stringContent = iniFile->getString("PROXY.PASSWORD", "");
  1573. netConfig.SetProxyPassword(stringContent);
  1574. }
  1575. catch(FileNotFoundException& e)
  1576. {
  1577. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  1578. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  1579. throw;
  1580. }
  1581. return PHMS_SUCCESSFUL_RESULT;
  1582. }
  1583. int CPhmsSession::GetGuanXinNetConfig(string stringFilePath, CNetConfig& netConfig, bool bMustSsl)
  1584. {
  1585. try
  1586. {
  1587. AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
  1588. string stringContent;
  1589. unsigned short nContent;
  1590. istringstream iStringStream;
  1591. //stringContent = iniFile->getString("NET.GUANXIN_SERVER_NAME", "114.247.234.148");
  1592. switch(m_enumGuanXinCommandType)
  1593. {
  1594. case ACCESSTOKEN:
  1595. case PERSONINFO:
  1596. case SESSION:
  1597. case UPLOADPERSONINFO:
  1598. stringContent = iniFile->getString("NET.GUANXIN_SERVER_NAME", "114.247.234.153");
  1599. break;
  1600. case UPLOADECG:
  1601. case UPLOADNONECG:
  1602. case UPLOADMONITOR:
  1603. stringContent = iniFile->getString("NET.GUANXIN_SERVER_NAME2", "114.247.234.153");
  1604. break;
  1605. }
  1606. netConfig.SetAddr(stringContent);
  1607. netConfig.SetHost(stringContent);
  1608. // if(m_enumGuanXinCommandType != PERSONINFO)
  1609. // {
  1610. // stringContent = iniFile->getString("NET.GUANXIN_PORT_TOKEN", "8044");
  1611. // }
  1612. // else
  1613. // {
  1614. // stringContent = iniFile->getString("NET.GUANXIN_PORT_INFO", "8049");
  1615. // }
  1616. switch(m_enumGuanXinCommandType)
  1617. {
  1618. case ACCESSTOKEN:
  1619. case PERSONINFO:
  1620. case SESSION:
  1621. case UPLOADPERSONINFO:
  1622. stringContent = iniFile->getString("NET.GUANXIN_PORT_TOKEN", "8081");
  1623. break;
  1624. case UPLOADECG:
  1625. case UPLOADNONECG:
  1626. case UPLOADMONITOR:
  1627. stringContent = iniFile->getString("NET.GUANXIN_PORT_TOKEN2", "8081");
  1628. break;
  1629. }
  1630. iStringStream.str(stringContent);
  1631. iStringStream>>nContent;
  1632. netConfig.SetPort(nContent);
  1633. if(!bMustSsl)
  1634. {
  1635. netConfig.SetSsl(false);
  1636. }
  1637. else
  1638. {
  1639. netConfig.SetSsl(true);
  1640. }
  1641. switch(m_enumGuanXinCommandType)
  1642. {
  1643. case ACCESSTOKEN:
  1644. //stringContent = iniFile->getString("NET.GUANXIN_ACCESSTOKEN_URI", "/auth-service/oauth/2.0/token");
  1645. stringContent = iniFile->getString("NET.GUANXIN_ACCESSTOKEN_URI", "/chss/web/ytjlogin");
  1646. break;
  1647. case PERSONINFO:
  1648. //stringContent = iniFile->getString("NET.GUANXIN_PERSONINFO_URI", "/chss/web/findMember");
  1649. stringContent = iniFile->getString("NET.GUANXIN_PERSONINFO_URI", "/chss/web/findMember");
  1650. break;
  1651. case SESSION:
  1652. //stringContent = iniFile->getString("NET.GUANXIN_SESSION_URI", "/auth-service/oauth/2.0/session");
  1653. break;
  1654. case UPLOADECG:
  1655. stringContent = iniFile->getString("NET.GUANXIN_UPLOADECG_URI", "/ytj/execute/uploadECGData");
  1656. break;
  1657. case UPLOADNONECG:
  1658. stringContent = iniFile->getString("NET.GUANXIN_UPLOADNONECG_URI", "/ytj/execute/uploadOtherData");
  1659. break;
  1660. case UPLOADMONITOR:
  1661. stringContent = iniFile->getString("NET.GUANXIN_UPLOADMONITOR_URI", "/ytj/execute/uploadCheckData");
  1662. break;
  1663. case UPLOADPERSONINFO:
  1664. stringContent = iniFile->getString("NET.GUANXIN_UPLOADPERSONINFO_URI", "/ytj/execute/uploadPersonInfo");
  1665. break;
  1666. }
  1667. netConfig.SetUrl(stringContent);
  1668. stringContent = iniFile->getString("GENERAL.NETWORK", "0");
  1669. iStringStream.clear();
  1670. iStringStream.str(stringContent);
  1671. iStringStream>>nContent;
  1672. switch (nContent)
  1673. {
  1674. case 0:
  1675. netConfig.SetProxyType(NO_PROXY);
  1676. break;
  1677. case 1:
  1678. netConfig.SetProxyType(HTTP_PROXY);
  1679. break;
  1680. case 2:
  1681. netConfig.SetProxyType(SOCK_PROXY);
  1682. break;
  1683. default:
  1684. netConfig.SetProxyType(NO_PROXY);
  1685. break;
  1686. }
  1687. stringContent = iniFile->getString("PROXY.IP", "");
  1688. netConfig.SetProxyAddr(stringContent);
  1689. stringContent = iniFile->getString("PROXY.PORT", "");
  1690. iStringStream.clear();
  1691. iStringStream.str(stringContent);
  1692. iStringStream>>nContent;
  1693. netConfig.SetProxyPort(nContent);
  1694. stringContent = iniFile->getString("PROXY.USERNAME", "");
  1695. netConfig.SetProxyUsername(stringContent);
  1696. stringContent = iniFile->getString("PROXY.PASSWORD", "");
  1697. netConfig.SetProxyPassword(stringContent);
  1698. }
  1699. catch(FileNotFoundException& e)
  1700. {
  1701. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  1702. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  1703. throw;
  1704. }
  1705. return PHMS_SUCCESSFUL_RESULT;
  1706. }
  1707. int CPhmsSession::GetXiKangNetConfig(string stringFilePath, CNetConfig& netConfig, bool bMustSsl)
  1708. {
  1709. try
  1710. {
  1711. AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
  1712. string stringContent;
  1713. unsigned short nContent;
  1714. istringstream iStringStream;
  1715. switch(m_enumXiKangCommandType)
  1716. {
  1717. case GET_TOKEN_XIKANG:
  1718. stringContent = iniFile->getString("NET.XIKANG_TOKEN_SERVER_NAME", "dlpassport.xikang.com");
  1719. break;
  1720. case LOGIN_XIKANG:
  1721. case REGISTER_PATIENT_XIKANG:
  1722. case REGISTER_PATIENT_INFO_XIKANG:
  1723. case BIND_PATIENT_XIKANG:
  1724. case GET_PATIENT_ID_XIKANG:
  1725. case GET_PATIENT_INFO_XIKANG:
  1726. case SEARCH_PATIENT_ID_XIKANG:
  1727. stringContent = iniFile->getString("NET.XIKANG_OPENAPI_SERVER_NAME", "dlopen.xikang.com");
  1728. break;
  1729. case GET_CASE_LIST_XIKANG:
  1730. case SUBMIT_CASE_XIKANG:
  1731. case GET_REPORT_URL_XIKANG:
  1732. stringContent = iniFile->getString("NET.XIKANG_DHEALTH_SERVER_NAME", "xk.xikang.com");
  1733. break;
  1734. case UPLOAD_FILE_XIKANG:
  1735. stringContent = iniFile->getString("NET.XIKANG_UPLOADFILE_SERVER_NAME", "tycyl.xikang.com");
  1736. break;
  1737. default:
  1738. stringContent = iniFile->getString("NET.XIKANG_API_SERVER_NAME", "xxxxx");
  1739. break;
  1740. }
  1741. netConfig.SetAddr(stringContent);
  1742. netConfig.SetHost(stringContent);
  1743. switch(m_enumXiKangCommandType)
  1744. {
  1745. case GET_TOKEN_XIKANG:
  1746. stringContent = iniFile->getString("NET.XIKANG_TOKEN_PORT", "80");
  1747. break;
  1748. default:
  1749. stringContent = iniFile->getString("NET.XIAKNG_API_PORT", "80");
  1750. break;
  1751. }
  1752. iStringStream.str(stringContent);
  1753. iStringStream>>nContent;
  1754. netConfig.SetPort(nContent);
  1755. if(!bMustSsl)
  1756. {
  1757. netConfig.SetSsl(false);
  1758. }
  1759. else
  1760. {
  1761. netConfig.SetSsl(true);
  1762. }
  1763. switch(m_enumXiKangCommandType)
  1764. {
  1765. case GET_TOKEN_XIKANG:
  1766. stringContent = iniFile->getString("NET.XIKANG_TOKEN_URI", "/oauth/token");
  1767. break;
  1768. case LOGIN_XIKANG:
  1769. stringContent = iniFile->getString("NET.XIKANG_LOGIN_URI", "/openapi/person/account");
  1770. break;
  1771. case REGISTER_PATIENT_XIKANG:
  1772. stringContent = iniFile->getString("NET.XIKANG_REGISTER_URI", "/openapi/person/member");
  1773. break;
  1774. case REGISTER_PATIENT_INFO_XIKANG:
  1775. stringContent = iniFile->getString("NET.XIKANG_REGISTER_INFO_URI", "/openapi/person/account/{openID}");
  1776. break;
  1777. case BIND_PATIENT_XIKANG:
  1778. stringContent = iniFile->getString("NET.XIKANG_BIND_PATIENT_URL", "/openapi/person/membercaregiver/addMemberCaregiver");
  1779. break;
  1780. case GET_PATIENT_ID_XIKANG:
  1781. stringContent = iniFile->getString("NET.XIKANG_GET_PATIENT_ID_URI", "/openapi/person/membercaregiver/findMemberCaregiver");
  1782. break;
  1783. case SEARCH_PATIENT_ID_XIKANG:
  1784. stringContent = iniFile->getString("NET.XIKANG_SEARCH_PATIENT_ID_URI", "/openapi/person/member/getOpenID");
  1785. break;
  1786. case GET_PATIENT_INFO_XIKANG:
  1787. stringContent = iniFile->getString("NET.XIKANG_GET_PATIENT_INFO_URL", "/openapi/person/member/{openID}");
  1788. break;
  1789. //以下为dHealth接口,暂时未加uploadfile接口
  1790. case GET_CASE_LIST_XIKANG:
  1791. stringContent = iniFile->getString("NET.XIKANG_GET_CASE_LIST_URI", "/hcservice/rest/ecg/ecgCnst");
  1792. break;
  1793. case SUBMIT_CASE_XIKANG:
  1794. stringContent = iniFile->getString("NET.XIKANG_SUBMIT_CASE_URI", "/hcservice/rest/ecg/addEcg");
  1795. break;
  1796. case GET_REPORT_URL_XIKANG:
  1797. stringContent = iniFile->getString("NET.XIKANG_GET_REPORT_URL_URI", "/hcservice/rest/ecg/report/{ecgID}");
  1798. break;
  1799. case UPLOAD_FILE_XIKANG:
  1800. stringContent = iniFile->getString("NET.XIKANG_UPLOAD_FILE_URI", "/kt-tmfs/tmfs/ufile");
  1801. break;
  1802. }
  1803. netConfig.SetUrl(stringContent);
  1804. stringContent = iniFile->getString("GENERAL.NETWORK", "0");
  1805. iStringStream.clear();
  1806. iStringStream.str(stringContent);
  1807. iStringStream>>nContent;
  1808. switch (nContent)
  1809. {
  1810. case 0:
  1811. netConfig.SetProxyType(NO_PROXY);
  1812. break;
  1813. case 1:
  1814. netConfig.SetProxyType(HTTP_PROXY);
  1815. break;
  1816. case 2:
  1817. netConfig.SetProxyType(SOCK_PROXY);
  1818. break;
  1819. default:
  1820. netConfig.SetProxyType(NO_PROXY);
  1821. break;
  1822. }
  1823. stringContent = iniFile->getString("PROXY.IP", "");
  1824. netConfig.SetProxyAddr(stringContent);
  1825. stringContent = iniFile->getString("PROXY.PORT", "");
  1826. iStringStream.clear();
  1827. iStringStream.str(stringContent);
  1828. iStringStream>>nContent;
  1829. netConfig.SetProxyPort(nContent);
  1830. stringContent = iniFile->getString("PROXY.USERNAME", "");
  1831. netConfig.SetProxyUsername(stringContent);
  1832. stringContent = iniFile->getString("PROXY.PASSWORD", "");
  1833. netConfig.SetProxyPassword(stringContent);
  1834. }
  1835. catch(FileNotFoundException& e)
  1836. {
  1837. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  1838. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  1839. throw;
  1840. }
  1841. return PHMS_SUCCESSFUL_RESULT;
  1842. }
  1843. int CPhmsSession::GetFormNetConfig(string stringFilePath, CNetConfig& netConfig, string stringHost, string stringUrl, bool bMustSsl)
  1844. {
  1845. try
  1846. {
  1847. AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
  1848. string stringContent;
  1849. unsigned short nContent;
  1850. istringstream iStringStream;
  1851. stringContent = stringHost;
  1852. netConfig.SetAddr(stringContent);
  1853. netConfig.SetHost(stringContent);
  1854. if(!bMustSsl)
  1855. {
  1856. stringContent = iniFile->getString("NET.FORM_PORT", "80");
  1857. iStringStream.str(stringContent);
  1858. iStringStream>>nContent;
  1859. netConfig.SetPort(nContent);
  1860. stringContent = iniFile->getString("NET.SSL", "0");
  1861. if(stringContent == "1")
  1862. {
  1863. netConfig.SetSsl(true);
  1864. }
  1865. else
  1866. {
  1867. netConfig.SetSsl(false);
  1868. }
  1869. }
  1870. else
  1871. {
  1872. netConfig.SetPort(443);
  1873. netConfig.SetSsl(true);
  1874. }
  1875. stringContent = stringUrl;
  1876. netConfig.SetUrl(stringContent);
  1877. stringContent = iniFile->getString("GENERAL.NETWORK", "0");
  1878. iStringStream.clear();
  1879. iStringStream.str(stringContent);
  1880. iStringStream>>nContent;
  1881. switch (nContent)
  1882. {
  1883. case 0:
  1884. netConfig.SetProxyType(NO_PROXY);
  1885. break;
  1886. case 1:
  1887. netConfig.SetProxyType(HTTP_PROXY);
  1888. break;
  1889. case 2:
  1890. netConfig.SetProxyType(SOCK_PROXY);
  1891. break;
  1892. default:
  1893. netConfig.SetProxyType(NO_PROXY);
  1894. break;
  1895. }
  1896. stringContent = iniFile->getString("PROXY.IP", "");
  1897. netConfig.SetProxyAddr(stringContent);
  1898. stringContent = iniFile->getString("PROXY.PORT", "");
  1899. iStringStream.clear();
  1900. iStringStream.str(stringContent);
  1901. iStringStream>>nContent;
  1902. netConfig.SetProxyPort(nContent);
  1903. stringContent = iniFile->getString("PROXY.USERNAME", "");
  1904. netConfig.SetProxyUsername(stringContent);
  1905. stringContent = iniFile->getString("PROXY.PASSWORD", "");
  1906. netConfig.SetProxyPassword(stringContent);
  1907. }
  1908. catch(FileNotFoundException& e)
  1909. {
  1910. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  1911. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  1912. throw;
  1913. }
  1914. return PHMS_SUCCESSFUL_RESULT;
  1915. }
  1916. int CPhmsSession::GetGWNetConfig(string stringFilePath, CNetConfig& netConfig, bool bMustSsl)
  1917. {
  1918. try
  1919. {
  1920. AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
  1921. string stringContent;
  1922. unsigned short nContent;
  1923. istringstream iStringStream;
  1924. stringContent = iniFile->getString("NET.GW_SERVER_NAME", "127.0.0.1");
  1925. netConfig.SetAddr(stringContent);
  1926. netConfig.SetHost(stringContent);
  1927. if(!bMustSsl)
  1928. {
  1929. stringContent = iniFile->getString("NET.GW_PORT", "80");
  1930. iStringStream.str(stringContent);
  1931. iStringStream>>nContent;
  1932. netConfig.SetPort(nContent);
  1933. netConfig.SetSsl(false);
  1934. }
  1935. else
  1936. {
  1937. stringContent = iniFile->getString("NET.GW_SSL_PORT", "443");
  1938. iStringStream.str(stringContent);
  1939. iStringStream>>nContent;
  1940. netConfig.SetPort(nContent);
  1941. netConfig.SetSsl(true);
  1942. }
  1943. stringContent = iniFile->getString("NET.GW_COMMON_PATH", "/xxxx/");
  1944. netConfig.SetUrl(stringContent);
  1945. stringContent = iniFile->getString("GENERAL.NETWORK", "0");
  1946. iStringStream.clear();
  1947. iStringStream.str(stringContent);
  1948. iStringStream>>nContent;
  1949. switch (nContent)
  1950. {
  1951. case 0:
  1952. netConfig.SetProxyType(NO_PROXY);
  1953. break;
  1954. case 1:
  1955. netConfig.SetProxyType(HTTP_PROXY);
  1956. break;
  1957. case 2:
  1958. netConfig.SetProxyType(SOCK_PROXY);
  1959. break;
  1960. default:
  1961. netConfig.SetProxyType(NO_PROXY);
  1962. break;
  1963. }
  1964. stringContent = iniFile->getString("PROXY.IP", "");
  1965. netConfig.SetProxyAddr(stringContent);
  1966. stringContent = iniFile->getString("PROXY.PORT", "");
  1967. iStringStream.clear();
  1968. iStringStream.str(stringContent);
  1969. iStringStream>>nContent;
  1970. netConfig.SetProxyPort(nContent);
  1971. stringContent = iniFile->getString("PROXY.USERNAME", "");
  1972. netConfig.SetProxyUsername(stringContent);
  1973. stringContent = iniFile->getString("PROXY.PASSWORD", "");
  1974. netConfig.SetProxyPassword(stringContent);
  1975. }
  1976. catch(FileNotFoundException& e)
  1977. {
  1978. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  1979. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  1980. throw;
  1981. }
  1982. return PHMS_SUCCESSFUL_RESULT;
  1983. }
  1984. int CPhmsSession::GetDirectlyToHisConfig(string stringFilePath, CNetConfig& netConfig, bool bMustSsl)
  1985. {
  1986. try
  1987. {
  1988. AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringFilePath, "gbk");
  1989. string stringContent;
  1990. unsigned short nContent;
  1991. istringstream iStringStream;
  1992. stringContent = iniFile->getString("NET.TOHIS_SERVER_NAME", "127.0.0.1");
  1993. netConfig.SetAddr(stringContent);
  1994. netConfig.SetHost(stringContent);
  1995. if(!bMustSsl)
  1996. {
  1997. stringContent = iniFile->getString("NET.TOHIS_PORT", "80");
  1998. iStringStream.str(stringContent);
  1999. iStringStream>>nContent;
  2000. netConfig.SetPort(nContent);
  2001. netConfig.SetSsl(false);
  2002. }
  2003. else
  2004. {
  2005. stringContent = iniFile->getString("NET.TOHIS_SSL_PORT", "443");
  2006. iStringStream.str(stringContent);
  2007. iStringStream>>nContent;
  2008. netConfig.SetPort(nContent);
  2009. netConfig.SetSsl(true);
  2010. }
  2011. stringContent = iniFile->getString("NET.TOHIS_GET_PATIENT_INFO_FROM_HIS", "/xxxx");
  2012. netConfig.SetUrl(stringContent);
  2013. stringContent = iniFile->getString("GENERAL.NETWORK", "0");
  2014. iStringStream.clear();
  2015. iStringStream.str(stringContent);
  2016. iStringStream>>nContent;
  2017. switch (nContent)
  2018. {
  2019. case 0:
  2020. netConfig.SetProxyType(NO_PROXY);
  2021. break;
  2022. case 1:
  2023. netConfig.SetProxyType(HTTP_PROXY);
  2024. break;
  2025. case 2:
  2026. netConfig.SetProxyType(SOCK_PROXY);
  2027. break;
  2028. default:
  2029. netConfig.SetProxyType(NO_PROXY);
  2030. break;
  2031. }
  2032. stringContent = iniFile->getString("PROXY.IP", "");
  2033. netConfig.SetProxyAddr(stringContent);
  2034. stringContent = iniFile->getString("PROXY.PORT", "");
  2035. iStringStream.clear();
  2036. iStringStream.str(stringContent);
  2037. iStringStream>>nContent;
  2038. netConfig.SetProxyPort(nContent);
  2039. stringContent = iniFile->getString("PROXY.USERNAME", "");
  2040. netConfig.SetProxyUsername(stringContent);
  2041. stringContent = iniFile->getString("PROXY.PASSWORD", "");
  2042. netConfig.SetProxyPassword(stringContent);
  2043. }
  2044. catch(FileNotFoundException& e)
  2045. {
  2046. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  2047. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  2048. throw;
  2049. }
  2050. return PHMS_SUCCESSFUL_RESULT;
  2051. }
  2052. int CPhmsSession::NoPhmsGetResult(istream* pInputStream, int bContinue)
  2053. {
  2054. int nRet = PHMS_SUCCESSFUL_RESULT;
  2055. switch(m_nSaveType)
  2056. {
  2057. case 0:
  2058. //残余的响应内容也收回来,防止影响下次接收
  2059. nRet = NoPhmsInputStreamToString(pInputStream, m_stringContent);
  2060. break;
  2061. case 1:
  2062. nRet = NoPhmsInputStreamToString(pInputStream, m_stringContent);
  2063. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2064. {
  2065. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2066. return nRet;
  2067. }
  2068. break;
  2069. case 2:
  2070. if(bContinue)
  2071. {
  2072. nRet = NoPhmsInputStreamToFile(pInputStream, m_stringFilePath, false);
  2073. }
  2074. else
  2075. {
  2076. nRet = NoPhmsInputStreamToFile(pInputStream, m_stringFilePath, true);
  2077. }
  2078. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2079. {
  2080. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2081. return nRet;
  2082. }
  2083. break;
  2084. default:
  2085. break;
  2086. }
  2087. return PHMS_SUCCESSFUL_RESULT;
  2088. }
  2089. int CPhmsSession::NoPhmsInputStreamToString(istream* pInputStream, string& stringContent)
  2090. {
  2091. //流形式实现
  2092. ostringstream oStringStream;
  2093. oStringStream.exceptions(ios::failbit|ios::badbit);
  2094. pInputStream->exceptions(ios::badbit);
  2095. try
  2096. {
  2097. StreamCopier::copyStream(*pInputStream, oStringStream);
  2098. }
  2099. catch(const std::ios::failure& e)
  2100. {
  2101. CPhmsLogger::GetPhmsLogger()->WriteLog(e.what(), __FUNCTION__, __FILE__, __LINE__);
  2102. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_INPUT_STREAM_FAIL), __FUNCTION__, __FILE__, __LINE__);
  2103. return COMMON_INPUT_STREAM_FAIL;
  2104. }
  2105. catch(const TimeoutException& e)
  2106. {
  2107. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  2108. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_RECV_TIMEOUT), __FUNCTION__, __FILE__, __LINE__);
  2109. return COMMON_RECV_TIMEOUT;
  2110. }
  2111. catch(const Exception& e)
  2112. {
  2113. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  2114. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_RECV_FAIL), __FUNCTION__, __FILE__, __LINE__);
  2115. return COMMON_RECV_FAIL;
  2116. }
  2117. stringContent = oStringStream.str();
  2118. return PHMS_SUCCESSFUL_RESULT;
  2119. }
  2120. int CPhmsSession::NoPhmsInputStreamToFile(istream* pInputStream, string& stringFilePath, bool bFileClearBeforeWrite)
  2121. {
  2122. try
  2123. {
  2124. File fileTarget(stringFilePath, "gbk");
  2125. fileTarget.createFile();
  2126. }
  2127. catch(Exception& e)
  2128. {
  2129. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  2130. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_OPEN_FAIL), __FUNCTION__, __FILE__, __LINE__);
  2131. return COMMON_FILE_OPEN_FAIL;
  2132. }
  2133. ofstream ofLocalTargetFile;
  2134. ofLocalTargetFile.exceptions(ios::failbit|ios::badbit);
  2135. pInputStream->exceptions(ios::goodbit);
  2136. try
  2137. {
  2138. if(bFileClearBeforeWrite)
  2139. {
  2140. ofLocalTargetFile.open(stringFilePath.c_str(), ios_base::trunc|ios_base::binary);
  2141. }
  2142. else
  2143. {
  2144. //locale localePre = ofLocalTargetFile.imbue(locale(""));//imbue不起作用
  2145. ofLocalTargetFile.open(stringFilePath.c_str(), ios_base::app|ios_base::binary);
  2146. //ofLocalTargetFile.imbue(localePre);
  2147. }
  2148. }
  2149. catch(const ios::failure& error)
  2150. {
  2151. //写日志
  2152. CPhmsLogger::GetPhmsLogger()->WriteLog(error.what(), __FUNCTION__, __FILE__, __LINE__);
  2153. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_OPEN_FAIL), __FUNCTION__, __FILE__, __LINE__);
  2154. return COMMON_FILE_OPEN_FAIL;
  2155. }
  2156. pInputStream->exceptions(ios::badbit);
  2157. ofLocalTargetFile.exceptions(ios::failbit|ios::badbit);
  2158. try
  2159. {
  2160. StreamCopier::copyStream(*pInputStream, ofLocalTargetFile);
  2161. }
  2162. catch(const std::ios::failure& e)
  2163. {
  2164. ofLocalTargetFile.close();
  2165. CPhmsLogger::GetPhmsLogger()->WriteLog(e.what(), __FUNCTION__, __FILE__, __LINE__);
  2166. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_INPUT_STREAM_FAIL), __FUNCTION__, __FILE__, __LINE__);
  2167. return COMMON_INPUT_STREAM_FAIL;
  2168. }
  2169. catch(const TimeoutException& e)
  2170. {
  2171. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  2172. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_RECV_TIMEOUT), __FUNCTION__, __FILE__, __LINE__);
  2173. return COMMON_RECV_TIMEOUT;
  2174. }
  2175. catch(const Exception& e)
  2176. {
  2177. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  2178. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_RECV_FAIL), __FUNCTION__, __FILE__, __LINE__);
  2179. return COMMON_RECV_FAIL;
  2180. }
  2181. try
  2182. {
  2183. ofLocalTargetFile.flush();
  2184. }
  2185. catch(const ios::failure& error)
  2186. {
  2187. //写日志
  2188. ofLocalTargetFile.close();
  2189. CPhmsLogger::GetPhmsLogger()->WriteLog(error.what(), __FUNCTION__, __FILE__, __LINE__);
  2190. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_WRITE_FAIL), __FUNCTION__, __FILE__, __LINE__);
  2191. return COMMON_FILE_WRITE_FAIL;
  2192. }
  2193. ofLocalTargetFile.close();
  2194. return PHMS_SUCCESSFUL_RESULT;
  2195. }
  2196. int CPhmsSession::GetHttpExceptionInfo(int& nCode, string& stringMsgName, string& stringMsgText)
  2197. {
  2198. return m_pHttpSession->GetHttpExceptionInfo(nCode, stringMsgName, stringMsgText);
  2199. }
  2200. int CPhmsSession::AbortSession()
  2201. {
  2202. Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
  2203. return m_pHttpSession->AbortSession();
  2204. }
  2205. //public member function
  2206. int CPhmsSession::Login(string stringRole, string stringUsername, string stringPassword, string stringLanguage, string stringToken, bool bMustSsl)
  2207. {
  2208. AutoPtr<Document> pDoc = new Document;
  2209. ////AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  2210. AutoPtr<Element> pRoot = pDoc->createElement("request");
  2211. AutoPtr<Element> pChildRole = pDoc->createElement("role");
  2212. AutoPtr<Element> pChildLoginId = pDoc->createElement("loginid");
  2213. AutoPtr<Element> pChildPwd = pDoc->createElement("pwd");
  2214. AutoPtr<Element> pChildLanguage = pDoc->createElement("lang");
  2215. AutoPtr<Element> pChildToken = pDoc->createElement("token");
  2216. AutoPtr<Text> pTextRole = pDoc->createTextNode(stringRole);
  2217. AutoPtr<Text> pTextUsername = pDoc->createTextNode(stringUsername);
  2218. AutoPtr<Text> pTextPassword = pDoc->createTextNode(stringPassword);
  2219. AutoPtr<Text> pTextLanguage = pDoc->createTextNode(stringLanguage);
  2220. AutoPtr<Text> pTextToken = pDoc->createTextNode(stringToken);
  2221. pChildRole->appendChild(pTextRole);
  2222. pChildLoginId->appendChild(pTextUsername);
  2223. pChildPwd->appendChild(pTextPassword);
  2224. pChildLanguage->appendChild(pTextLanguage);
  2225. pChildToken->appendChild(pTextToken);
  2226. pRoot->appendChild(pChildRole);
  2227. pRoot->appendChild(pChildLoginId);
  2228. pRoot->appendChild(pChildPwd);
  2229. pRoot->appendChild(pChildLanguage);
  2230. pRoot->appendChild(pChildToken);
  2231. ////pDoc->appendChild(pi);
  2232. pDoc->appendChild(pRoot);
  2233. string stringXmlContent;
  2234. int nRet = PHMS_SUCCESSFUL_RESULT;
  2235. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  2236. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2237. {
  2238. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2239. return nRet;
  2240. }
  2241. //构造PhmsRequest
  2242. string stringSessionId(32, '0');
  2243. CPhmsRequestHead phmsRequestHead("10", "1002", stringSessionId, "11");
  2244. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  2245. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  2246. //为什么登录的签名是32个0呢????????
  2247. //因为服务器计算签名需要在session中保存由用户名和密码计算出来的md5,调登录时接口未登录,所以签名为32个0
  2248. //phmsRequest.GenerateAndSetSign();
  2249. CPhmsResponse phmsResponse;
  2250. m_enumPhmsCommandType = LOGIN_TYPE;//目前只有登录命令是LOGIN_TYPE,改变个人信息命令是CHANGE_INFO_TYPE,用户注册命令是REGISTER_TYPE
  2251. nRet = ExecutePhmsSession(phmsRequest, phmsResponse, bMustSsl);
  2252. m_enumPhmsCommandType = MAIN_TYPE;//其余命令都是MAIN_TYPE
  2253. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2254. {
  2255. //写日志
  2256. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2257. return nRet;
  2258. }
  2259. //只有登录命令才需要,保存当前在线的用户名和密码,无论是否能正常登录,这样能保证GetResult中验证签名的时候能够正常计算签名
  2260. CPhmsRequest::SetUsername(stringUsername);
  2261. CPhmsRequest::SetPassword(stringPassword);
  2262. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  2263. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2264. {
  2265. //写日志
  2266. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2267. return nRet;
  2268. }
  2269. //只有登录(1002)和注册并登录(1086)命令才需要,解析返回的xml,得到sessionid
  2270. nRet = this->GetSessionId(m_nSaveType, m_stringContent, m_stringFilePath);
  2271. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2272. {
  2273. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2274. return nRet;
  2275. }
  2276. CSessionIdManager::HandleSessionSync(m_stringSessionId);
  2277. return PHMS_SUCCESSFUL_RESULT;
  2278. }
  2279. int CPhmsSession::MechineRegister(string stringCountry, string stringAreaId, string stringArea,
  2280. string stringDevice, string stringSignature, string stringSerialnum)
  2281. {
  2282. AutoPtr<Document> pDoc = new Document;
  2283. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  2284. AutoPtr<Element> pRoot = pDoc->createElement("request");
  2285. AutoPtr<Element> pChildCountry = pDoc->createElement("country");
  2286. AutoPtr<Element> pChildAreaId = pDoc->createElement("areaid");
  2287. AutoPtr<Element> pChildArea = pDoc->createElement("area");
  2288. AutoPtr<Element> pChildDevice = pDoc->createElement("device");
  2289. AutoPtr<Element> pChildSignature = pDoc->createElement("signature");
  2290. AutoPtr<Element> pChildSerialnum = pDoc->createElement("serialnum");
  2291. AutoPtr<Text> pTextCountry = pDoc->createTextNode(stringCountry);
  2292. AutoPtr<Text> pTextAreaId = pDoc->createTextNode(stringAreaId);
  2293. AutoPtr<Text> pTextArea = pDoc->createTextNode(stringArea);
  2294. AutoPtr<Text> pTextDevice = pDoc->createTextNode(stringDevice);
  2295. AutoPtr<Text> pTextSignature = pDoc->createTextNode(stringSignature);
  2296. AutoPtr<Text> pTextSerialnum = pDoc->createTextNode(stringSerialnum);
  2297. pChildCountry->appendChild(pTextCountry);
  2298. pChildAreaId->appendChild(pTextAreaId);
  2299. pChildArea->appendChild(pTextArea);
  2300. pChildDevice->appendChild(pTextDevice);
  2301. pChildSignature->appendChild(pTextSignature);
  2302. pChildSerialnum->appendChild(pTextSerialnum);
  2303. pRoot->appendChild(pChildCountry);
  2304. pRoot->appendChild(pChildAreaId);
  2305. pRoot->appendChild(pChildArea);
  2306. pRoot->appendChild(pChildDevice);
  2307. pRoot->appendChild(pChildSignature);
  2308. pRoot->appendChild(pChildSerialnum);
  2309. //pDoc->appendChild(pi);
  2310. pDoc->appendChild(pRoot);
  2311. string stringXmlContent;
  2312. int nRet = PHMS_SUCCESSFUL_RESULT;
  2313. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  2314. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2315. {
  2316. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2317. return nRet;
  2318. }
  2319. //pDoc->collectGarbage();
  2320. string stringSessionId(32, '0');
  2321. CPhmsRequestHead phmsRequestHead("10", "1001", stringSessionId, "11");
  2322. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  2323. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  2324. // phmsRequest.GenerateAndSetSign();//签名为32个的原因同登录接口一样
  2325. CPhmsResponse phmsResponse;
  2326. m_enumPhmsCommandType = REGISTER_TYPE;//目前只有登录命令是LOGIN_TYPE,改变个人信息命令是CHANGE_INFO_TYPE,用户注册命令是REGISTER_TYPE
  2327. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  2328. m_enumPhmsCommandType = MAIN_TYPE;//其余都是MAIN_TYPE
  2329. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2330. {
  2331. //写日志
  2332. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2333. return nRet;
  2334. }
  2335. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  2336. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2337. {
  2338. //写日志
  2339. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2340. return nRet;
  2341. }
  2342. return PHMS_SUCCESSFUL_RESULT;
  2343. }
  2344. int CPhmsSession::Logout()
  2345. {
  2346. CPhmsRequestHead phmsRequestHead("10", "1003", m_stringSessionId, "10");
  2347. CPhmsRequestBody phmsRequestBody("");
  2348. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  2349. phmsRequest.GenerateAndSetSign();
  2350. CPhmsResponse phmsResponse;
  2351. int nRet = PHMS_SUCCESSFUL_RESULT;
  2352. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  2353. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2354. {
  2355. //写日志
  2356. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2357. return nRet;
  2358. }
  2359. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  2360. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2361. {
  2362. //写日志
  2363. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2364. return nRet;
  2365. }
  2366. m_stringSessionId = "";
  2367. CSessionIdManager::HandleSessionSync("");
  2368. return PHMS_SUCCESSFUL_RESULT;
  2369. }
  2370. int CPhmsSession::SetDoctorSign(string stringMd5, string stringFilePath)
  2371. {
  2372. AutoPtr<Document> pDoc = new Document;
  2373. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  2374. AutoPtr<Element> pRoot = pDoc->createElement("request");
  2375. AutoPtr<Element> pChildMd5 = pDoc->createElement("md5");
  2376. AutoPtr<Text> pTextMd5 = pDoc->createTextNode(stringMd5);
  2377. pChildMd5->appendChild(pTextMd5);
  2378. pRoot->appendChild(pChildMd5);
  2379. //pDoc->appendChild(pi);
  2380. pDoc->appendChild(pRoot);
  2381. string stringXmlContent;
  2382. int nRet = PHMS_SUCCESSFUL_RESULT;
  2383. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  2384. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2385. {
  2386. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2387. return nRet;
  2388. }
  2389. CPhmsRequestHead phmsRequestHead("10", "1004", m_stringSessionId, "11");
  2390. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  2391. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, stringFilePath);
  2392. phmsRequest.GenerateAndSetSign();
  2393. CPhmsResponse phmsResponse;
  2394. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  2395. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2396. {
  2397. //写日志
  2398. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2399. return nRet;
  2400. }
  2401. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  2402. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2403. {
  2404. //写日志
  2405. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2406. return nRet;
  2407. }
  2408. return PHMS_SUCCESSFUL_RESULT;
  2409. }
  2410. int CPhmsSession::SetDoctorPhoto(string stringMd5, string stringFilePath)
  2411. {
  2412. AutoPtr<Document> pDoc = new Document;
  2413. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  2414. AutoPtr<Element> pRoot = pDoc->createElement("request");
  2415. AutoPtr<Element> pChildMd5 = pDoc->createElement("md5");
  2416. AutoPtr<Text> pTextMd5 = pDoc->createTextNode(stringMd5);
  2417. pChildMd5->appendChild(pTextMd5);
  2418. pRoot->appendChild(pChildMd5);
  2419. //pDoc->appendChild(pi);
  2420. pDoc->appendChild(pRoot);
  2421. string stringXmlContent;
  2422. int nRet = PHMS_SUCCESSFUL_RESULT;
  2423. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  2424. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2425. {
  2426. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2427. return nRet;
  2428. }
  2429. CPhmsRequestHead phmsRequestHead("10", "1005", m_stringSessionId, "11");
  2430. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  2431. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, stringFilePath);
  2432. phmsRequest.GenerateAndSetSign();
  2433. CPhmsResponse phmsResponse;
  2434. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  2435. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2436. {
  2437. //写日志
  2438. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2439. return nRet;
  2440. }
  2441. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  2442. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2443. {
  2444. //写日志
  2445. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2446. return nRet;
  2447. }
  2448. return PHMS_SUCCESSFUL_RESULT;
  2449. }
  2450. int CPhmsSession::ApplyNewCase(string stringName, string stringThirdId, string stringDataType, string stringDataTypeName, string stringNotes, string stringHospitalId,
  2451. string stringHospitalName, string stringDoctorId, string stringDoctorName, string stringCheckTime, string stringOtherParams,string stringDeviceId,
  2452. string stringDeviceName, string stringMd5, string stringCaseOrigin, string stringYzlb, string stringSex, string stringApplicationNo, string stringAutoMatic)
  2453. {
  2454. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringName:"+stringName, __FUNCTION__, __FILE__, __LINE__);
  2455. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringThirdId:"+stringThirdId, __FUNCTION__, __FILE__, __LINE__);
  2456. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringDataType:"+stringDataType, __FUNCTION__, __FILE__, __LINE__);
  2457. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringDataTypeName:"+stringDataTypeName, __FUNCTION__, __FILE__, __LINE__);
  2458. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringNotes:"+stringNotes, __FUNCTION__, __FILE__, __LINE__);
  2459. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringHospitalId:"+stringHospitalId, __FUNCTION__, __FILE__, __LINE__);
  2460. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringHospitalName:"+stringHospitalName, __FUNCTION__, __FILE__, __LINE__);
  2461. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringDoctorId:"+stringDoctorId, __FUNCTION__, __FILE__, __LINE__);
  2462. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringDoctorName:"+stringDoctorName, __FUNCTION__, __FILE__, __LINE__);
  2463. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringCheckTime:"+stringCheckTime, __FUNCTION__, __FILE__, __LINE__);
  2464. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringOtherParams:"+stringOtherParams, __FUNCTION__, __FILE__, __LINE__);
  2465. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringDeviceId:"+stringDeviceId, __FUNCTION__, __FILE__, __LINE__);
  2466. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringDeviceName:"+stringDeviceName, __FUNCTION__, __FILE__, __LINE__);
  2467. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringMd5:"+stringMd5, __FUNCTION__, __FILE__, __LINE__);
  2468. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringCaseOrigin:"+stringCaseOrigin, __FUNCTION__, __FILE__, __LINE__);
  2469. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringYzlb:"+stringYzlb, __FUNCTION__, __FILE__, __LINE__);
  2470. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringSex:"+stringSex, __FUNCTION__, __FILE__, __LINE__);
  2471. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringApplicationNo:"+stringApplicationNo, __FUNCTION__, __FILE__, __LINE__);
  2472. // CPhmsLogger::GetPhmsLogger()->WriteLog("stringAutoMatic:"+stringAutoMatic, __FUNCTION__, __FILE__, __LINE__);
  2473. AutoPtr<Document> pDoc = new Document;
  2474. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  2475. AutoPtr<Element> pRoot = pDoc->createElement("request");
  2476. AutoPtr<Element> pChildName = pDoc->createElement("name");
  2477. AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
  2478. AutoPtr<Element> pChildDataType = pDoc->createElement("datatype");
  2479. AutoPtr<Element> pChildDataTypeName = pDoc->createElement("datatypename");
  2480. AutoPtr<Element> pChildNotes = pDoc->createElement("notes");
  2481. AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
  2482. AutoPtr<Element> pChildHospitalName = pDoc->createElement("hname");
  2483. AutoPtr<Element> pChildDoctorId = pDoc->createElement("doctorid");
  2484. AutoPtr<Element> pChildDoctorName = pDoc->createElement("dname");
  2485. AutoPtr<Element> pChildCheckTime = pDoc->createElement("checktime");
  2486. AutoPtr<Element> pChildOtherParams = pDoc->createElement("otherparams");
  2487. AutoPtr<Element> pChildDeviceId = pDoc->createElement("deviceid");
  2488. AutoPtr<Element> pChildDeviceName = pDoc->createElement("devicename");
  2489. AutoPtr<Element> pChildMd5 = pDoc->createElement("md5");
  2490. AutoPtr<Element> pChildCaseOrigin = pDoc->createElement("caseorigin");
  2491. AutoPtr<Element> pChildYzlb = pDoc->createElement("yzlb");
  2492. AutoPtr<Element> pChildSex = pDoc->createElement("sex");
  2493. AutoPtr<Element> pChildApplicationNo = pDoc->createElement("applicationno");
  2494. AutoPtr<Element> pChildAutoMatic = pDoc->createElement("isautomatic");
  2495. AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
  2496. AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
  2497. AutoPtr<Text> pTextDataType = pDoc->createTextNode(stringDataType);
  2498. AutoPtr<Text> pTextDataTypeName = pDoc->createTextNode(stringDataTypeName);
  2499. AutoPtr<Text> pTextNotes = pDoc->createTextNode(stringNotes);
  2500. AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
  2501. AutoPtr<Text> pTextHospitalName = pDoc->createTextNode(stringHospitalName);
  2502. AutoPtr<Text> pTextDoctorId = pDoc->createTextNode(stringDoctorId);
  2503. AutoPtr<Text> pTextDoctorName = pDoc->createTextNode(stringDoctorName);
  2504. AutoPtr<Text> pTextCheckTime = pDoc->createTextNode(stringCheckTime);
  2505. // //stringOtherParams参数更改xml编码声明,目的是编码统一
  2506. // string stringWorkingDir = CUtil::GetCurrentAppDir();
  2507. // string stringIniFilePath = stringWorkingDir+"PhmsConfig.ini";
  2508. // AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringIniFilePath, "gbk");
  2509. // string stringEncoding = iniFile->getString("OTHER.Encoding", "GBK");
  2510. // string stringSrc = "encoding=\"";
  2511. // stringSrc += stringEncoding;
  2512. // stringSrc += "\"?>";
  2513. // string stringDst = "encoding=\"UTF-8\"?>";
  2514. // CUtil::ReplaceString(stringOtherParams, stringSrc, stringDst);
  2515. AutoPtr<Text> pTextOtherParams = pDoc->createTextNode(stringOtherParams);
  2516. AutoPtr<Text> pTextDeviceId = pDoc->createTextNode(stringDeviceId);
  2517. AutoPtr<Text> pTextDeviceName = pDoc->createTextNode(stringDeviceName);
  2518. AutoPtr<Text> pTextMd5 = pDoc->createTextNode(stringMd5);
  2519. AutoPtr<Text> pTextCaseOrigin = pDoc->createTextNode(stringCaseOrigin);
  2520. AutoPtr<Text> pTextYzlb = pDoc->createTextNode(stringYzlb);
  2521. AutoPtr<Text> pTextSex = pDoc->createTextNode(stringSex);
  2522. AutoPtr<Text> pTextApplicationNo = pDoc->createTextNode(stringApplicationNo);
  2523. AutoPtr<Text> pTextAutoMatic = pDoc->createTextNode(stringAutoMatic);
  2524. pChildName->appendChild(pTextName);
  2525. pChildThirdId->appendChild(pTextThirdId);
  2526. pChildDataType->appendChild(pTextDataType);
  2527. pChildDataTypeName->appendChild(pTextDataTypeName);
  2528. pChildNotes->appendChild(pTextNotes);
  2529. pChildHospitalId->appendChild(pTextHospitalId);
  2530. pChildHospitalName->appendChild(pTextHospitalName);
  2531. pChildDoctorId->appendChild(pTextDoctorId);
  2532. pChildDoctorName->appendChild(pTextDoctorName);
  2533. pChildCheckTime->appendChild(pTextCheckTime);
  2534. pChildOtherParams->appendChild(pTextOtherParams);
  2535. pChildDeviceId->appendChild(pTextDeviceId);
  2536. pChildDeviceName->appendChild(pTextDeviceName);
  2537. pChildMd5->appendChild(pTextMd5);
  2538. pChildCaseOrigin->appendChild(pTextCaseOrigin);
  2539. pChildYzlb->appendChild(pTextYzlb);
  2540. pChildSex->appendChild(pTextSex);
  2541. pChildApplicationNo->appendChild(pTextApplicationNo);
  2542. pChildAutoMatic->appendChild(pTextAutoMatic);
  2543. pRoot->appendChild(pChildName);
  2544. pRoot->appendChild(pChildThirdId);
  2545. pRoot->appendChild(pChildDataType);
  2546. pRoot->appendChild(pChildDataTypeName);
  2547. pRoot->appendChild(pChildNotes);
  2548. pRoot->appendChild(pChildHospitalId);
  2549. pRoot->appendChild(pChildHospitalName);
  2550. pRoot->appendChild(pChildDoctorId);
  2551. pRoot->appendChild(pChildDoctorName);
  2552. pRoot->appendChild(pChildCheckTime);
  2553. pRoot->appendChild(pChildOtherParams);
  2554. pRoot->appendChild(pChildDeviceId);
  2555. pRoot->appendChild(pChildDeviceName);
  2556. pRoot->appendChild(pChildMd5);
  2557. pRoot->appendChild(pChildCaseOrigin);
  2558. pRoot->appendChild(pChildYzlb);
  2559. pRoot->appendChild(pChildSex);
  2560. pRoot->appendChild(pChildApplicationNo);
  2561. pRoot->appendChild(pChildAutoMatic);
  2562. //pDoc->appendChild(pi);
  2563. pDoc->appendChild(pRoot);
  2564. string stringXmlContent;
  2565. int nRet = PHMS_SUCCESSFUL_RESULT;
  2566. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  2567. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2568. {
  2569. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2570. return nRet;
  2571. }
  2572. CPhmsRequestHead phmsRequestHead("10", "1006", m_stringSessionId, "11");
  2573. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  2574. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  2575. phmsRequest.GenerateAndSetSign();
  2576. CPhmsResponse phmsResponse;
  2577. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  2578. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2579. {
  2580. //写日志
  2581. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2582. return nRet;
  2583. }
  2584. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  2585. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2586. {
  2587. //写日志
  2588. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2589. return nRet;
  2590. }
  2591. return PHMS_SUCCESSFUL_RESULT;
  2592. }
  2593. int CPhmsSession::UploadCaseSegment(string stringCaseId, string stringOrder, string stringTotalSize, string stringServerUri, string stringStart1,
  2594. string stringEnd1, string stringMd51, string stringStart2, string stringEnd2, string stringMd52, string stringStart3,
  2595. string stringEnd3,string stringMd53, string stringFilePath)
  2596. {
  2597. AutoPtr<Document> pDoc = new Document;
  2598. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  2599. AutoPtr<Element> pRoot = pDoc->createElement("request");
  2600. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  2601. AutoPtr<Element> pChildOrder = pDoc->createElement("order");
  2602. AutoPtr<Element> pChildTotalSize = pDoc->createElement("totalsize");
  2603. AutoPtr<Element> pChildServerUri = pDoc->createElement("serveruri");
  2604. AutoPtr<Element> pChildPart1 = pDoc->createElement("md51");
  2605. AutoPtr<Element> pGrandChildStart1= pDoc->createElement("start");
  2606. AutoPtr<Element> pGrandChildEnd1 = pDoc->createElement("end");
  2607. AutoPtr<Element> pGrandChildMd51 = pDoc->createElement("md5");
  2608. AutoPtr<Element> pChildPart2 = pDoc->createElement("md52");
  2609. AutoPtr<Element> pGrandChildStart2= pDoc->createElement("start");
  2610. AutoPtr<Element> pGrandChildEnd2 = pDoc->createElement("end");
  2611. AutoPtr<Element> pGrandChildMd52 = pDoc->createElement("md5");
  2612. AutoPtr<Element> pChildPart3 = pDoc->createElement("md53");
  2613. AutoPtr<Element> pGrandChildStart3= pDoc->createElement("start");
  2614. AutoPtr<Element> pGrandChildEnd3 = pDoc->createElement("end");
  2615. AutoPtr<Element> pGrandChildMd53 = pDoc->createElement("md5");
  2616. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  2617. AutoPtr<Text> pTextOrder = pDoc->createTextNode(stringOrder);
  2618. AutoPtr<Text> pTextTotalSize = pDoc->createTextNode(stringTotalSize);
  2619. AutoPtr<Text> pTextServerUri = pDoc->createTextNode(stringServerUri);
  2620. AutoPtr<Text> pTextStart1 = pDoc->createTextNode(stringStart1);
  2621. AutoPtr<Text> pTextEnd1 = pDoc->createTextNode(stringEnd1);
  2622. AutoPtr<Text> pTextMd51 = pDoc->createTextNode(stringMd51);
  2623. AutoPtr<Text> pTextStart2 = pDoc->createTextNode(stringStart2);
  2624. AutoPtr<Text> pTextEnd2 = pDoc->createTextNode(stringEnd2);
  2625. AutoPtr<Text> pTextMd52 = pDoc->createTextNode(stringMd52);
  2626. AutoPtr<Text> pTextStart3 = pDoc->createTextNode(stringStart3);
  2627. AutoPtr<Text> pTextEnd3 = pDoc->createTextNode(stringEnd3);
  2628. AutoPtr<Text> pTextMd53 = pDoc->createTextNode(stringMd53);
  2629. pChildCaseId->appendChild(pTextCaseId);
  2630. pChildOrder->appendChild(pTextOrder);
  2631. pChildTotalSize->appendChild(pTextTotalSize);
  2632. pChildServerUri->appendChild(pTextServerUri);
  2633. pGrandChildStart1->appendChild(pTextStart1);
  2634. pGrandChildEnd1->appendChild(pTextEnd1);
  2635. pGrandChildMd51->appendChild(pTextMd51);
  2636. pGrandChildStart2->appendChild(pTextStart2);
  2637. pGrandChildEnd2->appendChild(pTextEnd2);
  2638. pGrandChildMd52->appendChild(pTextMd52);
  2639. pGrandChildStart3->appendChild(pTextStart3);
  2640. pGrandChildEnd3->appendChild(pTextEnd3);
  2641. pGrandChildMd53->appendChild(pTextMd53);
  2642. pChildPart1->appendChild(pGrandChildStart1);
  2643. pChildPart1->appendChild(pGrandChildEnd1);
  2644. pChildPart1->appendChild(pGrandChildMd51);
  2645. pChildPart2->appendChild(pGrandChildStart2);
  2646. pChildPart2->appendChild(pGrandChildEnd2);
  2647. pChildPart2->appendChild(pGrandChildMd52);
  2648. pChildPart3->appendChild(pGrandChildStart3);
  2649. pChildPart3->appendChild(pGrandChildEnd3);
  2650. pChildPart3->appendChild(pGrandChildMd53);
  2651. pRoot->appendChild(pChildCaseId);
  2652. pRoot->appendChild(pChildOrder);
  2653. pRoot->appendChild(pChildTotalSize);
  2654. pRoot->appendChild(pChildServerUri);
  2655. pRoot->appendChild(pChildPart1);
  2656. pRoot->appendChild(pChildPart2);
  2657. pRoot->appendChild(pChildPart3);
  2658. //pDoc->appendChild(pi);
  2659. pDoc->appendChild(pRoot);
  2660. string stringXmlContent;
  2661. int nRet = PHMS_SUCCESSFUL_RESULT;
  2662. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  2663. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2664. {
  2665. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2666. return nRet;
  2667. }
  2668. CPhmsRequestHead phmsRequestHead("10", "1007", m_stringSessionId, "11");
  2669. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  2670. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, stringFilePath);
  2671. phmsRequest.GenerateAndSetSign();
  2672. CPhmsResponse phmsResponse;
  2673. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  2674. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2675. {
  2676. //写日志
  2677. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2678. return nRet;
  2679. }
  2680. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  2681. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2682. {
  2683. //写日志
  2684. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2685. return nRet;
  2686. }
  2687. return PHMS_SUCCESSFUL_RESULT;
  2688. }
  2689. int CPhmsSession::CaseHoldPlace(string stringCaseId, string stringReceiverId)
  2690. {
  2691. AutoPtr<Document> pDoc = new Document;
  2692. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  2693. AutoPtr<Element> pRoot = pDoc->createElement("request");
  2694. AutoPtr<Element> pChildCase = pDoc->createElement("case");
  2695. AutoPtr<Element> pGrandChildCaseId = pDoc->createElement("caseid");
  2696. AutoPtr<Element> pGrandChildReceiverId = pDoc->createElement("receiverid");
  2697. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  2698. AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
  2699. pGrandChildCaseId->appendChild(pTextCaseId);
  2700. pGrandChildReceiverId->appendChild(pTextReceiverId);
  2701. pChildCase->appendChild(pGrandChildCaseId);
  2702. pChildCase->appendChild(pGrandChildReceiverId);
  2703. pRoot->appendChild(pChildCase);
  2704. //pDoc->appendChild(pi);
  2705. pDoc->appendChild(pRoot);
  2706. string stringXmlContent;
  2707. int nRet = PHMS_SUCCESSFUL_RESULT;
  2708. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  2709. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2710. {
  2711. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2712. return nRet;
  2713. }
  2714. CPhmsRequestHead phmsRequestHead("10", "1008", m_stringSessionId, "11");
  2715. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  2716. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  2717. phmsRequest.GenerateAndSetSign();
  2718. CPhmsResponse phmsResponse;
  2719. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  2720. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2721. {
  2722. //写日志
  2723. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2724. return nRet;
  2725. }
  2726. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  2727. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2728. {
  2729. //写日志
  2730. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2731. return nRet;
  2732. }
  2733. return PHMS_SUCCESSFUL_RESULT;
  2734. }
  2735. int CPhmsSession::GetAutoDownloadCase(string stringCaseType,string stringSenderId,string stringCaseOrigin)
  2736. {
  2737. AutoPtr<Document> pDoc = new Document;
  2738. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  2739. AutoPtr<Element> pRoot = pDoc->createElement("request");
  2740. AutoPtr<Element> pChildcasetype = pDoc->createElement("casetype");
  2741. AutoPtr<Element> pChildsenderid = pDoc->createElement("senderid");
  2742. AutoPtr<Element> pChildcaseorigin = pDoc->createElement("caseorigin");
  2743. AutoPtr<Text> pTextcasetype = pDoc->createTextNode(stringCaseType);
  2744. AutoPtr<Text> pTextsenderid = pDoc->createTextNode(stringSenderId);
  2745. AutoPtr<Text> pTextcaseorigin = pDoc->createTextNode(stringCaseOrigin);
  2746. pChildcasetype->appendChild(pTextcasetype);
  2747. pChildsenderid->appendChild(pTextsenderid);
  2748. pChildcaseorigin->appendChild(pTextcaseorigin);
  2749. pRoot->appendChild(pChildcasetype);
  2750. pRoot->appendChild(pChildsenderid);
  2751. pRoot->appendChild(pChildcaseorigin);
  2752. //pDoc->appendChild(pi);
  2753. pDoc->appendChild(pRoot);
  2754. string stringXmlContent;
  2755. int nRet = PHMS_SUCCESSFUL_RESULT;
  2756. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  2757. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2758. {
  2759. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2760. return nRet;
  2761. }
  2762. CPhmsRequestHead phmsRequestHead("10", "1009", m_stringSessionId, "11");
  2763. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  2764. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  2765. phmsRequest.GenerateAndSetSign();
  2766. CPhmsResponse phmsResponse;
  2767. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  2768. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2769. {
  2770. //写日志
  2771. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2772. return nRet;
  2773. }
  2774. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  2775. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2776. {
  2777. //写日志
  2778. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2779. return nRet;
  2780. }
  2781. return PHMS_SUCCESSFUL_RESULT;
  2782. }
  2783. int CPhmsSession::DownloadCaseBegin(string stringCaseId, string stringReceiverId)
  2784. {
  2785. AutoPtr<Document> pDoc = new Document;
  2786. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  2787. AutoPtr<Element> pRoot = pDoc->createElement("request");
  2788. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  2789. AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
  2790. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  2791. AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
  2792. pChildCaseId->appendChild(pTextCaseId);
  2793. pChildReceiverId->appendChild(pTextReceiverId);
  2794. pRoot->appendChild(pChildCaseId);
  2795. pRoot->appendChild(pChildReceiverId);
  2796. //pDoc->appendChild(pi);
  2797. pDoc->appendChild(pRoot);
  2798. string stringXmlContent;
  2799. int nRet = PHMS_SUCCESSFUL_RESULT;
  2800. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  2801. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2802. {
  2803. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2804. return nRet;
  2805. }
  2806. CPhmsRequestHead phmsRequestHead("10", "1010", m_stringSessionId, "11");
  2807. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  2808. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  2809. phmsRequest.GenerateAndSetSign();
  2810. CPhmsResponse phmsResponse;
  2811. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  2812. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2813. {
  2814. //写日志
  2815. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2816. return nRet;
  2817. }
  2818. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  2819. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2820. {
  2821. //写日志
  2822. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2823. return nRet;
  2824. }
  2825. return PHMS_SUCCESSFUL_RESULT;
  2826. }
  2827. int CPhmsSession::DownloadFileSegment(string stringUri, string stringStart, string stringEnd)
  2828. {
  2829. AutoPtr<Document> pDoc = new Document;
  2830. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  2831. AutoPtr<Element> pRoot = pDoc->createElement("request");
  2832. AutoPtr<Element> pChildUri = pDoc->createElement("uri");
  2833. AutoPtr<Element> pChildStart = pDoc->createElement("start");
  2834. AutoPtr<Element> pChildEnd = pDoc->createElement("end");
  2835. AutoPtr<Text> pTextUri = pDoc->createTextNode(stringUri);
  2836. AutoPtr<Text> pTextStart = pDoc->createTextNode(stringStart);
  2837. AutoPtr<Text> pTextEnd = pDoc->createTextNode(stringEnd);
  2838. pChildUri->appendChild(pTextUri);
  2839. pChildStart->appendChild(pTextStart);
  2840. pChildEnd->appendChild(pTextEnd);
  2841. pRoot->appendChild(pChildUri);
  2842. pRoot->appendChild(pChildStart);
  2843. pRoot->appendChild(pChildEnd);
  2844. //pDoc->appendChild(pi);
  2845. pDoc->appendChild(pRoot);
  2846. string stringXmlContent;
  2847. int nRet = PHMS_SUCCESSFUL_RESULT;
  2848. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  2849. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2850. {
  2851. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2852. return nRet;
  2853. }
  2854. CPhmsRequestHead phmsRequestHead("10", "1011", m_stringSessionId, "11");
  2855. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  2856. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  2857. phmsRequest.GenerateAndSetSign();
  2858. CPhmsResponse phmsResponse;
  2859. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  2860. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2861. {
  2862. //写日志
  2863. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2864. return nRet;
  2865. }
  2866. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath, false, false);
  2867. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2868. {
  2869. //写日志
  2870. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2871. return nRet;
  2872. }
  2873. return PHMS_SUCCESSFUL_RESULT;
  2874. }
  2875. int CPhmsSession::DownloadCaseComplete(string stringCaseId, string stringReceiverId)
  2876. {
  2877. AutoPtr<Document> pDoc = new Document;
  2878. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  2879. AutoPtr<Element> pRoot = pDoc->createElement("request");
  2880. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  2881. AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
  2882. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  2883. AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
  2884. pChildCaseId->appendChild(pTextCaseId);
  2885. pChildReceiverId->appendChild(pTextReceiverId);
  2886. pRoot->appendChild(pChildCaseId);
  2887. pRoot->appendChild(pChildReceiverId);
  2888. //pDoc->appendChild(pi);
  2889. pDoc->appendChild(pRoot);
  2890. string stringXmlContent;
  2891. int nRet = PHMS_SUCCESSFUL_RESULT;
  2892. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  2893. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2894. {
  2895. return nRet;
  2896. }
  2897. CPhmsRequestHead phmsRequestHead("10", "1012", m_stringSessionId, "11");
  2898. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  2899. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  2900. phmsRequest.GenerateAndSetSign();
  2901. CPhmsResponse phmsResponse;
  2902. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  2903. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2904. {
  2905. //写日志
  2906. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2907. return nRet;
  2908. }
  2909. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  2910. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2911. {
  2912. //写日志
  2913. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2914. return nRet;
  2915. }
  2916. return PHMS_SUCCESSFUL_RESULT;
  2917. }
  2918. int CPhmsSession::InvalidCase(string stringCaseId, string stringReceiverId, string stringReason)
  2919. {
  2920. AutoPtr<Document> pDoc = new Document;
  2921. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  2922. AutoPtr<Element> pRoot = pDoc->createElement("request");
  2923. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  2924. AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
  2925. AutoPtr<Element> pChildReason = pDoc->createElement("reason");
  2926. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  2927. AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
  2928. AutoPtr<Text> pTextReason = pDoc->createTextNode(stringReason);
  2929. pChildCaseId->appendChild(pTextCaseId);
  2930. pChildReceiverId->appendChild(pTextReceiverId);
  2931. pChildReason->appendChild(pTextReason);
  2932. pRoot->appendChild(pChildCaseId);
  2933. pRoot->appendChild(pChildReceiverId);
  2934. pRoot->appendChild(pChildReason);
  2935. //pDoc->appendChild(pi);
  2936. pDoc->appendChild(pRoot);
  2937. string stringXmlContent;
  2938. int nRet = PHMS_SUCCESSFUL_RESULT;
  2939. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  2940. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2941. {
  2942. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2943. return nRet;
  2944. }
  2945. CPhmsRequestHead phmsRequestHead("10", "1013", m_stringSessionId, "11");
  2946. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  2947. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  2948. phmsRequest.GenerateAndSetSign();
  2949. CPhmsResponse phmsResponse;
  2950. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  2951. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2952. {
  2953. //写日志
  2954. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2955. return nRet;
  2956. }
  2957. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  2958. if(nRet != PHMS_SUCCESSFUL_RESULT)
  2959. {
  2960. //写日志
  2961. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  2962. return nRet;
  2963. }
  2964. return PHMS_SUCCESSFUL_RESULT;
  2965. }
  2966. int CPhmsSession::TransmitCase(string stringCaseId, string stringReceiverId, string stringForwardToH, string stringForwardToHospitalName,
  2967. string stringForwandToD, string stringForwardToDoctorName)
  2968. {
  2969. AutoPtr<Document> pDoc = new Document;
  2970. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  2971. AutoPtr<Element> pRoot = pDoc->createElement("request");
  2972. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  2973. AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
  2974. AutoPtr<Element> pChildForwardToH = pDoc->createElement("forwardtoh");
  2975. AutoPtr<Element> pChildForwardToHospitalName = pDoc->createElement("forwardtohn");
  2976. AutoPtr<Element> pChildForwardToD = pDoc->createElement("forwardtod");
  2977. AutoPtr<Element> pChildForwardToDoctorName = pDoc->createElement("forwardtodn");
  2978. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  2979. AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
  2980. AutoPtr<Text> pTextForwardToH = pDoc->createTextNode(stringForwardToH);
  2981. AutoPtr<Text> pTextForwardToHospitalName = pDoc->createTextNode(stringForwardToHospitalName);
  2982. AutoPtr<Text> pTextForwardToD = pDoc->createTextNode(stringForwandToD);
  2983. AutoPtr<Text> pTextForwardToDoctorName = pDoc->createTextNode(stringForwardToDoctorName);
  2984. pChildCaseId->appendChild(pTextCaseId);
  2985. pChildReceiverId->appendChild(pTextReceiverId);
  2986. pChildForwardToH->appendChild(pTextForwardToH);
  2987. pChildForwardToHospitalName->appendChild(pTextForwardToHospitalName);
  2988. pChildForwardToD->appendChild(pTextForwardToD);
  2989. pChildForwardToDoctorName->appendChild(pTextForwardToDoctorName);
  2990. pRoot->appendChild(pChildCaseId);
  2991. pRoot->appendChild(pChildReceiverId);
  2992. pRoot->appendChild(pChildForwardToH);
  2993. pRoot->appendChild(pChildForwardToHospitalName);
  2994. pRoot->appendChild(pChildForwardToD);
  2995. pRoot->appendChild(pChildForwardToDoctorName);
  2996. //pDoc->appendChild(pi);
  2997. pDoc->appendChild(pRoot);
  2998. string stringXmlContent;
  2999. int nRet = PHMS_SUCCESSFUL_RESULT;
  3000. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  3001. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3002. {
  3003. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3004. return nRet;
  3005. }
  3006. CPhmsRequestHead phmsRequestHead("10", "1014", m_stringSessionId, "11");
  3007. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  3008. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  3009. phmsRequest.GenerateAndSetSign();
  3010. CPhmsResponse phmsResponse;
  3011. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  3012. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3013. {
  3014. //写日志
  3015. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3016. return nRet;
  3017. }
  3018. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  3019. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3020. {
  3021. //写日志
  3022. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3023. return nRet;
  3024. }
  3025. return PHMS_SUCCESSFUL_RESULT;
  3026. }
  3027. int CPhmsSession::Rollback(string stringCaseId, string stringReceiverId, string stringBackTo)
  3028. {
  3029. AutoPtr<Document> pDoc = new Document;
  3030. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  3031. AutoPtr<Element> pRoot = pDoc->createElement("request");
  3032. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  3033. AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
  3034. AutoPtr<Element> pChildBackTo = pDoc->createElement("backto");
  3035. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  3036. AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
  3037. AutoPtr<Text> pTextBackTo = pDoc->createTextNode(stringBackTo);
  3038. pChildCaseId->appendChild(pTextCaseId);
  3039. pChildReceiverId->appendChild(pTextReceiverId);
  3040. pChildBackTo->appendChild(pTextBackTo);
  3041. pRoot->appendChild(pChildCaseId);
  3042. pRoot->appendChild(pChildReceiverId);
  3043. pRoot->appendChild(pChildBackTo);
  3044. //pDoc->appendChild(pi);
  3045. pDoc->appendChild(pRoot);
  3046. string stringXmlContent;
  3047. int nRet = PHMS_SUCCESSFUL_RESULT;
  3048. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  3049. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3050. {
  3051. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3052. return nRet;
  3053. }
  3054. CPhmsRequestHead phmsRequestHead("10", "1015", m_stringSessionId, "11");
  3055. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  3056. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  3057. phmsRequest.GenerateAndSetSign();
  3058. CPhmsResponse phmsResponse;
  3059. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  3060. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3061. {
  3062. //写日志
  3063. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3064. return nRet;
  3065. }
  3066. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  3067. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3068. {
  3069. //写日志
  3070. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3071. return nRet;
  3072. }
  3073. return PHMS_SUCCESSFUL_RESULT;
  3074. }
  3075. int CPhmsSession::GetHospitalListOfGroup(string stringGroupId, string stringType, string stringCaseType, string stringPageTo, string stringPageSize)
  3076. {
  3077. AutoPtr<Document> pDoc = new Document;
  3078. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  3079. AutoPtr<Element> pRoot = pDoc->createElement("request");
  3080. AutoPtr<Element> pChildGroupId = pDoc->createElement("hgroupid");
  3081. AutoPtr<Element> pChildType = pDoc->createElement("type");
  3082. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  3083. AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
  3084. AutoPtr<Element> pChilePageSize = pDoc->createElement("pagesize");
  3085. AutoPtr<Text> pTextGroupId = pDoc->createTextNode(stringGroupId);
  3086. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  3087. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  3088. AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
  3089. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  3090. pChildGroupId->appendChild(pTextGroupId);
  3091. pChildType->appendChild(pTextType);
  3092. pChildCaseType->appendChild(pTextCaseType);
  3093. pChildPageTo->appendChild(pTextPageTo);
  3094. pChilePageSize->appendChild(pTextPageSize);
  3095. pRoot->appendChild(pChildGroupId);
  3096. pRoot->appendChild(pChildType);
  3097. pRoot->appendChild(pChildCaseType);
  3098. pRoot->appendChild(pChildPageTo);
  3099. pRoot->appendChild(pChilePageSize);
  3100. //pDoc->appendChild(pi);
  3101. pDoc->appendChild(pRoot);
  3102. string stringXmlContent;
  3103. int nRet = PHMS_SUCCESSFUL_RESULT;
  3104. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  3105. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3106. {
  3107. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3108. return nRet;
  3109. }
  3110. CPhmsRequestHead phmsRequestHead("10", "1016", m_stringSessionId, "11");
  3111. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  3112. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  3113. phmsRequest.GenerateAndSetSign();
  3114. CPhmsResponse phmsResponse;
  3115. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  3116. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3117. {
  3118. //写日志
  3119. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3120. return nRet;
  3121. }
  3122. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  3123. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3124. {
  3125. //写日志
  3126. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3127. return nRet;
  3128. }
  3129. return PHMS_SUCCESSFUL_RESULT;
  3130. }
  3131. int CPhmsSession::GetDoctorListOfHospital(string stringHospitalId, string stringDoctorId, string stringCaseType, string stringDoctorType, string stringPageTo, string stringPageSize)
  3132. {
  3133. AutoPtr<Document> pDoc = new Document;
  3134. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  3135. AutoPtr<Element> pRoot = pDoc->createElement("request");
  3136. AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
  3137. AutoPtr<Element> pChildDoctorId = pDoc->createElement("doctorid");
  3138. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  3139. AutoPtr<Element> pChildDoctorType = pDoc->createElement("doctortype");
  3140. AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
  3141. AutoPtr<Element> pChilePageSize = pDoc->createElement("pagesize");
  3142. AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
  3143. AutoPtr<Text> pTextDoctorId = pDoc->createTextNode(stringDoctorId);
  3144. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  3145. AutoPtr<Text> pTextDoctorType = pDoc->createTextNode(stringDoctorType);
  3146. AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
  3147. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  3148. pChildHospitalId->appendChild(pTextHospitalId);
  3149. pChildDoctorId->appendChild(pTextDoctorId);
  3150. pChildCaseType->appendChild(pTextCaseType);
  3151. pChildDoctorType->appendChild(pTextDoctorType);
  3152. pChildPageTo->appendChild(pTextPageTo);
  3153. pChilePageSize->appendChild(pTextPageSize);
  3154. pRoot->appendChild(pChildHospitalId);
  3155. pRoot->appendChild(pChildDoctorId);
  3156. pRoot->appendChild(pChildCaseType);
  3157. pRoot->appendChild(pChildDoctorType);
  3158. pRoot->appendChild(pChildPageTo);
  3159. pRoot->appendChild(pChilePageSize);
  3160. //pDoc->appendChild(pi);
  3161. pDoc->appendChild(pRoot);
  3162. string stringXmlContent;
  3163. int nRet = PHMS_SUCCESSFUL_RESULT;
  3164. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  3165. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3166. {
  3167. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3168. return nRet;
  3169. }
  3170. CPhmsRequestHead phmsRequestHead("10", "1017", m_stringSessionId, "11");
  3171. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  3172. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  3173. phmsRequest.GenerateAndSetSign();
  3174. CPhmsResponse phmsResponse;
  3175. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  3176. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3177. {
  3178. //写日志
  3179. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3180. return nRet;
  3181. }
  3182. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  3183. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3184. {
  3185. //写日志
  3186. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3187. return nRet;
  3188. }
  3189. return PHMS_SUCCESSFUL_RESULT;
  3190. }
  3191. int CPhmsSession::AnalyzeBegin(string stringCaseId, string stringReceiverId, string stringCaseType)
  3192. {
  3193. AutoPtr<Document> pDoc = new Document;
  3194. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  3195. AutoPtr<Element> pRoot = pDoc->createElement("request");
  3196. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  3197. AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
  3198. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  3199. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  3200. AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
  3201. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  3202. pChildCaseId->appendChild(pTextCaseId);
  3203. pChildReceiverId->appendChild(pTextReceiverId);
  3204. pChildCaseType->appendChild(pTextCaseType);
  3205. pRoot->appendChild(pChildCaseId);
  3206. pRoot->appendChild(pChildReceiverId);
  3207. pRoot->appendChild(pChildCaseType);
  3208. //pDoc->appendChild(pi);
  3209. pDoc->appendChild(pRoot);
  3210. string stringXmlContent;
  3211. int nRet = PHMS_SUCCESSFUL_RESULT;
  3212. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  3213. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3214. {
  3215. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3216. return nRet;
  3217. }
  3218. CPhmsRequestHead phmsRequestHead("10", "1018", m_stringSessionId, "11");
  3219. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  3220. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  3221. phmsRequest.GenerateAndSetSign();
  3222. CPhmsResponse phmsResponse;
  3223. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  3224. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3225. {
  3226. //写日志
  3227. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3228. return nRet;
  3229. }
  3230. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  3231. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3232. {
  3233. //写日志
  3234. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3235. return nRet;
  3236. }
  3237. return PHMS_SUCCESSFUL_RESULT;
  3238. }
  3239. int CPhmsSession::AnalyzeComplete(string stringCaseId, string stringReceiverId, string stringCaseType)
  3240. {
  3241. AutoPtr<Document> pDoc = new Document;
  3242. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  3243. AutoPtr<Element> pRoot = pDoc->createElement("request");
  3244. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  3245. AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
  3246. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  3247. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  3248. AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
  3249. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  3250. pChildCaseId->appendChild(pTextCaseId);
  3251. pChildReceiverId->appendChild(pTextReceiverId);
  3252. pChildCaseType->appendChild(pTextCaseType);
  3253. pRoot->appendChild(pChildCaseId);
  3254. pRoot->appendChild(pChildReceiverId);
  3255. pRoot->appendChild(pChildCaseType);
  3256. //pDoc->appendChild(pi);
  3257. pDoc->appendChild(pRoot);
  3258. string stringXmlContent;
  3259. int nRet = PHMS_SUCCESSFUL_RESULT;
  3260. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  3261. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3262. {
  3263. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3264. return nRet;
  3265. }
  3266. CPhmsRequestHead phmsRequestHead("10", "1019", m_stringSessionId, "11");
  3267. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  3268. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  3269. phmsRequest.GenerateAndSetSign();
  3270. CPhmsResponse phmsResponse;
  3271. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  3272. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3273. {
  3274. //写日志
  3275. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3276. return nRet;
  3277. }
  3278. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  3279. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3280. {
  3281. //写日志
  3282. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3283. return nRet;
  3284. }
  3285. return PHMS_SUCCESSFUL_RESULT;
  3286. }
  3287. int CPhmsSession::ApplyNewReport(string stringCaseId, string stringReceiverId, string stringDiagnosis, string stringMd5, string stringDigitalSign, string stringTimestampSign, string stringCaseType)
  3288. {
  3289. AutoPtr<Document> pDoc = new Document;
  3290. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  3291. AutoPtr<Element> pRoot = pDoc->createElement("request");
  3292. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  3293. AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
  3294. AutoPtr<Element> pChildDiagnosis = pDoc->createElement("diagnostic");
  3295. AutoPtr<Element> pChildMd5 = pDoc->createElement("md5");
  3296. AutoPtr<Element> pChildDigitalSign = pDoc->createElement("digitalsign");
  3297. AutoPtr<Element> pChildTimestampSign = pDoc->createElement("timestampsign");
  3298. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  3299. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  3300. AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
  3301. // //stringDiagnosis参数更改xml编码声明,目的是编码统一
  3302. // string stringWorkingDir = CUtil::GetCurrentAppDir();
  3303. // string stringIniFilePath = stringWorkingDir+"PhmsConfig.ini";
  3304. // AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringIniFilePath, "gbk");
  3305. // string stringEncoding = iniFile->getString("OTHER.Encoding", "GBK");
  3306. // string stringSrc = "encoding=\"";
  3307. // stringSrc += stringEncoding;
  3308. // stringSrc += "\"?>";
  3309. // string stringDst = "encoding=\"UTF-8\"?>";
  3310. // CUtil::ReplaceString(stringDiagnosis, stringSrc, stringDst);
  3311. AutoPtr<Text> pTextDiagnosis = pDoc->createTextNode(stringDiagnosis);
  3312. AutoPtr<Text> pTextMd5 = pDoc->createTextNode(stringMd5);
  3313. AutoPtr<Text> pTextDigitalSign = pDoc->createTextNode(stringDigitalSign);
  3314. AutoPtr<Text> pTextTimestampSign = pDoc->createTextNode(stringTimestampSign);
  3315. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  3316. pChildCaseId->appendChild(pTextCaseId);
  3317. pChildReceiverId->appendChild(pTextReceiverId);
  3318. pChildDiagnosis->appendChild(pTextDiagnosis);
  3319. pChildMd5->appendChild(pTextMd5);
  3320. pChildDigitalSign->appendChild(pTextDigitalSign);
  3321. pChildTimestampSign->appendChild(pTextTimestampSign);
  3322. pChildCaseType->appendChild(pTextCaseType);
  3323. pRoot->appendChild(pChildCaseId);
  3324. pRoot->appendChild(pChildReceiverId);
  3325. pRoot->appendChild(pChildDiagnosis);
  3326. pRoot->appendChild(pChildMd5);
  3327. pRoot->appendChild(pChildDigitalSign);
  3328. pRoot->appendChild(pChildTimestampSign);
  3329. pRoot->appendChild(pChildCaseType);
  3330. //pDoc->appendChild(pi);
  3331. pDoc->appendChild(pRoot);
  3332. string stringXmlContent;
  3333. int nRet = PHMS_SUCCESSFUL_RESULT;
  3334. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  3335. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3336. {
  3337. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3338. return nRet;
  3339. }
  3340. CPhmsRequestHead phmsRequestHead("10", "1020", m_stringSessionId, "11");
  3341. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  3342. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  3343. phmsRequest.GenerateAndSetSign();
  3344. CPhmsResponse phmsResponse;
  3345. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  3346. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3347. {
  3348. //写日志
  3349. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3350. return nRet;
  3351. }
  3352. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  3353. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3354. {
  3355. //写日志
  3356. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3357. return nRet;
  3358. }
  3359. return PHMS_SUCCESSFUL_RESULT;
  3360. }
  3361. int CPhmsSession::UploadReportSegment(string stringCaseId, string stringReceiverId, string stringCaseType, string stringReportId, string stringOrder, string stringTotalSize,
  3362. string stringServerUri, string stringStart1, string stringEnd1, string stringMd51, string stringStart2, string stringEnd2,
  3363. string stringMd52, string stringStart3, string stringEnd3, string stringMd53, string stringFilePath, string stringFileType)
  3364. {
  3365. AutoPtr<Document> pDoc = new Document;
  3366. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  3367. AutoPtr<Element> pRoot = pDoc->createElement("request");
  3368. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  3369. AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
  3370. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  3371. AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
  3372. AutoPtr<Element> pChildOrder = pDoc->createElement("order");
  3373. AutoPtr<Element> pChildTotalSize = pDoc->createElement("totalsize");
  3374. AutoPtr<Element> pChildServerUri = pDoc->createElement("serveruri");
  3375. AutoPtr<Element> pChildPart1 = pDoc->createElement("md51");
  3376. AutoPtr<Element> pGrandChildStart1= pDoc->createElement("start");
  3377. AutoPtr<Element> pGrandChildEnd1 = pDoc->createElement("end");
  3378. AutoPtr<Element> pGrandChildMd51 = pDoc->createElement("md5");
  3379. AutoPtr<Element> pChildPart2 = pDoc->createElement("md52");
  3380. AutoPtr<Element> pGrandChildStart2= pDoc->createElement("start");
  3381. AutoPtr<Element> pGrandChildEnd2 = pDoc->createElement("end");
  3382. AutoPtr<Element> pGrandChildMd52 = pDoc->createElement("md5");
  3383. AutoPtr<Element> pChildPart3 = pDoc->createElement("md53");
  3384. AutoPtr<Element> pGrandChildStart3= pDoc->createElement("start");
  3385. AutoPtr<Element> pGrandChildEnd3 = pDoc->createElement("end");
  3386. AutoPtr<Element> pGrandChildMd53 = pDoc->createElement("md5");
  3387. AutoPtr<Element> pChildFileType = pDoc->createElement("filetype");
  3388. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  3389. AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
  3390. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  3391. AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
  3392. AutoPtr<Text> pTextOrder = pDoc->createTextNode(stringOrder);
  3393. AutoPtr<Text> pTextTotalSize = pDoc->createTextNode(stringTotalSize);
  3394. AutoPtr<Text> pTextServerUri = pDoc->createTextNode(stringServerUri);
  3395. AutoPtr<Text> pTextStart1 = pDoc->createTextNode(stringStart1);
  3396. AutoPtr<Text> pTextEnd1 = pDoc->createTextNode(stringEnd1);
  3397. AutoPtr<Text> pTextMd51 = pDoc->createTextNode(stringMd51);
  3398. AutoPtr<Text> pTextStart2 = pDoc->createTextNode(stringStart2);
  3399. AutoPtr<Text> pTextEnd2 = pDoc->createTextNode(stringEnd2);
  3400. AutoPtr<Text> pTextMd52 = pDoc->createTextNode(stringMd52);
  3401. AutoPtr<Text> pTextStart3 = pDoc->createTextNode(stringStart3);
  3402. AutoPtr<Text> pTextEnd3 = pDoc->createTextNode(stringEnd3);
  3403. AutoPtr<Text> pTextMd53 = pDoc->createTextNode(stringMd53);
  3404. AutoPtr<Text> pTextFileType = pDoc->createTextNode(stringFileType);
  3405. pChildCaseId->appendChild(pTextCaseId);
  3406. pChildReceiverId->appendChild(pTextReceiverId);
  3407. pChildCaseType->appendChild(pTextCaseType);
  3408. pChildReportId->appendChild(pTextReportId);
  3409. pChildOrder->appendChild(pTextOrder);
  3410. pChildTotalSize->appendChild(pTextTotalSize);
  3411. pChildServerUri->appendChild(pTextServerUri);
  3412. pGrandChildStart1->appendChild(pTextStart1);
  3413. pGrandChildEnd1->appendChild(pTextEnd1);
  3414. pGrandChildMd51->appendChild(pTextMd51);
  3415. pGrandChildStart2->appendChild(pTextStart2);
  3416. pGrandChildEnd2->appendChild(pTextEnd2);
  3417. pGrandChildMd52->appendChild(pTextMd52);
  3418. pGrandChildStart3->appendChild(pTextStart3);
  3419. pGrandChildEnd3->appendChild(pTextEnd3);
  3420. pGrandChildMd53->appendChild(pTextMd53);
  3421. pChildPart1->appendChild(pGrandChildStart1);
  3422. pChildPart1->appendChild(pGrandChildEnd1);
  3423. pChildPart1->appendChild(pGrandChildMd51);
  3424. pChildPart2->appendChild(pGrandChildStart2);
  3425. pChildPart2->appendChild(pGrandChildEnd2);
  3426. pChildPart2->appendChild(pGrandChildMd52);
  3427. pChildPart3->appendChild(pGrandChildStart3);
  3428. pChildPart3->appendChild(pGrandChildEnd3);
  3429. pChildPart3->appendChild(pGrandChildMd53);
  3430. pChildFileType->appendChild(pTextFileType);
  3431. pRoot->appendChild(pChildCaseId);
  3432. pRoot->appendChild(pChildReceiverId);
  3433. pRoot->appendChild(pChildCaseType);
  3434. pRoot->appendChild(pChildReportId);
  3435. pRoot->appendChild(pChildOrder);
  3436. pRoot->appendChild(pChildTotalSize);
  3437. pRoot->appendChild(pChildServerUri);
  3438. pRoot->appendChild(pChildPart1);
  3439. pRoot->appendChild(pChildPart2);
  3440. pRoot->appendChild(pChildPart3);
  3441. pRoot->appendChild(pChildFileType);
  3442. //pDoc->appendChild(pi);
  3443. pDoc->appendChild(pRoot);
  3444. string stringXmlContent;
  3445. int nRet = PHMS_SUCCESSFUL_RESULT;
  3446. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  3447. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3448. {
  3449. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3450. return nRet;
  3451. }
  3452. CPhmsRequestHead phmsRequestHead("10", "1021", m_stringSessionId, "11");
  3453. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  3454. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, stringFilePath);
  3455. phmsRequest.GenerateAndSetSign();
  3456. CPhmsResponse phmsResponse;
  3457. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  3458. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3459. {
  3460. //写日志
  3461. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3462. return nRet;
  3463. }
  3464. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  3465. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3466. {
  3467. //写日志
  3468. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3469. return nRet;
  3470. }
  3471. return PHMS_SUCCESSFUL_RESULT;
  3472. }
  3473. int CPhmsSession::DownloadReportBegin(string stringCaseId, string stringReportId)
  3474. {
  3475. AutoPtr<Document> pDoc = new Document;
  3476. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  3477. AutoPtr<Element> pRoot = pDoc->createElement("request");
  3478. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  3479. AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
  3480. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  3481. AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
  3482. pChildCaseId->appendChild(pTextCaseId);
  3483. pChildReportId->appendChild(pTextReportId);
  3484. pRoot->appendChild(pChildCaseId);
  3485. pRoot->appendChild(pChildReportId);
  3486. //pDoc->appendChild(pi);
  3487. pDoc->appendChild(pRoot);
  3488. string stringXmlContent;
  3489. int nRet = PHMS_SUCCESSFUL_RESULT;
  3490. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  3491. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3492. {
  3493. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3494. return nRet;
  3495. }
  3496. CPhmsRequestHead phmsRequestHead("10", "1022", m_stringSessionId, "11");
  3497. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  3498. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  3499. phmsRequest.GenerateAndSetSign();
  3500. CPhmsResponse phmsResponse;
  3501. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  3502. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3503. {
  3504. //写日志
  3505. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3506. return nRet;
  3507. }
  3508. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  3509. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3510. {
  3511. //写日志
  3512. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3513. return nRet;
  3514. }
  3515. return PHMS_SUCCESSFUL_RESULT;
  3516. }
  3517. int CPhmsSession::DownloadReportComplete(string stringCaseId, string stringReportId)
  3518. {
  3519. AutoPtr<Document> pDoc = new Document;
  3520. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  3521. AutoPtr<Element> pRoot = pDoc->createElement("request");
  3522. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  3523. AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
  3524. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  3525. AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
  3526. pChildCaseId->appendChild(pTextCaseId);
  3527. pChildReportId->appendChild(pTextReportId);
  3528. pRoot->appendChild(pChildCaseId);
  3529. pRoot->appendChild(pChildReportId);
  3530. //pDoc->appendChild(pi);
  3531. pDoc->appendChild(pRoot);
  3532. string stringXmlContent;
  3533. int nRet = PHMS_SUCCESSFUL_RESULT;
  3534. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  3535. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3536. {
  3537. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3538. return nRet;
  3539. }
  3540. CPhmsRequestHead phmsRequestHead("10", "1023", m_stringSessionId, "11");
  3541. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  3542. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  3543. phmsRequest.GenerateAndSetSign();
  3544. CPhmsResponse phmsResponse;
  3545. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  3546. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3547. {
  3548. //写日志
  3549. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3550. return nRet;
  3551. }
  3552. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  3553. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3554. {
  3555. //写日志
  3556. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3557. return nRet;
  3558. }
  3559. return PHMS_SUCCESSFUL_RESULT;
  3560. }
  3561. int CPhmsSession::GetAlreadyUploadFileSize(string stringServerUri)
  3562. {
  3563. AutoPtr<Document> pDoc = new Document;
  3564. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  3565. AutoPtr<Element> pRoot = pDoc->createElement("request");
  3566. AutoPtr<Element> pChildServerUri = pDoc->createElement("serveruri");
  3567. AutoPtr<Text> pTextServerUri = pDoc->createTextNode(stringServerUri);
  3568. pChildServerUri->appendChild(pTextServerUri);
  3569. pRoot->appendChild(pChildServerUri);
  3570. //pDoc->appendChild(pi);
  3571. pDoc->appendChild(pRoot);
  3572. string stringXmlContent;
  3573. int nRet = PHMS_SUCCESSFUL_RESULT;
  3574. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  3575. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3576. {
  3577. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3578. return nRet;
  3579. }
  3580. CPhmsRequestHead phmsRequestHead("10", "1024", m_stringSessionId, "11");
  3581. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  3582. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  3583. phmsRequest.GenerateAndSetSign();
  3584. CPhmsResponse phmsResponse;
  3585. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  3586. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3587. {
  3588. //写日志
  3589. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3590. return nRet;
  3591. }
  3592. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  3593. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3594. {
  3595. //写日志
  3596. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3597. return nRet;
  3598. }
  3599. return PHMS_SUCCESSFUL_RESULT;
  3600. }
  3601. int CPhmsSession::GetReviewReportList(string stringReportStartDate, string stringReportEndDate, string stringReviewStartDate, string stringReviewEndDate,
  3602. string stringReviewState, string stringCaseType, string stringPtName, string stringSenderId, string stringYzlb, string stringAId, string stringReviewerId,
  3603. string stringReceiverId, string stringCaseId, string stringPageTo, string stringPageSize)
  3604. {
  3605. AutoPtr<Document> pDoc = new Document;
  3606. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  3607. AutoPtr<Element> pRoot = pDoc->createElement("request");
  3608. AutoPtr<Element> pChildReportStartDate = pDoc->createElement("reportstartdate");
  3609. AutoPtr<Element> pChildReportEndDate = pDoc->createElement("reportenddate");
  3610. AutoPtr<Element> pChildReviewStartDate = pDoc->createElement("reviewstartdate");
  3611. AutoPtr<Element> pChildReviewEndDate = pDoc->createElement("reviewenddate");
  3612. AutoPtr<Element> pChildReviewState = pDoc->createElement("reviewstate");
  3613. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  3614. AutoPtr<Element> pChildPtName = pDoc->createElement("ptname");
  3615. AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
  3616. AutoPtr<Element> pChildYzlb = pDoc->createElement("yzlb");
  3617. AutoPtr<Element> pChildAId = pDoc->createElement("applicationno");
  3618. AutoPtr<Element> pChildReviewerId = pDoc->createElement("reviewerid");
  3619. AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
  3620. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  3621. AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
  3622. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  3623. AutoPtr<Text> pTextReportStartDate = pDoc->createTextNode(stringReportStartDate);
  3624. AutoPtr<Text> pTextReportEndDate = pDoc->createTextNode(stringReportEndDate);
  3625. AutoPtr<Text> pTextReviewStartDate = pDoc->createTextNode(stringReviewStartDate);
  3626. AutoPtr<Text> pTextReviewEndDate = pDoc->createTextNode(stringReviewEndDate);
  3627. AutoPtr<Text> pTextReviewState = pDoc->createTextNode(stringReviewState);
  3628. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  3629. AutoPtr<Text> pTextPtName = pDoc->createTextNode(stringPtName);
  3630. AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
  3631. AutoPtr<Text> pTextYzlb = pDoc->createTextNode(stringYzlb);
  3632. AutoPtr<Text> pTextAId = pDoc->createTextNode(stringAId);
  3633. AutoPtr<Text> pTextReviewerId = pDoc->createTextNode(stringReviewerId);
  3634. AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
  3635. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  3636. AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
  3637. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  3638. pChildReportStartDate->appendChild(pTextReportStartDate);
  3639. pChildReportEndDate->appendChild(pTextReportEndDate);
  3640. pChildReviewStartDate->appendChild(pTextReviewStartDate);
  3641. pChildReviewEndDate->appendChild(pTextReviewEndDate);
  3642. pChildReviewState->appendChild(pTextReviewState);
  3643. pChildCaseType->appendChild(pTextCaseType);
  3644. pChildPtName->appendChild(pTextPtName);
  3645. pChildSenderId->appendChild(pTextSenderId);
  3646. pChildYzlb->appendChild(pTextYzlb);
  3647. pChildAId->appendChild(pTextAId);
  3648. pChildReviewerId->appendChild(pTextReviewerId);
  3649. pChildReceiverId->appendChild(pTextReceiverId);
  3650. pChildCaseId->appendChild(pTextCaseId);
  3651. pChildPageTo->appendChild(pTextPageTo);
  3652. pChildPageSize->appendChild(pTextPageSize);
  3653. pRoot->appendChild(pChildReportStartDate);
  3654. pRoot->appendChild(pChildReportEndDate);
  3655. pRoot->appendChild(pChildReviewStartDate);
  3656. pRoot->appendChild(pChildReviewEndDate);
  3657. pRoot->appendChild(pChildReviewState);
  3658. pRoot->appendChild(pChildCaseType);
  3659. pRoot->appendChild(pChildPtName);
  3660. pRoot->appendChild(pChildSenderId);
  3661. pRoot->appendChild(pChildYzlb);
  3662. pRoot->appendChild(pChildAId);
  3663. pRoot->appendChild(pChildReviewerId);
  3664. pRoot->appendChild(pChildReceiverId);
  3665. pRoot->appendChild(pChildCaseId);
  3666. pRoot->appendChild(pChildPageTo);
  3667. pRoot->appendChild(pChildPageSize);
  3668. //pDoc->appendChild(pi);
  3669. pDoc->appendChild(pRoot);
  3670. string stringXmlContent;
  3671. int nRet = PHMS_SUCCESSFUL_RESULT;
  3672. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  3673. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3674. {
  3675. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3676. return nRet;
  3677. }
  3678. CPhmsRequestHead phmsRequestHead("10", "1025", m_stringSessionId, "11");
  3679. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  3680. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  3681. phmsRequest.GenerateAndSetSign();
  3682. CPhmsResponse phmsResponse;
  3683. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  3684. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3685. {
  3686. //写日志
  3687. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3688. return nRet;
  3689. }
  3690. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  3691. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3692. {
  3693. //写日志
  3694. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3695. return nRet;
  3696. }
  3697. return PHMS_SUCCESSFUL_RESULT;
  3698. }
  3699. int CPhmsSession::ReviewReport(string stringReportId, string stringReviewState, string stringPath, string stringDiagnostic,
  3700. string stringDigitalSign, string stringTimeStampSign)
  3701. {
  3702. AutoPtr<Document> pDoc = new Document;
  3703. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  3704. AutoPtr<Element> pRoot = pDoc->createElement("request");
  3705. AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
  3706. AutoPtr<Element> pChildReviewState = pDoc->createElement("reviewstate");
  3707. AutoPtr<Element> pChildPath = pDoc->createElement("path");
  3708. AutoPtr<Element> pChildDiagnostic = pDoc->createElement("diagnostic");
  3709. AutoPtr<Element> pChildDigitalSign = pDoc->createElement("digitalsign");
  3710. AutoPtr<Element> pChildTimeStampSign = pDoc->createElement("timestampsign");
  3711. AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
  3712. AutoPtr<Text> pTextReviewState = pDoc->createTextNode(stringReviewState);
  3713. AutoPtr<Text> pTextPath = pDoc->createTextNode(stringPath);
  3714. AutoPtr<Text> pTextDiagnostic = pDoc->createTextNode(stringDiagnostic);
  3715. AutoPtr<Text> pTextDigitalSign = pDoc->createTextNode(stringDigitalSign);
  3716. AutoPtr<Text> pTextTimeStampSign = pDoc->createTextNode(stringTimeStampSign);
  3717. pChildReportId->appendChild(pTextReportId);
  3718. pChildReviewState->appendChild(pTextReviewState);
  3719. pChildPath->appendChild(pTextPath);
  3720. pChildDiagnostic->appendChild(pTextDiagnostic);
  3721. pChildDigitalSign->appendChild(pTextDigitalSign);
  3722. pChildTimeStampSign->appendChild(pTextTimeStampSign);
  3723. pRoot->appendChild(pChildReportId);
  3724. pRoot->appendChild(pChildReviewState);
  3725. pRoot->appendChild(pChildPath);
  3726. //pDoc->appendChild(pi);
  3727. pDoc->appendChild(pRoot);
  3728. string stringXmlContent;
  3729. int nRet = PHMS_SUCCESSFUL_RESULT;
  3730. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  3731. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3732. {
  3733. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3734. return nRet;
  3735. }
  3736. CPhmsRequestHead phmsRequestHead("10", "1026", m_stringSessionId, "11");
  3737. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  3738. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  3739. phmsRequest.GenerateAndSetSign();
  3740. CPhmsResponse phmsResponse;
  3741. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  3742. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3743. {
  3744. //写日志
  3745. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3746. return nRet;
  3747. }
  3748. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  3749. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3750. {
  3751. //写日志
  3752. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3753. return nRet;
  3754. }
  3755. return PHMS_SUCCESSFUL_RESULT;
  3756. }
  3757. int CPhmsSession::GetReportStateOfCase(string stringCaseId)
  3758. {
  3759. AutoPtr<Document> pDoc = new Document;
  3760. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  3761. AutoPtr<Element> pRoot = pDoc->createElement("request");
  3762. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  3763. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  3764. pChildCaseId->appendChild(pTextCaseId);
  3765. pRoot->appendChild(pChildCaseId);
  3766. //pDoc->appendChild(pi);
  3767. pDoc->appendChild(pRoot);
  3768. string stringXmlContent;
  3769. int nRet = PHMS_SUCCESSFUL_RESULT;
  3770. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  3771. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3772. {
  3773. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3774. return nRet;
  3775. }
  3776. CPhmsRequestHead phmsRequestHead("10", "1027", m_stringSessionId, "11");
  3777. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  3778. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  3779. phmsRequest.GenerateAndSetSign();
  3780. CPhmsResponse phmsResponse;
  3781. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  3782. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3783. {
  3784. //写日志
  3785. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3786. return nRet;
  3787. }
  3788. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  3789. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3790. {
  3791. //写日志
  3792. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3793. return nRet;
  3794. }
  3795. return PHMS_SUCCESSFUL_RESULT;
  3796. }
  3797. int CPhmsSession::GetCaseListOfDoctor(string stringCaseId, string stringCaseType, string stringCaseSource, string stringCaseState, string stringPatientName,
  3798. string stringSenderId, string stringReceiverId, string stringStartDate, string stringEndDate, string stringCheckStartDate, string stringCheckEndDate,
  3799. string stringSenderName, string stringDiagnostic, string stringCaseOrigin, string stringYzlb, string stringAId, string stringSex, string stringOrderBy, string stringThirdId,
  3800. string stringLang, string stringIsFullName, string stringPageTo, string stringPageSize)
  3801. {
  3802. AutoPtr<Document> pDoc = new Document;
  3803. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  3804. AutoPtr<Element> pRoot = pDoc->createElement("request");
  3805. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  3806. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  3807. AutoPtr<Element> pChildCaseSource = pDoc->createElement("casesource");
  3808. AutoPtr<Element> pChildCaseState = pDoc->createElement("casestate");
  3809. AutoPtr<Element> pChildPatientName = pDoc->createElement("ptname");
  3810. AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
  3811. AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
  3812. AutoPtr<Element> pChildStartDate = pDoc->createElement("startdate");
  3813. AutoPtr<Element> pChildEndDate = pDoc->createElement("enddate");
  3814. AutoPtr<Element> pChildCheckStartDate = pDoc->createElement("checkstartdate");
  3815. AutoPtr<Element> pChildCheckEndDate = pDoc->createElement("checkenddate");
  3816. AutoPtr<Element> pChildSenderName = pDoc->createElement("sendername");
  3817. AutoPtr<Element> pChildDiagnostic = pDoc->createElement("diagnostic");
  3818. AutoPtr<Element> pChildCaseOrigin = pDoc->createElement("caseorigin");
  3819. AutoPtr<Element> pChildYzlb = pDoc->createElement("yzlb");
  3820. AutoPtr<Element> pChildAId = pDoc->createElement("applicationno");
  3821. AutoPtr<Element> pChildSex = pDoc->createElement("sex");
  3822. AutoPtr<Element> pChildOrderBy = pDoc->createElement("orderby");
  3823. AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
  3824. AutoPtr<Element> pChildLang = pDoc->createElement("lang");
  3825. AutoPtr<Element> PChildIsFullName = pDoc->createElement("isfullname");
  3826. AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
  3827. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  3828. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  3829. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  3830. AutoPtr<Text> pTextCaseSource = pDoc->createTextNode(stringCaseSource);
  3831. AutoPtr<Text> pTextCaseState = pDoc->createTextNode(stringCaseState);
  3832. AutoPtr<Text> pTextPatientName = pDoc->createTextNode(stringPatientName);
  3833. AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
  3834. AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
  3835. AutoPtr<Text> pTextStartDate = pDoc->createTextNode(stringStartDate);
  3836. AutoPtr<Text> pTextEndDate = pDoc->createTextNode(stringEndDate);
  3837. AutoPtr<Text> pTextCheckStartDate = pDoc->createTextNode(stringCheckStartDate);
  3838. AutoPtr<Text> pTextCheckEndDate = pDoc->createTextNode(stringCheckEndDate);
  3839. AutoPtr<Text> pTextSenderName = pDoc->createTextNode(stringSenderName);
  3840. AutoPtr<Text> pTextDiagnostic = pDoc->createTextNode(stringDiagnostic);
  3841. AutoPtr<Text> pTextCaseOrigin = pDoc->createTextNode(stringCaseOrigin);
  3842. AutoPtr<Text> pTextYzlb = pDoc->createTextNode(stringYzlb);
  3843. AutoPtr<Text> pTextAId = pDoc->createTextNode(stringAId);
  3844. AutoPtr<Text> pTextSex = pDoc->createTextNode(stringSex);
  3845. AutoPtr<Text> pTextOrderBy = pDoc->createTextNode(stringOrderBy);
  3846. AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
  3847. AutoPtr<Text> pTextLang = pDoc->createTextNode(stringLang);
  3848. AutoPtr<Text> PTextIsFullName = pDoc->createTextNode(stringIsFullName);
  3849. AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
  3850. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  3851. pChildCaseId->appendChild(pTextCaseId);
  3852. pChildCaseType->appendChild(pTextCaseType);
  3853. pChildCaseSource->appendChild(pTextCaseSource);
  3854. pChildCaseState->appendChild(pTextCaseState);
  3855. pChildPatientName->appendChild(pTextPatientName);
  3856. pChildSenderId->appendChild(pTextSenderId);
  3857. pChildReceiverId->appendChild(pTextReceiverId);
  3858. pChildStartDate->appendChild(pTextStartDate);
  3859. pChildEndDate->appendChild(pTextEndDate);
  3860. pChildCheckStartDate->appendChild(pTextCheckStartDate);
  3861. pChildCheckEndDate->appendChild(pTextCheckEndDate);
  3862. pChildSenderName->appendChild(pTextSenderName);
  3863. pChildDiagnostic->appendChild(pTextDiagnostic);
  3864. pChildCaseOrigin->appendChild(pTextCaseOrigin);
  3865. pChildYzlb->appendChild(pTextYzlb);
  3866. pChildAId->appendChild(pTextAId);
  3867. pChildSex->appendChild(pTextSex);
  3868. pChildOrderBy->appendChild(pTextOrderBy);
  3869. pChildThirdId->appendChild(pTextThirdId);
  3870. pChildLang->appendChild(pTextLang);
  3871. PChildIsFullName->appendChild(PTextIsFullName);
  3872. pChildPageTo->appendChild(pTextPageTo);
  3873. pChildPageSize->appendChild(pTextPageSize);
  3874. pRoot->appendChild(pChildCaseId);
  3875. pRoot->appendChild(pChildCaseType);
  3876. pRoot->appendChild(pChildCaseSource);
  3877. pRoot->appendChild(pChildCaseState);
  3878. pRoot->appendChild(pChildPatientName);
  3879. pRoot->appendChild(pChildSenderId);
  3880. pRoot->appendChild(pChildReceiverId);
  3881. pRoot->appendChild(pChildStartDate);
  3882. pRoot->appendChild(pChildEndDate);
  3883. pRoot->appendChild(pChildCheckStartDate);
  3884. pRoot->appendChild(pChildCheckEndDate);
  3885. pRoot->appendChild(pChildSenderName);
  3886. pRoot->appendChild(pChildDiagnostic);
  3887. pRoot->appendChild(pChildCaseOrigin);
  3888. pRoot->appendChild(pChildYzlb);
  3889. pRoot->appendChild(pChildAId);
  3890. pRoot->appendChild(pChildSex);
  3891. pRoot->appendChild(pChildOrderBy);
  3892. pRoot->appendChild(pChildThirdId);
  3893. pRoot->appendChild(pChildLang);
  3894. pRoot->appendChild(PChildIsFullName);
  3895. pRoot->appendChild(pChildPageTo);
  3896. pRoot->appendChild(pChildPageSize);
  3897. //pDoc->appendChild(pi);
  3898. pDoc->appendChild(pRoot);
  3899. string stringXmlContent;
  3900. int nRet = PHMS_SUCCESSFUL_RESULT;
  3901. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  3902. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3903. {
  3904. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3905. return nRet;
  3906. }
  3907. CPhmsRequestHead phmsRequestHead("10", "1028", m_stringSessionId, "11");
  3908. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  3909. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  3910. phmsRequest.GenerateAndSetSign();
  3911. CPhmsResponse phmsResponse;
  3912. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  3913. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3914. {
  3915. //写日志
  3916. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3917. return nRet;
  3918. }
  3919. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  3920. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3921. {
  3922. //写日志
  3923. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3924. return nRet;
  3925. }
  3926. return PHMS_SUCCESSFUL_RESULT;
  3927. }
  3928. int CPhmsSession::GetHospitalInfo(string stringHospitalId)
  3929. {
  3930. AutoPtr<Document> pDoc = new Document;
  3931. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  3932. AutoPtr<Element> pRoot = pDoc->createElement("request");
  3933. AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
  3934. AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
  3935. pChildHospitalId->appendChild(pTextHospitalId);
  3936. pRoot->appendChild(pChildHospitalId);
  3937. //pDoc->appendChild(pi);
  3938. pDoc->appendChild(pRoot);
  3939. string stringXmlContent;
  3940. int nRet = PHMS_SUCCESSFUL_RESULT;
  3941. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  3942. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3943. {
  3944. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3945. return nRet;
  3946. }
  3947. CPhmsRequestHead phmsRequestHead("10", "1029", m_stringSessionId, "11");
  3948. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  3949. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  3950. phmsRequest.GenerateAndSetSign();
  3951. CPhmsResponse phmsResponse;
  3952. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  3953. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3954. {
  3955. //写日志
  3956. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3957. return nRet;
  3958. }
  3959. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  3960. if(nRet != PHMS_SUCCESSFUL_RESULT)
  3961. {
  3962. //写日志
  3963. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  3964. return nRet;
  3965. }
  3966. return PHMS_SUCCESSFUL_RESULT;
  3967. }
  3968. int CPhmsSession::UploadIm(string stringSenderId, string stringSenderName, string stringReceiverId, string stringMsgDirection, string stringMsgType,
  3969. string stringMsgContent, string stringCaseId, string stringCaseType)
  3970. {
  3971. AutoPtr<Document> pDoc = new Document;
  3972. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  3973. AutoPtr<Element> pRoot = pDoc->createElement("request");
  3974. AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
  3975. AutoPtr<Element> pChildSenderName = pDoc->createElement("sendername");
  3976. AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
  3977. AutoPtr<Element> pChildMsgDirection = pDoc->createElement("msgdirection");
  3978. AutoPtr<Element> pChildMsgType = pDoc->createElement("msgtype");
  3979. AutoPtr<Element> pChildMstContent = pDoc->createElement("msgcontent");
  3980. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  3981. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  3982. AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
  3983. AutoPtr<Text> pTextSenderName = pDoc->createTextNode(stringSenderName);
  3984. AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
  3985. AutoPtr<Text> pTextMsgDirection = pDoc->createTextNode(stringMsgDirection);
  3986. AutoPtr<Text> pTextMsgType = pDoc->createTextNode(stringMsgType);
  3987. AutoPtr<Text> pTextMsgContent = pDoc->createTextNode(stringMsgContent);
  3988. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  3989. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  3990. pChildSenderId->appendChild(pTextSenderId);
  3991. pChildSenderName->appendChild(pTextSenderName);
  3992. pChildReceiverId->appendChild(pTextReceiverId);
  3993. pChildMsgDirection->appendChild(pTextMsgDirection);
  3994. pChildMsgType->appendChild(pTextMsgType);
  3995. pChildMstContent->appendChild(pTextMsgContent);
  3996. pChildCaseId->appendChild(pTextCaseId);
  3997. pChildCaseType->appendChild(pTextCaseType);
  3998. pRoot->appendChild(pChildSenderId);
  3999. pRoot->appendChild(pChildSenderName);
  4000. pRoot->appendChild(pChildReceiverId);
  4001. pRoot->appendChild(pChildMsgDirection);
  4002. pRoot->appendChild(pChildMsgType);
  4003. pRoot->appendChild(pChildMstContent);
  4004. pRoot->appendChild(pChildCaseId);
  4005. pRoot->appendChild(pChildCaseType);
  4006. //pDoc->appendChild(pi);
  4007. pDoc->appendChild(pRoot);
  4008. string stringXmlContent;
  4009. int nRet = PHMS_SUCCESSFUL_RESULT;
  4010. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  4011. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4012. {
  4013. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4014. return nRet;
  4015. }
  4016. CPhmsRequestHead phmsRequestHead("10", "1030", m_stringSessionId, "11");
  4017. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  4018. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  4019. phmsRequest.GenerateAndSetSign();
  4020. CPhmsResponse phmsResponse;
  4021. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  4022. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4023. {
  4024. //写日志
  4025. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4026. return nRet;
  4027. }
  4028. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  4029. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4030. {
  4031. //写日志
  4032. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4033. return nRet;
  4034. }
  4035. return PHMS_SUCCESSFUL_RESULT;
  4036. }
  4037. int CPhmsSession::GetImList(string stringSenderId, string stringCaseId, string stringCaseType, string stringMsgDirection, string stringMsgType)
  4038. {
  4039. AutoPtr<Document> pDoc = new Document;
  4040. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  4041. AutoPtr<Element> pRoot = pDoc->createElement("request");
  4042. AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
  4043. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  4044. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  4045. AutoPtr<Element> pChildMsgType = pDoc->createElement("msgtype");
  4046. AutoPtr<Element> pChildMsgDirection = pDoc->createElement("msgdirection");
  4047. AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
  4048. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  4049. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  4050. AutoPtr<Text> pTextMsgType = pDoc->createTextNode(stringMsgType);
  4051. AutoPtr<Text> pTextMsgDirection = pDoc->createTextNode(stringMsgDirection);
  4052. pChildSenderId->appendChild(pTextSenderId);
  4053. pChildCaseId->appendChild(pTextCaseId);
  4054. pChildCaseType->appendChild(pTextCaseType);
  4055. pChildMsgType->appendChild(pTextMsgType);
  4056. pChildMsgDirection->appendChild(pTextMsgDirection);
  4057. pRoot->appendChild(pChildSenderId);
  4058. pRoot->appendChild(pChildCaseId);
  4059. pRoot->appendChild(pChildCaseType);
  4060. pRoot->appendChild(pChildMsgType);
  4061. pRoot->appendChild(pChildMsgDirection);
  4062. //pDoc->appendChild(pi);
  4063. pDoc->appendChild(pRoot);
  4064. string stringXmlContent;
  4065. int nRet = PHMS_SUCCESSFUL_RESULT;
  4066. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  4067. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4068. {
  4069. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4070. return nRet;
  4071. }
  4072. CPhmsRequestHead phmsRequestHead("10", "1031", m_stringSessionId, "11");
  4073. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  4074. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  4075. phmsRequest.GenerateAndSetSign();
  4076. CPhmsResponse phmsResponse;
  4077. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  4078. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4079. {
  4080. //写日志
  4081. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4082. return nRet;
  4083. }
  4084. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  4085. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4086. {
  4087. //写日志
  4088. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4089. return nRet;
  4090. }
  4091. return PHMS_SUCCESSFUL_RESULT;
  4092. }
  4093. int CPhmsSession::GetImList2(string stringNextId)
  4094. {
  4095. AutoPtr<Document> pDoc = new Document;
  4096. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  4097. AutoPtr<Element> pRoot = pDoc->createElement("request");
  4098. AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
  4099. AutoPtr<Element> pChildVersion = pDoc->createElement("version");
  4100. AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
  4101. AutoPtr<Text> pTextVersion = pDoc->createTextNode("2");
  4102. pChildNextId->appendChild(pTextNextId);
  4103. pChildVersion->appendChild(pTextVersion);
  4104. pRoot->appendChild(pChildNextId);
  4105. pRoot->appendChild(pChildVersion);
  4106. //pDoc->appendChild(pi);
  4107. pDoc->appendChild(pRoot);
  4108. string stringXmlContent;
  4109. int nRet = PHMS_SUCCESSFUL_RESULT;
  4110. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  4111. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4112. {
  4113. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4114. return nRet;
  4115. }
  4116. CPhmsRequestHead phmsRequestHead("10", "1031", m_stringSessionId, "11");
  4117. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  4118. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  4119. phmsRequest.GenerateAndSetSign();
  4120. CPhmsResponse phmsResponse;
  4121. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  4122. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4123. {
  4124. //写日志
  4125. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4126. return nRet;
  4127. }
  4128. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  4129. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4130. {
  4131. //写日志
  4132. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4133. return nRet;
  4134. }
  4135. return PHMS_SUCCESSFUL_RESULT;
  4136. }
  4137. int CPhmsSession::ImDownloadComplete(string stringId)
  4138. {
  4139. AutoPtr<Document> pDoc = new Document;
  4140. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  4141. AutoPtr<Element> pRoot = pDoc->createElement("request");
  4142. AutoPtr<Element> pChildId = pDoc->createElement("id");
  4143. AutoPtr<Text> pTextId = pDoc->createTextNode(stringId);
  4144. pChildId->appendChild(pTextId);
  4145. pRoot->appendChild(pChildId);
  4146. //pDoc->appendChild(pi);
  4147. pDoc->appendChild(pRoot);
  4148. string stringXmlContent;
  4149. int nRet = PHMS_SUCCESSFUL_RESULT;
  4150. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  4151. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4152. {
  4153. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4154. return nRet;
  4155. }
  4156. CPhmsRequestHead phmsRequestHead("10", "1032", m_stringSessionId, "11");
  4157. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  4158. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  4159. phmsRequest.GenerateAndSetSign();
  4160. CPhmsResponse phmsResponse;
  4161. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  4162. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4163. {
  4164. //写日志
  4165. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4166. return nRet;
  4167. }
  4168. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  4169. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4170. {
  4171. //写日志
  4172. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4173. return nRet;
  4174. }
  4175. return PHMS_SUCCESSFUL_RESULT;
  4176. }
  4177. int CPhmsSession::SendPhoneMsg(string stringCaseId, string stringPhone, string stringMsg)
  4178. {
  4179. AutoPtr<Document> pDoc = new Document;
  4180. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  4181. AutoPtr<Element> pRoot = pDoc->createElement("request");
  4182. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  4183. AutoPtr<Element> pChildPhone = pDoc->createElement("phone");
  4184. AutoPtr<Element> pChildMsg = pDoc->createElement("msg");
  4185. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  4186. AutoPtr<Text> pTextPhone = pDoc->createTextNode(stringPhone);
  4187. AutoPtr<Text> pTextMsg = pDoc->createTextNode(stringMsg);
  4188. pChildCaseId->appendChild(pTextCaseId);
  4189. pChildPhone->appendChild(pTextPhone);
  4190. pChildMsg->appendChild(pTextMsg);
  4191. pRoot->appendChild(pChildCaseId);
  4192. pRoot->appendChild(pChildPhone);
  4193. pRoot->appendChild(pChildMsg);
  4194. //pDoc->appendChild(pi);
  4195. pDoc->appendChild(pRoot);
  4196. string stringXmlContent;
  4197. int nRet = PHMS_SUCCESSFUL_RESULT;
  4198. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  4199. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4200. {
  4201. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4202. return nRet;
  4203. }
  4204. CPhmsRequestHead phmsRequestHead("10", "1033", m_stringSessionId, "11");
  4205. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  4206. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  4207. phmsRequest.GenerateAndSetSign();
  4208. CPhmsResponse phmsResponse;
  4209. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  4210. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4211. {
  4212. //写日志
  4213. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4214. return nRet;
  4215. }
  4216. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  4217. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4218. {
  4219. //写日志
  4220. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4221. return nRet;
  4222. }
  4223. return PHMS_SUCCESSFUL_RESULT;
  4224. }
  4225. int CPhmsSession::UploadTrendData(string stringCardId, string stringDeviceId, string stringDeviceName, string stringCaseId, vector<RECORD_DATA> vRecordData)
  4226. {
  4227. AutoPtr<Document> pDoc = new Document;
  4228. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  4229. AutoPtr<Element> pRoot = pDoc->createElement("request");
  4230. AutoPtr<Element> pChildCardId = pDoc->createElement("cardid");
  4231. AutoPtr<Element> pChildDeviceId = pDoc->createElement("deviceid");
  4232. AutoPtr<Element> pChildDeviceName = pDoc->createElement("devicename");
  4233. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  4234. AutoPtr<Text> pTextCardId = pDoc->createTextNode(stringCardId);
  4235. AutoPtr<Text> pTextDeviceId = pDoc->createTextNode(stringDeviceId);
  4236. AutoPtr<Text> pTextDeviceName = pDoc->createTextNode(stringDeviceName);
  4237. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  4238. pChildCardId->appendChild(pTextCardId);
  4239. pChildDeviceId->appendChild(pTextDeviceId);
  4240. pChildDeviceName->appendChild(pTextDeviceName);
  4241. pChildCaseId->appendChild(pTextCaseId);
  4242. pRoot->appendChild(pChildCardId);
  4243. pRoot->appendChild(pChildDeviceId);
  4244. pRoot->appendChild(pChildDeviceName);
  4245. pRoot->appendChild(pChildCaseId);
  4246. //构造pChildRecord
  4247. vector<RECORD_DATA>::const_iterator iter;
  4248. for(iter=vRecordData.begin(); iter!=vRecordData.end(); iter++)
  4249. {
  4250. AutoPtr<Element> pChildRecord = pDoc->createElement("record");
  4251. AutoPtr<Element> pGrandHr = pDoc->createElement("hr");
  4252. AutoPtr<Element> pGrandWeight = pDoc->createElement("weight");
  4253. AutoPtr<Element> pGrandHeight = pDoc->createElement("height");
  4254. AutoPtr<Element> pGrandTemp = pDoc->createElement("temp");
  4255. AutoPtr<Element> pGrandResp = pDoc->createElement("resp");
  4256. AutoPtr<Element> pGrandChol = pDoc->createElement("chol");
  4257. AutoPtr<Element> pGrandUa = pDoc->createElement("ua");
  4258. AutoPtr<Element> pGrandBloodSugar = pDoc->createElement("bloodsugar");
  4259. AutoPtr<Element> pGrand2BloodSugar = pDoc->createElement("bloodsugar");
  4260. AutoPtr<Element> pGrand2Flag = pDoc->createElement("flag");
  4261. AutoPtr<Element> pGrandSpo2 = pDoc->createElement("spo2");
  4262. AutoPtr<Element> pGrand2Spo2 = pDoc->createElement("spo2");
  4263. AutoPtr<Element> pGrand2Pr = pDoc->createElement("pr");
  4264. AutoPtr<Element> pGrandBp = pDoc->createElement("bp");
  4265. AutoPtr<Element> pGrand2Sys = pDoc->createElement("sys");
  4266. AutoPtr<Element> pGrand2Mean = pDoc->createElement("mean");
  4267. AutoPtr<Element> pGrand2Dia = pDoc->createElement("dia");
  4268. AutoPtr<Element> pGrandFetal = pDoc->createElement("fetal");
  4269. AutoPtr<Element> pGrand2FetalHeartRate = pDoc->createElement("fetalheartrate");
  4270. AutoPtr<Element> pGrand2PalacePressure = pDoc->createElement("palacepressure");
  4271. AutoPtr<Element> pGrand2Quickening = pDoc->createElement("quickening");
  4272. AutoPtr<Element> pGrandFvc = pDoc->createElement("fvc");
  4273. AutoPtr<Element> pGrand2Fvc = pDoc->createElement("fvc");
  4274. AutoPtr<Element> pGrand2Fev1 = pDoc->createElement("fev1");
  4275. AutoPtr<Element> pGrand2Pef = pDoc->createElement("pef");
  4276. AutoPtr<Element> pGrand2Fev1Rate = pDoc->createElement("fev1rate");
  4277. AutoPtr<Element> pGrand2Fef25 = pDoc->createElement("fef25");
  4278. AutoPtr<Element> pGrand2Fef2575 = pDoc->createElement("fef2575");
  4279. AutoPtr<Element> pGrand2Fef75 = pDoc->createElement("fef75");
  4280. AutoPtr<Element> pGrandPedometer = pDoc->createElement("pedometer");
  4281. AutoPtr<Element> pGrand2Steps = pDoc->createElement("steps");
  4282. AutoPtr<Element> pGrand2Distance = pDoc->createElement("distance");
  4283. AutoPtr<Element> pGrand2Calories = pDoc->createElement("calories");
  4284. AutoPtr<Element> pGrandUrine = pDoc->createElement("urine");
  4285. AutoPtr<Element> pGrand2Value = pDoc->createElement("value");
  4286. AutoPtr<Element> pGrand2ValueAdd = pDoc->createElement("valueadd");
  4287. AutoPtr<Element> pGrand2ValueNew = pDoc->createElement("valuenew");
  4288. AutoPtr<Element> pGrandHrConclusion = pDoc->createElement("hrconclusion");
  4289. AutoPtr<Element> pGrand2HrValue = pDoc->createElement("value");
  4290. AutoPtr<Element> pGrand2Conclusion = pDoc->createElement("conclusion");
  4291. AutoPtr<Element> pGrandBloodTest = pDoc->createElement("blood_test");
  4292. AutoPtr<Element> pGrand2CHOL = pDoc->createElement("CHOL");
  4293. AutoPtr<Element> pGrand2HDL = pDoc->createElement("HDL");
  4294. AutoPtr<Element> pGrand2TG = pDoc->createElement("TG");
  4295. AutoPtr<Element> pGrand2LDL = pDoc->createElement("LDL");
  4296. AutoPtr<Element> pGrand2HB = pDoc->createElement("HB");
  4297. AutoPtr<Element> pGrand2HCT = pDoc->createElement("HCT");
  4298. AutoPtr<Element> pGrandChekcTime = pDoc->createElement("checktime");
  4299. AutoPtr<Text> pTextHr = pDoc->createTextNode(CUtil::DoubleToString(iter->hr));
  4300. AutoPtr<Text> pTextWeight = pDoc->createTextNode(CUtil::DoubleToString(iter->weight));
  4301. AutoPtr<Text> pTextHeight = pDoc->createTextNode(CUtil::DoubleToString(iter->height));
  4302. AutoPtr<Text> pTextTemp = pDoc->createTextNode(CUtil::DoubleToString(iter->temp));
  4303. AutoPtr<Text> pTextResp = pDoc->createTextNode(CUtil::DoubleToString(iter->resp));
  4304. AutoPtr<Text> pTextChol = pDoc->createTextNode(CUtil::DoubleToString(iter->chol));
  4305. AutoPtr<Text> pTextUa = pDoc->createTextNode(CUtil::DoubleToString(iter->ua));
  4306. AutoPtr<Text> pTextBloodSugar = pDoc->createTextNode(CUtil::DoubleToString(iter->bloodsugerData.bloodsuger));
  4307. AutoPtr<Text> pTextFlag = pDoc->createTextNode(iter->bloodsugerData.flag);
  4308. AutoPtr<Text> pTextSpo2 = pDoc->createTextNode(CUtil::DoubleToString(iter->spo2Data.spo2));
  4309. AutoPtr<Text> pTextPr = pDoc->createTextNode(CUtil::DoubleToString(iter->spo2Data.pr));
  4310. AutoPtr<Text> pTextSys = pDoc->createTextNode(CUtil::DoubleToString(iter->bpData.sys));
  4311. AutoPtr<Text> pTextMean = pDoc->createTextNode(CUtil::DoubleToString(iter->bpData.mean));
  4312. AutoPtr<Text> pTextDia = pDoc->createTextNode(CUtil::DoubleToString(iter->bpData.dia));
  4313. AutoPtr<Text> pTextFetalHeartRate = pDoc->createTextNode(CUtil::DoubleToString(iter->fetalData.fetalHeartRate));
  4314. AutoPtr<Text> pTextPalacePressure = pDoc->createTextNode(CUtil::DoubleToString(iter->fetalData.palacePressure));
  4315. AutoPtr<Text> pTextQuickening = pDoc->createTextNode(CUtil::DoubleToString(iter->fetalData.quickening));
  4316. AutoPtr<Text> pTextFvc = pDoc->createTextNode(CUtil::DoubleToString(iter->fvcData.fvc));
  4317. AutoPtr<Text> pTextFev1 = pDoc->createTextNode(CUtil::DoubleToString(iter->fvcData.fev1));
  4318. AutoPtr<Text> pTextPef = pDoc->createTextNode(CUtil::DoubleToString(iter->fvcData.pef));
  4319. AutoPtr<Text> pTextFev1Rate = pDoc->createTextNode(CUtil::DoubleToString(iter->fvcData.fev1Rate));
  4320. AutoPtr<Text> pTextFef25 = pDoc->createTextNode(CUtil::DoubleToString(iter->fvcData.fef25));
  4321. AutoPtr<Text> pTextFef2575 = pDoc->createTextNode(CUtil::DoubleToString(iter->fvcData.fef2575));
  4322. AutoPtr<Text> pTextFef75 = pDoc->createTextNode(CUtil::DoubleToString(iter->fvcData.fef75));
  4323. AutoPtr<Text> pTextSteps = pDoc->createTextNode(CUtil::DoubleToString(iter->pedometerData.setps));
  4324. AutoPtr<Text> pTextDistance = pDoc->createTextNode(CUtil::DoubleToString(iter->pedometerData.distance));
  4325. AutoPtr<Text> pTextCalories = pDoc->createTextNode(CUtil::DoubleToString(iter->pedometerData.calories));
  4326. AutoPtr<Text> pTextValue = pDoc->createTextNode(iter->urineData.urineValue);
  4327. AutoPtr<Text> pTextValueAdd = pDoc->createTextNode(iter->urineData.urineValueAdd);
  4328. AutoPtr<Text> pTextValueNew = pDoc->createTextNode(iter->urineData.urineValueNew);
  4329. AutoPtr<Text> pTextHrValue = pDoc->createTextNode(CUtil::DoubleToString(iter->hrConclusion.vaule));
  4330. AutoPtr<Text> pTextConclusion = pDoc->createTextNode(iter->hrConclusion.conclusion);
  4331. AutoPtr<Text> pTextCHOL = pDoc->createTextNode(CUtil::DoubleToString(iter->bloodTest.CHOL));
  4332. AutoPtr<Text> pTextHDL = pDoc->createTextNode(CUtil::DoubleToString(iter->bloodTest.HDL));
  4333. AutoPtr<Text> pTextTG = pDoc->createTextNode(CUtil::DoubleToString(iter->bloodTest.TG));
  4334. AutoPtr<Text> pTextLDL = pDoc->createTextNode(CUtil::DoubleToString(iter->bloodTest.LDL));
  4335. AutoPtr<Text> pTextHB = pDoc->createTextNode(CUtil::DoubleToString(iter->bloodTest.HB));
  4336. AutoPtr<Text> pTextHCT = pDoc->createTextNode(CUtil::DoubleToString(iter->bloodTest.HCT));
  4337. AutoPtr<Text> pTextCheckTime = pDoc->createTextNode(iter->checkTime);
  4338. pGrandHr->appendChild(pTextHr);
  4339. pGrandWeight->appendChild(pTextWeight);
  4340. pGrandHeight->appendChild(pTextHeight);
  4341. pGrandTemp->appendChild(pTextTemp);
  4342. pGrandResp->appendChild(pTextResp);
  4343. pGrandChol->appendChild(pTextChol);
  4344. pGrandUa->appendChild(pTextUa);
  4345. pGrand2BloodSugar->appendChild(pTextBloodSugar);
  4346. pGrand2Flag->appendChild(pTextFlag);
  4347. pGrandBloodSugar->appendChild(pGrand2BloodSugar);
  4348. pGrandBloodSugar->appendChild(pGrand2Flag);
  4349. pGrand2Spo2->appendChild(pTextSpo2);
  4350. pGrand2Pr->appendChild(pTextPr);
  4351. pGrandSpo2->appendChild(pGrand2Spo2);
  4352. pGrandSpo2->appendChild(pGrand2Pr);
  4353. pGrand2Sys->appendChild(pTextSys);
  4354. pGrand2Mean->appendChild(pTextMean);
  4355. pGrand2Dia->appendChild(pTextDia);
  4356. pGrandBp->appendChild(pGrand2Sys);
  4357. pGrandBp->appendChild(pGrand2Mean);
  4358. pGrandBp->appendChild(pGrand2Dia);
  4359. pGrand2FetalHeartRate->appendChild(pTextFetalHeartRate);
  4360. pGrand2PalacePressure->appendChild(pTextPalacePressure);
  4361. pGrand2Quickening->appendChild(pTextQuickening);
  4362. pGrandFetal->appendChild(pGrand2FetalHeartRate);
  4363. pGrandFetal->appendChild(pGrand2PalacePressure);
  4364. pGrandFetal->appendChild(pGrand2Quickening);
  4365. pGrand2Fvc->appendChild(pTextFvc);
  4366. pGrand2Fev1->appendChild(pTextFev1);
  4367. pGrand2Pef->appendChild(pTextPef);
  4368. pGrand2Fev1Rate->appendChild(pTextFev1Rate);
  4369. pGrand2Fef25->appendChild(pTextFef25);
  4370. pGrand2Fef2575->appendChild(pTextFef2575);
  4371. pGrand2Fef75->appendChild(pTextFef75);
  4372. pGrandFvc->appendChild(pGrand2Fvc);
  4373. pGrandFvc->appendChild(pGrand2Fev1);
  4374. pGrandFvc->appendChild(pGrand2Pef);
  4375. pGrandFvc->appendChild(pGrand2Fev1Rate);
  4376. pGrandFvc->appendChild(pGrand2Fef25);
  4377. pGrandFvc->appendChild(pGrand2Fef2575);
  4378. pGrandFvc->appendChild(pGrand2Fef75);
  4379. pGrand2Steps->appendChild(pTextSteps);
  4380. pGrand2Distance->appendChild(pTextDistance);
  4381. pGrand2Calories->appendChild(pTextCalories);
  4382. pGrandPedometer->appendChild(pGrand2Steps);
  4383. pGrandPedometer->appendChild(pGrand2Distance);
  4384. pGrandPedometer->appendChild(pGrand2Calories);
  4385. pGrand2Value->appendChild(pTextValue);
  4386. pGrand2ValueAdd->appendChild(pTextValueAdd);
  4387. pGrand2ValueNew->appendChild(pTextValueNew);
  4388. pGrandUrine->appendChild(pGrand2Value);
  4389. pGrandUrine->appendChild(pGrand2ValueAdd);
  4390. pGrandUrine->appendChild(pGrand2ValueNew);
  4391. pGrand2HrValue->appendChild(pTextHrValue);
  4392. pGrand2Conclusion->appendChild(pTextConclusion);
  4393. pGrandHrConclusion->appendChild(pGrand2HrValue);
  4394. pGrandHrConclusion->appendChild(pGrand2Conclusion);
  4395. pGrand2CHOL->appendChild(pTextCHOL);
  4396. pGrand2HDL->appendChild(pTextHDL);
  4397. pGrand2TG->appendChild(pTextTG);
  4398. pGrand2LDL->appendChild(pTextLDL);
  4399. pGrand2HB->appendChild(pTextHB);
  4400. pGrand2HCT->appendChild(pTextHCT);
  4401. pGrandBloodTest->appendChild(pGrand2CHOL);
  4402. pGrandBloodTest->appendChild(pGrand2HDL);
  4403. pGrandBloodTest->appendChild(pGrand2TG);
  4404. pGrandBloodTest->appendChild(pGrand2LDL);
  4405. pGrandBloodTest->appendChild(pGrand2HB);
  4406. pGrandBloodTest->appendChild(pGrand2HCT);
  4407. pGrandChekcTime->appendChild(pTextCheckTime);
  4408. pChildRecord->appendChild(pGrandHr);
  4409. pChildRecord->appendChild(pGrandWeight);
  4410. pChildRecord->appendChild(pGrandHeight);
  4411. pChildRecord->appendChild(pGrandTemp);
  4412. pChildRecord->appendChild(pGrandResp);
  4413. pChildRecord->appendChild(pGrandChol);
  4414. pChildRecord->appendChild(pGrandUa);
  4415. pChildRecord->appendChild(pGrandBloodSugar);
  4416. pChildRecord->appendChild(pGrandSpo2);
  4417. pChildRecord->appendChild(pGrandBp);
  4418. pChildRecord->appendChild(pGrandFetal);
  4419. pChildRecord->appendChild(pGrandFvc);
  4420. pChildRecord->appendChild(pGrandPedometer);
  4421. pChildRecord->appendChild(pGrandUrine);
  4422. pChildRecord->appendChild(pGrandHrConclusion);
  4423. pChildRecord->appendChild(pGrandBloodTest);
  4424. pChildRecord->appendChild(pGrandChekcTime);
  4425. pRoot->appendChild(pChildRecord);
  4426. }
  4427. //pDoc->appendChild(pi);
  4428. pDoc->appendChild(pRoot);
  4429. string stringXmlContent;
  4430. int nRet = PHMS_SUCCESSFUL_RESULT;
  4431. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  4432. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4433. {
  4434. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4435. return nRet;
  4436. }
  4437. CPhmsRequestHead phmsRequestHead("10", "1034", m_stringSessionId, "11");
  4438. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  4439. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  4440. phmsRequest.GenerateAndSetSign();
  4441. CPhmsResponse phmsResponse;
  4442. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  4443. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4444. {
  4445. //写日志
  4446. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4447. return nRet;
  4448. }
  4449. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  4450. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4451. {
  4452. //写日志
  4453. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4454. return nRet;
  4455. }
  4456. return PHMS_SUCCESSFUL_RESULT;
  4457. }
  4458. int CPhmsSession::UploadTrendDataString(string stringCardId, string stringDeviceId, string stringDeviceName, string stringCaseId, vector<RECORD_DATA_STRING> vRecordData)
  4459. {
  4460. AutoPtr<Document> pDoc = new Document;
  4461. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  4462. AutoPtr<Element> pRoot = pDoc->createElement("request");
  4463. AutoPtr<Element> pChildCardId = pDoc->createElement("cardid");
  4464. AutoPtr<Element> pChildDeviceId = pDoc->createElement("deviceid");
  4465. AutoPtr<Element> pChildDeviceName = pDoc->createElement("devicename");
  4466. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  4467. AutoPtr<Text> pTextCardId = pDoc->createTextNode(stringCardId);
  4468. AutoPtr<Text> pTextDeviceId = pDoc->createTextNode(stringDeviceId);
  4469. AutoPtr<Text> pTextDeviceName = pDoc->createTextNode(stringDeviceName);
  4470. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  4471. pChildCardId->appendChild(pTextCardId);
  4472. pChildDeviceId->appendChild(pTextDeviceId);
  4473. pChildDeviceName->appendChild(pTextDeviceName);
  4474. pChildCaseId->appendChild(pTextCaseId);
  4475. pRoot->appendChild(pChildCardId);
  4476. pRoot->appendChild(pChildDeviceId);
  4477. pRoot->appendChild(pChildDeviceName);
  4478. pRoot->appendChild(pChildCaseId);
  4479. //构造pChildRecord
  4480. vector<RECORD_DATA_STRING>::const_iterator iter;
  4481. for(iter=vRecordData.begin(); iter!=vRecordData.end(); iter++)
  4482. {
  4483. AutoPtr<Element> pChildRecord = pDoc->createElement("record");
  4484. AutoPtr<Element> pGrandHr = pDoc->createElement("hr");
  4485. AutoPtr<Element> pGrandWeight = pDoc->createElement("weight");
  4486. AutoPtr<Element> pGrandHeight = pDoc->createElement("height");
  4487. AutoPtr<Element> pGrandTemp = pDoc->createElement("temp");
  4488. AutoPtr<Element> pGrandResp = pDoc->createElement("resp");
  4489. AutoPtr<Element> pGrandChol = pDoc->createElement("chol");
  4490. AutoPtr<Element> pGrandUa = pDoc->createElement("ua");
  4491. AutoPtr<Element> pGrandAg = pDoc->createElement("ag");
  4492. AutoPtr<Element> pGrandBloodSugar = pDoc->createElement("bloodsugar");
  4493. AutoPtr<Element> pGrand2BloodSugar = pDoc->createElement("bloodsugar");
  4494. AutoPtr<Element> pGrand2Flag = pDoc->createElement("flag");
  4495. AutoPtr<Element> pGrandSpo2 = pDoc->createElement("spo2");
  4496. AutoPtr<Element> pGrand2Spo2 = pDoc->createElement("spo2");
  4497. AutoPtr<Element> pGrand2Pr = pDoc->createElement("pr");
  4498. AutoPtr<Element> pGrandBp = pDoc->createElement("bp");
  4499. AutoPtr<Element> pGrand2Sys = pDoc->createElement("sys");
  4500. AutoPtr<Element> pGrand2Mean = pDoc->createElement("mean");
  4501. AutoPtr<Element> pGrand2Dia = pDoc->createElement("dia");
  4502. AutoPtr<Element> pGrandFetal = pDoc->createElement("fetal");
  4503. AutoPtr<Element> pGrand2FetalHeartRate = pDoc->createElement("fetalheartrate");
  4504. AutoPtr<Element> pGrand2PalacePressure = pDoc->createElement("palacepressure");
  4505. AutoPtr<Element> pGrand2Quickening = pDoc->createElement("quickening");
  4506. AutoPtr<Element> pGrandFvc = pDoc->createElement("fvc");
  4507. AutoPtr<Element> pGrand2Fvc = pDoc->createElement("fvc");
  4508. AutoPtr<Element> pGrand2Fev1 = pDoc->createElement("fev1");
  4509. AutoPtr<Element> pGrand2Pef = pDoc->createElement("pef");
  4510. AutoPtr<Element> pGrand2Fev1Rate = pDoc->createElement("fev1rate");
  4511. AutoPtr<Element> pGrand2Fef25 = pDoc->createElement("fef25");
  4512. AutoPtr<Element> pGrand2Fef2575 = pDoc->createElement("fef2575");
  4513. AutoPtr<Element> pGrand2Fef75 = pDoc->createElement("fef75");
  4514. AutoPtr<Element> pGrandPedometer = pDoc->createElement("pedometer");
  4515. AutoPtr<Element> pGrand2Steps = pDoc->createElement("steps");
  4516. AutoPtr<Element> pGrand2Distance = pDoc->createElement("distance");
  4517. AutoPtr<Element> pGrand2Calories = pDoc->createElement("calories");
  4518. AutoPtr<Element> pGrandUrine = pDoc->createElement("urine");
  4519. AutoPtr<Element> pGrand2Value = pDoc->createElement("value");
  4520. AutoPtr<Element> pGrand2ValueAdd = pDoc->createElement("valueadd");
  4521. AutoPtr<Element> pGrand2ValueNew = pDoc->createElement("valuenew");
  4522. AutoPtr<Element> pGrandHrConclusion = pDoc->createElement("hrconclusion");
  4523. AutoPtr<Element> pGrand2HrValue = pDoc->createElement("value");
  4524. AutoPtr<Element> pGrand2Conclusion = pDoc->createElement("conclusion");
  4525. AutoPtr<Element> pGrandBloodTest = pDoc->createElement("blood_test");
  4526. AutoPtr<Element> pGrand2CHOL = pDoc->createElement("CHOL");
  4527. AutoPtr<Element> pGrand2HDL = pDoc->createElement("HDL");
  4528. AutoPtr<Element> pGrand2TG = pDoc->createElement("TG");
  4529. AutoPtr<Element> pGrand2LDL = pDoc->createElement("LDL");
  4530. AutoPtr<Element> pGrand2HB = pDoc->createElement("HB");
  4531. AutoPtr<Element> pGrand2HCT = pDoc->createElement("HCT");
  4532. AutoPtr<Element> pGrandChekcTime = pDoc->createElement("checktime");
  4533. AutoPtr<Text> pTextHr = pDoc->createTextNode(iter->hr);
  4534. AutoPtr<Text> pTextWeight = pDoc->createTextNode(iter->weight);
  4535. AutoPtr<Text> pTextHeight = pDoc->createTextNode(iter->height);
  4536. AutoPtr<Text> pTextTemp = pDoc->createTextNode(iter->temp);
  4537. AutoPtr<Text> pTextResp = pDoc->createTextNode(iter->resp);
  4538. AutoPtr<Text> pTextChol = pDoc->createTextNode(iter->chol);
  4539. AutoPtr<Text> pTextUa = pDoc->createTextNode(iter->ua);
  4540. AutoPtr<Text> pTextAg = pDoc->createTextNode(iter->ag);
  4541. AutoPtr<Text> pTextBloodSugar = pDoc->createTextNode(iter->bloodsugerData.bloodsuger);
  4542. AutoPtr<Text> pTextFlag = pDoc->createTextNode(iter->bloodsugerData.flag);
  4543. AutoPtr<Text> pTextSpo2 = pDoc->createTextNode(iter->spo2Data.spo2);
  4544. AutoPtr<Text> pTextPr = pDoc->createTextNode(iter->spo2Data.pr);
  4545. AutoPtr<Text> pTextSys = pDoc->createTextNode(iter->bpData.sys);
  4546. AutoPtr<Text> pTextMean = pDoc->createTextNode(iter->bpData.mean);
  4547. AutoPtr<Text> pTextDia = pDoc->createTextNode(iter->bpData.dia);
  4548. AutoPtr<Text> pTextFetalHeartRate = pDoc->createTextNode(iter->fetalData.fetalHeartRate);
  4549. AutoPtr<Text> pTextPalacePressure = pDoc->createTextNode(iter->fetalData.palacePressure);
  4550. AutoPtr<Text> pTextQuickening = pDoc->createTextNode(iter->fetalData.quickening);
  4551. AutoPtr<Text> pTextFvc = pDoc->createTextNode(iter->fvcData.fvc);
  4552. AutoPtr<Text> pTextFev1 = pDoc->createTextNode(iter->fvcData.fev1);
  4553. AutoPtr<Text> pTextPef = pDoc->createTextNode(iter->fvcData.pef);
  4554. AutoPtr<Text> pTextFev1Rate = pDoc->createTextNode(iter->fvcData.fev1Rate);
  4555. AutoPtr<Text> pTextFef25 = pDoc->createTextNode(iter->fvcData.fef25);
  4556. AutoPtr<Text> pTextFef2575 = pDoc->createTextNode(iter->fvcData.fef2575);
  4557. AutoPtr<Text> pTextFef75 = pDoc->createTextNode(iter->fvcData.fef75);
  4558. AutoPtr<Text> pTextSteps = pDoc->createTextNode(iter->pedometerData.setps);
  4559. AutoPtr<Text> pTextDistance = pDoc->createTextNode(iter->pedometerData.distance);
  4560. AutoPtr<Text> pTextCalories = pDoc->createTextNode(iter->pedometerData.calories);
  4561. AutoPtr<Text> pTextValue = pDoc->createTextNode(iter->urineData.urineValue);
  4562. AutoPtr<Text> pTextValueAdd = pDoc->createTextNode(iter->urineData.urineValueAdd);
  4563. AutoPtr<Text> pTextValueNew = pDoc->createTextNode(iter->urineData.urineValueNew);
  4564. AutoPtr<Text> pTextHrValue = pDoc->createTextNode(iter->hrConclusion.vaule);
  4565. AutoPtr<Text> pTextConclusion = pDoc->createTextNode(iter->hrConclusion.conclusion);
  4566. AutoPtr<Text> pTextCHOL = pDoc->createTextNode(iter->bloodTest.CHOL);
  4567. AutoPtr<Text> pTextHDL = pDoc->createTextNode(iter->bloodTest.HDL);
  4568. AutoPtr<Text> pTextTG = pDoc->createTextNode(iter->bloodTest.TG);
  4569. AutoPtr<Text> pTextLDL = pDoc->createTextNode(iter->bloodTest.LDL);
  4570. AutoPtr<Text> pTextHB = pDoc->createTextNode(iter->bloodTest.HB);
  4571. AutoPtr<Text> pTextHCT = pDoc->createTextNode(iter->bloodTest.HCT);
  4572. AutoPtr<Text> pTextCheckTime = pDoc->createTextNode(iter->checkTime);
  4573. pGrandHr->appendChild(pTextHr);
  4574. pGrandWeight->appendChild(pTextWeight);
  4575. pGrandHeight->appendChild(pTextHeight);
  4576. pGrandTemp->appendChild(pTextTemp);
  4577. pGrandResp->appendChild(pTextResp);
  4578. pGrandChol->appendChild(pTextChol);
  4579. pGrandUa->appendChild(pTextUa);
  4580. pGrandAg->appendChild(pTextAg);
  4581. pGrand2BloodSugar->appendChild(pTextBloodSugar);
  4582. pGrand2Flag->appendChild(pTextFlag);
  4583. pGrandBloodSugar->appendChild(pGrand2BloodSugar);
  4584. pGrandBloodSugar->appendChild(pGrand2Flag);
  4585. pGrand2Spo2->appendChild(pTextSpo2);
  4586. pGrand2Pr->appendChild(pTextPr);
  4587. pGrandSpo2->appendChild(pGrand2Spo2);
  4588. pGrandSpo2->appendChild(pGrand2Pr);
  4589. pGrand2Sys->appendChild(pTextSys);
  4590. pGrand2Mean->appendChild(pTextMean);
  4591. pGrand2Dia->appendChild(pTextDia);
  4592. pGrandBp->appendChild(pGrand2Sys);
  4593. pGrandBp->appendChild(pGrand2Mean);
  4594. pGrandBp->appendChild(pGrand2Dia);
  4595. pGrand2FetalHeartRate->appendChild(pTextFetalHeartRate);
  4596. pGrand2PalacePressure->appendChild(pTextPalacePressure);
  4597. pGrand2Quickening->appendChild(pTextQuickening);
  4598. pGrandFetal->appendChild(pGrand2FetalHeartRate);
  4599. pGrandFetal->appendChild(pGrand2PalacePressure);
  4600. pGrandFetal->appendChild(pGrand2Quickening);
  4601. pGrand2Fvc->appendChild(pTextFvc);
  4602. pGrand2Fev1->appendChild(pTextFev1);
  4603. pGrand2Pef->appendChild(pTextPef);
  4604. pGrand2Fev1Rate->appendChild(pTextFev1Rate);
  4605. pGrand2Fef25->appendChild(pTextFef25);
  4606. pGrand2Fef2575->appendChild(pTextFef2575);
  4607. pGrand2Fef75->appendChild(pTextFef75);
  4608. pGrandFvc->appendChild(pGrand2Fvc);
  4609. pGrandFvc->appendChild(pGrand2Fev1);
  4610. pGrandFvc->appendChild(pGrand2Pef);
  4611. pGrandFvc->appendChild(pGrand2Fev1Rate);
  4612. pGrandFvc->appendChild(pGrand2Fef25);
  4613. pGrandFvc->appendChild(pGrand2Fef2575);
  4614. pGrandFvc->appendChild(pGrand2Fef75);
  4615. pGrand2Steps->appendChild(pTextSteps);
  4616. pGrand2Distance->appendChild(pTextDistance);
  4617. pGrand2Calories->appendChild(pTextCalories);
  4618. pGrandPedometer->appendChild(pGrand2Steps);
  4619. pGrandPedometer->appendChild(pGrand2Distance);
  4620. pGrandPedometer->appendChild(pGrand2Calories);
  4621. pGrand2Value->appendChild(pTextValue);
  4622. pGrand2ValueAdd->appendChild(pTextValueAdd);
  4623. pGrand2ValueNew->appendChild(pTextValueNew);
  4624. pGrandUrine->appendChild(pGrand2Value);
  4625. pGrandUrine->appendChild(pGrand2ValueAdd);
  4626. pGrandUrine->appendChild(pGrand2ValueNew);
  4627. pGrand2HrValue->appendChild(pTextHrValue);
  4628. pGrand2Conclusion->appendChild(pTextConclusion);
  4629. pGrandHrConclusion->appendChild(pGrand2HrValue);
  4630. pGrandHrConclusion->appendChild(pGrand2Conclusion);
  4631. pGrand2CHOL->appendChild(pTextCHOL);
  4632. pGrand2HDL->appendChild(pTextHDL);
  4633. pGrand2TG->appendChild(pTextTG);
  4634. pGrand2LDL->appendChild(pTextLDL);
  4635. pGrand2HB->appendChild(pTextHB);
  4636. pGrand2HCT->appendChild(pTextHCT);
  4637. pGrandBloodTest->appendChild(pGrand2CHOL);
  4638. pGrandBloodTest->appendChild(pGrand2HDL);
  4639. pGrandBloodTest->appendChild(pGrand2TG);
  4640. pGrandBloodTest->appendChild(pGrand2LDL);
  4641. pGrandBloodTest->appendChild(pGrand2HB);
  4642. pGrandBloodTest->appendChild(pGrand2HCT);
  4643. pGrandChekcTime->appendChild(pTextCheckTime);
  4644. pChildRecord->appendChild(pGrandHr);
  4645. pChildRecord->appendChild(pGrandWeight);
  4646. pChildRecord->appendChild(pGrandHeight);
  4647. pChildRecord->appendChild(pGrandTemp);
  4648. pChildRecord->appendChild(pGrandResp);
  4649. pChildRecord->appendChild(pGrandChol);
  4650. pChildRecord->appendChild(pGrandUa);
  4651. pChildRecord->appendChild(pGrandAg);
  4652. pChildRecord->appendChild(pGrandBloodSugar);
  4653. pChildRecord->appendChild(pGrandSpo2);
  4654. pChildRecord->appendChild(pGrandBp);
  4655. pChildRecord->appendChild(pGrandFetal);
  4656. pChildRecord->appendChild(pGrandFvc);
  4657. pChildRecord->appendChild(pGrandPedometer);
  4658. pChildRecord->appendChild(pGrandUrine);
  4659. pChildRecord->appendChild(pGrandHrConclusion);
  4660. pChildRecord->appendChild(pGrandBloodTest);
  4661. pChildRecord->appendChild(pGrandChekcTime);
  4662. pRoot->appendChild(pChildRecord);
  4663. }
  4664. //pDoc->appendChild(pi);
  4665. pDoc->appendChild(pRoot);
  4666. string stringXmlContent;
  4667. int nRet = PHMS_SUCCESSFUL_RESULT;
  4668. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  4669. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4670. {
  4671. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4672. return nRet;
  4673. }
  4674. CPhmsRequestHead phmsRequestHead("10", "1034", m_stringSessionId, "11");
  4675. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  4676. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  4677. phmsRequest.GenerateAndSetSign();
  4678. CPhmsResponse phmsResponse;
  4679. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  4680. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4681. {
  4682. //写日志
  4683. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4684. return nRet;
  4685. }
  4686. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  4687. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4688. {
  4689. //写日志
  4690. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4691. return nRet;
  4692. }
  4693. return PHMS_SUCCESSFUL_RESULT;
  4694. }
  4695. int CPhmsSession::UploadTrendDataFile(string stringFilePath)
  4696. {
  4697. string stringXmlContent;
  4698. int nRet = PHMS_SUCCESSFUL_RESULT;
  4699. nRet = this->GetRequestXml(stringFilePath, stringXmlContent);
  4700. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4701. {
  4702. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4703. return nRet;
  4704. }
  4705. CPhmsRequestHead phmsRequestHead("10", "1034", m_stringSessionId, "11");
  4706. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  4707. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  4708. phmsRequest.GenerateAndSetSign();
  4709. CPhmsResponse phmsResponse;
  4710. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  4711. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4712. {
  4713. //写日志
  4714. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4715. return nRet;
  4716. }
  4717. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  4718. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4719. {
  4720. //写日志
  4721. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4722. return nRet;
  4723. }
  4724. return PHMS_SUCCESSFUL_RESULT;
  4725. }
  4726. int CPhmsSession::UploadAudioSegment(string stringMsgId, string stringOrder, string stringTotalSize, string stringServerUri, string stringStart1,
  4727. string stringEnd1, string stringMd51, string stringStart2, string stringEnd2, string stringMd52, string stringStart3,
  4728. string stringEnd3, string stringMd53, string stringFilePath)
  4729. {
  4730. AutoPtr<Document> pDoc = new Document;
  4731. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  4732. AutoPtr<Element> pRoot = pDoc->createElement("request");
  4733. AutoPtr<Element> pChildMsgId = pDoc->createElement("msgid");
  4734. AutoPtr<Element> pChildOrder = pDoc->createElement("order");
  4735. AutoPtr<Element> pChildTotalSize = pDoc->createElement("totalsize");
  4736. AutoPtr<Element> pChildServerUri = pDoc->createElement("serveruri");
  4737. AutoPtr<Element> pChildPart1 = pDoc->createElement("md51");
  4738. AutoPtr<Element> pGrandChildStart1= pDoc->createElement("start");
  4739. AutoPtr<Element> pGrandChildEnd1 = pDoc->createElement("end");
  4740. AutoPtr<Element> pGrandChildMd51 = pDoc->createElement("md5");
  4741. AutoPtr<Element> pChildPart2 = pDoc->createElement("md52");
  4742. AutoPtr<Element> pGrandChildStart2= pDoc->createElement("start");
  4743. AutoPtr<Element> pGrandChildEnd2 = pDoc->createElement("end");
  4744. AutoPtr<Element> pGrandChildMd52 = pDoc->createElement("md5");
  4745. AutoPtr<Element> pChildPart3 = pDoc->createElement("md53");
  4746. AutoPtr<Element> pGrandChildStart3= pDoc->createElement("start");
  4747. AutoPtr<Element> pGrandChildEnd3 = pDoc->createElement("end");
  4748. AutoPtr<Element> pGrandChildMd53 = pDoc->createElement("md5");
  4749. AutoPtr<Text> pTextMsgId = pDoc->createTextNode(stringMsgId);
  4750. AutoPtr<Text> pTextOrder = pDoc->createTextNode(stringOrder);
  4751. AutoPtr<Text> pTextTotalSize = pDoc->createTextNode(stringTotalSize);
  4752. AutoPtr<Text> pTextServerUri = pDoc->createTextNode(stringServerUri);
  4753. AutoPtr<Text> pTextStart1 = pDoc->createTextNode(stringStart1);
  4754. AutoPtr<Text> pTextEnd1 = pDoc->createTextNode(stringEnd1);
  4755. AutoPtr<Text> pTextMd51 = pDoc->createTextNode(stringMd51);
  4756. AutoPtr<Text> pTextStart2 = pDoc->createTextNode(stringStart2);
  4757. AutoPtr<Text> pTextEnd2 = pDoc->createTextNode(stringEnd2);
  4758. AutoPtr<Text> pTextMd52 = pDoc->createTextNode(stringMd52);
  4759. AutoPtr<Text> pTextStart3 = pDoc->createTextNode(stringStart3);
  4760. AutoPtr<Text> pTextEnd3 = pDoc->createTextNode(stringEnd3);
  4761. AutoPtr<Text> pTextMd53 = pDoc->createTextNode(stringMd53);
  4762. pChildMsgId->appendChild(pTextMsgId);
  4763. pChildOrder->appendChild(pTextOrder);
  4764. pChildTotalSize->appendChild(pTextTotalSize);
  4765. pChildServerUri->appendChild(pTextServerUri);
  4766. pGrandChildStart1->appendChild(pTextStart1);
  4767. pGrandChildEnd1->appendChild(pTextEnd1);
  4768. pGrandChildMd51->appendChild(pTextMd51);
  4769. pGrandChildStart2->appendChild(pTextStart2);
  4770. pGrandChildEnd2->appendChild(pTextEnd2);
  4771. pGrandChildMd52->appendChild(pTextMd52);
  4772. pGrandChildStart3->appendChild(pTextStart3);
  4773. pGrandChildEnd3->appendChild(pTextEnd3);
  4774. pGrandChildMd53->appendChild(pTextMd53);
  4775. pChildPart1->appendChild(pGrandChildStart1);
  4776. pChildPart1->appendChild(pGrandChildEnd1);
  4777. pChildPart1->appendChild(pGrandChildMd51);
  4778. pChildPart2->appendChild(pGrandChildStart2);
  4779. pChildPart2->appendChild(pGrandChildEnd2);
  4780. pChildPart2->appendChild(pGrandChildMd52);
  4781. pChildPart3->appendChild(pGrandChildStart3);
  4782. pChildPart3->appendChild(pGrandChildEnd3);
  4783. pChildPart3->appendChild(pGrandChildMd53);
  4784. pRoot->appendChild(pChildMsgId);
  4785. pRoot->appendChild(pChildOrder);
  4786. pRoot->appendChild(pChildTotalSize);
  4787. pRoot->appendChild(pChildServerUri);
  4788. pRoot->appendChild(pChildPart1);
  4789. pRoot->appendChild(pChildPart2);
  4790. pRoot->appendChild(pChildPart3);
  4791. //pDoc->appendChild(pi);
  4792. pDoc->appendChild(pRoot);
  4793. string stringXmlContent;
  4794. int nRet = PHMS_SUCCESSFUL_RESULT;
  4795. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  4796. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4797. {
  4798. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4799. return nRet;
  4800. }
  4801. CPhmsRequestHead phmsRequestHead("10", "1035", m_stringSessionId, "11");
  4802. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  4803. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, stringFilePath);
  4804. phmsRequest.GenerateAndSetSign();
  4805. CPhmsResponse phmsResponse;
  4806. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  4807. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4808. {
  4809. //写日志
  4810. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4811. return nRet;
  4812. }
  4813. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  4814. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4815. {
  4816. //写日志
  4817. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4818. return nRet;
  4819. }
  4820. return PHMS_SUCCESSFUL_RESULT;
  4821. }
  4822. int CPhmsSession::UploadAdvice(string stringUserId, string stringUsername, string stringMsg, string stringType, string stringIsSendMsg)
  4823. {
  4824. AutoPtr<Document> pDoc = new Document;
  4825. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  4826. AutoPtr<Element> pRoot = pDoc->createElement("request");
  4827. AutoPtr<Element> pChildUserId = pDoc->createElement("userid");
  4828. AutoPtr<Element> pChildUsername = pDoc->createElement("username");
  4829. AutoPtr<Element> pChildMsg = pDoc->createElement("msg");
  4830. AutoPtr<Element> pChildType = pDoc->createElement("type");
  4831. AutoPtr<Element> pChildIsSendMsg = pDoc->createElement("issendmsg");
  4832. AutoPtr<Text> pTextUserId = pDoc->createTextNode(stringUserId);
  4833. AutoPtr<Text> pTextUsername = pDoc->createTextNode(stringUsername);
  4834. AutoPtr<Text> pTextMsg = pDoc->createTextNode(stringMsg);
  4835. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  4836. AutoPtr<Text> pTextIsSendMsg = pDoc->createTextNode(stringIsSendMsg);
  4837. pChildUserId->appendChild(pTextUserId);
  4838. pChildUsername->appendChild(pTextUsername);
  4839. pChildMsg->appendChild(pTextMsg);
  4840. pChildType->appendChild(pTextType);
  4841. pChildIsSendMsg->appendChild(pTextIsSendMsg);
  4842. pRoot->appendChild(pChildUserId);
  4843. pRoot->appendChild(pChildUsername);
  4844. pRoot->appendChild(pChildMsg);
  4845. pRoot->appendChild(pChildType);
  4846. pRoot->appendChild(pChildIsSendMsg);
  4847. //pDoc->appendChild(pi);
  4848. pDoc->appendChild(pRoot);
  4849. string stringXmlContent;
  4850. int nRet = PHMS_SUCCESSFUL_RESULT;
  4851. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  4852. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4853. {
  4854. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4855. return nRet;
  4856. }
  4857. CPhmsRequestHead phmsRequestHead("10", "1036", m_stringSessionId, "11");
  4858. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  4859. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  4860. phmsRequest.GenerateAndSetSign();
  4861. CPhmsResponse phmsResponse;
  4862. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  4863. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4864. {
  4865. //写日志
  4866. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4867. return nRet;
  4868. }
  4869. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  4870. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4871. {
  4872. //写日志
  4873. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4874. return nRet;
  4875. }
  4876. return PHMS_SUCCESSFUL_RESULT;
  4877. }
  4878. int CPhmsSession::GetAdvice(string stringSgId, string stringUserId, string stringDoctorId, string stringDownloadState, string stringType, string stringStartDate,
  4879. string stringEndDate, string stringPageTo, string stringPageSize)
  4880. {
  4881. AutoPtr<Document> pDoc = new Document;
  4882. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  4883. AutoPtr<Element> pRoot = pDoc->createElement("request");
  4884. AutoPtr<Element> pChildSgId = pDoc->createElement("sgid");
  4885. AutoPtr<Element> pChildUserId = pDoc->createElement("userid");
  4886. AutoPtr<Element> pChildDoctorId = pDoc->createElement("doctorid");
  4887. AutoPtr<Element> pChildDownloadState = pDoc->createElement("downstate");
  4888. AutoPtr<Element> pChildType = pDoc->createElement("type");
  4889. AutoPtr<Element> pChildStartDate = pDoc->createElement("startdate");
  4890. AutoPtr<Element> pChildEndDate = pDoc->createElement("enddate");
  4891. AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
  4892. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  4893. AutoPtr<Text> pTextSgId = pDoc->createTextNode(stringSgId);
  4894. AutoPtr<Text> pTextUserId = pDoc->createTextNode(stringUserId);
  4895. AutoPtr<Text> pTextDoctorId = pDoc->createTextNode(stringDoctorId);
  4896. AutoPtr<Text> pTextDownloadState = pDoc->createTextNode(stringDownloadState);
  4897. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  4898. AutoPtr<Text> pTextStartDate = pDoc->createTextNode(stringStartDate);
  4899. AutoPtr<Text> pTextEndDate = pDoc->createTextNode(stringEndDate);
  4900. AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
  4901. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  4902. pChildSgId->appendChild(pTextSgId);
  4903. pChildUserId->appendChild(pTextUserId);
  4904. pChildDoctorId->appendChild(pTextDoctorId);
  4905. pChildDownloadState->appendChild(pTextDownloadState);
  4906. pChildType->appendChild(pTextType);
  4907. pChildStartDate->appendChild(pTextStartDate);
  4908. pChildEndDate->appendChild(pTextEndDate);
  4909. pChildPageTo->appendChild(pTextPageTo);
  4910. pChildPageSize->appendChild(pTextPageSize);
  4911. pRoot->appendChild(pChildSgId);
  4912. pRoot->appendChild(pChildUserId);
  4913. pRoot->appendChild(pChildDoctorId);
  4914. pRoot->appendChild(pChildDownloadState);
  4915. pRoot->appendChild(pChildType);
  4916. pRoot->appendChild(pChildStartDate);
  4917. pRoot->appendChild(pChildEndDate);
  4918. pRoot->appendChild(pChildPageTo);
  4919. pRoot->appendChild(pChildPageSize);
  4920. //pDoc->appendChild(pi);
  4921. pDoc->appendChild(pRoot);
  4922. string stringXmlContent;
  4923. int nRet = PHMS_SUCCESSFUL_RESULT;
  4924. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  4925. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4926. {
  4927. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4928. return nRet;
  4929. }
  4930. CPhmsRequestHead phmsRequestHead("10", "1037", m_stringSessionId, "11");
  4931. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  4932. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  4933. phmsRequest.GenerateAndSetSign();
  4934. CPhmsResponse phmsResponse;
  4935. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  4936. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4937. {
  4938. //写日志
  4939. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4940. return nRet;
  4941. }
  4942. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  4943. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4944. {
  4945. //写日志
  4946. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4947. return nRet;
  4948. }
  4949. return PHMS_SUCCESSFUL_RESULT;
  4950. }
  4951. int CPhmsSession::DownloadAdviceComplete(string stringAdviceId)
  4952. {
  4953. AutoPtr<Document> pDoc = new Document;
  4954. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  4955. AutoPtr<Element> pRoot = pDoc->createElement("request");
  4956. AutoPtr<Element> pChildAdviceId = pDoc->createElement("sgid");
  4957. AutoPtr<Text> pTextAdviceId = pDoc->createTextNode(stringAdviceId);
  4958. pChildAdviceId->appendChild(pTextAdviceId);
  4959. pRoot->appendChild(pChildAdviceId);
  4960. //pDoc->appendChild(pi);
  4961. pDoc->appendChild(pRoot);
  4962. string stringXmlContent;
  4963. int nRet = PHMS_SUCCESSFUL_RESULT;
  4964. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  4965. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4966. {
  4967. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4968. return nRet;
  4969. }
  4970. CPhmsRequestHead phmsRequestHead("10", "1038", m_stringSessionId, "11");
  4971. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  4972. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  4973. phmsRequest.GenerateAndSetSign();
  4974. CPhmsResponse phmsResponse;
  4975. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  4976. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4977. {
  4978. //写日志
  4979. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4980. return nRet;
  4981. }
  4982. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  4983. if(nRet != PHMS_SUCCESSFUL_RESULT)
  4984. {
  4985. //写日志
  4986. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  4987. return nRet;
  4988. }
  4989. return PHMS_SUCCESSFUL_RESULT;
  4990. }
  4991. int CPhmsSession::GetReportListOfCase(string stringCaseId)
  4992. {
  4993. AutoPtr<Document> pDoc = new Document;
  4994. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  4995. AutoPtr<Element> pRoot = pDoc->createElement("request");
  4996. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  4997. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  4998. pChildCaseId->appendChild(pTextCaseId);
  4999. pRoot->appendChild(pChildCaseId);
  5000. //pDoc->appendChild(pi);
  5001. pDoc->appendChild(pRoot);
  5002. string stringXmlContent;
  5003. int nRet = PHMS_SUCCESSFUL_RESULT;
  5004. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5005. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5006. {
  5007. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5008. return nRet;
  5009. }
  5010. CPhmsRequestHead phmsRequestHead("10", "1039", m_stringSessionId, "11");
  5011. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5012. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5013. phmsRequest.GenerateAndSetSign();
  5014. CPhmsResponse phmsResponse;
  5015. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5016. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5017. {
  5018. //写日志
  5019. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5020. return nRet;
  5021. }
  5022. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5023. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5024. {
  5025. //写日志
  5026. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5027. return nRet;
  5028. }
  5029. return PHMS_SUCCESSFUL_RESULT;
  5030. }
  5031. //接口有变动,加了一个参数senderid,表示要查找信息的人,如为空表示自己
  5032. int CPhmsSession::GetSelfInfo(string stringSenderId)
  5033. {
  5034. AutoPtr<Document> pDoc = new Document;
  5035. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  5036. AutoPtr<Element> pRoot = pDoc->createElement("request");
  5037. AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
  5038. AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
  5039. pChildSenderId->appendChild(pTextSenderId);
  5040. pRoot->appendChild(pChildSenderId);
  5041. //pDoc->appendChild(pi);
  5042. pDoc->appendChild(pRoot);
  5043. string stringXmlContent;
  5044. int nRet = PHMS_SUCCESSFUL_RESULT;
  5045. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5046. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5047. {
  5048. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5049. return nRet;
  5050. }
  5051. CPhmsRequestHead phmsRequestHead("10", "1040", m_stringSessionId, "11");
  5052. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5053. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5054. phmsRequest.GenerateAndSetSign();
  5055. CPhmsResponse phmsResponse;
  5056. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5057. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5058. {
  5059. //写日志
  5060. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5061. return nRet;
  5062. }
  5063. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5064. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5065. {
  5066. //写日志
  5067. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5068. return nRet;
  5069. }
  5070. return PHMS_SUCCESSFUL_RESULT;
  5071. }
  5072. int CPhmsSession::ChangePwd(string stringOldPassword, string stringNewPassword)
  5073. {
  5074. AutoPtr<Document> pDoc = new Document;
  5075. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  5076. AutoPtr<Element> pRoot = pDoc->createElement("request");
  5077. AutoPtr<Element> pChildOldPassword = pDoc->createElement("oldpwd");
  5078. AutoPtr<Element> pChildNewPassword = pDoc->createElement("newpwd");
  5079. AutoPtr<Text> pTextOldPassword = pDoc->createTextNode(stringOldPassword);
  5080. AutoPtr<Text> pTextNewPassword = pDoc->createTextNode(stringNewPassword);
  5081. pChildOldPassword->appendChild(pTextOldPassword);
  5082. pChildNewPassword->appendChild(pTextNewPassword);
  5083. pRoot->appendChild(pChildOldPassword);
  5084. pRoot->appendChild(pChildNewPassword);
  5085. //pDoc->appendChild(pi);
  5086. pDoc->appendChild(pRoot);
  5087. string stringXmlContent;
  5088. int nRet = PHMS_SUCCESSFUL_RESULT;
  5089. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5090. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5091. {
  5092. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5093. return nRet;
  5094. }
  5095. CPhmsRequestHead phmsRequestHead("10", "1041", m_stringSessionId, "11");
  5096. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5097. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5098. phmsRequest.GenerateAndSetSign();
  5099. CPhmsResponse phmsResponse;
  5100. m_enumPhmsCommandType = CHANGE_INFO_TYPE;//目前只有登录命令是LOGIN_TYPE,改变个人信息命令是CHANGE_INFO_TYPE,用户注册命令是REGISTER_TYPE
  5101. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5102. m_enumPhmsCommandType = MAIN_TYPE;//其余都是MAIN_TYPE
  5103. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5104. {
  5105. //写日志
  5106. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5107. return nRet;
  5108. }
  5109. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5110. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5111. {
  5112. //写日志
  5113. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5114. return nRet;
  5115. }
  5116. return PHMS_SUCCESSFUL_RESULT;
  5117. }
  5118. int CPhmsSession::DoctorChangeSelfInfo(string stringName, string stringSex, string stringTel, string stringBirthYear, string stringPosition,
  5119. string stringNotes, string stringAgentId)
  5120. {
  5121. AutoPtr<Document> pDoc = new Document;
  5122. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  5123. AutoPtr<Element> pRoot = pDoc->createElement("request");
  5124. AutoPtr<Element> pChildName = pDoc->createElement("name");
  5125. AutoPtr<Element> pChildSex = pDoc->createElement("sex");
  5126. AutoPtr<Element> pChildTel = pDoc->createElement("tel");
  5127. AutoPtr<Element> pChildBirthYear = pDoc->createElement("birthyear");
  5128. AutoPtr<Element> pChildPosition = pDoc->createElement("position");
  5129. AutoPtr<Element> pChildNotes= pDoc->createElement("notes");
  5130. AutoPtr<Element> pChildAgentId = pDoc->createElement("agentid");
  5131. AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
  5132. AutoPtr<Text> pTextSex = pDoc->createTextNode(stringSex);
  5133. AutoPtr<Text> pTextTel = pDoc->createTextNode(stringTel);
  5134. AutoPtr<Text> pTextBirthYead = pDoc->createTextNode(stringBirthYear);
  5135. AutoPtr<Text> pTextPosition = pDoc->createTextNode(stringPosition);
  5136. AutoPtr<Text> pTextNotes = pDoc->createTextNode(stringNotes);
  5137. AutoPtr<Text> pTextAgentId = pDoc->createTextNode(stringAgentId);
  5138. pChildName->appendChild(pTextName);
  5139. pChildSex->appendChild(pTextSex);
  5140. pChildTel->appendChild(pTextTel);
  5141. pChildBirthYear->appendChild(pTextBirthYead);
  5142. pChildPosition->appendChild(pTextPosition);
  5143. pChildNotes->appendChild(pTextNotes);
  5144. pChildAgentId->appendChild(pTextAgentId);
  5145. pRoot->appendChild(pChildName);
  5146. pRoot->appendChild(pChildSex);
  5147. pRoot->appendChild(pChildTel);
  5148. pRoot->appendChild(pChildBirthYear);
  5149. pRoot->appendChild(pChildPosition);
  5150. pRoot->appendChild(pChildNotes);
  5151. pRoot->appendChild(pChildAgentId);
  5152. //pDoc->appendChild(pi);
  5153. pDoc->appendChild(pRoot);
  5154. string stringXmlContent;
  5155. int nRet = PHMS_SUCCESSFUL_RESULT;
  5156. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5157. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5158. {
  5159. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5160. return nRet;
  5161. }
  5162. CPhmsRequestHead phmsRequestHead("10", "1042", m_stringSessionId, "11");
  5163. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5164. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5165. phmsRequest.GenerateAndSetSign();
  5166. CPhmsResponse phmsResponse;
  5167. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5168. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5169. {
  5170. //写日志
  5171. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5172. return nRet;
  5173. }
  5174. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5175. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5176. {
  5177. //写日志
  5178. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5179. return nRet;
  5180. }
  5181. return PHMS_SUCCESSFUL_RESULT;
  5182. }
  5183. int CPhmsSession::CliniqueChangeSelfInfo(string stringPersonId, string stringName, string stringTel, string stringNotes)
  5184. {
  5185. AutoPtr<Document> pDoc = new Document;
  5186. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  5187. AutoPtr<Element> pRoot = pDoc->createElement("request");
  5188. AutoPtr<Element> pChildPersonId = pDoc->createElement("pid");
  5189. AutoPtr<Element> pChildName = pDoc->createElement("name");
  5190. AutoPtr<Element> pChildTel = pDoc->createElement("tel");
  5191. AutoPtr<Element> pChildNotes= pDoc->createElement("notes");
  5192. AutoPtr<Text> pTextPersonId = pDoc->createTextNode(stringPersonId);
  5193. AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
  5194. AutoPtr<Text> pTextTel = pDoc->createTextNode(stringTel);
  5195. AutoPtr<Text> pTextNotes = pDoc->createTextNode(stringNotes);
  5196. pChildPersonId->appendChild(pTextPersonId);
  5197. pChildName->appendChild(pTextName);
  5198. pChildTel->appendChild(pTextTel);
  5199. pChildNotes->appendChild(pTextNotes);
  5200. pRoot->appendChild(pChildPersonId);
  5201. pRoot->appendChild(pChildName);
  5202. pRoot->appendChild(pChildTel);
  5203. pRoot->appendChild(pChildNotes);
  5204. //pDoc->appendChild(pi);
  5205. pDoc->appendChild(pRoot);
  5206. string stringXmlContent;
  5207. int nRet = PHMS_SUCCESSFUL_RESULT;
  5208. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5209. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5210. {
  5211. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5212. return nRet;
  5213. }
  5214. CPhmsRequestHead phmsRequestHead("10", "1043", m_stringSessionId, "11");
  5215. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5216. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5217. phmsRequest.GenerateAndSetSign();
  5218. CPhmsResponse phmsResponse;
  5219. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5220. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5221. {
  5222. //写日志
  5223. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5224. return nRet;
  5225. }
  5226. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5227. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5228. {
  5229. //写日志
  5230. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5231. return nRet;
  5232. }
  5233. return PHMS_SUCCESSFUL_RESULT;
  5234. }
  5235. int CPhmsSession::CardUserChangeSelfInfo(string stringPersonId, string stringName, string stringSex, string stringTel, string stringBirthday,
  5236. string stringAddress, string stringLmp, string stringToken, string stringHeight, string stringWeight, string stringPhoto,
  5237. string stringVCodeBeFollowed, string stringHospitalId, string stringOtherInfo)
  5238. {
  5239. AutoPtr<Document> pDoc = new Document;
  5240. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  5241. AutoPtr<Element> pRoot = pDoc->createElement("request");
  5242. AutoPtr<Element> pChildPersonId = pDoc->createElement("pid");
  5243. AutoPtr<Element> pChildName = pDoc->createElement("name");
  5244. AutoPtr<Element> pChildSex = pDoc->createElement("sex");
  5245. AutoPtr<Element> pChildTel = pDoc->createElement("tel");
  5246. AutoPtr<Element> pChildBirthday = pDoc->createElement("birthday");
  5247. AutoPtr<Element> pChildAddress = pDoc->createElement("address");
  5248. AutoPtr<Element> pChildLmp = pDoc->createElement("lmp");
  5249. AutoPtr<Element> pChildToken = pDoc->createElement("token");
  5250. AutoPtr<Element> pChildHeight = pDoc->createElement("height");
  5251. AutoPtr<Element> pChildWeight = pDoc->createElement("weight");
  5252. AutoPtr<Element> pChildPhoto = pDoc->createElement("photo");
  5253. AutoPtr<Element> pChildVCodeBeFollowed = pDoc->createElement("vcode_be_followed");
  5254. AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
  5255. AutoPtr<Element> pChildOtherInfo = pDoc->createElement("other_info");
  5256. AutoPtr<Text> pTextPersonId = pDoc->createTextNode(stringPersonId);
  5257. AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
  5258. AutoPtr<Text> pTextSex = pDoc->createTextNode(stringSex);
  5259. AutoPtr<Text> pTextTel = pDoc->createTextNode(stringTel);
  5260. AutoPtr<Text> pTextBirthday = pDoc->createTextNode(stringBirthday);
  5261. AutoPtr<Text> pTextAddress= pDoc->createTextNode(stringAddress);
  5262. AutoPtr<Text> pTextLmp = pDoc->createTextNode(stringLmp);
  5263. AutoPtr<Text> pTextToken = pDoc->createTextNode(stringToken);
  5264. AutoPtr<Text> pTextHeight = pDoc->createTextNode(stringHeight);
  5265. AutoPtr<Text> pTextWeight = pDoc->createTextNode(stringWeight);
  5266. AutoPtr<Text> pTextPhoto = pDoc->createTextNode(stringPhoto);
  5267. AutoPtr<Text> pTextVCodeBeFollowed = pDoc->createTextNode(stringVCodeBeFollowed);
  5268. AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
  5269. AutoPtr<Text> pTextOtherInfo = pDoc->createTextNode(stringOtherInfo);
  5270. pChildPersonId->appendChild(pTextPersonId);
  5271. pChildName->appendChild(pTextName);
  5272. pChildSex->appendChild(pTextSex);
  5273. pChildTel->appendChild(pTextTel);
  5274. pChildBirthday->appendChild(pTextBirthday);
  5275. pChildAddress->appendChild(pTextAddress);
  5276. pChildLmp->appendChild(pTextLmp);
  5277. pChildToken->appendChild(pTextToken);
  5278. pChildHeight->appendChild(pTextHeight);
  5279. pChildWeight->appendChild(pTextWeight);
  5280. pChildPhoto->appendChild(pTextPhoto);
  5281. pChildVCodeBeFollowed->appendChild(pTextVCodeBeFollowed);
  5282. pChildHospitalId->appendChild(pTextHospitalId);
  5283. pChildOtherInfo->appendChild(pTextOtherInfo);
  5284. pRoot->appendChild(pChildPersonId);
  5285. pRoot->appendChild(pChildName);
  5286. pRoot->appendChild(pChildSex);
  5287. pRoot->appendChild(pChildTel);
  5288. pRoot->appendChild(pChildBirthday);
  5289. pRoot->appendChild(pChildAddress);
  5290. pRoot->appendChild(pChildLmp);
  5291. pRoot->appendChild(pChildToken);
  5292. pRoot->appendChild(pChildHeight);
  5293. pRoot->appendChild(pChildWeight);
  5294. pRoot->appendChild(pChildPhoto);
  5295. pRoot->appendChild(pChildVCodeBeFollowed);
  5296. pRoot->appendChild(pChildHospitalId);
  5297. pRoot->appendChild(pChildOtherInfo);
  5298. //pDoc->appendChild(pi);
  5299. pDoc->appendChild(pRoot);
  5300. string stringXmlContent;
  5301. int nRet = PHMS_SUCCESSFUL_RESULT;
  5302. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5303. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5304. {
  5305. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5306. return nRet;
  5307. }
  5308. CPhmsRequestHead phmsRequestHead("10", "1044", m_stringSessionId, "11");
  5309. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5310. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5311. phmsRequest.GenerateAndSetSign();
  5312. CPhmsResponse phmsResponse;
  5313. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5314. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5315. {
  5316. //写日志
  5317. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5318. return nRet;
  5319. }
  5320. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5321. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5322. {
  5323. //写日志
  5324. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5325. return nRet;
  5326. }
  5327. return PHMS_SUCCESSFUL_RESULT;
  5328. }
  5329. int CPhmsSession::GetCaseListOfUser(string stringCaseId, string stringCaseType, string stringCaseState, string stringThirdId, string stringName,
  5330. string stringStartDate, string stringEndDate, string stringCheckStartDate, string stringCheckEndDate, string stringCaseOrigin,
  5331. string stringYzlb, string stringSex, string stringIsRead, string stringOrderBy, string stringPageTo, string stringPageSize)
  5332. {
  5333. AutoPtr<Document> pDoc = new Document;
  5334. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  5335. AutoPtr<Element> pRoot = pDoc->createElement("request");
  5336. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  5337. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  5338. AutoPtr<Element> pChildCaseState = pDoc->createElement("casestate");
  5339. AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
  5340. AutoPtr<Element> pChildName = pDoc->createElement("name");
  5341. AutoPtr<Element> pChildStartDate = pDoc->createElement("startdate");
  5342. AutoPtr<Element> pChildEndDate = pDoc->createElement("enddate");
  5343. AutoPtr<Element> pChildCheckStartDate = pDoc->createElement("checkstartdate");
  5344. AutoPtr<Element> pChildCheckEndDate = pDoc->createElement("checkenddate");
  5345. AutoPtr<Element> pChildCaseOrigin = pDoc->createElement("caseorigin");
  5346. AutoPtr<Element> pChildYzlb = pDoc->createElement("yzlb");
  5347. AutoPtr<Element> pChildSex = pDoc->createElement("sex");
  5348. AutoPtr<Element> pChildIsRead = pDoc->createElement("isread");
  5349. AutoPtr<Element> pChildOrderBy = pDoc->createElement("orderby");
  5350. AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
  5351. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  5352. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  5353. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  5354. AutoPtr<Text> pTextCaseState = pDoc->createTextNode(stringCaseState);
  5355. AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
  5356. AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
  5357. AutoPtr<Text> pTextStartDate = pDoc->createTextNode(stringStartDate);
  5358. AutoPtr<Text> pTextEndDate = pDoc->createTextNode(stringEndDate);
  5359. AutoPtr<Text> pTextCheckStartDate = pDoc->createTextNode(stringCheckStartDate);
  5360. AutoPtr<Text> pTextCheckEndDate = pDoc->createTextNode(stringCheckEndDate);
  5361. AutoPtr<Text> pTextCaseOrigin = pDoc->createTextNode(stringCaseOrigin);
  5362. AutoPtr<Text> pTextYzlb = pDoc->createTextNode(stringYzlb);
  5363. AutoPtr<Text> pTextSex = pDoc->createTextNode(stringSex);
  5364. AutoPtr<Text> pTextIsRead = pDoc->createTextNode(stringIsRead);
  5365. AutoPtr<Text> pTextOrderBy = pDoc->createTextNode(stringOrderBy);
  5366. AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
  5367. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  5368. pChildCaseId->appendChild(pTextCaseId);
  5369. pChildCaseType->appendChild(pTextCaseType);
  5370. pChildCaseState->appendChild(pTextCaseState);
  5371. pChildThirdId->appendChild(pTextThirdId);
  5372. pChildName->appendChild(pTextName);
  5373. pChildStartDate->appendChild(pTextStartDate);
  5374. pChildEndDate->appendChild(pTextEndDate);
  5375. pChildCheckStartDate->appendChild(pTextCheckStartDate);
  5376. pChildCheckEndDate->appendChild(pTextCheckEndDate);
  5377. pChildCaseOrigin->appendChild(pTextCaseOrigin);
  5378. pChildYzlb->appendChild(pTextYzlb);
  5379. pChildSex->appendChild(pTextSex);
  5380. pChildIsRead->appendChild(pTextIsRead);
  5381. pChildOrderBy->appendChild(pTextOrderBy);
  5382. pChildPageTo->appendChild(pTextPageTo);
  5383. pChildPageSize->appendChild(pTextPageSize);
  5384. pRoot->appendChild(pChildCaseId);
  5385. pRoot->appendChild(pChildCaseType);
  5386. pRoot->appendChild(pChildCaseState);
  5387. pRoot->appendChild(pChildThirdId);
  5388. pRoot->appendChild(pChildName);
  5389. pRoot->appendChild(pChildStartDate);
  5390. pRoot->appendChild(pChildEndDate);
  5391. pRoot->appendChild(pChildCheckStartDate);
  5392. pRoot->appendChild(pChildCheckEndDate);
  5393. pRoot->appendChild(pChildCaseOrigin);
  5394. pRoot->appendChild(pChildYzlb);
  5395. pRoot->appendChild(pChildSex);
  5396. pRoot->appendChild(pChildIsRead);
  5397. pRoot->appendChild(pChildOrderBy);
  5398. pRoot->appendChild(pChildPageTo);
  5399. pRoot->appendChild(pChildPageSize);
  5400. //pDoc->appendChild(pi);
  5401. pDoc->appendChild(pRoot);
  5402. string stringXmlContent;
  5403. int nRet = PHMS_SUCCESSFUL_RESULT;
  5404. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5405. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5406. {
  5407. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5408. return nRet;
  5409. }
  5410. CPhmsRequestHead phmsRequestHead("10", "1045", m_stringSessionId, "11");
  5411. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5412. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5413. phmsRequest.GenerateAndSetSign();
  5414. CPhmsResponse phmsResponse;
  5415. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5416. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5417. {
  5418. //写日志
  5419. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5420. return nRet;
  5421. }
  5422. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5423. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5424. {
  5425. //写日志
  5426. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5427. return nRet;
  5428. }
  5429. return PHMS_SUCCESSFUL_RESULT;
  5430. }
  5431. int CPhmsSession::GetReportListOfUser(string stringReportId, string stringReportStartDate, string stringReportEndDate, string stringCaseType,
  5432. string stringState, string stringOrderBy, string stringPageTo, string stringPageSize)
  5433. {
  5434. AutoPtr<Document> pDoc = new Document;
  5435. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  5436. AutoPtr<Element> pRoot = pDoc->createElement("request");
  5437. AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
  5438. AutoPtr<Element> pChildReportStartDate = pDoc->createElement("reportstartdate");
  5439. AutoPtr<Element> pChildReportEndDate = pDoc->createElement("reportenddate");
  5440. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  5441. AutoPtr<Element> pChildState = pDoc->createElement("state");
  5442. AutoPtr<Element> pChildOrderBy = pDoc->createElement("orderby");
  5443. AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
  5444. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  5445. AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
  5446. AutoPtr<Text> pTextReportStartDate = pDoc->createTextNode(stringReportStartDate);
  5447. AutoPtr<Text> pTextReportEndDate = pDoc->createTextNode(stringReportEndDate);
  5448. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  5449. AutoPtr<Text> pTextState = pDoc->createTextNode(stringState);
  5450. AutoPtr<Text> pTextOrderBy = pDoc->createTextNode(stringOrderBy);
  5451. AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
  5452. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  5453. pChildReportId->appendChild(pTextReportId);
  5454. pChildReportStartDate->appendChild(pTextReportStartDate);
  5455. pChildReportEndDate->appendChild(pTextReportEndDate);
  5456. pChildCaseType->appendChild(pTextCaseType);
  5457. pChildState->appendChild(pTextState);
  5458. pChildOrderBy->appendChild(pTextOrderBy);
  5459. pChildPageTo->appendChild(pTextPageTo);
  5460. pChildPageSize->appendChild(pTextPageSize);
  5461. pRoot->appendChild(pChildReportId);
  5462. pRoot->appendChild(pChildReportStartDate);
  5463. pRoot->appendChild(pChildReportEndDate);
  5464. pRoot->appendChild(pChildCaseType);
  5465. pRoot->appendChild(pChildState);
  5466. pRoot->appendChild(pChildOrderBy);
  5467. pRoot->appendChild(pChildPageTo);
  5468. pRoot->appendChild(pChildPageSize);
  5469. //pDoc->appendChild(pi);
  5470. pDoc->appendChild(pRoot);
  5471. string stringXmlContent;
  5472. int nRet = PHMS_SUCCESSFUL_RESULT;
  5473. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5474. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5475. {
  5476. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5477. return nRet;
  5478. }
  5479. CPhmsRequestHead phmsRequestHead("10", "1046", m_stringSessionId, "11");
  5480. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5481. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5482. phmsRequest.GenerateAndSetSign();
  5483. CPhmsResponse phmsResponse;
  5484. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5485. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5486. {
  5487. //写日志
  5488. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5489. return nRet;
  5490. }
  5491. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5492. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5493. {
  5494. //写日志
  5495. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5496. return nRet;
  5497. }
  5498. return PHMS_SUCCESSFUL_RESULT;
  5499. }
  5500. int CPhmsSession::GetCardUserList(string stringCardId, string stringSenderId, string stringPersonId, string stringTel, string stringName, string stringType,
  5501. string stringPageTo, string stringPageSize)
  5502. {
  5503. AutoPtr<Document> pDoc = new Document;
  5504. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  5505. AutoPtr<Element> pRoot = pDoc->createElement("request");
  5506. AutoPtr<Element> pChildCardId = pDoc->createElement("cardid");
  5507. AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
  5508. AutoPtr<Element> pChildPersonId = pDoc->createElement("pid");
  5509. AutoPtr<Element> pChildTel = pDoc->createElement("tel");
  5510. AutoPtr<Element> pChildName = pDoc->createElement("name");
  5511. AutoPtr<Element> pChildType = pDoc->createElement("type");
  5512. AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
  5513. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  5514. AutoPtr<Text> pTextCardId = pDoc->createTextNode(stringCardId);
  5515. AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
  5516. AutoPtr<Text> pTextPersonId = pDoc->createTextNode(stringPersonId);
  5517. AutoPtr<Text> pTextTel = pDoc->createTextNode(stringTel);
  5518. AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
  5519. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  5520. AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
  5521. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  5522. pChildCardId->appendChild(pTextCardId);
  5523. pChildSenderId->appendChild(pTextSenderId);
  5524. pChildPersonId->appendChild(pTextPersonId);
  5525. pChildTel->appendChild(pTextTel);
  5526. pChildName->appendChild(pTextName);
  5527. pChildType->appendChild(pTextType);
  5528. pChildPageTo->appendChild(pTextPageTo);
  5529. pChildPageSize->appendChild(pTextPageSize);
  5530. pRoot->appendChild(pChildCardId);
  5531. pRoot->appendChild(pChildSenderId);
  5532. pRoot->appendChild(pChildPersonId);
  5533. pRoot->appendChild(pChildTel);
  5534. pRoot->appendChild(pChildName);
  5535. pRoot->appendChild(pChildType);
  5536. pRoot->appendChild(pChildPageTo);
  5537. pRoot->appendChild(pChildPageSize);
  5538. //pDoc->appendChild(pi);
  5539. pDoc->appendChild(pRoot);
  5540. string stringXmlContent;
  5541. int nRet = PHMS_SUCCESSFUL_RESULT;
  5542. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5543. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5544. {
  5545. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5546. return nRet;
  5547. }
  5548. CPhmsRequestHead phmsRequestHead("10", "1047", m_stringSessionId, "11");
  5549. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5550. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5551. phmsRequest.GenerateAndSetSign();
  5552. CPhmsResponse phmsResponse;
  5553. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5554. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5555. {
  5556. //写日志
  5557. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5558. return nRet;
  5559. }
  5560. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5561. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5562. {
  5563. //写日志
  5564. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5565. return nRet;
  5566. }
  5567. return PHMS_SUCCESSFUL_RESULT;
  5568. }
  5569. int CPhmsSession::KeepSession()
  5570. {
  5571. CPhmsRequestHead phmsRequestHead("10", "1048", m_stringSessionId, "10");
  5572. CPhmsRequestBody phmsRequestBody("");
  5573. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5574. phmsRequest.GenerateAndSetSign();
  5575. CPhmsResponse phmsResponse;
  5576. int nRet = PHMS_SUCCESSFUL_RESULT;
  5577. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5578. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5579. {
  5580. //写日志
  5581. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5582. return nRet;
  5583. }
  5584. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5585. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5586. {
  5587. //写日志
  5588. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5589. return nRet;
  5590. }
  5591. return PHMS_SUCCESSFUL_RESULT;
  5592. }
  5593. int CPhmsSession::MarkCaseException(string stringCaseId, string stringReceiverId, int nResultFlag)
  5594. {
  5595. AutoPtr<Document> pDoc = new Document;
  5596. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  5597. AutoPtr<Element> pRoot = pDoc->createElement("request");
  5598. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  5599. AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
  5600. AutoPtr<Element> pChildSymptoms = pDoc->createElement("symptoms");
  5601. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  5602. AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
  5603. string stringResultFlag = CUtil::UIntToString(nResultFlag);
  5604. AutoPtr<Text> pTextSymptoms = pDoc->createTextNode(stringResultFlag);
  5605. pChildCaseId->appendChild(pTextCaseId);
  5606. pChildReceiverId->appendChild(pTextReceiverId);
  5607. pChildSymptoms->appendChild(pTextSymptoms);
  5608. pRoot->appendChild(pChildCaseId);
  5609. pRoot->appendChild(pChildReceiverId);
  5610. pRoot->appendChild(pChildSymptoms);
  5611. //pDoc->appendChild(pi);
  5612. pDoc->appendChild(pRoot);
  5613. string stringXmlContent;
  5614. int nRet = PHMS_SUCCESSFUL_RESULT;
  5615. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5616. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5617. {
  5618. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5619. return nRet;
  5620. }
  5621. CPhmsRequestHead phmsRequestHead("10", "1049", m_stringSessionId, "11");
  5622. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5623. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5624. phmsRequest.GenerateAndSetSign();
  5625. CPhmsResponse phmsResponse;
  5626. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5627. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5628. {
  5629. //写日志
  5630. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5631. return nRet;
  5632. }
  5633. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5634. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5635. {
  5636. //写日志
  5637. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5638. return nRet;
  5639. }
  5640. return PHMS_SUCCESSFUL_RESULT;
  5641. }
  5642. int CPhmsSession::MarkReportRead(string stringReportId)
  5643. {
  5644. AutoPtr<Document> pDoc = new Document;
  5645. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  5646. AutoPtr<Element> pRoot = pDoc->createElement("request");
  5647. AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
  5648. AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
  5649. pChildReportId->appendChild(pTextReportId);
  5650. pRoot->appendChild(pChildReportId);
  5651. //pDoc->appendChild(pi);
  5652. pDoc->appendChild(pRoot);
  5653. string stringXmlContent;
  5654. int nRet = PHMS_SUCCESSFUL_RESULT;
  5655. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5656. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5657. {
  5658. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5659. return nRet;
  5660. }
  5661. CPhmsRequestHead phmsRequestHead("10", "1050", m_stringSessionId, "11");
  5662. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5663. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5664. phmsRequest.GenerateAndSetSign();
  5665. CPhmsResponse phmsResponse;
  5666. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5667. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5668. {
  5669. //写日志
  5670. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5671. return nRet;
  5672. }
  5673. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5674. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5675. {
  5676. //写日志
  5677. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5678. return nRet;
  5679. }
  5680. return PHMS_SUCCESSFUL_RESULT;
  5681. }
  5682. int CPhmsSession::Feedback(string stringTitle, string stringNotes, string stringPhone, string stringFilePath)
  5683. {
  5684. AutoPtr<Document> pDoc = new Document;
  5685. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  5686. AutoPtr<Element> pRoot = pDoc->createElement("request");
  5687. AutoPtr<Element> pChildTitle = pDoc->createElement("title");
  5688. AutoPtr<Element> pChildNotes = pDoc->createElement("notes");
  5689. AutoPtr<Element> pChildPhone = pDoc->createElement("phone");
  5690. AutoPtr<Text> pTextTitle = pDoc->createTextNode(stringTitle);
  5691. AutoPtr<Text> pTextNotes = pDoc->createTextNode(stringNotes);
  5692. AutoPtr<Text> pTextPhone = pDoc->createTextNode(stringPhone);
  5693. pChildTitle->appendChild(pTextTitle);
  5694. pChildNotes->appendChild(pTextNotes);
  5695. pChildPhone->appendChild(pTextPhone);
  5696. pRoot->appendChild(pChildTitle);
  5697. pRoot->appendChild(pChildNotes);
  5698. pRoot->appendChild(pChildPhone);
  5699. //pDoc->appendChild(pi);
  5700. pDoc->appendChild(pRoot);
  5701. string stringXmlContent;
  5702. int nRet = PHMS_SUCCESSFUL_RESULT;
  5703. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5704. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5705. {
  5706. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5707. return nRet;
  5708. }
  5709. CPhmsRequestHead phmsRequestHead("10", "1051", m_stringSessionId, "11");
  5710. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5711. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, stringFilePath);
  5712. phmsRequest.GenerateAndSetSign();
  5713. CPhmsResponse phmsResponse;
  5714. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5715. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5716. {
  5717. //写日志
  5718. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5719. return nRet;
  5720. }
  5721. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5722. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5723. {
  5724. //写日志
  5725. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5726. return nRet;
  5727. }
  5728. return PHMS_SUCCESSFUL_RESULT;
  5729. }
  5730. int CPhmsSession::UploadTrendData2(string stringTargetPath)
  5731. {
  5732. ifstream ifTarget;
  5733. ostringstream ostringTarget;
  5734. Base64Encoder encoderBase64(ostringTarget);
  5735. encoderBase64.rdbuf()->setLineLength(0);
  5736. try
  5737. {
  5738. ifTarget.exceptions(ios::badbit);
  5739. ifTarget.open(stringTargetPath.c_str(), ios_base::in|ios_base::binary);
  5740. StreamCopier::copyStream(ifTarget, encoderBase64);
  5741. ifTarget.close();
  5742. }
  5743. catch (ios_base::failure& e)
  5744. {
  5745. //写日志
  5746. CPhmsLogger::GetPhmsLogger()->WriteLog(e.what(), __FUNCTION__, __FILE__, __LINE__);
  5747. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_READ_FAIL), __FUNCTION__, __FILE__, __LINE__);
  5748. return COMMON_FILE_READ_FAIL;
  5749. }
  5750. encoderBase64.close();
  5751. string stringXmlContent = ostringTarget.str();
  5752. int nRet = PHMS_SUCCESSFUL_RESULT;
  5753. CPhmsRequestHead phmsRequestHead("10", "1052", m_stringSessionId, "12");
  5754. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5755. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5756. phmsRequest.GenerateAndSetSign();
  5757. CPhmsResponse phmsResponse;
  5758. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5759. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5760. {
  5761. //写日志
  5762. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5763. return nRet;
  5764. }
  5765. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5766. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5767. {
  5768. //写日志
  5769. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5770. return nRet;
  5771. }
  5772. return PHMS_SUCCESSFUL_RESULT;
  5773. }
  5774. int CPhmsSession::GetAllTeamList()
  5775. {
  5776. CPhmsRequestHead phmsRequestHead("10", "1053", m_stringSessionId, "10");
  5777. CPhmsRequestBody phmsRequestBody("");
  5778. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5779. phmsRequest.GenerateAndSetSign();
  5780. CPhmsResponse phmsResponse;
  5781. int nRet = PHMS_SUCCESSFUL_RESULT;
  5782. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5783. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5784. {
  5785. //写日志
  5786. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5787. return nRet;
  5788. }
  5789. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5790. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5791. {
  5792. //写日志
  5793. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5794. return nRet;
  5795. }
  5796. return PHMS_SUCCESSFUL_RESULT;
  5797. }
  5798. int CPhmsSession::GetDoctorListOfTeam(string stringTeamId)
  5799. {
  5800. AutoPtr<Document> pDoc = new Document;
  5801. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  5802. AutoPtr<Element> pRoot = pDoc->createElement("request");
  5803. AutoPtr<Element> pChildTeamId = pDoc->createElement("teamid");
  5804. AutoPtr<Text> pTextTeamId = pDoc->createTextNode(stringTeamId);
  5805. pChildTeamId->appendChild(pTextTeamId);
  5806. pRoot->appendChild(pChildTeamId);
  5807. //pDoc->appendChild(pi);
  5808. pDoc->appendChild(pRoot);
  5809. string stringXmlContent;
  5810. int nRet = PHMS_SUCCESSFUL_RESULT;
  5811. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5812. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5813. {
  5814. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5815. return nRet;
  5816. }
  5817. CPhmsRequestHead phmsRequestHead("10", "1054", m_stringSessionId, "11");
  5818. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5819. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5820. phmsRequest.GenerateAndSetSign();
  5821. CPhmsResponse phmsResponse;
  5822. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5823. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5824. {
  5825. //写日志
  5826. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5827. return nRet;
  5828. }
  5829. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5830. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5831. {
  5832. //写日志
  5833. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5834. return nRet;
  5835. }
  5836. return PHMS_SUCCESSFUL_RESULT;
  5837. }
  5838. int CPhmsSession::GetEventStream(string stringCaseId, string stringOriginalHospital)
  5839. {
  5840. AutoPtr<Document> pDoc = new Document;
  5841. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  5842. AutoPtr<Element> pRoot = pDoc->createElement("request");
  5843. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  5844. AutoPtr<Element> pChildSourceHospital = pDoc->createElement("horgorder");
  5845. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  5846. AutoPtr<Text> pTextOriginalHospital = pDoc->createTextNode(stringOriginalHospital);
  5847. pChildCaseId->appendChild(pTextCaseId);
  5848. pChildSourceHospital->appendChild(pTextOriginalHospital);
  5849. pRoot->appendChild(pChildCaseId);
  5850. pRoot->appendChild(pChildSourceHospital);
  5851. //pDoc->appendChild(pi);
  5852. pDoc->appendChild(pRoot);
  5853. string stringXmlContent;
  5854. int nRet = PHMS_SUCCESSFUL_RESULT;
  5855. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5856. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5857. {
  5858. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5859. return nRet;
  5860. }
  5861. CPhmsRequestHead phmsRequestHead("10", "1055", m_stringSessionId, "11");
  5862. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5863. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5864. phmsRequest.GenerateAndSetSign();
  5865. CPhmsResponse phmsResponse;
  5866. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5867. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5868. {
  5869. //写日志
  5870. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5871. return nRet;
  5872. }
  5873. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5874. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5875. {
  5876. //写日志
  5877. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5878. return nRet;
  5879. }
  5880. return PHMS_SUCCESSFUL_RESULT;
  5881. }
  5882. int CPhmsSession::GetCaseTypeList(string stringLanguage)
  5883. {
  5884. AutoPtr<Document> pDoc = new Document;
  5885. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  5886. AutoPtr<Element> pRoot = pDoc->createElement("request");
  5887. AutoPtr<Element> pChildLanguage = pDoc->createElement("lang");
  5888. AutoPtr<Text> pTextLanguage = pDoc->createTextNode(stringLanguage);
  5889. pChildLanguage->appendChild(pTextLanguage);
  5890. pRoot->appendChild(pChildLanguage);
  5891. //pDoc->appendChild(pi);
  5892. pDoc->appendChild(pRoot);
  5893. string stringXmlContent;
  5894. int nRet = PHMS_SUCCESSFUL_RESULT;
  5895. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5896. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5897. {
  5898. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5899. return nRet;
  5900. }
  5901. CPhmsRequestHead phmsRequestHead("10", "1056", m_stringSessionId, "11");
  5902. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5903. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5904. phmsRequest.GenerateAndSetSign();
  5905. CPhmsResponse phmsResponse;
  5906. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5907. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5908. {
  5909. //写日志
  5910. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5911. return nRet;
  5912. }
  5913. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5914. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5915. {
  5916. //写日志
  5917. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5918. return nRet;
  5919. }
  5920. return PHMS_SUCCESSFUL_RESULT;
  5921. }
  5922. int CPhmsSession::DoctorHandledCaseStatistics(string stringCaseType, string stringStartTime, string stringEndTime)
  5923. {
  5924. AutoPtr<Document> pDoc = new Document;
  5925. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  5926. AutoPtr<Element> pRoot = pDoc->createElement("request");
  5927. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  5928. AutoPtr<Element> pChildStartTime = pDoc->createElement("startdate");
  5929. AutoPtr<Element> pChildEndTime = pDoc->createElement("enddate");
  5930. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  5931. AutoPtr<Text> pTextStartTime = pDoc->createTextNode(stringStartTime);
  5932. AutoPtr<Text> pTextEndTime = pDoc->createTextNode(stringEndTime);
  5933. pChildCaseType->appendChild(pTextCaseType);
  5934. pChildStartTime->appendChild(pTextStartTime);
  5935. pChildEndTime->appendChild(pTextEndTime);
  5936. pRoot->appendChild(pChildCaseType);
  5937. pRoot->appendChild(pChildStartTime);
  5938. pRoot->appendChild(pChildEndTime);
  5939. //pDoc->appendChild(pi);
  5940. pDoc->appendChild(pRoot);
  5941. string stringXmlContent;
  5942. int nRet = PHMS_SUCCESSFUL_RESULT;
  5943. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5944. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5945. {
  5946. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5947. return nRet;
  5948. }
  5949. CPhmsRequestHead phmsRequestHead("10", "1057", m_stringSessionId, "11");
  5950. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  5951. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  5952. phmsRequest.GenerateAndSetSign();
  5953. CPhmsResponse phmsResponse;
  5954. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  5955. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5956. {
  5957. //写日志
  5958. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5959. return nRet;
  5960. }
  5961. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  5962. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5963. {
  5964. //写日志
  5965. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5966. return nRet;
  5967. }
  5968. return PHMS_SUCCESSFUL_RESULT;
  5969. }
  5970. int CPhmsSession::UserRegister(string stringPhone, string stringName, string stringHeigth)
  5971. {
  5972. AutoPtr<Document> pDoc = new Document;
  5973. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  5974. AutoPtr<Element> pRoot = pDoc->createElement("request");
  5975. AutoPtr<Element> pChildPhone = pDoc->createElement("phone");
  5976. AutoPtr<Element> pChildName = pDoc->createElement("name");
  5977. AutoPtr<Element> pChildHeigth = pDoc->createElement("heigth");
  5978. AutoPtr<Text> pTextPhone = pDoc->createTextNode(stringPhone);
  5979. AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
  5980. AutoPtr<Text> pTextHeigth = pDoc->createTextNode(stringHeigth);
  5981. pChildPhone->appendChild(pTextPhone);
  5982. pChildName->appendChild(pTextName);
  5983. pChildHeigth->appendChild(pTextHeigth);
  5984. pRoot->appendChild(pChildPhone);
  5985. pRoot->appendChild(pChildName);
  5986. pRoot->appendChild(pChildHeigth);
  5987. //pDoc->appendChild(pi);
  5988. pDoc->appendChild(pRoot);
  5989. string stringXmlContent;
  5990. int nRet = PHMS_SUCCESSFUL_RESULT;
  5991. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  5992. if(nRet != PHMS_SUCCESSFUL_RESULT)
  5993. {
  5994. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  5995. return nRet;
  5996. }
  5997. string stringSessionId(32, '0');
  5998. CPhmsRequestHead phmsRequestHead("10", "1058", stringSessionId, "11");
  5999. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  6000. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6001. //phmsRequest.GenerateAndSetSign();签名为32个0的原因与登录一致
  6002. CPhmsResponse phmsResponse;
  6003. m_enumPhmsCommandType = REGISTER_TYPE;//目前只有登录命令是LOGIN_TYPE,改变个人信息命令是CHANGE_INFO_TYPE,用户注册命令是REGISTER_TYPE
  6004. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6005. m_enumPhmsCommandType = MAIN_TYPE;//其余都是MAIN_TYPE
  6006. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6007. {
  6008. //写日志
  6009. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6010. return nRet;
  6011. }
  6012. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6013. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6014. {
  6015. //写日志
  6016. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6017. return nRet;
  6018. }
  6019. return PHMS_SUCCESSFUL_RESULT;
  6020. }
  6021. int CPhmsSession::GetTrendData(string stringUId, string stringInterUId, string stringTrendType, string stringStartDate, string stringEndDate, string stringNextId)
  6022. {
  6023. AutoPtr<Document> pDoc = new Document;
  6024. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  6025. AutoPtr<Element> pRoot = pDoc->createElement("request");
  6026. AutoPtr<Element> pChildUId = pDoc->createElement("uid");
  6027. AutoPtr<Element> pChildInterUId = pDoc->createElement("interuid");
  6028. AutoPtr<Element> pChildTrendType = pDoc->createElement("trendtype");
  6029. AutoPtr<Element> pChildStartDate = pDoc->createElement("startdate");
  6030. AutoPtr<Element> pChildEndDate = pDoc->createElement("enddate");
  6031. AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
  6032. AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
  6033. AutoPtr<Text> pTextInterUId = pDoc->createTextNode(stringInterUId);
  6034. AutoPtr<Text> pTextTrendType = pDoc->createTextNode(stringTrendType);
  6035. AutoPtr<Text> pTextStartDate = pDoc->createTextNode(stringStartDate);
  6036. AutoPtr<Text> pTextEndDate = pDoc->createTextNode(stringEndDate);
  6037. AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
  6038. pChildUId->appendChild(pTextUId);
  6039. pChildInterUId->appendChild(pTextInterUId);
  6040. pChildTrendType->appendChild(pTextTrendType);
  6041. pChildStartDate->appendChild(pTextStartDate);
  6042. pChildEndDate->appendChild(pTextEndDate);
  6043. pChildNextId->appendChild(pTextNextId);
  6044. pRoot->appendChild(pChildUId);
  6045. pRoot->appendChild(pChildInterUId);
  6046. pRoot->appendChild(pChildTrendType);
  6047. pRoot->appendChild(pChildStartDate);
  6048. pRoot->appendChild(pChildEndDate);
  6049. pRoot->appendChild(pChildNextId);
  6050. //pDoc->appendChild(pi);
  6051. pDoc->appendChild(pRoot);
  6052. string stringXmlContent;
  6053. int nRet = PHMS_SUCCESSFUL_RESULT;
  6054. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  6055. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6056. {
  6057. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6058. return nRet;
  6059. }
  6060. CPhmsRequestHead phmsRequestHead("10", "1059", m_stringSessionId, "11");
  6061. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  6062. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6063. phmsRequest.GenerateAndSetSign();
  6064. CPhmsResponse phmsResponse;
  6065. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6066. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6067. {
  6068. //写日志
  6069. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6070. return nRet;
  6071. }
  6072. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6073. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6074. {
  6075. //写日志
  6076. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6077. return nRet;
  6078. }
  6079. return PHMS_SUCCESSFUL_RESULT;
  6080. }
  6081. int CPhmsSession::GetLastPhysiologicalData()
  6082. {
  6083. CPhmsRequestHead phmsRequestHead("10", "1060", m_stringSessionId, "10");
  6084. CPhmsRequestBody phmsRequestBody("");
  6085. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6086. phmsRequest.GenerateAndSetSign();
  6087. CPhmsResponse phmsResponse;
  6088. int nRet = PHMS_SUCCESSFUL_RESULT;
  6089. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6090. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6091. {
  6092. //写日志
  6093. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6094. return nRet;
  6095. }
  6096. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6097. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6098. {
  6099. //写日志
  6100. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6101. return nRet;
  6102. }
  6103. return PHMS_SUCCESSFUL_RESULT;
  6104. }
  6105. int CPhmsSession::GetHealthDegree(string stringUId, string stringInterUId, string stringDate)
  6106. {
  6107. AutoPtr<Document> pDoc = new Document;
  6108. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  6109. AutoPtr<Element> pRoot = pDoc->createElement("request");
  6110. AutoPtr<Element> pChildUId = pDoc->createElement("uid");
  6111. AutoPtr<Element> pChildInterUId = pDoc->createElement("interuid");
  6112. AutoPtr<Element> pChildDate = pDoc->createElement("date");
  6113. AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
  6114. AutoPtr<Text> pTextInterUId = pDoc->createTextNode(stringInterUId);
  6115. AutoPtr<Text> pTextDate = pDoc->createTextNode(stringDate);
  6116. pChildUId->appendChild(pTextUId);
  6117. pChildInterUId->appendChild(pTextInterUId);
  6118. pChildDate->appendChild(pTextDate);
  6119. pRoot->appendChild(pChildUId);
  6120. pRoot->appendChild(pChildInterUId);
  6121. pRoot->appendChild(pChildDate);
  6122. //pDoc->appendChild(pi);
  6123. pDoc->appendChild(pRoot);
  6124. string stringXmlContent;
  6125. int nRet = PHMS_SUCCESSFUL_RESULT;
  6126. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  6127. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6128. {
  6129. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6130. return nRet;
  6131. }
  6132. CPhmsRequestHead phmsRequestHead("10", "1061", m_stringSessionId, "11");
  6133. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  6134. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6135. phmsRequest.GenerateAndSetSign();
  6136. CPhmsResponse phmsResponse;
  6137. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6138. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6139. {
  6140. //写日志
  6141. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6142. return nRet;
  6143. }
  6144. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6145. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6146. {
  6147. //写日志
  6148. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6149. return nRet;
  6150. }
  6151. return PHMS_SUCCESSFUL_RESULT;
  6152. }
  6153. int CPhmsSession::GetUserOfNoAdviceAndMostData(string stringDays)
  6154. {
  6155. AutoPtr<Document> pDoc = new Document;
  6156. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  6157. AutoPtr<Element> pRoot = pDoc->createElement("request");
  6158. AutoPtr<Element> pChildDays = pDoc->createElement("days");
  6159. AutoPtr<Text> pTextDays = pDoc->createTextNode(stringDays);
  6160. pChildDays->appendChild(pTextDays);
  6161. pRoot->appendChild(pChildDays);
  6162. //pDoc->appendChild(pi);
  6163. pDoc->appendChild(pRoot);
  6164. string stringXmlContent;
  6165. int nRet = PHMS_SUCCESSFUL_RESULT;
  6166. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  6167. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6168. {
  6169. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6170. return nRet;
  6171. }
  6172. CPhmsRequestHead phmsRequestHead("10", "1062", m_stringSessionId, "11");
  6173. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  6174. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6175. phmsRequest.GenerateAndSetSign();
  6176. CPhmsResponse phmsResponse;
  6177. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6178. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6179. {
  6180. //写日志
  6181. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6182. return nRet;
  6183. }
  6184. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6185. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6186. {
  6187. //写日志
  6188. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6189. return nRet;
  6190. }
  6191. return PHMS_SUCCESSFUL_RESULT;
  6192. }
  6193. int CPhmsSession::AdviceDelay(string stringUId, string stringMinutes)
  6194. {
  6195. AutoPtr<Document> pDoc = new Document;
  6196. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  6197. AutoPtr<Element> pRoot = pDoc->createElement("request");
  6198. AutoPtr<Element> pChildUId = pDoc->createElement("uid");
  6199. AutoPtr<Element> pChildMinutes = pDoc->createElement("minutes");
  6200. AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
  6201. AutoPtr<Text> pTextMinutes = pDoc->createTextNode(stringMinutes);
  6202. pChildUId->appendChild(pTextUId);
  6203. pChildMinutes->appendChild(pTextMinutes);
  6204. pRoot->appendChild(pChildUId);
  6205. pRoot->appendChild(pChildMinutes);
  6206. //pDoc->appendChild(pi);
  6207. pDoc->appendChild(pRoot);
  6208. string stringXmlContent;
  6209. int nRet = PHMS_SUCCESSFUL_RESULT;
  6210. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  6211. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6212. {
  6213. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6214. return nRet;
  6215. }
  6216. CPhmsRequestHead phmsRequestHead("10", "1063", m_stringSessionId, "11");
  6217. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  6218. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6219. phmsRequest.GenerateAndSetSign();
  6220. CPhmsResponse phmsResponse;
  6221. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6222. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6223. {
  6224. //写日志
  6225. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6226. return nRet;
  6227. }
  6228. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6229. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6230. {
  6231. //写日志
  6232. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6233. return nRet;
  6234. }
  6235. return PHMS_SUCCESSFUL_RESULT;
  6236. }
  6237. int CPhmsSession::AdviceComplete(string stringUId, string stringOptionType, string stringAdvice)
  6238. {
  6239. AutoPtr<Document> pDoc = new Document;
  6240. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  6241. AutoPtr<Element> pRoot = pDoc->createElement("request");
  6242. AutoPtr<Element> pChildUId = pDoc->createElement("uid");
  6243. AutoPtr<Element> pChildOptionType = pDoc->createElement("optype");
  6244. AutoPtr<Element> pChildAdvice = pDoc->createElement("advice");
  6245. AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
  6246. AutoPtr<Text> pTextOptionType = pDoc->createTextNode(stringOptionType);
  6247. AutoPtr<Text> pTextAdvice = pDoc->createTextNode(stringAdvice);
  6248. pChildUId->appendChild(pTextUId);
  6249. pChildOptionType->appendChild(pTextOptionType);
  6250. pChildAdvice->appendChild(pTextAdvice);
  6251. pRoot->appendChild(pChildUId);
  6252. pRoot->appendChild(pChildOptionType);
  6253. pRoot->appendChild(pChildAdvice);
  6254. //pDoc->appendChild(pi);
  6255. pDoc->appendChild(pRoot);
  6256. string stringXmlContent;
  6257. int nRet = PHMS_SUCCESSFUL_RESULT;
  6258. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  6259. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6260. {
  6261. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6262. return nRet;
  6263. }
  6264. CPhmsRequestHead phmsRequestHead("10", "1064", m_stringSessionId, "11");
  6265. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  6266. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6267. phmsRequest.GenerateAndSetSign();
  6268. CPhmsResponse phmsResponse;
  6269. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6270. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6271. {
  6272. //写日志
  6273. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6274. return nRet;
  6275. }
  6276. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6277. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6278. {
  6279. //写日志
  6280. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6281. return nRet;
  6282. }
  6283. return PHMS_SUCCESSFUL_RESULT;
  6284. }
  6285. int CPhmsSession::GetUserListOfNoAdvice(string stringDays, string stringPageTo, string stringPageSize)
  6286. {
  6287. AutoPtr<Document> pDoc = new Document;
  6288. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  6289. AutoPtr<Element> pRoot = pDoc->createElement("request");
  6290. AutoPtr<Element> pChildDays = pDoc->createElement("days");
  6291. AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
  6292. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  6293. AutoPtr<Text> pTextDays = pDoc->createTextNode(stringDays);
  6294. AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
  6295. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  6296. pChildDays->appendChild(pTextDays);
  6297. pChildPageTo->appendChild(pTextPageTo);
  6298. pChildPageSize->appendChild(pTextPageSize);
  6299. pRoot->appendChild(pChildDays);
  6300. pRoot->appendChild(pChildPageTo);
  6301. pRoot->appendChild(pChildPageSize);
  6302. //pDoc->appendChild(pi);
  6303. pDoc->appendChild(pRoot);
  6304. string stringXmlContent;
  6305. int nRet = PHMS_SUCCESSFUL_RESULT;
  6306. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  6307. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6308. {
  6309. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6310. return nRet;
  6311. }
  6312. CPhmsRequestHead phmsRequestHead("10", "1065", m_stringSessionId, "11");
  6313. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  6314. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6315. phmsRequest.GenerateAndSetSign();
  6316. CPhmsResponse phmsResponse;
  6317. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6318. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6319. {
  6320. //写日志
  6321. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6322. return nRet;
  6323. }
  6324. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6325. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6326. {
  6327. //写日志
  6328. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6329. return nRet;
  6330. }
  6331. return PHMS_SUCCESSFUL_RESULT;
  6332. }
  6333. int CPhmsSession::AdviceBegin(string stringUId)
  6334. {
  6335. AutoPtr<Document> pDoc = new Document;
  6336. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  6337. AutoPtr<Element> pRoot = pDoc->createElement("request");
  6338. AutoPtr<Element> pChildUId = pDoc->createElement("uid");
  6339. AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
  6340. pChildUId->appendChild(pTextUId);
  6341. pRoot->appendChild(pChildUId);
  6342. //pDoc->appendChild(pi);
  6343. pDoc->appendChild(pRoot);
  6344. string stringXmlContent;
  6345. int nRet = PHMS_SUCCESSFUL_RESULT;
  6346. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  6347. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6348. {
  6349. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6350. return nRet;
  6351. }
  6352. CPhmsRequestHead phmsRequestHead("10", "1066", m_stringSessionId, "11");
  6353. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  6354. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6355. phmsRequest.GenerateAndSetSign();
  6356. CPhmsResponse phmsResponse;
  6357. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6358. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6359. {
  6360. //写日志
  6361. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6362. return nRet;
  6363. }
  6364. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6365. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6366. {
  6367. //写日志
  6368. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6369. return nRet;
  6370. }
  6371. return PHMS_SUCCESSFUL_RESULT;
  6372. }
  6373. int CPhmsSession::GetUserListOfAdvicing(string stringPageTo, string stringPageSize)
  6374. {
  6375. AutoPtr<Document> pDoc = new Document;
  6376. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  6377. AutoPtr<Element> pRoot = pDoc->createElement("request");
  6378. AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
  6379. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  6380. AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
  6381. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  6382. pChildPageTo->appendChild(pTextPageTo);
  6383. pChildPageSize->appendChild(pTextPageSize);
  6384. pRoot->appendChild(pChildPageTo);
  6385. pRoot->appendChild(pChildPageSize);
  6386. //pDoc->appendChild(pi);
  6387. pDoc->appendChild(pRoot);
  6388. string stringXmlContent;
  6389. int nRet = PHMS_SUCCESSFUL_RESULT;
  6390. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  6391. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6392. {
  6393. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6394. return nRet;
  6395. }
  6396. CPhmsRequestHead phmsRequestHead("10", "1067", m_stringSessionId, "11");
  6397. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  6398. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6399. phmsRequest.GenerateAndSetSign();
  6400. CPhmsResponse phmsResponse;
  6401. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6402. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6403. {
  6404. //写日志
  6405. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6406. return nRet;
  6407. }
  6408. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6409. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6410. {
  6411. //写日志
  6412. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6413. return nRet;
  6414. }
  6415. return PHMS_SUCCESSFUL_RESULT;
  6416. }
  6417. int CPhmsSession::VerifyThirdId(string stringUId, string stringType)
  6418. {
  6419. AutoPtr<Document> pDoc = new Document;
  6420. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  6421. AutoPtr<Element> pRoot = pDoc->createElement("request");
  6422. AutoPtr<Element> pChildUId = pDoc->createElement("uid");
  6423. AutoPtr<Element> pChildType = pDoc->createElement("type");
  6424. AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
  6425. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  6426. pChildUId->appendChild(pTextUId);
  6427. pChildType->appendChild(pTextType);
  6428. pRoot->appendChild(pChildUId);
  6429. pRoot->appendChild(pChildType);
  6430. //pDoc->appendChild(pi);
  6431. pDoc->appendChild(pRoot);
  6432. string stringXmlContent;
  6433. int nRet = PHMS_SUCCESSFUL_RESULT;
  6434. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  6435. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6436. {
  6437. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6438. return nRet;
  6439. }
  6440. string stringSessionId(32, '0');
  6441. CPhmsRequestHead phmsRequestHead("10", "1068", stringSessionId/*m_stringSessionId*/, "11");
  6442. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  6443. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6444. //phmsRequest.GenerateAndSetSign();
  6445. CPhmsResponse phmsResponse;
  6446. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6447. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6448. {
  6449. //写日志
  6450. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6451. return nRet;
  6452. }
  6453. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6454. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6455. {
  6456. //写日志
  6457. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6458. return nRet;
  6459. }
  6460. return PHMS_SUCCESSFUL_RESULT;
  6461. }
  6462. int CPhmsSession::PersonIdRegister(string stringType, string stringRegFrom, string stringPersonId, string stringName, string stringSex, string stringBirthday, string stringAddress,
  6463. string stringPhone, string stringHeigth, string stringUploadUnitId, string stringHospitalId, string stringHGroupId,string stringScode, string stringWxUId, string stringLmp, string stringWeight, string stringPassword,
  6464. string stringThirdCode, string stringIsRegister)
  6465. {
  6466. AutoPtr<Document> pDoc = new Document;
  6467. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  6468. AutoPtr<Element> pRoot = pDoc->createElement("request");
  6469. AutoPtr<Element> pChildType = pDoc->createElement("type");
  6470. AutoPtr<Element> pChildRegFrom = pDoc->createElement("regfrom");
  6471. AutoPtr<Element> pChildPersonId = pDoc->createElement("personid");
  6472. AutoPtr<Element> pChildName = pDoc->createElement("name");
  6473. AutoPtr<Element> pChildSex = pDoc->createElement("sex");
  6474. AutoPtr<Element> pChildBirthday = pDoc->createElement("birthday");
  6475. AutoPtr<Element> pChildAddress = pDoc->createElement("address");
  6476. AutoPtr<Element> pChildPhone = pDoc->createElement("phone");
  6477. AutoPtr<Element> pChildHeigth = pDoc->createElement("height");
  6478. AutoPtr<Element> pChildUploadUnitId = pDoc->createElement("upload_unitid");
  6479. AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
  6480. AutoPtr<Element> pChildHGroupId = pDoc->createElement("hgroupid");
  6481. AutoPtr<Element> pChildScode = pDoc->createElement("scode");
  6482. AutoPtr<Element> pChildWxUId = pDoc->createElement("wxuid");
  6483. AutoPtr<Element> pChildLmp = pDoc->createElement("lmp");
  6484. AutoPtr<Element> pChildWeight = pDoc->createElement("weight");
  6485. AutoPtr<Element> pChildPassword = pDoc->createElement("password");
  6486. AutoPtr<Element> pChildThirdCode = pDoc->createElement("thirdcode");
  6487. AutoPtr<Element> pChildIsRegister = pDoc->createElement("isregister");
  6488. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  6489. AutoPtr<Text> pTextRegFrom = pDoc->createTextNode(stringRegFrom);
  6490. AutoPtr<Text> pTextPersonId = pDoc->createTextNode(stringPersonId);
  6491. AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
  6492. AutoPtr<Text> pTextSex = pDoc->createTextNode(stringSex);
  6493. AutoPtr<Text> pTextBirthday = pDoc->createTextNode(stringBirthday);
  6494. AutoPtr<Text> pTextAddress = pDoc->createTextNode(stringAddress);
  6495. AutoPtr<Text> pTextPhone = pDoc->createTextNode(stringPhone);
  6496. AutoPtr<Text> pTextHeigth = pDoc->createTextNode(stringHeigth);
  6497. AutoPtr<Text> pTextUploadUnitId = pDoc->createTextNode(stringUploadUnitId);
  6498. AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
  6499. AutoPtr<Text> pTextHGroupId = pDoc->createTextNode(stringHGroupId);
  6500. AutoPtr<Text> pTextScode = pDoc->createTextNode(stringScode);
  6501. AutoPtr<Text> pTextWxUId = pDoc->createTextNode(stringWxUId);
  6502. AutoPtr<Text> pTextLmp = pDoc->createTextNode(stringLmp);
  6503. AutoPtr<Text> pTextWeight = pDoc->createTextNode(stringWeight);
  6504. AutoPtr<Text> pTextPassword = pDoc->createTextNode(stringPassword);
  6505. AutoPtr<Text> pTextThirdCode = pDoc->createTextNode(stringThirdCode);
  6506. AutoPtr<Text> pTextIsRegister = pDoc->createTextNode(stringIsRegister);
  6507. pChildType->appendChild(pTextType);
  6508. pChildRegFrom->appendChild(pTextRegFrom);
  6509. pChildPersonId->appendChild(pTextPersonId);
  6510. pChildName->appendChild(pTextName);
  6511. pChildSex->appendChild(pTextSex);
  6512. pChildBirthday->appendChild(pTextBirthday);
  6513. pChildAddress->appendChild(pTextAddress);
  6514. pChildPhone->appendChild(pTextPhone);
  6515. pChildHeigth->appendChild(pTextHeigth);
  6516. pChildUploadUnitId->appendChild(pTextUploadUnitId);
  6517. pChildHospitalId->appendChild(pTextHospitalId);
  6518. pChildHGroupId->appendChild(pTextHGroupId);
  6519. pChildScode->appendChild(pTextScode);
  6520. pChildWxUId->appendChild(pTextWxUId);
  6521. pChildLmp->appendChild(pTextLmp);
  6522. pChildWeight->appendChild(pTextWeight);
  6523. pChildPassword->appendChild(pTextPassword);
  6524. pChildThirdCode->appendChild(pTextThirdCode);
  6525. pChildIsRegister->appendChild(pTextIsRegister);
  6526. pRoot->appendChild(pChildType);
  6527. pRoot->appendChild(pChildRegFrom);
  6528. pRoot->appendChild(pChildPersonId);
  6529. pRoot->appendChild(pChildName);
  6530. pRoot->appendChild(pChildSex);
  6531. pRoot->appendChild(pChildBirthday);
  6532. pRoot->appendChild(pChildAddress);
  6533. pRoot->appendChild(pChildPhone);
  6534. pRoot->appendChild(pChildHeigth);
  6535. pRoot->appendChild(pChildUploadUnitId);
  6536. pRoot->appendChild(pChildHospitalId);
  6537. pRoot->appendChild(pChildHGroupId);
  6538. pRoot->appendChild(pChildScode);
  6539. pRoot->appendChild(pChildWxUId);
  6540. pRoot->appendChild(pChildLmp);
  6541. pRoot->appendChild(pChildWeight);
  6542. pRoot->appendChild(pChildPassword);
  6543. pRoot->appendChild(pChildThirdCode);
  6544. pRoot->appendChild(pChildIsRegister);
  6545. //pDoc->appendChild(pi);
  6546. pDoc->appendChild(pRoot);
  6547. string stringXmlContent;
  6548. int nRet = PHMS_SUCCESSFUL_RESULT;
  6549. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  6550. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6551. {
  6552. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6553. return nRet;
  6554. }
  6555. string stringSessionId(32, '0');
  6556. CPhmsRequestHead phmsRequestHead("10", "1069", stringSessionId, "11");
  6557. if(stringType=="1")
  6558. {
  6559. phmsRequestHead.SetSessionId(m_stringSessionId);
  6560. }
  6561. if(stringType=="4" || stringType=="5")
  6562. {
  6563. if(m_stringSessionId.size() != 0)
  6564. {
  6565. phmsRequestHead.SetSessionId(m_stringSessionId);
  6566. }
  6567. }
  6568. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  6569. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6570. if(stringType=="1" || ((stringType=="4" || stringType=="5") && m_stringSessionId.size() != 0))
  6571. {
  6572. phmsRequest.GenerateAndSetSign();
  6573. }
  6574. CPhmsResponse phmsResponse;
  6575. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6576. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6577. {
  6578. //写日志
  6579. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6580. return nRet;
  6581. }
  6582. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6583. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6584. {
  6585. //写日志
  6586. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6587. return nRet;
  6588. }
  6589. return PHMS_SUCCESSFUL_RESULT;
  6590. }
  6591. int CPhmsSession::GetVerificationCode(string stringType, string stringPhone)
  6592. {
  6593. AutoPtr<Document> pDoc = new Document;
  6594. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  6595. AutoPtr<Element> pRoot = pDoc->createElement("request");
  6596. AutoPtr<Element> pChildType = pDoc->createElement("type");
  6597. AutoPtr<Element> pChildPhone = pDoc->createElement("phone");
  6598. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  6599. AutoPtr<Text> pTextPhone = pDoc->createTextNode(stringPhone);
  6600. pChildType->appendChild(pTextType);
  6601. pChildPhone->appendChild(pTextPhone);
  6602. pRoot->appendChild(pChildType);
  6603. pRoot->appendChild(pChildPhone);
  6604. //pDoc->appendChild(pi);
  6605. pDoc->appendChild(pRoot);
  6606. string stringXmlContent;
  6607. int nRet = PHMS_SUCCESSFUL_RESULT;
  6608. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  6609. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6610. {
  6611. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6612. return nRet;
  6613. }
  6614. string stringSessionId(32, '0');
  6615. CPhmsRequestHead phmsRequestHead("10", "1070", stringSessionId, "11");
  6616. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  6617. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6618. //phmsRequest.GenerateAndSetSign();签名为32个0的原因与登录一样
  6619. CPhmsResponse phmsResponse;
  6620. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6621. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6622. {
  6623. //写日志
  6624. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6625. return nRet;
  6626. }
  6627. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6628. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6629. {
  6630. //写日志
  6631. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6632. return nRet;
  6633. }
  6634. return PHMS_SUCCESSFUL_RESULT;
  6635. }
  6636. int CPhmsSession::GetAskList(string stringAskType, string stringAskEnd, string stringDoctorId, string stringIsAsk, string stringUserId, string stringStartTime, string stringEndTime, string stringPageTo, string stringPageSize)
  6637. {
  6638. AutoPtr<Document> pDoc = new Document;
  6639. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  6640. AutoPtr<Element> pRoot = pDoc->createElement("request");
  6641. AutoPtr<Element> pChildAskType = pDoc->createElement("asktype");
  6642. AutoPtr<Element> pChildAskEnd = pDoc->createElement("askend");
  6643. AutoPtr<Element> pChildDoctorId = pDoc->createElement("doctorid");
  6644. AutoPtr<Element> pChildIsAsk = pDoc->createElement("isask");
  6645. AutoPtr<Element> pChildUserId = pDoc->createElement("userid");
  6646. AutoPtr<Element> pChildStartTime = pDoc->createElement("starttime");
  6647. AutoPtr<Element> pChildEndTime = pDoc->createElement("endtime");
  6648. AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
  6649. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  6650. AutoPtr<Text> pTextAskType = pDoc->createTextNode(stringAskType);
  6651. AutoPtr<Text> pTextAskEnd = pDoc->createTextNode(stringAskEnd);
  6652. AutoPtr<Text> pTextDoctorId = pDoc->createTextNode(stringDoctorId);
  6653. AutoPtr<Text> pTextIsAsk = pDoc->createTextNode(stringIsAsk);
  6654. AutoPtr<Text> pTextUserId = pDoc->createTextNode(stringUserId);
  6655. AutoPtr<Text> pTextStartTime = pDoc->createTextNode(stringStartTime);
  6656. AutoPtr<Text> pTextEndTime = pDoc->createTextNode(stringEndTime);
  6657. AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
  6658. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  6659. pChildAskType->appendChild(pTextAskType);
  6660. pChildAskEnd->appendChild(pTextAskEnd);
  6661. pChildDoctorId->appendChild(pTextDoctorId);
  6662. pChildIsAsk->appendChild(pTextIsAsk);
  6663. pChildUserId->appendChild(pTextUserId);
  6664. pChildStartTime->appendChild(pTextStartTime);
  6665. pChildEndTime->appendChild(pTextEndTime);
  6666. pChildPageTo->appendChild(pTextPageTo);
  6667. pChildPageSize->appendChild(pTextPageSize);
  6668. pRoot->appendChild(pChildAskType);
  6669. pRoot->appendChild(pChildAskEnd);
  6670. pRoot->appendChild(pChildDoctorId);
  6671. pRoot->appendChild(pChildIsAsk);
  6672. pRoot->appendChild(pChildUserId);
  6673. pRoot->appendChild(pChildStartTime);
  6674. pRoot->appendChild(pChildEndTime);
  6675. pRoot->appendChild(pChildPageTo);
  6676. pRoot->appendChild(pChildPageSize);
  6677. //pDoc->appendChild(pi);
  6678. pDoc->appendChild(pRoot);
  6679. string stringXmlContent;
  6680. int nRet = PHMS_SUCCESSFUL_RESULT;
  6681. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  6682. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6683. {
  6684. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6685. return nRet;
  6686. }
  6687. CPhmsRequestHead phmsRequestHead("10", "1071", m_stringSessionId, "11");
  6688. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  6689. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6690. phmsRequest.GenerateAndSetSign();
  6691. CPhmsResponse phmsResponse;
  6692. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6693. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6694. {
  6695. //写日志
  6696. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6697. return nRet;
  6698. }
  6699. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6700. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6701. {
  6702. //写日志
  6703. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6704. return nRet;
  6705. }
  6706. return PHMS_SUCCESSFUL_RESULT;
  6707. }
  6708. int CPhmsSession::GetAskDetail(string stringAskId)
  6709. {
  6710. AutoPtr<Document> pDoc = new Document;
  6711. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  6712. AutoPtr<Element> pRoot = pDoc->createElement("request");
  6713. AutoPtr<Element> pChildAskId = pDoc->createElement("askid");
  6714. AutoPtr<Element> pChildIsAsked = pDoc->createElement("isasked");
  6715. AutoPtr<Element> pChildDoctorId = pDoc->createElement("doctorid");
  6716. AutoPtr<Text> pTextAskId = pDoc->createTextNode(stringAskId);
  6717. AutoPtr<Text> pTextIsAsked = pDoc->createTextNode("");
  6718. AutoPtr<Text> pTextDoctorId = pDoc->createTextNode("");
  6719. pChildAskId->appendChild(pTextAskId);
  6720. pChildIsAsked->appendChild(pTextIsAsked);
  6721. pChildDoctorId->appendChild(pTextDoctorId);
  6722. pRoot->appendChild(pChildAskId);
  6723. pRoot->appendChild(pChildIsAsked);
  6724. pRoot->appendChild(pChildDoctorId);
  6725. //pDoc->appendChild(pi);
  6726. pDoc->appendChild(pRoot);
  6727. string stringXmlContent;
  6728. int nRet = PHMS_SUCCESSFUL_RESULT;
  6729. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  6730. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6731. {
  6732. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6733. return nRet;
  6734. }
  6735. CPhmsRequestHead phmsRequestHead("10", "1072", m_stringSessionId, "11");
  6736. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  6737. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6738. phmsRequest.GenerateAndSetSign();
  6739. CPhmsResponse phmsResponse;
  6740. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6741. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6742. {
  6743. //写日志
  6744. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6745. return nRet;
  6746. }
  6747. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6748. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6749. {
  6750. //写日志
  6751. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6752. return nRet;
  6753. }
  6754. return PHMS_SUCCESSFUL_RESULT;
  6755. }
  6756. int CPhmsSession::GetQuestionList(string stringDoctorId, string stringReportType, string stringAskId)
  6757. {
  6758. AutoPtr<Document> pDoc = new Document;
  6759. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  6760. AutoPtr<Element> pRoot = pDoc->createElement("request");
  6761. AutoPtr<Element> pChildDoctorId = pDoc->createElement("doctorid");
  6762. AutoPtr<Element> pChildReportType = pDoc->createElement("reporttype");
  6763. AutoPtr<Element> pChildAskId = pDoc->createElement("askid");
  6764. AutoPtr<Text> pTextDoctorId = pDoc->createTextNode(stringDoctorId);
  6765. AutoPtr<Text> pTextReportType = pDoc->createTextNode(stringReportType);
  6766. AutoPtr<Text> pTextAskId = pDoc->createTextNode(stringAskId);
  6767. pChildDoctorId->appendChild(pTextDoctorId);
  6768. pChildReportType->appendChild(pTextReportType);
  6769. pChildAskId->appendChild(pTextAskId);
  6770. pRoot->appendChild(pChildDoctorId);
  6771. pRoot->appendChild(pChildReportType);
  6772. pRoot->appendChild(pChildAskId);
  6773. //pDoc->appendChild(pi);
  6774. pDoc->appendChild(pRoot);
  6775. string stringXmlContent;
  6776. int nRet = PHMS_SUCCESSFUL_RESULT;
  6777. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  6778. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6779. {
  6780. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6781. return nRet;
  6782. }
  6783. CPhmsRequestHead phmsRequestHead("10", "1073", m_stringSessionId, "11");
  6784. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  6785. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6786. phmsRequest.GenerateAndSetSign();
  6787. CPhmsResponse phmsResponse;
  6788. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6789. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6790. {
  6791. //写日志
  6792. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6793. return nRet;
  6794. }
  6795. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6796. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6797. {
  6798. //写日志
  6799. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6800. return nRet;
  6801. }
  6802. return PHMS_SUCCESSFUL_RESULT;
  6803. }
  6804. int CPhmsSession::SubmitQuestion(string stringUserId, string stringAdvise, string stringReportType, string stringAskId, string stringAskedId, string stringDoctorPhotoPath)
  6805. {
  6806. AutoPtr<Document> pDoc = new Document;
  6807. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  6808. AutoPtr<Element> pRoot = pDoc->createElement("request");
  6809. AutoPtr<Element> pChildUserId = pDoc->createElement("userid");
  6810. AutoPtr<Element> pChildAdvise = pDoc->createElement("advise");
  6811. AutoPtr<Element> pChildReportType = pDoc->createElement("reporttype");
  6812. AutoPtr<Element> pChildAskId = pDoc->createElement("askid");
  6813. AutoPtr<Element> pChildAskedId = pDoc->createElement("askedid");
  6814. AutoPtr<Element> pChildDoctorPhoto = pDoc->createElement("doctorphoto");;
  6815. AutoPtr<Text> pTextUserId = pDoc->createTextNode(stringUserId);
  6816. AutoPtr<Text> pTextAdvise = pDoc->createTextNode(stringAdvise);
  6817. AutoPtr<Text> pTextReportType = pDoc->createTextNode(stringReportType);
  6818. AutoPtr<Text> pTextAskId = pDoc->createTextNode(stringAskId);
  6819. AutoPtr<Text> pTextAskedId = pDoc->createTextNode(stringAskedId);
  6820. AutoPtr<Text> pTextDoctorPhoto = pDoc->createTextNode(stringDoctorPhotoPath);
  6821. pChildUserId->appendChild(pTextUserId);
  6822. pChildAdvise->appendChild(pTextAdvise);
  6823. pChildReportType->appendChild(pTextReportType);
  6824. pChildAskId->appendChild(pTextAskId);
  6825. pChildAskedId->appendChild(pTextAskedId);
  6826. pChildDoctorPhoto->appendChild(pTextDoctorPhoto);
  6827. pRoot->appendChild(pChildUserId);
  6828. pRoot->appendChild(pChildAdvise);
  6829. pRoot->appendChild(pChildReportType);
  6830. pRoot->appendChild(pChildAskId);
  6831. pRoot->appendChild(pChildAskedId);
  6832. pRoot->appendChild(pChildDoctorPhoto);
  6833. //pDoc->appendChild(pi);
  6834. pDoc->appendChild(pRoot);
  6835. string stringXmlContent;
  6836. int nRet = PHMS_SUCCESSFUL_RESULT;
  6837. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  6838. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6839. {
  6840. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6841. return nRet;
  6842. }
  6843. CPhmsRequestHead phmsRequestHead("10", "1074", m_stringSessionId, "11");
  6844. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  6845. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6846. phmsRequest.GenerateAndSetSign();
  6847. CPhmsResponse phmsResponse;
  6848. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6849. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6850. {
  6851. //写日志
  6852. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6853. return nRet;
  6854. }
  6855. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6856. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6857. {
  6858. //写日志
  6859. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6860. return nRet;
  6861. }
  6862. return PHMS_SUCCESSFUL_RESULT;
  6863. }
  6864. int CPhmsSession::GetDataDictionary()
  6865. {
  6866. CPhmsRequestHead phmsRequestHead("10", "1075", m_stringSessionId, "10");
  6867. CPhmsRequestBody phmsRequestBody("");
  6868. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  6869. phmsRequest.GenerateAndSetSign();
  6870. CPhmsResponse phmsResponse;
  6871. int nRet = PHMS_SUCCESSFUL_RESULT;
  6872. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  6873. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6874. {
  6875. //写日志
  6876. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6877. return nRet;
  6878. }
  6879. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  6880. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6881. {
  6882. //写日志
  6883. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  6884. return nRet;
  6885. }
  6886. return PHMS_SUCCESSFUL_RESULT;
  6887. }
  6888. int CPhmsSession::LoggingHealthBaseInfo(string stringUserId, string stringWeblock, string stringNation, string stringProfression, string stringCrowd, string stringBloodType,
  6889. string stringJwsJiBing, string stringJwsShouShu, string stringJwsWaiShang, string stringJwsShuXue, string stringJwsBaoLuShi, string stringJwsBaoLuShiBz,
  6890. string stringJwsYiChuanJiBing, string stringGmsGuoMinShi, string stringGmsGuoMinShiBz, string stringJzsFuQin, string stringJzsFuQinBz, string stringJzsMuQin,
  6891. string stringJzsMuQinBz, string stringJzsXdjm, string stringJzsXdjmBz, string stringJzsZiNv, string stringJzsZiNvBz, string stringJzsQiTa)
  6892. {
  6893. AutoPtr<Document> pDoc = new Document;
  6894. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  6895. AutoPtr<Element> pRoot = pDoc->createElement("request");
  6896. AutoPtr<Element> pChildUserId = pDoc->createElement("userid");
  6897. AutoPtr<Element> pChildWeblock = pDoc->createElement("wedlock");
  6898. AutoPtr<Element> pChildNation = pDoc->createElement("nation");
  6899. AutoPtr<Element> pChildProfression = pDoc->createElement("profession");
  6900. AutoPtr<Element> pChildCrowd = pDoc->createElement("crowd");
  6901. AutoPtr<Element> pChildBloodType = pDoc->createElement("bloodtype");
  6902. AutoPtr<Element> pChildJwsJiBing = pDoc->createElement("jws_jibing");
  6903. AutoPtr<Element> pChildJwsShouShu = pDoc->createElement("jws_shoushu");
  6904. AutoPtr<Element> pChildJwsWaiShang = pDoc->createElement("jws_waishang");
  6905. AutoPtr<Element> pChildJwsShuXue = pDoc->createElement("jws_shuxue");
  6906. AutoPtr<Element> pChildJwsBaoLuShi = pDoc->createElement("jws_baolushi");
  6907. AutoPtr<Element> pChildJwsBaoLuShiBz = pDoc->createElement("jws_baolushi_bz");
  6908. AutoPtr<Element> pChildJwsYiChuanJiBing = pDoc->createElement("jws_yichuanjibing");
  6909. AutoPtr<Element> pChildGmsGuoMinShi = pDoc->createElement("gms_guominshi");
  6910. AutoPtr<Element> pChildGmsGuoMinShiBz = pDoc->createElement("gms_guominshi_bz");
  6911. AutoPtr<Element> pChildJzsFuQin = pDoc->createElement("jzs_fuqin");
  6912. AutoPtr<Element> pChildJzsFuQinBz = pDoc->createElement("jzs_fuqin_bz");
  6913. AutoPtr<Element> pChildJzsMuQin = pDoc->createElement("jzs_muqin");
  6914. AutoPtr<Element> pChildJzsMuQinBz = pDoc->createElement("jzs_muqin_bz");
  6915. AutoPtr<Element> pChildJzsXdjm = pDoc->createElement("jzs_xdjm");
  6916. AutoPtr<Element> pChildJzsXdjmBz = pDoc->createElement("jzs_xdjm_bz");
  6917. AutoPtr<Element> pChildJzsZiNv = pDoc->createElement("jzs_zinv");
  6918. AutoPtr<Element> pChildJzsZiNvBz = pDoc->createElement("jzs_zinv_bz");
  6919. AutoPtr<Element> pChildJzsQiTa = pDoc->createElement("jzs_qita");
  6920. AutoPtr<Text> pTextUserId = pDoc->createTextNode(stringUserId);
  6921. AutoPtr<Text> pTextWeblock = pDoc->createTextNode(stringWeblock);
  6922. AutoPtr<Text> pTextNation = pDoc->createTextNode(stringNation);
  6923. AutoPtr<Text> pTextProfression = pDoc->createTextNode(stringProfression);
  6924. AutoPtr<Text> pTextCrowd = pDoc->createTextNode(stringCrowd);
  6925. AutoPtr<Text> pTextBloodType = pDoc->createTextNode(stringBloodType);
  6926. AutoPtr<Text> pTextJwsJiBing = pDoc->createTextNode(stringJwsJiBing);
  6927. AutoPtr<Text> pTextJwsShouShu = pDoc->createTextNode(stringJwsShouShu);
  6928. AutoPtr<Text> pTextJwsWaiShang = pDoc->createTextNode(stringJwsWaiShang);
  6929. AutoPtr<Text> pTextJwsShuXue = pDoc->createTextNode(stringJwsShuXue);
  6930. AutoPtr<Text> pTextJwsBaoLuShi = pDoc->createTextNode(stringJwsBaoLuShi);
  6931. AutoPtr<Text> pTextJwsBaoLuShiBz = pDoc->createTextNode(stringJwsBaoLuShiBz);
  6932. AutoPtr<Text> pTextJwsYiChuanJiBing = pDoc->createTextNode(stringJwsYiChuanJiBing);
  6933. AutoPtr<Text> pTextGmsGuoMinShi = pDoc->createTextNode(stringGmsGuoMinShi);
  6934. AutoPtr<Text> pTextGmsGuoMinShiBz = pDoc->createTextNode(stringGmsGuoMinShiBz);
  6935. AutoPtr<Text> pTextJzsFuQin = pDoc->createTextNode(stringJzsFuQin);
  6936. AutoPtr<Text> pTextJzsFuQinBz = pDoc->createTextNode(stringJzsFuQinBz);
  6937. AutoPtr<Text> pTextJzsMuQin = pDoc->createTextNode(stringJzsMuQin);
  6938. AutoPtr<Text> pTextJzsMuQinBz = pDoc->createTextNode(stringJzsMuQinBz);
  6939. AutoPtr<Text> pTextJzsXdjm = pDoc->createTextNode(stringJzsXdjm);
  6940. AutoPtr<Text> pTextJzsXdjmBz = pDoc->createTextNode(stringJzsXdjmBz);
  6941. AutoPtr<Text> pTextJzsZiNv = pDoc->createTextNode(stringJzsZiNv);
  6942. AutoPtr<Text> pTextJzsZiNvBz = pDoc->createTextNode(stringJzsZiNvBz);
  6943. AutoPtr<Text> pTextJzsQiTa = pDoc->createTextNode(stringJzsQiTa);
  6944. pChildUserId->appendChild(pTextUserId);
  6945. pChildWeblock->appendChild(pTextWeblock);
  6946. pChildNation->appendChild(pTextNation);
  6947. pChildProfression->appendChild(pTextProfression);
  6948. pChildCrowd->appendChild(pTextCrowd);
  6949. pChildBloodType->appendChild(pTextBloodType);
  6950. pChildJwsJiBing->appendChild(pTextJwsJiBing);
  6951. pChildJwsShouShu->appendChild(pTextJwsShouShu);
  6952. pChildJwsWaiShang->appendChild(pTextJwsWaiShang);
  6953. pChildJwsShuXue->appendChild(pTextJwsShuXue);
  6954. pChildJwsBaoLuShi->appendChild(pTextJwsBaoLuShi);
  6955. pChildJwsBaoLuShiBz->appendChild(pTextJwsBaoLuShiBz);
  6956. pChildJwsYiChuanJiBing->appendChild(pTextJwsYiChuanJiBing);
  6957. pChildGmsGuoMinShi->appendChild(pTextGmsGuoMinShi);
  6958. pChildGmsGuoMinShiBz->appendChild(pTextGmsGuoMinShiBz);
  6959. pChildJzsFuQin->appendChild(pTextJzsFuQin);
  6960. pChildJzsFuQinBz->appendChild(pTextJzsFuQinBz);
  6961. pChildJzsMuQin->appendChild(pTextJzsMuQin);
  6962. pChildJzsMuQinBz->appendChild(pTextJzsMuQinBz);
  6963. pChildJzsXdjm->appendChild(pTextJzsXdjm);
  6964. pChildJzsXdjmBz->appendChild(pTextJzsXdjmBz);
  6965. pChildJzsZiNv->appendChild(pTextJzsZiNv);
  6966. pChildJzsZiNvBz->appendChild(pTextJzsZiNvBz);
  6967. pChildJzsQiTa->appendChild(pTextJzsQiTa);
  6968. pRoot->appendChild(pChildUserId);
  6969. pRoot->appendChild(pChildWeblock);
  6970. pRoot->appendChild(pChildNation);
  6971. pRoot->appendChild(pChildProfression);
  6972. pRoot->appendChild(pChildCrowd);
  6973. pRoot->appendChild(pChildBloodType);
  6974. pRoot->appendChild(pChildJwsJiBing);
  6975. pRoot->appendChild(pChildJwsShouShu);
  6976. pRoot->appendChild(pChildJwsWaiShang);
  6977. pRoot->appendChild(pChildJwsShuXue);
  6978. pRoot->appendChild(pChildJwsBaoLuShi);
  6979. pRoot->appendChild(pChildJwsBaoLuShiBz);
  6980. pRoot->appendChild(pChildJwsYiChuanJiBing);
  6981. pRoot->appendChild(pChildGmsGuoMinShi);
  6982. pRoot->appendChild(pChildGmsGuoMinShiBz);
  6983. pRoot->appendChild(pChildJzsFuQin);
  6984. pRoot->appendChild(pChildJzsFuQinBz);
  6985. pRoot->appendChild(pChildJzsMuQin);
  6986. pRoot->appendChild(pChildJzsMuQinBz);
  6987. pRoot->appendChild(pChildJzsXdjm);
  6988. pRoot->appendChild(pChildJzsXdjmBz);
  6989. pRoot->appendChild(pChildJzsZiNv);
  6990. pRoot->appendChild(pChildJzsZiNvBz);
  6991. pRoot->appendChild(pChildJzsQiTa);
  6992. //pDoc->appendChild(pi);
  6993. pDoc->appendChild(pRoot);
  6994. string stringXmlContent;
  6995. int nRet = PHMS_SUCCESSFUL_RESULT;
  6996. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  6997. if(nRet != PHMS_SUCCESSFUL_RESULT)
  6998. {
  6999. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7000. return nRet;
  7001. }
  7002. CPhmsRequestHead phmsRequestHead("10", "1076", m_stringSessionId, "11");
  7003. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  7004. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  7005. phmsRequest.GenerateAndSetSign();
  7006. CPhmsResponse phmsResponse;
  7007. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  7008. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7009. {
  7010. //写日志
  7011. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7012. return nRet;
  7013. }
  7014. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  7015. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7016. {
  7017. //写日志
  7018. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7019. return nRet;
  7020. }
  7021. return PHMS_SUCCESSFUL_RESULT;
  7022. }
  7023. int CPhmsSession::LoggingHealthCurrentInfo(string stringUserId, string stringShfsYinShi, string stringShfsXlzk, string stringShfsXlzkBz, string stringShfsXltz, string stringShfsXiYan,
  7024. string stringShfsYinJiu, string stringShfsSyqk, string stringShfsYunDong, string stringShfsYunDongShiJian, string stringSysjcDanGuChun, string stringSysjcXueChangGui,
  7025. string stringSysjcXueChangGuiBz, string stringSysjcNiaoChangGui, string stringSysjcNiaoChangGuiBz, string stringSysjcQiTa, string stringYongYao, string stringZhuYuan,
  7026. string stringJkwtNaoXueGuan, string stringJkwtNaoXueGuanBz, string stringJkwtShenZang, string stringJkwtShenZangBz, string stringJkwtXinZang, string stringJkwtXinZangBz,
  7027. string stringJkwtXueGuan, string stringJkwtXueGuanBz, string stringJkwtYanBu, string stringJkwtYanBuBz, string stringJkwtShenJing, string stringJkwtQiTa, string stringDate)
  7028. {
  7029. AutoPtr<Document> pDoc = new Document;
  7030. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7031. AutoPtr<Element> pRoot = pDoc->createElement("request");
  7032. AutoPtr<Element> pChildUserId = pDoc->createElement("userid");
  7033. AutoPtr<Element> pChildShfsYinShi = pDoc->createElement("shfs_yinshi");
  7034. AutoPtr<Element> pChildShfsXlzk = pDoc->createElement("shfs_xinlizhuangkuang");
  7035. AutoPtr<Element> pChildShfsXlzkBz = pDoc->createElement("shfs_xlzk_bz");
  7036. AutoPtr<Element> pChildShfsXltz = pDoc->createElement("shfs_xltz");
  7037. AutoPtr<Element> pChildShfsXiYan = pDoc->createElement("shfs_xiyan");
  7038. AutoPtr<Element> pChildShfsYinJiu = pDoc->createElement("shfs_yinjiu");
  7039. AutoPtr<Element> pChildShfsSyqk = pDoc->createElement("shfs_syqk");
  7040. AutoPtr<Element> pChildShfsYunDong = pDoc->createElement("shfs_yundong");
  7041. AutoPtr<Element> pChildShfsYunDongShiJian = pDoc->createElement("shfs_yundongshijian");
  7042. AutoPtr<Element> pChildSysjcDanGuChun = pDoc->createElement("sysjc_danguchun");
  7043. AutoPtr<Element> pChildSysjcXueChangGui = pDoc->createElement("sysjc_xuechanggui");
  7044. AutoPtr<Element> pChildSysjcXueChangGuiBz = pDoc->createElement("sysjc_xuechanggui_bz");
  7045. AutoPtr<Element> pChildSysjcNiaoChangGui = pDoc->createElement("sysjc_niaochanggui");
  7046. AutoPtr<Element> pChildSysjcNiaoChangGuiBz = pDoc->createElement("sysjc_niaochanggui_bz");
  7047. AutoPtr<Element> pChildSysjcQiTa = pDoc->createElement("sysjc_qita");
  7048. AutoPtr<Element> pChildYongYao = pDoc->createElement("yongyao");
  7049. AutoPtr<Element> pChildZhuYuan = pDoc->createElement("zhuyuan");
  7050. AutoPtr<Element> pChildJkwtNaoXueGuan = pDoc->createElement("jkwt_naoxueguan");
  7051. AutoPtr<Element> pChildJkwtNaoXueGuanBz = pDoc->createElement("jkwt_naoxueguan_bz");
  7052. AutoPtr<Element> pChildJkwtShenZang = pDoc->createElement("jkwt_shenzang");
  7053. AutoPtr<Element> pChildJkwtShenZangBz = pDoc->createElement("jkwt_shenzang_bz");
  7054. AutoPtr<Element> pChildJkwtXinZang = pDoc->createElement("jkwt_xinzang");
  7055. AutoPtr<Element> pChildJkwtXinZangBz = pDoc->createElement("jkwt_xinzang_bz");
  7056. AutoPtr<Element> pChildJkwtXueGuan = pDoc->createElement("jkwt_xueguan");
  7057. AutoPtr<Element> pChildJkwtXueGuanBz = pDoc->createElement("jkwt_xueguan_bz");
  7058. AutoPtr<Element> pChildJkwtYanBu = pDoc->createElement("jkwt_yanbu");
  7059. AutoPtr<Element> pChildJkwtYanBuBz = pDoc->createElement("jkwt_yanbu_bz");
  7060. AutoPtr<Element> pChildJkwtShenJing = pDoc->createElement("jkwt_shenjing");
  7061. AutoPtr<Element> pChildJkwtQiTa = pDoc->createElement("jkwt_qita");
  7062. AutoPtr<Element> pChildDate = pDoc->createElement("date");
  7063. AutoPtr<Text> pTextUserId = pDoc->createTextNode(stringUserId);
  7064. AutoPtr<Text> pTextShfsYinShi = pDoc->createTextNode(stringShfsYinShi);
  7065. AutoPtr<Text> pTextShfsXlzk = pDoc->createTextNode(stringShfsXlzk);
  7066. AutoPtr<Text> pTextShfsXlzkBz = pDoc->createTextNode(stringShfsXlzkBz);
  7067. AutoPtr<Text> pTextShfsXltz = pDoc->createTextNode(stringShfsXltz);
  7068. AutoPtr<Text> pTextShfsXiYan = pDoc->createTextNode(stringShfsXiYan);
  7069. AutoPtr<Text> pTextShfsYinJiu = pDoc->createTextNode(stringShfsYinJiu);
  7070. AutoPtr<Text> pTextShfsSyqk = pDoc->createTextNode(stringShfsSyqk);
  7071. AutoPtr<Text> pTextShfsYunDong = pDoc->createTextNode(stringShfsYunDong);
  7072. AutoPtr<Text> pTextShfsYunDongShiJian = pDoc->createTextNode(stringShfsYunDongShiJian);
  7073. AutoPtr<Text> pTextSysjcDanGuChun = pDoc->createTextNode(stringSysjcDanGuChun);
  7074. AutoPtr<Text> pTextSysjcXueChangGui = pDoc->createTextNode(stringSysjcXueChangGui);
  7075. AutoPtr<Text> pTextSysjcXueChangGuiBz = pDoc->createTextNode(stringSysjcXueChangGuiBz);
  7076. AutoPtr<Text> pTextSysjcNiaoChangGui = pDoc->createTextNode(stringSysjcNiaoChangGui);
  7077. AutoPtr<Text> pTextSysjcNiaoChangGuiBz = pDoc->createTextNode(stringSysjcNiaoChangGuiBz);
  7078. AutoPtr<Text> pTextSysjcQiTa = pDoc->createTextNode(stringSysjcQiTa);
  7079. AutoPtr<Text> pTextYongYao = pDoc->createTextNode(stringYongYao);
  7080. AutoPtr<Text> pTextZhuYuan = pDoc->createTextNode(stringZhuYuan);
  7081. AutoPtr<Text> pTextJkwtNaoXueGuan = pDoc->createTextNode(stringJkwtNaoXueGuan);
  7082. AutoPtr<Text> pTextJkwtNaoXueGuanBz = pDoc->createTextNode(stringJkwtNaoXueGuanBz);
  7083. AutoPtr<Text> pTextJkwtShenZang = pDoc->createTextNode(stringJkwtShenZang);
  7084. AutoPtr<Text> pTextJkwtShenZangBz = pDoc->createTextNode(stringJkwtShenZangBz);
  7085. AutoPtr<Text> pTextJkwtXinZang = pDoc->createTextNode(stringJkwtXinZang);
  7086. AutoPtr<Text> pTextJkwtXinZangBz = pDoc->createTextNode(stringJkwtXinZangBz);
  7087. AutoPtr<Text> pTextJkwtXueGuan = pDoc->createTextNode(stringJkwtXueGuan);
  7088. AutoPtr<Text> pTextJkwtXueGuanBz = pDoc->createTextNode(stringJkwtXueGuanBz);
  7089. AutoPtr<Text> pTextJkwtYanBu = pDoc->createTextNode(stringJkwtYanBu);
  7090. AutoPtr<Text> pTextJkwtYanBuBz = pDoc->createTextNode(stringJkwtYanBuBz);
  7091. AutoPtr<Text> pTextJkwtShenJing = pDoc->createTextNode(stringJkwtShenJing);
  7092. AutoPtr<Text> pTextJkwtQiTa = pDoc->createTextNode(stringJkwtQiTa);
  7093. AutoPtr<Text> pTextDate = pDoc->createTextNode(stringDate);
  7094. pChildUserId->appendChild(pTextUserId);
  7095. pChildShfsYinShi->appendChild(pTextShfsYinShi);
  7096. pChildShfsXlzk->appendChild(pTextShfsXlzk);
  7097. pChildShfsXlzkBz->appendChild(pTextShfsXlzkBz);
  7098. pChildShfsXltz->appendChild(pTextShfsXltz);
  7099. pChildShfsXiYan->appendChild(pTextShfsXiYan);
  7100. pChildShfsYinJiu->appendChild(pTextShfsYinJiu);
  7101. pChildShfsSyqk->appendChild(pTextShfsSyqk);
  7102. pChildShfsYunDong->appendChild(pTextShfsYunDong);
  7103. pChildShfsYunDongShiJian->appendChild(pTextShfsYunDongShiJian);
  7104. pChildSysjcDanGuChun->appendChild(pTextSysjcDanGuChun);
  7105. pChildSysjcXueChangGui->appendChild(pTextSysjcXueChangGui);
  7106. pChildSysjcXueChangGuiBz->appendChild(pTextSysjcXueChangGuiBz);
  7107. pChildSysjcNiaoChangGui->appendChild(pTextSysjcNiaoChangGui);
  7108. pChildSysjcNiaoChangGuiBz->appendChild(pTextSysjcNiaoChangGuiBz);
  7109. pChildSysjcQiTa->appendChild(pTextSysjcQiTa);
  7110. pChildYongYao->appendChild(pTextYongYao);
  7111. pChildZhuYuan->appendChild(pTextZhuYuan);
  7112. pChildJkwtNaoXueGuan->appendChild(pTextJkwtNaoXueGuan);
  7113. pChildJkwtNaoXueGuanBz->appendChild(pTextJkwtNaoXueGuanBz);
  7114. pChildJkwtShenZang->appendChild(pTextJkwtShenZang);
  7115. pChildJkwtShenZangBz->appendChild(pTextJkwtShenZangBz);
  7116. pChildJkwtXinZang->appendChild(pTextJkwtXinZang);
  7117. pChildJkwtXinZangBz->appendChild(pTextJkwtXinZangBz);
  7118. pChildJkwtXueGuan->appendChild(pTextJkwtXueGuan);
  7119. pChildJkwtXueGuanBz->appendChild(pTextJkwtXueGuanBz);
  7120. pChildJkwtYanBu->appendChild(pTextJkwtYanBu);
  7121. pChildJkwtYanBuBz->appendChild(pTextJkwtYanBuBz);
  7122. pChildJkwtShenJing->appendChild(pTextJkwtShenJing);
  7123. pChildJkwtQiTa->appendChild(pTextJkwtQiTa);
  7124. pChildDate->appendChild(pTextDate);
  7125. pRoot->appendChild(pChildUserId);
  7126. pRoot->appendChild(pChildShfsYinShi);
  7127. pRoot->appendChild(pChildShfsXlzk);
  7128. pRoot->appendChild(pChildShfsXlzkBz);
  7129. pRoot->appendChild(pChildShfsXltz);
  7130. pRoot->appendChild(pChildShfsXiYan);
  7131. pRoot->appendChild(pChildShfsYinJiu);
  7132. pRoot->appendChild(pChildShfsSyqk);
  7133. pRoot->appendChild(pChildShfsYunDong);
  7134. pRoot->appendChild(pChildShfsYunDongShiJian);
  7135. pRoot->appendChild(pChildSysjcDanGuChun);
  7136. pRoot->appendChild(pChildSysjcXueChangGui);
  7137. pRoot->appendChild(pChildSysjcXueChangGuiBz);
  7138. pRoot->appendChild(pChildSysjcNiaoChangGui);
  7139. pRoot->appendChild(pChildSysjcNiaoChangGuiBz);
  7140. pRoot->appendChild(pChildSysjcQiTa);
  7141. pRoot->appendChild(pChildYongYao);
  7142. pRoot->appendChild(pChildZhuYuan);
  7143. pRoot->appendChild(pChildJkwtNaoXueGuan);
  7144. pRoot->appendChild(pChildJkwtNaoXueGuanBz);
  7145. pRoot->appendChild(pChildJkwtShenZang);
  7146. pRoot->appendChild(pChildJkwtShenZangBz);
  7147. pRoot->appendChild(pChildJkwtXinZang);
  7148. pRoot->appendChild(pChildJkwtXinZangBz);
  7149. pRoot->appendChild(pChildJkwtXueGuan);
  7150. pRoot->appendChild(pChildJkwtXueGuanBz);
  7151. pRoot->appendChild(pChildJkwtYanBu);
  7152. pRoot->appendChild(pChildJkwtYanBuBz);
  7153. pRoot->appendChild(pChildJkwtShenJing);
  7154. pRoot->appendChild(pChildJkwtQiTa);
  7155. pRoot->appendChild(pChildDate);
  7156. //pDoc->appendChild(pi);
  7157. pDoc->appendChild(pRoot);
  7158. string stringXmlContent;
  7159. int nRet = PHMS_SUCCESSFUL_RESULT;
  7160. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  7161. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7162. {
  7163. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7164. return nRet;
  7165. }
  7166. CPhmsRequestHead phmsRequestHead("10", "1077", m_stringSessionId, "11");
  7167. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  7168. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  7169. phmsRequest.GenerateAndSetSign();
  7170. CPhmsResponse phmsResponse;
  7171. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  7172. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7173. {
  7174. //写日志
  7175. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7176. return nRet;
  7177. }
  7178. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  7179. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7180. {
  7181. //写日志
  7182. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7183. return nRet;
  7184. }
  7185. return PHMS_SUCCESSFUL_RESULT;
  7186. }
  7187. int CPhmsSession::GetCliniqueListOfHospital(string stringHospitalId)
  7188. {
  7189. AutoPtr<Document> pDoc = new Document;
  7190. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7191. AutoPtr<Element> pRoot = pDoc->createElement("request");
  7192. AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
  7193. AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
  7194. pChildHospitalId->appendChild(pTextHospitalId);
  7195. pRoot->appendChild(pChildHospitalId);
  7196. //pDoc->appendChild(pi);
  7197. pDoc->appendChild(pRoot);
  7198. string stringXmlContent;
  7199. int nRet = PHMS_SUCCESSFUL_RESULT;
  7200. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  7201. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7202. {
  7203. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7204. return nRet;
  7205. }
  7206. CPhmsRequestHead phmsRequestHead("10", "1078", m_stringSessionId, "11");
  7207. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  7208. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  7209. phmsRequest.GenerateAndSetSign();
  7210. CPhmsResponse phmsResponse;
  7211. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  7212. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7213. {
  7214. //写日志
  7215. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7216. return nRet;
  7217. }
  7218. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  7219. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7220. {
  7221. //写日志
  7222. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7223. return nRet;
  7224. }
  7225. return PHMS_SUCCESSFUL_RESULT;
  7226. }
  7227. int CPhmsSession::GetStatisticsInfo(string stringTypeId, string stringMonth, string stringMonthDay, string stringPageTo, string stringPageSize)
  7228. {
  7229. AutoPtr<Document> pDoc = new Document;
  7230. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7231. AutoPtr<Element> pRoot = pDoc->createElement("request");
  7232. AutoPtr<Element> pChildTypeId = pDoc->createElement("typeid");
  7233. AutoPtr<Element> pChildMonth = pDoc->createElement("statisticsdate");
  7234. AutoPtr<Element> pChildMonthDay = pDoc->createElement("statisticsstartdate");
  7235. AutoPtr<Element> pChildPageTo = pDoc->createElement("pageto");
  7236. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  7237. AutoPtr<Text> pTextTypeId = pDoc->createTextNode(stringTypeId);
  7238. AutoPtr<Text> pTextMonth = pDoc->createTextNode(stringMonth);
  7239. AutoPtr<Text> pTextMonthDay = pDoc->createTextNode(stringMonthDay);
  7240. AutoPtr<Text> pTextPageTo = pDoc->createTextNode(stringPageTo);
  7241. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  7242. pChildTypeId->appendChild(pTextTypeId);
  7243. pChildMonth->appendChild(pTextMonth);
  7244. pChildMonthDay->appendChild(pTextMonthDay);
  7245. pChildPageTo->appendChild(pTextPageTo);
  7246. pChildPageSize->appendChild(pTextPageSize);
  7247. pRoot->appendChild(pChildTypeId);
  7248. pRoot->appendChild(pChildMonth);
  7249. pRoot->appendChild(pChildMonthDay);
  7250. pRoot->appendChild(pChildPageTo);
  7251. pRoot->appendChild(pChildPageSize);
  7252. //pDoc->appendChild(pi);
  7253. pDoc->appendChild(pRoot);
  7254. string stringXmlContent;
  7255. int nRet = PHMS_SUCCESSFUL_RESULT;
  7256. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  7257. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7258. {
  7259. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7260. return nRet;
  7261. }
  7262. CPhmsRequestHead phmsRequestHead("10", "1079", m_stringSessionId, "11");
  7263. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  7264. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  7265. phmsRequest.GenerateAndSetSign();
  7266. CPhmsResponse phmsResponse;
  7267. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  7268. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7269. {
  7270. //写日志
  7271. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7272. return nRet;
  7273. }
  7274. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  7275. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7276. {
  7277. //写日志
  7278. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7279. return nRet;
  7280. }
  7281. return PHMS_SUCCESSFUL_RESULT;
  7282. }
  7283. int CPhmsSession::UpdateCaseInfo(string stringHospitalId, string stringCaseId, string stringOtherParam, string stringFlag, string stringNotes, string stringReceiverId)
  7284. {
  7285. AutoPtr<Document> pDoc = new Document;
  7286. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7287. AutoPtr<Element> pRoot = pDoc->createElement("request");
  7288. AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
  7289. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  7290. AutoPtr<Element> pChildNotes = pDoc->createElement("notes");
  7291. AutoPtr<Element> pChildOtherParam = pDoc->createElement("otherparam");
  7292. AutoPtr<Element> pChildFlag = pDoc->createElement("flag");
  7293. AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
  7294. AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
  7295. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  7296. AutoPtr<Text> pTextNotes = pDoc->createTextNode(stringNotes);
  7297. AutoPtr<Text> pTextOtherParam = pDoc->createTextNode(stringOtherParam);
  7298. AutoPtr<Text> pTextFlag = pDoc->createTextNode(stringFlag);
  7299. AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
  7300. pChildHospitalId->appendChild(pTextHospitalId);
  7301. pChildCaseId->appendChild(pTextCaseId);
  7302. pChildNotes->appendChild(pTextNotes);
  7303. pChildOtherParam->appendChild(pTextOtherParam);
  7304. pChildFlag->appendChild(pTextFlag);
  7305. pChildReceiverId->appendChild(pTextReceiverId);
  7306. pRoot->appendChild(pChildHospitalId);
  7307. pRoot->appendChild(pChildCaseId);
  7308. pRoot->appendChild(pChildNotes);
  7309. pRoot->appendChild(pChildOtherParam);
  7310. pRoot->appendChild(pChildFlag);
  7311. pRoot->appendChild(pChildReceiverId);
  7312. //pDoc->appendChild(pi);
  7313. pDoc->appendChild(pRoot);
  7314. string stringXmlContent;
  7315. int nRet = PHMS_SUCCESSFUL_RESULT;
  7316. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  7317. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7318. {
  7319. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7320. return nRet;
  7321. }
  7322. CPhmsRequestHead phmsRequestHead("10", "1080", m_stringSessionId, "11");
  7323. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  7324. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  7325. phmsRequest.GenerateAndSetSign();
  7326. CPhmsResponse phmsResponse;
  7327. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  7328. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7329. {
  7330. //写日志
  7331. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7332. return nRet;
  7333. }
  7334. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  7335. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7336. {
  7337. //写日志
  7338. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7339. return nRet;
  7340. }
  7341. return PHMS_SUCCESSFUL_RESULT;
  7342. }
  7343. int CPhmsSession::GetUserHealthList(string stringNextId, string stringTypeId, string stringSecondTypeId, string stringName, string stringSex, string strinThirdIdType,
  7344. string stringThirdId, string stringHospitalId,
  7345. string stringUnitSenderId, string stringIsData, string stringIntervalTime, string stringPopulations, string stringContractDoctor, string stringIsContract, string stringPageSize)
  7346. {
  7347. AutoPtr<Document> pDoc = new Document;
  7348. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7349. AutoPtr<Element> pRoot = pDoc->createElement("request");
  7350. AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
  7351. AutoPtr<Element> pChildTypeId = pDoc->createElement("typeid");
  7352. AutoPtr<Element> pChildSecondTypeId = pDoc->createElement("secondtypeid");
  7353. AutoPtr<Element> pChildName = pDoc->createElement("name");
  7354. AutoPtr<Element> pChildSex = pDoc->createElement("sex");
  7355. AutoPtr<Element> pChildThirdIdType = pDoc->createElement("thirdidtype");
  7356. AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
  7357. AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
  7358. AutoPtr<Element> pChildUnitSenderId = pDoc->createElement("unitsenderid");
  7359. AutoPtr<Element> pChildIsData = pDoc->createElement("isdata");
  7360. AutoPtr<Element> pChildIntervalTime = pDoc->createElement("intervaltime");
  7361. AutoPtr<Element> pChildPopulations = pDoc->createElement("populations");
  7362. AutoPtr<Element> pChildContractDoctor = pDoc->createElement("contractdoctor");
  7363. AutoPtr<Element> pChildIsContract = pDoc->createElement("iscontract");
  7364. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  7365. AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
  7366. AutoPtr<Text> pTextTypeId = pDoc->createTextNode(stringTypeId);
  7367. AutoPtr<Text> pTextSecondTypeId = pDoc->createTextNode(stringSecondTypeId);
  7368. AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
  7369. AutoPtr<Text> pTextSex = pDoc->createTextNode(stringSex);
  7370. AutoPtr<Text> pTextThirdIdType = pDoc->createTextNode(strinThirdIdType);
  7371. AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
  7372. AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
  7373. AutoPtr<Text> pTextUnitSenderId = pDoc->createTextNode(stringUnitSenderId);
  7374. AutoPtr<Text> pTextIsData = pDoc->createTextNode(stringIsData);
  7375. AutoPtr<Text> pTextIntervalTime = pDoc->createTextNode(stringIntervalTime);
  7376. AutoPtr<Text> pTextPopulations = pDoc->createTextNode(stringPopulations);
  7377. AutoPtr<Text> pTextContractDoctor = pDoc->createTextNode(stringContractDoctor);
  7378. AutoPtr<Text> pTextIsContract = pDoc->createTextNode(stringIsContract);
  7379. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  7380. pChildNextId->appendChild(pTextNextId);
  7381. pChildTypeId->appendChild(pTextTypeId);
  7382. pChildSecondTypeId->appendChild(pTextSecondTypeId);
  7383. pChildName->appendChild(pTextName);
  7384. pChildSex->appendChild(pTextSex);
  7385. pChildThirdIdType->appendChild(pTextThirdIdType);
  7386. pChildThirdId->appendChild(pTextThirdId);
  7387. pChildHospitalId->appendChild(pTextHospitalId);
  7388. pChildUnitSenderId->appendChild(pTextUnitSenderId);
  7389. pChildIsData->appendChild(pTextIsData);
  7390. pChildIntervalTime->appendChild(pTextIntervalTime);
  7391. pChildPopulations->appendChild(pTextPopulations);
  7392. pChildContractDoctor->appendChild(pTextContractDoctor);
  7393. pChildIsContract->appendChild(pTextIsContract);
  7394. pChildPageSize->appendChild(pTextPageSize);
  7395. pRoot->appendChild(pChildNextId);
  7396. pRoot->appendChild(pChildTypeId);
  7397. pRoot->appendChild(pChildSecondTypeId);
  7398. pRoot->appendChild(pChildName);
  7399. pRoot->appendChild(pChildSex);
  7400. pRoot->appendChild(pChildThirdIdType);
  7401. pRoot->appendChild(pChildThirdId);
  7402. pRoot->appendChild(pChildHospitalId);
  7403. pRoot->appendChild(pChildUnitSenderId);
  7404. pRoot->appendChild(pChildIsData);
  7405. pRoot->appendChild(pChildIntervalTime);
  7406. pRoot->appendChild(pChildPopulations);
  7407. pRoot->appendChild(pChildContractDoctor);
  7408. pRoot->appendChild(pChildIsContract);
  7409. pRoot->appendChild(pChildPageSize);
  7410. //pDoc->appendChild(pi);
  7411. pDoc->appendChild(pRoot);
  7412. string stringXmlContent;
  7413. int nRet = PHMS_SUCCESSFUL_RESULT;
  7414. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  7415. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7416. {
  7417. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7418. return nRet;
  7419. }
  7420. CPhmsRequestHead phmsRequestHead("10", "1081", m_stringSessionId, "11");
  7421. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  7422. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  7423. phmsRequest.GenerateAndSetSign();
  7424. CPhmsResponse phmsResponse;
  7425. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  7426. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7427. {
  7428. //写日志
  7429. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7430. return nRet;
  7431. }
  7432. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  7433. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7434. {
  7435. //写日志
  7436. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7437. return nRet;
  7438. }
  7439. return PHMS_SUCCESSFUL_RESULT;
  7440. }
  7441. int CPhmsSession::GetAdviceImplemention(string stringThirdId, string stringHospitalId)
  7442. {
  7443. AutoPtr<Document> pDoc = new Document;
  7444. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7445. AutoPtr<Element> pRoot = pDoc->createElement("request");
  7446. AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
  7447. AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
  7448. AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
  7449. AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
  7450. pChildThirdId->appendChild(pTextThirdId);
  7451. pChildHospitalId->appendChild(pTextHospitalId);
  7452. pRoot->appendChild(pChildThirdId);
  7453. pRoot->appendChild(pChildHospitalId);
  7454. //pDoc->appendChild(pi);
  7455. pDoc->appendChild(pRoot);
  7456. string stringXmlContent;
  7457. int nRet = PHMS_SUCCESSFUL_RESULT;
  7458. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  7459. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7460. {
  7461. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7462. return nRet;
  7463. }
  7464. CPhmsRequestHead phmsRequestHead("10", "1082", m_stringSessionId, "11");
  7465. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  7466. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  7467. phmsRequest.GenerateAndSetSign();
  7468. CPhmsResponse phmsResponse;
  7469. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  7470. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7471. {
  7472. //写日志
  7473. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7474. return nRet;
  7475. }
  7476. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  7477. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7478. {
  7479. //写日志
  7480. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7481. return nRet;
  7482. }
  7483. return PHMS_SUCCESSFUL_RESULT;
  7484. }
  7485. int CPhmsSession::ChangePersonType(string stringThirdId, string stringPeopleType, string stringHospitalId)
  7486. {
  7487. AutoPtr<Document> pDoc = new Document;
  7488. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7489. AutoPtr<Element> pRoot = pDoc->createElement("request");
  7490. AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
  7491. AutoPtr<Element> pChildPeopleType = pDoc->createElement("peopletype");
  7492. AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
  7493. AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
  7494. AutoPtr<Text> pTextPeopleType = pDoc->createTextNode(stringPeopleType);
  7495. AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
  7496. pChildThirdId->appendChild(pTextThirdId);
  7497. pChildPeopleType->appendChild(pTextPeopleType);
  7498. pChildHospitalId->appendChild(pTextHospitalId);
  7499. pRoot->appendChild(pChildThirdId);
  7500. pRoot->appendChild(pChildPeopleType);
  7501. pRoot->appendChild(pChildHospitalId);
  7502. //pDoc->appendChild(pi);
  7503. pDoc->appendChild(pRoot);
  7504. string stringXmlContent;
  7505. int nRet = PHMS_SUCCESSFUL_RESULT;
  7506. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  7507. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7508. {
  7509. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7510. return nRet;
  7511. }
  7512. CPhmsRequestHead phmsRequestHead("10", "1083", m_stringSessionId, "11");
  7513. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  7514. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  7515. phmsRequest.GenerateAndSetSign();
  7516. CPhmsResponse phmsResponse;
  7517. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  7518. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7519. {
  7520. //写日志
  7521. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7522. return nRet;
  7523. }
  7524. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  7525. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7526. {
  7527. //写日志
  7528. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7529. return nRet;
  7530. }
  7531. return PHMS_SUCCESSFUL_RESULT;
  7532. }
  7533. int CPhmsSession::SetNextVisitTime(string stringThirdId, string stringInterViewTime, string stringHospitalId)
  7534. {
  7535. AutoPtr<Document> pDoc = new Document;
  7536. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7537. AutoPtr<Element> pRoot = pDoc->createElement("request");
  7538. AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
  7539. AutoPtr<Element> pChildInterViewDate = pDoc->createElement("interviewdate");
  7540. AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
  7541. AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
  7542. AutoPtr<Text> pTextInterViewDate = pDoc->createTextNode(stringInterViewTime);
  7543. AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
  7544. pChildThirdId->appendChild(pTextThirdId);
  7545. pChildInterViewDate->appendChild(pTextInterViewDate);
  7546. pChildHospitalId->appendChild(pTextHospitalId);
  7547. pRoot->appendChild(pChildThirdId);
  7548. pRoot->appendChild(pChildInterViewDate);
  7549. pRoot->appendChild(pChildHospitalId);
  7550. //pDoc->appendChild(pi);
  7551. pDoc->appendChild(pRoot);
  7552. string stringXmlContent;
  7553. int nRet = PHMS_SUCCESSFUL_RESULT;
  7554. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  7555. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7556. {
  7557. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7558. return nRet;
  7559. }
  7560. CPhmsRequestHead phmsRequestHead("10", "1084", m_stringSessionId, "11");
  7561. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  7562. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  7563. phmsRequest.GenerateAndSetSign();
  7564. CPhmsResponse phmsResponse;
  7565. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  7566. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7567. {
  7568. //写日志
  7569. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7570. return nRet;
  7571. }
  7572. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  7573. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7574. {
  7575. //写日志
  7576. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7577. return nRet;
  7578. }
  7579. return PHMS_SUCCESSFUL_RESULT;
  7580. }
  7581. int CPhmsSession::GetPersonTypeList(string stringLanguage)
  7582. {
  7583. AutoPtr<Document> pDoc = new Document;
  7584. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7585. AutoPtr<Element> pRoot = pDoc->createElement("request");
  7586. AutoPtr<Element> pChildLang = pDoc->createElement("lang");
  7587. AutoPtr<Text> pTextLang = pDoc->createTextNode(stringLanguage);
  7588. pChildLang->appendChild(pTextLang);
  7589. pRoot->appendChild(pChildLang);
  7590. //pDoc->appendChild(pi);
  7591. pDoc->appendChild(pRoot);
  7592. string stringXmlContent;
  7593. int nRet = PHMS_SUCCESSFUL_RESULT;
  7594. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  7595. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7596. {
  7597. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7598. return nRet;
  7599. }
  7600. CPhmsRequestHead phmsRequestHead("10", "1085", m_stringSessionId, "11");
  7601. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  7602. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  7603. phmsRequest.GenerateAndSetSign();
  7604. CPhmsResponse phmsResponse;
  7605. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  7606. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7607. {
  7608. //写日志
  7609. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7610. return nRet;
  7611. }
  7612. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  7613. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7614. {
  7615. //写日志
  7616. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7617. return nRet;
  7618. }
  7619. return PHMS_SUCCESSFUL_RESULT;
  7620. }
  7621. int CPhmsSession::PersonIdRegisterAndLogin(string stringRole, string stringPId, string stringName, string stringSex, string stringBirthday, string stringAddress, string stringDeviceId, string stringMd5,
  7622. string stringLang, string stringRegFrom)
  7623. {
  7624. AutoPtr<Document> pDoc = new Document;
  7625. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7626. AutoPtr<Element> pRoot = pDoc->createElement("request");
  7627. AutoPtr<Element> pChildDeviceId = pDoc->createElement("deviceid");
  7628. AutoPtr<Element> pChildRegFrom = pDoc->createElement("regfrom");
  7629. AutoPtr<Element> pChildPId = pDoc->createElement("pid");
  7630. AutoPtr<Element> pChildName = pDoc->createElement("name");
  7631. AutoPtr<Element> pChildSex = pDoc->createElement("sex");
  7632. AutoPtr<Element> pChildBirthday = pDoc->createElement("birthday");
  7633. AutoPtr<Element> pChildAddress = pDoc->createElement("address");
  7634. AutoPtr<Element> pChildLang = pDoc->createElement("lang");
  7635. AutoPtr<Element> pChildRole = pDoc->createElement("role");
  7636. AutoPtr<Element> pChildMd5 = pDoc->createElement("md5");
  7637. AutoPtr<Text> pTextDeviceId = pDoc->createTextNode(stringDeviceId);
  7638. AutoPtr<Text> pTextRegFrom = pDoc->createTextNode(stringRegFrom);
  7639. AutoPtr<Text> pTextPId = pDoc->createTextNode(stringPId);
  7640. AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
  7641. AutoPtr<Text> pTextSex = pDoc->createTextNode(stringSex);
  7642. AutoPtr<Text> pTextBirthday = pDoc->createTextNode(stringBirthday);
  7643. AutoPtr<Text> pTextAddress = pDoc->createTextNode(stringAddress);
  7644. AutoPtr<Text> pTextLang = pDoc->createTextNode(stringLang);
  7645. AutoPtr<Text> pTextRole = pDoc->createTextNode(stringRole);
  7646. AutoPtr<Text> pTextMd5 = pDoc->createTextNode(stringMd5);
  7647. pChildDeviceId->appendChild(pTextDeviceId);
  7648. pChildRegFrom->appendChild(pTextRegFrom);
  7649. pChildPId->appendChild(pTextPId);
  7650. pChildName->appendChild(pTextName);
  7651. pChildSex->appendChild(pTextSex);
  7652. pChildBirthday->appendChild(pTextBirthday);
  7653. pChildAddress->appendChild(pTextAddress);
  7654. pChildLang->appendChild(pTextLang);
  7655. pChildRole->appendChild(pTextRole);
  7656. pChildMd5->appendChild(pTextMd5);
  7657. pRoot->appendChild(pChildDeviceId);
  7658. pRoot->appendChild(pChildRegFrom);
  7659. pRoot->appendChild(pChildPId);
  7660. pRoot->appendChild(pChildName);
  7661. pRoot->appendChild(pChildSex);
  7662. pRoot->appendChild(pChildBirthday);
  7663. pRoot->appendChild(pChildAddress);
  7664. pRoot->appendChild(pChildLang);
  7665. pRoot->appendChild(pChildRole);
  7666. pRoot->appendChild(pChildMd5);
  7667. //pDoc->appendChild(pi);
  7668. pDoc->appendChild(pRoot);
  7669. string stringXmlContent;
  7670. int nRet = PHMS_SUCCESSFUL_RESULT;
  7671. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  7672. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7673. {
  7674. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7675. return nRet;
  7676. }
  7677. string stringSessionId(32, '0');
  7678. CPhmsRequestHead phmsRequestHead("10", "1086", stringSessionId, "11");
  7679. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  7680. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  7681. // phmsRequest.GenerateAndSetSign();
  7682. CPhmsResponse phmsResponse;
  7683. m_enumPhmsCommandType = LOGIN_TYPE;//目前只有登录命令是LOGIN_TYPE,改变个人信息命令是CHANGE_INFO_TYPE,用户注册命令是REGISTER_TYPE
  7684. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  7685. m_enumPhmsCommandType = MAIN_TYPE;//其余命令都是MAIN_TYPE
  7686. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7687. {
  7688. //写日志
  7689. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7690. return nRet;
  7691. }
  7692. CPhmsRequest::SetUsername(stringPId);
  7693. CPhmsRequest::SetPassword("");
  7694. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  7695. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7696. {
  7697. //写日志
  7698. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7699. return nRet;
  7700. }
  7701. //只有登录(1002)和注册并登录(1086)命令才需要,解析返回的xml,得到sessionid
  7702. nRet = this->GetSessionId(m_nSaveType, m_stringContent, m_stringFilePath);
  7703. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7704. {
  7705. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7706. return nRet;
  7707. }
  7708. CSessionIdManager::HandleSessionSync(m_stringSessionId);
  7709. return PHMS_SUCCESSFUL_RESULT;
  7710. }
  7711. int CPhmsSession::CardBindPhone(string stringPhone, string stringScode)
  7712. {
  7713. AutoPtr<Document> pDoc = new Document;
  7714. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7715. AutoPtr<Element> pRoot = pDoc->createElement("request");
  7716. AutoPtr<Element> pChildPhone = pDoc->createElement("phone");
  7717. AutoPtr<Element> pChildScode = pDoc->createElement("scode");
  7718. AutoPtr<Text> pTextPhone = pDoc->createTextNode(stringPhone);
  7719. AutoPtr<Text> pTextSCode = pDoc->createTextNode(stringScode);
  7720. pChildPhone->appendChild(pTextPhone);
  7721. pChildScode->appendChild(pTextSCode);
  7722. pRoot->appendChild(pChildPhone);
  7723. pRoot->appendChild(pChildScode);
  7724. //pDoc->appendChild(pi);
  7725. pDoc->appendChild(pRoot);
  7726. string stringXmlContent;
  7727. int nRet = PHMS_SUCCESSFUL_RESULT;
  7728. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  7729. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7730. {
  7731. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7732. return nRet;
  7733. }
  7734. CPhmsRequestHead phmsRequestHead("10", "1088", m_stringSessionId, "11");
  7735. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  7736. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  7737. phmsRequest.GenerateAndSetSign();
  7738. CPhmsResponse phmsResponse;
  7739. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  7740. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7741. {
  7742. //写日志
  7743. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7744. return nRet;
  7745. }
  7746. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  7747. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7748. {
  7749. //写日志
  7750. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7751. return nRet;
  7752. }
  7753. return PHMS_SUCCESSFUL_RESULT;
  7754. }
  7755. int CPhmsSession::ResetPassword(string stringPhone, string stringScode, string stringNewPwd)
  7756. {
  7757. AutoPtr<Document> pDoc = new Document;
  7758. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7759. AutoPtr<Element> pRoot = pDoc->createElement("request");
  7760. AutoPtr<Element> pChildPhone = pDoc->createElement("phone");
  7761. AutoPtr<Element> pChildScode = pDoc->createElement("scode");
  7762. AutoPtr<Element> pChildNewPwd = pDoc->createElement("newpwd");
  7763. AutoPtr<Text> pTextPhone = pDoc->createTextNode(stringPhone);
  7764. AutoPtr<Text> pTextSCode = pDoc->createTextNode(stringScode);
  7765. AutoPtr<Text> pTextNewPwd = pDoc->createTextNode(stringNewPwd);
  7766. pChildPhone->appendChild(pTextPhone);
  7767. pChildScode->appendChild(pTextSCode);
  7768. pChildNewPwd->appendChild(pTextNewPwd);
  7769. pRoot->appendChild(pChildPhone);
  7770. pRoot->appendChild(pChildScode);
  7771. pRoot->appendChild(pChildNewPwd);
  7772. //pDoc->appendChild(pi);
  7773. pDoc->appendChild(pRoot);
  7774. string stringXmlContent;
  7775. int nRet = PHMS_SUCCESSFUL_RESULT;
  7776. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  7777. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7778. {
  7779. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7780. return nRet;
  7781. }
  7782. string stringSessionId(32, '0');
  7783. CPhmsRequestHead phmsRequestHead("10", "1089", stringSessionId, "11");
  7784. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  7785. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  7786. //phmsRequest.GenerateAndSetSign();
  7787. CPhmsResponse phmsResponse;
  7788. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  7789. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7790. {
  7791. //写日志
  7792. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7793. return nRet;
  7794. }
  7795. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  7796. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7797. {
  7798. //写日志
  7799. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7800. return nRet;
  7801. }
  7802. return PHMS_SUCCESSFUL_RESULT;
  7803. }
  7804. int CPhmsSession::UploadDaily(string stringType, string stringCreateTime, string stringFiles)
  7805. {
  7806. int nRet = PHMS_SUCCESSFUL_RESULT;
  7807. //首先生成子xml文件,并获得内容
  7808. // string stringSubXmlContent;
  7809. // AutoPtr<Document> pSubDoc = new Document;
  7810. // //AutoPtr<ProcessingInstruction> pSubPi = pSubDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7811. // AutoPtr<Element> pSubRoot = pSubDoc->createElement("files");
  7812. // AutoPtr<Element> pSubChildMood = pSubDoc->createElement("feeling");
  7813. // AutoPtr<Text> pSubTextMood = pSubDoc->createTextNode(stringMood);
  7814. // pSubChildMood->appendChild(pSubTextMood);
  7815. // pSubRoot->appendChild(pSubChildMood);
  7816. // vector<string>::iterator iter;
  7817. // for(iter=vFileLocalPath.begin(); iter!=vFileLocalPath.end(); iter++)
  7818. // {
  7819. // AutoPtr<Element> pSubChildFile = pSubDoc->createElement("file");
  7820. // AutoPtr<Element> pSubGrandChildUri = pSubDoc->createElement("uri");
  7821. // AutoPtr<Text> pSubTextUri = pSubDoc->createTextNode(*iter);
  7822. // pSubGrandChildUri->appendChild(pSubTextUri);
  7823. // pSubChildFile->appendChild(pSubGrandChildUri);
  7824. // pSubRoot->appendChild(pSubChildFile);
  7825. // }
  7826. // //pSubDoc->appendChild(pSubPi);
  7827. // pSubDoc->appendChild(pSubRoot);
  7828. // nRet = this->GetRequestXmlNoBase64(pSubDoc, stringSubXmlContent, false);
  7829. // if(nRet != PHMS_SUCCESSFUL_RESULT)
  7830. // {
  7831. // CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7832. // return nRet;
  7833. // }
  7834. AutoPtr<Document> pDoc = new Document;
  7835. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7836. AutoPtr<Element> pRoot = pDoc->createElement("request");
  7837. AutoPtr<Element> pChildType = pDoc->createElement("type");
  7838. AutoPtr<Element> pChildCreateTime = pDoc->createElement("createtime");
  7839. AutoPtr<Element> pChildFiles = pDoc->createElement("files");
  7840. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  7841. AutoPtr<Text> pTextCreateTime = pDoc->createTextNode(stringCreateTime);
  7842. AutoPtr<Text> pTextFiles = pDoc->createTextNode(stringFiles);
  7843. pChildType->appendChild(pTextType);
  7844. pChildCreateTime->appendChild(pTextCreateTime);
  7845. pChildFiles->appendChild(pTextFiles);
  7846. pRoot->appendChild(pChildType);
  7847. pRoot->appendChild(pChildCreateTime);
  7848. pRoot->appendChild(pChildFiles);
  7849. //pDoc->appendChild(pi);
  7850. pDoc->appendChild(pRoot);
  7851. string stringXmlContent;
  7852. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  7853. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7854. {
  7855. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7856. return nRet;
  7857. }
  7858. string stringSessionId(32, '0');
  7859. if(m_stringSessionId.size() != 0)
  7860. {
  7861. stringSessionId = m_stringSessionId;
  7862. }
  7863. CPhmsRequestHead phmsRequestHead("10", "1090", stringSessionId, "11");
  7864. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  7865. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  7866. if(m_stringSessionId.size() != 0)
  7867. {
  7868. phmsRequest.GenerateAndSetSign();
  7869. }
  7870. CPhmsResponse phmsResponse;
  7871. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  7872. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7873. {
  7874. //写日志
  7875. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7876. return nRet;
  7877. }
  7878. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  7879. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7880. {
  7881. //写日志
  7882. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7883. return nRet;
  7884. }
  7885. return PHMS_SUCCESSFUL_RESULT;
  7886. }
  7887. int CPhmsSession::GetDateListOfDaily(string stringYear, string stringMonth)
  7888. {
  7889. AutoPtr<Document> pDoc = new Document;
  7890. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7891. AutoPtr<Element> pRoot = pDoc->createElement("request");
  7892. AutoPtr<Element> pChildYear = pDoc->createElement("year");
  7893. AutoPtr<Element> pChildMonth = pDoc->createElement("month");
  7894. AutoPtr<Text> pTextYear = pDoc->createTextNode(stringYear);
  7895. AutoPtr<Text> pTextMonth = pDoc->createTextNode(stringMonth);
  7896. pChildYear->appendChild(pTextYear);
  7897. pChildMonth->appendChild(pTextMonth);
  7898. pRoot->appendChild(pChildYear);
  7899. pRoot->appendChild(pChildMonth);
  7900. //pDoc->appendChild(pi);
  7901. pDoc->appendChild(pRoot);
  7902. string stringXmlContent;
  7903. int nRet = PHMS_SUCCESSFUL_RESULT;
  7904. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  7905. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7906. {
  7907. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7908. return nRet;
  7909. }
  7910. string stringSessionId(32, '0');
  7911. if(m_stringSessionId.size() != 0)
  7912. {
  7913. stringSessionId = m_stringSessionId;
  7914. }
  7915. CPhmsRequestHead phmsRequestHead("10", "1091", stringSessionId, "11");
  7916. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  7917. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  7918. if(m_stringSessionId.size() != 0)
  7919. {
  7920. phmsRequest.GenerateAndSetSign();
  7921. }
  7922. CPhmsResponse phmsResponse;
  7923. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  7924. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7925. {
  7926. //写日志
  7927. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7928. return nRet;
  7929. }
  7930. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  7931. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7932. {
  7933. //写日志
  7934. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7935. return nRet;
  7936. }
  7937. return PHMS_SUCCESSFUL_RESULT;
  7938. }
  7939. int CPhmsSession::GetDailyOfDate(string stringDate, string stringType)
  7940. {
  7941. AutoPtr<Document> pDoc = new Document;
  7942. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7943. AutoPtr<Element> pRoot = pDoc->createElement("request");
  7944. AutoPtr<Element> pChildDate = pDoc->createElement("date");
  7945. AutoPtr<Element> pChildType = pDoc->createElement("type");
  7946. AutoPtr<Text> pTextDate = pDoc->createTextNode(stringDate);
  7947. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  7948. pChildDate->appendChild(pTextDate);
  7949. pChildType->appendChild(pTextType);
  7950. pRoot->appendChild(pChildDate);
  7951. pRoot->appendChild(pChildType);
  7952. //pDoc->appendChild(pi);
  7953. pDoc->appendChild(pRoot);
  7954. string stringXmlContent;
  7955. int nRet = PHMS_SUCCESSFUL_RESULT;
  7956. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  7957. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7958. {
  7959. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7960. return nRet;
  7961. }
  7962. string stringSessionId(32, '0');
  7963. if(m_stringSessionId.size() != 0)
  7964. {
  7965. stringSessionId = m_stringSessionId;
  7966. }
  7967. CPhmsRequestHead phmsRequestHead("10", "1092", stringSessionId, "11");
  7968. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  7969. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  7970. if(m_stringSessionId.size() != 0)
  7971. {
  7972. phmsRequest.GenerateAndSetSign();
  7973. }
  7974. CPhmsResponse phmsResponse;
  7975. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  7976. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7977. {
  7978. //写日志
  7979. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7980. return nRet;
  7981. }
  7982. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  7983. if(nRet != PHMS_SUCCESSFUL_RESULT)
  7984. {
  7985. //写日志
  7986. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  7987. return nRet;
  7988. }
  7989. return PHMS_SUCCESSFUL_RESULT;
  7990. }
  7991. int CPhmsSession::ShareDaily(string stringType, string stringCreateTime)
  7992. {
  7993. AutoPtr<Document> pDoc = new Document;
  7994. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  7995. AutoPtr<Element> pRoot = pDoc->createElement("request");
  7996. AutoPtr<Element> pChildType = pDoc->createElement("type");
  7997. AutoPtr<Element> pChildCreateTime = pDoc->createElement("createtime");
  7998. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  7999. AutoPtr<Text> pTextCreateTime = pDoc->createTextNode(stringCreateTime);
  8000. pChildType->appendChild(pTextType);
  8001. pChildCreateTime->appendChild(pTextCreateTime);
  8002. pRoot->appendChild(pChildType);
  8003. pRoot->appendChild(pChildCreateTime);
  8004. //pDoc->appendChild(pi);
  8005. pDoc->appendChild(pRoot);
  8006. string stringXmlContent;
  8007. int nRet = PHMS_SUCCESSFUL_RESULT;
  8008. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8009. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8010. {
  8011. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8012. return nRet;
  8013. }
  8014. string stringSessionId(32, '0');
  8015. if(m_stringSessionId.size() != 0)
  8016. {
  8017. stringSessionId = m_stringSessionId;
  8018. }
  8019. CPhmsRequestHead phmsRequestHead("10", "1093", stringSessionId, "11");
  8020. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8021. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8022. if(m_stringSessionId.size() != 0)
  8023. {
  8024. phmsRequest.GenerateAndSetSign();
  8025. }
  8026. CPhmsResponse phmsResponse;
  8027. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8028. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8029. {
  8030. //写日志
  8031. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8032. return nRet;
  8033. }
  8034. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8035. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8036. {
  8037. //写日志
  8038. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8039. return nRet;
  8040. }
  8041. return PHMS_SUCCESSFUL_RESULT;
  8042. }
  8043. int CPhmsSession::DeleteDaily(string stringType, string stringDate)
  8044. {
  8045. AutoPtr<Document> pDoc = new Document;
  8046. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8047. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8048. AutoPtr<Element> pChildType = pDoc->createElement("type");
  8049. AutoPtr<Element> pChildDate = pDoc->createElement("day");
  8050. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  8051. AutoPtr<Text> pTextDate = pDoc->createTextNode(stringDate);
  8052. pChildType->appendChild(pTextType);
  8053. pChildDate->appendChild(pTextDate);
  8054. pRoot->appendChild(pChildType);
  8055. pRoot->appendChild(pChildDate);
  8056. //pDoc->appendChild(pi);
  8057. pDoc->appendChild(pRoot);
  8058. string stringXmlContent;
  8059. int nRet = PHMS_SUCCESSFUL_RESULT;
  8060. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8061. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8062. {
  8063. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8064. return nRet;
  8065. }
  8066. string stringSessionId(32, '0');
  8067. if(m_stringSessionId.size() != 0)
  8068. {
  8069. stringSessionId = m_stringSessionId;
  8070. }
  8071. CPhmsRequestHead phmsRequestHead("10", "1094", stringSessionId, "11");
  8072. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8073. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8074. if(m_stringSessionId.size() != 0)
  8075. {
  8076. phmsRequest.GenerateAndSetSign();
  8077. }
  8078. CPhmsResponse phmsResponse;
  8079. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8080. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8081. {
  8082. //写日志
  8083. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8084. return nRet;
  8085. }
  8086. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8087. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8088. {
  8089. //写日志
  8090. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8091. return nRet;
  8092. }
  8093. return PHMS_SUCCESSFUL_RESULT;
  8094. }
  8095. int CPhmsSession::PhoneScanQR(string stringQRCode)
  8096. {
  8097. AutoPtr<Document> pDoc = new Document;
  8098. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8099. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8100. AutoPtr<Element> pChildQRCode = pDoc->createElement("qrcode");
  8101. AutoPtr<Text> pTextQRCode = pDoc->createTextNode(stringQRCode);
  8102. pChildQRCode->appendChild(pTextQRCode);
  8103. pRoot->appendChild(pChildQRCode);
  8104. //pDoc->appendChild(pi);
  8105. pDoc->appendChild(pRoot);
  8106. string stringXmlContent;
  8107. int nRet = PHMS_SUCCESSFUL_RESULT;
  8108. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8109. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8110. {
  8111. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8112. return nRet;
  8113. }
  8114. string stringSessionId(32, '0');
  8115. if(m_stringSessionId.size() != 0)
  8116. {
  8117. stringSessionId = m_stringSessionId;
  8118. }
  8119. CPhmsRequestHead phmsRequestHead("10", "1095", stringSessionId, "11");
  8120. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8121. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8122. if(m_stringSessionId.size() != 0)
  8123. {
  8124. phmsRequest.GenerateAndSetSign();
  8125. }
  8126. CPhmsResponse phmsResponse;
  8127. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8128. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8129. {
  8130. //写日志
  8131. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8132. return nRet;
  8133. }
  8134. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8135. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8136. {
  8137. //写日志
  8138. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8139. return nRet;
  8140. }
  8141. return PHMS_SUCCESSFUL_RESULT;
  8142. }
  8143. int CPhmsSession::PhoneScanQRVerify(string stringQRCode)
  8144. {
  8145. AutoPtr<Document> pDoc = new Document;
  8146. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8147. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8148. AutoPtr<Element> pChildQRCode = pDoc->createElement("qrcode");
  8149. AutoPtr<Text> pTextQRCode = pDoc->createTextNode(stringQRCode);
  8150. pChildQRCode->appendChild(pTextQRCode);
  8151. pRoot->appendChild(pChildQRCode);
  8152. //pDoc->appendChild(pi);
  8153. pDoc->appendChild(pRoot);
  8154. string stringXmlContent;
  8155. int nRet = PHMS_SUCCESSFUL_RESULT;
  8156. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8157. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8158. {
  8159. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8160. return nRet;
  8161. }
  8162. string stringSessionId(32, '0');
  8163. if(m_stringSessionId.size() != 0)
  8164. {
  8165. stringSessionId = m_stringSessionId;
  8166. }
  8167. CPhmsRequestHead phmsRequestHead("10", "1096", stringSessionId, "11");
  8168. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8169. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8170. if(m_stringSessionId.size() != 0)
  8171. {
  8172. phmsRequest.GenerateAndSetSign();
  8173. }
  8174. CPhmsResponse phmsResponse;
  8175. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8176. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8177. {
  8178. //写日志
  8179. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8180. return nRet;
  8181. }
  8182. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8183. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8184. {
  8185. //写日志
  8186. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8187. return nRet;
  8188. }
  8189. return PHMS_SUCCESSFUL_RESULT;
  8190. }
  8191. int CPhmsSession::ApplyQRCode(string stringType, string stringScene)
  8192. {
  8193. AutoPtr<Document> pDoc = new Document;
  8194. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8195. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8196. AutoPtr<Element> pChildType = pDoc->createElement("type");
  8197. AutoPtr<Element> pChildData = pDoc->createElement("data");
  8198. AutoPtr<Element> pGrandChildScene = pDoc->createElement("scene");
  8199. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  8200. AutoPtr<Text> pTextScene = pDoc->createTextNode(stringScene);
  8201. pChildType->appendChild(pTextType);
  8202. pGrandChildScene->appendChild(pTextScene);
  8203. pChildData->appendChild(pGrandChildScene);
  8204. pRoot->appendChild(pChildType);
  8205. pRoot->appendChild(pChildData);
  8206. //pDoc->appendChild(pi);
  8207. pDoc->appendChild(pRoot);
  8208. string stringXmlContent;
  8209. int nRet = PHMS_SUCCESSFUL_RESULT;
  8210. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8211. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8212. {
  8213. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8214. return nRet;
  8215. }
  8216. string stringSessionId(32, '0');
  8217. if(m_stringSessionId.size() != 0)
  8218. {
  8219. stringSessionId = m_stringSessionId;
  8220. }
  8221. CPhmsRequestHead phmsRequestHead("10", "1097", stringSessionId, "11");
  8222. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8223. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8224. if(m_stringSessionId.size() != 0)
  8225. {
  8226. phmsRequest.GenerateAndSetSign();
  8227. }
  8228. CPhmsResponse phmsResponse;
  8229. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8230. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8231. {
  8232. //写日志
  8233. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8234. return nRet;
  8235. }
  8236. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8237. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8238. {
  8239. //写日志
  8240. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8241. return nRet;
  8242. }
  8243. return PHMS_SUCCESSFUL_RESULT;
  8244. }
  8245. int CPhmsSession::ValidateUserAccount(string stringLoginId, string stringPassword, string stringRole)
  8246. {
  8247. AutoPtr<Document> pDoc = new Document;
  8248. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8249. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8250. AutoPtr<Element> pChildRole = pDoc->createElement("role");
  8251. AutoPtr<Element> pChildLoginId = pDoc->createElement("loginid");
  8252. AutoPtr<Element> pChildPwd = pDoc->createElement("pwd");
  8253. AutoPtr<Text> pTextRole = pDoc->createTextNode(stringRole);
  8254. AutoPtr<Text> pTextLoginId = pDoc->createTextNode(stringLoginId);
  8255. AutoPtr<Text> pTextPwd = pDoc->createTextNode(stringPassword);
  8256. pChildRole->appendChild(pTextRole);
  8257. pChildLoginId->appendChild(pTextLoginId);
  8258. pChildPwd->appendChild(pTextPwd);
  8259. pRoot->appendChild(pChildRole);
  8260. pRoot->appendChild(pChildLoginId);
  8261. pRoot->appendChild(pChildPwd);
  8262. //pDoc->appendChild(pi);
  8263. pDoc->appendChild(pRoot);
  8264. string stringXmlContent;
  8265. int nRet = PHMS_SUCCESSFUL_RESULT;
  8266. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8267. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8268. {
  8269. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8270. return nRet;
  8271. }
  8272. string stringSessionId(32, '0');
  8273. if(m_stringSessionId.size() != 0)
  8274. {
  8275. stringSessionId = m_stringSessionId;
  8276. }
  8277. CPhmsRequestHead phmsRequestHead("10", "1099", stringSessionId, "11");
  8278. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8279. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8280. if(m_stringSessionId.size() != 0)
  8281. {
  8282. phmsRequest.GenerateAndSetSign();
  8283. }
  8284. CPhmsResponse phmsResponse;
  8285. nRet = ExecutePhmsSession(phmsRequest, phmsResponse, true);
  8286. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8287. {
  8288. //写日志
  8289. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8290. return nRet;
  8291. }
  8292. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8293. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8294. {
  8295. //写日志
  8296. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8297. return nRet;
  8298. }
  8299. return PHMS_SUCCESSFUL_RESULT;
  8300. }
  8301. int CPhmsSession::RegisterBluetoothDevice(string stringUniqueSN, string stringSerial, string stringBluetoothAddress, string stringBluetoothName, string stringDeviceType)
  8302. {
  8303. AutoPtr<Document> pDoc = new Document;
  8304. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8305. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8306. AutoPtr<Element> pChildUniqueSN = pDoc->createElement("uniquesn");
  8307. AutoPtr<Element> pChildSerial = pDoc->createElement("serial");
  8308. AutoPtr<Element> pChildBluetoothAddress = pDoc->createElement("bluetoothaddress");
  8309. AutoPtr<Element> pChildBluetoothName = pDoc->createElement("bluetoothname");
  8310. AutoPtr<Element> pChildDeviceType = pDoc->createElement("devicetype");
  8311. AutoPtr<Text> pTextUniqueSN = pDoc->createTextNode(stringUniqueSN);
  8312. AutoPtr<Text> pTextSerial = pDoc->createTextNode(stringSerial);
  8313. AutoPtr<Text> pTextBluetoothAddress = pDoc->createTextNode(stringBluetoothAddress);
  8314. AutoPtr<Text> pTextBluetoothName = pDoc->createTextNode(stringBluetoothName);
  8315. AutoPtr<Text> pTextDeviceType = pDoc->createTextNode(stringDeviceType);
  8316. pChildUniqueSN->appendChild(pTextUniqueSN);
  8317. pChildSerial->appendChild(pTextSerial);
  8318. pChildBluetoothAddress->appendChild(pTextBluetoothAddress);
  8319. pChildBluetoothName->appendChild(pTextBluetoothName);
  8320. pChildDeviceType->appendChild(pTextDeviceType);
  8321. pRoot->appendChild(pChildUniqueSN);
  8322. pRoot->appendChild(pChildSerial);
  8323. pRoot->appendChild(pChildBluetoothAddress);
  8324. pRoot->appendChild(pChildBluetoothName);
  8325. pRoot->appendChild(pChildDeviceType);
  8326. //pDoc->appendChild(pi);
  8327. pDoc->appendChild(pRoot);
  8328. string stringXmlContent;
  8329. int nRet = PHMS_SUCCESSFUL_RESULT;
  8330. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8331. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8332. {
  8333. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8334. return nRet;
  8335. }
  8336. CPhmsRequestHead phmsRequestHead("10", "1100", m_stringSessionId, "11");
  8337. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8338. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8339. phmsRequest.GenerateAndSetSign();
  8340. CPhmsResponse phmsResponse;
  8341. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8342. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8343. {
  8344. //写日志
  8345. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8346. return nRet;
  8347. }
  8348. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8349. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8350. {
  8351. //写日志
  8352. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8353. return nRet;
  8354. }
  8355. return PHMS_SUCCESSFUL_RESULT;
  8356. }
  8357. int CPhmsSession::GetBluetoothInfoOfDevice(string stringUniqueSN)
  8358. {
  8359. AutoPtr<Document> pDoc = new Document;
  8360. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8361. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8362. AutoPtr<Element> pChildUniqueSN = pDoc->createElement("uniquesn");
  8363. AutoPtr<Text> pTextUniqueSN = pDoc->createTextNode(stringUniqueSN);
  8364. pChildUniqueSN->appendChild(pTextUniqueSN);
  8365. pRoot->appendChild(pChildUniqueSN);
  8366. //pDoc->appendChild(pi);
  8367. pDoc->appendChild(pRoot);
  8368. string stringXmlContent;
  8369. int nRet = PHMS_SUCCESSFUL_RESULT;
  8370. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8371. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8372. {
  8373. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8374. return nRet;
  8375. }
  8376. CPhmsRequestHead phmsRequestHead("10", "1101", m_stringSessionId, "11");
  8377. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8378. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8379. phmsRequest.GenerateAndSetSign();
  8380. CPhmsResponse phmsResponse;
  8381. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8382. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8383. {
  8384. //写日志
  8385. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8386. return nRet;
  8387. }
  8388. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8389. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8390. {
  8391. //写日志
  8392. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8393. return nRet;
  8394. }
  8395. return PHMS_SUCCESSFUL_RESULT;
  8396. }
  8397. int CPhmsSession::ChangeDeviceType(string stringUniqueSN, string stringDeviceType)
  8398. {
  8399. AutoPtr<Document> pDoc = new Document;
  8400. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8401. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8402. AutoPtr<Element> pChildUniqueSN = pDoc->createElement("uniquesn");
  8403. AutoPtr<Element> pChildDeviceType = pDoc->createElement("devicetype");
  8404. AutoPtr<Text> pTextUniqueSN = pDoc->createTextNode(stringUniqueSN);
  8405. AutoPtr<Text> pTextDeviceType = pDoc->createTextNode(stringDeviceType);
  8406. pChildUniqueSN->appendChild(pTextUniqueSN);
  8407. pChildDeviceType->appendChild(pTextDeviceType);
  8408. pRoot->appendChild(pChildUniqueSN);
  8409. pRoot->appendChild(pChildDeviceType);
  8410. //pDoc->appendChild(pi);
  8411. pDoc->appendChild(pRoot);
  8412. string stringXmlContent;
  8413. int nRet = PHMS_SUCCESSFUL_RESULT;
  8414. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8415. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8416. {
  8417. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8418. return nRet;
  8419. }
  8420. CPhmsRequestHead phmsRequestHead("10", "1102", m_stringSessionId, "11");
  8421. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8422. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8423. phmsRequest.GenerateAndSetSign();
  8424. CPhmsResponse phmsResponse;
  8425. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8426. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8427. {
  8428. //写日志
  8429. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8430. return nRet;
  8431. }
  8432. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8433. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8434. {
  8435. //写日志
  8436. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8437. return nRet;
  8438. }
  8439. return PHMS_SUCCESSFUL_RESULT;
  8440. }
  8441. int CPhmsSession::UnregisterBluetoothDevice(string stringUniqueSN)
  8442. {
  8443. AutoPtr<Document> pDoc = new Document;
  8444. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8445. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8446. AutoPtr<Element> pChildUniqueSN = pDoc->createElement("uniquesn");
  8447. AutoPtr<Text> pTextUniqueSN = pDoc->createTextNode(stringUniqueSN);
  8448. pChildUniqueSN->appendChild(pTextUniqueSN);
  8449. pRoot->appendChild(pChildUniqueSN);
  8450. //pDoc->appendChild(pi);
  8451. pDoc->appendChild(pRoot);
  8452. string stringXmlContent;
  8453. int nRet = PHMS_SUCCESSFUL_RESULT;
  8454. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8455. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8456. {
  8457. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8458. return nRet;
  8459. }
  8460. CPhmsRequestHead phmsRequestHead("10", "1103", m_stringSessionId, "11");
  8461. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8462. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8463. phmsRequest.GenerateAndSetSign();
  8464. CPhmsResponse phmsResponse;
  8465. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8466. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8467. {
  8468. //写日志
  8469. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8470. return nRet;
  8471. }
  8472. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8473. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8474. {
  8475. //写日志
  8476. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8477. return nRet;
  8478. }
  8479. return PHMS_SUCCESSFUL_RESULT;
  8480. }
  8481. int CPhmsSession::GetHospitalListOfArea(string stringAreaId, string stringRank, string stringBeta)
  8482. {
  8483. AutoPtr<Document> pDoc = new Document;
  8484. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8485. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8486. AutoPtr<Element> pChildAreaId = pDoc->createElement("areaid");
  8487. AutoPtr<Element> pChildRank = pDoc->createElement("rank");
  8488. AutoPtr<Element> pChildBeta = pDoc->createElement("beta");
  8489. AutoPtr<Text> pTextAreaId = pDoc->createTextNode(stringAreaId);
  8490. AutoPtr<Text> pTextRank = pDoc->createTextNode(stringRank);
  8491. AutoPtr<Text> pTextBeta = pDoc->createTextNode(stringBeta);
  8492. pChildAreaId->appendChild(pTextAreaId);
  8493. pChildRank->appendChild(pTextRank);
  8494. pChildBeta->appendChild(pTextBeta);
  8495. pRoot->appendChild(pChildAreaId);
  8496. pRoot->appendChild(pChildRank);
  8497. pRoot->appendChild(pChildBeta);
  8498. //pDoc->appendChild(pi);
  8499. pDoc->appendChild(pRoot);
  8500. string stringXmlContent;
  8501. int nRet = PHMS_SUCCESSFUL_RESULT;
  8502. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8503. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8504. {
  8505. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8506. return nRet;
  8507. }
  8508. string stringSessionId(32, '0');
  8509. CPhmsRequestHead phmsRequestHead("10", "1104", stringSessionId, "11");
  8510. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8511. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8512. //phmsRequest.GenerateAndSetSign();
  8513. CPhmsResponse phmsResponse;
  8514. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8515. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8516. {
  8517. //写日志
  8518. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8519. return nRet;
  8520. }
  8521. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8522. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8523. {
  8524. //写日志
  8525. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8526. return nRet;
  8527. }
  8528. return PHMS_SUCCESSFUL_RESULT;
  8529. }
  8530. int CPhmsSession::UploadCommonFileSegment(string stringType, string stringExtra, string stringOrder, string stringTotalSize,
  8531. string stringServerUri, string stringStart1, string stringEnd1, string stringMd51, string stringStart2, string stringEnd2, string stringMd52, string stringStart3, string stringEnd3, string stringMd53, string stringFilePath, string stringFileType)
  8532. {
  8533. AutoPtr<Document> pDoc = new Document;
  8534. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8535. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8536. AutoPtr<Element> pChildType = pDoc->createElement("type");
  8537. AutoPtr<Element> pChildExtra = pDoc->createElement("extra");
  8538. AutoPtr<Element> pChildOrder = pDoc->createElement("order");
  8539. AutoPtr<Element> pChildTotalSize = pDoc->createElement("totalsize");
  8540. AutoPtr<Element> pChildServerUri = pDoc->createElement("serveruri");
  8541. AutoPtr<Element> pChildPart1 = pDoc->createElement("md51");
  8542. AutoPtr<Element> pGrandChildStart1= pDoc->createElement("start");
  8543. AutoPtr<Element> pGrandChildEnd1 = pDoc->createElement("end");
  8544. AutoPtr<Element> pGrandChildMd51 = pDoc->createElement("md5");
  8545. AutoPtr<Element> pChildPart2 = pDoc->createElement("md52");
  8546. AutoPtr<Element> pGrandChildStart2= pDoc->createElement("start");
  8547. AutoPtr<Element> pGrandChildEnd2 = pDoc->createElement("end");
  8548. AutoPtr<Element> pGrandChildMd52 = pDoc->createElement("md5");
  8549. AutoPtr<Element> pChildPart3 = pDoc->createElement("md53");
  8550. AutoPtr<Element> pGrandChildStart3= pDoc->createElement("start");
  8551. AutoPtr<Element> pGrandChildEnd3 = pDoc->createElement("end");
  8552. AutoPtr<Element> pGrandChildMd53 = pDoc->createElement("md5");
  8553. AutoPtr<Element> pChildFileType = pDoc->createElement("filetype");
  8554. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  8555. AutoPtr<Text> pTextExtra = pDoc->createTextNode(stringExtra);
  8556. AutoPtr<Text> pTextOrder = pDoc->createTextNode(stringOrder);
  8557. AutoPtr<Text> pTextTotalSize = pDoc->createTextNode(stringTotalSize);
  8558. AutoPtr<Text> pTextServerUri = pDoc->createTextNode(stringServerUri);
  8559. AutoPtr<Text> pTextStart1 = pDoc->createTextNode(stringStart1);
  8560. AutoPtr<Text> pTextEnd1 = pDoc->createTextNode(stringEnd1);
  8561. AutoPtr<Text> pTextMd51 = pDoc->createTextNode(stringMd51);
  8562. AutoPtr<Text> pTextStart2 = pDoc->createTextNode(stringStart2);
  8563. AutoPtr<Text> pTextEnd2 = pDoc->createTextNode(stringEnd2);
  8564. AutoPtr<Text> pTextMd52 = pDoc->createTextNode(stringMd52);
  8565. AutoPtr<Text> pTextStart3 = pDoc->createTextNode(stringStart3);
  8566. AutoPtr<Text> pTextEnd3 = pDoc->createTextNode(stringEnd3);
  8567. AutoPtr<Text> pTextMd53 = pDoc->createTextNode(stringMd53);
  8568. AutoPtr<Text> pTextFileType = pDoc->createTextNode(stringFileType);
  8569. pChildType->appendChild(pTextType);
  8570. pChildExtra->appendChild(pTextExtra);
  8571. pChildOrder->appendChild(pTextOrder);
  8572. pChildTotalSize->appendChild(pTextTotalSize);
  8573. pChildServerUri->appendChild(pTextServerUri);
  8574. pGrandChildStart1->appendChild(pTextStart1);
  8575. pGrandChildEnd1->appendChild(pTextEnd1);
  8576. pGrandChildMd51->appendChild(pTextMd51);
  8577. pGrandChildStart2->appendChild(pTextStart2);
  8578. pGrandChildEnd2->appendChild(pTextEnd2);
  8579. pGrandChildMd52->appendChild(pTextMd52);
  8580. pGrandChildStart3->appendChild(pTextStart3);
  8581. pGrandChildEnd3->appendChild(pTextEnd3);
  8582. pGrandChildMd53->appendChild(pTextMd53);
  8583. pChildPart1->appendChild(pGrandChildStart1);
  8584. pChildPart1->appendChild(pGrandChildEnd1);
  8585. pChildPart1->appendChild(pGrandChildMd51);
  8586. pChildPart2->appendChild(pGrandChildStart2);
  8587. pChildPart2->appendChild(pGrandChildEnd2);
  8588. pChildPart2->appendChild(pGrandChildMd52);
  8589. pChildPart3->appendChild(pGrandChildStart3);
  8590. pChildPart3->appendChild(pGrandChildEnd3);
  8591. pChildPart3->appendChild(pGrandChildMd53);
  8592. pChildFileType->appendChild(pTextFileType);
  8593. pRoot->appendChild(pChildType);
  8594. pRoot->appendChild(pChildExtra);
  8595. pRoot->appendChild(pChildOrder);
  8596. pRoot->appendChild(pChildTotalSize);
  8597. pRoot->appendChild(pChildServerUri);
  8598. pRoot->appendChild(pChildPart1);
  8599. pRoot->appendChild(pChildPart2);
  8600. pRoot->appendChild(pChildPart3);
  8601. pRoot->appendChild(pChildFileType);
  8602. //pDoc->appendChild(pi);
  8603. pDoc->appendChild(pRoot);
  8604. string stringXmlContent;
  8605. int nRet = PHMS_SUCCESSFUL_RESULT;
  8606. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8607. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8608. {
  8609. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8610. return nRet;
  8611. }
  8612. CPhmsRequestHead phmsRequestHead("10", "1105", m_stringSessionId, "11");
  8613. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8614. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, stringFilePath);
  8615. phmsRequest.GenerateAndSetSign();
  8616. CPhmsResponse phmsResponse;
  8617. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8618. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8619. {
  8620. //写日志
  8621. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8622. return nRet;
  8623. }
  8624. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8625. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8626. {
  8627. //写日志
  8628. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8629. return nRet;
  8630. }
  8631. return PHMS_SUCCESSFUL_RESULT;
  8632. }
  8633. int CPhmsSession::SearchSomebody(string stringUserId)
  8634. {
  8635. AutoPtr<Document> pDoc = new Document;
  8636. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8637. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8638. AutoPtr<Element> pChildUId = pDoc->createElement("uid");
  8639. AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUserId);
  8640. pChildUId->appendChild(pTextUId);
  8641. pRoot->appendChild(pChildUId);
  8642. //pDoc->appendChild(pi);
  8643. pDoc->appendChild(pRoot);
  8644. string stringXmlContent;
  8645. int nRet = PHMS_SUCCESSFUL_RESULT;
  8646. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8647. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8648. {
  8649. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8650. return nRet;
  8651. }
  8652. CPhmsRequestHead phmsRequestHead("10", "1106", m_stringSessionId, "11");
  8653. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8654. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8655. phmsRequest.GenerateAndSetSign();
  8656. CPhmsResponse phmsResponse;
  8657. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8658. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8659. {
  8660. //写日志
  8661. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8662. return nRet;
  8663. }
  8664. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8665. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8666. {
  8667. //写日志
  8668. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8669. return nRet;
  8670. }
  8671. return PHMS_SUCCESSFUL_RESULT;
  8672. }
  8673. int CPhmsSession::FollowSomebody(string stringUserId, string stringUsername, string stringNickname, string stringVCode)
  8674. {
  8675. AutoPtr<Document> pDoc = new Document;
  8676. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8677. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8678. AutoPtr<Element> pChildUId = pDoc->createElement("uid");
  8679. AutoPtr<Element> pChildUName = pDoc->createElement("uname");
  8680. AutoPtr<Element> pChildNickname = pDoc->createElement("nickname");
  8681. AutoPtr<Element> pChildVCode = pDoc->createElement("vcode");
  8682. AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUserId);
  8683. AutoPtr<Text> pTextUName = pDoc->createTextNode(stringUsername);
  8684. AutoPtr<Text> pTextNickname = pDoc->createTextNode(stringNickname);
  8685. AutoPtr<Text> pTextVCode = pDoc->createTextNode(stringVCode);
  8686. pChildUId->appendChild(pTextUId);
  8687. pChildUName->appendChild(pTextUName);
  8688. pChildNickname->appendChild(pTextNickname);
  8689. pChildVCode->appendChild(pTextVCode);
  8690. pRoot->appendChild(pChildUId);
  8691. pRoot->appendChild(pChildUName);
  8692. pRoot->appendChild(pChildNickname);
  8693. pRoot->appendChild(pChildVCode);
  8694. //pDoc->appendChild(pi);
  8695. pDoc->appendChild(pRoot);
  8696. string stringXmlContent;
  8697. int nRet = PHMS_SUCCESSFUL_RESULT;
  8698. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8699. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8700. {
  8701. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8702. return nRet;
  8703. }
  8704. CPhmsRequestHead phmsRequestHead("10", "1107", m_stringSessionId, "11");
  8705. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8706. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8707. phmsRequest.GenerateAndSetSign();
  8708. CPhmsResponse phmsResponse;
  8709. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8710. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8711. {
  8712. //写日志
  8713. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8714. return nRet;
  8715. }
  8716. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8717. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8718. {
  8719. //写日志
  8720. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8721. return nRet;
  8722. }
  8723. return PHMS_SUCCESSFUL_RESULT;
  8724. }
  8725. int CPhmsSession::MyFollowing(string stringUserId, string stringNextId, string stringFType)
  8726. {
  8727. AutoPtr<Document> pDoc = new Document;
  8728. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8729. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8730. AutoPtr<Element> pChildUId = pDoc->createElement("uid");
  8731. AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
  8732. AutoPtr<Element> pChildFType = pDoc->createElement("ftype");
  8733. AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUserId);
  8734. AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
  8735. AutoPtr<Text> pTextFType = pDoc->createTextNode(stringFType);
  8736. pChildUId->appendChild(pTextUId);
  8737. pChildNextId->appendChild(pTextNextId);
  8738. pChildFType->appendChild(pTextFType);
  8739. pRoot->appendChild(pChildUId);
  8740. pRoot->appendChild(pChildNextId);
  8741. pRoot->appendChild(pChildFType);
  8742. //pDoc->appendChild(pi);
  8743. pDoc->appendChild(pRoot);
  8744. string stringXmlContent;
  8745. int nRet = PHMS_SUCCESSFUL_RESULT;
  8746. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8747. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8748. {
  8749. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8750. return nRet;
  8751. }
  8752. CPhmsRequestHead phmsRequestHead("10", "1108", m_stringSessionId, "11");
  8753. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8754. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8755. phmsRequest.GenerateAndSetSign();
  8756. CPhmsResponse phmsResponse;
  8757. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8758. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8759. {
  8760. //写日志
  8761. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8762. return nRet;
  8763. }
  8764. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8765. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8766. {
  8767. //写日志
  8768. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8769. return nRet;
  8770. }
  8771. return PHMS_SUCCESSFUL_RESULT;
  8772. }
  8773. int CPhmsSession::MyFans(string stringUserId, string stringNextId)
  8774. {
  8775. AutoPtr<Document> pDoc = new Document;
  8776. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8777. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8778. AutoPtr<Element> pChildUId = pDoc->createElement("uid");
  8779. AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
  8780. AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUserId);
  8781. AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
  8782. pChildUId->appendChild(pTextUId);
  8783. pChildNextId->appendChild(pTextNextId);
  8784. pRoot->appendChild(pChildUId);
  8785. pRoot->appendChild(pChildNextId);
  8786. //pDoc->appendChild(pi);
  8787. pDoc->appendChild(pRoot);
  8788. string stringXmlContent;
  8789. int nRet = PHMS_SUCCESSFUL_RESULT;
  8790. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8791. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8792. {
  8793. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8794. return nRet;
  8795. }
  8796. CPhmsRequestHead phmsRequestHead("10", "1109", m_stringSessionId, "11");
  8797. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8798. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8799. phmsRequest.GenerateAndSetSign();
  8800. CPhmsResponse phmsResponse;
  8801. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8802. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8803. {
  8804. //写日志
  8805. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8806. return nRet;
  8807. }
  8808. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8809. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8810. {
  8811. //写日志
  8812. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8813. return nRet;
  8814. }
  8815. return PHMS_SUCCESSFUL_RESULT;
  8816. }
  8817. int CPhmsSession::ChangeNicknameOfFollowed(string stringUserId, string stringNickname)
  8818. {
  8819. AutoPtr<Document> pDoc = new Document;
  8820. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8821. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8822. AutoPtr<Element> pChildUId = pDoc->createElement("uid");
  8823. AutoPtr<Element> pChildNickname = pDoc->createElement("nickname");
  8824. AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUserId);
  8825. AutoPtr<Text> pTextNickname = pDoc->createTextNode(stringNickname);
  8826. pChildUId->appendChild(pTextUId);
  8827. pChildNickname->appendChild(pTextNickname);
  8828. pRoot->appendChild(pChildUId);
  8829. pRoot->appendChild(pChildNickname);
  8830. //pDoc->appendChild(pi);
  8831. pDoc->appendChild(pRoot);
  8832. string stringXmlContent;
  8833. int nRet = PHMS_SUCCESSFUL_RESULT;
  8834. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8835. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8836. {
  8837. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8838. return nRet;
  8839. }
  8840. CPhmsRequestHead phmsRequestHead("10", "1110", m_stringSessionId, "11");
  8841. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8842. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8843. phmsRequest.GenerateAndSetSign();
  8844. CPhmsResponse phmsResponse;
  8845. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8846. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8847. {
  8848. //写日志
  8849. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8850. return nRet;
  8851. }
  8852. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8853. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8854. {
  8855. //写日志
  8856. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8857. return nRet;
  8858. }
  8859. return PHMS_SUCCESSFUL_RESULT;
  8860. }
  8861. int CPhmsSession::CancelFollowing(string stringUserId)
  8862. {
  8863. AutoPtr<Document> pDoc = new Document;
  8864. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8865. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8866. AutoPtr<Element> pChildUId = pDoc->createElement("uid");
  8867. AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUserId);
  8868. pChildUId->appendChild(pTextUId);
  8869. pRoot->appendChild(pChildUId);
  8870. //pDoc->appendChild(pi);
  8871. pDoc->appendChild(pRoot);
  8872. string stringXmlContent;
  8873. int nRet = PHMS_SUCCESSFUL_RESULT;
  8874. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8875. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8876. {
  8877. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8878. return nRet;
  8879. }
  8880. CPhmsRequestHead phmsRequestHead("10", "1111", m_stringSessionId, "11");
  8881. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8882. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8883. phmsRequest.GenerateAndSetSign();
  8884. CPhmsResponse phmsResponse;
  8885. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8886. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8887. {
  8888. //写日志
  8889. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8890. return nRet;
  8891. }
  8892. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8893. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8894. {
  8895. //写日志
  8896. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8897. return nRet;
  8898. }
  8899. return PHMS_SUCCESSFUL_RESULT;
  8900. }
  8901. int CPhmsSession::PublishHealthyKnowledge(vector<HEALTHY_KNOWLEDGE> vHealthKnowledge)
  8902. {
  8903. AutoPtr<Document> pDoc = new Document;
  8904. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8905. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8906. for(int i=0; i<vHealthKnowledge.size(); i++)
  8907. {
  8908. AutoPtr<Element> pChildMsg = pDoc->createElement("msg");
  8909. AutoPtr<Element> pGrandChildTitle = pDoc->createElement("title");
  8910. AutoPtr<Element> pGrandChildDescription = pDoc->createElement("description");
  8911. AutoPtr<Element> pGrandChildUrl = pDoc->createElement("url");
  8912. AutoPtr<Element> pGrandChildPicUrl = pDoc->createElement("picurl");
  8913. AutoPtr<Text> pTextTitle = pDoc->createTextNode(vHealthKnowledge[i].title);
  8914. AutoPtr<Text> pTextDescription = pDoc->createTextNode(vHealthKnowledge[i].description);
  8915. AutoPtr<Text> pTextUrl = pDoc->createTextNode(vHealthKnowledge[i].url);
  8916. AutoPtr<Text> pTextPicUrl = pDoc->createTextNode(vHealthKnowledge[i].picurl);
  8917. pGrandChildTitle->appendChild(pTextTitle);
  8918. pGrandChildDescription->appendChild(pTextDescription);
  8919. pGrandChildUrl->appendChild(pTextUrl);
  8920. pGrandChildPicUrl->appendChild(pTextPicUrl);
  8921. pChildMsg->appendChild(pGrandChildTitle);
  8922. pChildMsg->appendChild(pGrandChildDescription);
  8923. pChildMsg->appendChild(pGrandChildUrl);
  8924. pChildMsg->appendChild(pGrandChildPicUrl);
  8925. pRoot->appendChild(pChildMsg);
  8926. }
  8927. //pDoc->appendChild(pi);
  8928. pDoc->appendChild(pRoot);
  8929. string stringXmlContent;
  8930. int nRet = PHMS_SUCCESSFUL_RESULT;
  8931. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8932. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8933. {
  8934. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8935. return nRet;
  8936. }
  8937. CPhmsRequestHead phmsRequestHead("10", "1112", m_stringSessionId, "11");
  8938. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8939. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8940. phmsRequest.GenerateAndSetSign();
  8941. CPhmsResponse phmsResponse;
  8942. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8943. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8944. {
  8945. //写日志
  8946. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8947. return nRet;
  8948. }
  8949. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  8950. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8951. {
  8952. //写日志
  8953. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8954. return nRet;
  8955. }
  8956. return PHMS_SUCCESSFUL_RESULT;
  8957. }
  8958. int CPhmsSession::GetListOfHealthyKnowledge(string stringSenderId, string stringNextId, string stringIds, string stringPageSize, string stringOrderBy)
  8959. {
  8960. AutoPtr<Document> pDoc = new Document;
  8961. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  8962. AutoPtr<Element> pRoot = pDoc->createElement("request");
  8963. AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
  8964. AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
  8965. AutoPtr<Element> pChildIds = pDoc->createElement("ids");
  8966. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  8967. AutoPtr<Element> pChildOrderBy = pDoc->createElement("orderby");
  8968. AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
  8969. AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
  8970. AutoPtr<Text> pTextIds = pDoc->createTextNode(stringIds);
  8971. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  8972. AutoPtr<Text> pTextOrderBy = pDoc->createTextNode(stringOrderBy);
  8973. pChildSenderId->appendChild(pTextSenderId);
  8974. pChildNextId->appendChild(pTextNextId);
  8975. pChildIds->appendChild(pTextIds);
  8976. pChildPageSize->appendChild(pTextPageSize);
  8977. pChildOrderBy->appendChild(pTextOrderBy);
  8978. pRoot->appendChild(pChildSenderId);
  8979. pRoot->appendChild(pChildNextId);
  8980. pRoot->appendChild(pChildIds);
  8981. pRoot->appendChild(pChildPageSize);
  8982. pRoot->appendChild(pChildOrderBy);
  8983. //pDoc->appendChild(pi);
  8984. pDoc->appendChild(pRoot);
  8985. string stringXmlContent;
  8986. int nRet = PHMS_SUCCESSFUL_RESULT;
  8987. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  8988. if(nRet != PHMS_SUCCESSFUL_RESULT)
  8989. {
  8990. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  8991. return nRet;
  8992. }
  8993. CPhmsRequestHead phmsRequestHead("10", "1113", m_stringSessionId, "11");
  8994. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  8995. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  8996. phmsRequest.GenerateAndSetSign();
  8997. CPhmsResponse phmsResponse;
  8998. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  8999. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9000. {
  9001. //写日志
  9002. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9003. return nRet;
  9004. }
  9005. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9006. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9007. {
  9008. //写日志
  9009. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9010. return nRet;
  9011. }
  9012. return PHMS_SUCCESSFUL_RESULT;
  9013. }
  9014. int CPhmsSession::GenerateOrDeletePngZlibReport(string stringServerPath, string stringFlag)
  9015. {
  9016. AutoPtr<Document> pDoc = new Document;
  9017. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  9018. AutoPtr<Element> pRoot = pDoc->createElement("request");
  9019. AutoPtr<Element> pChildReportPath = pDoc->createElement("reportpath");
  9020. AutoPtr<Element> pChildType = pDoc->createElement("type");
  9021. AutoPtr<Text> pTextReportPath = pDoc->createTextNode(stringServerPath);
  9022. AutoPtr<Text> pTextType = pDoc->createTextNode(stringFlag);
  9023. pChildReportPath->appendChild(pTextReportPath);
  9024. pChildType->appendChild(pTextType);
  9025. pRoot->appendChild(pChildReportPath);
  9026. pRoot->appendChild(pChildType);
  9027. //pDoc->appendChild(pi);
  9028. pDoc->appendChild(pRoot);
  9029. string stringXmlContent;
  9030. int nRet = PHMS_SUCCESSFUL_RESULT;
  9031. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  9032. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9033. {
  9034. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9035. return nRet;
  9036. }
  9037. CPhmsRequestHead phmsRequestHead("10", /*"1114"*/"", m_stringSessionId, "11");
  9038. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  9039. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  9040. phmsRequest.GenerateAndSetSign();
  9041. CPhmsResponse phmsResponse;
  9042. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  9043. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9044. {
  9045. //写日志
  9046. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9047. return nRet;
  9048. }
  9049. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9050. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9051. {
  9052. //写日志
  9053. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9054. return nRet;
  9055. }
  9056. return PHMS_SUCCESSFUL_RESULT;
  9057. }
  9058. int CPhmsSession::GetDailyList(string stringType, string stringStartDate, string stringEndDate, string stringOrderBy, string stringNextId, string stringPageSize)
  9059. {
  9060. AutoPtr<Document> pDoc = new Document;
  9061. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  9062. AutoPtr<Element> pRoot = pDoc->createElement("request");
  9063. AutoPtr<Element> pChildType = pDoc->createElement("type");
  9064. AutoPtr<Element> pChildStartDate = pDoc->createElement("startdate");
  9065. AutoPtr<Element> pChildEndDate = pDoc->createElement("enddate");
  9066. AutoPtr<Element> pChildOrderBy = pDoc->createElement("orderby");
  9067. AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
  9068. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  9069. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  9070. AutoPtr<Text> pTextStartDate = pDoc->createTextNode(stringStartDate);
  9071. AutoPtr<Text> pTextEndDate = pDoc->createTextNode(stringEndDate);
  9072. AutoPtr<Text> pTextOrderBy = pDoc->createTextNode(stringOrderBy);
  9073. AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
  9074. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  9075. pChildType->appendChild(pTextType);
  9076. pChildStartDate->appendChild(pTextStartDate);
  9077. pChildEndDate->appendChild(pTextEndDate);
  9078. pChildOrderBy->appendChild(pTextOrderBy);
  9079. pChildNextId->appendChild(pTextNextId);
  9080. pChildPageSize->appendChild(pTextPageSize);
  9081. pRoot->appendChild(pChildType);
  9082. pRoot->appendChild(pChildStartDate);
  9083. pRoot->appendChild(pChildEndDate);
  9084. pRoot->appendChild(pChildOrderBy);
  9085. pRoot->appendChild(pChildNextId);
  9086. pRoot->appendChild(pChildPageSize);
  9087. //pDoc->appendChild(pi);
  9088. pDoc->appendChild(pRoot);
  9089. string stringXmlContent;
  9090. int nRet = PHMS_SUCCESSFUL_RESULT;
  9091. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  9092. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9093. {
  9094. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9095. return nRet;
  9096. }
  9097. CPhmsRequestHead phmsRequestHead("10", "1114", m_stringSessionId, "11");
  9098. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  9099. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  9100. phmsRequest.GenerateAndSetSign();
  9101. CPhmsResponse phmsResponse;
  9102. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  9103. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9104. {
  9105. //写日志
  9106. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9107. return nRet;
  9108. }
  9109. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9110. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9111. {
  9112. //写日志
  9113. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9114. return nRet;
  9115. }
  9116. return PHMS_SUCCESSFUL_RESULT;
  9117. }
  9118. int CPhmsSession::GetCardUserReportList(string stringReportId, string stringReportStartDate, string stringReportEndDate, string stringCaseType, string stringState, string stringOrderBy,
  9119. string stringThirdIdType, string stringThirdId, string stringNextId, string stringPageSize)
  9120. {
  9121. AutoPtr<Document> pDoc = new Document;
  9122. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  9123. AutoPtr<Element> pRoot = pDoc->createElement("request");
  9124. AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
  9125. AutoPtr<Element> pChildReportStartDate = pDoc->createElement("reportstartdate");
  9126. AutoPtr<Element> pChildReportEndDate = pDoc->createElement("reportenddate");
  9127. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  9128. AutoPtr<Element> pChildState = pDoc->createElement("state");
  9129. AutoPtr<Element> pChildOrderBy = pDoc->createElement("orderby");
  9130. AutoPtr<Element> pChildThirdIdType = pDoc->createElement("thirdidtype");
  9131. AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
  9132. AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
  9133. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  9134. AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
  9135. AutoPtr<Text> pTextReportStartDate = pDoc->createTextNode(stringReportStartDate);
  9136. AutoPtr<Text> pTextReportEndDate = pDoc->createTextNode(stringReportEndDate);
  9137. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  9138. AutoPtr<Text> pTextState = pDoc->createTextNode(stringState);
  9139. AutoPtr<Text> pTextOrderBy = pDoc->createTextNode(stringOrderBy);
  9140. AutoPtr<Text> pTextThirdIdType = pDoc->createTextNode(stringThirdIdType);
  9141. AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
  9142. AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
  9143. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  9144. pChildReportId->appendChild(pTextReportId);
  9145. pChildReportStartDate->appendChild(pTextReportStartDate);
  9146. pChildReportEndDate->appendChild(pTextReportEndDate);
  9147. pChildCaseType->appendChild(pTextCaseType);
  9148. pChildState->appendChild(pTextState);
  9149. pChildOrderBy->appendChild(pTextOrderBy);
  9150. pChildThirdIdType->appendChild(pTextThirdIdType);
  9151. pChildThirdId->appendChild(pTextThirdId);
  9152. pChildNextId->appendChild(pTextNextId);
  9153. pChildPageSize->appendChild(pTextPageSize);
  9154. pRoot->appendChild(pChildReportId);
  9155. pRoot->appendChild(pChildReportStartDate);
  9156. pRoot->appendChild(pChildReportEndDate);
  9157. pRoot->appendChild(pChildCaseType);
  9158. pRoot->appendChild(pChildState);
  9159. pRoot->appendChild(pChildOrderBy);
  9160. pRoot->appendChild(pChildThirdIdType);
  9161. pRoot->appendChild(pChildThirdId);
  9162. pRoot->appendChild(pChildNextId);
  9163. pRoot->appendChild(pChildPageSize);
  9164. //pDoc->appendChild(pi);
  9165. pDoc->appendChild(pRoot);
  9166. string stringXmlContent;
  9167. int nRet = PHMS_SUCCESSFUL_RESULT;
  9168. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  9169. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9170. {
  9171. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9172. return nRet;
  9173. }
  9174. CPhmsRequestHead phmsRequestHead("10", "1115", m_stringSessionId, "11");
  9175. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  9176. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  9177. phmsRequest.GenerateAndSetSign();
  9178. CPhmsResponse phmsResponse;
  9179. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  9180. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9181. {
  9182. //写日志
  9183. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9184. return nRet;
  9185. }
  9186. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9187. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9188. {
  9189. //写日志
  9190. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9191. return nRet;
  9192. }
  9193. return PHMS_SUCCESSFUL_RESULT;
  9194. }
  9195. int CPhmsSession::ChangeViewLikeCollectCount(string stringHealthTipId, string stringUri, string stringTitle, string stringLike, string stringRead, string stringCollect)
  9196. {
  9197. AutoPtr<Document> pDoc = new Document;
  9198. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  9199. AutoPtr<Element> pRoot = pDoc->createElement("request");
  9200. AutoPtr<Element> pChildHealthTipId = pDoc->createElement("healthtip_id");
  9201. AutoPtr<Element> pChildUri = pDoc->createElement("uri");
  9202. AutoPtr<Element> pChildTitle = pDoc->createElement("title");
  9203. AutoPtr<Element> pChildLike = pDoc->createElement("like");
  9204. AutoPtr<Element> pChildRead = pDoc->createElement("read");
  9205. AutoPtr<Element> pChildCollect = pDoc->createElement("collect");
  9206. AutoPtr<Text> pTextHealthTipId = pDoc->createTextNode(stringHealthTipId);
  9207. AutoPtr<Text> pTextUri = pDoc->createTextNode(stringUri);
  9208. AutoPtr<Text> pTextTitle = pDoc->createTextNode(stringTitle);
  9209. AutoPtr<Text> pTextLike = pDoc->createTextNode(stringLike);
  9210. AutoPtr<Text> pTextRead = pDoc->createTextNode(stringRead);
  9211. AutoPtr<Text> pTextCollect = pDoc->createTextNode(stringCollect);
  9212. pChildHealthTipId->appendChild(pTextHealthTipId);
  9213. pChildUri->appendChild(pTextUri);
  9214. pChildTitle->appendChild(pTextTitle);
  9215. pChildLike->appendChild(pTextLike);
  9216. pChildRead->appendChild(pTextRead);
  9217. pChildCollect->appendChild(pTextCollect);
  9218. pRoot->appendChild(pChildHealthTipId);
  9219. pRoot->appendChild(pChildUri);
  9220. pRoot->appendChild(pChildTitle);
  9221. pRoot->appendChild(pChildLike);
  9222. pRoot->appendChild(pChildRead);
  9223. pRoot->appendChild(pChildCollect);
  9224. //pDoc->appendChild(pi);
  9225. pDoc->appendChild(pRoot);
  9226. string stringXmlContent;
  9227. int nRet = PHMS_SUCCESSFUL_RESULT;
  9228. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  9229. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9230. {
  9231. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9232. return nRet;
  9233. }
  9234. CPhmsRequestHead phmsRequestHead("10", "1116", m_stringSessionId, "11");
  9235. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  9236. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  9237. phmsRequest.GenerateAndSetSign();
  9238. CPhmsResponse phmsResponse;
  9239. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  9240. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9241. {
  9242. //写日志
  9243. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9244. return nRet;
  9245. }
  9246. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9247. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9248. {
  9249. //写日志
  9250. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9251. return nRet;
  9252. }
  9253. return PHMS_SUCCESSFUL_RESULT;
  9254. }
  9255. int CPhmsSession::ChangeAdviceExecutiveState(string stringSgId, string stringState)
  9256. {
  9257. AutoPtr<Document> pDoc = new Document;
  9258. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  9259. AutoPtr<Element> pRoot = pDoc->createElement("request");
  9260. AutoPtr<Element> pChildSgId = pDoc->createElement("sgid");
  9261. AutoPtr<Element> pChildState = pDoc->createElement("state");
  9262. AutoPtr<Text> pTextSgId = pDoc->createTextNode(stringSgId);
  9263. AutoPtr<Text> pTextState = pDoc->createTextNode(stringState);
  9264. pChildSgId->appendChild(pTextSgId);
  9265. pChildState->appendChild(pTextState);
  9266. pRoot->appendChild(pChildSgId);
  9267. pRoot->appendChild(pChildState);
  9268. //pDoc->appendChild(pi);
  9269. pDoc->appendChild(pRoot);
  9270. string stringXmlContent;
  9271. int nRet = PHMS_SUCCESSFUL_RESULT;
  9272. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  9273. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9274. {
  9275. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9276. return nRet;
  9277. }
  9278. CPhmsRequestHead phmsRequestHead("10", "1117", m_stringSessionId, "11");
  9279. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  9280. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  9281. phmsRequest.GenerateAndSetSign();
  9282. CPhmsResponse phmsResponse;
  9283. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  9284. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9285. {
  9286. //写日志
  9287. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9288. return nRet;
  9289. }
  9290. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9291. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9292. {
  9293. //写日志
  9294. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9295. return nRet;
  9296. }
  9297. return PHMS_SUCCESSFUL_RESULT;
  9298. }
  9299. int CPhmsSession::GetTrendRangeValue()
  9300. {
  9301. CPhmsRequestHead phmsRequestHead("10", "1118", m_stringSessionId, "10");
  9302. CPhmsRequestBody phmsRequestBody("");
  9303. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  9304. phmsRequest.GenerateAndSetSign();
  9305. CPhmsResponse phmsResponse;
  9306. int nRet = PHMS_SUCCESSFUL_RESULT;
  9307. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  9308. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9309. {
  9310. //写日志
  9311. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9312. return nRet;
  9313. }
  9314. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9315. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9316. {
  9317. //写日志
  9318. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9319. return nRet;
  9320. }
  9321. return PHMS_SUCCESSFUL_RESULT;
  9322. }
  9323. int CPhmsSession::GetCliniqueReportList(string stringCliniqueSenderId, string stringStartDate,
  9324. string stringEndDate, string stringState, string stringName, string stringPatientSourceCode, string stringYzlb, string stringPIdType, string stringPId, string stringHb, string stringASectionId, string stringNextId, string stringPageSize)
  9325. {
  9326. AutoPtr<Document> pDoc = new Document;
  9327. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  9328. AutoPtr<Element> pRoot = pDoc->createElement("request");
  9329. AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
  9330. AutoPtr<Element> pChildStartDate = pDoc->createElement("startdate");
  9331. AutoPtr<Element> pChildEndDate = pDoc->createElement("enddate");
  9332. AutoPtr<Element> pChildState = pDoc->createElement("state");
  9333. AutoPtr<Element> pChildName = pDoc->createElement("cname");
  9334. AutoPtr<Element> pChildPatientSourceCode = pDoc->createElement("patientsourceid");
  9335. AutoPtr<Element> pChildYzlb = pDoc->createElement("yzlb");
  9336. AutoPtr<Element> pChildPIdType = pDoc->createElement("pidtype");
  9337. AutoPtr<Element> pChildPId = pDoc->createElement("pid");
  9338. AutoPtr<Element> pChildHb = pDoc->createElement("hb");
  9339. AutoPtr<Element> pChildASectionId = pDoc->createElement("asectionid");
  9340. AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
  9341. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  9342. AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringCliniqueSenderId);
  9343. AutoPtr<Text> pTextStartDate = pDoc->createTextNode(stringStartDate);
  9344. AutoPtr<Text> pTextEndDate = pDoc->createTextNode(stringEndDate);
  9345. AutoPtr<Text> pTextState = pDoc->createTextNode(stringState);
  9346. AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
  9347. AutoPtr<Text> pTextPatientSourceCode = pDoc->createTextNode(stringPatientSourceCode);
  9348. AutoPtr<Text> pTextYzlb = pDoc->createTextNode(stringYzlb);
  9349. AutoPtr<Text> pTextPIdType = pDoc->createTextNode(stringPIdType);
  9350. AutoPtr<Text> pTextPId = pDoc->createTextNode(stringPId);
  9351. AutoPtr<Text> pTextHb = pDoc->createTextNode(stringHb);
  9352. AutoPtr<Text> pTextASectionId = pDoc->createTextNode(stringASectionId);
  9353. AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
  9354. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  9355. pChildSenderId->appendChild(pTextSenderId);
  9356. pChildStartDate->appendChild(pTextStartDate);
  9357. pChildEndDate->appendChild(pTextEndDate);
  9358. pChildState->appendChild(pTextState);
  9359. pChildName->appendChild(pTextName);
  9360. pChildPatientSourceCode->appendChild(pTextPatientSourceCode);
  9361. pChildYzlb->appendChild(pTextYzlb);
  9362. pChildPIdType->appendChild(pTextPIdType);
  9363. pChildPId->appendChild(pTextPId);
  9364. pChildHb->appendChild(pTextHb);
  9365. pChildASectionId->appendChild(pTextASectionId);
  9366. pChildNextId->appendChild(pTextNextId);
  9367. pChildPageSize->appendChild(pTextPageSize);
  9368. pRoot->appendChild(pChildSenderId);
  9369. pRoot->appendChild(pChildStartDate);
  9370. pRoot->appendChild(pChildEndDate);
  9371. pRoot->appendChild(pChildState);
  9372. pRoot->appendChild(pChildName);
  9373. pRoot->appendChild(pChildPatientSourceCode);
  9374. pRoot->appendChild(pChildYzlb);
  9375. pRoot->appendChild(pChildPIdType);
  9376. pRoot->appendChild(pChildPId);
  9377. pRoot->appendChild(pChildHb);
  9378. pRoot->appendChild(pChildASectionId);
  9379. pRoot->appendChild(pChildNextId);
  9380. pRoot->appendChild(pChildPageSize);
  9381. //pDoc->appendChild(pi);
  9382. pDoc->appendChild(pRoot);
  9383. string stringXmlContent;
  9384. int nRet = PHMS_SUCCESSFUL_RESULT;
  9385. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  9386. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9387. {
  9388. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9389. return nRet;
  9390. }
  9391. CPhmsRequestHead phmsRequestHead("10", "1119", m_stringSessionId, "11");
  9392. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  9393. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  9394. phmsRequest.GenerateAndSetSign();
  9395. CPhmsResponse phmsResponse;
  9396. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  9397. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9398. {
  9399. //写日志
  9400. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9401. return nRet;
  9402. }
  9403. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9404. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9405. {
  9406. //写日志
  9407. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9408. return nRet;
  9409. }
  9410. return PHMS_SUCCESSFUL_RESULT;
  9411. }
  9412. int CPhmsSession::GetUserListBindingOrNot(string stringNextId, string stringPageSize, string stringIsBind, string stringIsActive)
  9413. {
  9414. AutoPtr<Document> pDoc = new Document;
  9415. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  9416. AutoPtr<Element> pRoot = pDoc->createElement("request");
  9417. AutoPtr<Element> pChildIsBind = pDoc->createElement("isbind");
  9418. AutoPtr<Element> pChildIsActive = pDoc->createElement("isactive");
  9419. AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
  9420. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  9421. AutoPtr<Text> pTextIsBind = pDoc->createTextNode(stringIsBind);
  9422. AutoPtr<Text> pTextIsActive = pDoc->createTextNode(stringIsActive);
  9423. AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
  9424. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  9425. pChildIsBind->appendChild(pTextIsBind);
  9426. pChildIsActive->appendChild(pTextIsActive);
  9427. pChildNextId->appendChild(pTextNextId);
  9428. pChildPageSize->appendChild(pTextPageSize);
  9429. pRoot->appendChild(pChildNextId);
  9430. pRoot->appendChild(pChildPageSize);
  9431. pRoot->appendChild(pChildIsBind);
  9432. pRoot->appendChild(pChildIsActive);
  9433. //pDoc->appendChild(pi);
  9434. pDoc->appendChild(pRoot);
  9435. string stringXmlContent;
  9436. int nRet = PHMS_SUCCESSFUL_RESULT;
  9437. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  9438. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9439. {
  9440. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9441. return nRet;
  9442. }
  9443. CPhmsRequestHead phmsRequestHead("10", "1120", m_stringSessionId, "11");
  9444. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  9445. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  9446. phmsRequest.GenerateAndSetSign();
  9447. CPhmsResponse phmsResponse;
  9448. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  9449. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9450. {
  9451. //写日志
  9452. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9453. return nRet;
  9454. }
  9455. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9456. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9457. {
  9458. //写日志
  9459. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9460. return nRet;
  9461. }
  9462. return PHMS_SUCCESSFUL_RESULT;
  9463. }
  9464. int CPhmsSession::BindUser(string stringUId, string stringUName)
  9465. {
  9466. AutoPtr<Document> pDoc = new Document;
  9467. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  9468. AutoPtr<Element> pRoot = pDoc->createElement("request");
  9469. AutoPtr<Element> pChildUId = pDoc->createElement("uid");
  9470. AutoPtr<Element> pChildUName = pDoc->createElement("uname");
  9471. AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
  9472. AutoPtr<Text> pTextUName = pDoc->createTextNode(stringUName);
  9473. pChildUId->appendChild(pTextUId);
  9474. pChildUName->appendChild(pTextUName);
  9475. pRoot->appendChild(pChildUId);
  9476. pRoot->appendChild(pChildUName);
  9477. //pDoc->appendChild(pi);
  9478. pDoc->appendChild(pRoot);
  9479. string stringXmlContent;
  9480. int nRet = PHMS_SUCCESSFUL_RESULT;
  9481. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  9482. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9483. {
  9484. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9485. return nRet;
  9486. }
  9487. CPhmsRequestHead phmsRequestHead("10", "1121", m_stringSessionId, "11");
  9488. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  9489. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  9490. phmsRequest.GenerateAndSetSign();
  9491. CPhmsResponse phmsResponse;
  9492. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  9493. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9494. {
  9495. //写日志
  9496. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9497. return nRet;
  9498. }
  9499. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9500. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9501. {
  9502. //写日志
  9503. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9504. return nRet;
  9505. }
  9506. return PHMS_SUCCESSFUL_RESULT;
  9507. }
  9508. int CPhmsSession::UnbindUser(string stringUId)
  9509. {
  9510. AutoPtr<Document> pDoc = new Document;
  9511. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  9512. AutoPtr<Element> pRoot = pDoc->createElement("request");
  9513. AutoPtr<Element> pChildUId = pDoc->createElement("uid");
  9514. AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
  9515. pChildUId->appendChild(pTextUId);
  9516. pRoot->appendChild(pChildUId);
  9517. //pDoc->appendChild(pi);
  9518. pDoc->appendChild(pRoot);
  9519. string stringXmlContent;
  9520. int nRet = PHMS_SUCCESSFUL_RESULT;
  9521. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  9522. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9523. {
  9524. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9525. return nRet;
  9526. }
  9527. CPhmsRequestHead phmsRequestHead("10", "1122", m_stringSessionId, "11");
  9528. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  9529. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  9530. phmsRequest.GenerateAndSetSign();
  9531. CPhmsResponse phmsResponse;
  9532. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  9533. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9534. {
  9535. //写日志
  9536. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9537. return nRet;
  9538. }
  9539. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9540. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9541. {
  9542. //写日志
  9543. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9544. return nRet;
  9545. }
  9546. return PHMS_SUCCESSFUL_RESULT;
  9547. }
  9548. int CPhmsSession::GetCardUserListOfCustomer(string stringThirdId, string stringName, string stringCaseType, string stringStartDate, string stringEndDate, string stringNextId, string stringPageSize)
  9549. {
  9550. AutoPtr<Document> pDoc = new Document;
  9551. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  9552. AutoPtr<Element> pRoot = pDoc->createElement("request");
  9553. AutoPtr<Element> pChildThirdId = pDoc->createElement("thirdid");
  9554. AutoPtr<Element> pChildName = pDoc->createElement("name");
  9555. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  9556. AutoPtr<Element> pChildStartDate = pDoc->createElement("startdate");
  9557. AutoPtr<Element> pChildEndDate = pDoc->createElement("enddate");
  9558. AutoPtr<Element> pChildNextId = pDoc->createElement("nextid");
  9559. AutoPtr<Element> pChildPageSize = pDoc->createElement("pagesize");
  9560. AutoPtr<Text> pTextThirdId = pDoc->createTextNode(stringThirdId);
  9561. AutoPtr<Text> pTextName = pDoc->createTextNode(stringName);
  9562. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  9563. AutoPtr<Text> pTextStartDate = pDoc->createTextNode(stringStartDate);
  9564. AutoPtr<Text> pTextEndDate = pDoc->createTextNode(stringEndDate);
  9565. AutoPtr<Text> pTextNextId = pDoc->createTextNode(stringNextId);
  9566. AutoPtr<Text> pTextPageSize = pDoc->createTextNode(stringPageSize);
  9567. pChildThirdId->appendChild(pTextThirdId);
  9568. pChildName->appendChild(pTextName);
  9569. pChildCaseType->appendChild(pTextCaseType);
  9570. pChildStartDate->appendChild(pTextStartDate);
  9571. pChildEndDate->appendChild(pTextEndDate);
  9572. pChildNextId->appendChild(pTextNextId);
  9573. pChildPageSize->appendChild(pTextPageSize);
  9574. pRoot->appendChild(pChildThirdId);
  9575. pRoot->appendChild(pChildName);
  9576. pRoot->appendChild(pChildCaseType);
  9577. pRoot->appendChild(pChildStartDate);
  9578. pRoot->appendChild(pChildEndDate);
  9579. pRoot->appendChild(pChildNextId);
  9580. pRoot->appendChild(pChildPageSize);
  9581. //pDoc->appendChild(pi);
  9582. pDoc->appendChild(pRoot);
  9583. string stringXmlContent;
  9584. int nRet = PHMS_SUCCESSFUL_RESULT;
  9585. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  9586. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9587. {
  9588. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9589. return nRet;
  9590. }
  9591. CPhmsRequestHead phmsRequestHead("10", "1124", m_stringSessionId, "11");
  9592. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  9593. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  9594. phmsRequest.GenerateAndSetSign();
  9595. CPhmsResponse phmsResponse;
  9596. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  9597. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9598. {
  9599. //写日志
  9600. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9601. return nRet;
  9602. }
  9603. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9604. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9605. {
  9606. //写日志
  9607. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9608. return nRet;
  9609. }
  9610. return PHMS_SUCCESSFUL_RESULT;
  9611. }
  9612. int CPhmsSession::SearchCaseAdvanced(string stringHospitalId, string stringDiagnostic,
  9613. string stringName, string stringSex, QUERY_RANGE rangeAge, QUERY_RANGE rangeCreateTime, string stringMode,
  9614. string stringCaseType, QUERY_ECG ecg, string stringFrom, string stringSize)
  9615. {
  9616. string stringXmlContent;
  9617. int nRet = PHMS_SUCCESSFUL_RESULT;
  9618. //构造json
  9619. Json::Value jRoot;
  9620. Json::FastWriter jWriter;
  9621. jRoot["hospitalid"] = CUtil::EnvToUtf8(stringHospitalId);
  9622. jRoot["diagnostic"] = CUtil::EnvToUtf8(stringDiagnostic);
  9623. jRoot["name"] = CUtil::EnvToUtf8(stringName);
  9624. jRoot["sex"] = CUtil::EnvToUtf8(stringSex);
  9625. Json::Value jAge;
  9626. jAge["gte"] = CUtil::EnvToUtf8(rangeAge.lowerLimit);
  9627. jAge["lte"] = CUtil::EnvToUtf8(rangeAge.upperLimit);
  9628. jRoot["age"] = jAge;
  9629. Json::Value jCreateTime;
  9630. jCreateTime["gte"] = CUtil::EnvToUtf8(rangeCreateTime.lowerLimit);
  9631. jCreateTime["lte"] = CUtil::EnvToUtf8(rangeCreateTime.upperLimit);
  9632. jRoot["createtime"] = jCreateTime;
  9633. jRoot["mode"] = CUtil::EnvToUtf8(stringMode);
  9634. Json::Value jCaseType;
  9635. jCaseType["id"] = CUtil::EnvToUtf8(stringCaseType);
  9636. Json::Value HR;
  9637. HR["gte"] = CUtil::EnvToUtf8(ecg.hr.lowerLimit);
  9638. HR["lte"] = CUtil::EnvToUtf8(ecg.hr.upperLimit);
  9639. jCaseType["HR"] = HR;
  9640. Json::Value PR_Int;
  9641. PR_Int["gte"] = CUtil::EnvToUtf8(ecg.pr_int.lowerLimit);
  9642. PR_Int["lte"] = CUtil::EnvToUtf8(ecg.pr_int.upperLimit);
  9643. jCaseType["PR_Int"] = PR_Int;
  9644. Json::Value QT_Int;
  9645. QT_Int["gte"] = CUtil::EnvToUtf8(ecg.qt_int.lowerLimit);
  9646. QT_Int["lte"] = CUtil::EnvToUtf8(ecg.qt_int.upperLimit);
  9647. jCaseType["QT_Int"] = QT_Int;
  9648. jCaseType["PR_Int"] = PR_Int;
  9649. Json::Value QTc_Int;
  9650. QTc_Int["gte"] = CUtil::EnvToUtf8(ecg.qtc_int.lowerLimit);
  9651. QTc_Int["lte"] = CUtil::EnvToUtf8(ecg.qtc_int.upperLimit);
  9652. jCaseType["QTc_Int"] = QTc_Int;
  9653. Json::Value P_Dur;
  9654. P_Dur["gte"] = CUtil::EnvToUtf8(ecg.p_dur.lowerLimit);
  9655. P_Dur["lte"] = CUtil::EnvToUtf8(ecg.p_dur.upperLimit);
  9656. jCaseType["P_Dur"] = P_Dur;
  9657. Json::Value QRS_Dur;
  9658. QRS_Dur["gte"] = CUtil::EnvToUtf8(ecg.qrs_dur.lowerLimit);
  9659. QRS_Dur["lte"] = CUtil::EnvToUtf8(ecg.qrs_dur.upperLimit);
  9660. jCaseType["QRS_Dur"] = QRS_Dur;
  9661. Json::Value P_Axis;
  9662. P_Axis["gte"] = CUtil::EnvToUtf8(ecg.p_axis.lowerLimit);
  9663. P_Axis["lte"] = CUtil::EnvToUtf8(ecg.p_axis.upperLimit);
  9664. jCaseType["P_Axis"] = P_Axis;
  9665. Json::Value QRS_Axis;
  9666. QRS_Axis["gte"] = CUtil::EnvToUtf8(ecg.qrs_axis.lowerLimit);
  9667. QRS_Axis["lte"] = CUtil::EnvToUtf8(ecg.qrs_axis.upperLimit);
  9668. jCaseType["QRS_Axis"] = QRS_Axis;
  9669. Json::Value T_Axis;
  9670. T_Axis["gte"] = CUtil::EnvToUtf8(ecg.t_axis.lowerLimit);
  9671. T_Axis["lte"] = CUtil::EnvToUtf8(ecg.t_axis.upperLimit);
  9672. jCaseType["T_Axis"] = T_Axis;
  9673. Json::Value RV5;
  9674. RV5["gte"] = CUtil::EnvToUtf8(ecg.rv5.lowerLimit);
  9675. RV5["lte"] = CUtil::EnvToUtf8(ecg.rv5.upperLimit);
  9676. jCaseType["RV5"] = RV5;
  9677. Json::Value SV1;
  9678. SV1["gte"] = CUtil::EnvToUtf8(ecg.sv1.lowerLimit);
  9679. SV1["lte"] = CUtil::EnvToUtf8(ecg.sv1.upperLimit);
  9680. jCaseType["SV1"] = SV1;
  9681. jRoot["casetype"] = jCaseType;
  9682. jRoot["from"] = CUtil::EnvToUtf8(stringFrom);
  9683. jRoot["size"] = CUtil::EnvToUtf8(stringSize);
  9684. stringXmlContent = jWriter.write(jRoot);
  9685. CPhmsLogger::GetPhmsLogger()->WriteLog(stringXmlContent, __FUNCTION__, __FILE__, __LINE__);
  9686. std::ostringstream oStringStream;
  9687. Base64Encoder encoderBase64(oStringStream);
  9688. encoderBase64.rdbuf()->setLineLength(0);
  9689. istringstream istr(stringXmlContent);
  9690. StreamCopier::copyStream(istr, encoderBase64);
  9691. encoderBase64.close();
  9692. stringXmlContent = oStringStream.str();
  9693. CPhmsLogger::GetPhmsLogger()->WriteLog(stringXmlContent, __FUNCTION__, __FILE__, __LINE__);
  9694. CPhmsRequestHead phmsRequestHead("10", "1123", m_stringSessionId, "13");
  9695. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  9696. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  9697. phmsRequest.GenerateAndSetSign();
  9698. CPhmsResponse phmsResponse;
  9699. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  9700. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9701. {
  9702. //写日志
  9703. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9704. return nRet;
  9705. }
  9706. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9707. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9708. {
  9709. //写日志
  9710. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9711. return nRet;
  9712. }
  9713. return PHMS_SUCCESSFUL_RESULT;
  9714. }
  9715. int CPhmsSession::SearchCaseAdvancedString(string stringHospitalId, string stringDiagnostic,
  9716. string stringName, string stringSex, string stringJsonAge, string stringJsonCreateTime, string stringMode,
  9717. string stringCaseType, string stringJsonEcg, string stringFrom, string stringSize)
  9718. {
  9719. string stringXmlContent;
  9720. int nRet = PHMS_SUCCESSFUL_RESULT;
  9721. //构造json
  9722. Json::Value jRoot;
  9723. Json::FastWriter jWriter;
  9724. Json::Reader jReader;
  9725. try
  9726. {
  9727. jRoot["hospitalid"] = CUtil::EnvToUtf8(stringHospitalId);
  9728. jRoot["diagnostic"] = CUtil::EnvToUtf8(stringDiagnostic);
  9729. jRoot["name"] = CUtil::EnvToUtf8(stringName);
  9730. jRoot["sex"] = CUtil::EnvToUtf8(stringSex);
  9731. Json::Value jAge;
  9732. // jAge["gte"] = CUtil::EnvToUtf8(rangeAge.lowerLimit);
  9733. // jAge["lte"] = CUtil::EnvToUtf8(rangeAge.upperLimit);
  9734. // jRoot["age"] = jAge;
  9735. jReader.parse(stringJsonAge, jAge);
  9736. Json::Value::Members arrayMemberAge = jAge.getMemberNames();
  9737. for(Json::Value::Members::iterator iter = arrayMemberAge.begin(); iter != arrayMemberAge.end(); ++iter) //遍历json成员
  9738. {
  9739. jRoot[*iter] = jAge[*iter];
  9740. }
  9741. // jRoot.append(jAge);
  9742. Json::Value jCreateTime;
  9743. // jCreateTime["gte"] = CUtil::EnvToUtf8(rangeCreateTime.lowerLimit);
  9744. // jCreateTime["lte"] = CUtil::EnvToUtf8(rangeCreateTime.upperLimit);
  9745. // jRoot["createtime"] = jCreateTime;
  9746. jReader.parse(stringJsonCreateTime, jCreateTime);
  9747. Json::Value::Members arrayMemberCreateTime = jCreateTime.getMemberNames();
  9748. for(Json::Value::Members::iterator iter = arrayMemberCreateTime.begin(); iter != arrayMemberCreateTime.end(); ++iter) //遍历json成员
  9749. {
  9750. jRoot[*iter] = jCreateTime[*iter];
  9751. }
  9752. // jRoot.append(jCreateTime);
  9753. jRoot["mode"] = CUtil::EnvToUtf8(stringMode);
  9754. Json::Value jCaseType;
  9755. jCaseType["id"] = CUtil::EnvToUtf8(stringCaseType);
  9756. // Json::Value HR;
  9757. // HR["gte"] = CUtil::EnvToUtf8(ecg.hr.lowerLimit);
  9758. // HR["lte"] = CUtil::EnvToUtf8(ecg.hr.upperLimit);
  9759. // jCaseType["HR"] = HR;
  9760. // Json::Value PR_Int;
  9761. // PR_Int["gte"] = CUtil::EnvToUtf8(ecg.pr_int.lowerLimit);
  9762. // PR_Int["lte"] = CUtil::EnvToUtf8(ecg.pr_int.upperLimit);
  9763. // jCaseType["PR_Int"] = PR_Int;
  9764. // Json::Value QT_Int;
  9765. // QT_Int["gte"] = CUtil::EnvToUtf8(ecg.qt_int.lowerLimit);
  9766. // QT_Int["lte"] = CUtil::EnvToUtf8(ecg.qt_int.upperLimit);
  9767. // jCaseType["QT_Int"] = QT_Int;
  9768. // jCaseType["PR_Int"] = PR_Int;
  9769. // Json::Value QTc_Int;
  9770. // QTc_Int["gte"] = CUtil::EnvToUtf8(ecg.qtc_int.lowerLimit);
  9771. // QTc_Int["lte"] = CUtil::EnvToUtf8(ecg.qtc_int.upperLimit);
  9772. // jCaseType["QTc_Int"] = QTc_Int;
  9773. // Json::Value P_Dur;
  9774. // P_Dur["gte"] = CUtil::EnvToUtf8(ecg.p_dur.lowerLimit);
  9775. // P_Dur["lte"] = CUtil::EnvToUtf8(ecg.p_dur.upperLimit);
  9776. // jCaseType["P_Dur"] = P_Dur;
  9777. // Json::Value QRS_Dur;
  9778. // QRS_Dur["gte"] = CUtil::EnvToUtf8(ecg.qrs_dur.lowerLimit);
  9779. // QRS_Dur["lte"] = CUtil::EnvToUtf8(ecg.qrs_dur.upperLimit);
  9780. // jCaseType["QRS_Dur"] = QRS_Dur;
  9781. // Json::Value P_Axis;
  9782. // P_Axis["gte"] = CUtil::EnvToUtf8(ecg.p_axis.lowerLimit);
  9783. // P_Axis["lte"] = CUtil::EnvToUtf8(ecg.p_axis.upperLimit);
  9784. // jCaseType["P_Axis"] = P_Axis;
  9785. // Json::Value QRS_Axis;
  9786. // QRS_Axis["gte"] = CUtil::EnvToUtf8(ecg.qrs_axis.lowerLimit);
  9787. // QRS_Axis["lte"] = CUtil::EnvToUtf8(ecg.qrs_axis.upperLimit);
  9788. // jCaseType["QRS_Axis"] = QRS_Axis;
  9789. // Json::Value T_Axis;
  9790. // T_Axis["gte"] = CUtil::EnvToUtf8(ecg.t_axis.lowerLimit);
  9791. // T_Axis["lte"] = CUtil::EnvToUtf8(ecg.t_axis.upperLimit);
  9792. // jCaseType["T_Axis"] = T_Axis;
  9793. // Json::Value RV5;
  9794. // RV5["gte"] = CUtil::EnvToUtf8(ecg.rv5.lowerLimit);
  9795. // RV5["lte"] = CUtil::EnvToUtf8(ecg.rv5.upperLimit);
  9796. // jCaseType["RV5"] = RV5;
  9797. // Json::Value SV1;
  9798. // SV1["gte"] = CUtil::EnvToUtf8(ecg.sv1.lowerLimit);
  9799. // SV1["lte"] = CUtil::EnvToUtf8(ecg.sv1.upperLimit);
  9800. // jCaseType["SV1"] = SV1;
  9801. Json::Value jEcg;
  9802. jReader.parse(stringJsonEcg, jEcg);
  9803. Json::Value::Members arrayMemberECG = jEcg.getMemberNames();
  9804. for(Json::Value::Members::iterator iter = arrayMemberECG.begin(); iter != arrayMemberECG.end(); ++iter) //遍历json成员
  9805. {
  9806. jCaseType[*iter] = jEcg[*iter];
  9807. }
  9808. // jCaseType.append(jEcg);
  9809. jRoot["casetype"] = jCaseType;
  9810. jRoot["from"] = CUtil::EnvToUtf8(stringFrom);
  9811. jRoot["size"] = CUtil::EnvToUtf8(stringSize);
  9812. stringXmlContent = jWriter.write(jRoot);
  9813. CPhmsLogger::GetPhmsLogger()->WriteLog(stringXmlContent, __FUNCTION__, __FILE__, __LINE__);
  9814. }
  9815. catch(...)
  9816. {
  9817. CPhmsLogger::GetPhmsLogger()->WriteLog("Json Handle Exception", __FUNCTION__, __FILE__, __LINE__);
  9818. }
  9819. std::ostringstream oStringStream;
  9820. Base64Encoder encoderBase64(oStringStream);
  9821. encoderBase64.rdbuf()->setLineLength(0);
  9822. istringstream istr(stringXmlContent);
  9823. StreamCopier::copyStream(istr, encoderBase64);
  9824. encoderBase64.close();
  9825. stringXmlContent = oStringStream.str();
  9826. CPhmsLogger::GetPhmsLogger()->WriteLog(stringXmlContent, __FUNCTION__, __FILE__, __LINE__);
  9827. CPhmsRequestHead phmsRequestHead("10", "1123", m_stringSessionId, "13");
  9828. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  9829. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  9830. phmsRequest.GenerateAndSetSign();
  9831. CPhmsResponse phmsResponse;
  9832. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  9833. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9834. {
  9835. //写日志
  9836. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9837. return nRet;
  9838. }
  9839. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9840. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9841. {
  9842. //写日志
  9843. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9844. return nRet;
  9845. }
  9846. return PHMS_SUCCESSFUL_RESULT;
  9847. }
  9848. int CPhmsSession::GetPayCode(string stringType, string stringCaseId)
  9849. {
  9850. AutoPtr<Document> pDoc = new Document;
  9851. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  9852. AutoPtr<Element> pRoot = pDoc->createElement("request");
  9853. AutoPtr<Element> pChildType = pDoc->createElement("type");
  9854. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  9855. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  9856. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  9857. pChildType->appendChild(pTextType);
  9858. pChildCaseId->appendChild(pTextCaseId);
  9859. pRoot->appendChild(pChildType);
  9860. pRoot->appendChild(pChildCaseId);
  9861. //pDoc->appendChild(pi);
  9862. pDoc->appendChild(pRoot);
  9863. string stringXmlContent;
  9864. int nRet = PHMS_SUCCESSFUL_RESULT;
  9865. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  9866. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9867. {
  9868. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9869. return nRet;
  9870. }
  9871. CPhmsRequestHead phmsRequestHead("10", "1125", m_stringSessionId, "11");
  9872. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  9873. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  9874. phmsRequest.GenerateAndSetSign();
  9875. CPhmsResponse phmsResponse;
  9876. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  9877. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9878. {
  9879. //写日志
  9880. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9881. return nRet;
  9882. }
  9883. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9884. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9885. {
  9886. //写日志
  9887. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9888. return nRet;
  9889. }
  9890. return PHMS_SUCCESSFUL_RESULT;
  9891. }
  9892. int CPhmsSession::GetOrderInfo(string stringType, string stringCaseId)
  9893. {
  9894. AutoPtr<Document> pDoc = new Document;
  9895. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  9896. AutoPtr<Element> pRoot = pDoc->createElement("request");
  9897. AutoPtr<Element> pChildType = pDoc->createElement("type");
  9898. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  9899. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  9900. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  9901. pChildType->appendChild(pTextType);
  9902. pChildCaseId->appendChild(pTextCaseId);
  9903. pRoot->appendChild(pChildType);
  9904. pRoot->appendChild(pChildCaseId);
  9905. //pDoc->appendChild(pi);
  9906. pDoc->appendChild(pRoot);
  9907. string stringXmlContent;
  9908. int nRet = PHMS_SUCCESSFUL_RESULT;
  9909. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  9910. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9911. {
  9912. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9913. return nRet;
  9914. }
  9915. CPhmsRequestHead phmsRequestHead("10", "1126", m_stringSessionId, "11");
  9916. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  9917. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  9918. phmsRequest.GenerateAndSetSign();
  9919. CPhmsResponse phmsResponse;
  9920. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  9921. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9922. {
  9923. //写日志
  9924. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9925. return nRet;
  9926. }
  9927. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9928. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9929. {
  9930. //写日志
  9931. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9932. return nRet;
  9933. }
  9934. return PHMS_SUCCESSFUL_RESULT;
  9935. }
  9936. int CPhmsSession::SignDoctor(string stringUId)
  9937. {
  9938. AutoPtr<Document> pDoc = new Document;
  9939. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  9940. AutoPtr<Element> pRoot = pDoc->createElement("request");
  9941. AutoPtr<Element> pChildUId = pDoc->createElement("uid");
  9942. AutoPtr<Text> pTextUId = pDoc->createTextNode(stringUId);
  9943. pChildUId->appendChild(pTextUId);
  9944. pRoot->appendChild(pChildUId);
  9945. //pDoc->appendChild(pi);
  9946. pDoc->appendChild(pRoot);
  9947. string stringXmlContent;
  9948. int nRet = PHMS_SUCCESSFUL_RESULT;
  9949. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  9950. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9951. {
  9952. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9953. return nRet;
  9954. }
  9955. CPhmsRequestHead phmsRequestHead("10", "1127", m_stringSessionId, "11");
  9956. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  9957. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  9958. phmsRequest.GenerateAndSetSign();
  9959. CPhmsResponse phmsResponse;
  9960. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  9961. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9962. {
  9963. //写日志
  9964. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9965. return nRet;
  9966. }
  9967. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  9968. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9969. {
  9970. //写日志
  9971. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  9972. return nRet;
  9973. }
  9974. return PHMS_SUCCESSFUL_RESULT;
  9975. }
  9976. int CPhmsSession::RefundFee(string stringType, string stringCaseId, string stringRefundFee)
  9977. {
  9978. AutoPtr<Document> pDoc = new Document;
  9979. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  9980. AutoPtr<Element> pRoot = pDoc->createElement("request");
  9981. AutoPtr<Element> pChildType = pDoc->createElement("type");
  9982. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  9983. AutoPtr<Element> pChildRefundFee = pDoc->createElement("refund_fee");
  9984. AutoPtr<Text> pTextType = pDoc->createTextNode(stringType);
  9985. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  9986. AutoPtr<Text> pTextRefundFee = pDoc->createTextNode(stringRefundFee);
  9987. pChildType->appendChild(pTextType);
  9988. pChildCaseId->appendChild(pTextCaseId);
  9989. pChildRefundFee->appendChild(pTextRefundFee);
  9990. pRoot->appendChild(pChildType);
  9991. pRoot->appendChild(pChildCaseId);
  9992. pRoot->appendChild(pChildRefundFee);
  9993. //pDoc->appendChild(pi);
  9994. pDoc->appendChild(pRoot);
  9995. string stringXmlContent;
  9996. int nRet = PHMS_SUCCESSFUL_RESULT;
  9997. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  9998. if(nRet != PHMS_SUCCESSFUL_RESULT)
  9999. {
  10000. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10001. return nRet;
  10002. }
  10003. CPhmsRequestHead phmsRequestHead("10", "1128", m_stringSessionId, "11");
  10004. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  10005. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  10006. phmsRequest.GenerateAndSetSign();
  10007. CPhmsResponse phmsResponse;
  10008. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  10009. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10010. {
  10011. //写日志
  10012. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10013. return nRet;
  10014. }
  10015. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  10016. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10017. {
  10018. //写日志
  10019. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10020. return nRet;
  10021. }
  10022. return PHMS_SUCCESSFUL_RESULT;
  10023. }
  10024. int CPhmsSession::HoldPlaceReview(string stringReportId)
  10025. {
  10026. AutoPtr<Document> pDoc = new Document;
  10027. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  10028. AutoPtr<Element> pRoot = pDoc->createElement("request");
  10029. AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
  10030. AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
  10031. pChildReportId->appendChild(pTextReportId);
  10032. pRoot->appendChild(pChildReportId);
  10033. //pDoc->appendChild(pi);
  10034. pDoc->appendChild(pRoot);
  10035. string stringXmlContent;
  10036. int nRet = PHMS_SUCCESSFUL_RESULT;
  10037. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  10038. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10039. {
  10040. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10041. return nRet;
  10042. }
  10043. CPhmsRequestHead phmsRequestHead("10", "1129", m_stringSessionId, "11");
  10044. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  10045. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  10046. phmsRequest.GenerateAndSetSign();
  10047. CPhmsResponse phmsResponse;
  10048. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  10049. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10050. {
  10051. //写日志
  10052. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10053. return nRet;
  10054. }
  10055. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  10056. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10057. {
  10058. //写日志
  10059. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10060. return nRet;
  10061. }
  10062. return PHMS_SUCCESSFUL_RESULT;
  10063. }
  10064. int CPhmsSession::RollBackReview(string stringReportId)
  10065. {
  10066. AutoPtr<Document> pDoc = new Document;
  10067. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  10068. AutoPtr<Element> pRoot = pDoc->createElement("request");
  10069. AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
  10070. AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
  10071. pChildReportId->appendChild(pTextReportId);
  10072. pRoot->appendChild(pChildReportId);
  10073. //pDoc->appendChild(pi);
  10074. pDoc->appendChild(pRoot);
  10075. string stringXmlContent;
  10076. int nRet = PHMS_SUCCESSFUL_RESULT;
  10077. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  10078. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10079. {
  10080. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10081. return nRet;
  10082. }
  10083. CPhmsRequestHead phmsRequestHead("10", "1130", m_stringSessionId, "11");
  10084. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  10085. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  10086. phmsRequest.GenerateAndSetSign();
  10087. CPhmsResponse phmsResponse;
  10088. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  10089. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10090. {
  10091. //写日志
  10092. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10093. return nRet;
  10094. }
  10095. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  10096. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10097. {
  10098. //写日志
  10099. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10100. return nRet;
  10101. }
  10102. return PHMS_SUCCESSFUL_RESULT;
  10103. }
  10104. int CPhmsSession::ResetReviewHoldPlace(string stringReportId, string stringOccupantId, string stringOccupantName, string stringSuperKey)
  10105. {
  10106. AutoPtr<Document> pDoc = new Document;
  10107. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  10108. AutoPtr<Element> pRoot = pDoc->createElement("request");
  10109. AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
  10110. AutoPtr<Element> pChildOccupantId = pDoc->createElement("occupant_id");
  10111. AutoPtr<Element> pChildOccupantName = pDoc->createElement("occupant_name");
  10112. AutoPtr<Element> pChildSuperKey = pDoc->createElement("super_key");
  10113. AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
  10114. AutoPtr<Text> pTextOccupantId = pDoc->createTextNode(stringOccupantId);
  10115. AutoPtr<Text> pTextOccupantName = pDoc->createTextNode(stringOccupantName);
  10116. AutoPtr<Text> pTextSuperKey = pDoc->createTextNode(stringSuperKey);
  10117. pChildReportId->appendChild(pTextReportId);
  10118. pChildOccupantId->appendChild(pTextOccupantId);
  10119. pChildOccupantName->appendChild(pTextOccupantName);
  10120. pChildSuperKey->appendChild(pTextSuperKey);
  10121. pRoot->appendChild(pChildReportId);
  10122. pRoot->appendChild(pChildOccupantId);
  10123. pRoot->appendChild(pChildOccupantName);
  10124. pRoot->appendChild(pChildSuperKey);
  10125. //pDoc->appendChild(pi);
  10126. pDoc->appendChild(pRoot);
  10127. string stringXmlContent;
  10128. int nRet = PHMS_SUCCESSFUL_RESULT;
  10129. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  10130. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10131. {
  10132. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10133. return nRet;
  10134. }
  10135. CPhmsRequestHead phmsRequestHead("10", "1131", m_stringSessionId, "11");
  10136. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  10137. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  10138. phmsRequest.GenerateAndSetSign();
  10139. CPhmsResponse phmsResponse;
  10140. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  10141. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10142. {
  10143. //写日志
  10144. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10145. return nRet;
  10146. }
  10147. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  10148. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10149. {
  10150. //写日志
  10151. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10152. return nRet;
  10153. }
  10154. return PHMS_SUCCESSFUL_RESULT;
  10155. }
  10156. int CPhmsSession::ResetCaseHoldPlace(string stringCaseId, string stringReceiverId, string stringOccupantId, string stringOccupantName, string stringSuperKey)
  10157. {
  10158. AutoPtr<Document> pDoc = new Document;
  10159. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  10160. AutoPtr<Element> pRoot = pDoc->createElement("request");
  10161. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  10162. AutoPtr<Element> pChildReceiverId = pDoc->createElement("receiverid");
  10163. AutoPtr<Element> pChildOccupantId = pDoc->createElement("occupant_id");
  10164. AutoPtr<Element> pChildOccupantName = pDoc->createElement("occupant_name");
  10165. AutoPtr<Element> pChildSuperKey = pDoc->createElement("super_key");
  10166. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  10167. AutoPtr<Text> pTextReceiverId = pDoc->createTextNode(stringReceiverId);
  10168. AutoPtr<Text> pTextOccupantId = pDoc->createTextNode(stringOccupantId);
  10169. AutoPtr<Text> pTextOccupantName = pDoc->createTextNode(stringOccupantName);
  10170. AutoPtr<Text> pTextSuperKey = pDoc->createTextNode(stringSuperKey);
  10171. pChildCaseId->appendChild(pTextCaseId);
  10172. pChildReceiverId->appendChild(pTextReceiverId);
  10173. pChildOccupantId->appendChild(pTextOccupantId);
  10174. pChildOccupantName->appendChild(pTextOccupantName);
  10175. pChildSuperKey->appendChild(pTextSuperKey);
  10176. pRoot->appendChild(pChildCaseId);
  10177. pRoot->appendChild(pChildReceiverId);
  10178. pRoot->appendChild(pChildOccupantId);
  10179. pRoot->appendChild(pChildOccupantName);
  10180. pRoot->appendChild(pChildSuperKey);
  10181. //pDoc->appendChild(pi);
  10182. pDoc->appendChild(pRoot);
  10183. string stringXmlContent;
  10184. int nRet = PHMS_SUCCESSFUL_RESULT;
  10185. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  10186. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10187. {
  10188. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10189. return nRet;
  10190. }
  10191. CPhmsRequestHead phmsRequestHead("10", "1132", m_stringSessionId, "11");
  10192. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  10193. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  10194. phmsRequest.GenerateAndSetSign();
  10195. CPhmsResponse phmsResponse;
  10196. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  10197. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10198. {
  10199. //写日志
  10200. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10201. return nRet;
  10202. }
  10203. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  10204. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10205. {
  10206. //写日志
  10207. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10208. return nRet;
  10209. }
  10210. return PHMS_SUCCESSFUL_RESULT;
  10211. }
  10212. int CPhmsSession::AddTag(string stringTagName, string stringTagDescription)
  10213. {
  10214. AutoPtr<Document> pDoc = new Document;
  10215. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  10216. AutoPtr<Element> pRoot = pDoc->createElement("request");
  10217. AutoPtr<Element> pChildTagName = pDoc->createElement("favoritename");
  10218. AutoPtr<Element> pChildDescription = pDoc->createElement("description");
  10219. AutoPtr<Text> pTextTagName = pDoc->createTextNode(stringTagName);
  10220. AutoPtr<Text> pTextDescription = pDoc->createTextNode(stringTagDescription);
  10221. pChildTagName->appendChild(pTextTagName);
  10222. pChildDescription->appendChild(pTextDescription);
  10223. pRoot->appendChild(pChildTagName);
  10224. pRoot->appendChild(pChildDescription);
  10225. //pDoc->appendChild(pi);
  10226. pDoc->appendChild(pRoot);
  10227. string stringXmlContent;
  10228. int nRet = PHMS_SUCCESSFUL_RESULT;
  10229. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  10230. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10231. {
  10232. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10233. return nRet;
  10234. }
  10235. CPhmsRequestHead phmsRequestHead("10", "1133", m_stringSessionId, "11");
  10236. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  10237. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  10238. phmsRequest.GenerateAndSetSign();
  10239. CPhmsResponse phmsResponse;
  10240. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  10241. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10242. {
  10243. //写日志
  10244. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10245. return nRet;
  10246. }
  10247. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  10248. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10249. {
  10250. //写日志
  10251. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10252. return nRet;
  10253. }
  10254. return PHMS_SUCCESSFUL_RESULT;
  10255. }
  10256. int CPhmsSession::GetTagList(string stringSenderId)
  10257. {
  10258. AutoPtr<Document> pDoc = new Document;
  10259. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  10260. AutoPtr<Element> pRoot = pDoc->createElement("request");
  10261. AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
  10262. AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
  10263. pChildSenderId->appendChild(pTextSenderId);
  10264. pRoot->appendChild(pChildSenderId);
  10265. //pDoc->appendChild(pi);
  10266. pDoc->appendChild(pRoot);
  10267. string stringXmlContent;
  10268. int nRet = PHMS_SUCCESSFUL_RESULT;
  10269. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  10270. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10271. {
  10272. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10273. return nRet;
  10274. }
  10275. CPhmsRequestHead phmsRequestHead("10", "1134", m_stringSessionId, "11");
  10276. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  10277. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  10278. phmsRequest.GenerateAndSetSign();
  10279. CPhmsResponse phmsResponse;
  10280. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  10281. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10282. {
  10283. //写日志
  10284. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10285. return nRet;
  10286. }
  10287. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  10288. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10289. {
  10290. //写日志
  10291. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10292. return nRet;
  10293. }
  10294. return PHMS_SUCCESSFUL_RESULT;
  10295. }
  10296. int CPhmsSession::AddCaseToTag(string stringTagId, string stringTagName, string stringCaseId, string stringCaseType, string stringCaseTypeName, string stringPatientName)
  10297. {
  10298. AutoPtr<Document> pDoc = new Document;
  10299. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  10300. AutoPtr<Element> pRoot = pDoc->createElement("request");
  10301. AutoPtr<Element> pChildTagId = pDoc->createElement("favoritetid");
  10302. AutoPtr<Element> pChildTagName = pDoc->createElement("favoritetname");
  10303. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  10304. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  10305. AutoPtr<Element> pChildCaseTypeName = pDoc->createElement("casetypename");
  10306. AutoPtr<Element> pChildPatientName = pDoc->createElement("patientname");
  10307. AutoPtr<Text> pTextTagId = pDoc->createTextNode(stringTagId);
  10308. AutoPtr<Text> pTextTagName = pDoc->createTextNode(stringTagName);
  10309. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  10310. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  10311. AutoPtr<Text> pTextCaseTypeName = pDoc->createTextNode(stringCaseTypeName);
  10312. AutoPtr<Text> pTextPatientName = pDoc->createTextNode(stringPatientName);
  10313. pChildTagId->appendChild(pTextTagId);
  10314. pChildTagName->appendChild(pTextTagName);
  10315. pChildCaseId->appendChild(pTextCaseId);
  10316. pChildCaseType->appendChild(pTextCaseType);
  10317. pChildCaseTypeName->appendChild(pTextCaseTypeName);
  10318. pChildPatientName->appendChild(pTextPatientName);
  10319. pRoot->appendChild(pChildTagId);
  10320. pRoot->appendChild(pChildTagName);
  10321. pRoot->appendChild(pChildCaseId);
  10322. pRoot->appendChild(pChildCaseType);
  10323. pRoot->appendChild(pChildCaseTypeName);
  10324. pRoot->appendChild(pChildPatientName);
  10325. //pDoc->appendChild(pi);
  10326. pDoc->appendChild(pRoot);
  10327. string stringXmlContent;
  10328. int nRet = PHMS_SUCCESSFUL_RESULT;
  10329. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  10330. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10331. {
  10332. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10333. return nRet;
  10334. }
  10335. CPhmsRequestHead phmsRequestHead("10", "1135", m_stringSessionId, "11");
  10336. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  10337. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  10338. phmsRequest.GenerateAndSetSign();
  10339. CPhmsResponse phmsResponse;
  10340. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  10341. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10342. {
  10343. //写日志
  10344. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10345. return nRet;
  10346. }
  10347. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  10348. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10349. {
  10350. //写日志
  10351. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10352. return nRet;
  10353. }
  10354. return PHMS_SUCCESSFUL_RESULT;
  10355. }
  10356. int CPhmsSession::GetCaseListOfTag(string stringTagId, string stringSenderId, string stringCaseType)
  10357. {
  10358. AutoPtr<Document> pDoc = new Document;
  10359. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  10360. AutoPtr<Element> pRoot = pDoc->createElement("request");
  10361. AutoPtr<Element> pChildTagId = pDoc->createElement("tagid");
  10362. AutoPtr<Element> pChildSenderId = pDoc->createElement("senderid");
  10363. AutoPtr<Element> pChildCaseType = pDoc->createElement("casetype");
  10364. AutoPtr<Text> pTextTagId = pDoc->createTextNode(stringTagId);
  10365. AutoPtr<Text> pTextSenderId = pDoc->createTextNode(stringSenderId);
  10366. AutoPtr<Text> pTextCaseType = pDoc->createTextNode(stringCaseType);
  10367. pChildTagId->appendChild(pTextTagId);
  10368. pChildSenderId->appendChild(pTextSenderId);
  10369. pChildCaseType->appendChild(pTextCaseType);
  10370. pRoot->appendChild(pChildTagId);
  10371. pRoot->appendChild(pChildSenderId);
  10372. pRoot->appendChild(pChildCaseType);
  10373. //pDoc->appendChild(pi);
  10374. pDoc->appendChild(pRoot);
  10375. string stringXmlContent;
  10376. int nRet = PHMS_SUCCESSFUL_RESULT;
  10377. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  10378. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10379. {
  10380. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10381. return nRet;
  10382. }
  10383. CPhmsRequestHead phmsRequestHead("10", "1136", m_stringSessionId, "11");
  10384. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  10385. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  10386. phmsRequest.GenerateAndSetSign();
  10387. CPhmsResponse phmsResponse;
  10388. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  10389. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10390. {
  10391. //写日志
  10392. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10393. return nRet;
  10394. }
  10395. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  10396. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10397. {
  10398. //写日志
  10399. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10400. return nRet;
  10401. }
  10402. return PHMS_SUCCESSFUL_RESULT;
  10403. }
  10404. // int CPhmsSession::CreateSession_GuanXin(string stringUsername, string stringPassword)
  10405. // {
  10406. // map<string, string> mapParam;
  10407. // mapParam["username"] = stringUsername;
  10408. // mapParam["password"] = stringPassword;
  10409. // int nRet = PHMS_SUCCESSFUL_RESULT;
  10410. // this->SetGuanXinCommandType(SESSION);
  10411. // nRet = ExecuteGuanXinSession(mapParam);
  10412. // if(nRet != PHMS_SUCCESSFUL_RESULT)
  10413. // {
  10414. // //写日志
  10415. // CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10416. // return nRet;
  10417. // }
  10418. // return PHMS_SUCCESSFUL_RESULT;
  10419. // }
  10420. int CPhmsSession::GetAccessToken_GuanXin(string stringUsername, string stringPassword)
  10421. {
  10422. map<string, string> mapParam;
  10423. //mapParam["grant_type"]="password";
  10424. mapParam["username"] = stringUsername;
  10425. mapParam["password"] = stringPassword;
  10426. int nRet = PHMS_SUCCESSFUL_RESULT;
  10427. this->SetGuanXinCommandType(ACCESSTOKEN);
  10428. this->SetNetConfigType(GUANXIN_FORM);
  10429. nRet = ExecuteGuanXinSession(mapParam, "");
  10430. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10431. {
  10432. //写日志
  10433. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10434. return nRet;
  10435. }
  10436. return PHMS_SUCCESSFUL_RESULT;
  10437. }
  10438. int CPhmsSession::GetPersonInfo_GuanXin(string stringAccessToken, string stringPersonName, string stringPersonGender, string stringPersonIdentity, string stringPersonBirthDate)
  10439. {
  10440. // string stringJsonContent;
  10441. // Json::Value root;
  10442. // root["accessToken"] = stringAccessToken;
  10443. // root["personName"] = stringPersonName;
  10444. // root["personGender"] = stringPersonGender;
  10445. // root["personIdentity"] = stringPersonIdentity;
  10446. // root["personBirthDate"] = stringPersonBirthDate;
  10447. // stringJsonContent = root.toStyledString();
  10448. map<string, string> mapParam;
  10449. // mapParam["personInfo"]=stringJsonContent;
  10450. mapParam["accessToken"] = stringAccessToken;
  10451. mapParam["personName"] = stringPersonName;
  10452. mapParam["personGender"] = stringPersonGender;
  10453. mapParam["personIdentity"] = stringPersonIdentity;
  10454. mapParam["personBirthDate"] = stringPersonBirthDate;
  10455. int nRet = PHMS_SUCCESSFUL_RESULT;
  10456. this->SetGuanXinCommandType(PERSONINFO);
  10457. this->SetNetConfigType(GUANXIN_FORM);
  10458. nRet = ExecuteGuanXinSession(mapParam, "");
  10459. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10460. {
  10461. //写日志
  10462. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10463. return nRet;
  10464. }
  10465. return PHMS_SUCCESSFUL_RESULT;
  10466. }
  10467. int CPhmsSession::UploadECGData_GuanXin(string stringECGXmlPath, string stringECGDataPath)
  10468. {
  10469. map<string, string> mapParam;
  10470. int nRet = PHMS_SUCCESSFUL_RESULT;
  10471. if(stringECGDataPath.size()==0 || CUtil::GetFileSize(stringECGDataPath)==0)
  10472. {
  10473. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_OPEN_FAIL), __FUNCTION__, __FILE__, __LINE__);
  10474. return COMMON_FILE_OPEN_FAIL;
  10475. }
  10476. ifstream iFStream;
  10477. ostringstream oStringStream;
  10478. iFStream.open(stringECGXmlPath.c_str());
  10479. StreamCopier::copyStream(iFStream, oStringStream);
  10480. iFStream.close();
  10481. string stringXmlContent = oStringStream.str();
  10482. nRet = CUtil::GetMapFromRequestXml(stringXmlContent, "root", mapParam);
  10483. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10484. {
  10485. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10486. return nRet;
  10487. }
  10488. this->SetGuanXinCommandType(UPLOADECG);
  10489. this->SetNetConfigType(GUANXIN_FORM);
  10490. nRet = ExecuteGuanXinSession(mapParam, stringECGDataPath);
  10491. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10492. {
  10493. //写日志
  10494. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10495. return nRet;
  10496. }
  10497. return PHMS_SUCCESSFUL_RESULT;
  10498. }
  10499. int CPhmsSession::UploadOtherData_GuanXin(string stringOtherXmlPath)
  10500. {
  10501. map<string, string> mapParam;
  10502. int nRet = PHMS_SUCCESSFUL_RESULT;
  10503. if(stringOtherXmlPath.size()==0 || CUtil::GetFileSize(stringOtherXmlPath)==0)
  10504. {
  10505. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_OPEN_FAIL), __FUNCTION__, __FILE__, __LINE__);
  10506. return COMMON_FILE_OPEN_FAIL;
  10507. }
  10508. ifstream iFStream;
  10509. ostringstream oStringStream;
  10510. iFStream.open(stringOtherXmlPath.c_str());
  10511. StreamCopier::copyStream(iFStream, oStringStream);
  10512. iFStream.close();
  10513. string stringXmlContent = oStringStream.str();
  10514. nRet = CUtil::GetMapFromRequestXml(stringXmlContent, "root", mapParam);
  10515. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10516. {
  10517. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10518. return nRet;
  10519. }
  10520. this->SetGuanXinCommandType(UPLOADNONECG);
  10521. this->SetNetConfigType(GUANXIN_FORM);
  10522. nRet = ExecuteGuanXinSession(mapParam, "");
  10523. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10524. {
  10525. //写日志
  10526. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10527. return nRet;
  10528. }
  10529. return PHMS_SUCCESSFUL_RESULT;
  10530. }
  10531. int CPhmsSession::UploadCheckData_GuanXin(string stringCheckXmlPath)
  10532. {
  10533. map<string, string> mapParam;
  10534. int nRet = PHMS_SUCCESSFUL_RESULT;
  10535. if(stringCheckXmlPath.size()==0 || CUtil::GetFileSize(stringCheckXmlPath)==0)
  10536. {
  10537. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_OPEN_FAIL), __FUNCTION__, __FILE__, __LINE__);
  10538. return COMMON_FILE_OPEN_FAIL;
  10539. }
  10540. ifstream iFStream;
  10541. ostringstream oStringStream;
  10542. iFStream.open(stringCheckXmlPath.c_str());
  10543. StreamCopier::copyStream(iFStream, oStringStream);
  10544. iFStream.close();
  10545. string stringXmlContent = oStringStream.str();
  10546. nRet = CUtil::GetMapFromRequestXml(stringXmlContent, "root", mapParam);
  10547. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10548. {
  10549. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10550. return nRet;
  10551. }
  10552. this->SetGuanXinCommandType(UPLOADMONITOR);
  10553. this->SetNetConfigType(GUANXIN_FORM);
  10554. nRet = ExecuteGuanXinSession(mapParam, "");
  10555. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10556. {
  10557. //写日志
  10558. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10559. return nRet;
  10560. }
  10561. return PHMS_SUCCESSFUL_RESULT;
  10562. }
  10563. int CPhmsSession::UploadPersonInfo_GuanXin(string stringPersonInfoXmlPath)
  10564. {
  10565. map<string, string> mapParam;
  10566. int nRet = PHMS_SUCCESSFUL_RESULT;
  10567. if(stringPersonInfoXmlPath.size()==0 || CUtil::GetFileSize(stringPersonInfoXmlPath)==0)
  10568. {
  10569. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_FILE_OPEN_FAIL), __FUNCTION__, __FILE__, __LINE__);
  10570. return COMMON_FILE_OPEN_FAIL;
  10571. }
  10572. ifstream iFStream;
  10573. ostringstream oStringStream;
  10574. iFStream.open(stringPersonInfoXmlPath.c_str());
  10575. StreamCopier::copyStream(iFStream, oStringStream);
  10576. iFStream.close();
  10577. string stringXmlContent = oStringStream.str();
  10578. nRet = CUtil::GetMapFromRequestXml(stringXmlContent, "root", mapParam);
  10579. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10580. {
  10581. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10582. return nRet;
  10583. }
  10584. this->SetGuanXinCommandType(UPLOADPERSONINFO);
  10585. this->SetNetConfigType(GUANXIN_FORM);
  10586. nRet = ExecuteGuanXinSession(mapParam, "");
  10587. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10588. {
  10589. //写日志
  10590. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10591. return nRet;
  10592. }
  10593. return PHMS_SUCCESSFUL_RESULT;
  10594. }
  10595. int CPhmsSession::SetCliniqueState(string stringCliniqueId, string stringState)
  10596. {
  10597. AutoPtr<Document> pDoc = new Document;
  10598. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  10599. AutoPtr<Element> pRoot = pDoc->createElement("request");
  10600. AutoPtr<Element> pChildCliniqueId = pDoc->createElement("unitid");
  10601. AutoPtr<Element> pChildState = pDoc->createElement("state");
  10602. AutoPtr<Text> pTextCliniqueId = pDoc->createTextNode(stringCliniqueId);
  10603. AutoPtr<Text> pTextState = pDoc->createTextNode(stringState);
  10604. pChildCliniqueId->appendChild(pTextCliniqueId);
  10605. pChildState->appendChild(pTextState);
  10606. pRoot->appendChild(pChildCliniqueId);
  10607. pRoot->appendChild(pChildState);
  10608. //pDoc->appendChild(pi);
  10609. pDoc->appendChild(pRoot);
  10610. string stringXmlContent;
  10611. int nRet = PHMS_SUCCESSFUL_RESULT;
  10612. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  10613. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10614. {
  10615. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10616. return nRet;
  10617. }
  10618. string stringSessionId(32, '0');
  10619. if(m_stringSessionId.size() != 0)
  10620. {
  10621. stringSessionId = m_stringSessionId;
  10622. }
  10623. CPhmsRequestHead phmsRequestHead("10", "2201", stringSessionId, "11");
  10624. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  10625. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  10626. if(m_stringSessionId.size() != 0)
  10627. {
  10628. phmsRequest.GenerateAndSetSign();
  10629. }
  10630. CPhmsResponse phmsResponse;
  10631. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  10632. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10633. {
  10634. //写日志
  10635. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10636. return nRet;
  10637. }
  10638. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  10639. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10640. {
  10641. //写日志
  10642. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10643. return nRet;
  10644. }
  10645. return PHMS_SUCCESSFUL_RESULT;
  10646. }
  10647. int CPhmsSession::GetPatientInfoByAppNum(string stringHospitalId, string stringOrderType, string stringOrderId, string stringReqDepart, string stringOrderState, string stringCheckType, string stringStartDate, string stringEndDate, string stringClinicId)
  10648. {
  10649. AutoPtr<Document> pDoc = new Document;
  10650. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  10651. AutoPtr<Element> pRoot = pDoc->createElement("request");
  10652. AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
  10653. AutoPtr<Element> pChildOrderType = pDoc->createElement("order_type");
  10654. AutoPtr<Element> pChildOrderId = pDoc->createElement("order_id");
  10655. AutoPtr<Element> pChildReqDepart = pDoc->createElement("req_depart");
  10656. AutoPtr<Element> pChildOrderState = pDoc->createElement("order_state");
  10657. AutoPtr<Element> pChildCheckType = pDoc->createElement("check_type");
  10658. AutoPtr<Element> pChildStartDate = pDoc->createElement("startdate");
  10659. AutoPtr<Element> pChildEndDate = pDoc->createElement("enddate");
  10660. AutoPtr<Element> pClinicId = pDoc->createElement("clinic_id");
  10661. AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
  10662. AutoPtr<Text> pTextOrderType = pDoc->createTextNode(stringOrderType);
  10663. AutoPtr<Text> pTextOrderId = pDoc->createTextNode(stringOrderId);
  10664. AutoPtr<Text> pTextReqDepart = pDoc->createTextNode(stringReqDepart);
  10665. AutoPtr<Text> pTextOrderState = pDoc->createTextNode(stringOrderState);
  10666. AutoPtr<Text> pTextCheckType = pDoc->createTextNode(stringCheckType);
  10667. AutoPtr<Text> pTextStartDate = pDoc->createTextNode(stringStartDate);
  10668. AutoPtr<Text> pTextEndDate = pDoc->createTextNode(stringEndDate);
  10669. AutoPtr<Text> pTextClinicId = pDoc->createTextNode(stringClinicId);
  10670. pChildHospitalId->appendChild(pTextHospitalId);
  10671. pChildOrderType->appendChild(pTextOrderType);
  10672. pChildOrderId->appendChild(pTextOrderId);
  10673. pChildReqDepart->appendChild(pTextReqDepart);
  10674. pChildOrderState->appendChild(pTextOrderState);
  10675. pChildCheckType->appendChild(pTextCheckType);
  10676. pChildStartDate->appendChild(pTextStartDate);
  10677. pChildEndDate->appendChild(pTextEndDate);
  10678. pClinicId->appendChild(pTextClinicId);
  10679. pRoot->appendChild(pChildHospitalId);
  10680. pRoot->appendChild(pChildOrderType);
  10681. pRoot->appendChild(pChildOrderId);
  10682. pRoot->appendChild(pChildReqDepart);
  10683. pRoot->appendChild(pChildOrderState);
  10684. pRoot->appendChild(pChildCheckType);
  10685. pRoot->appendChild(pChildStartDate);
  10686. pRoot->appendChild(pChildEndDate);
  10687. pRoot->appendChild(pClinicId);
  10688. //pDoc->appendChild(pi);
  10689. pDoc->appendChild(pRoot);
  10690. string stringXmlContent;
  10691. int nRet = PHMS_SUCCESSFUL_RESULT;
  10692. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  10693. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10694. {
  10695. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10696. return nRet;
  10697. }
  10698. string stringSessionId(32, '0');
  10699. if(m_stringSessionId.size() != 0)
  10700. {
  10701. stringSessionId = m_stringSessionId;
  10702. }
  10703. CPhmsRequestHead phmsRequestHead("10", "2202", stringSessionId, "11");
  10704. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  10705. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  10706. if(m_stringSessionId.size() != 0)
  10707. {
  10708. phmsRequest.GenerateAndSetSign();
  10709. }
  10710. CPhmsResponse phmsResponse;
  10711. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  10712. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10713. {
  10714. //写日志
  10715. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10716. return nRet;
  10717. }
  10718. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  10719. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10720. {
  10721. //写日志
  10722. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10723. return nRet;
  10724. }
  10725. return PHMS_SUCCESSFUL_RESULT;
  10726. }
  10727. int CPhmsSession::GetPatientInfoByAppNumToHis(string stringHospitalId, string stringOrderType, string stringOrderId)
  10728. {
  10729. int nRet = PHMS_SUCCESSFUL_RESULT;
  10730. string stringId;
  10731. string stringIdType;
  10732. nRet = CUtil::ParseStandardQueryString(stringOrderId, stringId, stringIdType);
  10733. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10734. {
  10735. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10736. return nRet;
  10737. }
  10738. AutoPtr<Document> pDoc = new Document;
  10739. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  10740. AutoPtr<Element> pRoot = pDoc->createElement("request");
  10741. AutoPtr<Element> pChildId = pDoc->createElement("id");
  10742. AutoPtr<Element> pChildIdType = pDoc->createElement("id_type");
  10743. AutoPtr<Element> pChildOrderType = pDoc->createElement("order_type");
  10744. AutoPtr<Text> pTextId = pDoc->createTextNode(stringId);
  10745. AutoPtr<Text> pTextIdType = pDoc->createTextNode(stringIdType);
  10746. AutoPtr<Text> pTextOrderType = pDoc->createTextNode(stringOrderType);
  10747. pChildId->appendChild(pTextId);
  10748. pChildIdType->appendChild(pTextIdType);
  10749. pChildOrderType->appendChild(pTextOrderType);
  10750. pRoot->appendChild(pChildId);
  10751. pRoot->appendChild(pChildIdType);
  10752. pRoot->appendChild(pChildOrderType);
  10753. //pDoc->appendChild(pi);
  10754. pDoc->appendChild(pRoot);
  10755. string stringXmlContent;
  10756. nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
  10757. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10758. {
  10759. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10760. return nRet;
  10761. }
  10762. this->SetNetConfigType(DIRECTLY_TO_HIS);
  10763. //暂时使用GetXmlNetConfig读取网络配置,所以不能与导医服务器连用,其实应该有类似SetXmlCommandType的SetXmlServer/Port
  10764. //而且SSL采用通用配置,不能单独配置
  10765. nRet = ExecuteXmlSession(stringXmlContent);
  10766. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10767. {
  10768. //写日志
  10769. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10770. return nRet;
  10771. }
  10772. return PHMS_SUCCESSFUL_RESULT;
  10773. }
  10774. int CPhmsSession::GetPatientInfoByAppNumToPhmsAndHis(string stringHospitalId, string stringOrderType, string stringOrderId)
  10775. {
  10776. this->SetNetConfigType(DIRECTLY_TO_HIS);
  10777. return this->GetPatientInfoByAppNum(stringHospitalId, stringOrderType, stringOrderId, "", "", "", "", "", "");
  10778. }
  10779. int CPhmsSession::ApplyCheck(string stringCliniqueId, string stringOrderId, string stringOrderType)
  10780. {
  10781. AutoPtr<Document> pDoc = new Document;
  10782. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  10783. AutoPtr<Element> pRoot = pDoc->createElement("request");
  10784. AutoPtr<Element> pChildCliniqueId = pDoc->createElement("unitid");
  10785. AutoPtr<Element> pChildOrderType = pDoc->createElement("order_type");
  10786. AutoPtr<Element> pChildOrderId = pDoc->createElement("order_id");
  10787. AutoPtr<Text> pTextCliniqueId = pDoc->createTextNode(stringCliniqueId);
  10788. AutoPtr<Text> pTextOrderType = pDoc->createTextNode(stringOrderType);
  10789. AutoPtr<Text> pTextOrderId = pDoc->createTextNode(stringOrderId);
  10790. pChildCliniqueId->appendChild(pTextCliniqueId);
  10791. pChildOrderType->appendChild(pTextOrderType);
  10792. pChildOrderId->appendChild(pTextOrderId);
  10793. pRoot->appendChild(pChildCliniqueId);
  10794. pRoot->appendChild(pChildOrderType);
  10795. pRoot->appendChild(pChildOrderId);
  10796. //pDoc->appendChild(pi);
  10797. pDoc->appendChild(pRoot);
  10798. string stringXmlContent;
  10799. int nRet = PHMS_SUCCESSFUL_RESULT;
  10800. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  10801. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10802. {
  10803. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10804. return nRet;
  10805. }
  10806. string stringSessionId(32, '0');
  10807. if(m_stringSessionId.size() != 0)
  10808. {
  10809. stringSessionId = m_stringSessionId;
  10810. }
  10811. CPhmsRequestHead phmsRequestHead("10", "2203", stringSessionId, "11");
  10812. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  10813. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  10814. if(m_stringSessionId.size() != 0)
  10815. {
  10816. phmsRequest.GenerateAndSetSign();
  10817. }
  10818. CPhmsResponse phmsResponse;
  10819. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  10820. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10821. {
  10822. //写日志
  10823. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10824. return nRet;
  10825. }
  10826. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  10827. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10828. {
  10829. //写日志
  10830. if(nRet != 220303)
  10831. {
  10832. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10833. }
  10834. return nRet;
  10835. }
  10836. return PHMS_SUCCESSFUL_RESULT;
  10837. }
  10838. int CPhmsSession::GetWaitingCheck(string stringCliniqueId)
  10839. {
  10840. AutoPtr<Document> pDoc = new Document;
  10841. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  10842. AutoPtr<Element> pRoot = pDoc->createElement("request");
  10843. AutoPtr<Element> pChildCliniqueId = pDoc->createElement("unitid");
  10844. AutoPtr<Text> pTextCliniqueId = pDoc->createTextNode(stringCliniqueId);
  10845. pChildCliniqueId->appendChild(pTextCliniqueId);
  10846. pRoot->appendChild(pChildCliniqueId);
  10847. //pDoc->appendChild(pi);
  10848. pDoc->appendChild(pRoot);
  10849. string stringXmlContent;
  10850. int nRet = PHMS_SUCCESSFUL_RESULT;
  10851. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  10852. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10853. {
  10854. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10855. return nRet;
  10856. }
  10857. string stringSessionId(32, '0');
  10858. if(m_stringSessionId.size() != 0)
  10859. {
  10860. stringSessionId = m_stringSessionId;
  10861. }
  10862. CPhmsRequestHead phmsRequestHead("10", "2204", stringSessionId, "11");
  10863. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  10864. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  10865. if(m_stringSessionId.size() != 0)
  10866. {
  10867. phmsRequest.GenerateAndSetSign();
  10868. }
  10869. CPhmsResponse phmsResponse;
  10870. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  10871. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10872. {
  10873. //写日志
  10874. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10875. return nRet;
  10876. }
  10877. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  10878. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10879. {
  10880. //写日志
  10881. if(nRet!=220403 && nRet!=220405)
  10882. {
  10883. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10884. }
  10885. return nRet;
  10886. }
  10887. return PHMS_SUCCESSFUL_RESULT;
  10888. }
  10889. int CPhmsSession::GetCliniqueState(string stringCliniqueId)
  10890. {
  10891. AutoPtr<Document> pDoc = new Document;
  10892. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  10893. AutoPtr<Element> pRoot = pDoc->createElement("request");
  10894. AutoPtr<Element> pChildCliniqueId = pDoc->createElement("unitid");
  10895. AutoPtr<Text> pTextCliniqueId = pDoc->createTextNode(stringCliniqueId);
  10896. pChildCliniqueId->appendChild(pTextCliniqueId);
  10897. pRoot->appendChild(pChildCliniqueId);
  10898. //pDoc->appendChild(pi);
  10899. pDoc->appendChild(pRoot);
  10900. string stringXmlContent;
  10901. int nRet = PHMS_SUCCESSFUL_RESULT;
  10902. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  10903. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10904. {
  10905. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10906. return nRet;
  10907. }
  10908. string stringSessionId(32, '0');
  10909. if(m_stringSessionId.size() != 0)
  10910. {
  10911. stringSessionId = m_stringSessionId;
  10912. }
  10913. CPhmsRequestHead phmsRequestHead("10", "2205", stringSessionId, "11");
  10914. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  10915. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  10916. if(m_stringSessionId.size() != 0)
  10917. {
  10918. phmsRequest.GenerateAndSetSign();
  10919. }
  10920. CPhmsResponse phmsResponse;
  10921. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  10922. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10923. {
  10924. //写日志
  10925. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10926. return nRet;
  10927. }
  10928. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  10929. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10930. {
  10931. //写日志
  10932. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10933. return nRet;
  10934. }
  10935. return PHMS_SUCCESSFUL_RESULT;
  10936. }
  10937. int CPhmsSession::NotifyCaseState(string stringHospitalId, string stringOrderType, string stringOrderId)
  10938. {
  10939. AutoPtr<Document> pDoc = new Document;
  10940. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  10941. AutoPtr<Element> pRoot = pDoc->createElement("request");
  10942. AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
  10943. AutoPtr<Element> pChildOrderType = pDoc->createElement("order_type");
  10944. AutoPtr<Element> pChildOrderId = pDoc->createElement("order_id");
  10945. AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
  10946. AutoPtr<Text> pTextOrderType = pDoc->createTextNode(stringOrderType);
  10947. AutoPtr<Text> pTextOrderId = pDoc->createTextNode(stringOrderId);
  10948. pChildHospitalId->appendChild(pTextHospitalId);
  10949. pChildOrderType->appendChild(pTextOrderType);
  10950. pChildOrderId->appendChild(pTextOrderId);
  10951. pRoot->appendChild(pChildHospitalId);
  10952. pRoot->appendChild(pChildOrderType);
  10953. pRoot->appendChild(pChildOrderId);
  10954. //pDoc->appendChild(pi);
  10955. pDoc->appendChild(pRoot);
  10956. string stringXmlContent;
  10957. int nRet = PHMS_SUCCESSFUL_RESULT;
  10958. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  10959. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10960. {
  10961. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10962. return nRet;
  10963. }
  10964. string stringSessionId(32, '0');
  10965. if(m_stringSessionId.size() != 0)
  10966. {
  10967. stringSessionId = m_stringSessionId;
  10968. }
  10969. CPhmsRequestHead phmsRequestHead("10", "2206", stringSessionId, "11");
  10970. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  10971. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  10972. if(m_stringSessionId.size() != 0)
  10973. {
  10974. phmsRequest.GenerateAndSetSign();
  10975. }
  10976. CPhmsResponse phmsResponse;
  10977. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  10978. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10979. {
  10980. //写日志
  10981. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10982. return nRet;
  10983. }
  10984. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  10985. if(nRet != PHMS_SUCCESSFUL_RESULT)
  10986. {
  10987. //写日志
  10988. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  10989. return nRet;
  10990. }
  10991. return PHMS_SUCCESSFUL_RESULT;
  10992. }
  10993. int CPhmsSession::NotifyReportState(string stringReportId)
  10994. {
  10995. AutoPtr<Document> pDoc = new Document;
  10996. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  10997. AutoPtr<Element> pRoot = pDoc->createElement("request");
  10998. AutoPtr<Element> pChildReportId = pDoc->createElement("reportid");
  10999. AutoPtr<Text> pTextReportId = pDoc->createTextNode(stringReportId);
  11000. pChildReportId->appendChild(pTextReportId);
  11001. pRoot->appendChild(pChildReportId);
  11002. //pDoc->appendChild(pi);
  11003. pDoc->appendChild(pRoot);
  11004. string stringXmlContent;
  11005. int nRet = PHMS_SUCCESSFUL_RESULT;
  11006. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  11007. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11008. {
  11009. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11010. return nRet;
  11011. }
  11012. string stringSessionId(32, '0');
  11013. if(m_stringSessionId.size() != 0)
  11014. {
  11015. stringSessionId = m_stringSessionId;
  11016. }
  11017. CPhmsRequestHead phmsRequestHead("10", "2207", stringSessionId, "11");
  11018. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  11019. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  11020. if(m_stringSessionId.size() != 0)
  11021. {
  11022. phmsRequest.GenerateAndSetSign();
  11023. }
  11024. CPhmsResponse phmsResponse;
  11025. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  11026. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11027. {
  11028. //写日志
  11029. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11030. return nRet;
  11031. }
  11032. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  11033. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11034. {
  11035. //写日志
  11036. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11037. return nRet;
  11038. }
  11039. return PHMS_SUCCESSFUL_RESULT;
  11040. }
  11041. int CPhmsSession::NotifyAppState(string stringUnitId, string stringOrderId, string stringOrderType, string stringState)
  11042. {
  11043. AutoPtr<Document> pDoc = new Document;
  11044. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  11045. AutoPtr<Element> pRoot = pDoc->createElement("request");
  11046. AutoPtr<Element> pChildUnitId = pDoc->createElement("unitid");
  11047. AutoPtr<Element> pChildOrderId = pDoc->createElement("order_id");
  11048. AutoPtr<Element> pChildOrderType = pDoc->createElement("order_type");
  11049. AutoPtr<Element> pChildState = pDoc->createElement("state");
  11050. AutoPtr<Text> pTextUnitId = pDoc->createTextNode(stringUnitId);
  11051. AutoPtr<Text> pTextOrderType = pDoc->createTextNode(stringOrderType);
  11052. AutoPtr<Text> pTextOrderId = pDoc->createTextNode(stringOrderId);
  11053. AutoPtr<Text> pTextState = pDoc->createTextNode(stringState);
  11054. pChildUnitId->appendChild(pTextUnitId);
  11055. pChildOrderType->appendChild(pTextOrderType);
  11056. pChildOrderId->appendChild(pTextOrderId);
  11057. pChildState->appendChild(pTextState);
  11058. pRoot->appendChild(pChildUnitId);
  11059. pRoot->appendChild(pChildOrderId);
  11060. pRoot->appendChild(pChildOrderType);
  11061. pRoot->appendChild(pChildState);
  11062. //pDoc->appendChild(pi);
  11063. pDoc->appendChild(pRoot);
  11064. string stringXmlContent;
  11065. int nRet = PHMS_SUCCESSFUL_RESULT;
  11066. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  11067. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11068. {
  11069. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11070. return nRet;
  11071. }
  11072. string stringSessionId(32, '0');
  11073. if(m_stringSessionId.size() != 0)
  11074. {
  11075. stringSessionId = m_stringSessionId;
  11076. }
  11077. CPhmsRequestHead phmsRequestHead("10", "2208", stringSessionId, "11");
  11078. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  11079. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  11080. if(m_stringSessionId.size() != 0)
  11081. {
  11082. phmsRequest.GenerateAndSetSign();
  11083. }
  11084. CPhmsResponse phmsResponse;
  11085. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  11086. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11087. {
  11088. //写日志
  11089. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11090. return nRet;
  11091. }
  11092. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  11093. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11094. {
  11095. //写日志
  11096. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11097. return nRet;
  11098. }
  11099. return PHMS_SUCCESSFUL_RESULT;
  11100. }
  11101. int CPhmsSession::VerifyAppState(string stringOrderId, string stringOrderType)
  11102. {
  11103. AutoPtr<Document> pDoc = new Document;
  11104. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  11105. AutoPtr<Element> pRoot = pDoc->createElement("request");
  11106. AutoPtr<Element> pChildOrderId = pDoc->createElement("order_id");
  11107. AutoPtr<Element> pChildOrderType = pDoc->createElement("order_type");
  11108. AutoPtr<Text> pTextOrderType = pDoc->createTextNode(stringOrderType);
  11109. AutoPtr<Text> pTextOrderId = pDoc->createTextNode(stringOrderId);
  11110. pChildOrderType->appendChild(pTextOrderType);
  11111. pChildOrderId->appendChild(pTextOrderId);
  11112. pRoot->appendChild(pChildOrderId);
  11113. pRoot->appendChild(pChildOrderType);
  11114. //pDoc->appendChild(pi);
  11115. pDoc->appendChild(pRoot);
  11116. string stringXmlContent;
  11117. int nRet = PHMS_SUCCESSFUL_RESULT;
  11118. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  11119. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11120. {
  11121. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11122. return nRet;
  11123. }
  11124. string stringSessionId(32, '0');
  11125. if(m_stringSessionId.size() != 0)
  11126. {
  11127. stringSessionId = m_stringSessionId;
  11128. }
  11129. CPhmsRequestHead phmsRequestHead("10", "2209", stringSessionId, "11");
  11130. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  11131. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  11132. if(m_stringSessionId.size() != 0)
  11133. {
  11134. phmsRequest.GenerateAndSetSign();
  11135. }
  11136. CPhmsResponse phmsResponse;
  11137. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  11138. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11139. {
  11140. //写日志
  11141. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11142. return nRet;
  11143. }
  11144. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  11145. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11146. {
  11147. //写日志
  11148. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11149. return nRet;
  11150. }
  11151. return PHMS_SUCCESSFUL_RESULT;
  11152. }
  11153. int CPhmsSession::GetHisReportState(string stringHospitalId, string stringOrderType, string stringOrderId)
  11154. {
  11155. AutoPtr<Document> pDoc = new Document;
  11156. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  11157. AutoPtr<Element> pRoot = pDoc->createElement("request");
  11158. AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
  11159. AutoPtr<Element> pChildOrderType = pDoc->createElement("order_type");
  11160. AutoPtr<Element> pChildOrderId = pDoc->createElement("order_id");
  11161. AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
  11162. AutoPtr<Text> pTextOrderType = pDoc->createTextNode(stringOrderType);
  11163. AutoPtr<Text> pTextOrderId = pDoc->createTextNode(stringOrderId);
  11164. pChildHospitalId->appendChild(pTextHospitalId);
  11165. pChildOrderType->appendChild(pTextOrderType);
  11166. pChildOrderId->appendChild(pTextOrderId);
  11167. pRoot->appendChild(pChildHospitalId);
  11168. pRoot->appendChild(pChildOrderType);
  11169. pRoot->appendChild(pChildOrderId);
  11170. //pDoc->appendChild(pi);
  11171. pDoc->appendChild(pRoot);
  11172. string stringXmlContent;
  11173. int nRet = PHMS_SUCCESSFUL_RESULT;
  11174. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  11175. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11176. {
  11177. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11178. return nRet;
  11179. }
  11180. string stringSessionId(32, '0');
  11181. if(m_stringSessionId.size() != 0)
  11182. {
  11183. stringSessionId = m_stringSessionId;
  11184. }
  11185. CPhmsRequestHead phmsRequestHead("10", "2211", stringSessionId, "11");
  11186. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  11187. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  11188. if(m_stringSessionId.size() != 0)
  11189. {
  11190. phmsRequest.GenerateAndSetSign();
  11191. }
  11192. CPhmsResponse phmsResponse;
  11193. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  11194. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11195. {
  11196. //写日志
  11197. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11198. return nRet;
  11199. }
  11200. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  11201. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11202. {
  11203. //写日志
  11204. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11205. return nRet;
  11206. }
  11207. return PHMS_SUCCESSFUL_RESULT;
  11208. }
  11209. int CPhmsSession::SetHisCriticalValue(string stringHospitalId, string stringCaseId, string stringCriticalValues)
  11210. {
  11211. AutoPtr<Document> pDoc = new Document;
  11212. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  11213. AutoPtr<Element> pRoot = pDoc->createElement("request");
  11214. AutoPtr<Element> pChildHospitalId = pDoc->createElement("hospitalid");
  11215. AutoPtr<Element> pChildCaseId = pDoc->createElement("caseid");
  11216. AutoPtr<Element> pChildCriticalValues = pDoc->createElement("critical_values");
  11217. AutoPtr<Text> pTextHospitalId = pDoc->createTextNode(stringHospitalId);
  11218. AutoPtr<Text> pTextCaseId = pDoc->createTextNode(stringCaseId);
  11219. AutoPtr<Text> pTextCriticalValues = pDoc->createTextNode(stringCriticalValues);
  11220. pChildHospitalId->appendChild(pTextHospitalId);
  11221. pChildCaseId->appendChild(pTextCaseId);
  11222. pChildCriticalValues->appendChild(pTextCriticalValues);
  11223. pRoot->appendChild(pChildHospitalId);
  11224. pRoot->appendChild(pChildCaseId);
  11225. pRoot->appendChild(pChildCriticalValues);
  11226. //pDoc->appendChild(pi);
  11227. pDoc->appendChild(pRoot);
  11228. string stringXmlContent;
  11229. int nRet = PHMS_SUCCESSFUL_RESULT;
  11230. nRet = this->GetRequestXml(pDoc, stringXmlContent);
  11231. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11232. {
  11233. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11234. return nRet;
  11235. }
  11236. string stringSessionId(32, '0');
  11237. if(m_stringSessionId.size() != 0)
  11238. {
  11239. stringSessionId = m_stringSessionId;
  11240. }
  11241. CPhmsRequestHead phmsRequestHead("10", "2212", stringSessionId, "11");
  11242. CPhmsRequestBody phmsRequestBody(stringXmlContent);
  11243. CPhmsRequest phmsRequest(phmsRequestHead, phmsRequestBody, "");
  11244. if(m_stringSessionId.size() != 0)
  11245. {
  11246. phmsRequest.GenerateAndSetSign();
  11247. }
  11248. CPhmsResponse phmsResponse;
  11249. nRet = ExecutePhmsSession(phmsRequest, phmsResponse);
  11250. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11251. {
  11252. //写日志
  11253. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11254. return nRet;
  11255. }
  11256. nRet = phmsResponse.GetResult(m_nSaveType, m_stringContent, m_stringFilePath);
  11257. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11258. {
  11259. //写日志
  11260. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11261. return nRet;
  11262. }
  11263. return PHMS_SUCCESSFUL_RESULT;
  11264. }
  11265. int CPhmsSession::GetDoctorList_999120(string stringKtCliniqueId, string stringCaseTypeId)
  11266. {
  11267. AutoPtr<Document> pDoc = new Document;
  11268. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  11269. AutoPtr<Element> pRoot = pDoc->createElement("request");
  11270. AutoPtr<Element> pChildTopic = pDoc->createElement("topic");
  11271. AutoPtr<Element> pChildDetail = pDoc->createElement("detail");
  11272. AutoPtr<Element> pChildSign = pDoc->createElement("sign");
  11273. AutoPtr<Element> pGrandChildVersion = pDoc->createElement("version");
  11274. AutoPtr<Element> pGrandChildCharset = pDoc->createElement("charset");
  11275. AutoPtr<Element> pGrandChildDevice = pDoc->createElement("device");
  11276. AutoPtr<Element> pGrandChildKtCliniqueId = pDoc->createElement("kt_cliniqueid");
  11277. AutoPtr<Element> pGrandChildSignContent = pDoc->createElement("signcontent");
  11278. AutoPtr<Text> pTextVersion = pDoc->createTextNode("1.0");
  11279. AutoPtr<Text> pTextCharset = pDoc->createTextNode("GBK");
  11280. AutoPtr<Text> pTextDevice = pDoc->createTextNode(stringCaseTypeId);
  11281. AutoPtr<Text> pTextKtCliniqueId = pDoc->createTextNode(stringKtCliniqueId);
  11282. string stringSignSrc;
  11283. stringSignSrc = "version=1.0&charset=GBK";
  11284. stringSignSrc += "&kt_cliniqueid=";
  11285. stringSignSrc += stringKtCliniqueId;
  11286. stringSignSrc += "&device=";
  11287. stringSignSrc += stringCaseTypeId;
  11288. stringSignSrc += "&poskey=";
  11289. stringSignSrc += m_stringKey;
  11290. // std::cout<<stringSignSrc<<std::endl;
  11291. AutoPtr<Text> pTextSignContent = pDoc->createTextNode(CUtil::GetMd5(stringSignSrc.c_str(), stringSignSrc.size()));
  11292. pGrandChildVersion->appendChild(pTextVersion);
  11293. pGrandChildCharset->appendChild(pTextCharset);
  11294. pGrandChildDevice->appendChild(pTextDevice);
  11295. pGrandChildKtCliniqueId->appendChild(pTextKtCliniqueId);
  11296. pGrandChildSignContent->appendChild(pTextSignContent);
  11297. pChildTopic->appendChild(pGrandChildVersion);
  11298. pChildTopic->appendChild(pGrandChildCharset);
  11299. pChildTopic->appendChild(pGrandChildDevice);
  11300. pChildDetail->appendChild(pGrandChildKtCliniqueId);
  11301. pChildSign->appendChild(pGrandChildSignContent);
  11302. pRoot->appendChild(pChildTopic);
  11303. pRoot->appendChild(pChildDetail);
  11304. pRoot->appendChild(pChildSign);
  11305. //pDoc->appendChild(pi);
  11306. pDoc->appendChild(pRoot);
  11307. string stringXmlContent;
  11308. int nRet = PHMS_SUCCESSFUL_RESULT;
  11309. nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
  11310. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11311. {
  11312. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11313. return nRet;
  11314. }
  11315. this->SetXmlCommandType(SELECT_DOCTOR_TYPE);
  11316. this->SetNetConfigType(DAOYI_XML);
  11317. nRet = ExecuteXmlSession(stringXmlContent);
  11318. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11319. {
  11320. //写日志
  11321. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11322. return nRet;
  11323. }
  11324. return PHMS_SUCCESSFUL_RESULT;
  11325. }
  11326. int CPhmsSession::ValidatePay_999120(string stringConsumeId, string stringKtCliniqueId, string stringCardNumber, string stringKtDoctorId, string stringConsumeMoney, string stringCaseTypeId)
  11327. {
  11328. AutoPtr<Document> pDoc = new Document;
  11329. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  11330. AutoPtr<Element> pRoot = pDoc->createElement("request");
  11331. AutoPtr<Element> pChildTopic = pDoc->createElement("topic");
  11332. AutoPtr<Element> pChildDetail = pDoc->createElement("detail");
  11333. AutoPtr<Element> pChildSign = pDoc->createElement("sign");
  11334. AutoPtr<Element> pGrandChildVersion = pDoc->createElement("version");
  11335. AutoPtr<Element> pGrandChildCharset = pDoc->createElement("charset");
  11336. AutoPtr<Element> pGrandChildDevice = pDoc->createElement("device");
  11337. AutoPtr<Element> pGrandChildConsumeId = pDoc->createElement("consume_id");
  11338. AutoPtr<Element> pGrandChildKtCliniqueId = pDoc->createElement("kt_cliniqueid");
  11339. AutoPtr<Element> pGrandChildCardNumber = pDoc->createElement("cardnumber");
  11340. AutoPtr<Element> pGrandChildKtDoctorId = pDoc->createElement("kt_doctorid");
  11341. AutoPtr<Element> pGrandChildConsumeMoney = pDoc->createElement("consumemoney");
  11342. AutoPtr<Element> pGrandChildSignContent = pDoc->createElement("signcontent");
  11343. AutoPtr<Text> pTextVersion = pDoc->createTextNode("1.0");
  11344. AutoPtr<Text> pTextCharset = pDoc->createTextNode("GBK");
  11345. AutoPtr<Text> pTextDevice = pDoc->createTextNode(stringCaseTypeId);
  11346. AutoPtr<Text> pTextConsumeId = pDoc->createTextNode(stringConsumeId);
  11347. AutoPtr<Text> pTextKtCliniqueId = pDoc->createTextNode(stringKtCliniqueId);
  11348. AutoPtr<Text> pTextCardNumber = pDoc->createTextNode(stringCardNumber);
  11349. AutoPtr<Text> pTextKtDoctorId = pDoc->createTextNode(stringKtDoctorId);
  11350. AutoPtr<Text> pTextConsumeMoney = pDoc->createTextNode(stringConsumeMoney);
  11351. string stringSignSrc;
  11352. stringSignSrc = "version=1.0&charset=GBK";
  11353. stringSignSrc += "&consume_id=";
  11354. stringSignSrc += stringConsumeId;
  11355. stringSignSrc += "&kt_cliniqueid=";
  11356. stringSignSrc += stringKtCliniqueId;
  11357. stringSignSrc += "&cardnumber=";
  11358. stringSignSrc += stringCardNumber;
  11359. stringSignSrc += "&kt_doctorid=";
  11360. stringSignSrc += stringKtDoctorId;
  11361. stringSignSrc += "&consumemoney=";
  11362. stringSignSrc += stringConsumeMoney;
  11363. stringSignSrc += "&device=";
  11364. stringSignSrc += stringCaseTypeId;
  11365. stringSignSrc += "&poskey=";
  11366. stringSignSrc += m_stringKey;
  11367. // std::cout<<stringSignSrc<<std::endl;
  11368. AutoPtr<Text> pTextSignContent = pDoc->createTextNode(CUtil::GetMd5(stringSignSrc.c_str(), stringSignSrc.size()));
  11369. pGrandChildVersion->appendChild(pTextVersion);
  11370. pGrandChildCharset->appendChild(pTextCharset);
  11371. pGrandChildDevice->appendChild(pTextDevice);
  11372. pGrandChildConsumeId->appendChild(pTextConsumeId);
  11373. pGrandChildKtCliniqueId->appendChild(pTextKtCliniqueId);
  11374. pGrandChildCardNumber->appendChild(pTextCardNumber);
  11375. pGrandChildKtDoctorId->appendChild(pTextKtDoctorId);
  11376. pGrandChildConsumeMoney->appendChild(pTextConsumeMoney);
  11377. pGrandChildSignContent->appendChild(pTextSignContent);
  11378. pChildTopic->appendChild(pGrandChildVersion);
  11379. pChildTopic->appendChild(pGrandChildCharset);
  11380. pChildTopic->appendChild(pGrandChildDevice);
  11381. pChildDetail->appendChild(pGrandChildConsumeId);
  11382. pChildDetail->appendChild(pGrandChildKtCliniqueId);
  11383. pChildDetail->appendChild(pGrandChildCardNumber);
  11384. pChildDetail->appendChild(pGrandChildKtDoctorId);
  11385. pChildDetail->appendChild(pGrandChildConsumeMoney);
  11386. pChildSign->appendChild(pGrandChildSignContent);
  11387. pRoot->appendChild(pChildTopic);
  11388. pRoot->appendChild(pChildDetail);
  11389. pRoot->appendChild(pChildSign);
  11390. //pDoc->appendChild(pi);
  11391. pDoc->appendChild(pRoot);
  11392. string stringXmlContent;
  11393. int nRet = PHMS_SUCCESSFUL_RESULT;
  11394. nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
  11395. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11396. {
  11397. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11398. return nRet;
  11399. }
  11400. this->SetXmlCommandType(PAY_VERIFICATION_TYPE);
  11401. this->SetNetConfigType(DAOYI_XML);
  11402. nRet = ExecuteXmlSession(stringXmlContent);
  11403. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11404. {
  11405. //写日志
  11406. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11407. return nRet;
  11408. }
  11409. return PHMS_SUCCESSFUL_RESULT;
  11410. }
  11411. int CPhmsSession::UpdateCaseForConsumerRecord_999120(string stringConsumeId, string stringKtCaseId, string stringCaseTypeId)
  11412. {
  11413. AutoPtr<Document> pDoc = new Document;
  11414. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  11415. AutoPtr<Element> pRoot = pDoc->createElement("request");
  11416. AutoPtr<Element> pChildTopic = pDoc->createElement("topic");
  11417. AutoPtr<Element> pChildDetail = pDoc->createElement("detail");
  11418. AutoPtr<Element> pChildSign = pDoc->createElement("sign");
  11419. AutoPtr<Element> pGrandChildVersion = pDoc->createElement("version");
  11420. AutoPtr<Element> pGrandChildCharset = pDoc->createElement("charset");
  11421. AutoPtr<Element> pGrandChildDevice = pDoc->createElement("device");
  11422. AutoPtr<Element> pGrandChildConsumeId = pDoc->createElement("consume_id");
  11423. AutoPtr<Element> pGrandChildKtCaseId = pDoc->createElement("kt_case_id");
  11424. AutoPtr<Element> pGrandChildSignContent = pDoc->createElement("signcontent");
  11425. AutoPtr<Text> pTextVersion = pDoc->createTextNode("1.0");
  11426. AutoPtr<Text> pTextCharset = pDoc->createTextNode("GBK");
  11427. AutoPtr<Text> pTextDevice = pDoc->createTextNode(stringCaseTypeId);
  11428. AutoPtr<Text> pTextConsumeId = pDoc->createTextNode(stringConsumeId);
  11429. AutoPtr<Text> pTextKtCaseId = pDoc->createTextNode(stringKtCaseId);
  11430. string stringSignSrc;
  11431. stringSignSrc = "version=1.0&charset=GBK";
  11432. stringSignSrc += "&consume_id=";
  11433. stringSignSrc += stringConsumeId;
  11434. stringSignSrc += "&kt_case_id=";
  11435. stringSignSrc += stringKtCaseId;
  11436. stringSignSrc += "&device=";
  11437. stringSignSrc += stringCaseTypeId;
  11438. stringSignSrc += "&poskey=";
  11439. stringSignSrc += m_stringKey;
  11440. // std::cout<<stringSignSrc<<std::endl;
  11441. AutoPtr<Text> pTextSignContent = pDoc->createTextNode(CUtil::GetMd5(stringSignSrc.c_str(), stringSignSrc.size()));
  11442. pGrandChildVersion->appendChild(pTextVersion);
  11443. pGrandChildCharset->appendChild(pTextCharset);
  11444. pGrandChildDevice->appendChild(pTextDevice);
  11445. pGrandChildConsumeId->appendChild(pTextConsumeId);
  11446. pGrandChildKtCaseId->appendChild(pTextKtCaseId);
  11447. pGrandChildSignContent->appendChild(pTextSignContent);
  11448. pChildTopic->appendChild(pGrandChildVersion);
  11449. pChildTopic->appendChild(pGrandChildCharset);
  11450. pChildTopic->appendChild(pGrandChildDevice);
  11451. pChildDetail->appendChild(pGrandChildConsumeId);
  11452. pChildDetail->appendChild(pGrandChildKtCaseId);
  11453. pChildSign->appendChild(pGrandChildSignContent);
  11454. pRoot->appendChild(pChildTopic);
  11455. pRoot->appendChild(pChildDetail);
  11456. pRoot->appendChild(pChildSign);
  11457. //pDoc->appendChild(pi);
  11458. pDoc->appendChild(pRoot);
  11459. string stringXmlContent;
  11460. int nRet = PHMS_SUCCESSFUL_RESULT;
  11461. nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
  11462. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11463. {
  11464. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11465. return nRet;
  11466. }
  11467. this->SetXmlCommandType(PAY_VERIFICATION_CASE_TYPE);
  11468. this->SetNetConfigType(DAOYI_XML);
  11469. nRet = ExecuteXmlSession(stringXmlContent);
  11470. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11471. {
  11472. //写日志
  11473. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11474. return nRet;
  11475. }
  11476. return PHMS_SUCCESSFUL_RESULT;
  11477. }
  11478. int CPhmsSession::ValidatePay_XinJie(string stringRrn, string stringLocalDate)
  11479. {
  11480. AutoPtr<Document> pDoc = new Document;
  11481. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  11482. AutoPtr<Element> pRoot = pDoc->createElement("xml");
  11483. AutoPtr<Element> pChildRrn = pDoc->createElement("rrn");
  11484. AutoPtr<Element> pChildLocalDate = pDoc->createElement("localdate");
  11485. AutoPtr<Text> pTextRrn = pDoc->createTextNode(stringRrn);
  11486. AutoPtr<Text> pTextLocalDate = pDoc->createTextNode(stringLocalDate);
  11487. pChildRrn->appendChild(pTextRrn);
  11488. pChildLocalDate->appendChild(pTextLocalDate);
  11489. pRoot->appendChild(pChildRrn);
  11490. pRoot->appendChild(pChildLocalDate);
  11491. //pDoc->appendChild(pi);
  11492. pDoc->appendChild(pRoot);
  11493. string stringXmlContent;
  11494. int nRet = PHMS_SUCCESSFUL_RESULT;
  11495. nRet = this->GetRequestXmlForAESAndBase64(pDoc, stringXmlContent);
  11496. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11497. {
  11498. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11499. return nRet;
  11500. }
  11501. this->SetXinJieCommandType(VALIDATE_PAY);
  11502. this->SetNetConfigType(XINJIE_XML);
  11503. nRet = ExecuteXinJieSession(stringXmlContent);
  11504. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11505. {
  11506. //写日志
  11507. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11508. return nRet;
  11509. }
  11510. return PHMS_SUCCESSFUL_RESULT;
  11511. }
  11512. int CPhmsSession::NotifyCheck_XinJie(string stringRrn, string stringLocalDate)
  11513. {
  11514. AutoPtr<Document> pDoc = new Document;
  11515. //AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='GBK'");
  11516. AutoPtr<Element> pRoot = pDoc->createElement("xml");
  11517. AutoPtr<Element> pChildRrn = pDoc->createElement("rrn");
  11518. AutoPtr<Element> pChildLocalDate = pDoc->createElement("localdate");
  11519. AutoPtr<Text> pTextRrn = pDoc->createTextNode(stringRrn);
  11520. AutoPtr<Text> pTextLocalDate = pDoc->createTextNode(stringLocalDate);
  11521. pChildRrn->appendChild(pTextRrn);
  11522. pChildLocalDate->appendChild(pTextLocalDate);
  11523. pRoot->appendChild(pChildRrn);
  11524. pRoot->appendChild(pChildLocalDate);
  11525. //pDoc->appendChild(pi);
  11526. pDoc->appendChild(pRoot);
  11527. string stringXmlContent;
  11528. int nRet = PHMS_SUCCESSFUL_RESULT;
  11529. nRet = this->GetRequestXmlForAESAndBase64(pDoc, stringXmlContent);
  11530. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11531. {
  11532. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11533. return nRet;
  11534. }
  11535. this->SetXinJieCommandType(NOTIFY_PAY);
  11536. this->SetNetConfigType(XINJIE_XML);
  11537. nRet = ExecuteXinJieSession(stringXmlContent);
  11538. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11539. {
  11540. //写日志
  11541. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11542. return nRet;
  11543. }
  11544. return PHMS_SUCCESSFUL_RESULT;
  11545. }
  11546. int CPhmsSession::UserAuthorize_Telecom(string stringPersonId, string stringName, string stringNation, string stringAddress, string stringRoomId)
  11547. {
  11548. bool bNfc = false;
  11549. if(stringName.size()==0 && stringNation.size()==0 && stringAddress.size()==0)
  11550. {
  11551. bNfc = true;
  11552. }
  11553. DateTime dt;
  11554. dt += Timespan(Timezone::utcOffset(), 0);
  11555. string stringDateTime = DateTimeFormatter::format(dt, "%Y-%m-%d %H:%M:%S");
  11556. AutoPtr<Document> pDoc = new Document;
  11557. AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='utf-8'");
  11558. AutoPtr<Element> pRoot = pDoc->createElement("root");
  11559. AutoPtr<Element> pChildTimeStamp = pDoc->createElement("TimeStamp");
  11560. AutoPtr<Element> pChildAccessCode = pDoc->createElement("AccessCode");
  11561. AutoPtr<Element> pChildAuthType = pDoc->createElement("AuthType");
  11562. AutoPtr<Element> pChildAuthData = pDoc->createElement("AuthData");
  11563. AutoPtr<Element> pGrandChildName = 0;
  11564. AutoPtr<Element> pGrandChildNation = 0;
  11565. AutoPtr<Element> pGrandChildAddress = 0;
  11566. AutoPtr<Element> pGrandChildProofNum = 0;
  11567. if(!bNfc)
  11568. {
  11569. pGrandChildName = pDoc->createElement("Name");
  11570. pGrandChildNation = pDoc->createElement("Nation");
  11571. pGrandChildAddress = pDoc->createElement("Address");
  11572. pGrandChildProofNum = pDoc->createElement("ProofNum");
  11573. }
  11574. AutoPtr<Element> pChildRoomId = pDoc->createElement("RoomId");
  11575. AutoPtr<Text> pTextTimeStamp = pDoc->createTextNode(stringDateTime);
  11576. AutoPtr<Text> pTextAccessCode = pDoc->createTextNode("CONTEC");
  11577. AutoPtr<Text> pTextAuthType = 0;
  11578. if(!bNfc)
  11579. {
  11580. pTextAuthType = pDoc->createTextNode("08");
  11581. }
  11582. else
  11583. {
  11584. pTextAuthType = pDoc->createTextNode("01");
  11585. }
  11586. AutoPtr<Text> pTextName = 0;
  11587. AutoPtr<Text> pTextNation = 0;
  11588. AutoPtr<Text> pTextAddress = 0;
  11589. AutoPtr<Text> pTextProofNum = 0;
  11590. AutoPtr<Text> pTextNfcId = 0;
  11591. if(!bNfc)
  11592. {
  11593. pTextName = pDoc->createTextNode(stringName);
  11594. pTextNation = pDoc->createTextNode(stringNation);
  11595. pTextAddress = pDoc->createTextNode(stringAddress);
  11596. pTextProofNum = pDoc->createTextNode(stringPersonId);
  11597. }
  11598. else
  11599. {
  11600. pTextNfcId = pDoc->createTextNode(stringPersonId);
  11601. }
  11602. AutoPtr<Text> pTextRoomId = pDoc->createTextNode(stringRoomId);
  11603. pChildTimeStamp->appendChild(pTextTimeStamp);
  11604. pChildAccessCode->appendChild(pTextAccessCode);
  11605. pChildAuthType->appendChild(pTextAuthType);
  11606. if(!bNfc)
  11607. {
  11608. pGrandChildName->appendChild(pTextName);
  11609. pGrandChildNation->appendChild(pTextNation);
  11610. pGrandChildAddress->appendChild(pTextAddress);
  11611. pGrandChildProofNum->appendChild(pTextProofNum);
  11612. pChildAuthData->appendChild(pGrandChildName);
  11613. pChildAuthData->appendChild(pGrandChildNation);
  11614. pChildAuthData->appendChild(pGrandChildAddress);
  11615. pChildAuthData->appendChild(pGrandChildProofNum);
  11616. }
  11617. else
  11618. {
  11619. pChildAuthData->appendChild(pTextNfcId);
  11620. }
  11621. pChildRoomId->appendChild(pTextRoomId);
  11622. pRoot->appendChild(pChildTimeStamp);
  11623. pRoot->appendChild(pChildAccessCode);
  11624. pRoot->appendChild(pChildAuthType);
  11625. pRoot->appendChild(pChildAuthData);
  11626. pRoot->appendChild(pChildRoomId);
  11627. //pDoc->appendChild(pi);
  11628. pDoc->appendChild(pRoot);
  11629. string stringXmlContent;
  11630. int nRet = PHMS_SUCCESSFUL_RESULT;
  11631. nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent, true);
  11632. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11633. {
  11634. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11635. return nRet;
  11636. }
  11637. this->SetXmlCommandType_Telecom(USER_AUTH);
  11638. this->SetNetConfigType(TELECOM_XML);
  11639. nRet = ExecuteXmlSession_Telecom(stringXmlContent);
  11640. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11641. {
  11642. //写日志
  11643. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11644. return nRet;
  11645. }
  11646. return PHMS_SUCCESSFUL_RESULT;
  11647. }
  11648. int CPhmsSession::BloodPressureUpload_Telecom(string stringPersonType, string stringPersonId, string stringSBP, string stringDBP, string stringAverageValue, string stringPulseRate, string stringDetectionTime,
  11649. string stringEquCode, string stringRoomId)
  11650. {
  11651. DateTime dt;
  11652. dt += Timespan(Timezone::utcOffset(), 0);
  11653. string stringDateTime = DateTimeFormatter::format(dt, "%Y-%m-%d %H:%M:%S");
  11654. AutoPtr<Document> pDoc = new Document;
  11655. AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='utf-8'");
  11656. AutoPtr<Element> pRoot = pDoc->createElement("root");
  11657. AutoPtr<Element> pChildTimeStamp = pDoc->createElement("TimeStamp");
  11658. AutoPtr<Element> pChildAccessCode = pDoc->createElement("AccessCode");
  11659. AutoPtr<Element> pChildDiscernType = pDoc->createElement("UserDiscernType");
  11660. AutoPtr<Element> pChildDiscernData = pDoc->createElement("UserDiscernData");
  11661. AutoPtr<Element> pChildSBP = pDoc->createElement("SBP");
  11662. AutoPtr<Element> pChildDBP = pDoc->createElement("DBP");
  11663. AutoPtr<Element> pChildAverageValue = pDoc->createElement("AverageValue");
  11664. AutoPtr<Element> pChildPulseRate = pDoc->createElement("PulseRate");
  11665. AutoPtr<Element> pChildDetectionTime = pDoc->createElement("DetectionTime");
  11666. AutoPtr<Element> pChildDetectionResult = pDoc->createElement("DetectionResult");
  11667. AutoPtr<Element> pChildEquCode = pDoc->createElement("EquCode");
  11668. AutoPtr<Element> pChildId = pDoc->createElement("Id");
  11669. AutoPtr<Element> pChildRoomId = pDoc->createElement("RoomId");
  11670. AutoPtr<Text> pTextTimeStamp = pDoc->createTextNode(stringDateTime);
  11671. AutoPtr<Text> pTextAccessCode = pDoc->createTextNode("CONTEC");
  11672. AutoPtr<Text> pTextDiscernType = 0;
  11673. pTextDiscernType = pDoc->createTextNode(stringPersonType);
  11674. // if(nCardType == 1)
  11675. // {
  11676. // pTextDiscernType = pDoc->createTextNode("01");
  11677. // }
  11678. // else
  11679. // {
  11680. // pTextDiscernType = pDoc->createTextNode("02");
  11681. // }
  11682. AutoPtr<Text> pTextDiscernData = pDoc->createTextNode(stringPersonId);
  11683. AutoPtr<Text> pTextSBP = pDoc->createTextNode(stringSBP);
  11684. AutoPtr<Text> pTextDBP = pDoc->createTextNode(stringDBP);
  11685. AutoPtr<Text> pTextAverageValue = pDoc->createTextNode(stringAverageValue);
  11686. AutoPtr<Text> pTextPulseRate = pDoc->createTextNode(stringPulseRate);
  11687. AutoPtr<Text> pTextDetectionTime = pDoc->createTextNode(stringDetectionTime);
  11688. AutoPtr<Text> pTextDetectionResutl = pDoc->createTextNode("");
  11689. AutoPtr<Text> pTextEquCode = pDoc->createTextNode(stringEquCode);
  11690. AutoPtr<Text> pTextId = pDoc->createTextNode("");
  11691. AutoPtr<Text> pTextRoomId = pDoc->createTextNode(stringRoomId);
  11692. pChildTimeStamp->appendChild(pTextTimeStamp);
  11693. pChildAccessCode->appendChild(pTextAccessCode);
  11694. pChildDiscernType->appendChild(pTextDiscernType);
  11695. pChildDiscernData->appendChild(pTextDiscernData);
  11696. pChildSBP->appendChild(pTextSBP);
  11697. pChildDBP->appendChild(pTextDBP);
  11698. pChildAverageValue->appendChild(pTextAverageValue);
  11699. pChildPulseRate->appendChild(pTextPulseRate);
  11700. pChildDetectionTime->appendChild(pTextDetectionTime);
  11701. pChildDetectionResult->appendChild(pTextDetectionResutl);
  11702. pChildEquCode->appendChild(pTextEquCode);
  11703. pChildId->appendChild(pTextId);
  11704. pChildRoomId->appendChild(pTextRoomId);
  11705. pRoot->appendChild(pChildTimeStamp);
  11706. pRoot->appendChild(pChildAccessCode);
  11707. pRoot->appendChild(pChildDiscernType);
  11708. pRoot->appendChild(pChildDiscernData);
  11709. pRoot->appendChild(pChildSBP);
  11710. pRoot->appendChild(pChildDBP);
  11711. pRoot->appendChild(pChildAverageValue);
  11712. pRoot->appendChild(pChildPulseRate);
  11713. pRoot->appendChild(pChildDetectionTime);
  11714. pRoot->appendChild(pChildDetectionResult);
  11715. pRoot->appendChild(pChildEquCode);
  11716. pRoot->appendChild(pChildId);
  11717. pRoot->appendChild(pChildRoomId);
  11718. //pDoc->appendChild(pi);
  11719. pDoc->appendChild(pRoot);
  11720. string stringXmlContent;
  11721. int nRet = PHMS_SUCCESSFUL_RESULT;
  11722. nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
  11723. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11724. {
  11725. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11726. return nRet;
  11727. }
  11728. this->SetXmlCommandType_Telecom(SYNC_BP);
  11729. this->SetNetConfigType(TELECOM_XML);
  11730. nRet = ExecuteXmlSession_Telecom(stringXmlContent);
  11731. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11732. {
  11733. //写日志
  11734. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11735. return nRet;
  11736. }
  11737. return PHMS_SUCCESSFUL_RESULT;
  11738. }
  11739. int CPhmsSession::BloodOxygenUpload_Telecom(string stringPersonType, string stringPersonId, string stringBloodOxygen, string stringPulseRate, string stringDetectionTime,
  11740. string stringEquCode, string stringRoomId)
  11741. {
  11742. DateTime dt;
  11743. dt += Timespan(Timezone::utcOffset(), 0);
  11744. string stringDateTime = DateTimeFormatter::format(dt, "%Y-%m-%d %H:%M:%S");
  11745. AutoPtr<Document> pDoc = new Document;
  11746. AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='utf-8'");
  11747. AutoPtr<Element> pRoot = pDoc->createElement("root");
  11748. AutoPtr<Element> pChildTimeStamp = pDoc->createElement("TimeStamp");
  11749. AutoPtr<Element> pChildAccessCode = pDoc->createElement("AccessCode");
  11750. AutoPtr<Element> pChildDiscernType = pDoc->createElement("UserDiscernType");
  11751. AutoPtr<Element> pChildDiscernData = pDoc->createElement("UserDiscernData");
  11752. AutoPtr<Element> pChildBloodOxygen = pDoc->createElement("BloodOxygen");
  11753. AutoPtr<Element> pChildPulseRate = pDoc->createElement("PulseRate");
  11754. AutoPtr<Element> pChildDetectionTime = pDoc->createElement("DetectionTime");
  11755. AutoPtr<Element> pChildDetectionResult = pDoc->createElement("DetectionResult");
  11756. AutoPtr<Element> pChildEquCode = pDoc->createElement("EquCode");
  11757. AutoPtr<Element> pChildId = pDoc->createElement("Id");
  11758. AutoPtr<Element> pChildRoomId = pDoc->createElement("RoomId");
  11759. AutoPtr<Text> pTextTimeStamp = pDoc->createTextNode(stringDateTime);
  11760. AutoPtr<Text> pTextAccessCode = pDoc->createTextNode("CONTEC");
  11761. AutoPtr<Text> pTextDiscernType = 0;
  11762. pTextDiscernType = pDoc->createTextNode(stringPersonType);
  11763. // if(nCardType == 1)
  11764. // {
  11765. // pTextDiscernType = pDoc->createTextNode("01");
  11766. // }
  11767. // else
  11768. // {
  11769. // pTextDiscernType = pDoc->createTextNode("02");
  11770. // }
  11771. AutoPtr<Text> pTextDiscernData = pDoc->createTextNode(stringPersonId);
  11772. AutoPtr<Text> pTextBloodOxygen = pDoc->createTextNode(stringBloodOxygen);
  11773. AutoPtr<Text> pTextPulseRate = pDoc->createTextNode(stringPulseRate);
  11774. AutoPtr<Text> pTextDetectionTime = pDoc->createTextNode(stringDetectionTime);
  11775. AutoPtr<Text> pTextDetectionResutl = pDoc->createTextNode("");
  11776. AutoPtr<Text> pTextEquCode = pDoc->createTextNode(stringEquCode);
  11777. AutoPtr<Text> pTextId = pDoc->createTextNode("");
  11778. AutoPtr<Text> pTextRoomId = pDoc->createTextNode(stringRoomId);
  11779. pChildTimeStamp->appendChild(pTextTimeStamp);
  11780. pChildAccessCode->appendChild(pTextAccessCode);
  11781. pChildDiscernType->appendChild(pTextDiscernType);
  11782. pChildDiscernData->appendChild(pTextDiscernData);
  11783. pChildBloodOxygen->appendChild(pTextBloodOxygen);
  11784. pChildPulseRate->appendChild(pTextPulseRate);
  11785. pChildDetectionTime->appendChild(pTextDetectionTime);
  11786. pChildDetectionResult->appendChild(pTextDetectionResutl);
  11787. pChildEquCode->appendChild(pTextEquCode);
  11788. pChildId->appendChild(pTextId);
  11789. pChildRoomId->appendChild(pTextRoomId);
  11790. pRoot->appendChild(pChildTimeStamp);
  11791. pRoot->appendChild(pChildAccessCode);
  11792. pRoot->appendChild(pChildDiscernType);
  11793. pRoot->appendChild(pChildDiscernData);
  11794. pRoot->appendChild(pChildBloodOxygen);
  11795. pRoot->appendChild(pChildPulseRate);
  11796. pRoot->appendChild(pChildDetectionTime);
  11797. pRoot->appendChild(pChildDetectionResult);
  11798. pRoot->appendChild(pChildEquCode);
  11799. pRoot->appendChild(pChildId);
  11800. pRoot->appendChild(pChildRoomId);
  11801. //pDoc->appendChild(pi);
  11802. pDoc->appendChild(pRoot);
  11803. string stringXmlContent;
  11804. int nRet = PHMS_SUCCESSFUL_RESULT;
  11805. nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
  11806. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11807. {
  11808. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11809. return nRet;
  11810. }
  11811. this->SetXmlCommandType_Telecom(SYNC_BO);
  11812. this->SetNetConfigType(TELECOM_XML);
  11813. nRet = ExecuteXmlSession_Telecom(stringXmlContent);
  11814. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11815. {
  11816. //写日志
  11817. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11818. return nRet;
  11819. }
  11820. return PHMS_SUCCESSFUL_RESULT;
  11821. }
  11822. int CPhmsSession::BloodSugarUpload_Telecom(string stringPersonType, string stringPersonId, string stringBloodSugar, string stringDetectionTime,
  11823. string stringEquCode, string stringRoomId)
  11824. {
  11825. DateTime dt;
  11826. dt += Timespan(Timezone::utcOffset(), 0);
  11827. string stringDateTime = DateTimeFormatter::format(dt, "%Y-%m-%d %H:%M:%S");
  11828. AutoPtr<Document> pDoc = new Document;
  11829. AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='utf-8'");
  11830. AutoPtr<Element> pRoot = pDoc->createElement("root");
  11831. AutoPtr<Element> pChildTimeStamp = pDoc->createElement("TimeStamp");
  11832. AutoPtr<Element> pChildAccessCode = pDoc->createElement("AccessCode");
  11833. AutoPtr<Element> pChildDiscernType = pDoc->createElement("UserDiscernType");
  11834. AutoPtr<Element> pChildDiscernData = pDoc->createElement("UserDiscernData");
  11835. AutoPtr<Element> pChildBloodGlucose = pDoc->createElement("BloodGlucose");
  11836. AutoPtr<Element> pChildTestType = pDoc->createElement("TestType");
  11837. AutoPtr<Element> pChildDetectionTime = pDoc->createElement("DetectionTime");
  11838. AutoPtr<Element> pChildDetectionResult = pDoc->createElement("DetectionResult");
  11839. AutoPtr<Element> pChildEquCode = pDoc->createElement("EquCode");
  11840. AutoPtr<Element> pChildId = pDoc->createElement("Id");
  11841. AutoPtr<Element> pChildRoomId = pDoc->createElement("RoomId");
  11842. AutoPtr<Text> pTextTimeStamp = pDoc->createTextNode(stringDateTime);
  11843. AutoPtr<Text> pTextAccessCode = pDoc->createTextNode("CONTEC");
  11844. AutoPtr<Text> pTextDiscernType = 0;
  11845. pTextDiscernType = pDoc->createTextNode(stringPersonType);
  11846. // if(nCardType == 1)
  11847. // {
  11848. // pTextDiscernType = pDoc->createTextNode("01");
  11849. // }
  11850. // else
  11851. // {
  11852. // pTextDiscernType = pDoc->createTextNode("02");
  11853. // }
  11854. AutoPtr<Text> pTextDiscernData = pDoc->createTextNode(stringPersonId);
  11855. AutoPtr<Text> pTextBloodGlucose = pDoc->createTextNode(stringBloodSugar);
  11856. AutoPtr<Text> pTextTestType = pDoc->createTextNode("");
  11857. AutoPtr<Text> pTextDetectionTime = pDoc->createTextNode(stringDetectionTime);
  11858. AutoPtr<Text> pTextDetectionResutl = pDoc->createTextNode("");
  11859. AutoPtr<Text> pTextEquCode = pDoc->createTextNode(stringEquCode);
  11860. AutoPtr<Text> pTextId = pDoc->createTextNode("");
  11861. AutoPtr<Text> pTextRoomId = pDoc->createTextNode(stringRoomId);
  11862. pChildTimeStamp->appendChild(pTextTimeStamp);
  11863. pChildAccessCode->appendChild(pTextAccessCode);
  11864. pChildDiscernType->appendChild(pTextDiscernType);
  11865. pChildDiscernData->appendChild(pTextDiscernData);
  11866. pChildBloodGlucose->appendChild(pTextBloodGlucose);
  11867. pChildTestType->appendChild(pTextTestType);
  11868. pChildDetectionTime->appendChild(pTextDetectionTime);
  11869. pChildDetectionResult->appendChild(pTextDetectionResutl);
  11870. pChildEquCode->appendChild(pTextEquCode);
  11871. pChildId->appendChild(pTextId);
  11872. pChildRoomId->appendChild(pTextRoomId);
  11873. pRoot->appendChild(pChildTimeStamp);
  11874. pRoot->appendChild(pChildAccessCode);
  11875. pRoot->appendChild(pChildDiscernType);
  11876. pRoot->appendChild(pChildDiscernData);
  11877. pRoot->appendChild(pChildBloodGlucose);
  11878. pRoot->appendChild(pChildTestType);
  11879. pRoot->appendChild(pChildDetectionTime);
  11880. pRoot->appendChild(pChildDetectionResult);
  11881. pRoot->appendChild(pChildEquCode);
  11882. pRoot->appendChild(pChildId);
  11883. pRoot->appendChild(pChildRoomId);
  11884. //pDoc->appendChild(pi);
  11885. pDoc->appendChild(pRoot);
  11886. string stringXmlContent;
  11887. int nRet = PHMS_SUCCESSFUL_RESULT;
  11888. nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
  11889. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11890. {
  11891. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11892. return nRet;
  11893. }
  11894. this->SetXmlCommandType_Telecom(SYNC_BS);
  11895. this->SetNetConfigType(TELECOM_XML);
  11896. nRet = ExecuteXmlSession_Telecom(stringXmlContent);
  11897. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11898. {
  11899. //写日志
  11900. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11901. return nRet;
  11902. }
  11903. return PHMS_SUCCESSFUL_RESULT;
  11904. }
  11905. int CPhmsSession::HeightWeightUpload_Telecom(string stringPersonType, string stringPersonId, string stringHeight, string stringWeight, string stringBMI, string stringDetectionTime,
  11906. string stringEquCode, string stringRoomId)
  11907. {
  11908. DateTime dt;
  11909. dt += Timespan(Timezone::utcOffset(), 0);
  11910. string stringDateTime = DateTimeFormatter::format(dt, "%Y-%m-%d %H:%M:%S");
  11911. AutoPtr<Document> pDoc = new Document;
  11912. AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='utf-8'");
  11913. AutoPtr<Element> pRoot = pDoc->createElement("root");
  11914. AutoPtr<Element> pChildTimeStamp = pDoc->createElement("TimeStamp");
  11915. AutoPtr<Element> pChildAccessCode = pDoc->createElement("AccessCode");
  11916. AutoPtr<Element> pChildDiscernType = pDoc->createElement("UserDiscernType");
  11917. AutoPtr<Element> pChildDiscernData = pDoc->createElement("UserDiscernData");
  11918. AutoPtr<Element> pChildHeight = pDoc->createElement("Height");
  11919. AutoPtr<Element> pChildWeight = pDoc->createElement("Weight");
  11920. AutoPtr<Element> pChildBMI = pDoc->createElement("BMI");
  11921. AutoPtr<Element> pChildDetectionTime = pDoc->createElement("DetectionTime");
  11922. AutoPtr<Element> pChildDetectionResult = pDoc->createElement("DetectionResult");
  11923. AutoPtr<Element> pChildEquCode = pDoc->createElement("EquCode");
  11924. AutoPtr<Element> pChildId = pDoc->createElement("Id");
  11925. AutoPtr<Element> pChildRoomId = pDoc->createElement("RoomId");
  11926. AutoPtr<Text> pTextTimeStamp = pDoc->createTextNode(stringDateTime);
  11927. AutoPtr<Text> pTextAccessCode = pDoc->createTextNode("CONTEC");
  11928. AutoPtr<Text> pTextDiscernType = 0;
  11929. pTextDiscernType = pDoc->createTextNode(stringPersonType);
  11930. // if(nCardType == 1)
  11931. // {
  11932. // pTextDiscernType = pDoc->createTextNode("01");
  11933. // }
  11934. // else
  11935. // {
  11936. // pTextDiscernType = pDoc->createTextNode("02");
  11937. // }
  11938. AutoPtr<Text> pTextDiscernData = pDoc->createTextNode(stringPersonId);
  11939. AutoPtr<Text> pTextHeight = pDoc->createTextNode(stringHeight);
  11940. AutoPtr<Text> pTextWeight = pDoc->createTextNode(stringWeight);
  11941. AutoPtr<Text> pTextBMI = pDoc->createTextNode(stringBMI);
  11942. AutoPtr<Text> pTextDetectionTime = pDoc->createTextNode(stringDetectionTime);
  11943. AutoPtr<Text> pTextDetectionResutl = pDoc->createTextNode("");
  11944. AutoPtr<Text> pTextEquCode = pDoc->createTextNode(stringEquCode);
  11945. AutoPtr<Text> pTextId = pDoc->createTextNode("");
  11946. AutoPtr<Text> pTextRoomId = pDoc->createTextNode(stringRoomId);
  11947. pChildTimeStamp->appendChild(pTextTimeStamp);
  11948. pChildAccessCode->appendChild(pTextAccessCode);
  11949. pChildDiscernType->appendChild(pTextDiscernType);
  11950. pChildDiscernData->appendChild(pTextDiscernData);
  11951. pChildHeight->appendChild(pTextHeight);
  11952. pChildWeight->appendChild(pTextWeight);
  11953. pChildBMI->appendChild(pTextBMI);
  11954. pChildDetectionTime->appendChild(pTextDetectionTime);
  11955. pChildDetectionResult->appendChild(pTextDetectionResutl);
  11956. pChildEquCode->appendChild(pTextEquCode);
  11957. pChildId->appendChild(pTextId);
  11958. pChildRoomId->appendChild(pTextRoomId);
  11959. pRoot->appendChild(pChildTimeStamp);
  11960. pRoot->appendChild(pChildAccessCode);
  11961. pRoot->appendChild(pChildDiscernType);
  11962. pRoot->appendChild(pChildDiscernData);
  11963. pRoot->appendChild(pChildHeight);
  11964. pRoot->appendChild(pChildWeight);
  11965. pRoot->appendChild(pChildBMI);
  11966. pRoot->appendChild(pChildDetectionTime);
  11967. pRoot->appendChild(pChildDetectionResult);
  11968. pRoot->appendChild(pChildEquCode);
  11969. pRoot->appendChild(pChildId);
  11970. pRoot->appendChild(pChildRoomId);
  11971. //pDoc->appendChild(pi);
  11972. pDoc->appendChild(pRoot);
  11973. string stringXmlContent;
  11974. int nRet = PHMS_SUCCESSFUL_RESULT;
  11975. nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
  11976. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11977. {
  11978. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11979. return nRet;
  11980. }
  11981. this->SetXmlCommandType_Telecom(SYNC_HW);
  11982. this->SetNetConfigType(TELECOM_XML);
  11983. nRet = ExecuteXmlSession_Telecom(stringXmlContent);
  11984. if(nRet != PHMS_SUCCESSFUL_RESULT)
  11985. {
  11986. //写日志
  11987. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  11988. return nRet;
  11989. }
  11990. return PHMS_SUCCESSFUL_RESULT;
  11991. }
  11992. int CPhmsSession::LungUpload_Telecom(string stringPersonType, string stringPersonId, string stringM_B1, string stringBSA, string stringBSA1, string stringMMF, string stringMefSeventyFive, string stringMefFifty,
  11993. string stringMefTwentyFive, string stringMefFVST, string stringIC, string stringIRV, string stringERV, string stringFevOne, string stringFevTwo, string stringFevThree,
  11994. string stringFevOnePer, string stringFevTwoPer, string stringFevThreePer, string stringRR, string stringFVC, string stringPEF, string stringTV, string stringVC, string stringMVV,
  11995. string stringMV, string stringVSTHeight, string stringVSMvvBsa, string stringVSMvvOne, string stringSVC, string stringFevOneZeroFive, string stringFevOneZeroFivePer, string stringPefOne,
  11996. string stringPefTwo, string stringPefThree, string stringFive, string stringFiveOne, string stringFiveTwo, string stringFiveThree, string stringPIF, string stringMifFifty,
  11997. string stringDetectionTime, string stringEquCode, string stringRoomId)
  11998. {
  11999. DateTime dt;
  12000. dt += Timespan(Timezone::utcOffset(), 0);
  12001. string stringDateTime = DateTimeFormatter::format(dt, "%Y-%m-%d %H:%M:%S");
  12002. AutoPtr<Document> pDoc = new Document;
  12003. AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='utf-8'");
  12004. AutoPtr<Element> pRoot = pDoc->createElement("root");
  12005. AutoPtr<Element> pChildTimeStamp = pDoc->createElement("TimeStamp");
  12006. AutoPtr<Element> pChildAccessCode = pDoc->createElement("AccessCode");
  12007. AutoPtr<Element> pChildDiscernType = pDoc->createElement("UserDiscernType");
  12008. AutoPtr<Element> pChildDiscernData = pDoc->createElement("UserDiscernData");
  12009. AutoPtr<Element> pChildM_B1 = pDoc->createElement("M_B1");
  12010. AutoPtr<Element> pChildBSA = pDoc->createElement("BSA");
  12011. AutoPtr<Element> pChildBSA1 = pDoc->createElement("BSA1");
  12012. AutoPtr<Element> pChildMMF = pDoc->createElement("MMF");
  12013. AutoPtr<Element> pChildMefSeventyFive = pDoc->createElement("MefSeventyFive");
  12014. AutoPtr<Element> pChildMefFifty = pDoc->createElement("MefFifty");
  12015. AutoPtr<Element> pChildMefTwentyFive = pDoc->createElement("MefTwentyFive");
  12016. AutoPtr<Element> pChildMefFVST = pDoc->createElement("MefFVST");
  12017. AutoPtr<Element> pChildIC = pDoc->createElement("IC");
  12018. AutoPtr<Element> pChildIRV = pDoc->createElement("IRV");
  12019. AutoPtr<Element> pChildERV = pDoc->createElement("ERV");
  12020. AutoPtr<Element> pChildFevOne = pDoc->createElement("FevOne");
  12021. AutoPtr<Element> pChildFevTwo = pDoc->createElement("FevTwo");
  12022. AutoPtr<Element> pChildFevThree = pDoc->createElement("FevThree");
  12023. AutoPtr<Element> pChildFevOnePer = pDoc->createElement("FevOnePer");
  12024. AutoPtr<Element> pChildFevTwoPer = pDoc->createElement("FevTwoPer");
  12025. AutoPtr<Element> pChildFevThreePer = pDoc->createElement("FevThreePer");
  12026. AutoPtr<Element> pChildRR = pDoc->createElement("RR");
  12027. AutoPtr<Element> pChildFVC = pDoc->createElement("FVC");
  12028. AutoPtr<Element> pChildPEF = pDoc->createElement("PEF");
  12029. AutoPtr<Element> pChildTV = pDoc->createElement("TV");
  12030. AutoPtr<Element> pChildVC = pDoc->createElement("VC");
  12031. AutoPtr<Element> pChildMVV = pDoc->createElement("MVV");
  12032. AutoPtr<Element> pChildMV = pDoc->createElement("MV");
  12033. AutoPtr<Element> pChildVSTHeight = pDoc->createElement("VSTHeight");
  12034. AutoPtr<Element> pChildVSMvvBsa = pDoc->createElement("VSMvvBsa");
  12035. AutoPtr<Element> pChildVSMvvOne = pDoc->createElement("VSMvvOne");
  12036. AutoPtr<Element> pChildSVC = pDoc->createElement("SVC");
  12037. AutoPtr<Element> pChildFevOneZeroFive = pDoc->createElement("FevOneZeroFive");
  12038. AutoPtr<Element> pChildFevOneZeroFivePer = pDoc->createElement("FevOneZeroFivePer");
  12039. AutoPtr<Element> pChildPefOne = pDoc->createElement("PefOne");
  12040. AutoPtr<Element> pChildPefTwo = pDoc->createElement("PefTwo");
  12041. AutoPtr<Element> pChildPefThree = pDoc->createElement("PefThree");
  12042. AutoPtr<Element> pChildFive = pDoc->createElement("Five");
  12043. AutoPtr<Element> pChildFiveOne = pDoc->createElement("FiveOne");
  12044. AutoPtr<Element> pChildFiveTwo = pDoc->createElement("FiveTwo");
  12045. AutoPtr<Element> pChildFiveThree = pDoc->createElement("FiveThree");
  12046. AutoPtr<Element> pChildPif = pDoc->createElement("Pif");
  12047. AutoPtr<Element> pChildMifFifty = pDoc->createElement("MifFifty");
  12048. AutoPtr<Element> pChildDetectionTime = pDoc->createElement("DetectionTime");
  12049. AutoPtr<Element> pChildDetectionResult = pDoc->createElement("DetectionResult");
  12050. AutoPtr<Element> pChildEquCode = pDoc->createElement("EquCode");
  12051. AutoPtr<Element> pChildId = pDoc->createElement("Id");
  12052. AutoPtr<Element> pChildRoomId = pDoc->createElement("RoomId");
  12053. AutoPtr<Text> pTextTimeStamp = pDoc->createTextNode(stringDateTime);
  12054. AutoPtr<Text> pTextAccessCode = pDoc->createTextNode("CONTEC");
  12055. AutoPtr<Text> pTextDiscernType = 0;
  12056. pTextDiscernType = pDoc->createTextNode(stringPersonType);
  12057. // if(nCardType == 1)
  12058. // {
  12059. // pTextDiscernType = pDoc->createTextNode("01");
  12060. // }
  12061. // else
  12062. // {
  12063. // pTextDiscernType = pDoc->createTextNode("02");
  12064. // }
  12065. AutoPtr<Text> pTextDiscernData = pDoc->createTextNode(stringPersonId);
  12066. AutoPtr<Text> pTextM_B1 = pDoc->createTextNode(stringM_B1);
  12067. AutoPtr<Text> pTextBSA = pDoc->createTextNode(stringBSA);
  12068. AutoPtr<Text> pTextBSA1 = pDoc->createTextNode(stringBSA1);
  12069. AutoPtr<Text> pTextMMF = pDoc->createTextNode(stringMMF);
  12070. AutoPtr<Text> pTextMefSeventyFive = pDoc->createTextNode(stringMefSeventyFive);
  12071. AutoPtr<Text> pTextMefFifty = pDoc->createTextNode(stringMefFifty);
  12072. AutoPtr<Text> pTextMefTwentyFive = pDoc->createTextNode(stringMefTwentyFive);
  12073. AutoPtr<Text> pTextMefFVST = pDoc->createTextNode(stringMefFVST);
  12074. AutoPtr<Text> pTextIC = pDoc->createTextNode(stringIC);
  12075. AutoPtr<Text> pTextIRV = pDoc->createTextNode(stringIRV);
  12076. AutoPtr<Text> pTextERV = pDoc->createTextNode(stringERV);
  12077. AutoPtr<Text> pTextFevOne = pDoc->createTextNode(stringFevOne);
  12078. AutoPtr<Text> pTextFevTwo = pDoc->createTextNode(stringFevTwo);
  12079. AutoPtr<Text> pTextFevThree = pDoc->createTextNode(stringFevThree);
  12080. AutoPtr<Text> pTextFevOnePer = pDoc->createTextNode(stringFevOnePer);
  12081. AutoPtr<Text> pTextFevTwoPer = pDoc->createTextNode(stringFevTwoPer);
  12082. AutoPtr<Text> pTextFevThreePer = pDoc->createTextNode(stringFevThreePer);
  12083. AutoPtr<Text> pTextRR = pDoc->createTextNode(stringRR);
  12084. AutoPtr<Text> pTextFVC = pDoc->createTextNode(stringFVC);
  12085. AutoPtr<Text> pTextPEF = pDoc->createTextNode(stringPEF);
  12086. AutoPtr<Text> pTextTV = pDoc->createTextNode(stringTV);
  12087. AutoPtr<Text> pTextVC = pDoc->createTextNode(stringVC);
  12088. AutoPtr<Text> pTextMVV = pDoc->createTextNode(stringMVV);
  12089. AutoPtr<Text> pTextMV = pDoc->createTextNode(stringMV);
  12090. AutoPtr<Text> pTextVSTHeight = pDoc->createTextNode(stringVSTHeight);
  12091. AutoPtr<Text> pTextVSMvvBsa = pDoc->createTextNode(stringVSMvvBsa);
  12092. AutoPtr<Text> pTextVSMvvOne = pDoc->createTextNode(stringVSMvvOne);
  12093. AutoPtr<Text> pTextSVC = pDoc->createTextNode(stringSVC);
  12094. AutoPtr<Text> pTextFevOneZeroFive = pDoc->createTextNode(stringFevOneZeroFive);
  12095. AutoPtr<Text> pTextFevOneZeroFivePer = pDoc->createTextNode(stringFevOneZeroFivePer);
  12096. AutoPtr<Text> pTextPefOne = pDoc->createTextNode(stringPefOne);
  12097. AutoPtr<Text> pTextPefTwo = pDoc->createTextNode(stringPefTwo);
  12098. AutoPtr<Text> pTextPefThree = pDoc->createTextNode(stringPefThree);
  12099. AutoPtr<Text> pTextFive = pDoc->createTextNode(stringFive);
  12100. AutoPtr<Text> pTextFiveOne = pDoc->createTextNode(stringFiveOne);
  12101. AutoPtr<Text> pTextFiveTwo = pDoc->createTextNode(stringFiveTwo);
  12102. AutoPtr<Text> pTextFiveThree = pDoc->createTextNode(stringFiveThree);
  12103. AutoPtr<Text> pTextPif = pDoc->createTextNode(stringPIF);
  12104. AutoPtr<Text> pTextMifFifty = pDoc->createTextNode(stringMifFifty);
  12105. AutoPtr<Text> pTextDetectionTime = pDoc->createTextNode(stringDetectionTime);
  12106. AutoPtr<Text> pTextDetectionResutl = pDoc->createTextNode("");
  12107. AutoPtr<Text> pTextEquCode = pDoc->createTextNode(stringEquCode);
  12108. AutoPtr<Text> pTextId = pDoc->createTextNode("");
  12109. AutoPtr<Text> pTextRoomId = pDoc->createTextNode(stringRoomId);
  12110. pChildTimeStamp->appendChild(pTextTimeStamp);
  12111. pChildAccessCode->appendChild(pTextAccessCode);
  12112. pChildDiscernType->appendChild(pTextDiscernType);
  12113. pChildDiscernData->appendChild(pTextDiscernData);
  12114. pChildM_B1->appendChild(pTextM_B1);
  12115. pChildBSA->appendChild(pTextBSA);
  12116. pChildBSA1->appendChild(pTextBSA1);
  12117. pChildMMF->appendChild(pTextMMF);
  12118. pChildMefSeventyFive->appendChild(pTextMefSeventyFive);
  12119. pChildMefFifty->appendChild(pTextMefFifty);
  12120. pChildMefTwentyFive->appendChild(pTextMefTwentyFive);
  12121. pChildMefFVST->appendChild(pTextMefFVST);
  12122. pChildIC->appendChild(pTextIC);
  12123. pChildIRV->appendChild(pTextIRV);
  12124. pChildERV->appendChild(pTextERV);
  12125. pChildFevOne->appendChild(pTextFevOne);
  12126. pChildFevTwo->appendChild(pTextFevTwo);
  12127. pChildFevThree->appendChild(pTextFevThree);
  12128. pChildFevOnePer->appendChild(pTextFevOnePer);
  12129. pChildFevTwoPer->appendChild(pTextFevTwoPer);
  12130. pChildFevThreePer->appendChild(pTextFevThreePer);
  12131. pChildRR->appendChild(pTextRR);
  12132. pChildFVC->appendChild(pTextFVC);
  12133. pChildPEF->appendChild(pTextPEF);
  12134. pChildTV->appendChild(pTextTV);
  12135. pChildVC->appendChild(pTextVC);
  12136. pChildMVV->appendChild(pTextMVV);
  12137. pChildMV->appendChild(pTextMV);
  12138. pChildVSTHeight->appendChild(pTextVSTHeight);
  12139. pChildVSMvvBsa->appendChild(pTextVSMvvBsa);
  12140. pChildVSMvvOne->appendChild(pTextVSMvvOne);
  12141. pChildSVC->appendChild(pTextSVC);
  12142. pChildFevOneZeroFive->appendChild(pTextFevOneZeroFive);
  12143. pChildFevOneZeroFivePer->appendChild(pTextFevOneZeroFivePer);
  12144. pChildPefOne->appendChild(pTextPefOne);
  12145. pChildPefTwo->appendChild(pTextPefTwo);
  12146. pChildPefThree->appendChild(pTextPefThree);
  12147. pChildFive->appendChild(pTextFive);
  12148. pChildFiveOne->appendChild(pTextFiveOne);
  12149. pChildFiveTwo->appendChild(pTextFiveTwo);
  12150. pChildFiveThree->appendChild(pTextFiveThree);
  12151. pChildPif->appendChild(pTextPif);
  12152. pChildMifFifty->appendChild(pTextMifFifty);
  12153. pChildDetectionTime->appendChild(pTextDetectionTime);
  12154. pChildDetectionResult->appendChild(pTextDetectionResutl);
  12155. pChildEquCode->appendChild(pTextEquCode);
  12156. pChildId->appendChild(pTextId);
  12157. pChildRoomId->appendChild(pTextRoomId);
  12158. pRoot->appendChild(pChildTimeStamp);
  12159. pRoot->appendChild(pChildAccessCode);
  12160. pRoot->appendChild(pChildDiscernType);
  12161. pRoot->appendChild(pChildDiscernData);
  12162. pRoot->appendChild(pChildM_B1);
  12163. pRoot->appendChild(pChildBSA);
  12164. pRoot->appendChild(pChildBSA1);
  12165. pRoot->appendChild(pChildMMF);
  12166. pRoot->appendChild(pChildMefSeventyFive);
  12167. pRoot->appendChild(pChildMefFifty);
  12168. pRoot->appendChild(pChildMefTwentyFive);
  12169. pRoot->appendChild(pChildMefFVST);
  12170. pRoot->appendChild(pChildIC);
  12171. pRoot->appendChild(pChildIRV);
  12172. pRoot->appendChild(pChildERV);
  12173. pRoot->appendChild(pChildFevOne);
  12174. pRoot->appendChild(pChildFevTwo);
  12175. pRoot->appendChild(pChildFevThree);
  12176. pRoot->appendChild(pChildFevOnePer);
  12177. pRoot->appendChild(pChildFevTwoPer);
  12178. pRoot->appendChild(pChildFevThreePer);
  12179. pRoot->appendChild(pChildRR);
  12180. pRoot->appendChild(pChildFVC);
  12181. pRoot->appendChild(pChildPEF);
  12182. pRoot->appendChild(pChildTV);
  12183. pRoot->appendChild(pChildVC);
  12184. pRoot->appendChild(pChildMVV);
  12185. pRoot->appendChild(pChildMV);
  12186. pRoot->appendChild(pChildVSTHeight);
  12187. pRoot->appendChild(pChildVSMvvBsa);
  12188. pRoot->appendChild(pChildVSMvvOne);
  12189. pRoot->appendChild(pChildSVC);
  12190. pRoot->appendChild(pChildFevOneZeroFive);
  12191. pRoot->appendChild(pChildFevOneZeroFivePer);
  12192. pRoot->appendChild(pChildPefOne);
  12193. pRoot->appendChild(pChildPefTwo);
  12194. pRoot->appendChild(pChildPefThree);
  12195. pRoot->appendChild(pChildFive);
  12196. pRoot->appendChild(pChildFiveOne);
  12197. pRoot->appendChild(pChildFiveTwo);
  12198. pRoot->appendChild(pChildFiveThree);
  12199. pRoot->appendChild(pChildPif);
  12200. pRoot->appendChild(pChildMifFifty);
  12201. pRoot->appendChild(pChildDetectionTime);
  12202. pRoot->appendChild(pChildDetectionResult);
  12203. pRoot->appendChild(pChildEquCode);
  12204. pRoot->appendChild(pChildId);
  12205. pRoot->appendChild(pChildRoomId);
  12206. //pDoc->appendChild(pi);
  12207. pDoc->appendChild(pRoot);
  12208. string stringXmlContent;
  12209. int nRet = PHMS_SUCCESSFUL_RESULT;
  12210. nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent);
  12211. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12212. {
  12213. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12214. return nRet;
  12215. }
  12216. this->SetXmlCommandType_Telecom(SYNC_LUNG);
  12217. this->SetNetConfigType(TELECOM_XML);
  12218. nRet = ExecuteXmlSession_Telecom(stringXmlContent);
  12219. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12220. {
  12221. //写日志
  12222. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12223. return nRet;
  12224. }
  12225. return PHMS_SUCCESSFUL_RESULT;
  12226. }
  12227. int CPhmsSession::ECGUpload_Telecom(string stringPersonType, string stringPersonId, string stringDetectionTime, string stringEquCode, string stringRoomId, TELCOM_ECG ecgData)
  12228. {
  12229. DateTime dt;
  12230. dt += Timespan(Timezone::utcOffset(), 0);
  12231. string stringDateTime = DateTimeFormatter::format(dt, "%Y-%m-%d %H:%M:%S");
  12232. AutoPtr<Document> pDoc = new Document;
  12233. AutoPtr<ProcessingInstruction> pi = pDoc->createProcessingInstruction("xml", "version='1.0' encoding='utf-8'");
  12234. AutoPtr<Element> pRoot = pDoc->createElement("root");
  12235. AutoPtr<Element> pChildTimeStamp = pDoc->createElement("TimeStamp");
  12236. AutoPtr<Element> pChildAccessCode = pDoc->createElement("AccessCode");
  12237. AutoPtr<Element> pChildDiscernType = pDoc->createElement("UserDiscernType");
  12238. AutoPtr<Element> pChildDiscernData = pDoc->createElement("UserDiscernData");
  12239. AutoPtr<Element> pChildDetectionTime = pDoc->createElement("DetectionTime");
  12240. AutoPtr<Element> pChildDetectionResult = pDoc->createElement("DetectionResult");
  12241. AutoPtr<Element> pChildEquCode = pDoc->createElement("EquCode");
  12242. AutoPtr<Element> pChildId = pDoc->createElement("Id");
  12243. AutoPtr<Element> pChildRoomId = pDoc->createElement("RoomId");
  12244. AutoPtr<Element> pChildEcgLeadType = pDoc->createElement("EcgLeadType");
  12245. AutoPtr<Element> pChildEcgLeadList = pDoc->createElement("EcgLeadList");
  12246. AutoPtr<Text> pTextTimeStamp = pDoc->createTextNode(stringDateTime);
  12247. AutoPtr<Text> pTextAccessCode = pDoc->createTextNode("CONTEC");
  12248. AutoPtr<Text> pTextDiscernType = 0;
  12249. pTextDiscernType = pDoc->createTextNode(stringPersonType);
  12250. // if(nCardType == 1)
  12251. // {
  12252. // pTextDiscernType = pDoc->createTextNode("01");
  12253. // }
  12254. // else
  12255. // {
  12256. // pTextDiscernType = pDoc->createTextNode("02");
  12257. // }
  12258. AutoPtr<Text> pTextDiscernData = pDoc->createTextNode(stringPersonId);
  12259. AutoPtr<Text> pTextDetectionTime = pDoc->createTextNode(stringDetectionTime);
  12260. AutoPtr<Text> pTextDetectionResutl = pDoc->createTextNode(ecgData.result1);
  12261. AutoPtr<Text> pTextEquCode = pDoc->createTextNode(stringEquCode);
  12262. AutoPtr<Text> pTextId = pDoc->createTextNode("");
  12263. AutoPtr<Text> pTextRoomId = pDoc->createTextNode(stringRoomId);
  12264. AutoPtr<Text> pTextEcgLeadType = pDoc->createTextNode("ECG1ECG2ECG3ECG4ECG5ECG6ECG7ECG8ECG9ECG10ECG11ECG12");
  12265. pChildTimeStamp->appendChild(pTextTimeStamp);
  12266. pChildAccessCode->appendChild(pTextAccessCode);
  12267. pChildDiscernType->appendChild(pTextDiscernType);
  12268. pChildDiscernData->appendChild(pTextDiscernData);
  12269. pChildDetectionTime->appendChild(pTextDetectionTime);
  12270. pChildDetectionResult->appendChild(pTextDetectionResutl);
  12271. pChildEquCode->appendChild(pTextEquCode);
  12272. pChildId->appendChild(pTextId);
  12273. pChildRoomId->appendChild(pTextRoomId);
  12274. pChildEcgLeadType->appendChild(pTextEcgLeadType);
  12275. for(int i=1; i<=ecgData.nArrayLength; i++)
  12276. {
  12277. AutoPtr<Element> pGrandChildEcgLeadInfo = pDoc->createElement("EcgLeadInfo");
  12278. AutoPtr<Element> pGrand2ChildLeadId = pDoc->createElement("LeadId");
  12279. AutoPtr<Element> pGrand2ChildLeadType = pDoc->createElement("LeadType");
  12280. AutoPtr<Element> pGrand2ChildLeadData = pDoc->createElement("LeadData");
  12281. AutoPtr<Element> pGrand2ChildAdRate = pDoc->createElement("AdRate");
  12282. AutoPtr<Element> pGrand2ChildAdAccuracy = pDoc->createElement("AdAccuracy");
  12283. AutoPtr<Element> pGrand2ChildRangeMin = pDoc->createElement("RangeMin");
  12284. AutoPtr<Element> pGrand2ChildRangeMax = pDoc->createElement("RangeMax");
  12285. AutoPtr<Element> pGrand2ChildHeartValue = pDoc->createElement("HeartValue");
  12286. AutoPtr<Element> pGrand2ChildStLevel = pDoc->createElement("StLevel");
  12287. AutoPtr<Element> pGrand2ChildPrInterval = pDoc->createElement("PrInterval");
  12288. AutoPtr<Element> pGrand2ChildQtInterval = pDoc->createElement("QtInterval");
  12289. AutoPtr<Element> pGrand2ChildRrInterval = pDoc->createElement("RrInterval");
  12290. AutoPtr<Element> pGrand2ChildPWave = pDoc->createElement("PWave");
  12291. AutoPtr<Element> pGrand2ChildRWave = pDoc->createElement("RWave");
  12292. AutoPtr<Element> pGrand2ChildTWave = pDoc->createElement("TWave");
  12293. AutoPtr<Element> pGrand2ChildResult1 = pDoc->createElement("Result1");
  12294. AutoPtr<Element> pGrand2ChildResult2 = pDoc->createElement("Result2");
  12295. AutoPtr<Element> pGrand2ChildResult3 = pDoc->createElement("Result3");
  12296. AutoPtr<Element> pGrand2ChildResult4 = pDoc->createElement("Result4");
  12297. AutoPtr<Element> pGrand2ChildResult5 = pDoc->createElement("Result5");
  12298. string stringLeadType = "ECG";
  12299. stringLeadType += CUtil::ULongToString(i);
  12300. string stringLeadId;
  12301. stringLeadId = CUtil::GetMd5(stringLeadType.c_str(), stringLeadType.size());
  12302. AutoPtr<Text> pTextLeadId = pDoc->createTextNode(stringLeadId.substr(0, 16));
  12303. AutoPtr<Text> pTextLeadType = pDoc->createTextNode(stringLeadType);
  12304. AutoPtr<Text> pTextLeadData = pDoc->createTextNode(ecgData.pArrayData[i-1]);
  12305. AutoPtr<Text> pTextAdRate = pDoc->createTextNode(ecgData.adRate);
  12306. AutoPtr<Text> pTextAdAccuracy = pDoc->createTextNode(ecgData.adAccuracy);
  12307. AutoPtr<Text> pTextRangeMin = pDoc->createTextNode(ecgData.rangeMin);
  12308. AutoPtr<Text> pTextRangeMax = pDoc->createTextNode(ecgData.rangeMax);
  12309. AutoPtr<Text> pTextHeartValue = pDoc->createTextNode(ecgData.heartValue);
  12310. AutoPtr<Text> pTextStLevel = pDoc->createTextNode(ecgData.stLevel);
  12311. AutoPtr<Text> pTextPrInterval = pDoc->createTextNode(ecgData.prInterval);
  12312. AutoPtr<Text> pTextQtInterval = pDoc->createTextNode(ecgData.qtInterval);
  12313. AutoPtr<Text> pTextRrInterval = pDoc->createTextNode(ecgData.rrInterval);
  12314. AutoPtr<Text> pTextPWave = pDoc->createTextNode(ecgData.pWave);
  12315. AutoPtr<Text> pTextRWave = pDoc->createTextNode(ecgData.rWave);
  12316. AutoPtr<Text> pTextTWave = pDoc->createTextNode(ecgData.tWave);
  12317. AutoPtr<Text> pTextResult1 = pDoc->createTextNode(""/*ecgData.result1*/);
  12318. AutoPtr<Text> pTextResult2 = pDoc->createTextNode(ecgData.result2);
  12319. AutoPtr<Text> pTextResult3 = pDoc->createTextNode(ecgData.result3);
  12320. AutoPtr<Text> pTextResult4 = pDoc->createTextNode(ecgData.result4);
  12321. AutoPtr<Text> pTextResult5 = pDoc->createTextNode(ecgData.result5);
  12322. pGrand2ChildLeadId->appendChild(pTextLeadId);
  12323. pGrand2ChildLeadType->appendChild(pTextLeadType);
  12324. pGrand2ChildLeadData->appendChild(pTextLeadData);
  12325. pGrand2ChildAdRate->appendChild(pTextAdRate);
  12326. pGrand2ChildAdAccuracy->appendChild(pTextAdAccuracy);
  12327. pGrand2ChildRangeMin->appendChild(pTextRangeMin);
  12328. pGrand2ChildRangeMax->appendChild(pTextRangeMax);
  12329. pGrand2ChildHeartValue->appendChild(pTextHeartValue);
  12330. pGrand2ChildStLevel->appendChild(pTextStLevel);
  12331. pGrand2ChildPrInterval->appendChild(pTextPrInterval);
  12332. pGrand2ChildQtInterval->appendChild(pTextQtInterval);
  12333. pGrand2ChildRrInterval->appendChild(pTextRrInterval);
  12334. pGrand2ChildPWave->appendChild(pTextPWave);
  12335. pGrand2ChildRWave->appendChild(pTextRWave);
  12336. pGrand2ChildTWave->appendChild(pTextTWave);
  12337. pGrand2ChildResult1->appendChild(pTextResult1);
  12338. pGrand2ChildResult2->appendChild(pTextResult2);
  12339. pGrand2ChildResult3->appendChild(pTextResult3);
  12340. pGrand2ChildResult4->appendChild(pTextResult4);
  12341. pGrand2ChildResult5->appendChild(pTextResult5);
  12342. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildLeadId);
  12343. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildLeadType);
  12344. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildLeadData);
  12345. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildAdRate);
  12346. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildAdAccuracy);
  12347. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildRangeMin);
  12348. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildRangeMax);
  12349. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildHeartValue);
  12350. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildStLevel);
  12351. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildPrInterval);
  12352. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildQtInterval);
  12353. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildRrInterval);
  12354. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildPWave);
  12355. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildRWave);
  12356. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildTWave);
  12357. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildResult1);
  12358. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildResult2);
  12359. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildResult3);
  12360. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildResult4);
  12361. pGrandChildEcgLeadInfo->appendChild(pGrand2ChildResult5);
  12362. pChildEcgLeadList->appendChild(pGrandChildEcgLeadInfo);
  12363. }
  12364. pRoot->appendChild(pChildTimeStamp);
  12365. pRoot->appendChild(pChildAccessCode);
  12366. pRoot->appendChild(pChildDiscernType);
  12367. pRoot->appendChild(pChildDiscernData);
  12368. pRoot->appendChild(pChildDetectionTime);
  12369. pRoot->appendChild(pChildDetectionResult);
  12370. pRoot->appendChild(pChildEquCode);
  12371. pRoot->appendChild(pChildId);
  12372. pRoot->appendChild(pChildRoomId);
  12373. pRoot->appendChild(pChildEcgLeadType);
  12374. pRoot->appendChild(pChildEcgLeadList);
  12375. //pDoc->appendChild(pi);
  12376. pDoc->appendChild(pRoot);
  12377. string stringXmlContent;
  12378. int nRet = PHMS_SUCCESSFUL_RESULT;
  12379. nRet = this->GetRequestXmlNoBase64(pDoc, stringXmlContent, true);
  12380. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12381. {
  12382. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12383. return nRet;
  12384. }
  12385. this->SetXmlCommandType_Telecom(SYNC_ECG);
  12386. this->SetNetConfigType(TELECOM_XML);
  12387. nRet = ExecuteXmlSession_Telecom(stringXmlContent);
  12388. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12389. {
  12390. //写日志
  12391. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12392. return nRet;
  12393. }
  12394. return PHMS_SUCCESSFUL_RESULT;
  12395. }
  12396. int CPhmsSession::GetToken_XiKang()
  12397. {
  12398. string stringClientId;
  12399. string stringClientSecret;
  12400. if(CPhmsSession::m_stringClientId_XiKang.size()==0 || CPhmsSession::m_stringClientSecret_XiKang.size()==0)
  12401. {
  12402. string stringWorkingDir = CUtil::GetCurrentAppDir();
  12403. string stringIniFilePath = stringWorkingDir+"PhmsConfig.ini";
  12404. AutoPtr<IniFileConfiguration> iniFile = new IniFileConfiguration(stringIniFilePath, "gbk");
  12405. stringClientId = iniFile->getString("XIKANG.ClientId", "");
  12406. stringClientSecret = iniFile->getString("XIKANG.CliengSecret", "");
  12407. }
  12408. else
  12409. {
  12410. stringClientId = CPhmsSession::m_stringClientId_XiKang;
  12411. stringClientSecret = CPhmsSession::m_stringClientSecret_XiKang;
  12412. }
  12413. map<string, string> mapParam;
  12414. mapParam["grant_type"] = "client_credentials";
  12415. mapParam["scope"] = "trust";
  12416. mapParam["client_id"] = stringClientId;
  12417. mapParam["client_secret"] = stringClientSecret;
  12418. int nRet = PHMS_SUCCESSFUL_RESULT;
  12419. this->SetXiKangCommandType(GET_TOKEN_XIKANG);
  12420. this->SetNetConfigType(XIKANG_FORM);
  12421. nRet = ExecuteXiKangSession(mapParam, "", "");
  12422. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12423. {
  12424. //写日志
  12425. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12426. return nRet;
  12427. }
  12428. //处理token
  12429. CPhmsSession::m_stringToken_XiKang = "";
  12430. CPhmsSession::m_stringToken_XiKang = this->GetXiKangToken(m_nSaveType, m_stringContent, m_stringFilePath);
  12431. if(m_stringToken_XiKang.size() == 0)
  12432. {
  12433. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_GET_TOKEN_FAIL), __FUNCTION__, __FILE__, __LINE__);
  12434. return COMMON_GET_TOKEN_FAIL;
  12435. }
  12436. CPhmsSession::m_stringClientId_XiKang = stringClientId;
  12437. CPhmsSession::m_stringClientSecret_XiKang = stringClientSecret;
  12438. return PHMS_SUCCESSFUL_RESULT;
  12439. }
  12440. int CPhmsSession::Login_XiKang(string stringUsername, string stringPassword)
  12441. {
  12442. int nRet = PHMS_SUCCESSFUL_RESULT;
  12443. if(CPhmsSession::m_stringToken_XiKang.size() == 0)
  12444. {
  12445. nRet = this->GetToken_XiKang();
  12446. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12447. {
  12448. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12449. return nRet;
  12450. }
  12451. }
  12452. map<string, string> mapParam;
  12453. mapParam["userAccount"] = stringUsername;
  12454. mapParam["password"] = stringPassword;
  12455. this->SetXiKangCommandType(LOGIN_XIKANG);
  12456. this->SetNetConfigType(XIKANG_FORM);
  12457. nRet = ExecuteXiKangSession(mapParam, "", "");
  12458. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12459. {
  12460. if(nRet == COMMON_URL_NOT_FOUND)
  12461. {
  12462. //token失效
  12463. nRet = this->GetToken_XiKang();
  12464. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12465. {
  12466. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12467. return nRet;
  12468. }
  12469. this->SetXiKangCommandType(LOGIN_XIKANG);
  12470. this->SetNetConfigType(XIKANG_FORM);
  12471. nRet = ExecuteXiKangSession(mapParam, "", "");
  12472. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12473. {
  12474. //写日志
  12475. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12476. return nRet;
  12477. }
  12478. }
  12479. else
  12480. {
  12481. //写日志
  12482. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12483. return nRet;
  12484. }
  12485. }
  12486. return PHMS_SUCCESSFUL_RESULT;
  12487. }
  12488. int CPhmsSession::RegisterPatientId_XiKang(string stringName, string stringSex, string stringPhoneNum, string stringProofNum)
  12489. {
  12490. int nRet = PHMS_SUCCESSFUL_RESULT;
  12491. if(CPhmsSession::m_stringToken_XiKang.size() == 0)
  12492. {
  12493. nRet = this->GetToken_XiKang();
  12494. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12495. {
  12496. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12497. return nRet;
  12498. }
  12499. }
  12500. //网络库内部处理性别名称和生日
  12501. string stringBirthday;
  12502. string stringYear = stringProofNum.substr(6, 4);
  12503. string stringMonth = stringProofNum.substr(10, 2);
  12504. string stringDay = stringProofNum.substr(12, 2);
  12505. stringBirthday = stringYear+"-"+stringMonth+"-"+stringDay+"T08:00:00";
  12506. string stringSexName;
  12507. if(stringSex == "1")
  12508. {
  12509. stringSexName = "男";
  12510. }
  12511. else if(stringSex == "2")
  12512. {
  12513. stringSexName = "女";
  12514. }
  12515. else
  12516. {
  12517. stringSexName = "未知";
  12518. }
  12519. map<string, string> mapParam;
  12520. map<string, string> mapJson;
  12521. string stringJson;
  12522. mapJson["personName"] = stringName;
  12523. mapJson["genderCode"] = stringSex;
  12524. mapJson["genderName"] = stringSexName;
  12525. mapJson["birthday"] = stringBirthday;
  12526. mapJson["mobileNum"] = stringPhoneNum;
  12527. mapJson["proofCode"] = "01";
  12528. mapJson["proofNum"] = stringProofNum;
  12529. stringJson = CUtil::MapToJson(mapJson);
  12530. mapParam["memberBean"] = stringJson;
  12531. this->SetXiKangCommandType(REGISTER_PATIENT_XIKANG);
  12532. this->SetNetConfigType(XIKANG_FORM);
  12533. nRet = ExecuteXiKangSession(mapParam, "", "");
  12534. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12535. {
  12536. if(nRet == COMMON_URL_NOT_FOUND)
  12537. {
  12538. //token失效
  12539. nRet = this->GetToken_XiKang();
  12540. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12541. {
  12542. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12543. return nRet;
  12544. }
  12545. this->SetXiKangCommandType(REGISTER_PATIENT_XIKANG);
  12546. this->SetNetConfigType(XIKANG_FORM);
  12547. nRet = ExecuteXiKangSession(mapParam, "", "");
  12548. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12549. {
  12550. //写日志
  12551. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12552. return nRet;
  12553. }
  12554. }
  12555. else
  12556. {
  12557. //写日志
  12558. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12559. return nRet;
  12560. }
  12561. }
  12562. return PHMS_SUCCESSFUL_RESULT;
  12563. }
  12564. int CPhmsSession::RegisterPatientInfo_XiKang(string stringPatientOpenId, string stringName, string stringSex, string stringPhoneNum, string stringProofNum, string stringPassword)
  12565. {
  12566. int nRet = PHMS_SUCCESSFUL_RESULT;
  12567. if(CPhmsSession::m_stringToken_XiKang.size() == 0)
  12568. {
  12569. nRet = this->GetToken_XiKang();
  12570. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12571. {
  12572. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12573. return nRet;
  12574. }
  12575. }
  12576. map<string, string> mapParam;
  12577. map<string, string> mapJson;
  12578. string stringJson;
  12579. mapJson["personPHRCode"] = stringPatientOpenId;
  12580. mapJson["memberCode"] = stringPatientOpenId;
  12581. mapJson["userFullName"] = stringName;
  12582. //mapJson["genderCode"] = stringSex;
  12583. mapJson["mobileNum"] = stringPhoneNum;
  12584. mapJson["userType"] = "0";
  12585. //mapJson["proofCode"] = "01";
  12586. mapJson["proofNum"] = stringProofNum;
  12587. mapJson["userPassword"] = stringPassword;
  12588. stringJson = CUtil::MapToJson(mapJson);
  12589. mapParam["ManagerAccount"] = stringJson;
  12590. this->SetXiKangCommandType(REGISTER_PATIENT_INFO_XIKANG);
  12591. this->SetNetConfigType(XIKANG_FORM);
  12592. nRet = ExecuteXiKangSession(mapParam, "", stringPatientOpenId);
  12593. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12594. {
  12595. if(nRet == COMMON_URL_NOT_FOUND)
  12596. {
  12597. //token失效
  12598. nRet = this->GetToken_XiKang();
  12599. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12600. {
  12601. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12602. return nRet;
  12603. }
  12604. this->SetXiKangCommandType(REGISTER_PATIENT_INFO_XIKANG);
  12605. this->SetNetConfigType(XIKANG_FORM);
  12606. nRet = ExecuteXiKangSession(mapParam, "", stringPatientOpenId);
  12607. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12608. {
  12609. //写日志
  12610. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12611. return nRet;
  12612. }
  12613. }
  12614. else
  12615. {
  12616. //写日志
  12617. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12618. return nRet;
  12619. }
  12620. }
  12621. return PHMS_SUCCESSFUL_RESULT;
  12622. }
  12623. int CPhmsSession::BindPatient_XiKang(string stringDoctorOpenId, string stringPatientOpenId)
  12624. {
  12625. int nRet = PHMS_SUCCESSFUL_RESULT;
  12626. if(CPhmsSession::m_stringToken_XiKang.size() == 0)
  12627. {
  12628. nRet = this->GetToken_XiKang();
  12629. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12630. {
  12631. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12632. return nRet;
  12633. }
  12634. }
  12635. map<string, string> mapParam;
  12636. map<string, string> mapJson;
  12637. string stringJson;
  12638. mapJson["caregiverCode"] = stringDoctorOpenId;
  12639. mapJson["memberCode"] = stringPatientOpenId;
  12640. stringJson = CUtil::MapToJson(mapJson);
  12641. mapParam["memberCaregiverBean"] = stringJson;
  12642. this->SetXiKangCommandType(BIND_PATIENT_XIKANG);
  12643. this->SetNetConfigType(XIKANG_FORM);
  12644. nRet = ExecuteXiKangSession(mapParam, "", "");
  12645. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12646. {
  12647. if(nRet == COMMON_URL_NOT_FOUND)
  12648. {
  12649. //token失效
  12650. nRet = this->GetToken_XiKang();
  12651. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12652. {
  12653. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12654. return nRet;
  12655. }
  12656. this->SetXiKangCommandType(BIND_PATIENT_XIKANG);
  12657. this->SetNetConfigType(XIKANG_FORM);
  12658. nRet = ExecuteXiKangSession(mapParam, "", "");
  12659. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12660. {
  12661. //写日志
  12662. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12663. return nRet;
  12664. }
  12665. }
  12666. else
  12667. {
  12668. //写日志
  12669. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12670. return nRet;
  12671. }
  12672. }
  12673. return PHMS_SUCCESSFUL_RESULT;
  12674. }
  12675. int CPhmsSession::GetPatientIdList_XiKang(string stringDoctorOpenId)
  12676. {
  12677. int nRet = PHMS_SUCCESSFUL_RESULT;
  12678. if(CPhmsSession::m_stringToken_XiKang.size() == 0)
  12679. {
  12680. nRet = this->GetToken_XiKang();
  12681. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12682. {
  12683. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12684. return nRet;
  12685. }
  12686. }
  12687. map<string, string> mapParam;
  12688. mapParam["caregiverCode"] = stringDoctorOpenId;
  12689. mapParam["firstResult"] = "-1";
  12690. mapParam["pageSize"] = "5000";
  12691. this->SetXiKangCommandType(GET_PATIENT_ID_XIKANG);
  12692. this->SetNetConfigType(XIKANG_FORM);
  12693. nRet = ExecuteXiKangSession(mapParam, "", "");
  12694. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12695. {
  12696. if(nRet == COMMON_URL_NOT_FOUND)
  12697. {
  12698. //token失效
  12699. nRet = this->GetToken_XiKang();
  12700. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12701. {
  12702. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12703. return nRet;
  12704. }
  12705. this->SetXiKangCommandType(GET_PATIENT_ID_XIKANG);
  12706. this->SetNetConfigType(XIKANG_FORM);
  12707. nRet = ExecuteXiKangSession(mapParam, "", "");
  12708. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12709. {
  12710. //写日志
  12711. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12712. return nRet;
  12713. }
  12714. }
  12715. else
  12716. {
  12717. //写日志
  12718. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12719. return nRet;
  12720. }
  12721. }
  12722. return PHMS_SUCCESSFUL_RESULT;
  12723. }
  12724. int CPhmsSession::GetPatientInfo_XiKang(string stringPatientOpenId)
  12725. {
  12726. int nRet = PHMS_SUCCESSFUL_RESULT;
  12727. if(CPhmsSession::m_stringToken_XiKang.size() == 0)
  12728. {
  12729. nRet = this->GetToken_XiKang();
  12730. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12731. {
  12732. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12733. return nRet;
  12734. }
  12735. }
  12736. map<string, string> mapParam;
  12737. //mapParam["openID"] = stringPatientOpenId;
  12738. this->SetXiKangCommandType(GET_PATIENT_INFO_XIKANG);
  12739. this->SetNetConfigType(XIKANG_FORM);
  12740. nRet = ExecuteXiKangSession(mapParam, "", stringPatientOpenId);
  12741. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12742. {
  12743. if(nRet == COMMON_URL_NOT_FOUND)
  12744. {
  12745. //token失效
  12746. nRet = this->GetToken_XiKang();
  12747. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12748. {
  12749. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12750. return nRet;
  12751. }
  12752. this->SetXiKangCommandType(GET_PATIENT_INFO_XIKANG);
  12753. this->SetNetConfigType(XIKANG_FORM);
  12754. nRet = ExecuteXiKangSession(mapParam, "", stringPatientOpenId);
  12755. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12756. {
  12757. //写日志
  12758. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12759. return nRet;
  12760. }
  12761. }
  12762. else
  12763. {
  12764. //写日志
  12765. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12766. return nRet;
  12767. }
  12768. }
  12769. return PHMS_SUCCESSFUL_RESULT;
  12770. }
  12771. int CPhmsSession::SearchPatientId_XiKang(string stringKey, string stringValue)
  12772. {
  12773. int nRet = PHMS_SUCCESSFUL_RESULT;
  12774. if(CPhmsSession::m_stringToken_XiKang.size() == 0)
  12775. {
  12776. nRet = this->GetToken_XiKang();
  12777. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12778. {
  12779. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12780. return nRet;
  12781. }
  12782. }
  12783. map<string, string> mapParam;
  12784. mapParam["queryItem"] = stringKey;
  12785. mapParam["queryValue"] = stringValue;
  12786. this->SetXiKangCommandType(SEARCH_PATIENT_ID_XIKANG);
  12787. this->SetNetConfigType(XIKANG_FORM);
  12788. nRet = ExecuteXiKangSession(mapParam, "", "");
  12789. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12790. {
  12791. if(nRet == COMMON_URL_NOT_FOUND)
  12792. {
  12793. //token失效
  12794. nRet = this->GetToken_XiKang();
  12795. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12796. {
  12797. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12798. return nRet;
  12799. }
  12800. this->SetXiKangCommandType(SEARCH_PATIENT_ID_XIKANG);
  12801. this->SetNetConfigType(XIKANG_FORM);
  12802. nRet = ExecuteXiKangSession(mapParam, "", "");
  12803. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12804. {
  12805. //写日志
  12806. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12807. return nRet;
  12808. }
  12809. }
  12810. else
  12811. {
  12812. //写日志
  12813. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12814. return nRet;
  12815. }
  12816. }
  12817. return PHMS_SUCCESSFUL_RESULT;
  12818. }
  12819. int CPhmsSession::GetCaseList_XiKang(vector<string> vPatientOpenId)
  12820. {
  12821. int nRet = PHMS_SUCCESSFUL_RESULT;
  12822. if(CPhmsSession::m_stringToken_XiKang.size() == 0)
  12823. {
  12824. nRet = this->GetToken_XiKang();
  12825. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12826. {
  12827. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12828. return nRet;
  12829. }
  12830. }
  12831. map<string, string> mapParam;
  12832. map<string, string> mapJson;
  12833. string stringParamValue;
  12834. vector<string>::iterator iter = vPatientOpenId.begin();
  12835. int i = 0;
  12836. for(iter; iter!=vPatientOpenId.end(); iter++)
  12837. {
  12838. stringParamValue += *iter;
  12839. i++;
  12840. if(i != vPatientOpenId.size())
  12841. {
  12842. stringParamValue += ",";
  12843. }
  12844. }
  12845. mapJson["memberCodes"] = stringParamValue;
  12846. mapJson["states"] = "0,1,2,3";
  12847. mapJson["startDate"] = "0";
  12848. mapJson["endDate"] = "0";
  12849. string stringJson = CUtil::MapToJson(mapJson);
  12850. mapParam["FindDetailByMemberCodes"] = stringJson;
  12851. this->SetXiKangCommandType(GET_CASE_LIST_XIKANG);
  12852. this->SetNetConfigType(XIKANG_FORM);
  12853. nRet = ExecuteXiKangSession(mapParam, "", "");
  12854. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12855. {
  12856. if(nRet == COMMON_URL_NOT_FOUND)
  12857. {
  12858. //token失效
  12859. nRet = this->GetToken_XiKang();
  12860. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12861. {
  12862. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12863. return nRet;
  12864. }
  12865. this->SetXiKangCommandType(GET_CASE_LIST_XIKANG);
  12866. this->SetNetConfigType(XIKANG_FORM);
  12867. nRet = ExecuteXiKangSession(mapParam, "", "");
  12868. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12869. {
  12870. //写日志
  12871. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12872. return nRet;
  12873. }
  12874. }
  12875. else
  12876. {
  12877. //写日志
  12878. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12879. return nRet;
  12880. }
  12881. }
  12882. return PHMS_SUCCESSFUL_RESULT;
  12883. }
  12884. int CPhmsSession::SubmitCase_XiKang(string stringPatientOpenId, string stringAdvice, string stringCaseType, string stringEcgXmlContent)
  12885. {
  12886. int nRet = PHMS_SUCCESSFUL_RESULT;
  12887. if(CPhmsSession::m_stringToken_XiKang.size() == 0)
  12888. {
  12889. nRet = this->GetToken_XiKang();
  12890. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12891. {
  12892. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12893. return nRet;
  12894. }
  12895. }
  12896. map<string, string> mapParam;
  12897. map<string, string> mapJson;
  12898. mapJson["memberCode"] = stringPatientOpenId;
  12899. mapJson["advice"] = stringAdvice;
  12900. mapJson["cnstType"] = stringCaseType;
  12901. DateTime dt;
  12902. //dt += Timespan(Timezone::utcOffset(), 0);
  12903. mapJson["testTime"] = CUtil::Int64ToString(dt.timestamp().epochMicroseconds()/1000);
  12904. ostringstream ostr;
  12905. Base64Encoder encoderBase64(ostr);
  12906. encoderBase64<<stringEcgXmlContent;
  12907. encoderBase64.close();
  12908. string stringBase64Content = ostr.str();
  12909. CUtil::ReplaceString(stringBase64Content, "*", "+");
  12910. mapJson["fileContent"] = stringBase64Content;
  12911. string stringJson = CUtil::MapToJson(mapJson);
  12912. mapParam["AddEcgInfo"] = stringJson;
  12913. this->SetXiKangCommandType(SUBMIT_CASE_XIKANG);
  12914. this->SetNetConfigType(XIKANG_FORM);
  12915. nRet = ExecuteXiKangSession(mapParam, "", "");
  12916. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12917. {
  12918. if(nRet == COMMON_URL_NOT_FOUND)
  12919. {
  12920. //token失效
  12921. nRet = this->GetToken_XiKang();
  12922. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12923. {
  12924. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12925. return nRet;
  12926. }
  12927. this->SetXiKangCommandType(SUBMIT_CASE_XIKANG);
  12928. this->SetNetConfigType(XIKANG_FORM);
  12929. nRet = ExecuteXiKangSession(mapParam, "", "");
  12930. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12931. {
  12932. //写日志
  12933. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12934. return nRet;
  12935. }
  12936. }
  12937. else
  12938. {
  12939. //写日志
  12940. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12941. return nRet;
  12942. }
  12943. }
  12944. return PHMS_SUCCESSFUL_RESULT;
  12945. }
  12946. int CPhmsSession::GetReportFile_XiKang(string stringCaseId)
  12947. {
  12948. int nRet = PHMS_SUCCESSFUL_RESULT;
  12949. if(CPhmsSession::m_stringToken_XiKang.size() == 0)
  12950. {
  12951. nRet = this->GetToken_XiKang();
  12952. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12953. {
  12954. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12955. return nRet;
  12956. }
  12957. }
  12958. map<string, string> mapParam;
  12959. this->SetXiKangCommandType(GET_REPORT_URL_XIKANG);
  12960. this->SetNetConfigType(XIKANG_FORM);
  12961. nRet = ExecuteXiKangSession(mapParam, "", stringCaseId);
  12962. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12963. {
  12964. if(nRet == COMMON_URL_NOT_FOUND)
  12965. {
  12966. //token失效
  12967. nRet = this->GetToken_XiKang();
  12968. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12969. {
  12970. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12971. return nRet;
  12972. }
  12973. this->SetXiKangCommandType(GET_REPORT_URL_XIKANG);
  12974. this->SetNetConfigType(XIKANG_FORM);
  12975. nRet = ExecuteXiKangSession(mapParam, "", stringCaseId);
  12976. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12977. {
  12978. //写日志
  12979. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12980. return nRet;
  12981. }
  12982. }
  12983. else
  12984. {
  12985. //写日志
  12986. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  12987. return nRet;
  12988. }
  12989. }
  12990. return PHMS_SUCCESSFUL_RESULT;
  12991. }
  12992. int CPhmsSession::UploadFile_XiKang(string stringCaseId, string stringCaseFilePath)
  12993. {
  12994. int nRet = PHMS_SUCCESSFUL_RESULT;
  12995. if(CPhmsSession::m_stringToken_XiKang.size() == 0)
  12996. {
  12997. nRet = this->GetToken_XiKang();
  12998. if(nRet != PHMS_SUCCESSFUL_RESULT)
  12999. {
  13000. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  13001. return nRet;
  13002. }
  13003. }
  13004. map<string, string> mapParam;
  13005. mapParam["ecgId"] = stringCaseId;
  13006. mapParam["authority"] = "contec";
  13007. this->SetXiKangCommandType(UPLOAD_FILE_XIKANG);
  13008. this->SetNetConfigType(XIKANG_FORM);
  13009. nRet = ExecuteXiKangSession(mapParam, stringCaseFilePath, "");
  13010. if(nRet != PHMS_SUCCESSFUL_RESULT)
  13011. {
  13012. if(nRet == COMMON_URL_NOT_FOUND)
  13013. {
  13014. //token失效
  13015. nRet = this->GetToken_XiKang();
  13016. if(nRet != PHMS_SUCCESSFUL_RESULT)
  13017. {
  13018. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  13019. return nRet;
  13020. }
  13021. this->SetXiKangCommandType(UPLOAD_FILE_XIKANG);
  13022. this->SetNetConfigType(XIKANG_FORM);
  13023. nRet = ExecuteXiKangSession(mapParam, stringCaseFilePath, "");
  13024. if(nRet != PHMS_SUCCESSFUL_RESULT)
  13025. {
  13026. //写日志
  13027. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  13028. return nRet;
  13029. }
  13030. }
  13031. else
  13032. {
  13033. //写日志
  13034. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  13035. return nRet;
  13036. }
  13037. }
  13038. return PHMS_SUCCESSFUL_RESULT;
  13039. }
  13040. int CPhmsSession::ExecuteGWService(string stringLastPath, map<string, string> mapParam, string stringFilePath, bool bMustSsl)
  13041. {
  13042. CNetConfig netConfig;
  13043. int nRet = PHMS_SUCCESSFUL_RESULT;
  13044. //设置网络环境
  13045. try
  13046. {
  13047. string stringWorkingDir = CUtil::GetCurrentAppDir();
  13048. EnumNetConfigType enumNetConfigType = GW_FORM;
  13049. nRet = this->GetNetConfig(stringWorkingDir+"PhmsConfig.ini", netConfig, bMustSsl, enumNetConfigType);
  13050. netConfig.SetUrl(netConfig.GetUrl()+stringLastPath);
  13051. if(nRet != PHMS_SUCCESSFUL_RESULT)
  13052. {
  13053. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  13054. return nRet;
  13055. }
  13056. Mutex::ScopedLock lock(m_mutexAbortAndSslSwitch);
  13057. if(bMustSsl)
  13058. {
  13059. if(!m_bSsl)
  13060. {
  13061. delete m_pHttpSession;
  13062. m_pHttpSession = new CHttpSession(bMustSsl);
  13063. m_bSsl = bMustSsl;
  13064. }
  13065. }
  13066. else
  13067. {
  13068. if(m_bSsl != netConfig.GetSsl())
  13069. {
  13070. delete m_pHttpSession;
  13071. m_pHttpSession = new CHttpSession(netConfig.GetSsl());
  13072. m_bSsl = netConfig.GetSsl();
  13073. }
  13074. }
  13075. }
  13076. catch(FileNotFoundException& e)
  13077. {
  13078. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  13079. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  13080. return COMMON_NO_NET_CONFIG_FILE;
  13081. }
  13082. istream* pInputStream = NULL;
  13083. nRet = m_pHttpSession->ExecuteFormHttpSession(netConfig, mapParam, stringFilePath, pInputStream);
  13084. if(nRet != PHMS_SUCCESSFUL_RESULT)
  13085. {
  13086. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  13087. return nRet;
  13088. }
  13089. nRet = NoPhmsGetResult(pInputStream);
  13090. if(nRet != PHMS_SUCCESSFUL_RESULT)
  13091. {
  13092. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  13093. return nRet;
  13094. }
  13095. return PHMS_SUCCESSFUL_RESULT;
  13096. }
  13097. int CPhmsSession::ExecuteCommonRESTful(string stringIp, string stringPort, string stringUrl, string stringContentType, string stringPayload)
  13098. {
  13099. CNetConfig netConfig;
  13100. int nRet = PHMS_SUCCESSFUL_RESULT;
  13101. //设置网络环境
  13102. try
  13103. {
  13104. netConfig.SetHost(stringIp);
  13105. netConfig.SetAddr(stringIp);
  13106. if(stringPort.size() == 0)
  13107. {
  13108. netConfig.SetPort(80);
  13109. }
  13110. else
  13111. {
  13112. netConfig.SetPort(CUtil::StringToULong(stringPort));
  13113. }
  13114. netConfig.SetUrl(stringUrl);
  13115. netConfig.SetProxyType(NO_PROXY);
  13116. netConfig.SetSsl(false);
  13117. }
  13118. catch(FileNotFoundException& e)
  13119. {
  13120. CPhmsLogger::GetPhmsLogger()->WriteLog(e, __FUNCTION__, __FILE__, __LINE__);
  13121. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(COMMON_NO_NET_CONFIG_FILE), __FUNCTION__, __FILE__, __LINE__);
  13122. return COMMON_NO_NET_CONFIG_FILE;
  13123. }
  13124. istream* pInputStream = NULL;
  13125. map<string, string> mapParam;
  13126. nRet = m_pHttpSession->ExeceteCommonPostSession(netConfig, mapParam, stringContentType, stringPayload, pInputStream);
  13127. if(nRet != PHMS_SUCCESSFUL_RESULT)
  13128. {
  13129. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  13130. return nRet;
  13131. }
  13132. nRet = NoPhmsGetResult(pInputStream);
  13133. if(nRet != PHMS_SUCCESSFUL_RESULT)
  13134. {
  13135. CPhmsLogger::GetPhmsLogger()->WriteLog(CUtil::GetErrorMsg(nRet), __FUNCTION__, __FILE__, __LINE__);
  13136. return nRet;
  13137. }
  13138. return PHMS_SUCCESSFUL_RESULT;
  13139. }