DIOSDICOMInfo.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. #pragma once
  2. #include <stdlib.h>
  3. #include "ResDataObject.h"
  4. #define SIZE_Small ("SMALL")
  5. #define SIZE_Medium ("MEDIUM")
  6. #define SIZE_Large ("LARGE")
  7. #define SIZE_Paediatric ("PAEDIATRIC")
  8. class STUDAY_INFO : public BaseJsonDataObject<string>
  9. {
  10. public:
  11. BaseJsonDataObject<string> m_PatientName;
  12. BaseJsonDataObject<string> m_PatientID;
  13. BaseJsonDataObject<string> m_PatientSex;
  14. BaseJsonDataObject<string> m_StudyID;
  15. BaseJsonDataObject<string> m_OtherPatientIDs;
  16. BaseJsonDataObject<string> m_OtherPatientNames;
  17. BaseJsonDataObject<string> m_AccessionNumber;
  18. BaseJsonDataObject<string> m_StudyDescription;
  19. BaseJsonDataObject<string> m_PatientAge;
  20. BaseJsonDataObject<string> m_PatientLength;
  21. BaseJsonDataObject<string> m_PatientWeight;
  22. BaseJsonDataObject<string> m_PatientSize;
  23. BaseJsonDataObject<string> m_PatientBirthDate;
  24. BaseJsonDataObject<string> m_PatientBirthTime;
  25. BaseJsonDataObject<string> m_BodyPart;
  26. STUDAY_INFO(void)
  27. {
  28. SetKey("StudayInfo");
  29. m_PatientName.SetKey("PatientName");
  30. m_PatientID.SetKey("PatientID");
  31. m_PatientSex.SetKey("PatientSex");
  32. m_StudyID.SetKey("StudyID");
  33. m_OtherPatientIDs.SetKey("OtherPatientIDs");
  34. m_OtherPatientNames.SetKey("OtherPatientNames");
  35. m_AccessionNumber.SetKey("AccessionNumber");
  36. m_StudyDescription.SetKey("StudyDescription");
  37. m_PatientAge.SetKey("PatientAge");
  38. m_PatientLength.SetKey("PatientLength");
  39. m_PatientWeight.SetKey("PatientWeight");
  40. m_PatientSize.SetKey("PatientSize");
  41. m_PatientBirthDate.SetKey("PatientBirthDate");
  42. m_PatientBirthTime.SetKey("PatientBirthTime");
  43. m_BodyPart.SetKey("ProcedureGroup");
  44. }
  45. virtual ~STUDAY_INFO(void)
  46. {
  47. }
  48. virtual const char *GetVal()
  49. {
  50. ResDataObject obj;
  51. obj.add(m_PatientName.GetKey(), m_PatientName.GetVal());
  52. obj.add(m_PatientID.GetKey(), m_PatientID.GetVal());
  53. obj.add(m_PatientSex.GetKey(), m_PatientSex.GetVal());
  54. obj.add(m_StudyID.GetKey(), m_StudyID.GetVal());
  55. obj.add(m_OtherPatientIDs.GetKey(), m_OtherPatientIDs.GetVal());
  56. obj.add(m_OtherPatientNames.GetKey(), m_OtherPatientNames.GetVal());
  57. obj.add(m_AccessionNumber.GetKey(), m_AccessionNumber.GetVal());
  58. obj.add(m_StudyDescription.GetKey(), m_StudyDescription.GetVal());
  59. obj.add(m_PatientAge.GetKey(), m_PatientAge.GetVal());
  60. obj.add(m_PatientLength.GetKey(), m_PatientLength.GetVal());
  61. obj.add(m_PatientWeight.GetKey(), m_PatientWeight.GetVal());
  62. obj.add(m_PatientSize.GetKey(), m_PatientSize.GetVal());
  63. obj.add(m_PatientBirthDate.GetKey(), m_PatientBirthDate.GetVal());
  64. obj.add(m_PatientBirthTime.GetKey(), m_PatientBirthTime.GetVal());
  65. obj.add(m_BodyPart.GetKey(), m_BodyPart.GetVal());
  66. (m_ValString) = obj.encode();
  67. return m_ValString.c_str();
  68. };
  69. virtual bool SetVal(const char* pValString)
  70. {
  71. ResDataObject obj;
  72. if (obj.decode(pValString))
  73. {
  74. int idx;
  75. idx = obj.GetFirstOf(m_PatientName.GetKey());
  76. if (idx >= 0)
  77. {
  78. m_PatientName.SetVal(obj[idx]);
  79. }
  80. idx = obj.GetFirstOf(m_PatientID.GetKey());
  81. if (idx >= 0)
  82. {
  83. m_PatientID.SetVal(obj[idx]);
  84. }
  85. idx = obj.GetFirstOf(m_PatientSex.GetKey());
  86. if (idx >= 0)
  87. {
  88. m_PatientSex.SetVal(obj[idx]);
  89. }
  90. idx = obj.GetFirstOf(m_StudyID.GetKey());
  91. if (idx >= 0)
  92. {
  93. m_StudyID.SetVal(obj[idx]);
  94. }
  95. idx = obj.GetFirstOf(m_OtherPatientIDs.GetKey());
  96. if (idx >= 0)
  97. {
  98. m_OtherPatientIDs.SetVal(obj[idx]);
  99. }
  100. idx = obj.GetFirstOf(m_OtherPatientNames.GetKey());
  101. if (idx >= 0)
  102. {
  103. m_OtherPatientNames.SetVal(obj[idx]);
  104. }
  105. idx = obj.GetFirstOf(m_AccessionNumber.GetKey());
  106. if (idx >= 0)
  107. {
  108. m_AccessionNumber.SetVal(obj[idx]);
  109. }
  110. idx = obj.GetFirstOf(m_StudyDescription.GetKey());
  111. if (idx >= 0)
  112. {
  113. m_StudyDescription.SetVal(obj[idx]);
  114. }
  115. idx = obj.GetFirstOf(m_PatientAge.GetKey());
  116. if (idx >= 0)
  117. {
  118. m_PatientAge.SetVal(obj[idx]);
  119. }
  120. idx = obj.GetFirstOf(m_PatientLength.GetKey());
  121. if (idx >= 0)
  122. {
  123. m_PatientLength.SetVal(obj[idx]);
  124. }
  125. idx = obj.GetFirstOf(m_PatientWeight.GetKey());
  126. if (idx >= 0)
  127. {
  128. m_PatientWeight.SetVal(obj[idx]);
  129. }
  130. idx = obj.GetFirstOf(m_PatientSize.GetKey());
  131. if (idx >= 0)
  132. {
  133. m_PatientSize.SetVal(obj[idx]);
  134. }
  135. idx = obj.GetFirstOf(m_PatientBirthDate.GetKey());
  136. if (idx >= 0)
  137. {
  138. m_PatientBirthDate.SetVal(obj[idx]);
  139. }
  140. idx = obj.GetFirstOf(m_PatientBirthTime.GetKey());
  141. if (idx >= 0)
  142. {
  143. m_PatientBirthTime.SetVal(obj[idx]);
  144. }
  145. idx = obj.GetFirstOf(m_BodyPart.GetKey());
  146. if (idx >= 0)
  147. {
  148. m_BodyPart.SetVal(obj[idx]);
  149. }
  150. return true;
  151. }
  152. return false;
  153. };
  154. };
  155. class TECHPARAM_INFO : public BaseJsonDataObject<string>
  156. {
  157. public:
  158. BaseJsonDataObject<string> m_CollimatorHeight;
  159. BaseJsonDataObject<string> m_CollimatorWidth;
  160. BaseJsonDataObject<string> m_CollimatorPosition;
  161. BaseJsonDataObject<string> m_CollimatorFilter;
  162. BaseJsonDataObject<string> m_SID;
  163. BaseJsonDataObject<string> m_PositionNumber;
  164. BaseJsonDataObject<string> m_TargetEXI;
  165. TECHPARAM_INFO(void)
  166. {
  167. SetKey("TechParamsInfo");
  168. m_CollimatorHeight.SetKey("CollimatorHeight");
  169. m_CollimatorWidth.SetKey("CollimatorWidth");
  170. m_CollimatorPosition.SetKey("CollimatorCenter");
  171. m_CollimatorFilter.SetKey("CollimatorFilter");
  172. m_SID.SetKey("SID");
  173. m_PositionNumber.SetKey("PositionNumber");
  174. m_TargetEXI.SetKey("TargetEXI");
  175. }
  176. virtual ~TECHPARAM_INFO(void)
  177. {
  178. }
  179. virtual const char *GetVal()
  180. {
  181. ResDataObject obj;
  182. obj.add(m_CollimatorHeight.GetKey(), m_CollimatorHeight.GetVal());
  183. obj.add(m_CollimatorWidth.GetKey(), m_CollimatorWidth.GetVal());
  184. obj.add(m_CollimatorPosition.GetKey(), m_CollimatorPosition.GetVal());
  185. obj.add(m_CollimatorFilter.GetKey(), m_CollimatorFilter.GetVal());
  186. obj.add(m_SID.GetKey(), m_SID.GetVal());
  187. obj.add(m_PositionNumber.GetKey(), m_PositionNumber.GetVal());
  188. obj.add(m_TargetEXI.GetKey(), m_TargetEXI.GetVal());
  189. (m_ValString) = obj.encode();
  190. return m_ValString.c_str();
  191. };
  192. virtual bool SetVal(const char* pValString)
  193. {
  194. ResDataObject obj;
  195. if (obj.decode(pValString))
  196. {
  197. int idx;
  198. idx = obj.GetFirstOf(m_CollimatorHeight.GetKey());
  199. if (idx >= 0)
  200. {
  201. m_CollimatorHeight.SetVal(obj[idx]);
  202. }
  203. idx = obj.GetFirstOf(m_CollimatorWidth.GetKey());
  204. if (idx >= 0)
  205. {
  206. m_CollimatorWidth.SetVal(obj[idx]);
  207. }
  208. idx = obj.GetFirstOf(m_CollimatorPosition.GetKey());
  209. if (idx >= 0)
  210. {
  211. m_CollimatorPosition.SetVal(obj[idx]);
  212. }
  213. idx = obj.GetFirstOf(m_CollimatorFilter.GetKey());
  214. if (idx >= 0)
  215. {
  216. m_CollimatorFilter.SetVal(obj[idx]);
  217. }
  218. idx = obj.GetFirstOf(m_SID.GetKey());
  219. if (idx >= 0)
  220. {
  221. m_SID.SetVal(obj[idx]);
  222. }
  223. idx = obj.GetFirstOf(m_PositionNumber.GetKey());
  224. if (idx >= 0)
  225. {
  226. m_PositionNumber.SetVal(obj[idx]);
  227. }
  228. idx = obj.GetFirstOf(m_TargetEXI.GetKey());
  229. if (idx >= 0)
  230. {
  231. m_TargetEXI.SetVal(obj[idx]);
  232. }
  233. return true;
  234. }
  235. return false;
  236. };
  237. };