<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="STOR" 
Name="GROUP_REMAINS_ON_TRN" 
Description="Сгруппированые остатки по ТРН" 
PrimaryKey="GroupRemainsOnTrnID" 
DNAttributes="{CTrn/NameRus};{MedicationForms/Name};{DoseView};{ExpirationDate};{Amount};{PackageName}" 
DisplayName="{0} {1} {2} Срок годности:{3} Остаток:{4} {5}">
  <Fields>
    <Attribute Name="GroupRemainsOnTrnID" Type="guid" Description="Идентификатор" />
    <Parent Name="CTrn" Type="PHARM.C_TRN" Description="Торговое наименование препарата" Required="1" />
    <Parent Name="MedicationForms" Type="PHARM.MEDICATION_FORMS" Description="Лекарственные формы" />
    <Attribute Name="DoseView" Type="string" Description="Дозировка" CharacterMaximumLength="1000" />
    <Parent Name="Storage" Type="STOR.STORAGE" Description="Склад" Required="1" />
    <Attribute Name="Amount" Type="float" DefaultFormat="{0:0.#####}" Description="Остаток" NumericPrecision="20" NumericScale="6" Required="1" />
    <Attribute Name="ExpirationDate" Type="date" Description="Срок годности" Required="1" />
    <Parent Name="EhrRus9a9g09e8kl" Type="EHR.EHR_RUS_9A9G09E8KL" Description="Узлы СМНН. ЕСКЛП" />
    <Attribute Name="Dose" Type="string" Description="Доза" CharacterMaximumLength="1000" />
    <Parent Name="PackageType" Type="PHARM.PACKAGE_TYPE" Description="Вид упаковки" />
    <Attribute Name="PackageName" Type="string" Description="Наименование вида упаковки" />
  </Fields>
  <DbMapping>
    <View name="V_GROUP_REMAINS_ON_TRN">
      <Map Name="GroupRemainsOnTrnID" Column="GroupRemainsOnTrnID" />
      <Map Name="CTrn" Column="CTrn" />
      <Map Name="MedicationForms" Column="MedicationForms" />
      <Map Name="DoseView" Column="DoseView" />
      <Map Name="Storage" Column="Storage" />
      <Map Name="Amount" Column="Amount" />
      <Map Name="ExpirationDate" Column="ExpirationDate" />
      <Map Name="EhrRus9a9g09e8kl" Column="EhrRus9a9g09e8kl" />
      <Map Name="Dose" Column="Dose" />
      <Map Name="PackageType" Column="PackageType" />
    </View>
    <Lexem>
      <Map Name="PackageName">
        <lx:IsNull xmlns:lx="lexem">
          <lx:Path OwnerQueryLevel="0">
            <lx:StepString name="PackageType" />
            <lx:StepString name="ShortName" />
          </lx:Path>
          <lx:Path OwnerQueryLevel="0">
            <lx:StepString name="PackageType" />
            <lx:StepString name="Name" />
          </lx:Path>
        </lx:IsNull>
      </Map>
    </Lexem>
  </DbMapping>
</Entity>