2011-03-20 03:22:52 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace IndianHealthService.ClinicalScheduling
|
|
|
|
|
{
|
2011-03-21 08:47:45 -04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// You guessed it.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public enum Sex
|
|
|
|
|
{
|
|
|
|
|
Male, Female
|
|
|
|
|
};
|
|
|
|
|
|
2011-03-20 03:22:52 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Puppet standing for a Real Patient
|
|
|
|
|
/// </summary>
|
2011-05-08 05:17:53 -04:00
|
|
|
|
[Serializable]
|
2011-03-20 03:22:52 -04:00
|
|
|
|
public class Patient
|
|
|
|
|
{
|
|
|
|
|
public int DFN { get; set; }
|
|
|
|
|
public string Name { get; set; }
|
2011-03-21 08:47:45 -04:00
|
|
|
|
public Sex Sex;
|
2011-03-20 03:22:52 -04:00
|
|
|
|
public DateTime DOB { get; set; }
|
|
|
|
|
public string ID { get; set; }
|
|
|
|
|
public string HRN { get; set; }
|
|
|
|
|
public List<CGAppointment> Appointments { get; set; }
|
|
|
|
|
public string Street { get; set; }
|
|
|
|
|
public string City { get; set; }
|
|
|
|
|
public string State { get; set; }
|
|
|
|
|
public string Zip { get; set; }
|
|
|
|
|
public string Country { get; set; }
|
|
|
|
|
public string Email { get; set; }
|
|
|
|
|
public string HomePhone { get; set; }
|
|
|
|
|
public string WorkPHone { get; set; }
|
|
|
|
|
public string CellPhone { get; set; }
|
2011-03-21 08:47:45 -04:00
|
|
|
|
public TimeSpan Age
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return (DateTime.Today - this.DOB);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-23 05:15:51 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns User Friendly Age. If Age < 5, then Years and Months
|
|
|
|
|
/// If Age > 5, then only Years.
|
|
|
|
|
/// Humans tend to round down their ages. So I follow the same rule here.
|
|
|
|
|
/// </summary>
|
2011-03-21 08:47:45 -04:00
|
|
|
|
public string UserFriendlyAge
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (Age.TotalDays / 365.24 > 5)
|
2011-03-24 09:26:14 -04:00
|
|
|
|
return Math.Floor((Age.TotalDays / 365.24)).ToString() + " " + strings.years;
|
2011-03-21 08:47:45 -04:00
|
|
|
|
else
|
2011-03-24 09:26:14 -04:00
|
|
|
|
return Math.Floor((Age.TotalDays / 365.24)).ToString() + " " + strings.years + " " + strings.and + " "
|
|
|
|
|
+ Math.Floor(Age.TotalDays % 365.24 / 30).ToString() + " " + strings.months;
|
2011-03-21 08:47:45 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
2011-03-20 03:22:52 -04:00
|
|
|
|
}
|
|
|
|
|
}
|