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.
GET [base]/someresource/id
You can use the resource endpoint with no id to get all resources.
GET [base]/someresource
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":
http://hl7.org/fhir/lifecycle.html#current
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.