OpenWalnut  1.4.0
WPersonalInformation.h
00001 //---------------------------------------------------------------------------
00002 //
00003 // Project: OpenWalnut ( http://www.openwalnut.org )
00004 //
00005 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
00006 // For more information see http://www.openwalnut.org/copying
00007 //
00008 // This file is part of OpenWalnut.
00009 //
00010 // OpenWalnut is free software: you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as published by
00012 // the Free Software Foundation, either version 3 of the License, or
00013 // (at your option) any later version.
00014 //
00015 // OpenWalnut is distributed in the hope that it will be useful,
00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 // GNU Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public License
00021 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
00022 //
00023 //---------------------------------------------------------------------------
00024 
00025 #ifndef WPERSONALINFORMATION_H
00026 #define WPERSONALINFORMATION_H
00027 
00028 #include <stdint.h>
00029 
00030 #include <string>
00031 #include <boost/date_time/posix_time/posix_time_types.hpp>
00032 
00033 
00034 /**
00035  * A structure that holds all relevant information about the subject.
00036  * \ingroup dataHandler
00037  */
00038 class WPersonalInformation // NOLINT
00039 {
00040     /**
00041      * Only tests are allowed as friends.
00042      */
00043     friend class WPersonalInformationTest;
00044 public:
00045     /**
00046      * Enumeration of possible sex types.
00047      */
00048     enum Sex
00049     {
00050         male,
00051         female,
00052         unknown
00053     };
00054 
00055     /**
00056      * Returns an empty dummy WPersonalInformation object.
00057      *
00058      * \return the dummy object
00059      */
00060     static WPersonalInformation createDummyInformation();
00061 
00062     /**
00063      * Returns the subjectID of the person. This is zero for dummy information.
00064      *
00065      * \return subject id number
00066      */
00067     uint64_t getSubjectID() const;
00068 
00069     /**
00070      * Sets the subjectID of the person. This must be non-zero as changed information is not considered dummy anymore.
00071      * \param subjectID New globally unique identifier
00072      */
00073     void setSubjectID( uint64_t subjectID );
00074 
00075     /**
00076      * Returns the last or family name of the person.
00077      *
00078      * \return family name
00079      */
00080     std::string getLastName() const;
00081 
00082     /**
00083      * Sets the last or family name of the person if the object is no dummy anymore.
00084      * \param lastName the new last name
00085      */
00086     void setLastName( std::string lastName );
00087 
00088     /**
00089      * Returns the middle name of the person.
00090      *
00091      * \return middle name
00092      */
00093     std::string getMiddleName() const;
00094 
00095     /**
00096      * Returns the first or given name of the person.
00097      *
00098      * \return first name
00099      */
00100     std::string getFirstName() const;
00101 
00102     /**
00103      * Returns if all members of the current WPersonalInformation are equal to those of info.
00104      * \param info the WPersonalInformation to compare with
00105      *
00106      * \return true if the information are equal
00107      */
00108     bool operator==( WPersonalInformation info ) const;
00109 
00110     /**
00111      * Returns if not all members of the current WPersonalInformation are equal to those of info.
00112      * \param info the WPersonalInformation to compare with
00113      *
00114      * \return true if the personal informations differ
00115      */
00116     bool operator!=( WPersonalInformation info ) const;
00117 
00118     /**
00119      * Returns the name of the subject. This is a concatenation of first, middle and last name.
00120      *
00121      * \return the name of the subject.
00122      */
00123     std::string getCompleteName() const;
00124 
00125 protected:
00126 private:
00127     /**
00128      * Private default constructor to force the use of special function for dummy infos.
00129      */
00130     WPersonalInformation();
00131 
00132     // TODO(wiebel): need getters and setters for all methods.
00133     // TODO(wiebel): Should better be something like dotnet's System.Guid
00134     uint64_t m_subjectID; //!< Represents a globally unique identifier.
00135     std::string m_subjectCode; //!< Code for person
00136     std::string m_lastName; //!< Last name or family of the person.
00137     std::string m_middleName; //!< Middle name of the person, if any.
00138     std::string m_firstName; //!< First name or given name of the person.
00139     boost::posix_time::ptime m_dateOfBirth; //!< Birthday of the person.
00140     std::string m_streetAndNumber; //!< street name and number of house in which person lives
00141     std::string m_zipCode; //!< ZIP code of the city in which person lives
00142     std::string m_city; //!< city in which person lives
00143     std::string m_state; //!< state in which person lives
00144     std::string m_country; //!< country in which person lives
00145     std::string m_phone; //!< phone number of person
00146     std::string m_eMail; //!< e-mail adress of person
00147     std::string m_handicaps; //!< Description of the handicaps of the person.
00148     Sex m_sex; //!< The gender of the person.
00149     // TODO(wiebel):  Should better be something like dotnet's System.Nullable<byte>
00150     char m_categoryId; //!< not documented.
00151     std::string m_handedness; //!< preference for using right or left hand
00152     std::string m_notes; //!< Notes.
00153     std::string m_diagnostic; //!< The diagnosis for the person.
00154     std::string m_medication; //!< The medication of the person.
00155     std::string m_referringDoctor; //!< The doctor who reffered the person.
00156 };
00157 
00158 #endif  // WPERSONALINFORMATION_H