OpenWalnut  1.5.0dev
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
106  && m_streetAndNumber == info.m_streetAndNumber
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
120  && m_referringDoctor == info.m_referringDoctor;
121 }
122 
124 {
125  return !( ( *this ) == info );
126 }
A structure that holds all relevant information about the subject.
std::string m_eMail
e-mail adress of person
WPersonalInformation()
Private default constructor to force the use of special function for dummy infos.
uint64_t getSubjectID() const
Returns the subjectID of the person.
std::string m_handedness
preference for using right or left hand
std::string getLastName() const
Returns the last or family name of the person.
std::string getCompleteName() const
Returns the name of the subject.
std::string m_city
city in which person lives
std::string m_country
country in which person lives
uint64_t m_subjectID
Represents a globally unique identifier.
bool operator!=(WPersonalInformation info) const
Returns if not all members of the current WPersonalInformation are equal to those of info.
char m_categoryId
not documented.
std::string m_handicaps
Description of the handicaps of the person.
std::string m_referringDoctor
The doctor who reffered the person.
std::string getMiddleName() const
Returns the middle name of the person.
std::string m_subjectCode
Code for person.
std::string m_firstName
First name or given name of the person.
Sex m_sex
The gender of the person.
std::string m_medication
The medication of the person.
std::string m_middleName
Middle name of the person, if any.
void setSubjectID(uint64_t subjectID)
Sets the subjectID of the person.
static WPersonalInformation createDummyInformation()
Returns an empty dummy WPersonalInformation object.
std::string getFirstName() const
Returns the first or given name of the person.
std::string m_streetAndNumber
street name and number of house in which person lives
std::string m_zipCode
ZIP code of the city in which person lives.
boost::posix_time::ptime m_dateOfBirth
Birthday of the person.
std::string m_lastName
Last name or family of the person.
bool operator==(WPersonalInformation info) const
Returns if all members of the current WPersonalInformation are equal to those of info.
std::string m_phone
phone number of person
std::string m_state
state in which person lives
std::string m_notes
Notes.
void setLastName(std::string lastName)
Sets the last or family name of the person if the object is no dummy anymore.
std::string m_diagnostic
The diagnosis for the person.
Container for all WDataSets belonging to one subject or patient.
Definition: WSubject.h:46