DIOSDICOMInfo.h 6.9 KB

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