<?xml version="1.0" encoding="utf-8"?>
<Entity 
Schema="AKUZ" 
Name="WOMENS_CONSULTATION" 
Description="Этап женской консультации в случае беременности" 
PrimaryKey="WomensConsultationID">
  <Fields>
    <Attribute Name="WomensConsultationID" Type="guid" Description="Идентификатор" />
    <Parent Name="LpuMain" Type="AKUZ.LPU_MAIN" Description="МО" />
    <Attribute Name="FirstAppearenceTerm" Type="int" Description="Срок первой явки (нед.)" />
    <Attribute Name="FirstAppearenceDate" Type="date" Description="Дата первой явки" />
    <Attribute Name="Mkb" Type="string" Description="Код МКБ при постановке на учет" />
    <Attribute Name="Diagnosis" Type="string" Description="Диагноз при постановке на учет" />
    <Parent Name="FatherBloodGroup" Type="VCLib.ENUMS" Description="Группа крови отца" EnumType="BloodGroup" />
    <Attribute Name="MenstruationRegularity" Type="int" Description="Длительность менструального цикла" />
    <Attribute Name="MenstruationDuration" Type="int" Description="Длительность менструаций" />
    <Attribute Name="MenstruationPain" Type="bool" Description="Боли при менструации" Required="1" />
    <Attribute Name="RegularMens" Type="bool" Description="Регулярные месячные" Required="1" />
    <Choice Name="MenstruationVolume" Description="Обьем менструаций">
      <Item Name="Умеренные" Index="0" />
      <Item Name="Обильные" Index="1" />
      <Item Name="Скудные" Index="2" />
    </Choice>
    <Attribute Name="FeaturesMens" Type="string" Description="Особенности менструаций" CharacterMaximumLength="4096" />
    <Attribute Name="LastMenstruationDate" Type="date" Description="Дата последней менструации" />
    <Attribute Name="FetalFirstMovementsDate" Type="date" Description="Дата первого шевеления плода" />
    <Attribute Name="MaternityLeaveFrom" Type="date" Description="Декретный отпуск с" />
    <Attribute Name="Height" Type="int" Description="Рост (см)" />
    <Attribute Name="BMI" Type="float" Description="Индекс массы телы при первоя явке (кг/м2)" />
    <Attribute Name="LastFgDate" Type="date" Description="Дата последней флюорографии" />
    <Attribute Name="LastFgResult" Type="string" Description="Результат последней флюорографии" />
    <Attribute Name="RepeatedPregnancy" Type="bool" Description="Повторная беременность" Required="1" />
    <Choice Name="PregnancyType" Description="Тип наступления беременности">
      <Item Name="Спонтанно" Index="0" />
      <Item Name="Индуцирована" Index="1" />
      <Item Name="С помощью ВРТ" Index="2" />
    </Choice>
    <Attribute Name="PregravidPreparation" Type="string" Description="Предгравидарная подготовка" />
    <Attribute Name="UpcomingChildBirth" Type="bool" Description="Предстоящие роды являются повторными" Required="1" />
    <Attribute Name="MultiplePregnancy" Type="bool" Description="Многоплодность" Required="1" />
    <Attribute Name="FetusCount" Type="int" Description="Количество плодов" />
    <Attribute Name="FirstUSIDate" Type="date" Description="Дата первого УЗИ" />
    <Attribute Name="FatherFIO" Type="string" Description="ФИО отца" />
    <Attribute Name="FatherSpeciality" Type="string" Description="Специальность отца" />
    <Attribute Name="FatherPhone" Type="string" Description="Номер телефона отца" />
    <Attribute Name="FatherAge" Type="int" Description="Возраст отца" />
    <Attribute Name="FatherAnotherInfections" Type="string" Description="Другие социально значимые инфекции отца" />
    <Attribute Name="FatherChronicDisease" Type="string" Description="Хронические заболевания отца" />
    <Attribute Name="FatherFluorograohyDate" Type="date" Description="Дата флюорографии отца" />
    <Attribute Name="FatherFluorographyResult" Type="string" Description="Результат флюорографии отца" />
    <Attribute Name="FatherHealthStatus" Type="string" Description="Состояние здоровья отца" />
    <Attribute Name="FatherHeight" Type="int" Description="Рост отца" />
    <Attribute Name="FatherHeredity" Type="string" Description="Наследственность отца" />
    <Choice Name="FatherBadHabits" IsFlag="1" Description="Вредные привычки отца">
      <Item Name="Отрицает" Index="1" />
      <Item Name="Табакокурение" Index="2" />
      <Item Name="Алкоголь" Index="4" />
      <Item Name="Наркотики" Index="8" />
    </Choice>
    <Parent Name="FatherRhesusFactor" Type="VCLib.ENUMS" Description="Резус-фактор отца" EnumType="Rhesus_factor" />
    <Choice Name="FatherVaccinations" IsFlag="1" Description="Сведения о прививках отца">
      <Item Name="Отрицает" Index="1" />
      <Item Name="Столбняк" Index="2" />
      <Item Name="Дифтерия" Index="4" />
      <Item Name="Корь" Index="8" />
      <Item Name="Краснуха" Index="16" />
      <Item Name="Грипп" Index="32" />
    </Choice>
    <Choice Name="FatherSociallySignificantInfections" IsFlag="1" Description="Социально значимые инфекции отца">
      <Item Name="Отрицает" Index="1" />
      <Item Name="ВИЧ" Index="2" />
      <Item Name="Туберкулез" Index="4" />
      <Item Name="Гепатит В" Index="8" />
      <Item Name="Гепатит С" Index="16" />
      <Item Name="Сифилис" Index="32" />
      <Item Name="Другое" Index="64" />
    </Choice>
    <Attribute Name="FatherSTI" Type="string" Description="ИППП отца" />
    <Attribute Name="FatherWeight" Type="int" Description="Вес отца (кг)" />
    <Attribute Name="FatherWorkplace" Type="string" Description="Место работы отца" />
    <Attribute Name="PerinatalCardDate" Type="date" Description="Дата получения обменной карты" />
    <Attribute Name="ARTAttemptNumber" Type="int" Description="Номер попытки ВРТ" />
    <Choice Name="EmbryoTransfer" Description="Перенос эмбрионов">
      <Item Name="Нативного" Index="0" />
      <Item Name="Криоконсервированного" Index="1" />
    </Choice>
    <Attribute Name="EmbryoTransferDate" Type="date" Description="Дата переноса эмбрионов" />
    <Attribute Name="EmbryoTransferCount" Type="int" Description="Число перенесенных эмбрионов" />
    <Attribute Name="DonorsAge" Type="int" Description="Возраст матери/донора на дату криоконсервации" />
    <Parent Name="PregnantDispanserisation" Type="AKUZ.PREGNANT_DISPANSERISATION" Description="Диспансерное наблюдение за беременной" Required="1" />
    <Attribute Name="PregnancyTermWeek" Type="int" Description="Срок первого УЗИ (нед.)" />
    <Attribute Name="FirstMenstruation" Type="int" Description="Первая менструация (лет)" />
    <Attribute Name="MensesEstablished" Type="int" Description="Менструации установились через (мес.)" />
    <Attribute Name="SexualLife" Type="int" Description="Половая жизнь с (лет)" />
    <Attribute Name="Hemotranfusion" Type="string" Description="Информация о гемотрансфузиях со слов пациентки" />
    <Attribute Name="FirstWeight" Type="float" Description="Вес при первой явке" NumericPrecision="4" NumericScale="1" />
    <Attribute Name="PregnancyTermDays" Type="int" Description="Срок первого УЗИ (дн.)" />
    <Attribute Name="FirstAppearenceTermDays" Type="int" Description="Срок первой яыяки (дн.)" />
    <Attribute Name="EstimatedConceptionDateByUSI" Type="datetime" Description="Предполагаемая дата зачатия (по УЗИ)" />
    <Attribute Name="FirstBMI" Type="float" Description="ИМТ при первой явке (кг/м2)" />
    <Attribute Name="FatherBMI" Type="float" Description="ИМТ отца (кг/м2)" />
    <Attribute Name="FatherBloodGroupDate" Type="date" Description="Дата определения группы крови отца" />
    <Attribute Name="BloodGroupDate" Type="date" Description="Дата определения группы крови" />
    <Attribute Name="DistantiaSpinarum" Type="int" Description="Distantia spinarum" />
    <Attribute Name="DistantiaCristarum" Type="int" Description="Distantia cristarum" />
    <Attribute Name="DistantiaTrochanterica" Type="int" Description="Distantia trochanterica" />
    <Attribute Name="ConjugataExterna" Type="int" Description="Conjugatа externa" />
    <Attribute Name="SolovyovIndex" Type="float" Description="Индекс Соловьева" NumericPrecision="4" NumericScale="1" />
    <Attribute Name="ConjugateVera" Type="int" Description="Conjugate vera" />
    <Attribute Name="ConjugataDiagonalis" Type="int" Description="Conjugata diagonalis" />
    <Attribute Name="MichaelisDiamondHorizontal" Type="int" Description="Ромб Михаэлиса поперечное измерение" />
    <Attribute Name="MichaelisDiamondVertical" Type="int" Description="Ромб Михаэлиса вертикальное измерение" />
    <Attribute Name="ExtraPelvicDimension" Type="string" Description="Дополнительные размеры таза (по показаниям)" />
    <Attribute Name="NoLastFgInformation" Type="bool" Description="Неи данных о последней флюорографии" Required="1" />
  </Fields>
  <DbMapping>
    <Table name="T_WOMENS_CONSULTATION">
      <Map Name="WomensConsultationID" Column="WomensConsultationID" />
      <Map Name="LpuMain" Column="LpuMain" />
      <Map Name="FirstAppearenceTerm" Column="FirstAppearenceTerm" />
      <Map Name="FirstAppearenceDate" Column="FirstAppearenceDate" />
      <Map Name="Mkb" Column="Mkb" />
      <Map Name="Diagnosis" Column="Diagnosis" />
      <Map Name="FatherBloodGroup" Column="FatherBloodGroup" />
      <Map Name="MenstruationRegularity" Column="MenstruationRegularity" />
      <Map Name="MenstruationDuration" Column="MenstruationDuration" />
      <Map Name="MenstruationPain" Column="MenstruationPain" />
      <Map Name="RegularMens" Column="RegularMens" />
      <Map Name="MenstruationVolume" Column="MenstruationVolume" />
      <Map Name="FeaturesMens" Column="FeaturesMens" />
      <Map Name="LastMenstruationDate" Column="LastMenstruationDate" />
      <Map Name="FetalFirstMovementsDate" Column="FetalFirstMovementsDate" />
      <Map Name="MaternityLeaveFrom" Column="MaternityLeaveFrom" />
      <Map Name="Height" Column="Height" />
      <Map Name="BMI" Column="BMI" />
      <Map Name="LastFgDate" Column="LastFgDate" />
      <Map Name="LastFgResult" Column="LastFgResult" />
      <Map Name="RepeatedPregnancy" Column="RepeatedPregnancy" />
      <Map Name="PregnancyType" Column="PregnancyType" />
      <Map Name="PregravidPreparation" Column="PregravidPreparation" />
      <Map Name="UpcomingChildBirth" Column="UpcomingChildBirth" />
      <Map Name="MultiplePregnancy" Column="MultiplePregnancy" />
      <Map Name="FetusCount" Column="FetusCount" />
      <Map Name="FirstUSIDate" Column="FirstUSIDate" />
      <Map Name="FatherFIO" Column="FatherFIO" />
      <Map Name="FatherSpeciality" Column="FatherSpecialty" />
      <Map Name="FatherPhone" Column="FatherPhone" />
      <Map Name="FatherAge" Column="FatherAge" />
      <Map Name="FatherAnotherInfections" Column="FatherAnotherInfections" />
      <Map Name="FatherChronicDisease" Column="FatherChronicDisease" />
      <Map Name="FatherFluorograohyDate" Column="FatherFluorograohyDate" />
      <Map Name="FatherFluorographyResult" Column="FatherFluorographyResult" />
      <Map Name="FatherHealthStatus" Column="FatherHealthStatus" />
      <Map Name="FatherHeight" Column="FatherHeight" />
      <Map Name="FatherHeredity" Column="FatherHeredity" />
      <Map Name="FatherBadHabits" Column="FatherBadHabits" />
      <Map Name="FatherRhesusFactor" Column="FatherRhesusFactor" />
      <Map Name="FatherVaccinations" Column="FatherVaccinations" />
      <Map Name="FatherSociallySignificantInfections" Column="FatherSociallySignificantInfections" />
      <Map Name="FatherSTI" Column="FatherSTI" />
      <Map Name="FatherWeight" Column="FatherWeight" />
      <Map Name="FatherWorkplace" Column="FatherWorkplace" />
      <Map Name="PerinatalCardDate" Column="PerinatalCardDate" />
      <Map Name="ARTAttemptNumber" Column="ARTAttemptNumber" />
      <Map Name="EmbryoTransfer" Column="EmbryoTransfer" />
      <Map Name="EmbryoTransferDate" Column="EmbryoTransferDate" />
      <Map Name="EmbryoTransferCount" Column="EmbryoTransferCount" />
      <Map Name="DonorsAge" Column="DonorsAge" />
      <Map Name="PregnantDispanserisation" Column="PregnantDispanserisation" />
      <Map Name="PregnancyTermWeek" Column="PregnancyTermWeek" />
      <Map Name="FirstMenstruation" Column="FirstMenstruation" />
      <Map Name="MensesEstablished" Column="MensesEstablished" />
      <Map Name="SexualLife" Column="SexualLife" />
      <Map Name="Hemotranfusion" Column="Hemotranfusion" />
      <Map Name="FirstWeight" Column="FirstWeight" />
      <Map Name="PregnancyTermDays" Column="PregnancyTermDays" />
      <Map Name="FirstAppearenceTermDays" Column="FirstAppearenceTermDays" />
      <Map Name="EstimatedConceptionDateByUSI" Column="EstimatedConceptionDateByUSI" />
      <Map Name="FatherBloodGroupDate" Column="FatherBloodGroupDate" />
      <Map Name="BloodGroupDate" Column="BloodGroupDate" />
      <Map Name="DistantiaSpinarum" Column="DistantiaSpinarum" />
      <Map Name="DistantiaCristarum" Column="DistantiaCristarum" />
      <Map Name="DistantiaTrochanterica" Column="DistantiaTrochanterica" />
      <Map Name="ConjugataExterna" Column="ConjugataExterna" />
      <Map Name="SolovyovIndex" Column="SolovyovIndex" />
      <Map Name="ConjugateVera" Column="ConjugateVera" />
      <Map Name="ConjugataDiagonalis" Column="ConjugataDiagonalis" />
      <Map Name="MichaelisDiamondHorizontal" Column="MichaelisDiamondHorizontal" />
      <Map Name="MichaelisDiamondVertical" Column="MichaelisDiamondVertical" />
      <Map Name="ExtraPelvicDimension" Column="ExtraPelvicDimension" />
      <Map Name="PregnancyTermByMenses" Column="PregnancyTermByMenses" />
      <Map Name="PregnancyTermByMensesDays" Column="PregnancyTermByMensesDays" />
      <Map Name="PregnancyTermByUSIDays" Column="PregnancyTermByUSIDays" />
      <Map Name="PregnancyTermByUSIWeeks" Column="PregnancyTermByUSIWeeks" />
      <Map Name="NoLastFgInformation" Column="NoLastFgInformation" />
    </Table>
    <Lexem>
      <Map Name="FirstBMI">
        <lx:MathOperator sign="/" xmlns:lx="lexem">
          <lx:Path OwnerQueryLevel="0">
            <lx:StepString name="FirstWeight" />
          </lx:Path>
          <lx:MathOperator sign="/">
            <lx:MathOperator sign="*">
              <lx:Path OwnerQueryLevel="0">
                <lx:StepString name="Height" />
              </lx:Path>
              <lx:Path OwnerQueryLevel="0">
                <lx:StepString name="Height" />
              </lx:Path>
            </lx:MathOperator>
            <lx:ConstOperand type="Int32">10000</lx:ConstOperand>
          </lx:MathOperator>
        </lx:MathOperator>
      </Map>
      <Map Name="FatherBMI">
        <lx:MathOperator sign="/" xmlns:lx="lexem">
          <lx:Path OwnerQueryLevel="0">
            <lx:StepString name="FatherWeight" />
          </lx:Path>
          <lx:MathOperator sign="/">
            <lx:MathOperator sign="*">
              <lx:Path OwnerQueryLevel="0">
                <lx:StepString name="FatherHeight" />
              </lx:Path>
              <lx:Path OwnerQueryLevel="0">
                <lx:StepString name="FatherHeight" />
              </lx:Path>
            </lx:MathOperator>
            <lx:ConstOperand type="Int32">10000</lx:ConstOperand>
          </lx:MathOperator>
        </lx:MathOperator>
      </Map>
    </Lexem>
  </DbMapping>
  <CalculatingAttributes>
    <Attribute Name="PregnancyTermByMenses" Type="int" Description="Срок беременности по последней менструации (нед.)" RequiredAttributes="{LastMenstruationDate}" />
    <Attribute Name="PregnancyTermByMensesDays" Type="int" Description="Срок беременности по последней менструации (дн.)" RequiredAttributes="{LastMenstruationDate}" />
    <Attribute Name="PregnancyTermByUSIDays" Type="int" Description="Срок беременности по УЗИ (дн.)" RequiredAttributes="{PregnancyTermDays}" />
    <Attribute Name="PregnancyTermByUSIWeeks" Type="int" Description="Срок беременности по УЗИ (нед.)" RequiredAttributes="{PregnancyTermWeek}" />
  </CalculatingAttributes>
</Entity>