(1) If, under this chapter the court affirms an order of the department, the person whose liberty is involved may appeal to the proper appellate court for a reversal or modification of the order. The appeal shall be taken as provided by law for appeals to said court from the judgment of an inferior court.(2) At the hearing of an appeal the appellate court may base its judgment upon the record, or it may upon its own motion or at the request of either the appellant or the department refer the matter back for the taking of additional evidence.(3) The appellate court may confirm the order of the lower court, or modify it, or reverse it and order the appellant to be discharged.(4) Pending appeal the appellant shall remain under the control of the department.