The document formalizes a hospital management system (HMS) using Z-notation and UML to enhance its functionality, with a focus on eliminating ambiguities and improving system safety. It describes the methodologies employed, including user authentication and various hospital management processes, and highlights the benefits of the system such as increased efficiency and user-friendliness. The implementation was executed using MATLAB, emphasizing the role of formal specification in addressing critical system requirements.