The dose-to-volume sub-tables in phase and course summary sections are fragile. They only work because the data we parse happens to align BodySite indexes with codexrt-radiotherapy-dose-XX-to-volume extension indexes, where XX is planned or delivered; this, AFAIK, is not a requirement of the IG and can collapse whenever. Ideally, we would be using information on the codexrt-radiotherapy-dose-XX-to-volume's volume extension, using its valueReference to get display information.
For the purposes of a quick proof of concept, this is sufficient, but should be fixed long term.
Resources are not guaranteed to have profile tags so we should be using the code and category codes to determine when a procedure is of interest. Or at the very least not looking for whether it is the first profile in the list but one of the profiles on the resource.