UPDATE RDS.T_DRUG_APPLICATION_LIST_ITEM d
SET Preparation = TRIM(
    COALESCE(
        (SELECT TRIM(NameRus) || ' ' FROM PHARM.T_C_TRN WHERE CTrnID = d.CTrn),
        (SELECT TRIM(NameRus) || ' ' FROM PHARM.T_C_MNN WHERE CMnnID = d.CMnn),
        ''
    ) ||
    COALESCE(
        (SELECT TRIM(Name) || ' ' FROM PHARM.T_MEDICATION_FORMS
         WHERE MedicationFormsID = d.MedicationForms
         AND TRIM(COALESCE(Name, '')) <> ''),
        ''
    ) ||
    TRIM(COALESCE(
        (SELECT Value FROM RDS.S_DLO_DoseView WHERE Id = d.DoseView),
        ''
    ))
)
WHERE (d.Preparation IS NULL OR TRIM(COALESCE(d.Preparation, '')) = '');