On a sufficient showing the court may at any time order that the discovery or inspection be denied, restricted, or deferred or may make an order as is appropriate. On the motion of a party, the court may permit the party to make the showing, in whole or in part, in the form of a written statement to be inspected by the judge alone. If the court enters an order granting relief following the ex parte showing, the entire text of the party's statement shall be sealed and preserved in the records of the court to be made available to the appellate court in the event of an appeal.
SDCL 26-7A-72