OpenWalnut  1.5.0dev
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  */
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  */
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  */
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
Tests for WPersonalInformation.
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.
Sex
Enumeration of possible sex types.
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.