<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="AKUZ" 
Name="PATIENT_PARENTS" 
Description="Родители пациента" 
PrimaryKey="PatientParentsID" 
DNAttributes="{LastName};{FirstName};{FatherName};{Filiation/Name};{DocType/Name};{DocSeries};{DocNumber}" 
DisplayName="{0}, {1}: {2} {3}">
  <Fields>
    <Attribute Name="PatientParentsID" Index="5750001" Type="guid" Description="Идентификатор" />
    <Attribute Name="FirstName" Index="5750002" Type="string" Description="Имя" CharacterMaximumLength="40" Required="1" />
    <Attribute Name="LastName" Index="5750003" Type="string" Description="Фамилия" CharacterMaximumLength="40" Required="1" />
    <Attribute Name="FatherName" Index="5750004" Type="string" Description="Отчество" CharacterMaximumLength="40" />
    <Attribute Name="Birthday" Index="5750005" Type="datetime" DefaultFormat="{0:dd.MM.yyyy}" Description="Дата рождения" />
    <Attribute Name="DocSeries" Index="5750006" Type="string" Description="Серия документа" CharacterMaximumLength="16" />
    <Attribute Name="DocNumber" Index="5750007" Type="string" Description="Номер документа" CharacterMaximumLength="16" />
    <Attribute Name="DocIssueDate" Index="5750008" Type="date" Description="Дата выдачи документа" />
    <Attribute Name="DocIssueOrg" Index="5750009" Type="string" Description="Организация выдавшая документ" CharacterMaximumLength="256" />
    <Attribute Name="MobilePhone" Index="5750013" Type="string" Description="Мобильный телефон" CharacterMaximumLength="128" />
    <Attribute Name="Email" Index="5750014" Type="string" Description="E-mail" CharacterMaximumLength="64" />
    <Attribute Name="CurrentRepresentative" Index="5750016" Type="bool" Description="Текущий представитель" Required="1" />
    <Parent Name="DocType" Index="5750010" Type="VCLib.ENUMS" Description="Тип документа" EnumType="DocType" Required="1" />
    <Parent Name="Filiation" Index="5750011" Type="VCLib.ENUMS" Description="Вид родства" EnumType="Filiation" Required="1" />
    <Parent Name="Patient" Index="5750012" Type="AKUZ.PATIENT" Description="Пациент" Required="1" />
    <Child Name="Jobs" Type="AKUZ.PATIENT_JOB" Description="Место работы/учебы" ChildAttribute="PatientParents" />
    <Attribute Name="Snils" Type="string" Description="СНИЛС" CharacterMaximumLength="14" />
    <Attribute Name="FIO" Type="string" Description="ФИО" />
    <Child Name="PatientIdentityRequests" Type="AKUZ.PATIENT_IDENTITY_REQUEST" Description="Запрос идентификации гражданина (ИП ООГУЗ)" ChildAttribute="PatientParents" />
    <Attribute Name="IsGuardian" Type="bool" Description="Опекун" Required="1" />
    <Attribute Name="GuardianDate" Type="date" Description="Дата установления опекунства" />
    <Attribute Name="IsTrustee" Type="bool" Description="Попечитель" Required="1" />
    <Attribute Name="AddressReal" Type="string" Description="Адрес проживания" CharacterMaximumLength="256" />
    <Attribute Name="AddressLegal" Type="string" Description="Адрес регистрации" CharacterMaximumLength="256" />
    <Attribute Name="CanTransmitHealthStatus" Type="bool" Description="Может быть передана информация о состоянии здоровья" Required="1" />
  </Fields>
  <DbMapping>
    <Table name="T_PATIENT_PARENTS">
      <Map Name="PatientParentsID" Column="PatientParentsID" />
      <Map Name="FirstName" Column="FirstName" />
      <Map Name="LastName" Column="LastName" />
      <Map Name="FatherName" Column="FatherName" />
      <Map Name="Birthday" Column="Birthday" />
      <Map Name="DocSeries" Column="DocSeries" />
      <Map Name="DocNumber" Column="DocNumber" />
      <Map Name="DocIssueDate" Column="DocIssueDate" />
      <Map Name="DocIssueOrg" Column="DocIssueOrg" />
      <Map Name="MobilePhone" Column="MobilePhone" />
      <Map Name="Email" Column="Email" />
      <Map Name="CurrentRepresentative" Column="CurrentRepresentative" />
      <Map Name="DocType" Column="DocType" />
      <Map Name="Filiation" Column="Filiation" />
      <Map Name="Patient" Column="Patient" />
      <Map Name="Snils" Column="Snils" />
      <Map Name="IsGuardian" Column="IsGuardian" />
      <Map Name="GuardianDate" Column="GuardianDate" />
      <Map Name="IsTrustee" Column="IsTrustee" />
      <Map Name="AddressReal" Column="AddressReal" />
      <Map Name="AddressLegal" Column="AddressLegal" />
      <Map Name="CanTransmitHealthStatus" Column="CanTransmitHealthStatus" />
    </Table>
    <Lexem>
      <Map Name="FIO">
        <lx:MathOperator sign="+" xmlns:lx="lexem">
          <lx:MathOperator sign="+">
            <lx:MathOperator sign="+">
              <lx:MathOperator sign="+">
                <lx:Path OwnerQueryLevel="0">
                  <lx:StepString name="LastName" />
                </lx:Path>
                <lx:ConstOperand type="String"><![CDATA[ ]]></lx:ConstOperand>
              </lx:MathOperator>
              <lx:Path OwnerQueryLevel="0">
                <lx:StepString name="FirstName" />
              </lx:Path>
            </lx:MathOperator>
            <lx:ConstOperand type="String"><![CDATA[ ]]></lx:ConstOperand>
          </lx:MathOperator>
          <lx:Path OwnerQueryLevel="0">
            <lx:StepString name="FatherName" />
          </lx:Path>
        </lx:MathOperator>
      </Map>
    </Lexem>
  </DbMapping>
  <CalculatingAttributes>
    <Attribute Name="Document" Type="string" Description="Документ" RequiredAttributes="{DocType/Name};{DocSeries};{DocNumber};{DocIssueDate};{DocIssueOrg}" />
  </CalculatingAttributes>
</Entity>