oop_II-6/EHEC_Server/EHEC_Server/cluster_dependencies/Models/ClusterPatient.cs

38 lines
1.2 KiB
C#
Raw Normal View History

2018-07-17 19:51:33 +02:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace EHEC_Server
{
2018-07-21 17:16:56 +02:00
/// <summary>
/// This clas converts the object from db model to the needs of Json
/// conversion for Clusteranalysis.
/// </summary>
2018-07-17 19:51:33 +02:00
public class ClusterPatient
{
2018-07-21 17:16:56 +02:00
public int Id { get; set; }
public string Name { get; set; }
public string Nodetype { get; set; }
2018-07-18 19:19:47 +02:00
public ClusterPatient() { }
2018-07-17 21:05:13 +02:00
public List<ClusterPatient> GetClusterPatients()
2018-07-17 19:51:33 +02:00
{
2018-07-18 19:19:47 +02:00
Patient patient = new Patient();
List<Patient> patients = new List<Patient>();
patients = patient.GetAllPatients();
2018-07-21 17:16:56 +02:00
List<ClusterPatient> clusterPatients = new List<ClusterPatient>();
2018-07-18 19:19:47 +02:00
foreach (Patient element in patients)
2018-07-17 19:51:33 +02:00
{
ClusterPatient clusterPatient = new ClusterPatient
{
Id = element.PatientId,
2018-07-18 19:19:47 +02:00
Nodetype = "patient",
2018-07-17 19:51:33 +02:00
Name = element.FirstName + " " + element.LastName
};
2018-07-21 17:16:56 +02:00
clusterPatients.Add(clusterPatient);
2018-07-17 19:51:33 +02:00
}
2018-07-21 17:16:56 +02:00
return clusterPatients;
2018-07-17 19:51:33 +02:00
}
2018-07-21 17:16:56 +02:00
}
2018-07-17 19:51:33 +02:00
}