Which way to get parents'code in concept hierachy with specific url using ValueSet?

Hello everyone,
Here my issue: I am using a ValueSet resource to search multiple “codes” in a specific url. In this case codes are structured in a simple hierarchy like: “code-A” parent of “code-A0”, itself the parent of “code-A0.1” etc…
And when I am searching codes I need to get all “parents’ code” for each one, to be able to print in my application the complete hierarchy path (for example: “code-A/code-A0/code-A0. 1”).
What is the more Fhir resilient and cleanest way to do this?

What is the more Fhir resilient and cleanest way to do this?
I have already found the Valueset parent relationship (Valueset-parent-relationship-codes.json - FHIR v4.0.1) or lookup (Operation-codesystem-lookup - FHIR v4.0.1) way
But I am not sure if this is the correct implementation to get parents’ code… there is another ressource to use?

Thanks in advance.

If the codes exist in a simple hierarchy (i.e. each code has a max of one parent), the ValueSet expansion should automatically be generated in hierarchical form. Otherwise, you’d need to do a lookup on each of the codes - though you could do that as a batch.