<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="AKUZ" 
Name="MEDICAL_EXAMINATION_DATA" 
Description="Данные о случае обращения" 
DNAttributes="{Mkb};{DateIn};{Post/Speciality/Name}" 
DisplayName="Обращение от {1}  по специальности {2} с диагнозом {0}" 
Inherits="AKUZ.MEDICAL_EPISODE">
  <Fields>
    <Parent Name="MedicalExaminationMain" Type="AKUZ.MEDICAL_EXAMINATION_MAIN" Description="Первичный медицинский осмотр" />
    <Parent Name="SicknessMode" Type="VCLib.ENUMS" Description="Характер заболевания" EnumType="SicknessMode" />
    <Attribute Name="ExternalCause" Type="string" Description="Внешняя причина" />
    <Choice Name="TraumaType" Description="Тип травмы">
      <Item Name="Производственная" Index="1" />
      <Item Name="Непроизводственная" Index="2" />
    </Choice>
    <Parent Name="VisitPurpose" Type="AKUZ.VISIT_PURPOSE" Description="Цель обращения" />
    <Choice Name="SicknessStage" Description="Стадия заболевания">
      <Item Name="ранняя" Index="1" />
      <Item Name="поздняя" Index="2" />
      <Item Name="0" Index="10" />
      <Item Name="1" Index="11" />
      <Item Name="2" Index="12" />
      <Item Name="3" Index="13" />
      <Item Name="4" Index="14" />
    </Choice>
    <Parent Name="Trauma" Type="AKUZ.TRAUMA" Description="Травма" />
    <Parent Name="CheckUpStatus" Type="VCLib.ENUMS" Description="Признак ДН по диагнозу" EnumType="CheckUpStatus" />
    <Parent Name="CheckUpGroup" Type="VCLib.ENUMS" Description="Группа Д-наблюдения" EnumType="CheckUpGroup" />
    <Attribute Name="CheckUpDateIn" Type="datetime" DefaultFormat="{0:dd.MM.yyyy}" Description="Дата взятия на ДН" />
    <Attribute Name="CheckUpDateOut" Type="datetime" DefaultFormat="{0:dd.MM.yyyy}" Description="Дата снятия с ДН" />
    <Attribute Name="ActiveFindDiagnos" Type="bool" Description="Признак активного выявления диагноза" Required="1" />
    <Parent Name="LastMedicalExamination" Type="AKUZ.MEDICAL_EXAMINATION" Description="Последний осмотр врача, проводившего первичку" />
    <Parent Name="CurrentDispanserisationInit" Type="AKUZ.DISPANSERISATION_INIT" Description="Текущее диспансерное наблюдение" />
    <Attribute Name="TraumaDateTime" Type="datetime" Description="Дата и время получения травмы" />
  </Fields>
  <DbMapping>
    <Table name="T_MEDICAL_EXAMINATION_DATA">
      <Map Name="MedicalExaminationMain" Column="MedicalExaminationMain" />
      <Map Name="SicknessMode" Column="SicknessMode" />
      <Map Name="ExternalCause" Column="ExternalCause" />
      <Map Name="TraumaType" Column="TraumaType" />
      <Map Name="VisitPurpose" Column="VisitPurpose" />
      <Map Name="SicknessStage" Column="SicknessStage" />
      <Map Name="Trauma" Column="Trauma" />
      <Map Name="CheckUpStatus" Column="CheckUpStatus" />
      <Map Name="CheckUpGroup" Column="CheckUpGroup" />
      <Map Name="CheckUpDateIn" Column="CheckUpDateIn" />
      <Map Name="CheckUpDateOut" Column="CheckUpDateOut" />
      <Map Name="ActiveFindDiagnos" Column="ActiveFindDiagnos" />
      <Map Name="LastMedicalExamination" Column="LastMedicalExamination" />
      <Map Name="CurrentDispanserisationInit" Column="CurrentDispanserisationInit" />
      <Map Name="TraumaDateTime" Column="TraumaDateTime" />
    </Table>
  </DbMapping>
  <CalculatingAttributes>
    <Attribute Name="NextEntryDate" Type="datetime" DefaultFormat="{0:dd.MM.yyyy}" Description="Дата следующей явки" RequiredAttributes="{LastMedicalExamination/ExaminationDate};{MedicalExaminationMain/ExaminationDate};{MedicalExaminationMain/RepeatedToRouteDoctorInspections/RouteDate};{MedicalExaminationMain/cMedicalExaminationRess/ExaminationDate};{MedicalExaminationMain/cMedicalExaminationRess/ExaminationTime};{MedicalExaminationMain/Post};{MedicalExaminationMain/AmbulanceEvent/AmbulanceRecords/Post};{MedicalExaminationMain/ExaminationDate};{MedicalExaminationMain/AmbulanceEvent/AmbulanceRecords/as AKUZ.PRESCRIPTION_RECORD/RouteDate}" />
  </CalculatingAttributes>
</Entity>