I think the question here might not be to do with changing codes, but rather “why isn’t there a resource that gives me all the medications”.
The answer to that one is that that’s not the way resources typically work in a RESTful interface. But there is still a way to get what you want.
A single resource instance - with a URL ending in "/id" - represents one concept, e.g. one medication, with that id.
You can use the resource endpoint with no id to get all resources.
That will get all resources of type "someresource" - but it is not bound to one patient.
What you want is a resource that has all the medication for one patient. That is not a standard CRUD action on a single resource type.
There are other concepts such as the List resource which is a container for other resources. That is closer to what you are looking for.
And in fact if you want current medication, the correct way to implement this is to use one of the predefined list "operations":
The $current-medications operation gets all the medication resources that the system (by its own rules), considers "current", for a given patient.
An operation is an endpoint that is somewhat like a resource (a “pseudo-resource” perhaps), but actually does some extra processing beyond simple CRUD, and can return a set of resources.
Not all systems will implement this, but it might be a good idea if GP systems did.