select t.ExtDirectionLab_id as "ExtDirectionLab_id",
t.ExtDirectionLab_Num as "ExtDirectionLab_Num",
t.ExtDirectionLab_Date as "ExtDirectionLab_Date",
t.ExtLpu_id as "ExtLpu_id",
t.MedService_id as "MedService_id",
t.ExtDirectionLab_IsTransfBioMaterial as "ExtDirectionLab_IsTransfBioMaterial",
t.ExtDirectionLab_IsTransfAllService as "ExtDirectionLab_IsTransfAllService",
t.ExtDirectionLab_PatientFIO as "ExtDirectionLab_PatientFIO",
t.ExtDirectionLab_PatientBirthDay as "ExtDirectionLab_PatientBirthDay",
t.ExtDirectionLab_MedPersonalFIO as "ExtDirectionLab_MedPersonalFIO",
t.ExtDirectionLab_IsFail as "ExtDirectionLab_IsFail",
t.ExtDirectionLab_Result as "ExtDirectionLab_Result",
to_char(t.ExtDirectionLab_Date, 'dd.mm.yyyy') as "ExtDirectionLab_Date_DDMMYYYY"
  from integra.ExtDirectionLab t
 left join dbo.v_MedService t1 on t.MedService_id = t1.MedService_id
left join integra.v_ExtLpu t2 on t.ExtLpu_id = t2.ExtLpu_id
 where t.ExtDirectionLab_Num = '38140134574444554'
