<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="AKUZ" 
Name="HOSPITAL_DESTINATION" 
Description="Лечебное назначение" 
DNAttributes="{CName}" 
DisplayName="{0}" 
Inherits="AKUZ.AMBULANCE_CARD_RECORD">
  <Fields>
    <Attribute Name="Signa" Type="string" Description="Сигнатура назначения" CharacterMaximumLength="1000" Required="1" />
    <Parent Name="EhrRusVls373" Type="EHR.EHR_RUS_VLS373" Description="Классификатор способов введения лекарственных средств" />
    <Child Name="DestinationExecuteElements" Type="AKUZ.DESTINATION_EXECUTE_ELEMENT" Description="Выполняемый элемент назначения" ChildAttribute="HospitalDestination" />
    <Child Name="HospitalDestinationLekComponents" Type="AKUZ.HOSPITAL_DESTINATION_LEK_COMPONENT" Description="Лекарственный компонент назначения" ChildAttribute="HospitalDestination" />
    <Parent Name="HospitalDestinationList" Type="AKUZ.HOSPITAL_DESTINATION_LIST" Description="Лист назначений в стационаре" Required="1" />
    <Parent Name="SubmissionConditionDestination" Type="AKUZ.SUBMISSION_CONDITION_DESTINATION" Description="Условия введения назначения" />
    <Attribute Name="PreparateReserved" Type="bool" Description="Признак необходимости резервирования препаратов на складе" Required="1" />
    <Parent Name="MedicalExamination" Type="AKUZ.MEDICAL_EXAMINATION" Description="Медицинский осмотр" />
    <Attribute Name="CName" Type="string" Description="Наименование" />
    <Parent Name="AppointmentsFrequencyDictionary" Type="AKUZ.APPOINTMENTS_FREQUENCY_DICTIONARY" Description="Справочник переодичности назначений" />
    <Parent Name="CancelPost" Type="AKUZ.POST" Description="Врач, отменивший назначение" />
    <Attribute Name="CancelDateTime" Type="datetime" Description="Дата и время отмены назначения" />
    <Parent Name="EhrRusA4HN5A96VT" Type="EHR.EHR_RUS_A4HN5A96VT" Description="Причины отмены лекарственных средств" />
    <Attribute Name="ProcedureDuration" Type="int" Description="Длительность процедуры" />
    <Attribute Name="IsUntilCancellation" Type="bool" Description="По графику до отмены" Required="1" />
    <Attribute Name="ProcedureCount" Type="int" Description="Количество процедур" />
    <Attribute Name="Note" Type="string" Description="Примечание" CharacterMaximumLength="500" />
  </Fields>
  <DbMapping>
    <Table name="T_HOSPITAL_DESTINATION">
      <Map Name="Signa" Column="Signa" />
      <Map Name="EhrRusVls373" Column="EhrRusVls373" />
      <Map Name="HospitalDestinationList" Column="HospitalDestinationList" />
      <Map Name="SubmissionConditionDestination" Column="SubmissionConditionDestination" />
      <Map Name="PreparateReserved" Column="PreparateReserved" />
      <Map Name="MedicalExamination" Column="MedicalExamination" />
      <Map Name="AppointmentsFrequencyDictionary" Column="AppointmentsFrequencyDictionary" />
      <Map Name="CancelPost" Column="CancelPost" />
      <Map Name="CancelDateTime" Column="CancelDateTime" />
      <Map Name="EhrRusA4HN5A96VT" Column="EhrRusA4HN5A96VT" />
      <Map Name="ProcedureDuration" Column="ProcedureDuration" />
      <Map Name="IsUntilCancellation" Column="IsUntilCancellation" />
      <Map Name="ProcedureCount" Column="ProcedureCount" />
      <Map Name="Note" Column="Note" />
    </Table>
    <Lexem>
      <Map Name="CName">
        <lx:ChildCount xmlns:lx="lexem">
          <condition />
          <lx:Path OwnerQueryLevel="0">
            <lx:StepString name="HospitalDestinationLekComponents" />
          </lx:Path>
          <lx:Joint>
            <lx:Path OwnerQueryLevel="0">
              <lx:StepString name="cName" />
            </lx:Path>
            <lx:ConstOperand type="String"><![CDATA[+]]></lx:ConstOperand>
          </lx:Joint>
          <lx:Path OwnerQueryLevel="0">
            <lx:StepString name="BaseComponent" />
          </lx:Path>
          <lx:ConstOperand type="String"><![CDATA[asc]]></lx:ConstOperand>
        </lx:ChildCount>
      </Map>
    </Lexem>
  </DbMapping>
</Entity>