TelecomHealthInterface.cpp 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. #define PHMS_DLL_EXPORTS
  2. #include "TelecomHealthInterface.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 UserAuthorize_Telecom(NET_HANDLE handle, const char* stringLocalFilePath, const char* stringPersonId, const char* stringName, const char* stringNation, const char* stringAddress, const char* stringRoomId)
  10. {
  11. if(handle==NULL || stringLocalFilePath==NULL || stringPersonId==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->UserAuthorize_Telecom(stringLocalFilePath, stringPersonId, stringName, stringNation, stringAddress, stringRoomId);
  24. }
  25. int BloodPressureUpload_Telecom(NET_HANDLE handle, const char* stringLocalFilePath, const char* stringPersonType, const char* stringPersonId, const char* stringSBP, const char* stringDBP, const char* stringAverageValue, const char* stringPulseRate, const char* stringDetectionTime,
  26. const char* stringEquCode, const char* stringRoomId)
  27. {
  28. if(handle==NULL || stringLocalFilePath==NULL || stringPersonId==NULL || stringSBP==NULL || stringDBP==NULL || stringAverageValue==NULL || stringPulseRate==NULL || stringDetectionTime==NULL || stringEquCode==NULL || stringRoomId==NULL)
  29. {
  30. return COMMON_PARAMETER_NULL;
  31. }
  32. string stringUuid = handle;
  33. CExternalNetInterface* pNetInterface = NULL;
  34. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  35. if(pNetInterface == NULL)
  36. {
  37. //写日志
  38. return COMMON_INVALID_HANDLE;
  39. }
  40. return pNetInterface->BloodPressureUpload_Telecom(stringLocalFilePath, stringPersonType, stringPersonId, stringSBP, stringDBP, stringAverageValue, stringPulseRate, stringDetectionTime, stringEquCode, stringRoomId);
  41. }
  42. int BloodOxygenUpload_Telecom(NET_HANDLE handle, const char* stringLocalFilePath, const char* stringPersonType, const char* stringPersonId, const char* stringBloodOxygen, const char* stringPulseRate, const char* stringDetectionTime,
  43. const char* stringEquCode, const char* stringRoomId)
  44. {
  45. if(handle==NULL || stringLocalFilePath==NULL || stringPersonId==NULL || stringBloodOxygen==NULL || stringPulseRate==NULL || stringDetectionTime==NULL || stringEquCode==NULL || stringRoomId==NULL)
  46. {
  47. return COMMON_PARAMETER_NULL;
  48. }
  49. string stringUuid = handle;
  50. CExternalNetInterface* pNetInterface = NULL;
  51. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  52. if(pNetInterface == NULL)
  53. {
  54. //写日志
  55. return COMMON_INVALID_HANDLE;
  56. }
  57. return pNetInterface->BloodOxygenUpload_Telecom(stringLocalFilePath, stringPersonType, stringPersonId, stringBloodOxygen, stringPulseRate, stringDetectionTime, stringEquCode, stringRoomId);
  58. }
  59. int BloodSugarUpload_Telecom(NET_HANDLE handle, const char* stringLocalFilePath, const char* stringPersonType, const char* stringPersonId, const char* stringBloodSugar, const char* stringDetectionTime,
  60. const char* stringEquCode, const char* stringRoomId)
  61. {
  62. if(handle==NULL || stringLocalFilePath==NULL || stringPersonId==NULL || stringBloodSugar==NULL || stringDetectionTime==NULL || stringEquCode==NULL || stringRoomId==NULL)
  63. {
  64. return COMMON_PARAMETER_NULL;
  65. }
  66. string stringUuid = handle;
  67. CExternalNetInterface* pNetInterface = NULL;
  68. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  69. if(pNetInterface == NULL)
  70. {
  71. //写日志
  72. return COMMON_INVALID_HANDLE;
  73. }
  74. return pNetInterface->BloodSugarUpload_Telecom(stringLocalFilePath, stringPersonType, stringPersonId, stringBloodSugar, stringDetectionTime, stringEquCode, stringRoomId);
  75. }
  76. int HeightWeightUpload_Telecom(NET_HANDLE handle, const char* stringLocalFilePath, const char* stringPersonType, const char* stringPersonId, const char* stringHeight, const char* stringWeight, const char* stringBMI, const char* stringDetectionTime,
  77. const char* stringEquCode, const char* stringRoomId)
  78. {
  79. if(handle==NULL || stringLocalFilePath==NULL || stringPersonId==NULL || stringHeight==NULL || stringWeight==NULL || stringBMI==NULL || stringDetectionTime==NULL || stringEquCode==NULL || stringRoomId==NULL)
  80. {
  81. return COMMON_PARAMETER_NULL;
  82. }
  83. string stringUuid = handle;
  84. CExternalNetInterface* pNetInterface = NULL;
  85. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  86. if(pNetInterface == NULL)
  87. {
  88. //写日志
  89. return COMMON_INVALID_HANDLE;
  90. }
  91. return pNetInterface->HeightWeightUpload_Telecom(stringLocalFilePath, stringPersonType, stringPersonId, stringHeight, stringWeight, stringBMI, stringDetectionTime, stringEquCode, stringRoomId);
  92. }
  93. int LungUpload_Telecom(NET_HANDLE handle, const char* stringLocalFilePath, const char* stringPersonType, const char* stringPersonId, const char* stringM_B1, const char* stringBSA, const char* stringBSA1, const char* stringMMF, const char* stringMefSeventyFive, const char* stringMefFifty,
  94. const char* stringMefTwentyFive, const char* stringMefFVST, const char* stringIC, const char* stringIRV, const char* stringERV, const char* stringFevOne, const char* stringFevTwo, const char* stringFevThree,
  95. const char* stringFevOnePer, const char* stringFevTwoPer, const char* stringFevThreePer, const char* stringRR, const char* stringFVC, const char* stringPEF, const char* stringTV, const char* stringVC, const char* stringMVV,
  96. const char* stringMV, const char* stringVSTHeight, const char* stringVSMvvBsa, const char* stringVSMvvOne, const char* stringSVC, const char* stringFevOneZeroFive, const char* stringFevOneZeroFivePer, const char* stringPefOne,
  97. const char* stringPefTwo, const char* stringPefThree, const char* stringFive, const char* stringFiveOne, const char* stringFiveTwo, const char* stringFiveThree, const char* stringPIF, const char* stringMifFifty,
  98. const char* stringDetectionTime, const char* stringEquCode, const char* stringRoomId)
  99. {
  100. if(handle==NULL || stringLocalFilePath==NULL || stringPersonId==NULL || stringM_B1==NULL || stringBSA==NULL || stringBSA1==NULL || stringMMF==NULL || stringMefSeventyFive==NULL || stringMefFifty==NULL || stringMefTwentyFive==NULL ||
  101. stringMefFVST==NULL || stringIC==NULL || stringIRV==NULL || stringERV==NULL || stringFevOne==NULL || stringFevTwo==NULL || stringFevThree==NULL || stringFevOnePer==NULL || stringFevTwoPer==NULL || stringFevThreePer==NULL ||
  102. stringRR==NULL || stringFVC==NULL || stringPEF==NULL || stringTV==NULL || stringVC==NULL || stringMVV==NULL || stringMV==NULL || stringVSTHeight==NULL || stringVSMvvBsa==NULL || stringVSMvvOne==NULL || stringSVC==NULL ||
  103. stringFevOneZeroFive==NULL || stringFevOneZeroFivePer==NULL || stringPefOne==NULL || stringPefTwo==NULL || stringPefThree==NULL || stringFive==NULL || stringFiveOne==NULL || stringFiveTwo==NULL || stringFiveThree==NULL ||
  104. stringPIF==NULL || stringMifFifty==NULL || stringDetectionTime==NULL || stringEquCode==NULL || stringRoomId==NULL)
  105. {
  106. return COMMON_PARAMETER_NULL;
  107. }
  108. string stringUuid = handle;
  109. CExternalNetInterface* pNetInterface = NULL;
  110. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  111. if(pNetInterface == NULL)
  112. {
  113. //写日志
  114. return COMMON_INVALID_HANDLE;
  115. }
  116. return pNetInterface->LungUpload_Telecom(stringLocalFilePath, stringPersonType, stringPersonId, stringM_B1, stringBSA, stringBSA1, stringMMF, stringMefSeventyFive, stringMefFifty, stringMefTwentyFive, stringMefFVST, stringIC,
  117. stringIRV, stringERV, stringFevOne, stringFevTwo, stringFevThree, stringFevOnePer, stringFevTwoPer, stringFevThreePer, stringRR, stringFVC, stringPEF, stringTV, stringVC, stringMVV, stringMV,
  118. stringVSTHeight, stringVSMvvBsa, stringVSMvvOne, stringSVC, stringFevOneZeroFive, stringFevOneZeroFivePer, stringPefOne, stringPefTwo, stringPefThree, stringFive, stringFiveOne, stringFiveTwo, stringFiveThree,
  119. stringPIF, stringMifFifty, stringDetectionTime, stringEquCode, stringRoomId);
  120. }
  121. int ECGUpload_Telecom(NET_HANDLE handle, const char* stringLocalFilePath, const char* stringPersonType, const char* stringPersonId, const char* stringDetectionTime,
  122. const char* stringEquCode, const char* stringRoomId, TELCOM_ECG ecgData)
  123. {
  124. if(handle==NULL || stringLocalFilePath==NULL || stringPersonId==NULL || stringDetectionTime==NULL || stringEquCode==NULL || stringRoomId==NULL ||
  125. ecgData.pArrayData==NULL || ecgData.adRate==NULL || ecgData.adAccuracy==NULL || ecgData.rangeMin==NULL || ecgData.rangeMax==NULL || ecgData.heartValue==NULL ||
  126. ecgData.stLevel==NULL || ecgData.prInterval==NULL || ecgData.qtInterval==NULL || ecgData.rrInterval==NULL || ecgData.pWave==NULL || ecgData.rWave==NULL ||
  127. ecgData.tWave==NULL || ecgData.result1==NULL || ecgData.result2==NULL || ecgData.result3==NULL || ecgData.result4==NULL || ecgData.result5==NULL)
  128. {
  129. return COMMON_PARAMETER_NULL;
  130. }
  131. string stringUuid = handle;
  132. CExternalNetInterface* pNetInterface = NULL;
  133. pNetInterface = CNetThreadManager::GetNetThread(stringUuid);
  134. if(pNetInterface == NULL)
  135. {
  136. //写日志
  137. return COMMON_INVALID_HANDLE;
  138. }
  139. return pNetInterface->ECGUpload_Telecom(stringLocalFilePath, stringPersonType, stringPersonId, stringDetectionTime, stringEquCode, stringRoomId, ecgData);
  140. }