<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="AKUZ" 
Name="PHONE_NUMBER" 
Description="Контакт пациента" 
PrimaryKey="PhoneNumberID" 
DNAttributes="{Number}" 
DisplayName="{0}">
  <Customs>
    <Custom Name="UniteObjectsKey" Value="format(&quot;{0}|{1}&quot;, {Number}, {PhoneType})" />
    <Custom Name="UniteObjectsKeyHumanView" Value="format(&quot;{0}: {1}&quot;, Str({PhoneType}), {Number})" />
    <Custom Name="HistoryEntity" Value="AKUZ.PHONE_NUMBER_HISTORY" />
    <Custom Name="NotTrackedAttributes" Value="Patient" />
  </Customs>
  <Fields>
    <Attribute Name="PhoneNumberID" Index="5380001" Type="guid" Description="Идентификатор" />
    <Attribute Name="Number" Index="5380003" Type="string" Description="Контакт" CharacterMaximumLength="32" Required="1" />
    <Attribute Name="AddedDate" Index="5380005" Type="datetime" DefaultFormat="{0:dd.MM.yyyy HH:mm}" Description="Дата и время добавления" />
    <Parent Name="Patient" Index="5380002" Type="AKUZ.PATIENT" Description="Пациент" Required="1" />
    <Choice Name="PhoneType" Index="5380004" Description="Тип контакта" Required="1">
      <Item Name="дом." Index="1" />
      <Item Name="раб." Index="2" />
      <Item Name="моб." Index="3" />
      <Item Name="email" Index="4" />
      <Item Name="прочее" Index="5" />
    </Choice>
    <Choice Name="AddedBy" Index="5380006" Description="Кем добавлен" Required="1">
      <Item Name="МО" Index="0" />
      <Item Name="Оператор" Index="1" />
      <Item Name="Пациент" Index="2" />
      <Item Name="Чат-бот MAX" Index="3" />
    </Choice>
    <Attribute Name="Comment" Type="string" Description="Комментарий" CharacterMaximumLength="255" />
    <Attribute Name="TiedToMAX" Type="bool" Description="Привязан к MAX" Required="1" />
  </Fields>
  <DbMapping>
    <Table name="T_PHONE_NUMBER">
      <Map Name="PhoneNumberID" Column="PhoneNumberID" />
      <Map Name="Number" Column="Number" />
      <Map Name="AddedDate" Column="AddedDate" />
      <Map Name="Patient" Column="Patient" />
      <Map Name="PhoneType" Column="PhoneType" />
      <Map Name="AddedBy" Column="AddedBy" />
      <Map Name="Comment" Column="Comment" />
      <Map Name="TiedToMAX" Column="TiedToMAX" />
    </Table>
  </DbMapping>
</Entity>