OpenWalnut
1.5.0dev
src
core
dataHandler
WPersonalInformation.h
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
#ifndef WPERSONALINFORMATION_H
26
#define WPERSONALINFORMATION_H
27
28
#include <stdint.h>
29
30
#include <string>
31
#include <boost/date_time/posix_time/posix_time_types.hpp>
32
33
34
/**
35
* A structure that holds all relevant information about the subject.
36
* \ingroup dataHandler
37
*/
38
class
WPersonalInformation
// NOLINT
39
{
40
/**
41
* Only tests are allowed as friends.
42
*/
43
friend
class
WPersonalInformationTest
;
44
public
:
45
/**
46
* Enumeration of possible sex types.
47
*/
48
enum
Sex
49
{
50
male,
51
female,
52
unknown
53
};
54
55
/**
56
* Returns an empty dummy WPersonalInformation object.
57
*
58
* \return the dummy object
59
*/
60
static
WPersonalInformation
createDummyInformation
();
61
62
/**
63
* Returns the subjectID of the person. This is zero for dummy information.
64
*
65
* \return subject id number
66
*/
67
uint64_t
getSubjectID
()
const
;
68
69
/**
70
* Sets the subjectID of the person. This must be non-zero as changed information is not considered dummy anymore.
71
* \param subjectID New globally unique identifier
72
*/
73
void
setSubjectID
( uint64_t subjectID );
74
75
/**
76
* Returns the last or family name of the person.
77
*
78
* \return family name
79
*/
80
std::string
getLastName
()
const
;
81
82
/**
83
* Sets the last or family name of the person if the object is no dummy anymore.
84
* \param lastName the new last name
85
*/
86
void
setLastName
( std::string lastName );
87
88
/**
89
* Returns the middle name of the person.
90
*
91
* \return middle name
92
*/
93
std::string
getMiddleName
()
const
;
94
95
/**
96
* Returns the first or given name of the person.
97
*
98
* \return first name
99
*/
100
std::string
getFirstName
()
const
;
101
102
/**
103
* Returns if all members of the current WPersonalInformation are equal to those of info.
104
* \param info the WPersonalInformation to compare with
105
*
106
* \return true if the information are equal
107
*/
108
bool
operator==
(
WPersonalInformation
info )
const
;
109
110
/**
111
* Returns if not all members of the current WPersonalInformation are equal to those of info.
112
* \param info the WPersonalInformation to compare with
113
*
114
* \return true if the personal informations differ
115
*/
116
bool
operator!=
(
WPersonalInformation
info )
const
;
117
118
/**
119
* Returns the name of the subject. This is a concatenation of first, middle and last name.
120
*
121
* \return the name of the subject.
122
*/
123
std::string
getCompleteName
()
const
;
124
125
protected
:
126
private
:
127
/**
128
* Private default constructor to force the use of special function for dummy infos.
129
*/
130
WPersonalInformation
();
131
132
// TODO(wiebel): need getters and setters for all methods.
133
// TODO(wiebel): Should better be something like dotnet's System.Guid
134
uint64_t
m_subjectID
;
//!< Represents a globally unique identifier.
135
std::string
m_subjectCode
;
//!< Code for person
136
std::string
m_lastName
;
//!< Last name or family of the person.
137
std::string
m_middleName
;
//!< Middle name of the person, if any.
138
std::string
m_firstName
;
//!< First name or given name of the person.
139
boost::posix_time::ptime
m_dateOfBirth
;
//!< Birthday of the person.
140
std::string
m_streetAndNumber
;
//!< street name and number of house in which person lives
141
std::string
m_zipCode
;
//!< ZIP code of the city in which person lives
142
std::string
m_city
;
//!< city in which person lives
143
std::string
m_state
;
//!< state in which person lives
144
std::string
m_country
;
//!< country in which person lives
145
std::string
m_phone
;
//!< phone number of person
146
std::string
m_eMail
;
//!< e-mail adress of person
147
std::string
m_handicaps
;
//!< Description of the handicaps of the person.
148
Sex
m_sex
;
//!< The gender of the person.
149
// TODO(wiebel): Should better be something like dotnet's System.Nullable<byte>
150
char
m_categoryId
;
//!< not documented.
151
std::string
m_handedness
;
//!< preference for using right or left hand
152
std::string
m_notes
;
//!< Notes.
153
std::string
m_diagnostic
;
//!< The diagnosis for the person.
154
std::string
m_medication
;
//!< The medication of the person.
155
std::string
m_referringDoctor
;
//!< The doctor who reffered the person.
156
};
157
158
#endif
// WPERSONALINFORMATION_H
WPersonalInformationTest
Tests for WPersonalInformation.
Definition:
WPersonalInformation_test.h:36
WPersonalInformation
A structure that holds all relevant information about the subject.
Definition:
WPersonalInformation.h:39
WPersonalInformation::m_eMail
std::string m_eMail
e-mail adress of person
Definition:
WPersonalInformation.h:146
WPersonalInformation::WPersonalInformation
WPersonalInformation()
Private default constructor to force the use of special function for dummy infos.
Definition:
WPersonalInformation.cpp:36
WPersonalInformation::getSubjectID
uint64_t getSubjectID() const
Returns the subjectID of the person.
Definition:
WPersonalInformation.cpp:61
WPersonalInformation::m_handedness
std::string m_handedness
preference for using right or left hand
Definition:
WPersonalInformation.h:151
WPersonalInformation::getLastName
std::string getLastName() const
Returns the last or family name of the person.
Definition:
WPersonalInformation.cpp:72
WPersonalInformation::getCompleteName
std::string getCompleteName() const
Returns the name of the subject.
Definition:
WPersonalInformation.cpp:77
WPersonalInformation::m_city
std::string m_city
city in which person lives
Definition:
WPersonalInformation.h:142
WPersonalInformation::m_country
std::string m_country
country in which person lives
Definition:
WPersonalInformation.h:144
WPersonalInformation::m_subjectID
uint64_t m_subjectID
Represents a globally unique identifier.
Definition:
WPersonalInformation.h:134
WPersonalInformation::operator!=
bool operator!=(WPersonalInformation info) const
Returns if not all members of the current WPersonalInformation are equal to those of info.
Definition:
WPersonalInformation.cpp:123
WPersonalInformation::m_categoryId
char m_categoryId
not documented.
Definition:
WPersonalInformation.h:150
WPersonalInformation::m_handicaps
std::string m_handicaps
Description of the handicaps of the person.
Definition:
WPersonalInformation.h:147
WPersonalInformation::m_referringDoctor
std::string m_referringDoctor
The doctor who reffered the person.
Definition:
WPersonalInformation.h:155
WPersonalInformation::getMiddleName
std::string getMiddleName() const
Returns the middle name of the person.
Definition:
WPersonalInformation.cpp:88
WPersonalInformation::m_subjectCode
std::string m_subjectCode
Code for person.
Definition:
WPersonalInformation.h:135
WPersonalInformation::m_firstName
std::string m_firstName
First name or given name of the person.
Definition:
WPersonalInformation.h:138
WPersonalInformation::m_sex
Sex m_sex
The gender of the person.
Definition:
WPersonalInformation.h:148
WPersonalInformation::m_medication
std::string m_medication
The medication of the person.
Definition:
WPersonalInformation.h:154
WPersonalInformation::m_middleName
std::string m_middleName
Middle name of the person, if any.
Definition:
WPersonalInformation.h:137
WPersonalInformation::Sex
Sex
Enumeration of possible sex types.
Definition:
WPersonalInformation.h:49
WPersonalInformation::setSubjectID
void setSubjectID(uint64_t subjectID)
Sets the subjectID of the person.
Definition:
WPersonalInformation.cpp:66
WPersonalInformation::createDummyInformation
static WPersonalInformation createDummyInformation()
Returns an empty dummy WPersonalInformation object.
Definition:
WPersonalInformation.cpp:31
WPersonalInformation::getFirstName
std::string getFirstName() const
Returns the first or given name of the person.
Definition:
WPersonalInformation.cpp:93
WPersonalInformation::m_streetAndNumber
std::string m_streetAndNumber
street name and number of house in which person lives
Definition:
WPersonalInformation.h:140
WPersonalInformation::m_zipCode
std::string m_zipCode
ZIP code of the city in which person lives.
Definition:
WPersonalInformation.h:141
WPersonalInformation::m_dateOfBirth
boost::posix_time::ptime m_dateOfBirth
Birthday of the person.
Definition:
WPersonalInformation.h:139
WPersonalInformation::m_lastName
std::string m_lastName
Last name or family of the person.
Definition:
WPersonalInformation.h:136
WPersonalInformation::operator==
bool operator==(WPersonalInformation info) const
Returns if all members of the current WPersonalInformation are equal to those of info.
Definition:
WPersonalInformation.cpp:98
WPersonalInformation::m_phone
std::string m_phone
phone number of person
Definition:
WPersonalInformation.h:145
WPersonalInformation::m_state
std::string m_state
state in which person lives
Definition:
WPersonalInformation.h:143
WPersonalInformation::m_notes
std::string m_notes
Notes.
Definition:
WPersonalInformation.h:152
WPersonalInformation::setLastName
void setLastName(std::string lastName)
Sets the last or family name of the person if the object is no dummy anymore.
Definition:
WPersonalInformation.cpp:82
WPersonalInformation::m_diagnostic
std::string m_diagnostic
The diagnosis for the person.
Definition:
WPersonalInformation.h:153
Generated by
1.9.1