C++客户端开发接口库 V5.1.8.15
连接信创集成中间件服务程序的二次开发接口
载入中...
搜索中...
未找到
MDWPack.h
1#pragma once
2
3#include <string>
4#include <vector>
5#include "unBaseFunction.h"
6#include "mdwclient_global.h"
7
9#define ENUM_CASE(name) case name: return #name;
10
12#define WM_CLIENT_LOGIN (0x0400 + 1555)
13
15#define WM_RECEIVED_FILE (0x0400 + 1556)
16
18#define WM_NET_MESSAGE (0x0400 + 1567)
19
21#define WM_SRVPUSH_MESSAGE (0x0400 + 1568)
22
24#define WM_DBUPDATE_MESSAGE (0x0400 + 1569)
25
27#define WM_STATUS_MESSAGE (0x0400 + 1570)
28
31#define PACK_LENGTH (0x17A0 - 0x14)
33#define PACK_MAIN_LEN 0xFFF
35#define SQL_RECORD_MAX_LEN 0x2000
37#define PACK_SQLDB_RECORD 10240
39#define PACKHEAD_LEN 0x14
41#define FILE_PACK_MAX_LEN (0xFFFF - PACKHEAD_LEN)
42
45#define PACK_TYPE_ROWBIN 0x04
47#define PACK_TYPE_DBPARA 0x05
49#define PACK_TYPE_CLIENTVERIFY 0x06
51#define PACK_TYPE_VERIFY 0x07
53#define PACK_TYPE_NORMAL 0x08
55#define PACK_TYPE_ROUTE_RESULT 0x09
57#define PACK_TYPE_HEAD 0x0A
59#define PACK_TYPE_ROW 0x0B
61#define PACK_TYPE_BIN 0x0C
63#define PACK_TYPE_CTRL 0x0D
65#define PACK_TYPE_CANCEL 0x0E
67#define MDWS_NODATA -99996
68
69namespace mdwc
70{
72 enum class MIDEncryptMode
73 {
75 emNone = 0,
77 emMac = 1,
79 emZip = 2,
82 };
83
85 enum class MidCharSet
86 {
88 AUTO = 0,
92 UTF8 = 2
93 };
94
111
112#pragma pack(push, 4)
115 {
117 char cUserCode[6];
119 char cUserName[41];
121 char cWorkStation[41];
123 char cAddress[16];
125 unsigned short wPort;
127 unsigned int dwLastAnswerTime;
128 };
129
132 {
136 char cDeviceName[21];
138 char cDeviceFlag[11];
139 };
140
141#define MAX_BRD_MESSAGE_LEN 512
144 {
146 uint8_t uMsgType;
148 char cSended[MAX_BRD_MESSAGE_LEN + 1];
150 char cContext[MAX_BRD_MESSAGE_LEN + 1];
151 };
152
181#pragma pack(pop)
182
185 {
187 uint8_t uMsgType;
189 std::string Sended;
191 std::string Context;
192 };
193
196 {
198 std::string sUserCode;
200 std::string sUserName;
202 std::string sWorkStation;
204 std::string sAddress;
206 unsigned short wPort;
208 unsigned int dwLastAnswerTime;
209 };
210
212 enum class FIELD_TYPE
213 {
215 FT_US = 'U',
217 FT_INT4 = 'N',
219 FT_FLOAT = 'F',
221 FT_STR = 'C',
223 FT_BIN = 'B',
228 };
229
232 {
234 std::string FieldName;
241 };
242
245 {
247 std::string ServerName;
251 std::string ClientIPAddress;
253 std::string VisitIPAddress;
255 std::string IPAddress;
257 int Port;
259 std::string Version;
285 std::string DICOM_AET;
289 std::string EnbledDBSysNames;
293 std::string MidClientID;
295 std::string BackupFloder;
297 std::string Charset;
298
306
310 std::string ConvertToString()
311 {
312 return "服务器名称:" + ServerName + ",版本:" + Version + ",节点号:" + std::to_string(RouteNodeNumber) +
313 ",RDMS=" + std::to_string(EnabledRDMS) + ",FileCache=" + std::to_string(EnableFileCache) +
314 ",Route=" + std::to_string(EnabledRoute) + ",Update]=" + std::to_string(EnabledUpdate) +
315 ",Dicom=" + std::to_string(EnabledDicom) + ",HL7=" + std::to_string(EnabledHL7) +
316 ",TTS=" + std::to_string(EnabledTTS) + ",ProxyServer=" + std::to_string(EnabledProxyServer) +
317 ",AIP=" + std::to_string(EnabledAIP) + ",SaveLogToRDMS=" + std::to_string(SaveLogToRDMS) + "\n" +
318 "DICOM_AET:" + DICOM_AET + ",DICOM_Port:" + std::to_string(DICOM_Port) +
319 ",EnbledDBSysNames:" + EnbledDBSysNames + ",MidClientID:" + MidClientID +
320 ",备份文件夹:" + BackupFloder + "," + Charset;
321 }
322
328 int VersionCompare(const std::string& version)
329 {
330 if (Version.empty() || version.empty())
331 return 0;
332
333 std::vector<std::string> sVerSplit1 = StringSplit(Version.c_str(), '.');
334 std::vector<std::string> sVerSplit2 = StringSplit(version.c_str(), '.');
335 if (sVerSplit1.size() == sVerSplit2.size())
336 {
337 for (size_t i = 0; i < sVerSplit1.size(); i++)
338 {
339 if (StrToInt(sVerSplit1[i]) && StrToInt(sVerSplit2[i]))
340 {
341 //作为整数处理
342 if (StrToInt(sVerSplit1[i]) < StrToInt(sVerSplit2[i]))
343 return -1;
344 else if (StrToInt(sVerSplit1[i]) > StrToInt(sVerSplit2[i]))
345 return 1;
346 }
347 else {
348 //作为字符串比较
349 if (sVerSplit1[i].compare(sVerSplit2[i]) < 0)
350 return -1;
351 else if (sVerSplit1[i].compare(sVerSplit2[i]) > 0)
352 return 1;
353 }
354 }
355 //相等
356 return 0;
357 }
358 else
359 {
360 //当作字符串处理
361 if (Version == version)
362 return 0;
363 else if (Version.compare(version) < 0)
364 return -1;
365 else
366 return 1;
367 }
368 }
369 };
370
379 MDWC_COMPLILE std::string GetMidPackField(const char* buf, int pos, char cSprt = 0x01);
380}
定义 AutoUpdateHelper.h:8
MidCharSet
定义 MDWPack.h:86
@ GB18030
定义 MDWPack.h:90
@ AUTO
定义 MDWPack.h:88
@ UTF8
定义 MDWPack.h:92
MDWC_COMPLILE std::string GetMidPackField(const char *buf, int pos, char cSprt=0x01)
定义 MDWPack.cpp:5
MSG_TYPE
定义 MDWPack.h:97
@ MSG_TYPE_LOGIN
定义 MDWPack.h:99
@ MSG_TYPE_LOGINANS
定义 MDWPack.h:105
@ MSG_TYPE_MESSAGE
定义 MDWPack.h:103
@ MSG_TYPE_UPDATEDB
定义 MDWPack.h:107
@ MSG_TYPE_LOGOUT
定义 MDWPack.h:101
@ MSG_TYPE_UPDATERECORD
定义 MDWPack.h:109
FIELD_TYPE
定义 MDWPack.h:213
@ FT_FLOAT
定义 MDWPack.h:219
@ FT_US
定义 MDWPack.h:215
@ FT_INT8
定义 MDWPack.h:227
@ FT_DATETIME
定义 MDWPack.h:225
@ FT_INT4
定义 MDWPack.h:217
@ FT_BIN
定义 MDWPack.h:223
@ FT_STR
定义 MDWPack.h:221
MIDEncryptMode
定义 MDWPack.h:73
@ emEncrypt
定义 MDWPack.h:81
@ emMac
定义 MDWPack.h:77
@ emNone
定义 MDWPack.h:75
@ emZip
定义 MDWPack.h:79
定义 MDWPack.h:155
bool bSocketConnected
定义 MDWPack.h:173
char cClientUID[31]
定义 MDWPack.h:169
int iListenPort
定义 MDWPack.h:159
char cMACAddress[21]
定义 MDWPack.h:167
int hSocket
定义 MDWPack.h:161
int iSocketErrorCode
定义 MDWPack.h:175
char cListenIP[21]
定义 MDWPack.h:157
char cComMacKey[9]
定义 MDWPack.h:171
bool bIsRoutePack
定义 MDWPack.h:179
int iRequestNo
定义 MDWPack.h:177
char cClientIPAddress[21]
定义 MDWPack.h:163
int iCommPort
定义 MDWPack.h:165
定义 MDWPack.h:232
FIELD_TYPE FieldType
定义 MDWPack.h:240
int Precision
定义 MDWPack.h:238
int FieldSize
定义 MDWPack.h:236
std::string FieldName
定义 MDWPack.h:234
定义 MDWPack.h:115
char cWorkStation[41]
定义 MDWPack.h:121
char cAddress[16]
定义 MDWPack.h:123
char cUserCode[6]
定义 MDWPack.h:117
unsigned int dwLastAnswerTime
定义 MDWPack.h:127
char cUserName[41]
定义 MDWPack.h:119
unsigned short wPort
定义 MDWPack.h:125
定义 MDWPack.h:196
std::string sWorkStation
定义 MDWPack.h:202
std::string sUserCode
定义 MDWPack.h:198
unsigned int dwLastAnswerTime
定义 MDWPack.h:208
unsigned short wPort
定义 MDWPack.h:206
std::string sAddress
定义 MDWPack.h:204
std::string sUserName
定义 MDWPack.h:200
bool EnabledHDVWEB
定义 MDWPack.h:273
std::string MidClientID
定义 MDWPack.h:293
bool SaveLogToRDMS
定义 MDWPack.h:291
bool EnabledProxyServer
定义 MDWPack.h:281
int HDVWEBPort
定义 MDWPack.h:275
int DICOM_Port
定义 MDWPack.h:287
bool EnabledDicom
定义 MDWPack.h:271
int DataPackEncryptMode
定义 MDWPack.h:249
bool EnabledRDMS
定义 MDWPack.h:263
std::string ServerName
定义 MDWPack.h:247
int RouteNodeNumber
定义 MDWPack.h:261
std::string EnbledDBSysNames
定义 MDWPack.h:289
bool EnableFileCache
定义 MDWPack.h:265
bool EnabledUpdate
定义 MDWPack.h:269
std::string Version
定义 MDWPack.h:259
std::string ClientIPAddress
定义 MDWPack.h:251
std::string ConvertToString()
定义 MDWPack.h:310
std::string VisitIPAddress
定义 MDWPack.h:253
std::string DICOM_AET
定义 MDWPack.h:285
std::string IPAddress
定义 MDWPack.h:255
bool EnabledAIP
定义 MDWPack.h:283
std::string BackupFloder
定义 MDWPack.h:295
int VersionCompare(const std::string &version)
定义 MDWPack.h:328
int Port
定义 MDWPack.h:257
bool EnabledRoute
定义 MDWPack.h:267
bool EnabledTTS
定义 MDWPack.h:279
bool EnabledHL7
定义 MDWPack.h:277
MIDServerInfo()
定义 MDWPack.h:299
std::string Charset
定义 MDWPack.h:297
定义 MDWPack.h:132
int iDeviceNum
定义 MDWPack.h:134
char cDeviceFlag[11]
定义 MDWPack.h:138
char cDeviceName[21]
定义 MDWPack.h:136
定义 MDWPack.h:185
std::string Sended
定义 MDWPack.h:189
uint8_t uMsgType
定义 MDWPack.h:187
std::string Context
定义 MDWPack.h:191
定义 MDWPack.h:144
uint8_t uMsgType
定义 MDWPack.h:146
char cSended[MAX_BRD_MESSAGE_LEN+1]
定义 MDWPack.h:148
char cContext[MAX_BRD_MESSAGE_LEN+1]
定义 MDWPack.h:150