# How to get the path of an element in java implementation **Category:** [Tools](https://discourse.openehr.org/c/tool-dev/36) **Created:** 2023-04-01 17:25 UTC **Views:** 507 **Replies:** 8 **URL:** https://discourse.openehr.org/t/how-to-get-the-path-of-an-element-in-java-implementation/3792 --- ## Post #1 by @Omar Hello everybody, While trying to do a java main for uploading a COMPOSITION, I have had some problems. I want to give a value to a DV_CODED_TEXT, but for doing that first I need to obtain the path of the element. Is there any function or command that is used that returns that value? ![image|690x284](upload://bgl8VUaKyDdVxua2Rbf5S7xy3t5.png) Thanks, Omar. --- ## Post #2 by @joostholslag Hi Omar, could you share a bit more about your project? Is the Java app your talking about a client app, or are you building/extending a CDR like ehrbase? Are you using Archie library and/or ehrbase sdk? And do you need the path for a specific template? Then the .adl vscode plug-in may be easy. Or do you need to be able to generate any path for any template? --- ## Post #3 by @ian.mcnicoll Another option is to use the Export-> Web template from Archetype Designer, which lists all of the AQL paths for each node. You can also get this format via the Ehrscape API that both Better and EhrBase support. Also in Archetype Designer, look at the Resolved path field. ![image|690x151](upload://btdVEsI2pabLvscJg59ZZVUQxGj.png) or indeed the VsCode plug-in --- ## Post #4 by @Omar Hi Joost, Is a Java app with the purpose to be a client app. I am using the ehrbase sdk. And i need a path to a specific cluster inside a template. Hereafter i paste some pictures of the code and the part of the archetype structure. Can you help me to obtain the path? --- ## Post #5 by @Omar Hi Ian, Yes, I know that i can get the path from the Archetype Designer. In fact, I have mapped that path in a .txt file and afterwards read it in a Java function. The problem is that if I want to automize the process of uploading a COMPOSITION from the SDK, I need to obtain the path that I have indicated above. Do you have any idea in order to obtain it? --- ## Post #6 by @ian.mcnicoll Sorry Omar, Which data point are you trying to populate? It might be helpful if you can share your .opt and explain which data point you are trying to populate? The IdentificationCluster structure is a branch node so there must be some leaf elements inside it. --- ## Post #7 by @joostholslag This is helpful info. I assume ehrbase Sdk may have some feature for that. I’m not familiar with that. So I can’t help. Maybe @birger.haarbrandt. But if archetype designer is not helpful than I can’t help you in another way. Probably others can if you share the .opt code and screenshots. Good luck! --- ## Post #8 by @Omar Hi Ian and Joost, I have solved the problem. I needed to import the next package: **import org.ehrbase.client.annotations.Path;** Now, once I call the function to obtain the path, I am able to obtain it. Thanks a lot for your help!! --- ## Post #9 by @joostholslag Thanks a lot for reporting back. This will help other people in the future! --- **Canonical:** https://discourse.openehr.org/t/how-to-get-the-path-of-an-element-in-java-implementation/3792 **Original content:** https://discourse.openehr.org/t/how-to-get-the-path-of-an-element-in-java-implementation/3792