<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="RDS" 
Name="DIVISION_LINK_STRUCTURE_BED" 
Description="Связь отделений и профилей коек" 
PrimaryKey="DivisionLinkStructureBedID" 
DNAttributes="{Division/Name};{StructureBed/Name}" 
DisplayName="{0}-{1}">
  <Fields>
    <Attribute Name="DivisionLinkStructureBedID" Index="30040001" Type="guid" Description="Идентификатор" />
    <Attribute Name="Info" Index="30040006" Type="string" Description="Общая информация" />
    <Attribute Name="ID" Index="30040007" Type="guid" Description="ID" />
    <Parent Name="StructureBed" Index="30040002" Type="RDS.STRUCTURE_BED" Description="Профиль коек(V002)" Required="1" />
    <Parent Name="Division" Index="30040003" Type="RDS.DIVISION" Description="Отделение" Required="1" />
    <Child Name="AmountBeds" Index="30040004" Type="RDS.AMOUNT_BED" Description="Количество коек в профиле" ChildAttribute="DivisionLinkStructureBed" />
    <Child Name="VisitsPlans" Index="30040005" Type="RDS.DIVISION_VISITS_PLAN" Description="План посещений" ChildAttribute="DivisionLinkStructureBed" />
    <Child Name="FreeBedsInformations" Index="30040008" Type="RDS.FREE_BEDS_INFORMATION" Description="Информация о свободных койках" ChildAttribute="DivisionLinkStructureBed" />
    <Parent Name="V020StructureBed" Type="RDS.V020_STRUCTURE_BED" Description="Классификатор профиля койки(V020)" />
  </Fields>
  <DbMapping>
    <Table name="T_DIVISION_LINK_STRUCTURE_BED">
      <Map Name="DivisionLinkStructureBedID" Column="DivisionLinkStructureBedID" />
      <Map Name="Info" Column="Info" />
      <Map Name="ID" Column="ID" />
      <Map Name="StructureBed" Column="StructureBed" />
      <Map Name="Division" Column="Division" />
      <Map Name="V020StructureBed" Column="V020StructureBed" />
    </Table>
  </DbMapping>
  <CalculatingAttributes>
    <Parent Name="BedsInprofile" Index="10210006" Type="RDS.AMOUNT_BED" Description="Количество коек в прифиле" RequiredAttributes="{AmountBeds / DateEnd};{AmountBeds / DateBegin};{AmountBeds / BedsCount}" PathAttributes="{AmountBeds}">
      <Parameter Name="OnDate" Description="Дата актуальности" Type="date" />
    </Parent>
    <Parent Name="VisitPlan" Index="10210007" Type="RDS.VISITS_PLAN" Description="План посещений по отделению" RequiredAttributes="{VisitsPlans / Years}" PathAttributes="{VisitsPlans}">
      <Parameter Name="Year" Description="Год" Type="int" />
    </Parent>
  </CalculatingAttributes>
</Entity>