<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>Направление</title>
</head>
<body>
    <!-- %%#xsl:if lexem='{ObjectProperties / ObjectTypeID} IS "AKUZ.ROUTE_TO_DOCTOR_INSPECTION"'%% -->
    <table style="border: 0px; border-collapse: collapse">
        <tr>
            <td style="padding-bottom: 60px; padding-left: 30px; padding-top: 30px; width: 50%; border: 0px; vertical-align: top">
                <table style="border: 0px">
                    <tr>
                        <td style="border: 0px; font-weight: bold; text-align: center; font-size: 15px" colspan="2">
                            Направление пациента на консультацию, <br>диагностическое исследование и лечение №%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / As AKUZ.ROUTE_RECORD / As AKUZ.ROUTE_TO_DOCTOR_INSPECTION / Number}%% <br>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                Наименование ЛПУ, направившее пациента
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div>
                                <span style="text-align: center">%%{AmbulanceEvent / AmbulanceCard / Patient / cRegistration / LpuMain / Name}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                Наименование ЛПУ, куда направлен пациент
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div>
                                <span style="text-align: center">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / As AKUZ.ROUTE_RECORD / PerformerLpu / Name}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                Специальность
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div>
                                <span style="text-align: center">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / As AKUZ.ROUTE_RECORD / As AKUZ.ROUTE_TO_DOCTOR_INSPECTION / Speciality / Name}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; text-align: left; font-size: 14px; font-weight: bold">Ф.И.О пациента:</td>
                        <td style="border: 0px; text-align: left; font-size: 16px; font-weight: normal">
                            <span>%%{AmbulanceEvent/AmbulanceCard/Patient/FIO}%%</span>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; width: 50%; text-align: left; font-weight: bold">
                            Пол:  <span style="font-size: 16px; font-weight: normal">%%{AmbulanceEvent/AmbulanceCard/Patient/Sex/Name}%%</span>
                        </td>
                        <td style="border: 0px; width: 50%; text-align: left; font-weight: bold">
                            Дата рождения:  <span style="font-size: 16px; font-weight: normal">%%{AmbulanceEvent/AmbulanceCard/Patient/Birthday}%%</span>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold" colspan="2">
                            Адрес (места жительства и (или) места прописки): <br>
                            <span style="text-align: left; font-weight: normal">%%{AmbulanceEvent/AmbulanceCard/Patient/AddressReal/Address}%%</span>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold" colspan="2">
                            Полис:
                            <span style="text-align: left; font-weight: normal">%%{AmbulanceEvent / AmbulanceCard / Patient / OmsPolicy / DisplayName}%%</span>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold" colspan="2">
                            Цель направления:
                            <span style="text-align: left; font-weight: normal">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / RefferalComment}%%</span>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold" colspan="2">
                            Диагноз:
                            <span style="text-align: left; font-weight: normal">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / Mkb}%%. %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / Diagnosis}%%</span>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold" colspan="2">
                            ФИО и должность лечащего врача: %%{Post / Worker / FIO}%%,%%{Post / PostType / Name}%% <br>
                            Зам. гл. врача по КЭР (председатель врачебной комиссии)<br>
                        </td>
                    </tr>
                    <td style="border: 0px">
                        <span style="text-align: left; font-weight: bold">Печать</span>
                    </td>
                    <td style="border: 0px">
                        <span style="text-align: left; font-weight: bold">Дата: %%{RecordDate}%%</span>
                    </td>
        </tr>
    </table>
    </td>
    </tr>
    </table>
    <!-- %%#xsl:end%% -->
    <!-- %%#xsl:if lexem='{ObjectProperties / ObjectTypeID} IS "AKUZ.ROUTE_TO_DIAGNOSTICS"'%% -->
    <table style="border: 0px; border-collapse: collapse">
        <tr>
            <td style="width: 50%; border: 0px; vertical-align: top; border-collapse: collapse; font-size: 14px">
                <table style="border: 0px; border-collapse: collapse">
                    <tr>
                        <td style="border:1px solid black; text-align: center; font-weight: bold; border-collapse: collapse; font-size: 14px" colspan="2">
                            <!-- ЛПУ: %%{ AmbulanceEvent / AmbulanceCard / Patient / cRegistration / LpuMain / Name}%% -->
                            %%{ AmbulanceEvent / AmbulanceCard / CardLpu / Name}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 50%; border-collapse: collapse; border:1px solid black; font-size: 14px">
                            <div style="float: left">
                                Дата назначения: <span style="font-weight: bold">%%{As AKUZ.PRESCRIPTION_RECORD / RouteDate}%%</span>
                            </div>
                        </td>
                        <td style="border-collapse: collapse; border:1px solid black; font-size: 14px">
                            <div style="float: left">
                                Приоритет: <span style="font-weight: bold">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / Priority}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="border-collapse: collapse; text-align: center; font-weight: bold; font-size: 16px; border:1px solid black; font-size: 14px">
                            Направление на исследование. Код № %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / As AKUZ.ROUTE_RECORD / As AKUZ.ROUTE_TO_DIAGNOSTICS / Research / Code}%% %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / As AKUZ.ROUTE_RECORD / As AKUZ.ROUTE_TO_DIAGNOSTICS / Research/Name}%%
                        </td>
                    </tr>
                    <tr style="">
                        <td style="border-collapse: collapse; border-right: 0px; font-size: 14px">
                            № направления: %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / As AKUZ.ROUTE_RECORD / As AKUZ.ROUTE_TO_DIAGNOSTICS / NumberDirection}%%
                        </td>
                        <td style="border-collapse: collapse; border-left: 0px; text-align: center; font-size: 14px">
                            <span style="font-family: 'Code 128'; font-size: 40px">%%BarCode("Code128",{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / As AKUZ.ROUTE_RECORD / As AKUZ.ROUTE_TO_DIAGNOSTICS / NumberDirection})%%</span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="border-collapse: collapse; border:1px solid black; font-size: 14px">
                            № карты пациента: <span style="font-weight: bold">%%{AmbulanceEvent / AmbulanceCard / Number}%%</span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="border-collapse: collapse; border:1px solid black; font-size: 14px">
                            Отделение: %%{Post / Division / Name}%%
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="border-collapse: collapse; border:1px solid black; font-size: 14px">
                            ФИО и должность лечащего врача: %%{Post / Worker / FIO}%%,%%{Post / PostType / Name}%%
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="border-collapse: collapse; border:1px solid black; font-size: 14px">
                            ФИО пациента: <span style="font-weight: bold">%%{ AmbulanceEvent /AmbulanceCard/Patient/FIO}%%</span>
                        </td>
                    </tr>
                    <tr>
                        <td style="border-collapse: collapse; border:1px solid black; font-size: 14px">
                            Пол: <span style="font-weight: bold; font-size: 14px">%%{ AmbulanceEvent /AmbulanceCard/Patient/Sex/Name}%%</span>
                        </td>
                        <td style="border-collapse: collapse; border:1px solid black; font-size: 14px">
                            Дата рождения: <span style="font-weight: bold">%%{ AmbulanceEvent /AmbulanceCard/Patient/Birthday}%%</span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="border-collapse: collapse; border:1px solid black; font-size: 14px">
                            Адрес (места жительства и (или) места прописки): <span style="font-weight: bold">%%{ AmbulanceEvent/AmbulanceCard/Patient/AddressReal/Address}%%</span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="border-collapse: collapse; border:1px solid black; font-size: 14px">
                            Диагноз: <span style="font-weight: bold">
                                %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / Mkb}%%. %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / Diagnosis}%%
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="border-collapse: collapse; border:1px solid black; font-size: 14px">
                            Цель исследования:  %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / RefferalComment}%%
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <!-- %%#xsl:if lexem='{ObjectTypeID} IS "AKUZ.ROUTE_TO_DIAGNOSTICS"'%% -->
                        </td>
                    </tr>
                    <tr>
                        <td style="border-collapse: collapse; border:1px solid black; font-size: 14px" colspan="2">
                            %%ChildCount({As AKUZ.ROUTE_TO_DIAGNOSTICS / SelectedAnalysis}, Joint({Name}, ", "), {TreeLevel} > 1 And (!ChildExists({As AKUZ.ROUTE_TO_DIAGNOSTICS / SelectedAnalysisCodess}) Or ChildExists({As AKUZ.ROUTE_TO_DIAGNOSTICS / SelectedAnalysisCodess}) And {TreeLevel} < 3))%%
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <!--%%#xsl:end%%-->
                        </td>
                    </tr>
                    <tr>
                        <td style="border-collapse: collapse; border:1px solid black; font-size: 14px">
                            Дата: <span style="font-weight: bold">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / EntryAmbulance/EntryDate}%%</span><br />
                            Время записи: <span style="font-weight: bold">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD /  EntryAmbulance/TimeOrTurn}%%</span>
                        </td>
                        <td style="border-collapse: collapse; border:1px solid black; font-size: 14px">
                            Врач: <span style="font-weight: bold">%%{Post / Worker / FIO}%%</span>
                        </td>
                    </tr>
                    <tr>
                        <td style="border-collapse: collapse; border:1px solid black; font-size: 14px" colspan="2">
                            Подпись:
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!-- %%#xsl:end%% -->
    <!-- %%#xsl:if lexem='{ObjectProperties / ObjectTypeID} IS "AKUZ.REK_REFFERAL"'%% -->
    <table style="border: 0px; border-collapse: collapse">
        <tr>
            <td style="padding-bottom: 60px; padding-left: 30px; padding-top: 30px; width: 50%; border: 0px; vertical-align: top">
                <table style="border: 0px">
                    <tr>
                        <td style="border: 0px; font-weight: bold; text-align: center; font-size: 15px" colspan="2">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.REFERRAL / As AKUZ.REK_REFFERAL / Lpu / OGRNCode}%%, %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.REFERRAL / As AKUZ.REK_REFFERAL / Lpu / Name}%%, %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.REFERRAL / As AKUZ.REK_REFFERAL / Lpu / AddressString}%%  <br>
                            <span style="font-size: 9px">(ОГРН, наименование,  адрес медицинской организации)</span>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold; text-align: center; font-size: 15px; padding-top: 20px" colspan="2">
                            Направление на ВК
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px; padding-top: 20px">
                                Дата направления:
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div style="padding-top: 20px">
                                <span style="text-align: center; font-size:14px">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.REFERRAL / ReferralDate}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                Фамилия, имя, отчество пациента:
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div>
                                <span style="text-align: center">%%{AmbulanceEvent / AmbulanceCard / Patient / FIO}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                Пол:
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div>
                                <span style="text-align: center">%%{ AmbulanceEvent / AmbulanceCard / Patient / Sex / Name}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                Дата рождения:
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div>
                                <span style="text-align: center">%%{ AmbulanceEvent / AmbulanceCard / Patient / Birthday}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                Место постоянного  жительства (регистрации):
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div>
                                <span style="text-align: center">%%{ AmbulanceEvent / AmbulanceCard / Patient / AddressReal / DisplayName}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold; text-align: left; font-size: 15px; padding-top: 20px" colspan="2">
                            Страховой полис ОМС:
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                Серия:
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div>
                                <span style="text-align: center">%%{AmbulanceEvent/AmbulanceCard/Patient/PolicyOMS/Serial}%% </span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                Номер:
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div>
                                <span style="text-align: center">%%{AmbulanceEvent/AmbulanceCard/Patient/PolicyOMS/Number}%% </span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                СМО:
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div>
                                <span style="text-align: center">%%{ AmbulanceEvent / AmbulanceCard / Patient / OmsPolicy / InsuranceCompany / ShortName}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                СНИЛС:
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div>
                                <span style="text-align: center">%%{AmbulanceEvent / AmbulanceCard / Patient / SNILS / SnilsID}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="padding-top: 20px; font-weight: bold; font-size: 14px">
                                Основной диагноз МКБ:
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div style="padding-top: 20px">
                                <span style="text-align: center">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.REFERRAL / MkbCode}%% %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.REFERRAL / Diagnosis}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                Сопутствующий диагноз МКБ:
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div>
                                <span style="text-align: center">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.REFERRAL / As AKUZ.REK_REFFERAL / AccompanyMkb}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="padding-top: 20px; font-weight: bold; font-size: 14px">
                                Вид экспертизы:
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div>
                                <span style="padding-top: 20px; text-align: center"><br>%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.REFERRAL / As AKUZ.REK_REFFERAL / EventPurpose}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                Подробное описание:
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div>
                                <span style="text-align: center">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.REFERRAL / As AKUZ.REK_REFFERAL / ExspertiseDesrc}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <td colspan="2" style="border: 0px; padding-top: 60px">
                        Врач: %%{Post / Worker / FIO}%%
                    </td>
                </table>
            </td>
        </tr>
    </table>
    <!-- %%#xsl:end%% -->
    <!-- %%#xsl:if lexem='{ObjectProperties / ObjectTypeID} IS "AKUZ.REPEATED_PRESCRIPTION_RECORD"'%% -->
    <table style="border: 0px; border-collapse: collapse">
        <tr>
            <td style="padding-bottom: 70px; padding-left: 30px; padding-top: 20px; border: 0px; vertical-align: top">
                <table style="border: 0px">
                    <tr>
                        <td style="border: 0px; font-weight: bold; text-align: center; font-size: 15px" colspan="2">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / Resource / Division / Name}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold; text-align: center; font-size: 15px; padding-top: 10px" colspan="2">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD /  Resource / Division / Branch / LpuMain / Name}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px;">
                            <div style="font-weight: bold; font-size: 14px; padding-top: 10px">
                                Номер очереди на прием к врачу
                            </div>
                        </td>
                        <td style="border: 0px;">
                            <div style="padding-top: 10px">
                                <span style="text-align: center; font-weight: normal; font-size:14px">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / EntryAmbulance / Ticket / Number}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px;">
                            <div style="font-weight: bold; font-size: 14px">
                                Номер кабинета
                            </div>
                        </td>
                        <td style="border: 0px;">
                            <div>
                                <span style="text-align: center; font-weight: normal">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / EntryAmbulance / Ticket / WorkScheduleItem / Place / PlaceDescription}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px;">
                            <div style="font-weight: bold; font-size: 14px">
                                Дата приема
                            </div>
                        </td>
                        <td style="border: 0px;">
                            <div>
                                <span style="text-align: center; font-weight: normal">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / EntryAmbulance / EntryDate}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px;">
                            <div style="font-weight: bold; font-size: 14px">
                                Время приема
                            </div>
                        </td>
                        <td style="border: 0px;">
                            <div>
                                <span style="text-align: center; font-weight: normal">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / EntryAmbulance / TimeOrTurn}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px;">
                            <div style="font-weight: bold; font-size: 14px">
                                %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / Resource / Speciality / DisplayName }%%
                            </div>
                        </td>
                        <td style="border: 0px;">
                            <div>
                                <span style="text-align: center; font-weight: normal">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / Resource / As AKUZ.POST / Worker / FIO}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <td colspan="2" style="border: 0px; padding-top: 50px">
                        Дата записи: %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / EntryAmbulance / CreationDateTime{ dd.MM.yyyy , HH:mm } }%%
                    </td>
        </tr>
    </table>
    </td>
    </table>
    <!-- %%#xsl:end%% -->
    <!-- %%#xsl:if lexem='{ObjectProperties / ObjectTypeID} IS "AKUZ.HOSPITALIZATION_REFERRAL"'%% -->
    <table style="border: 0px; border-collapse: collapse">
        <tr>
            <td style="padding-left: 20px; padding-top: 10px; width: 50%; border: 0px; vertical-align: top">
                <table style="border: 0px">
                    <tr>
                        <td style="border: 0px; font-weight: bold; text-align: center; font-size: 15px" colspan="4">
                            Направление на госпитализацию в отделение: %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.REFERRAL / Division}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold; text-align: center; font-size: 15px; padding-top: 20px; border-bottom-style: ridge" colspan="4">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.REFERRAL / Lpu}%%<br>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                Фамилия: <span> %%{AmbulanceEvent / AmbulanceCard / Patient / LastName}%%</span>
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                Имя: <span>%%{AmbulanceEvent / AmbulanceCard / Patient / FirstName}%%</span>
                            </div>

                            </div>
                        </td>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                Отчество: <span>%%{AmbulanceEvent / AmbulanceCard / Patient / FatherName}%%</span>
                            </div>

                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px; padding-top: 5px">
                                Возраст: %%{AmbulanceEvent / cPatientAge}%%
                            </div>
                        </td>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px; padding-top: 5px">
                                Дата рождения:<span> %%{AmbulanceEvent / AmbulanceCard / Patient / Birthday}%%</span>
                            </div>
                            <div style="clear: both">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <div style="font-weight: bold; font-size: 14px">
                                Рост_____________см Вес____________кг
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px" colspan="3">
                            <div style="font-size: 14px; padding-top: 5px">
                                Адрес по прописке:<span style="font-weight: bold; font-size: 14px; padding-top: 20px">%%{AmbulanceEvent / AmbulanceCard / Patient / AddressLegal / DisplayName}%%</span>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px" colspan="3">
                            <div style="font-size: 14px; padding-top: 5px">
                                Адрес по проживанию:  <span>%%{AmbulanceEvent / AmbulanceCard / Patient / AddressReal / DisplayName}%%</span>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px" colspan="3">
                            <div style="font-size: 14px; padding-top: 5px">
                                Место работы: %%{AmbulanceEvent / AmbulanceCard / Patient / Job / DisplayName}%%
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px" colspan="3">
                            <div style="font-size: 14px; padding-top: 5px">
                                Диагноз консультативной поликлиники:  %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.REFERRAL / Diagnosis}%%
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px" colspan="3">
                            <div style="font-size: 14px; padding-top: 5px">
                                Шифр МКБ: %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.REFERRAL / MkbCode}%%
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px" colspan="3">
                            <div style="font-size: 14px; padding-top: 5px">
                                Больничный лист: %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.REFERRAL / As AKUZ.HOSPITALIZATION_REFERRAL / MedicalCertificateObtain}%%
                            </div>
                        </td>

                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold; border: 0px" colspan="2">
                            Дата госпитализации: %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.REFERRAL / As AKUZ.HOSPITALIZATION_REFERRAL / HospitalisationDate}%%
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!-- %%#xsl:end%% -->
    <!-- %%#xsl:if lexem='{ObjectProperties / ObjectTypeID} IS "AKUZ.ROUTE_TO_VACCINATION"'%% -->
    <table style="border: 0px; border-collapse: collapse;">
        <tr>
            <td style="padding-bottom: 60px; padding-left: 30px; padding-top: 20px; width: 50%; border: 0px; vertical-align: top">
                <table style="border: 0px; border-collapse: collapse">
                    <tr>
                        <td style="border: 0px; font-weight: bold;text-align: center; padding-bottom: 10px" colspan="2">
                            <span>Направление на вакцинацию</span><br>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Пациент:
                        </td>
                        <td style="border: 0px">
                            %%{AmbulanceEvent / AmbulanceCard / Patient / FIO}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Дата рождения:
                        </td>
                        <td style="border: 0px">
                            %%{AmbulanceEvent / AmbulanceCard / Patient / Birthday}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Пол:
                        </td>
                        <td style="border: 0px">
                            %%{ AmbulanceEvent /AmbulanceCard/Patient/Sex/Name}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Номер амбулаторной карты:
                        </td>
                        <td style="border: 0px">
                            %%{AmbulanceEvent / AmbulanceCard / Number}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Дата назначения:
                        </td>
                        <td style="border: 0px">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / RouteDate}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Тип иммунопрофилактики:
                        </td>
                        <td style="border: 0px">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / As AKUZ.ROUTE_RECORD / As AKUZ.ROUTE_TO_VACCINATION / VaccinationType}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">Вид вакцинопрофилактики:</td>
                        <!-- %%#xsl:if lexem='{ObjectProperties / ObjectTypeID} IS "AKUZ.ROUTE_TO_VACCINATION"'%% -->
                        <td style="border: 0px">
                            %%ChildCount({As AKUZ.ROUTE_TO_VACCINATION / RtvLinkVgs}, Joint({VaccineLibrary / Name}, ","))%%
                        </td>
                        <!--%%#xsl:end%%-->
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold" colspan="2">
                            Комментарии:  %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.PRESCRIPTION_RECORD / RefferalComment}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px" colspan="2">
                            <br><span style="font-weight: bold">Врач:</span> %%{Post / Worker / FIO}%%,%%{Post / PostType / Name}%%
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!-- %%#xsl:end%% -->
    <!-- %%#xsl:if lexem='{ObjectProperties / ObjectTypeID} IS "AKUZ.RECIPE_BASE"'%% -->
    <table style="border: 0px; border-collapse: collapse;">
        <tr>
            <td style="padding-bottom: 60px; padding-left: 30px; padding-top: 20px; width: 50%; border: 0px; vertical-align: top">
                <table style="border: 0px; border-collapse: collapse">
                    <tr>
                        <td style="border: 0px; font-weight: bold;text-align: center" colspan="2">
                            <span>Рецепт</span><br>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Вид льготы:
                        </td>
                        <td style="border: 0px">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.RECIPE_BASE / As AKUZ.RECIPE / Benefits / BenefitViews / Name}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Серия/номер:
                        </td>
                        <td style="border: 0px">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.RECIPE_BASE / Serial}%% %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.RECIPE_BASE / Number}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Дата выписки:
                        </td>
                        <td style="border: 0px">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.RECIPE_BASE / RecipeDate}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Льгота:
                        </td>
                        <td style="border: 0px">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.RECIPE_BASE / As AKUZ.RECIPE / Benefits / BenefitName}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Заболевание:
                        </td>
                        <td style="border: 0px">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.RECIPE_BASE / MKBCode}%% %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.RECIPE_BASE / Diagnosis}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Препарат (МНН):
                        </td>
                        <td style="border: 0px">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.RECIPE_BASE / As AKUZ.RECIPE / As AKUZ.RECIPE_GENERAL / CMnn / NameRus}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Препарат (ТРН):
                        </td>
                        <td style="border: 0px">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.RECIPE_BASE / As AKUZ.RECIPE / As AKUZ.RECIPE_GENERAL / CTrn / NameRus}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">Лек. форма: <span style="border: 0px; font-weight: normal">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.RECIPE_BASE / As AKUZ.RECIPE / MedicationForms / Name}%%</span></td>
                        <td style="border: 0px; font-weight: bold">
                            Дозировка: <span style="border: 0px; font-weight: normal">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.RECIPE_BASE / As AKUZ.RECIPE / Dose}%%</span>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold" colspan="2">
                            Signa: %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.RECIPE_BASE / As AKUZ.RECIPE / Signa}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold" colspan="2">
                            Действителен: %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.RECIPE_BASE / Period}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px" colspan="2">
                            <br><span style="font-weight: bold">Врач:</span> %%{Post / Worker / FIO}%%,%%{Post / PostType / Name}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px" colspan="2">
                            <br><span style="font-weight: bold">Аптека:</span> %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.RECIPE_BASE / As AKUZ.RECIPE / Pharmacy / Name}%%
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!-- %%#xsl:end%% -->
    <!-- %%#xsl:if lexem='{ObjectProperties / ObjectTypeID} IS "AKUZ.MEDICAL_CERTIFICATE"'%% -->
    <table style="border: 0px; border-collapse: collapse;">
        <tr>
            <td style="padding-bottom: 60px; padding-left: 30px; padding-top: 20px; width: 50%; border: 0px; vertical-align: top">
                <table style="border: 0px; border-collapse: collapse">
                    <tr>
                        <td style="border: 0px; font-weight: bold;text-align: center" colspan="4">
                            <span>Лист нетрудоспособности</span><br>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            ФИО пациента:
                        </td>
                        <td style="border: 0px;" colspan="3">
                            %%{AmbulanceCard / Patient / FIO}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Номер АК: <span style="font-weight: normal">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.MEDICAL_CERTIFICATE / MedCardNumber}%%</span>
                        </td>
                        <td style="border: 0px; font-weight: bold">
                            Дата рождения: <span style="font-weight: normal">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.MEDICAL_CERTIFICATE / Birthday}%%</span>
                        </td>
                        <td style="border: 0px; font-weight: bold">
                            Пол: <span style="font-weight: normal">%%{As AKUZ.AMBULANCE_RECORD / As AKUZ.MEDICAL_CERTIFICATE / Sex / Name}%%</span>
                        </td>

                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Дата выдачи ЛН:
                        </td>
                        <td style="border: 0px" colspan="2">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.MEDICAL_CERTIFICATE / MedcertOutDate}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Дата закрытия ЛН:
                        </td>
                        <td style="border: 0px" colspan="2">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.MEDICAL_CERTIFICATE / MedicalCertificateClose / DateClose}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Номер ЛН:
                        </td>
                        <td style="border: 0px" colspan="3">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.MEDICAL_CERTIFICATE / CertificateNumber}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Причина нетрудоспособности:
                        </td>
                        <td style="border: 0px" colspan="3">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.MEDICAL_CERTIFICATE / MedicalCertificatesCauses / Name}%%
                        </td>
                    </tr>

                    <tr>
                        <td style="border: 0px; font-weight: bold">
                            Заболевание:
                        </td>
                        <td style="border: 0px" colspan="3">
                            %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.MEDICAL_CERTIFICATE / MKBCode}%% %%{As AKUZ.AMBULANCE_RECORD / As AKUZ.MEDICAL_CERTIFICATE / Diagnosis}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <br><span style="font-weight: bold">Ответственный врач:</span>
                        </td>
                        <td style="border: 0px" colspan="3">
                            <br>%%{Post / Worker / FIO}%%,%%{Post / PostType / Name}%%
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0px">
                            <br><span style="font-weight: bold">МО:</span>
                        </td>
                        <td style="border: 0px" colspan="3">
                            %%{Post / Division / Branch / LpuMain / Name}%%
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!-- %%#xsl:end%% -->
</body>
</html>

