You did not say whether there were 9 or 10 players in the lineup. NFHS rules allow for two different types of DH. One is a "traditional" DH similar to MLB, except that the DH can bat for any defensive player (not just the pitcher).
The other is called a "Player/DH" where a player plays defense but also bats for some other defensive player. In this case there would only be 9 players in the lineup.
The PlayerDH is locked into the batting order. And can also play defense. In your example it sounds like the P/DH was batting for the right fielder. This article from South Dakota does a pretty good job explaining the NFHS DH rules.
https://sdumpires.org/uploads/NFHS%20DH%20Rule.pdf