// Globals.cpp: implementation of the CGlobals class. // ////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "DicomMWL.h" #include "Globals.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CGlobals::CGlobals() { } CGlobals::~CGlobals() { } #define BUILD_IP(n0, n1, n2, n3) ((n0<<24) + (n1<<16) + (n2<<8) + n3) DWORD CGlobals::BuildIP(BYTE n0, BYTE n1, BYTE n2, BYTE n3) { DWORD dRet; dRet = (((DWORD)n0<<24) + (n1<<16) + (n2<<8) + n3); return dRet; } // Initialize static member variables // Page0 int CGlobals::m_nTimerMax = 15; // Timer expiration in seconds // Page1 #ifdef _DEBUG CString CGlobals::m_strMWLServerAE = "PUBLICBROKER"; DWORD CGlobals::m_lMWLServerIP = BUILD_IP(192, 190, 75, 22); int CGlobals::m_nMWLServerPort = 3320; CString CGlobals::m_strMWLClientAE = "TIMS_2001"; int CGlobals::m_bMWLServerValid = FALSE; // Page2 int CGlobals::m_bUseStorageServer = FALSE; CString CGlobals::m_strStorageServerAE = ""; DWORD CGlobals::m_lStorageServerIP = BuildIP(10,1,1,118); int CGlobals::m_nStorageServerPort = 104; CString CGlobals::m_strStorageClientAE = "TERRY"; int CGlobals::m_bStorageServerValid = FALSE; #else //RELEASE CString CGlobals::m_strMWLServerAE = ""; DWORD CGlobals::m_lMWLServerIP = BUILD_IP(0, 0, 0, 0); int CGlobals::m_nMWLServerPort = 104; CString CGlobals::m_strMWLClientAE = ""; int CGlobals::m_bMWLServerValid = FALSE; // Page2 int CGlobals::m_bUseStorageServer = FALSE; CString CGlobals::m_strStorageServerAE = ""; DWORD CGlobals::m_lStorageServerIP = BuildIP(0,0,0,0); int CGlobals::m_nStorageServerPort = 104; CString CGlobals::m_strStorageClientAE = ""; int CGlobals::m_bStorageServerValid = FALSE; #endif // Page3 #ifdef _DEBUG int CGlobals::m_nQueryType = CPage3::QUERY_BROAD_MODALITY_WORK_LIST; CString CGlobals::m_strAccessionNumber = ""; CString CGlobals::m_strModality = "US"; CString CGlobals::m_strPatientID = ""; CString CGlobals::m_strPatientName = "ANOTHER*"; CString CGlobals::m_strRequestedProcedureID = ""; CString CGlobals::m_strScheduleDate = "06/05/2002"; int CGlobals::m_bCheckModality = TRUE; int CGlobals::m_bCheckDate = FALSE; #else int CGlobals::m_nQueryType = CPage3::QUERY_BROAD_MODALITY_WORK_LIST; CString CGlobals::m_strAccessionNumber = ""; CString CGlobals::m_strModality = "US"; CString CGlobals::m_strPatientID = ""; CString CGlobals::m_strPatientName = ""; CString CGlobals::m_strRequestedProcedureID = ""; CString CGlobals::m_strScheduleDate = ""; int CGlobals::m_bCheckModality = TRUE; int CGlobals::m_bCheckDate = FALSE; #endif // Page 5 BITMAPHANDLE CGlobals::m_Bitmap; // Tree Control CMyTreeCtrl CGlobals::m_TreeResult; CImageList CGlobals::m_ImageList; int CGlobals::m_nIconFolder; int CGlobals::m_nIconElement; int CGlobals::m_nIconMissing; int CGlobals::m_nIconSequence; int CGlobals::m_nIconWorklist; // Created Dataset LMyDicomDS *CGlobals::m_pDS = NULL; // Modality Table MODALITY CGlobals::m_ModalityTable[] = { "SC", "Secondary Capture Image", CLASS_SC_IMAGE_STORAGE, "CR", "Computed Radiography", CLASS_CR_IMAGE_STORAGE, "CT", "Computed Tomography", CLASS_CT_IMAGE_STORAGE, "MR", "Magnetic Resonance", CLASS_MR_IMAGE_STORAGE, "NM", "Nuclear Medicine", CLASS_NM_IMAGE_STORAGE, "US", "Ultrasound", CLASS_US_IMAGE_STORAGE, //"OT", "Other", //"BI", "Biomagnetic Imaging", //"CD", "Color flow Dopple", //"DD", "Duplex Doppler", //"DG", "Diaphanograph", "ES", "Endoscopy", CLASS_VL_ENDOSCOPIC_IMAGE_STORAGE, //"LS", "Laser surface scan", //"MA", "Magnetic resonance angiography", //"MS", "Magnetic resonance spectroscopy", //"PT", "Positron emission tomography (PET)", //"RG", "Radiographic imaging (conventional film/screen)", //"ST", "Single-photon emission computed tomography (SPECT)", //"TG", "Thermography", "XA", "X-Ray Angiography", CLASS_XA_IMAGE_STORAGE, "RF", "Radio Fluoroscopy", CLASS_XRF_IMAGE_STORAGE, "RTIMAGE", "Radiotherapy Image", CLASS_RT_IMAGE_STORAGE, "RTDOSE", "Radiotherapy Dose", CLASS_RT_DOSE_STORAGE, "RTSTRUCT", "Radiotherapy Structure Set", CLASS_RT_STRUCTURE_SET_STORAGE, "RTPLAN", "Radiotherapy Plan", CLASS_RT_PLAN_STORAGE, //"RTRECORD", "RT Treatment Record", //"HC", "Hard Copy", "DX", "Digital Radiography", CLASS_DX_IMAGE_STORAGE_PRESENTATION, "MG", "Mammography", CLASS_DX_MAMMOGRAPHY_IMAGE_STORAGE_PRESENTATION, "IO", "Intra-oral Radiography", CLASS_DX_INTRAORAL_IMAGE_STORAGE_PRESENTATION, "PX", "Panoramic X-Ray", CLASS_DX_IMAGE_STORAGE_PRESENTATION, "GM", "General Microscopy", CLASS_VL_MICROSCOPIC_IMAGE_STORAGE, "SM", "Slide Microscopy", CLASS_VL_SLIDE_COORDINATES_MICROSCOPIC_IMAGE_STORAGE, "XC", "External-camera Photography",CLASS_VL_PHOTOGRAPHIC_IMAGE_STORAGE, //"PR", "Presentation State", //"AU", "Audio", //"ECG", "Electrocardiography", //"EPS", "Cardiac Electrophysiology", //"HD", "Hemodynamic Waveform", //"SR", "SR Document", //"IVUS", "Intravascular Ultrasound", //// Retired Defined Terms for the Modality (0008,0060) are: //"DS", "Digital Subtraction Angiography (retired)", //"CF", "Cinefluorography (retired)", //"DF", "Digital fluoroscopy (retired)", //"VF", "Videofluorography (retired)", //"AS", "Angioscopy", //"CS", "Cystoscopy", //"EC", "Echocardiography", //"LP", "Laparoscopy", //"FA", "Fluorescein angiography", //"CP", "Culposcopy", //"DM", "Digital microscopy", //"FS", "Fundoscopy", }; int CGlobals::m_nModalityTableCount = sizeof(CGlobals::m_ModalityTable)/sizeof(MODALITY); //Initialize the image list L_UINT32 CGlobals::m_uClass = -1; #define REGISTRY_LOCATION "SOFTWARE\\LEAD Technologies, Inc.\\DicomMWL" void CGlobals::LoadRegKeys() { long lRet; CMyRegKey RegKey; lRet = RegKey.Open(HKEY_CURRENT_USER, REGISTRY_LOCATION); if (lRet == ERROR_SUCCESS) { // Page 1 RegKey.QueryValue( CGlobals::m_nMWLServerPort, "nMWLServerPort"); RegKey.QueryValue( CGlobals::m_strMWLServerAE, "strMWLServerAE"); RegKey.CRegKey::QueryValue( CGlobals::m_lMWLServerIP, "lMWLServerAE"); RegKey.QueryValue( CGlobals::m_strMWLClientAE, "strMWLClientAE"); RegKey.QueryValue( CGlobals::m_bMWLServerValid, "bMWLServerValid"); // Page 2 RegKey.QueryValue( CGlobals::m_bUseStorageServer, "bUseStorageServer"); RegKey.QueryValue( CGlobals::m_nStorageServerPort, "nStorageServerPort"); RegKey.QueryValue( CGlobals::m_strStorageServerAE, "strStorageServerAE"); RegKey.QueryValue( CGlobals::m_strStorageClientAE, "strStorageClientAE"); RegKey.QueryValue( CGlobals::m_bStorageServerValid, "bStorageServerValid"); RegKey.CRegKey::QueryValue( CGlobals::m_lStorageServerIP, "lStorageServerIP"); // Page 3 RegKey.QueryValue( CGlobals::m_nQueryType, "nQueryType"); RegKey.QueryValue( CGlobals::m_strAccessionNumber, "strAccessionNumber"); RegKey.QueryValue( CGlobals::m_strModality, "strModality"); RegKey.QueryValue( CGlobals::m_strPatientID, "strPatientID"); RegKey.QueryValue( CGlobals::m_strPatientName, "strPatientName"); RegKey.QueryValue( CGlobals::m_strRequestedProcedureID, "strRequestedProcedureID"); RegKey.QueryValue( CGlobals::m_strScheduleDate, "strScheduleDate"); RegKey.QueryValue( CGlobals::m_bCheckModality, "bCheckModality"); RegKey.QueryValue( CGlobals::m_bCheckDate, "bCheckDate"); // Timer RegKey.QueryValue( CGlobals::m_nTimerMax, "nTimerMax"); } } void CGlobals::SaveRegKeys() { long lRet; CMyRegKey RegKey; lRet = RegKey.Create(HKEY_CURRENT_USER, REGISTRY_LOCATION); if (lRet == ERROR_SUCCESS) { // Page 1 RegKey.SetValue( CGlobals::m_nMWLServerPort, "nMWLServerPort"); RegKey.SetValue( CGlobals::m_strMWLServerAE, "strMWLServerAE"); RegKey.SetValue( CGlobals::m_lMWLServerIP, "lMWLServerAE"); RegKey.SetValue( CGlobals::m_strMWLClientAE, "strMWLClientAE"); RegKey.SetValue( CGlobals::m_bMWLServerValid, "bMWLServerValid"); // Page 2 RegKey.SetValue( CGlobals::m_bUseStorageServer, "bUseStorageServer"); RegKey.SetValue( CGlobals::m_nStorageServerPort, "nStorageServerPort"); RegKey.SetValue( CGlobals::m_strStorageServerAE, "strStorageServerAE"); RegKey.SetValue( CGlobals::m_strStorageClientAE, "strStorageClientAE"); RegKey.SetValue( CGlobals::m_bStorageServerValid, "bStorageServerValid"); RegKey.SetValue( CGlobals::m_lStorageServerIP, "lStorageServerIP"); // Page 3 RegKey.SetValue( CGlobals::m_nQueryType, "nQueryType"); RegKey.SetValue( CGlobals::m_strAccessionNumber, "strAccessionNumber"); RegKey.SetValue( CGlobals::m_strModality, "strModality"); RegKey.SetValue( CGlobals::m_strPatientID, "strPatientID"); RegKey.SetValue( CGlobals::m_strPatientName, "strPatientName"); RegKey.SetValue( CGlobals::m_strRequestedProcedureID, "strRequestedProcedureID"); RegKey.SetValue( CGlobals::m_strScheduleDate, "strScheduleDate"); RegKey.SetValue( CGlobals::m_bCheckModality, "bCheckModality"); RegKey.SetValue( CGlobals::m_bCheckDate, "bCheckDate"); // Timer RegKey.SetValue( CGlobals::m_nTimerMax, "nTimerMax"); } } //To DO list: /* 1. Save/read the data in registry 2. I think you are populating the query incorrectly--the extra fields--look at the spec 3. Functions to delete type3 empty elements is not correct Need to traverse high-level 1.dataset and 2. IOD and compare element by element Also, delete a type3 sequence if all element under it are empty (even if they are mandatory) This needs to be a function in the toolkit 4. Unable to save fields that are not strings! 5. Doesn't time out when connect 6. Add diya dialog */