(
				select distinct
					mouc.DrugTherapyScheme_id as "DrugTherapyScheme_id"
				from
					v_EvnUsluga eu
					inner join v_MesOldUslugaComplex mouc on mouc.UslugaComplex_id = eu.UslugaComplex_id
					inner join v_MesOld mo on mo.Mes_id = mouc.Mes_id
					inner join v_DrugTherapyScheme dts on dts.DrugTherapyScheme_id = mouc.DrugTherapyScheme_id
				where
					eu.EvnUsluga_pid = '890101013507860'
					and mouc.DrugTherapyScheme_id is not null
					and mouc.MesOldUslugaComplex_begDT <= '2022-01-10'
					and (coalesce(mouc.MesOldUslugaComplex_endDT, '2022-01-10') >= '2022-01-10')
					and (dts.DrugTherapyScheme_begDate is null or dts.DrugTherapyScheme_begDate <= '2022-01-10')
					and (coalesce(dts.DrugTherapyScheme_endDate, '2022-01-10') >= '2022-01-10')
					and mo.MesType_id IN (10,14)
			)
