("SoldierWMedic" countType [array__of_units_goes_here]) select 0
("SoldierEMedic" countType [array__of_units_goes_here]) select 0
("SoldierRMedic" countType [array__of_units_goes_here]) select 0
this might work for detectecting the 1st east or west or resistance medic in an array of soldiers. if you want it to return an array of medics take out the select 0 part.
no garaunties if thats right but its something like that
and i reckon i could probabaly script this script just post the exact details and i'll have a good crack at it.