About the website

This website is a demonstration of the use of the Demonstrative Diagnosis API to diagnose an animal's condition based on the signs they are presenting."

About the API

The API is a RESTful API that uses a Bayes model to diagnose an animal's condition based on the signs they are presenting. The API is hosted on PythonAnywhere and is written in Python using the Flask framework. Other libraries used include Flask-RESTX , openpyxl and Flask-CORS. The API is documented using Swagger which is automatically generated via Flask-RESTX.

About the website

The website is written in HTML, CSS and JavaScript. The website uses the Bootstrap framework to provide a responsive layout. The website is hosted on Netlify.

A deeper look at the website

To make use of the functionality of the API, I used JavaScript's Fetch API to make requests to the API. The API returns a JSON object which is then parsed and displayed on the page.

I utilise the endpoints provided by the API to get the list of signs and diseases as well as the valid animals. This allows me to dynamically generate the list of signs and diseases on the page. This means that if the API is updated with new signs or diseases, the website will automatically update to reflect this.

I make use of the WikiData IDs provided via the api by creating links to the WikiData page for the sign and disease. This allows the user to learn more about the condition as well as translate it to their native language.

I use JavaScript to dynamically generate the HTML for the page. This allows me to easily change what is on the screen depending on what data I have received from the API calls.

Using Likelihoods

I added the ability to alter likelihoods and perform totally diagnosis quite late into the cycle and as such the website doesn't use that feature. Without designing it myself, it's hard to say what the best way to implement this may be, but possibly using a separate page to edit the priors and likelihood values would be a good idea. This would allow the user to change the likelihoods and priors before providing the sign data on a separate page to keep it readable, as editing a table that is 15 rows long and 15 columns wide would be quite difficult if it was crammed into a single page with the sign data too.