<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="AKUZ" 
Name="INDIVIDUAL_JOB" 
Description="Сведения о работе" 
PrimaryKey="IndividualJobID" 
DNAttributes="{WorkPlace};{Occupation}" 
DisplayName="{0}, {1}">
  <Fields>
    <Attribute Name="IndividualJobID" Index="14330001" Type="guid" Description="Идентификатор" />
    <Attribute Name="WorkPlace" Index="14330002" Type="string" Description="Место работы/учебы" CharacterMaximumLength="256" Required="1" />
    <Attribute Name="Occupation" Index="14330003" Type="string" Description="Должность/Профессия" />
    <Attribute Name="BeginDate" Index="14330004" Type="date" Description="Дата начала" Required="1" />
    <Attribute Name="Division" Index="14330005" Type="string" Description="Подразделение" />
    <Attribute Name="Address" Index="14330006" Type="string" Description="Адрес" />
    <Attribute Name="CollaborationWork" Index="14330008" Type="bool" Description="Работа по совместительтсву" Required="1" />
    <Attribute Name="WorkPlaceAndDivision" Index="14330009" Type="string" Description="Место работы с подразделением" />
    <Parent Name="WorkplaceDict" Index="14330010" Type="AKUZ.WORKPLACE" Description="Учреждения образования / мест работы" />
    <Parent Name="IndividualValuation" Index="14330014" Type="AKUZ.INDIVIDUAL_VALUATION" Description="Индивидуальный расчет" Required="1" />
    <Choice Name="JobType" Index="14330012" Description="Место" Required="1">
      <Item Name="работы" Index="0" />
      <Item Name="учебы" Index="1" />
    </Choice>
    <Choice Name="DivisionType" Index="14330013" 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>
    <Parent Name="Profession" Type="EHR.EHR_RUS_PRP365" Description="Должность по справочнику" Required="1" />
  </Fields>
  <DbMapping>
    <Table name="T_INDIVIDUAL_JOB">
      <Map Name="IndividualJobID" Column="IndividualJobID" />
      <Map Name="WorkPlace" Column="WorkPlace" />
      <Map Name="Occupation" Column="Occupation" />
      <Map Name="BeginDate" Column="BeginDate" />
      <Map Name="Division" Column="Division" />
      <Map Name="Address" Column="Address" />
      <Map Name="CollaborationWork" Column="CollaborationWork" />
      <Map Name="WorkplaceDict" Column="WorkplaceDict" />
      <Map Name="IndividualValuation" Column="IndividualValuation" />
      <Map Name="JobType" Column="JobType" />
      <Map Name="DivisionType" Column="DivisionType" />
      <Map Name="Profession" Column="Profession" />
    </Table>
    <Lexem>
      <Map Name="WorkPlaceAndDivision">
        <lx:Format xmlns:lx="lexem">
          <lx:ConstOperand type="String"><![CDATA[{0}, {1} {2}]]></lx:ConstOperand>
          <lx:Path OwnerQueryLevel="0">
            <lx:StepInt index="14330002" />
          </lx:Path>
          <lx:Path OwnerQueryLevel="0">
            <lx:StepInt index="14330013" />
          </lx:Path>
          <lx:Path OwnerQueryLevel="0">
            <lx:StepInt index="14330005" />
          </lx:Path>
        </lx:Format>
      </Map>
    </Lexem>
  </DbMapping>
  <CalculatingAttributes>
    <Attribute Name="Experience" Index="14330015" Type="int" Description="Стаж работы (полных лет)" RequiredAttributes="{BeginDate}" />
  </CalculatingAttributes>
</Entity>