If the court ordering the discharge is not the court that ordered the commitment or admission, the court shall transmit a certified copy of the order to the court that ordered the commitment or admission. Upon receipt of the copy, the court that ordered the commitment or admission shall enter an order finding that the person has been discharged by order of the court that issued the writ of habeas corpus.