If the appropriate authority shall refuse or fail to accept temporary custody of said person, or in the event that an action on the indictment, information, or complaint on the basis of which the detainer has been lodged is not brought to trial within the period provided in § 23-24A-3 or 23-24A-14, the appropriate court of the jurisdiction where the indictment, information, or complaint has been pending shall enter an order dismissing the same with prejudice, and any detainer based thereon shall cease to be of any force or effect.
SDCL 23-24A-22