finish relations, added unique id's for each entity and linked Uid's to clusters.
This commit is contained in:
parent
4547400137
commit
5ca4544e15
|
@ -15,6 +15,7 @@ namespace EHEC_Server
|
|||
{
|
||||
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
||||
{
|
||||
doctor.DoctorUid = Guid.NewGuid().ToString();
|
||||
ctx.Doctors.Add(doctor);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ namespace EHEC_Server
|
|||
{
|
||||
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
||||
{
|
||||
exam.ExamUid = Guid.NewGuid().ToString();
|
||||
ctx.Exams.Add(exam);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace EHEC_Server
|
|||
{
|
||||
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
||||
{
|
||||
origin.OriginUid = Guid.NewGuid().ToString();
|
||||
ctx.Origins.Add(origin);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace EHEC_Server
|
|||
{
|
||||
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
||||
{
|
||||
origin_exam.Origin_ExamUid = Guid.NewGuid().ToString();
|
||||
ctx.Origin_Exam.Add(origin_exam);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
|
@ -30,5 +31,13 @@ namespace EHEC_Server
|
|||
return ctx.Origin_Exam.ToList();
|
||||
}
|
||||
}
|
||||
public List<Origin_Exam> GetExamsByExamId(int id)
|
||||
{
|
||||
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
||||
{
|
||||
var exams = ctx.Origin_Exam.Where(e => e.ExamId == id).ToList();
|
||||
return exams;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,6 +14,7 @@ namespace EHEC_Server
|
|||
{
|
||||
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
||||
{
|
||||
patient.PatientUid = Guid.NewGuid().ToString();
|
||||
ctx.Patients.Add(patient);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
|
@ -32,5 +33,13 @@ namespace EHEC_Server
|
|||
return ctx.Patients.ToList();
|
||||
}
|
||||
}
|
||||
public Patient GetPatientIdById(int id)
|
||||
{
|
||||
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
||||
{
|
||||
Patient patient = ctx.Patients.Where(e => e.PatientId == id).SingleOrDefault();
|
||||
return patient;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,6 +14,7 @@ namespace EHEC_Server
|
|||
{
|
||||
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
||||
{
|
||||
result.ResultUid = Guid.NewGuid().ToString();
|
||||
ctx.Results.Add(result);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
|
@ -33,5 +34,13 @@ namespace EHEC_Server
|
|||
return ctx.Results.ToList();
|
||||
}
|
||||
}
|
||||
public Result GetResultsById(int id)
|
||||
{
|
||||
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
|
||||
{
|
||||
Result result = ctx.Results.Where(e => e.ResultId == id).SingleOrDefault();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,6 +29,8 @@ public partial class Doctor
|
|||
|
||||
public int DoctorId { get; set; }
|
||||
|
||||
public string DoctorUid { get; set; }
|
||||
|
||||
public string FirstName { get; set; }
|
||||
|
||||
public string LastName { get; set; }
|
||||
|
|
|
@ -29,6 +29,8 @@ public partial class Exam
|
|||
|
||||
public int ExamId { get; set; }
|
||||
|
||||
public string ExamUid { get; set; }
|
||||
|
||||
public int DoctorId { get; set; }
|
||||
|
||||
public int PatientId { get; set; }
|
||||
|
@ -39,14 +41,14 @@ public partial class Exam
|
|||
|
||||
public virtual Doctor Doctor { get; set; }
|
||||
|
||||
public virtual Patient Patient { get; set; }
|
||||
|
||||
public virtual Result Result { get; set; }
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
|
||||
public virtual ICollection<Origin_Exam> Origin_Exam { get; set; }
|
||||
|
||||
public virtual Patient Patient { get; set; }
|
||||
|
||||
public virtual Result Result { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,12 +38,12 @@ public partial class EHEC_DBEntities : DbContext
|
|||
|
||||
public virtual DbSet<Origin> Origins { get; set; }
|
||||
|
||||
public virtual DbSet<Origin_Exam> Origin_Exam { get; set; }
|
||||
|
||||
public virtual DbSet<Patient> Patients { get; set; }
|
||||
|
||||
public virtual DbSet<Result> Results { get; set; }
|
||||
|
||||
public virtual DbSet<Origin_Exam> Origin_Exam { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// T4 code generation is enabled for model '\\Mac\Home\Life\Schule\IBZ\SW\OOP2\casestudy\EHEC_Server\EHEC_Server\Model.edmx'.
|
||||
// T4 code generation is enabled for model 'Y:\Life\Schule\IBZ\SW\OOP2\casestudy\EHEC_Server\EHEC_Server\Model.edmx'.
|
||||
// To enable legacy code generation, change the value of the 'Code Generation Strategy' designer
|
||||
// property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model
|
||||
// is open in the designer.
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<PropertyRef Name="DoctorId" />
|
||||
</Key>
|
||||
<Property Name="DoctorId" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="DoctorUid" Type="nvarchar(max)" />
|
||||
<Property Name="FirstName" Type="nvarchar(max)" Nullable="false" />
|
||||
<Property Name="LastName" Type="nvarchar(max)" Nullable="false" />
|
||||
<Property Name="DoctorOrigin" Type="nvarchar(max)" Nullable="false" />
|
||||
|
@ -20,6 +21,7 @@
|
|||
<PropertyRef Name="ExamId" />
|
||||
</Key>
|
||||
<Property Name="ExamId" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="ExamUid" Type="nvarchar(max)" />
|
||||
<Property Name="DoctorId" Type="int" Nullable="false" />
|
||||
<Property Name="PatientId" Type="int" Nullable="false" />
|
||||
<Property Name="ResultId" Type="int" Nullable="false" />
|
||||
|
@ -29,6 +31,7 @@
|
|||
<PropertyRef Name="OriginId" />
|
||||
</Key>
|
||||
<Property Name="OriginId" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="OriginUid" Type="nvarchar(max)" />
|
||||
<Property Name="Name" Type="nvarchar(max)" Nullable="false" />
|
||||
<Property Name="Food" Type="nvarchar(max)" Nullable="false" />
|
||||
<Property Name="Street" Type="nvarchar(max)" Nullable="false" />
|
||||
|
@ -39,6 +42,7 @@
|
|||
<PropertyRef Name="Origin_ExamId" />
|
||||
</Key>
|
||||
<Property Name="Origin_ExamId" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="Origin_ExamUid" Type="nvarchar(max)" />
|
||||
<Property Name="OriginId" Type="int" Nullable="false" />
|
||||
<Property Name="ExamId" Type="int" Nullable="false" />
|
||||
</EntityType>
|
||||
|
@ -47,6 +51,7 @@
|
|||
<PropertyRef Name="PatientId" />
|
||||
</Key>
|
||||
<Property Name="PatientId" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="PatientUid" Type="nvarchar(max)" />
|
||||
<Property Name="FirstName" Type="nvarchar(max)" Nullable="false" />
|
||||
<Property Name="LastName" Type="nvarchar(max)" Nullable="false" />
|
||||
<Property Name="BirthDate" Type="datetime" Nullable="false" />
|
||||
|
@ -59,6 +64,7 @@
|
|||
<PropertyRef Name="ResultId" />
|
||||
</Key>
|
||||
<Property Name="ResultId" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="ResultUid" Type="nvarchar(max)" />
|
||||
<Property Name="Name" Type="nvarchar(max)" Nullable="false" />
|
||||
</EntityType>
|
||||
<Association Name="FK_DoctorExam">
|
||||
|
@ -157,12 +163,17 @@
|
|||
<EntitySet Name="Doctors" EntityType="EHEC_DBModel.Doctor" />
|
||||
<EntitySet Name="Exams" EntityType="EHEC_DBModel.Exam" />
|
||||
<EntitySet Name="Origins" EntityType="EHEC_DBModel.Origin" />
|
||||
<EntitySet Name="Origin_Exam" EntityType="EHEC_DBModel.Origin_Exam" />
|
||||
<EntitySet Name="Patients" EntityType="EHEC_DBModel.Patient" />
|
||||
<EntitySet Name="Results" EntityType="EHEC_DBModel.Result" />
|
||||
<AssociationSet Name="FK_DoctorExam" Association="EHEC_DBModel.FK_DoctorExam">
|
||||
<End Role="Doctor" EntitySet="Doctors" />
|
||||
<End Role="Exam" EntitySet="Exams" />
|
||||
</AssociationSet>
|
||||
<AssociationSet Name="FK_Exam" Association="EHEC_DBModel.FK_Exam">
|
||||
<End Role="Exam" EntitySet="Exams" />
|
||||
<End Role="Origin_Exam" EntitySet="Origin_Exam" />
|
||||
</AssociationSet>
|
||||
<AssociationSet Name="FK_PatientExam" Association="EHEC_DBModel.FK_PatientExam">
|
||||
<End Role="Patient" EntitySet="Patients" />
|
||||
<End Role="Exam" EntitySet="Exams" />
|
||||
|
@ -171,12 +182,7 @@
|
|||
<End Role="Result" EntitySet="Results" />
|
||||
<End Role="Exam" EntitySet="Exams" />
|
||||
</AssociationSet>
|
||||
<EntitySet Name="Origin_Exam" EntityType="EHEC_DBModel.Origin_Exam" />
|
||||
<AssociationSet Name="FK_Exam1" Association="EHEC_DBModel.FK_Exam1">
|
||||
<End Role="Exam" EntitySet="Exams" />
|
||||
<End Role="Origin_Exam" EntitySet="Origin_Exam" />
|
||||
</AssociationSet>
|
||||
<AssociationSet Name="FK_Origin1" Association="EHEC_DBModel.FK_Origin1">
|
||||
<AssociationSet Name="FK_Origin" Association="EHEC_DBModel.FK_Origin">
|
||||
<End Role="Origin" EntitySet="Origins" />
|
||||
<End Role="Origin_Exam" EntitySet="Origin_Exam" />
|
||||
</AssociationSet>
|
||||
|
@ -186,6 +192,7 @@
|
|||
<PropertyRef Name="DoctorId" />
|
||||
</Key>
|
||||
<Property Name="DoctorId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="DoctorUid" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
|
||||
<Property Name="FirstName" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
|
||||
<Property Name="LastName" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
|
||||
<Property Name="DoctorOrigin" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
|
||||
|
@ -197,30 +204,44 @@
|
|||
<PropertyRef Name="ExamId" />
|
||||
</Key>
|
||||
<Property Name="ExamId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="ExamUid" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
|
||||
<Property Name="DoctorId" Type="Int32" Nullable="false" />
|
||||
<Property Name="PatientId" Type="Int32" Nullable="false" />
|
||||
<Property Name="ResultId" Type="Int32" Nullable="false" />
|
||||
<NavigationProperty Name="Doctor" Relationship="EHEC_DBModel.FK_DoctorExam" FromRole="Exam" ToRole="Doctor" />
|
||||
<NavigationProperty Name="Origin_Exam" Relationship="EHEC_DBModel.FK_Exam" FromRole="Exam" ToRole="Origin_Exam" />
|
||||
<NavigationProperty Name="Patient" Relationship="EHEC_DBModel.FK_PatientExam" FromRole="Exam" ToRole="Patient" />
|
||||
<NavigationProperty Name="Result" Relationship="EHEC_DBModel.FK_ResultExam" FromRole="Exam" ToRole="Result" />
|
||||
<NavigationProperty Name="Origin_Exam" Relationship="EHEC_DBModel.FK_Exam1" FromRole="Exam" ToRole="Origin_Exam" />
|
||||
</EntityType>
|
||||
<EntityType Name="Origin">
|
||||
<Key>
|
||||
<PropertyRef Name="OriginId" />
|
||||
</Key>
|
||||
<Property Name="OriginId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="OriginUid" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
|
||||
<Property Name="Name" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
|
||||
<Property Name="Food" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
|
||||
<Property Name="Street" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
|
||||
<Property Name="City" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
|
||||
<NavigationProperty Name="Origin_Exam" Relationship="EHEC_DBModel.FK_Origin1" FromRole="Origin" ToRole="Origin_Exam" />
|
||||
<NavigationProperty Name="Origin_Exam" Relationship="EHEC_DBModel.FK_Origin" FromRole="Origin" ToRole="Origin_Exam" />
|
||||
</EntityType>
|
||||
<EntityType Name="Origin_Exam">
|
||||
<Key>
|
||||
<PropertyRef Name="Origin_ExamId" />
|
||||
</Key>
|
||||
<Property Name="Origin_ExamId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="Origin_ExamUid" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
|
||||
<Property Name="OriginId" Type="Int32" Nullable="false" />
|
||||
<Property Name="ExamId" Type="Int32" Nullable="false" />
|
||||
<NavigationProperty Name="Exam" Relationship="EHEC_DBModel.FK_Exam" FromRole="Origin_Exam" ToRole="Exam" />
|
||||
<NavigationProperty Name="Origin" Relationship="EHEC_DBModel.FK_Origin" FromRole="Origin_Exam" ToRole="Origin" />
|
||||
</EntityType>
|
||||
<EntityType Name="Patient">
|
||||
<Key>
|
||||
<PropertyRef Name="PatientId" />
|
||||
</Key>
|
||||
<Property Name="PatientId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="PatientUid" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
|
||||
<Property Name="FirstName" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
|
||||
<Property Name="LastName" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
|
||||
<Property Name="BirthDate" Type="DateTime" Nullable="false" Precision="3" />
|
||||
|
@ -234,6 +255,7 @@
|
|||
<PropertyRef Name="ResultId" />
|
||||
</Key>
|
||||
<Property Name="ResultId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="ResultUid" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
|
||||
<Property Name="Name" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
|
||||
<NavigationProperty Name="Exams" Relationship="EHEC_DBModel.FK_ResultExam" FromRole="Result" ToRole="Exam" />
|
||||
</EntityType>
|
||||
|
@ -249,6 +271,18 @@
|
|||
</Dependent>
|
||||
</ReferentialConstraint>
|
||||
</Association>
|
||||
<Association Name="FK_Exam">
|
||||
<End Type="EHEC_DBModel.Exam" Role="Exam" Multiplicity="1" />
|
||||
<End Type="EHEC_DBModel.Origin_Exam" Role="Origin_Exam" Multiplicity="*" />
|
||||
<ReferentialConstraint>
|
||||
<Principal Role="Exam">
|
||||
<PropertyRef Name="ExamId" />
|
||||
</Principal>
|
||||
<Dependent Role="Origin_Exam">
|
||||
<PropertyRef Name="ExamId" />
|
||||
</Dependent>
|
||||
</ReferentialConstraint>
|
||||
</Association>
|
||||
<Association Name="FK_PatientExam">
|
||||
<End Type="EHEC_DBModel.Patient" Role="Patient" Multiplicity="1" />
|
||||
<End Type="EHEC_DBModel.Exam" Role="Exam" Multiplicity="*" />
|
||||
|
@ -273,29 +307,7 @@
|
|||
</Dependent>
|
||||
</ReferentialConstraint>
|
||||
</Association>
|
||||
<EntityType Name="Origin_Exam">
|
||||
<Key>
|
||||
<PropertyRef Name="Origin_ExamId" />
|
||||
</Key>
|
||||
<Property Name="Origin_ExamId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="OriginId" Type="Int32" Nullable="false" />
|
||||
<Property Name="ExamId" Type="Int32" Nullable="false" />
|
||||
<NavigationProperty Name="Exam" Relationship="EHEC_DBModel.FK_Exam1" FromRole="Origin_Exam" ToRole="Exam" />
|
||||
<NavigationProperty Name="Origin" Relationship="EHEC_DBModel.FK_Origin1" FromRole="Origin_Exam" ToRole="Origin" />
|
||||
</EntityType>
|
||||
<Association Name="FK_Exam1">
|
||||
<End Type="EHEC_DBModel.Exam" Role="Exam" Multiplicity="1" />
|
||||
<End Type="EHEC_DBModel.Origin_Exam" Role="Origin_Exam" Multiplicity="*" />
|
||||
<ReferentialConstraint>
|
||||
<Principal Role="Exam">
|
||||
<PropertyRef Name="ExamId" />
|
||||
</Principal>
|
||||
<Dependent Role="Origin_Exam">
|
||||
<PropertyRef Name="ExamId" />
|
||||
</Dependent>
|
||||
</ReferentialConstraint>
|
||||
</Association>
|
||||
<Association Name="FK_Origin1">
|
||||
<Association Name="FK_Origin">
|
||||
<End Type="EHEC_DBModel.Origin" Role="Origin" Multiplicity="1" />
|
||||
<End Type="EHEC_DBModel.Origin_Exam" Role="Origin_Exam" Multiplicity="*" />
|
||||
<ReferentialConstraint>
|
||||
|
@ -320,6 +332,7 @@
|
|||
<ScalarProperty Name="DoctorOrigin" ColumnName="DoctorOrigin" />
|
||||
<ScalarProperty Name="LastName" ColumnName="LastName" />
|
||||
<ScalarProperty Name="FirstName" ColumnName="FirstName" />
|
||||
<ScalarProperty Name="DoctorUid" ColumnName="DoctorUid" />
|
||||
<ScalarProperty Name="DoctorId" ColumnName="DoctorId" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
|
@ -330,6 +343,7 @@
|
|||
<ScalarProperty Name="ResultId" ColumnName="ResultId" />
|
||||
<ScalarProperty Name="PatientId" ColumnName="PatientId" />
|
||||
<ScalarProperty Name="DoctorId" ColumnName="DoctorId" />
|
||||
<ScalarProperty Name="ExamUid" ColumnName="ExamUid" />
|
||||
<ScalarProperty Name="ExamId" ColumnName="ExamId" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
|
@ -341,10 +355,21 @@
|
|||
<ScalarProperty Name="Street" ColumnName="Street" />
|
||||
<ScalarProperty Name="Food" ColumnName="Food" />
|
||||
<ScalarProperty Name="Name" ColumnName="Name" />
|
||||
<ScalarProperty Name="OriginUid" ColumnName="OriginUid" />
|
||||
<ScalarProperty Name="OriginId" ColumnName="OriginId" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
<EntitySetMapping Name="Origin_Exam">
|
||||
<EntityTypeMapping TypeName="EHEC_DBModel.Origin_Exam">
|
||||
<MappingFragment StoreEntitySet="Origin_Exam">
|
||||
<ScalarProperty Name="ExamId" ColumnName="ExamId" />
|
||||
<ScalarProperty Name="OriginId" ColumnName="OriginId" />
|
||||
<ScalarProperty Name="Origin_ExamUid" ColumnName="Origin_ExamUid" />
|
||||
<ScalarProperty Name="Origin_ExamId" ColumnName="Origin_ExamId" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
<EntitySetMapping Name="Patients">
|
||||
<EntityTypeMapping TypeName="EHEC_DBModel.Patient">
|
||||
<MappingFragment StoreEntitySet="Patient">
|
||||
|
@ -354,6 +379,7 @@
|
|||
<ScalarProperty Name="BirthDate" ColumnName="BirthDate" />
|
||||
<ScalarProperty Name="LastName" ColumnName="LastName" />
|
||||
<ScalarProperty Name="FirstName" ColumnName="FirstName" />
|
||||
<ScalarProperty Name="PatientUid" ColumnName="PatientUid" />
|
||||
<ScalarProperty Name="PatientId" ColumnName="PatientId" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
|
@ -362,19 +388,11 @@
|
|||
<EntityTypeMapping TypeName="EHEC_DBModel.Result">
|
||||
<MappingFragment StoreEntitySet="Result">
|
||||
<ScalarProperty Name="Name" ColumnName="Name" />
|
||||
<ScalarProperty Name="ResultUid" ColumnName="ResultUid" />
|
||||
<ScalarProperty Name="ResultId" ColumnName="ResultId" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
<EntitySetMapping Name="Origin_Exam">
|
||||
<EntityTypeMapping TypeName="EHEC_DBModel.Origin_Exam">
|
||||
<MappingFragment StoreEntitySet="Origin_Exam">
|
||||
<ScalarProperty Name="ExamId" ColumnName="ExamId" />
|
||||
<ScalarProperty Name="OriginId" ColumnName="OriginId" />
|
||||
<ScalarProperty Name="Origin_ExamId" ColumnName="Origin_ExamId" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
</EntityContainerMapping>
|
||||
</Mapping>
|
||||
</edmx:Mappings>
|
||||
|
|
|
@ -7,15 +7,15 @@
|
|||
<Diagram DiagramId="09c9d242de5f41b186b4e8e8af51e2a7" Name="Diagram1">
|
||||
<EntityTypeShape EntityType="EHEC_DBModel.Doctor" Width="1.5" PointX="0.5" PointY="0.5" />
|
||||
<EntityTypeShape EntityType="EHEC_DBModel.Exam" Width="1.5" PointX="2.5" PointY="0.5" />
|
||||
<EntityTypeShape EntityType="EHEC_DBModel.Origin" Width="1.5" PointX="4.5" PointY="3" />
|
||||
<EntityTypeShape EntityType="EHEC_DBModel.Patient" Width="1.5" PointX="0.5" PointY="2.75" />
|
||||
<EntityTypeShape EntityType="EHEC_DBModel.Result" Width="1.5" PointX="2.5" PointY="3.5" />
|
||||
<EntityTypeShape EntityType="EHEC_DBModel.Origin" Width="1.5" PointX="4.625" PointY="3.125" />
|
||||
<EntityTypeShape EntityType="EHEC_DBModel.Origin_Exam" Width="1.5" PointX="4.625" PointY="0.5" />
|
||||
<EntityTypeShape EntityType="EHEC_DBModel.Patient" Width="1.5" PointX="0.5" PointY="3" />
|
||||
<EntityTypeShape EntityType="EHEC_DBModel.Result" Width="1.5" PointX="2.5" PointY="3.875" />
|
||||
<AssociationConnector Association="EHEC_DBModel.FK_DoctorExam" />
|
||||
<AssociationConnector Association="EHEC_DBModel.FK_Exam" />
|
||||
<AssociationConnector Association="EHEC_DBModel.FK_PatientExam" />
|
||||
<AssociationConnector Association="EHEC_DBModel.FK_ResultExam" />
|
||||
<EntityTypeShape EntityType="EHEC_DBModel.Origin_Exam" Width="1.5" PointX="4.5" PointY="0.5" />
|
||||
<AssociationConnector Association="EHEC_DBModel.FK_Exam1" />
|
||||
<AssociationConnector Association="EHEC_DBModel.FK_Origin1" />
|
||||
<AssociationConnector Association="EHEC_DBModel.FK_Origin" />
|
||||
</Diagram>
|
||||
</edmx:Diagrams>
|
||||
</edmx:Designer>
|
||||
|
|
|
@ -29,6 +29,8 @@ public partial class Origin
|
|||
|
||||
public int OriginId { get; set; }
|
||||
|
||||
public string OriginUid { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Food { get; set; }
|
||||
|
|
|
@ -20,6 +20,8 @@ public partial class Origin_Exam
|
|||
|
||||
public int Origin_ExamId { get; set; }
|
||||
|
||||
public string Origin_ExamUid { get; set; }
|
||||
|
||||
public int OriginId { get; set; }
|
||||
|
||||
public int ExamId { get; set; }
|
||||
|
|
|
@ -29,6 +29,8 @@ public partial class Patient
|
|||
|
||||
public int PatientId { get; set; }
|
||||
|
||||
public string PatientUid { get; set; }
|
||||
|
||||
public string FirstName { get; set; }
|
||||
|
||||
public string LastName { get; set; }
|
||||
|
|
|
@ -29,6 +29,8 @@ public partial class Result
|
|||
|
||||
public int ResultId { get; set; }
|
||||
|
||||
public string ResultUid { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
|
||||
|
|
|
@ -7,16 +7,18 @@
|
|||
<title>CS-EHEC-II</title>
|
||||
<%--<script src="https://d3js.org/d3.v4.min.js"></script>--%>
|
||||
<%--<script src="http://cdn.graphalchemist.com/alchemy.min.js"></script>--%>
|
||||
<link rel="stylesheet" type="text/css" href="cluster_dependencies/alchemy/alchemy.css" />
|
||||
<%--<link rel="stylesheet" type="text/css" href="cluster_dependencies/alchemy/alchemy.css" />--%>
|
||||
<link rel="stylesheet" type="text/css" href="cluster_dependencies/alchemy/alchemy.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="cluster_dependencies/alchemy/styles/vendor.css" />
|
||||
<link rel="stylesheet" type="text/css" href="cluster_dependencies/bootstrap/css/bootstrap.css" />
|
||||
<script type="text/javascript" src="cluster_dependencies/jquery/jquery-3.3.1.min.js"></script>
|
||||
<script type="text/javascript" src="cluster_dependencies/lodash/lodash.js"></script>
|
||||
<script type="text/javascript" src="cluster_dependencies/bootstrap/js/bootstrap.bundle.js"></script>
|
||||
<%--<script type="text/javascript" src="cluster_dependencies/d3/d3.min.js"></script>--%>
|
||||
<script type="text/javascript" src="cluster_dependencies/d3/d3.js"></script>
|
||||
<script type="text/javascript" src="cluster_dependencies/alchemy/alchemy.js"></script>
|
||||
<%--<script type="text/javascript" src="cluster_dependencies/alchemy/alchemy.min.js"></script>--%>
|
||||
<%--<script type="text/javascript" src="cluster_dependencies/bootstrap/js/bootstrap.bundle.js"></script>--%>
|
||||
<script type="text/javascript" src="cluster_dependencies/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
<script type="text/javascript" src="cluster_dependencies/d3/d3.min.js"></script>
|
||||
<%--<script type="text/javascript" src="cluster_dependencies/d3/d3.js"></script>--%>
|
||||
<%--<script type="text/javascript" src="cluster_dependencies/alchemy/alchemy.js"></script>--%>
|
||||
<script type="text/javascript" src="cluster_dependencies/alchemy/alchemy.min.js"></script>
|
||||
<script type="text/javascript" src="cluster_dependencies/alchemy/scripts/vendor.js"></script>
|
||||
|
||||
</head>
|
||||
|
@ -40,13 +42,12 @@
|
|||
<div class="alchemy" id="alchemy"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var htmlClusterData = <%=Clusterdata%>;
|
||||
var config = {
|
||||
dataSource: htmlClusterData, <%-- /cluster_dependencies/alchemy/testdata/cluster.json --%> <%-- <%=Clusterdata%> --%>
|
||||
forceLocked: true,
|
||||
graphHeight: function(){ return 800; },
|
||||
graphWidth: function(){ return 800; },
|
||||
linkDistance: function(){ return 50; },
|
||||
dataSource: <%=Clusterdata%>, <%-- /cluster_dependencies/alchemy/testdata/cluster.json --%> <%-- <%=Clusterdata%> --%>
|
||||
cluster: true,
|
||||
graphHeight: function(){ return 900; },
|
||||
graphWidth: function(){ return 900; },
|
||||
|
||||
nodeTypes: {
|
||||
"Nodetype": [
|
||||
"Patient",
|
||||
|
@ -54,8 +55,24 @@
|
|||
"Origin"
|
||||
]
|
||||
},
|
||||
nodeMouseOver: 'fun_fact',
|
||||
nodeMouseOver: 'edgetype',
|
||||
nodeCaption: "name",
|
||||
rootNodeRadius: 30,
|
||||
|
||||
showControlDash: true,
|
||||
|
||||
showStats: true,
|
||||
nodeStats: true,
|
||||
|
||||
showFilters: true,
|
||||
nodeFilters: true,
|
||||
|
||||
captionToggle: true,
|
||||
edgesToggle: true,
|
||||
nodesToggle: true,
|
||||
toggleRootNotes: false,
|
||||
|
||||
zoomControls: true
|
||||
};
|
||||
|
||||
alchemy = new Alchemy(config)
|
||||
|
|
|
@ -7,8 +7,8 @@ namespace EHEC_Server
|
|||
{
|
||||
public class Edge
|
||||
{
|
||||
public int Source { get; set; }
|
||||
public int Target { get; set; }
|
||||
public string Source { get; set; }
|
||||
public string Target { get; set; }
|
||||
public string Edgetype { get; set; }
|
||||
public Edge() { }
|
||||
public List<Edge> GetEdges()
|
||||
|
@ -23,32 +23,47 @@ namespace EHEC_Server
|
|||
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 element in exams)
|
||||
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 = element.PatientId,
|
||||
Target = element.DoctorId ///for tests !!!!!!!!!!!!!!!! correct it to Origin id somehow!!!!!!!!
|
||||
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 element in exams)
|
||||
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 = element.PatientId,
|
||||
Target = element.ResultId
|
||||
Source = patient.PatientUid,
|
||||
Target = result.ResultUid
|
||||
};
|
||||
clusterEdges.Add(clusterEdge);
|
||||
};
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace EHEC_Server
|
|||
{
|
||||
public class Node
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Nodetype { get; set; }
|
||||
public Node() { }
|
||||
|
@ -29,7 +29,7 @@ namespace EHEC_Server
|
|||
{
|
||||
Node clusterOrigin = new Node
|
||||
{
|
||||
Id = element.OriginId,
|
||||
Id = element.OriginUid,
|
||||
Nodetype = "origin",
|
||||
Name = element.City
|
||||
};
|
||||
|
@ -47,7 +47,7 @@ namespace EHEC_Server
|
|||
{
|
||||
Node clusterPatient = new Node
|
||||
{
|
||||
Id = element.PatientId,
|
||||
Id = element.PatientUid,
|
||||
Nodetype = "patient",
|
||||
Name = element.FirstName + " " + element.LastName
|
||||
};
|
||||
|
@ -65,7 +65,7 @@ namespace EHEC_Server
|
|||
{
|
||||
Node clusterResult = new Node
|
||||
{
|
||||
Id = element.ResultId,
|
||||
Id = element.ResultUid,
|
||||
Nodetype = "result",
|
||||
Name = element.Name
|
||||
};
|
||||
|
|
|
@ -101,6 +101,7 @@ PRINT 'Creating all TABLES';
|
|||
-- Creating table 'Patient'
|
||||
CREATE TABLE [dbo].[Patient] (
|
||||
[PatientId] int IDENTITY(1,1) NOT NULL,
|
||||
[PatientUid] nvarchar(max) NOT NULL,
|
||||
[FirstName] nvarchar(max) NOT NULL,
|
||||
[LastName] nvarchar(max) NOT NULL,
|
||||
[BirthDate] datetime NOT NULL,
|
||||
|
@ -113,6 +114,7 @@ GO
|
|||
-- Creating table 'Doctor'
|
||||
CREATE TABLE [dbo].[Doctor] (
|
||||
[DoctorId] int IDENTITY(1,1) NOT NULL,
|
||||
[DoctorUid] nvarchar(max) NOT NULL,
|
||||
[FirstName] nvarchar(max) NOT NULL,
|
||||
[LastName] nvarchar(max) NOT NULL,
|
||||
[DoctorOrigin] nvarchar(max) NOT NULL,
|
||||
|
@ -123,6 +125,7 @@ GO
|
|||
-- Creating table 'Origin'
|
||||
CREATE TABLE [dbo].[Origin] (
|
||||
[OriginId] int IDENTITY(1,1) NOT NULL,
|
||||
[OriginUid] nvarchar(max) NOT NULL,
|
||||
[Name] nvarchar(max) NOT NULL,
|
||||
[Food] nvarchar(max) NOT NULL,
|
||||
[Street] nvarchar(max) NOT NULL,
|
||||
|
@ -133,6 +136,7 @@ GO
|
|||
-- Creating table 'Exam'
|
||||
CREATE TABLE [dbo].[Exam] (
|
||||
[ExamId] int IDENTITY(1,1) NOT NULL,
|
||||
[ExamUid] nvarchar(max) NOT NULL,
|
||||
[DoctorId] int NOT NULL,
|
||||
[PatientId] int NOT NULL,
|
||||
[ResultId] int NOT NULL
|
||||
|
@ -142,6 +146,7 @@ GO
|
|||
-- Creating table 'Result'
|
||||
CREATE TABLE [dbo].[Result] (
|
||||
[ResultId] int IDENTITY(1,1) NOT NULL,
|
||||
[ResultUid] nvarchar(max) NOT NULL,
|
||||
[Name] nvarchar(max) NOT NULL,
|
||||
);
|
||||
GO
|
||||
|
@ -149,6 +154,7 @@ GO
|
|||
-- Creating table 'Origin_Exam'
|
||||
CREATE TABLE [dbo].[Origin_Exam] (
|
||||
[Origin_ExamId] int IDENTITY(1,1) NOT NULL,
|
||||
[Origin_ExamUid] nvarchar(max) NOT NULL,
|
||||
[OriginId] int NOT NULL,
|
||||
[ExamId] int NOT NULL
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue