94 lines
3.3 KiB
C#
94 lines
3.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
|
|
namespace EHEC_Server
|
|
{
|
|
public class Edge
|
|
{
|
|
public string Source { get; set; }
|
|
public string Target { get; set; }
|
|
public string Edgetype { get; set; }
|
|
public Edge() { }
|
|
public List<Edge> GetEdges()
|
|
{
|
|
List<Edge> X = new List<Edge>();
|
|
X.AddRange(GetClusterRelationsPatientsOrigins());
|
|
X.AddRange(GetClusterRelationsPatientsResults());
|
|
return X;
|
|
}
|
|
public List<Edge> GetClusterRelationsPatientsOrigins()
|
|
{
|
|
Exam exam = new Exam();
|
|
List<Exam> exams = new List<Exam>();
|
|
exams = exam.GetAllExams();
|
|
|
|
Origin_Exam originExam = new Origin_Exam();
|
|
List<Origin_Exam> origin_Exams = new List<Origin_Exam>();
|
|
|
|
Patient patient = new Patient();
|
|
|
|
List<Edge> clusterEdges = new List<Edge>();
|
|
foreach (Exam exam_element in exams)
|
|
{
|
|
origin_Exams = originExam.GetExamsByExamId(exam_element.ExamId);
|
|
patient = patient.GetPatientIdById(exam_element.PatientId);
|
|
foreach (Origin_Exam origin_exam_element in origin_Exams)
|
|
{
|
|
Edge clusterEdge = new Edge
|
|
{
|
|
Edgetype = "Angesteckt in ",
|
|
Source = patient.PatientUid,
|
|
Target = origin_exam_element.Origin_ExamUid ///for tests !!!!!!!!!!!!!!!! correct it to Origin id somehow!!!!!!!!
|
|
};
|
|
clusterEdges.Add(clusterEdge);
|
|
}
|
|
}
|
|
return clusterEdges;
|
|
}
|
|
public List<Edge> GetClusterRelationsPatientsResults()
|
|
{
|
|
Patient patient = new Patient();
|
|
Result result = new Result();
|
|
Exam exam = new Exam();
|
|
List<Exam> exams = new List<Exam>();
|
|
exams = exam.GetAllExams();
|
|
List<Edge> clusterEdges = new List<Edge>();
|
|
foreach (Exam exam_element in exams)
|
|
{
|
|
patient = patient.GetPatientIdById(exam_element.PatientId);
|
|
result = result.GetResultsById(exam_element.ResultId);
|
|
Edge clusterEdge = new Edge
|
|
{
|
|
Edgetype = "Wurde Angesteckt mit ",
|
|
Source = patient.PatientUid,
|
|
Target = result.ResultUid
|
|
};
|
|
clusterEdges.Add(clusterEdge);
|
|
};
|
|
return clusterEdges;
|
|
}
|
|
//public List<Edges> GetClusterRelationOrigin()
|
|
//{
|
|
// Origin origin = new Origin();
|
|
// List<Origin> origins = new List<Origin>();
|
|
// origins = origin.GetAllOrigins();
|
|
// List<Edges> clusterOrigins = new List<Edges>();
|
|
// foreach (Origin element in origins)
|
|
// {
|
|
// Nodes clusterOrigin = new Nodes
|
|
// {
|
|
// Nodetype = "Angesteckt in ",
|
|
// Source = element.OriginId,
|
|
// Target = element.City
|
|
// };
|
|
// clusterOrigins.Add(clusterOrigin);
|
|
// };
|
|
// return clusterOrigins;
|
|
//}
|
|
}
|
|
|
|
}
|
|
|