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