<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="AKUZ" 
Name="DRUG_REQUEST" 
Description="Заявка на лекарственное обеспечение" 
DNAttributes="{BeginPeriod};{EndPeriod}" 
DisplayName="Заявка на лекарственное обеспечение с {0} по {1}" 
Inherits="AKUZ.BASE_DRUG_REQUEST">
  <Fields>
    <Attribute Name="ImportFileName" Index="7240028" Type="string" Description="Имя файла импорта" CharacterMaximumLength="255" />
    <Parent Name="Branch" Index="7240034" Type="AKUZ.BRANCH" Description="Филиал" />
    <Child Name="DrugDemands" Index="7240004" Type="AKUZ.DRUG_DEMAND" Description="Потребность в препарате по заявке" ChildAttribute="DrugRequest" />
    <Child Name="DrugRequestCommentss" Index="7240035" Type="AKUZ.DRUG_REQUEST_COMMENTS" Description="Комментарии к заявке" ChildAttribute="DrugRequest" />
    <Parent Name="RequestType" Type="VCLib.ENUMS" Description="Тип заявки" EnumType="BenefitType" Required="1" />
  </Fields>
  <DbMapping>
    <Table name="T_DRUG_REQUEST">
      <Map Name="ImportFileName" Column="ImportFileName" />
      <Map Name="Branch" Column="Branch" />
      <Map Name="RequestType" Column="RequestType" />
    </Table>
  </DbMapping>
  <CalculatingAttributes>
    <Attribute Name="Sum7" Index="7240009" Type="float" DefaultFormat="{0:F2}" Description="Сумма 7 месяц" RequiredAttributes="{DrugDemands/RequestCatalog/Price};{DrugDemands/Mont7}" />
    <Attribute Name="Sum8" Index="7240010" Type="float" DefaultFormat="{0:F2}" Description="Сумма 8 месяц" RequiredAttributes="{DrugDemands/RequestCatalog/Price};{DrugDemands/Mont8}" />
    <Attribute Name="Excess" Index="7240011" Type="float" DefaultFormat="{0:F2}" Description="Превышение" RequiredAttributes="{SumTotal};{Limit}" />
    <Attribute Name="Sum10" Index="7240012" Type="float" DefaultFormat="{0:F2}" Description="Сумма 10 месяц" RequiredAttributes="{DrugDemands/RequestCatalog/Price};{DrugDemands/Mont10}" />
    <Attribute Name="Sum11" Index="7240013" Type="float" DefaultFormat="{0:F2}" Description="Сумма 11 месяц" RequiredAttributes="{DrugDemands/RequestCatalog/Price};{DrugDemands/Mont11}" />
    <Attribute Name="Sum1" Index="7240020" Type="float" DefaultFormat="{0:F2}" Description="Сумма 1 месяц" RequiredAttributes="{DrugDemands/RequestCatalog/Price};{DrugDemands/Mont1}" />
    <Attribute Name="Sum2" Index="7240021" Type="float" DefaultFormat="{0:F2}" Description="Сумма 2 месяц" RequiredAttributes="{DrugDemands/RequestCatalog/Price};{DrugDemands/Mont2}" />
    <Attribute Name="Sum3" Index="7240022" Type="float" DefaultFormat="{0:F2}" Description="Сумма 3 месяц" RequiredAttributes="{DrugDemands/RequestCatalog/Price};{DrugDemands/Mont3}" />
    <Attribute Name="Sum4" Index="7240023" Type="float" DefaultFormat="{0:F2}" Description="Сумма 4 месяц" RequiredAttributes="{DrugDemands/RequestCatalog/Price};{DrugDemands/Mont4}" />
    <Attribute Name="Sum5" Index="7240024" Type="float" DefaultFormat="{0:F2}" Description="Сумма 5 месяц" RequiredAttributes="{DrugDemands/RequestCatalog/Price};{DrugDemands/Mont5}" />
    <Attribute Name="Sum6" Index="7240025" Type="float" DefaultFormat="{0:F2}" Description="Сумма 6 месяц" RequiredAttributes="{DrugDemands/RequestCatalog/Price};{DrugDemands/Mont6}" />
    <Attribute Name="SumTotal" Index="7240026" Type="float" DefaultFormat="{0:F2}" Description="Сумма итого" RequiredAttributes="{DrugDemands/RequestCatalog/Price};{DrugDemands/Mont1};{DrugDemands/Mont2};{DrugDemands/Mont3};{DrugDemands/Mont4};{DrugDemands/Mont5};{DrugDemands/Mont6};{DrugDemands/Mont7};{DrugDemands/Mont8};{DrugDemands/Mont9};{DrugDemands/Mont10};{DrugDemands/Mont11};{DrugDemands/Mont12}" />
    <Attribute Name="Sum12" Index="7240031" Type="float" DefaultFormat="{0:F2}" Description="Сумма 12 месяц" RequiredAttributes="{DrugDemands/RequestCatalog/Price};{DrugDemands/Mont12}" />
    <Attribute Name="Sum9" Index="7240032" Type="float" DefaultFormat="{0:F2}" Description="Сумма 9 месяц" RequiredAttributes="{DrugDemands/RequestCatalog/Price};{DrugDemands/Mont9}" />
    <Child Name="PatientDrugDemands" Index="7240008" Type="AKUZ.PATIENT_DRUG_DEMAND" Description="Потребность льготника в препарате" RequiredAttributes="{DrugDemands/PharmacyDrugDemands/PatientDrugDemands}" PathAttributes="{DrugDemands/PharmacyDrugDemands/PatientDrugDemands}" />
    <Child Name="PharmacyDrugDemands" Index="7240014" Type="AKUZ.PHARMACY_DRUG_DEMAND" Description="Потребность препарата по аптеке" RequiredAttributes="{DrugDemands/PharmacyDrugDemands}" PathAttributes="{DrugDemands/PharmacyDrugDemands}" />
  </CalculatingAttributes>
</Entity>