<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="AKUZ" 
Name="MEDICAL_RECORD" 
Description="Медицинская запись" 
PrimaryKey="MedicalRecordID" 
DNAttributes="{RecordType/EntDesc}" 
DisplayName="{0}">
  <Fields>
    <Attribute Name="MedicalRecordID" Index="5460001" Type="guid" Description="Идентификатор" />
    <Attribute Name="RecordDate" Index="5460004" Type="date" Description="Дата записи" />
    <Attribute Name="RecordTime" Index="5460005" Type="datetime" DefaultFormat="{0:HH:mm}" Description="Время записи" />
    <Parent Name="Post" Index="5460002" Type="AKUZ.POST" Description="Должность" Required="1" />
    <Parent Name="Users" Index="5460007" Type="AKUZ.USERS" Description="Пользователь системы" />
    <Parent Name="RecordType" Index="5460008" Type="VCLib.ENTITIES" Description="Тип записи" Save="0" />
    <Child Name="Relationships" Index="5460009" Type="AKUZ.MEDICAL_RECORD_RELATIONSHIP" Description="Связанные записи" ChildAttribute="MedicalRecord" />
    <Child Name="ServiceRelationShips" Index="11100022" Type="AKUZ.SERVICE_RELATION_SHIPS" Description="Связь между медицинской записью и услугой" ChildAttribute="MedicalRecord" />
    <Link Name="RecordSign" Type="AKUZ.RECORD_SIGN" Description="Подпись записи" LinkAttribute="MedicalRecord" />
    <Parent Name="MOMain" Type="AKUZ.LPU_MAIN" Description="Медицинская организация" Required="1" />
    <Parent Name="MedicalEpisode" Type="AKUZ.MEDICAL_EPISODE" Description="Медицинский эпизод" />
  </Fields>
  <DbMapping>
    <Table name="T_MEDICAL_RECORD">
      <Map Name="MedicalRecordID" Column="MedicalRecordID" />
      <Map Name="RecordDate" Column="RecordDate" />
      <Map Name="RecordTime" Column="RecordTime" />
      <Map Name="Post" Column="Post" />
      <Map Name="Users" Column="Users" />
      <Map Name="RecordType" Column="type_" IsStored="0" />
      <Map Name="MOMain" Column="MOMain" />
    </Table>
    <Spread>
      <Map Name="MedicalEpisode" />
    </Spread>
  </DbMapping>
  <CalculatingAttributes>
    <Attribute Name="MkbOsn" Index="11100017" Type="string" Description="Код МКБ основного заболевания" RequiredAttributes="{as AKUZ.HOSPITAL_RECORD/MKBCode};{as AKUZ.OUTCOME_OF_INSPECTION/MKBCode};{as AKUZ.MEDICAL_CERTIFICATE/MKBCode}" />
    <Attribute Name="DiagOsn" Index="11100021" Type="string" Description="Расшифровка основного диагноза" RequiredAttributes="{as AKUZ.HOSPITAL_RECORD/Diagnosis};{as AKUZ.OUTCOME_OF_INSPECTION/Diagnosis};{as AKUZ.MEDICAL_CERTIFICATE/Diagnosis}" />
    <Attribute Name="Type" Index="5460010" Type="int" Description="Тип" />
  </CalculatingAttributes>
</Entity>