In this MacWorld article it shows a screenshot of Health.app with a section for medications but I can't find it in my Health.app. Was this functionality moved or removed at some point?
You cannot track medications in the Health app in the way you're describing. HealthKit does not have any medication data types. It's possible those screenshots were from an early/preview version of the Health app, but that feature definitely didn't make it into any shipping versions of Health.
When you open the
Health app, look at the bottom row of tab choices. On the far right you'll see one labeled Medical ID:
Tap on that and you should see a screen similar to this image:
Tap Edit on the top right (not shown in the picture above, I'm already in Edit mode). Go down to the Medications section and enter whatever medicine you want in there.
It would seem that medication tracking was moved into CareKit from HealthKit.
"you’ll be able to regularly track your symptoms and medications" CareKit Site at Apple
And at the HealthKit Site, the note on ResearchKit and CareKit at the very bottom of the page:
"giving you tools to track things like your symptoms and medications," HealthKit Site at Apple