Closed eatyourpeas closed 5 months ago
Thank you for raising this, I will keep an eye on it and will any raise issues to these repos in the future. :) Aurora
Following a discussion I had with @pacharanero on 29-Feb-2024, we have ironed out some further information about what has been observed with this bug that may be useful in finding a fix.
Firstly, the issue we were experiencing was 'Internal Server Error for maternal/paternal height >240.27'. Here is a screenshot of what I was getting in postman when making this call:
As you can see, we get a 500 back which isn't nice for us to process and doesn't align with the expected behaviour set out by the Height, Weight, and OFC calls.
I couldn't find any documentation on validation constants for the maternal and paternal height fields, so I thought I found that it was a limit between 50.00cm and 240.27cm by messing around with the API. However, as you will see further down, I am beginning to think that these are not specified and I just got lucky finding those?
The plot thickens... my colleague Ryan found that it wasn't just because we were passing in a parental height value that exceeded the limit, but because in certain circumstances if the maternal and paternal heights passed to the midparental height API endpoint were such that a centile >100 would be calculated, this is when we would get the 500 returned.
For example, here is an example where we passed in a paternal height greater than 240.27, but the API responded successfully:
And here we pass in values that cause it to break and generate a centile >100:
Discussion with @pacharanero @pacharanero informed us that the team have been working on the server and python package to upgrade the python version and that he has been looking at the validation limits surrounding parental heights to see where this knock-on effect is generating centiles >100.
This may already be fixed in #201 There are actually 2 issues here.
constants
folder in the python package (RCPCHGrowth) where all the calculations actually happen (separate repository and available on pypi) we have taken our thresholds from the guiness book of records. I don't know the exact answer but what we have to my mind is workable. Note the 500 errors you were getting were indeed a bug and a PR is sitting there to close: forgive me for this, just other things in that that need reviewing beforehand such as python version bump etc.I hope that helps.
There is no validation error for heights >250cm and this leads to a 500 error.