Developer documentation
Version 3.0.3-105-gd3941f44
patient.h
Go to the documentation of this file.
1/* Copyright (c) 2008-2022 the MRtrix3 contributors.
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 *
7 * Covered Software is provided under this License on an "as is"
8 * basis, without warranty of any kind, either expressed, implied, or
9 * statutory, including, without limitation, warranties that the
10 * Covered Software is free of defects, merchantable, fit for a
11 * particular purpose or non-infringing.
12 * See the Mozilla Public License v. 2.0 for more details.
13 *
14 * For more details, see http://www.mrtrix.org/.
15 */
16
17#ifndef __file_dicom_patient_h__
18#define __file_dicom_patient_h__
19
20#include "memory.h"
21#include "file/dicom/study.h"
22
23namespace MR {
24 namespace File {
25 namespace Dicom {
26
27 class Study;
28
29 class Patient : public vector<std::shared_ptr<Study>> { NOMEMALIGN
30 public:
31 Patient (const std::string& patient_name, const std::string& patient_ID,
32 const std::string& patient_DOB) :
33 name (patient_name), ID (patient_ID), DOB (patient_DOB) { }
34 std::string name, ID, DOB;
35
36 std::shared_ptr<Study> find (const std::string& study_name, const std::string& study_ID = "",
37 const std::string& study_UID = "", const std::string& study_date = "", const std::string& study_time = "");
38
39 bool operator< (const Patient& s) const {
40 if (name != s.name)
41 return name < s.name;
42 if (ID != s.ID)
43 return ID < s.ID;
44 return DOB < s.DOB;
45 }
46
47 };
48
49
50 std::ostream& operator<< (std::ostream& stream, const Patient& item);
51
52
53 }
54 }
55}
56
57
58#endif
59
60
61
std::shared_ptr< Study > find(const std::string &study_name, const std::string &study_ID="", const std::string &study_UID="", const std::string &study_date="", const std::string &study_time="")
std::string name
Definition: patient.h:34
bool operator<(const Patient &s) const
Definition: patient.h:39
Patient(const std::string &patient_name, const std::string &patient_ID, const std::string &patient_DOB)
Definition: patient.h:31
#define NOMEMALIGN
Definition: memory.h:22
std::ostream & operator<<(std::ostream &stream, const Patient &item)
Definition: base.h:24
Item item