One way of modeling the data you describe below can be:
In the programs app, make one program(with registration) and tracked entity attributes Name and Age.
In this program, add one repeatable program stage with data elements Name, Dose, Frequency.
In the tracker data entry user interface you might want to try and add the “Tabular data entry” widget in the “show hide widgets” menu at the top right of the screen. This is an alternate way of entering data that might suit your usecase better.