<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="AKUZ" 
Name="EVENT_BASE" 
Description="Случай обращения" 
PrimaryKey="EventID">
  <Customs>
    <Custom Name="FilterUICondition"><![CDATA[<lx:Criterion type="=" xmlns:lx="lexem">
    <lx:Path OwnerQueryLevel="0">
        <lx:StepString name="AmbulanceCard" />
        <lx:StepString name="CardLpu" />
    </lx:Path>
    <lx:ParamHolder>
        <lx:StepString name="CURRENT_LPU_MAIN" />
    </lx:ParamHolder>
</lx:Criterion>]]></Custom>
  </Customs>
  <Fields>
    <Attribute Name="EventID" Index="5240001" Type="guid" Description="Идентификатор" />
    <Attribute Name="EventDate" Index="5240002" Type="date" Description="Дата обращения" Required="1" />
    <Attribute Name="CloseDate" Index="5240007" Type="date" Description="Дата закрытия" />
    <Attribute Name="CreationDateTime" Index="5240008" Type="datetime" DefaultFormat="{0:dd.MM.yyyy HH:mm}" Description="Дата и время регистрации" />
    <Attribute Name="Number" Index="5240014" Type="int" Description="Номер госпитализации " Required="1" />
    <Parent Name="AmbulanceCard" Index="5240005" Type="AKUZ.AMBULANCE_CARD" Description="Амбулаторная карта" />
    <Parent Name="Direction" Index="5240006" Type="AKUZ.DIRECTION_BASE" Description="Направление" />
    <Parent Name="CreatorUser" Index="5240009" Type="AKUZ.USERS" Description="Регистратор" />
    <Parent Name="EventPerpose" Index="5240010" Type="VCLib.ENUMS" Description="Цель обращения" EnumType="DirectionPerpose" />
    <Parent Name="EventType" Index="5240011" Type="VCLib.ENTITIES" Description="Тип записи" Save="0" />
    <Parent Name="AmbulanceEvent" Index="5240016" Type="AKUZ.AMBULANCE_EVENT" Description="Основной случай обращения" />
    <Parent Name="RemoteDirection" Index="5240017" Type="AKUZ.REMOTE_DIRECTION" Description="Удаленное направление" />
    <Child Name="AmbulanceEvents" Index="5240015" Type="AKUZ.AMBULANCE_EVENT" Description="Связанные случаи обращения" ChildAttribute="AmbulanceEvent" />
    <Choice Name="Maritalstatus" Index="5240012" Description="Семейное положение">
      <Item Name="Брак зарегистрирован" Index="0" />
      <Item Name="Брак не зарегистрирован" Index="1" />
      <Item Name="одинокая" Index="2" />
    </Choice>
    <Choice Name="Education" Index="5240013" Description="Образование">
      <Item Name="незаконченное среднее" Index="0" />
      <Item Name="среднее" Index="1" />
      <Item Name="средне-специальное" Index="2" />
      <Item Name="незаконченное высшее" Index="3" />
      <Item Name="без образования" Index="4" />
      <Item Name="высшее" Index="5" />
    </Choice>
    <Child Name="EventMemoRecords" Type="AKUZ.EVENT_MEMO_RECORD" Description="Информационные заметки" ChildAttribute="EventBase" />
    <Link Name="HospitalDestinationList" Type="AKUZ.HOSPITAL_DESTINATION_LIST" Description="Лист назначений в стационаре" LinkAttribute="EventBase" />
    <Child Name="HospitalStandartApplicationHistorys" Type="AKUZ.HOSPITAL_STANDART_APPLICATION_HISTORY" Description="Использование стандартов лечения в терапии пациента" ChildAttribute="EventBase" />
    <Parent Name="PatientHivContingent" Type="AKUZ.PATIENT_HIV_CONTINGENT" Description="Контингент пациента для ВИЧ" />
    <Child Name="InquiryInfos" Type="AKUZ.INQUIRY_INFO" Description="Выданные по случаю обращения документы на руки" ChildAttribute="EventBase" />
    <Link Name="EventRehabilitationCard" Type="AKUZ.EVENT_REHABILITATION_CARD" Description="Карта реабилитационных мероприятий" LinkAttribute="EventBase" />
    <Parent Name="VmpEvent" Type="VMP.VMP_EVENT" Description="Случай ВМП" />
    <Child Name="PatientFieldEditReasons" Type="AKUZ.PATIENT_FIELD_EDIT_REASON" Description="Причина изменения атрибута номер ИБ" ChildAttribute="EventBase" />
  </Fields>
  <DbMapping>
    <Table name="T_EVENT_BASE">
      <Map Name="EventID" Column="EventID" />
      <Map Name="EventDate" Column="EventDate" />
      <Map Name="CloseDate" Column="CloseDate" />
      <Map Name="CreationDateTime" Column="CreationDateTime" />
      <Map Name="Number" Column="Number" />
      <Map Name="AmbulanceCard" Column="AmbulanceCard" />
      <Map Name="Direction" Column="Direction" />
      <Map Name="CreatorUser" Column="CreatorUser" />
      <Map Name="EventPerpose" Column="EventPerpose" />
      <Map Name="EventType" Column="type_" IsStored="0" />
      <Map Name="AmbulanceEvent" Column="AmbulanceEvent" />
      <Map Name="RemoteDirection" Column="RemoteDirection" />
      <Map Name="Maritalstatus" Column="Maritalstatus" />
      <Map Name="Education" Column="Education" />
      <Map Name="PatientHivContingent" Column="PatientHivContingent" />
      <Map Name="VmpEvent" Column="VmpEvent" />
    </Table>
  </DbMapping>
  <CalculatingAttributes>
    <Attribute Name="Type" Index="5240004" Type="int" Description="Тип" />
    <Choice Name="Status" Index="5240003" Description="Статус" Required="1" RequiredAttributes="{CloseDate}">
      <Item Name="Открыт" Index="0" />
      <Item Name="Закрыт" Index="1" />
    </Choice>
  </CalculatingAttributes>
</Entity>