<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="AKUZ" 
Name="EXAMINATION_TYPE_LINK" 
Description="Связка случая и справочника медицинских осмотров" 
PrimaryKey="ExaminationTypeLinkID">
  <Fields>
    <Attribute Name="ExaminationTypeLinkID" Index="11600001" Type="guid" Description="Идентификатор" />
    <Attribute Name="Priority" Index="11600002" Type="int" Description="Приоритет" Required="1" />
    <Attribute Name="ExecutionDate" Index="11600003" Type="date" Description="Дата выполнения(отмены)" />
    <Attribute Name="ExaminationCount" Index="11600004" Type="int" Description="Количество услуг" Required="1" />
    <Attribute Name="RecordDate" Index="11600014" Type="datetime" DefaultFormat="{0:dd.MM.yyyy}" Description="Дата записи" />
    <Attribute Name="Deviation" Index="11600018" Type="bool" Description="Патология" Required="1" />
    <Attribute Name="BunchID" Index="11600020" Type="guid" Description="Идентификатор посещения или услуги" />
    <Attribute Name="Mkb" Type="string" Description="Код МКБ" CharacterMaximumLength="8" />
    <Attribute Name="Diagnosis" Type="string" Description="Диагноз" />
    <Attribute Name="ExpirationDate" Type="int" Description="Срок годности (в днях)" />
    <Attribute Name="RouteID" Type="guid" Description="Идентификатор направления" />
    <Parent Name="AgeGroup" Index="11600005" Type="AKUZ.AGE_GROUP" Description="Возрастная группа" />
    <Parent Name="MedicalService" Index="11600006" Type="AKUZ.MEDICAL_SERVICE" Description="Медицинская услуга" />
    <Parent Name="Speciality" Index="11600007" Type="AKUZ.SPECIALITY" Description="Специальность" />
    <Parent Name="ExaminationBase" Index="11600009" Type="AKUZ.EXAMINATION_BASE" Description="Медицинский осмотр" Required="1" />
    <Parent Name="Users" Index="11600015" Type="AKUZ.USERS" Description="Пользователи системы" />
    <Parent Name="PerformerPost" Type="AKUZ.POST" Description="Должность" />
    <Parent Name="PerformerLpu" Type="AKUZ.LPU_MAIN" Description="МО исполнителя для выполненных ранее" />
    <Choice Name="Condition" Index="11600008" Description="Условие на выполнение" Required="1">
      <Item Name="Обязательный" Index="0" />
      <Item Name="Дополнительный" Index="1" />
    </Choice>
    <Choice Name="Status" Index="11600010" Description="Состояние" Required="1">
      <Item Name="Назначено" Index="0" />
      <Item Name="Выполнено" Index="1" />
      <Item Name="Выполнено ранее" Index="2" />
      <Item Name="Отказ" Index="3" />
      <Item Name="Неявка" Index="4" />
      <Item Name="Медицинские противопоказания" Index="5" />
      <Item Name="Услуги по ДВН/ПМО" Index="6" />
      <Item Name="Выполнено в др. МО" Index="7" />
    </Choice>
    <Choice Name="Type" Index="11600011" Description="Тип" Required="1">
      <Item Name="Специальность" Index="0" />
      <Item Name="Услуга" Index="1" />
      <Item Name="Процедура" Index="2" />
    </Choice>
    <Choice Name="RouteRequired" Index="11600016" Description="Направление" Required="1">
      <Item Name="Обязательное" Index="0" />
      <Item Name="Необязательное" Index="1" />
      <Item Name="В составе" Index="2" />
    </Choice>
    <Choice Name="BundleType" Index="11600019" Description="Способ подбора" Required="1">
      <Item Name="Специальность и услуга" Index="0" />
      <Item Name="Хирургические манипуляции" Index="1" />
    </Choice>
    <Parent Name="AmbulanceCardRecord" Type="AKUZ.AMBULANCE_CARD_RECORD" Description="Выполненное посещение или услуга" />
    <Child Name="SchetSluchs" Type="AKUZ.SCHET_SLUCH" Description="Элементы реестра счетов" ChildAttribute="Event" />
  </Fields>
  <DbMapping>
    <Table name="T_EXAMINATION_TYPE_LINK">
      <Map Name="ExaminationTypeLinkID" Column="ExaminationTypeLinkID" />
      <Map Name="Priority" Column="Priority" />
      <Map Name="ExecutionDate" Column="ExecutionDate" />
      <Map Name="ExaminationCount" Column="ExaminationCount" />
      <Map Name="RecordDate" Column="RecordDate" />
      <Map Name="Deviation" Column="Deviation" />
      <Map Name="BunchID" Column="BunchID" />
      <Map Name="Mkb" Column="Mkb" />
      <Map Name="Diagnosis" Column="Diagnosis" />
      <Map Name="ExpirationDate" Column="ExpirationDate" />
      <Map Name="RouteID" Column="RouteID" />
      <Map Name="AgeGroup" Column="AgeGroup" />
      <Map Name="MedicalService" Column="MedicalService" />
      <Map Name="Speciality" Column="Speciality" />
      <Map Name="ExaminationBase" Column="ExaminationBase" />
      <Map Name="Users" Column="Users" />
      <Map Name="PerformerPost" Column="PerformerPost" />
      <Map Name="PerformerLpu" Column="PerformerLpu" />
      <Map Name="Condition" Column="Condition" />
      <Map Name="Status" Column="Status" />
      <Map Name="Type" Column="Type" />
      <Map Name="RouteRequired" Column="RouteRequired" />
      <Map Name="BundleType" Column="BundleType" />
      <Map Name="AmbulanceCardRecord" Column="AmbulanceCardRecord" />
    </Table>
  </DbMapping>
  <CalculatingAttributes>
    <Parent Name="cBunchVisit" Index="11600012" Type="AKUZ.DOCTOR_VISIT" Description="Связка с посещением" RequiredAttributes="{MedicalService};{ExecutionDate};{Status};{Speciality};{Speciality/RelatedSpecialityLinks/RelatedSpeciality/Name};{BundleType};{BunchID};{ExaminationBase/DoctorVisits/Post/Speciality/Name};{ExaminationBase/DoctorVisits/VisitDate};{ExaminationBase/DoctorVisits/Post/ResourceServices/MedicalService};{ExaminationBase/DoctorVisits/DoctorVisitServices/MedicalService};{ExaminationBase/DoctorVisits/DoctorVisitServices/OperationDate}" PathAttributes="{ExaminationBase/DoctorVisits}" />
    <Parent Name="cBunchService" Index="11600013" Type="AKUZ.DIAGNOSTICS_RESULTS" Description="Связка с услугой" RequiredAttributes="{MedicalService};{ExecutionDate};{Status};{Speciality};{BundleType};{BunchID};{ExaminationBase/AmbulanceRecords/as AKUZ.DIAGNOSTICS_RESULTS/Research};{ExaminationBase/AmbulanceRecords/PostingDate};{ExaminationBase/ExaminationTypeLinks};{ExaminationBase/ExaminationTypeLinks/BunchID}" PathAttributes="{ExaminationBase/AmbulanceRecords/as AKUZ.DIAGNOSTICS_RESULTS}" />
    <Parent Name="cProcedure" Type="AKUZ.PROCEDURE_TREATMENT_RECORD" Description="Немедикаментозное лечение" RequiredAttributes="{MedicalService};{ExecutionDate};{Status};{Speciality};{BundleType};{BunchID};{ExaminationBase/AmbulanceRecords/as AKUZ.PROCEDURE_TREATMENT_RECORD/Procedure};{ExaminationBase/AmbulanceRecords/PostingDate}" PathAttributes="{ExaminationBase/AmbulanceRecords/as AKUZ.PROCEDURE_TREATMENT_RECORD}" />
  </CalculatingAttributes>
</Entity>