Translations:SMS handler setup/8/en
An example of a reply SQL for the OB message:
select format(get_string('OB_reply',sms_userid), dinfo, s.species[1], l.name)
from (
select t.caseid, string_agg(format('%s (%s %s)', d.name, dose, units), ', ') as dinfo
from treatments t
join drugs d on d.id = drug
where t.msgid = sms_msgid group by t.caseid) as dd
left join cadre_reports c on c.id = dd.caseid
left join locations l on l.id = c.locationid
left join species s on s.id = c. speciesid