<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="AKUZ" 
Name="ANALYSIS" 
Description="Анализы" 
PrimaryKey="AnalysisID" 
DNAttributes="{Name};{ResultString}" 
DisplayName="{0}: {1}">
  <CanGroupInTreeListBy Value="ParentID" />
  <Customs>
    <Custom Name="NotDisplayedInFilter" Value="TreeLevel;CalcLexem;ValidateLexem;NormativLexem;PrintTemplateFile" />
    <Custom Name="NotDisplayedColumns" Value="TreeLevel;CalcLexem;Depth;ValidateLexem;NormativLexem;PrintTemplateFile" />
  </Customs>
  <Fields>
    <Attribute Name="AnalysisID" Index="50000001" Type="sguid" Description="Идентификатор" />
    <Attribute Name="TreeLevel" Index="50000005" Type="int" Description="Уровень дерева" Required="1" />
    <Attribute Name="Name" Index="50000008" Type="string" Description="Наименование" CharacterMaximumLength="700" Required="1" />
    <Attribute Name="Value" Index="50000009" Type="string" Description="Значение" CharacterMaximumLength="1000" />
    <Attribute Name="CalcLexem" Index="50000010" Type="string" Description="Формула" CharacterMaximumLength="4000" />
    <Attribute Name="ValidateLexem" Index="50000016" Type="string" Description="Валидация" CharacterMaximumLength="1500" />
    <Attribute Name="NormativLexem" Index="50000017" Type="text" Description="Норматив" />
    <Attribute Name="CheckBoxValue" Index="50000019" Type="bool" Description="Да/нет" />
    <Attribute Name="TemplateGuid" Index="50000020" Type="guid" Description="Идентификатор шаблона" Required="1" />
    <Attribute Name="NormativText" Index="50000022" Type="string" Description="Описание норматива" CharacterMaximumLength="600" />
    <Attribute Name="Measurement" Index="50000023" Type="string" Description="Единицы измерения" CharacterMaximumLength="255" />
    <Attribute Name="FormWidth" Index="50000024" Type="int" Description="Ширина формы" />
    <Attribute Name="FormHeight" Index="50000025" Type="int" Description="Высота формы" />
    <Attribute Name="ColumnsConfig" Index="50000026" Type="string" Description="Настройка размеров колонок" CharacterMaximumLength="8" />
    <Attribute Name="ColumnCount" Index="50000027" Type="int" Description="Количество колонок" />
    <Attribute Name="TabOrder" Index="50000029" Type="int" Description="Порядок" Required="1" />
    <Attribute Name="ShowBorder" Index="50000030" Type="bool" Description="Показать границу" Required="1" />
    <Attribute Name="Date" Index="50000037" Type="date" Description="Дата" />
    <Attribute Name="MultilineText" Index="50000038" Type="string" Description="Текст" CharacterMaximumLength="2000" />
    <Attribute Name="CalcReadOnly" Index="50000039" Type="bool" Description="Вычислимое, нередактируемое поле" Required="1" />
    <Parent Name="ParentID" Index="50000006" Type="AKUZ.ANALYSIS" Description="Родительская категория" />
    <Parent Name="AnalysisDictionary" Index="50000021" Type="AKUZ.ANALYSIS_DICTIONARY" Description="Значение из справочника" />
    <Parent Name="RootParent" Index="50000033" Type="AKUZ.ANALYSIS" Description="Основной анализ" />
    <Child Name="Children" Index="50000007" Type="AKUZ.ANALYSIS" Description="Дочерние категории" ChildAttribute="ParentID" />
    <Child Name="RootChildren" Index="50000034" Type="AKUZ.ANALYSIS" Description="Все анализы" ChildAttribute="RootParent" />
    <Choice Name="ValueType" Index="50000018" Description="Тип значения" Required="1">
      <Item Name="Value" Index="0" />
      <Item Name="Dictionary" Index="1" />
      <Item Name="CheckBox" Index="2" />
      <Item Name="Date" Index="5" />
      <Item Name="MultilineText" Index="6" />
      <Item Name="Group" Index="3" />
      <Item Name="Analysis" Index="4" />
    </Choice>
    <Attribute Name="Code" Type="string" Description="Код" />
    <Attribute Name="CodeSystem" Type="string" Description="Код справочника" />
    <Parent Name="AnalysisDiagnosticResultLink" Type="AKUZ.ANALYSIS_DIAGNOSTIC_RESULT_LINK" Description="Анализ результата исследования" />
  </Fields>
  <DbMapping>
    <Table name="T_ANALYSIS">
      <Map Name="AnalysisID" Column="AnalysisID" />
      <Map Name="TreeLevel" Column="TreeLevel" />
      <Map Name="Name" Column="Name" RefTable="S_ANALYSIS_Name" />
      <Map Name="Value" Column="Value" />
      <Map Name="CalcLexem" Column="CalcLexem" RefTable="S_ANALYSIS_CalcLexem" />
      <Map Name="ValidateLexem" Column="ValidateLexem" RefTable="S_ANALYSIS_ValidateLexem" />
      <Map Name="NormativLexem" Column="NormativLexem" RefTable="S_ANALYSIS_NormativLexem" />
      <Map Name="CheckBoxValue" Column="CheckBoxValue" />
      <Map Name="TemplateGuid" Column="TemplateGuid" />
      <Map Name="NormativText" Column="NormativText" RefTable="S_ANALYSIS_NormativText" />
      <Map Name="Measurement" Column="Measurement" RefTable="S_ANALYSIS_Measurement" />
      <Map Name="FormWidth" Column="FormWidth" />
      <Map Name="FormHeight" Column="FormHeight" />
      <Map Name="ColumnsConfig" Column="ColumnsConfig" RefTable="S_ANALYSIS_ColumnsConfig" />
      <Map Name="ColumnCount" Column="ColumnCount" />
      <Map Name="TabOrder" Column="TabOrder" />
      <Map Name="ShowBorder" Column="ShowBorder" />
      <Map Name="Date" Column="Date" />
      <Map Name="MultilineText" Column="MultilineText" />
      <Map Name="CalcReadOnly" Column="CalcReadOnly" />
      <Map Name="ParentID" Column="ParentID" />
      <Map Name="AnalysisDictionary" Column="AnalysisDictionary" />
      <Map Name="RootParent" Column="RootParent" />
      <Map Name="ValueType" Column="ValueType" />
      <Map Name="Code" Column="Code" />
      <Map Name="CodeSystem" Column="CodeSystem" />
      <Map Name="AnalysisDiagnosticResultLink" Column="AnalysisDiagnosticResultLink" />
    </Table>
  </DbMapping>
  <CalculatingAttributes>
    <Attribute Name="ColumnPercent" Index="50000028" Type="int" Description="Ширина колонки" RequiredAttributes="{ColumnsConfig};{ParentID/ColumnsConfig}">
      <Parameter Name="ColNumber" Description="Номер колонки" Type="int" />
    </Attribute>
    <Attribute Name="ResultString" Index="50000035" Type="string" Description="Результат анализа" RequiredAttributes="{Value};{CheckBoxValue};{AnalysisDictionary/Code};{AnalysisDictionary/Name};{Measurement};{ValueType};{Date};{MultilineText}" />
    <Attribute Name="RootSort" Index="50000036" Type="string" Description="Атрибут сортировки коллекции анализов" RequiredAttributes="{RootParent/RootChildren/TabOrder};{RootParent/RootChildren/RootParent};{RootParent/RootChildren/ParentID};{RootParent/RootChildren/Children};{RootParent/RootParent};{RootParent/ParentID};{RootParent/Children};{RootParent/TabOrder}" />
  </CalculatingAttributes>
</Entity>