WithinHospitalNetInterface.cpp 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. #define PHMS_DLL_EXPORTS
  2. #include "WithinHospitalNetInterface.h"
  3. #include "ExternalNetInterface.h"
  4. #include "ErrorCode.h"
  5. #include <map>
  6. #include <string>
  7. #include "NetThreadManager.h"
  8. using namespace std;
  9. int SetCliniqueBusy(NET_HANDLE handle, const char* stringCliniqueId)
  10. {
  11. if(handle==NULL || stringCliniqueId==NULL)
  12. {
  13. return COMMON_PARAMETER_NULL;
  14. }
  15. string stringUuid = handle;
  16. CExternalNetInterface* pNetInterface = NULL;
  17. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  18. if(pNetInterface == NULL)
  19. {
  20. //写日志
  21. return COMMON_INVALID_HANDLE;
  22. }
  23. return pNetInterface->SetCliniqueBusy(stringCliniqueId);
  24. }
  25. int SetCliniqueFree(NET_HANDLE handle, const char* stringCliniqueId)
  26. {
  27. if(handle==NULL || stringCliniqueId==NULL)
  28. {
  29. return COMMON_PARAMETER_NULL;
  30. }
  31. string stringUuid = handle;
  32. CExternalNetInterface* pNetInterface = NULL;
  33. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  34. if(pNetInterface == NULL)
  35. {
  36. //写日志
  37. return COMMON_INVALID_HANDLE;
  38. }
  39. return pNetInterface->SetCliniqueFree(stringCliniqueId);
  40. }
  41. int NET_API SetCliniqueChecking(NET_HANDLE handle, const char* stringCliniqueId)
  42. {
  43. if(handle==NULL || stringCliniqueId==NULL)
  44. {
  45. return COMMON_PARAMETER_NULL;
  46. }
  47. string stringUuid = handle;
  48. CExternalNetInterface* pNetInterface = NULL;
  49. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  50. if(pNetInterface == NULL)
  51. {
  52. //写日志
  53. return COMMON_INVALID_HANDLE;
  54. }
  55. return pNetInterface->SetCliniqueChecking(stringCliniqueId);
  56. }
  57. int NET_API SetCliniqueShoutComplete(NET_HANDLE handle, const char* stringCliniqueId)
  58. {
  59. if(handle==NULL || stringCliniqueId==NULL)
  60. {
  61. return COMMON_PARAMETER_NULL;
  62. }
  63. string stringUuid = handle;
  64. CExternalNetInterface* pNetInterface = NULL;
  65. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  66. if(pNetInterface == NULL)
  67. {
  68. //写日志
  69. return COMMON_INVALID_HANDLE;
  70. }
  71. return pNetInterface->SetCliniqueShoutComplete(stringCliniqueId);
  72. }
  73. int GetPatientInfoByAppNum(NET_HANDLE handle, const char* stringLocalFilePath, const char* stringHospitalId, const char* stringOrderType, const char* stringOrderId,
  74. const char* stringReqDepart, const char* stringOrderState, const char* stringCheckType, const char* stringStartDate, const char* stringEndDate,const char* stringClinicId)
  75. {
  76. if(handle==NULL || stringLocalFilePath==NULL || stringHospitalId==NULL || stringOrderType==NULL || stringOrderId==NULL || stringReqDepart==NULL || stringOrderState==NULL ||
  77. stringCheckType==NULL || stringStartDate==NULL || stringEndDate==NULL || stringClinicId == NULL)
  78. {
  79. return COMMON_PARAMETER_NULL;
  80. }
  81. string stringUuid = handle;
  82. CExternalNetInterface* pNetInterface = NULL;
  83. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  84. if(pNetInterface == NULL)
  85. {
  86. //写日志
  87. return COMMON_INVALID_HANDLE;
  88. }
  89. return pNetInterface->GetPatientInfoByAppNum(stringLocalFilePath, stringHospitalId, stringOrderType, stringOrderId, stringReqDepart, stringOrderState, stringCheckType, stringStartDate, stringEndDate,stringClinicId);
  90. }
  91. int GetPatientInfoByAppNumToHis(NET_HANDLE handle, const char* stringLocalFilePath, const char* stringHospitalId, const char* stringOrderType, const char* stringOrderId)
  92. {
  93. if(handle==NULL || stringLocalFilePath==NULL || stringHospitalId==NULL || stringOrderType==NULL || stringOrderId==NULL)
  94. {
  95. return COMMON_PARAMETER_NULL;
  96. }
  97. string stringUuid = handle;
  98. CExternalNetInterface* pNetInterface = NULL;
  99. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  100. if(pNetInterface == NULL)
  101. {
  102. //写日志
  103. return COMMON_INVALID_HANDLE;
  104. }
  105. return pNetInterface->GetPatientInfoByAppNumToHis(stringLocalFilePath, stringHospitalId, stringOrderType, stringOrderId);
  106. }
  107. int GetPatientInfoByAppNumToPhmsAndHis(NET_HANDLE handle, const char* stringLocalFilePath, const char* stringHospitalId, const char* stringOrderType, const char* stringOrderId)
  108. {
  109. if(handle==NULL || stringLocalFilePath==NULL || stringHospitalId==NULL || stringOrderType==NULL || stringOrderId==NULL)
  110. {
  111. return COMMON_PARAMETER_NULL;
  112. }
  113. string stringUuid = handle;
  114. CExternalNetInterface* pNetInterface = NULL;
  115. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  116. if(pNetInterface == NULL)
  117. {
  118. //写日志
  119. return COMMON_INVALID_HANDLE;
  120. }
  121. return pNetInterface->GetPatientInfoByAppNumToPhmsAndHis(stringLocalFilePath, stringHospitalId, stringOrderType, stringOrderId);
  122. }
  123. int ApplyCheck(NET_HANDLE handle, const char* stringCliniqueId, const char* stringOrderId, const char* stringOrderType)
  124. {
  125. if(handle==NULL || stringCliniqueId==NULL || stringOrderType==NULL || stringOrderId==NULL)
  126. {
  127. return COMMON_PARAMETER_NULL;
  128. }
  129. string stringUuid = handle;
  130. CExternalNetInterface* pNetInterface = NULL;
  131. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  132. if(pNetInterface == NULL)
  133. {
  134. //写日志
  135. return COMMON_INVALID_HANDLE;
  136. }
  137. return pNetInterface->ApplyCheck(stringCliniqueId, stringOrderId, stringOrderType);
  138. }
  139. int GetWaitingCheck(NET_HANDLE handle, const char* stringLocalFilePath, const char* stringCliniqueId)
  140. {
  141. if(handle==NULL || stringLocalFilePath==NULL || stringCliniqueId==NULL)
  142. {
  143. return COMMON_PARAMETER_NULL;
  144. }
  145. string stringUuid = handle;
  146. CExternalNetInterface* pNetInterface = NULL;
  147. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  148. if(pNetInterface == NULL)
  149. {
  150. //写日志
  151. return COMMON_INVALID_HANDLE;
  152. }
  153. return pNetInterface->GetWaitingCheck(stringLocalFilePath, stringCliniqueId);
  154. }
  155. int GetCliniqueState(NET_HANDLE handle, const char* stringLocalFilePath, const char* stringCliniqueId)
  156. {
  157. if(handle==NULL || stringLocalFilePath==NULL || stringCliniqueId==NULL)
  158. {
  159. return COMMON_PARAMETER_NULL;
  160. }
  161. string stringUuid = handle;
  162. CExternalNetInterface* pNetInterface = NULL;
  163. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  164. if(pNetInterface == NULL)
  165. {
  166. //写日志
  167. return COMMON_INVALID_HANDLE;
  168. }
  169. return pNetInterface->GetCliniqueState(stringLocalFilePath, stringCliniqueId);
  170. }
  171. int NotifyCaseState(NET_HANDLE handle, const char* stringHospitalId, const char* stringOrderType, const char* stringOrderId)
  172. {
  173. if(handle==NULL || stringHospitalId==NULL || stringOrderType==NULL || stringOrderId==NULL)
  174. {
  175. return COMMON_PARAMETER_NULL;
  176. }
  177. string stringUuid = handle;
  178. CExternalNetInterface* pNetInterface = NULL;
  179. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  180. if(pNetInterface == NULL)
  181. {
  182. //写日志
  183. return COMMON_INVALID_HANDLE;
  184. }
  185. return pNetInterface->NotifyCaseState(stringHospitalId, stringOrderType, stringOrderId);
  186. }
  187. int NotifyReportState(NET_HANDLE handle, const char* stringReportId)
  188. {
  189. if(handle==NULL || stringReportId==NULL)
  190. {
  191. return COMMON_PARAMETER_NULL;
  192. }
  193. string stringUuid = handle;
  194. CExternalNetInterface* pNetInterface = NULL;
  195. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  196. if(pNetInterface == NULL)
  197. {
  198. //写日志
  199. return COMMON_INVALID_HANDLE;
  200. }
  201. return pNetInterface->NotifyReportState(stringReportId);
  202. }
  203. int SetDoctorAgentId(NET_HANDLE handle, const char* stringDoctorAgentId)
  204. {
  205. if(handle==NULL || stringDoctorAgentId==NULL)
  206. {
  207. return COMMON_PARAMETER_NULL;
  208. }
  209. string stringUuid = handle;
  210. CExternalNetInterface* pNetInterface = NULL;
  211. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  212. if(pNetInterface == NULL)
  213. {
  214. //写日志
  215. return COMMON_INVALID_HANDLE;
  216. }
  217. return pNetInterface->SetDoctorAgentId(stringDoctorAgentId);
  218. }
  219. int NotifyAppState(NET_HANDLE handle, const char* stringUnitId, const char* stringOrderId, const char* stringOrderType, const char* stringState)
  220. {
  221. if(handle==NULL || stringUnitId==NULL || stringOrderId==NULL || stringOrderType==NULL || stringState==NULL)
  222. {
  223. return COMMON_PARAMETER_NULL;
  224. }
  225. string stringUuid = handle;
  226. CExternalNetInterface* pNetInterface = NULL;
  227. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  228. if(pNetInterface == NULL)
  229. {
  230. //写日志
  231. return COMMON_INVALID_HANDLE;
  232. }
  233. return pNetInterface->NotifyAppState(stringUnitId, stringOrderId, stringOrderType, stringState);
  234. }
  235. int VerifyAppState(NET_HANDLE handle, const char* stringLocalFilePath, const char* stringOrderId, const char* stringOrderType)
  236. {
  237. if(handle==NULL || stringLocalFilePath==NULL || stringOrderId==NULL || stringOrderType==NULL)
  238. {
  239. return COMMON_PARAMETER_NULL;
  240. }
  241. string stringUuid = handle;
  242. CExternalNetInterface* pNetInterface = NULL;
  243. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  244. if(pNetInterface == NULL)
  245. {
  246. //写日志
  247. return COMMON_INVALID_HANDLE;
  248. }
  249. return pNetInterface->VerifyAppState(stringLocalFilePath, stringOrderId, stringOrderType);
  250. }
  251. int GetHisReportState(NET_HANDLE handle, const char* stringLocalFilePath, const char* stringHospitalId, const char* stringOrderType, const char* stringOrderId)
  252. {
  253. if(handle==NULL || stringHospitalId==NULL || stringOrderType==NULL || stringOrderId==NULL)
  254. {
  255. return COMMON_PARAMETER_NULL;
  256. }
  257. string stringUuid = handle;
  258. CExternalNetInterface* pNetInterface = NULL;
  259. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  260. if(pNetInterface == NULL)
  261. {
  262. //写日志
  263. return COMMON_INVALID_HANDLE;
  264. }
  265. return pNetInterface->GetHisReportState(stringLocalFilePath, stringHospitalId, stringOrderType, stringOrderId);
  266. }
  267. int SetHisCriticalValue(NET_HANDLE handle, const char* stringHospitalId, const char* stringCaseId, const char* stringCriticalValues)
  268. {
  269. if(handle==NULL || stringHospitalId==NULL || stringCaseId==NULL || stringCriticalValues==NULL)
  270. {
  271. return COMMON_PARAMETER_NULL;
  272. }
  273. string stringUuid = handle;
  274. CExternalNetInterface* pNetInterface = NULL;
  275. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  276. if(pNetInterface == NULL)
  277. {
  278. //写日志
  279. return COMMON_INVALID_HANDLE;
  280. }
  281. return pNetInterface->SetHisCriticalValue(stringHospitalId, stringCaseId, stringCriticalValues);
  282. }