-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdicomdb.cpp
More file actions
46 lines (37 loc) · 814 Bytes
/
dicomdb.cpp
File metadata and controls
46 lines (37 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "dicomdb.h"
DICOMDB::DICOMDB() : m_PatientIDCounter(0)
{
}
DICOMDB::~DICOMDB()
{
for(int i=0; i < m_ListPatients.size(); ++i)
{
delete m_ListPatients.value(i);
}
m_ListPatients.clear();
}
void DICOMDB::AddPatient(Patient *patient)
{
if(patient)
m_ListPatients.append(patient);
}
QList<Patient *> * DICOMDB::GetPatients()
{
return &m_ListPatients;
}
Patient* DICOMDB::GetPatient(int idx)
{
if(idx >= 0 && idx < m_ListPatients.size())
return m_ListPatients.value(idx);
else
return NULL;
}
Patient* DICOMDB::GetPatientByName(const QString& name)
{
for(int i=0; i < m_ListPatients.size(); ++i)
{
if(m_ListPatients.at(i)->GetName().compare(name) == 0)
return m_ListPatients.value(i);
}
return NULL;
}