OpenWalnut  1.3.1
WPersonalInformation.cpp
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #include <string>
26 
27 #include "../common/WAssert.h"
28 #include "WSubject.h"
29 #include "WPersonalInformation.h"
30 
32 {
33  return WPersonalInformation();
34 }
35 
37  : m_subjectID( WSubject::SUBJECT_UNKNOWN ),
38  m_subjectCode( "" ),
39  m_lastName( "UNKNOWN" ),
40  m_middleName( "" ),
41  m_firstName( "" ),
42  m_dateOfBirth( boost::date_time::not_a_date_time ),
43  m_streetAndNumber( "" ),
44  m_zipCode( "" ),
45  m_city( "" ),
46  m_state( "" ),
47  m_country( "" ),
48  m_phone( "" ),
49  m_eMail( "" ),
50  m_handicaps( "" ),
51  m_sex( unknown ),
52  m_categoryId( 0 ),
53  m_handedness( "" ),
54  m_notes( "" ),
55  m_diagnostic( "" ),
56  m_medication( "" ),
57  m_referringDoctor( "" )
58 {
59 }
60 
62 {
63  return m_subjectID;
64 }
65 
66 void WPersonalInformation::setSubjectID( uint64_t subjectID )
67 {
68  WAssert( subjectID != WSubject::SUBJECT_UNKNOWN, "ID zero is reserved for dummies." );
69  m_subjectID = subjectID;
70 }
71 
73 {
74  return m_lastName;
75 }
76 
78 {
79  return getLastName() + ", " + getFirstName() + " " + getMiddleName();
80 }
81 
82 void WPersonalInformation::setLastName( std::string lastName )
83 {
84  WAssert( m_subjectID != WSubject::SUBJECT_UNKNOWN, "SubjectID is still zero. This is reserved for empty dummies. Set it first." );
85  m_lastName = lastName;
86 }
87 
89 {
90  return m_middleName;
91 }
92 
94 {
95  return m_firstName;
96 }
97 
99 {
100  return m_subjectID == info.m_subjectID
101  && m_subjectCode == info.m_subjectCode
102  && m_lastName == info.m_lastName
103  && m_middleName == info.m_middleName
104  && m_firstName == info.m_firstName
105  && m_dateOfBirth == info.m_dateOfBirth
107  && m_zipCode == info.m_zipCode
108  && m_city == info.m_city
109  && m_state == info.m_state
110  && m_country == info.m_country
111  && m_phone == info.m_phone
112  && m_eMail == info.m_eMail
113  && m_handicaps == info.m_handicaps
114  && m_sex == info.m_sex
115  && m_categoryId == info.m_categoryId
116  && m_handedness == info.m_handedness
117  && m_notes == info.m_notes
118  && m_diagnostic == info.m_diagnostic
119  && m_medication == info.m_medication
121 }
122 
124 {
125  return !( (*this) == info );
126 }