<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="AKUZ" 
Name="STATE" 
Description="Участок" 
PrimaryKey="StateID" 
DNAttributes="{StateNumber}" 
DisplayName="Участок №{0}">
  <Customs>
    <Custom Name="FilterUICondition"><![CDATA[<lx:Criterion type="=" xmlns:lx="lexem">
    <lx:Path OwnerQueryLevel="0">
        <lx:StepString name="LpuMain" />
    </lx:Path>
    <lx:ParamHolder>
        <lx:StepString name="CURRENT_LPU_MAIN" />
    </lx:ParamHolder>
</lx:Criterion>]]></Custom>
  </Customs>
  <Fields>
    <Attribute Name="StateID" Index="6260001" Type="guid" Description="Идентификатор" />
    <Attribute Name="StateNumber" Index="6260002" Type="int" Description="Номер участка" Required="1" />
    <Attribute Name="Criteria" Index="6260003" Type="text" Description="Критерий" />
    <Attribute Name="OldCriteria" Index="6260009" Type="text" Description="Ранее используемый критерий" />
    <Attribute Name="TFOMSCode" Index="6260015" Type="string" Description="Код участка в ТФОМС" />
    <Attribute Name="ActualDate" Index="6260016" Type="date" Description="Дата актуальности" />
    <Parent Name="LpuMain" Index="6260005" Type="AKUZ.LPU_MAIN" Description="МО" Required="1" />
    <Parent Name="Division" Index="6260006" Type="AKUZ.DIVISION" Description="Отделение" />
    <Parent Name="ResponsiblePost" Index="6260017" Type="AKUZ.POST" Description="Ответственный врач" />
    <Child Name="StatePosts" Index="6260004" Type="AKUZ.STATE_POST" Description="Участковые" ChildAttribute="State" SortingAttr="DateBegin" />
    <Child Name="StatePharmacys" Index="6260007" Type="AKUZ.STATE_PHARMACY" Description="Связка аптека-участок" ChildAttribute="State" />
    <Child Name="StateDairyCenters" Index="6260008" Type="AKUZ.STATE_DAIRY_CENTER" Description="Участок МРП" ChildAttribute="State" />
    <Child Name="StateAddresss" Index="6260010" Type="AKUZ.STATE_ADDRESS" Description="Связка участка с адресом" ChildAttribute="State" />
    <Choice Name="StateProfile" Index="6260012" Description="Профиль" Required="1">
      <Item Name="Терапевтический" Index="1" />
      <Item Name="Педиатрический" Index="2" />
      <Item Name="Стоматологический" Index="6" />
      <Item Name="Кардиологический" Index="12" />
      <Item Name="Неврологический" Index="15" />
      <Item Name="Отоларингологический" Index="18" />
      <Item Name="Психиатрический" Index="19" />
      <Item Name="Эндокринологический" Index="24" />
      <Item Name="Ревматологический" Index="26" />
      <Item Name="Акушерский и гинекологический" Index="32" />
      <Item Name="Дерматовенерология" Index="33" />
      <Item Name="Онкологический" Index="36" />
      <Item Name="Фтизиатрический" Index="39" />
      <Item Name="Наркология" Index="51" />
      <Item Name="Ученический" Index="79" />
      <Item Name="Паллиативная помощь" Index="89" />
      <Item Name="Специализированный" Index="95" />
      <Item Name="Экстренная помощь" Index="99" />
    </Choice>
    <Parent Name="EhrRusFl82iuutib" Type="EHR.EHR_RUS_FL82IUUTIB" Description="ФРМО. Типы врачебных участков" />
    <Attribute Name="RoomNumber" Type="string" Description="Номер кабинета" CharacterMaximumLength="16" />
    <Attribute Name="BeginDate" Type="date" Description="Дата начала" Required="1" />
  </Fields>
  <DbMapping>
    <Table name="T_STATE">
      <Map Name="StateID" Column="StateID" />
      <Map Name="StateNumber" Column="StateNumber" />
      <Map Name="Criteria" Column="Criteria" />
      <Map Name="OldCriteria" Column="OldCriteria" />
      <Map Name="TFOMSCode" Column="TFOMSCode" />
      <Map Name="ActualDate" Column="ActualDate" />
      <Map Name="LpuMain" Column="LpuMain" />
      <Map Name="Division" Column="Division" />
      <Map Name="ResponsiblePost" Column="ResponsiblePost" />
      <Map Name="StateProfile" Column="StateProfile" />
      <Map Name="EhrRusFl82iuutib" Column="EhrRusFl82iuutib" />
      <Map Name="RoomNumber" Column="RoomNumber" />
      <Map Name="BeginDate" Column="BeginDate" />
    </Table>
  </DbMapping>
  <CalculatingAttributes>
    <Attribute Name="AddressCriteria" Index="6260011" Type="string" Description="Критерий адреса" RequiredAttributes="{StateAddresss/City};{StateAddresss/Street};{StateAddresss/StateAddressHouses/House};{StateAddresss/StateAddressHouses/Flat};{StateAddresss/StateAddressHouses/Block};{StateAddresss/District}" />
  </CalculatingAttributes>
</Entity>