(a) Except as otherwise provided in this code or rules, all records and information of the department regarding any beneficiary or beneficiary's family members, including food stamps, child support and Medicaid records, are confidential and shall not be released, except under the following circumstances:
(1) If permissible under state or federal rules or regulations;
(2) Upon the express written consent of the beneficiary or his or her legally authorized representative;
(3) Pursuant to an order of any court of record of this state or the United States based upon a finding that the information is sufficiently relevant to a proceeding before the court to outweigh the importance of maintaining the confidentiality established by this section: Provided, That all confidential records and information presented to the court shall after review be sealed by the clerk and shall not be open to any person except upon order of the court upon good cause being shown for the confidential records and information to be opened; or
(4) To a department or division of the state or other entity, pursuant to the terms of an interagency or other agreement: Provided, That any agreement specifically references this section and extends its requirements for confidentiality to the other entity receiving the records or information, its agents and employees.
(b) Any person who knowingly and willfully releases or causes to be released the confidential records and information described in this section, except under the specific circumstances enumerated in this section, is guilty of a misdemeanor and, upon conviction thereof, shall be fined not more than $500 or confined in the county or regional jail for not more than six months, or both.