<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="AKUZ" 
Name="FRVICH_PATIENT" 
Description="Пациент РВИЧ" 
PrimaryKey="FrvichPatientID">
  <Fields>
    <Attribute Name="FrvichPatientID" Type="guid" Description="Идентификатор" />
    <Attribute Name="Snils" Type="string" Description="СНИЛС" CharacterMaximumLength="14" />
    <Attribute Name="FirstName" Type="string" Description="Имя" Required="1" />
    <Attribute Name="LastName" Type="string" Description="Фамилия" CharacterMaximumLength="100" Required="1" />
    <Attribute Name="Patronymic" Type="string" Description="Отчество" CharacterMaximumLength="100" />
    <Attribute Name="BirthDate" Type="date" Description="Дата рождения" Required="1" />
    <Choice Name="Gender" Description="Пол">
      <Item Name="мужской" Index="1" />
      <Item Name="женский" Index="2" />
    </Choice>
    <Attribute Name="BirthLastName" Type="string" Description="Фамилия, данная при рождении" CharacterMaximumLength="100" />
    <Attribute Name="BirthPlace" Type="string" Description="Место рождения" CharacterMaximumLength="256" />
    <Attribute Name="WorkPlace" Type="string" Description="Место работы/учебы" CharacterMaximumLength="100" />
    <Parent Name="SocStatusId" Type="EHR.EHR_RUS_SMP468" Description="Код социального статуса" />
    <Parent Name="DecreedGroupId" Type="EHR.EHR_RUS_KVEOU5B4G2" Description="Код декретированной группы" />
    <Parent Name="CitizenShipId" Type="EHR.EHR_RUS_O00015" Description="Код гражданства" Required="1" />
    <Parent Name="NoresidentStatusId" Type="EHR.EHR_RUS_IN5PIUE8S5" Description="Правовой статус нерезидента" />
    <Child Name="Relatives" Type="AKUZ.FRVICH_PATIENT_RELATIVE" Description="Информация о родственниках" ChildAttribute="FrvichPatient" />
    <Child Name="Documents" Type="AKUZ.FRVICH_PATIENT_DOCUMENT" Description="Информация о документах, удостоверяющих личность" ChildAttribute="FrvichPatient" />
    <Link Name="FrvichIi" Type="AKUZ.FRVICH_PATIENT_II" Description="Сведения об интеграции с ФРВИЧ" LinkAttribute="FrvichPatient" />
    <Link Name="FrvichRegistrationRecord" Type="AKUZ.FRVICH_REGISTRATION_RECORD" Description="Регистрационная запись РВИЧ" LinkAttribute="FrvichPatient" />
    <Parent Name="Patient" Type="AKUZ.PATIENT" Description="Пациент" Required="1" />
    <Parent Name="MaritalStatus" Type="EHR.EHR_RUS_JJD6FHFVQC" Description="Семейное положение" />
  </Fields>
  <DbMapping>
    <Table name="T_FRVICH_PATIENT">
      <Map Name="FrvichPatientID" Column="FrvichPatientID" />
      <Map Name="Snils" Column="Snils" />
      <Map Name="FirstName" Column="FirstName" />
      <Map Name="LastName" Column="LastName" />
      <Map Name="Patronymic" Column="Patronymic" />
      <Map Name="BirthDate" Column="BirthDate" />
      <Map Name="Gender" Column="Gender" />
      <Map Name="BirthLastName" Column="BirthLastName" />
      <Map Name="BirthPlace" Column="BirthPlace" />
      <Map Name="WorkPlace" Column="WorkPlace" />
      <Map Name="SocStatusId" Column="SocStatusId" />
      <Map Name="DecreedGroupId" Column="DecreedGroupId" />
      <Map Name="CitizenShipId" Column="CitizenShipId" />
      <Map Name="NoresidentStatusId" Column="NoresidentStatusId" />
      <Map Name="Patient" Column="Patient" />
      <Map Name="MaritalStatus" Column="MaritalStatus" />
    </Table>
  </DbMapping>
</Entity>