gets multiple medication names per encounter
restructured the sql stuff.