For grouping things in a performant way, you typically want to create a CPT with custom taxonomies. It sounds like lab_test
would work well as a CPT, and you could add a test_panel
custom taxonomy that would group the lab_tests
.
The additional data about the lab_tests
is less straightforward – it really depends on what type of data you need to store about each test. If it’s feasible to capture any or all of this information in a fairly standard set, i.e. you have maybe 20-100 choices for each piece of data, then that would be a good fit for another custom taxonomy. Whenever you are (A) searching by a particular type of data or (B) outputting data from multiple posts on a single URL, if you can use a taxonomy instead of postmeta, it’s much more performant. However, if each test has very unique associated data and you’re going to end up with hundreds of choices for any one type of data, that may mean postmeta would work better than custom taxonomies.
One other thought – if you’re wanting to display all the data about each lab_test
on the test_panel
URLs, then you don’t have to use taxonomies or postmeta at all. You could set up a block template for the lab_test
CPT so that each one is structured the same, and just have each CPT’s full content output on both the individual lab_test
URL and the associated test_panels
. Depending on how creative you get with the markup, you could potentially have the same content each place, but hide some of the data – say with an accordion – on the test_panels
, so it’s all there but only expanded when a user interacts to learn more about an individual lab_test
.