123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- #pragma once
- #include "ResDataObject.h"
- #define SIZE_Small ("SMALL")
- #define SIZE_Medium ("MEDIUM")
- #define SIZE_Large ("LARGE")
- #define SIZE_Paediatric ("PAEDIATRIC")
- class STUDAY_INFO : public BaseJsonDataObject<string>
- {
- public:
- BaseJsonDataObject<string> m_PatientName;
- BaseJsonDataObject<string> m_PatientID;
- BaseJsonDataObject<string> m_PatientSex;
- BaseJsonDataObject<string> m_StudyID;
- BaseJsonDataObject<string> m_OtherPatientIDs;
- BaseJsonDataObject<string> m_OtherPatientNames;
- BaseJsonDataObject<string> m_AccessionNumber;
- BaseJsonDataObject<string> m_StudyDescription;
- BaseJsonDataObject<string> m_PatientAge;
- BaseJsonDataObject<string> m_PatientLength;
- BaseJsonDataObject<string> m_PatientWeight;
- BaseJsonDataObject<string> m_PatientSize;
- BaseJsonDataObject<string> m_PatientBirthDate;
- BaseJsonDataObject<string> m_PatientBirthTime;
- BaseJsonDataObject<string> m_BodyPart;
- STUDAY_INFO(void)
- {
- SetKey("StudayInfo");
- m_PatientName.SetKey("PatientName");
- m_PatientID.SetKey("PatientID");
- m_PatientSex.SetKey("PatientSex");
- m_StudyID.SetKey("StudyID");
- m_OtherPatientIDs.SetKey("OtherPatientIDs");
- m_OtherPatientNames.SetKey("OtherPatientNames");
- m_AccessionNumber.SetKey("AccessionNumber");
- m_StudyDescription.SetKey("StudyDescription");
- m_PatientAge.SetKey("PatientAge");
- m_PatientLength.SetKey("PatientLength");
- m_PatientWeight.SetKey("PatientWeight");
- m_PatientSize.SetKey("PatientSize");
- m_PatientBirthDate.SetKey("PatientBirthDate");
- m_PatientBirthTime.SetKey("PatientBirthTime");
- m_BodyPart.SetKey("ProcedureGroup");
- }
- virtual ~STUDAY_INFO(void)
- {
- }
- virtual const char *GetVal()
- {
- ResDataObject obj;
- obj.add(m_PatientName.GetKey(), m_PatientName.GetVal());
- obj.add(m_PatientID.GetKey(), m_PatientID.GetVal());
- obj.add(m_PatientSex.GetKey(), m_PatientSex.GetVal());
- obj.add(m_StudyID.GetKey(), m_StudyID.GetVal());
- obj.add(m_OtherPatientIDs.GetKey(), m_OtherPatientIDs.GetVal());
- obj.add(m_OtherPatientNames.GetKey(), m_OtherPatientNames.GetVal());
- obj.add(m_AccessionNumber.GetKey(), m_AccessionNumber.GetVal());
- obj.add(m_StudyDescription.GetKey(), m_StudyDescription.GetVal());
- obj.add(m_PatientAge.GetKey(), m_PatientAge.GetVal());
- obj.add(m_PatientLength.GetKey(), m_PatientLength.GetVal());
- obj.add(m_PatientWeight.GetKey(), m_PatientWeight.GetVal());
- obj.add(m_PatientSize.GetKey(), m_PatientSize.GetVal());
- obj.add(m_PatientBirthDate.GetKey(), m_PatientBirthDate.GetVal());
- obj.add(m_PatientBirthTime.GetKey(), m_PatientBirthTime.GetVal());
- obj.add(m_BodyPart.GetKey(), m_BodyPart.GetVal());
- (m_ValString) = obj.encode();
- return m_ValString.c_str();
- };
- virtual bool SetVal(const char* pValString)
- {
- ResDataObject obj;
- if (obj.decode(pValString))
- {
- int idx;
- idx = obj.GetFirstOf(m_PatientName.GetKey());
- if (idx >= 0)
- {
- m_PatientName.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_PatientID.GetKey());
- if (idx >= 0)
- {
- m_PatientID.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_PatientSex.GetKey());
- if (idx >= 0)
- {
- m_PatientSex.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_StudyID.GetKey());
- if (idx >= 0)
- {
- m_StudyID.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_OtherPatientIDs.GetKey());
- if (idx >= 0)
- {
- m_OtherPatientIDs.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_OtherPatientNames.GetKey());
- if (idx >= 0)
- {
- m_OtherPatientNames.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_AccessionNumber.GetKey());
- if (idx >= 0)
- {
- m_AccessionNumber.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_StudyDescription.GetKey());
- if (idx >= 0)
- {
- m_StudyDescription.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_PatientAge.GetKey());
- if (idx >= 0)
- {
- m_PatientAge.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_PatientLength.GetKey());
- if (idx >= 0)
- {
- m_PatientLength.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_PatientWeight.GetKey());
- if (idx >= 0)
- {
- m_PatientWeight.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_PatientSize.GetKey());
- if (idx >= 0)
- {
- m_PatientSize.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_PatientBirthDate.GetKey());
- if (idx >= 0)
- {
- m_PatientBirthDate.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_PatientBirthTime.GetKey());
- if (idx >= 0)
- {
- m_PatientBirthTime.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_BodyPart.GetKey());
- if (idx >= 0)
- {
- m_BodyPart.SetVal(obj[idx]);
- }
- return true;
- }
- return false;
- };
- };
- class TECHPARAM_INFO : public BaseJsonDataObject<string>
- {
- public:
- BaseJsonDataObject<string> m_CollimatorHeight;
- BaseJsonDataObject<string> m_CollimatorWidth;
- BaseJsonDataObject<string> m_CollimatorPosition;
- BaseJsonDataObject<string> m_CollimatorFilter;
- BaseJsonDataObject<string> m_SID;
- BaseJsonDataObject<string> m_PositionNumber;
- BaseJsonDataObject<string> m_TargetEXI;
- TECHPARAM_INFO(void)
- {
- SetKey("TechParamsInfo");
- m_CollimatorHeight.SetKey("CollimatorHeight");
- m_CollimatorWidth.SetKey("CollimatorWidth");
- m_CollimatorPosition.SetKey("CollimatorCenter");
- m_CollimatorFilter.SetKey("CollimatorFilter");
- m_SID.SetKey("SID");
- m_PositionNumber.SetKey("PositionNumber");
- m_TargetEXI.SetKey("TargetEXI");
- }
- virtual ~TECHPARAM_INFO(void)
- {
- }
- virtual const char *GetVal()
- {
- ResDataObject obj;
- obj.add(m_CollimatorHeight.GetKey(), m_CollimatorHeight.GetVal());
- obj.add(m_CollimatorWidth.GetKey(), m_CollimatorWidth.GetVal());
- obj.add(m_CollimatorPosition.GetKey(), m_CollimatorPosition.GetVal());
- obj.add(m_CollimatorFilter.GetKey(), m_CollimatorFilter.GetVal());
- obj.add(m_SID.GetKey(), m_SID.GetVal());
- obj.add(m_PositionNumber.GetKey(), m_PositionNumber.GetVal());
- obj.add(m_TargetEXI.GetKey(), m_TargetEXI.GetVal());
- (m_ValString) = obj.encode();
- return m_ValString.c_str();
- };
- virtual bool SetVal(const char* pValString)
- {
- ResDataObject obj;
- if (obj.decode(pValString))
- {
- int idx;
- idx = obj.GetFirstOf(m_CollimatorHeight.GetKey());
- if (idx >= 0)
- {
- m_CollimatorHeight.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_CollimatorWidth.GetKey());
- if (idx >= 0)
- {
- m_CollimatorWidth.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_CollimatorPosition.GetKey());
- if (idx >= 0)
- {
- m_CollimatorPosition.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_CollimatorFilter.GetKey());
- if (idx >= 0)
- {
- m_CollimatorFilter.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_SID.GetKey());
- if (idx >= 0)
- {
- m_SID.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_PositionNumber.GetKey());
- if (idx >= 0)
- {
- m_PositionNumber.SetVal(obj[idx]);
- }
- idx = obj.GetFirstOf(m_TargetEXI.GetKey());
- if (idx >= 0)
- {
- m_TargetEXI.SetVal(obj[idx]);
- }
- return true;
- }
- return false;
- };
- };
|