Hi,
Performing a calculation API call with a measurement on the birth date for a baby with a shorter than full term gestation period seems to return a “No reference data exists below 40 weeks gestation”:
https://api.rcpch.ac.uk/growth/v1/trisomy-21/calculation
{
“birth_date”:“2023-01-14”,
“observation_date”:“2023-01-14”,
“observation_value”:45.0,
“measurement_method”:“height”,
“sex”:“male”,
“gestation_weeks”:32,
“gestation_days”:0
}
Returns the following response:
{
“detail”:
[
{
“loc”:
[
“body”
],
“msg”:“No reference data exists below 40 weeks gestation”,
“type”:“value_error”,
“input”:“observation_value”
}
]
}
Another calculation for the same patient for an observation recorded at a later age returns a successful reposnse:
https://api.rcpch.ac.uk/growth/v1/trisomy-21/calculation
{
“birth_date”:“2023-01-14”,
“observation_date”:“2024-07-14”,
“observation_value”:80.0,
“measurement_method”:“height”,
“sex”:“male”,
“gestation_weeks”:32,
“gestation_days”:0
}
Returns the following response:
{
“birth_data”:
{
…
Have I understood the error correctly? What should I do for this case?
I could test that the [observation date] minus [weeks away from 40 weeks gestation] is positive, and if not then do an API call pretending that they are full term. If I did this could I then combine this measurement with other measurements that include gestation adjusted data for chart dispay?
Do API calls that result in errors count towards the number of API calls perfomed in a month?
Is there any documentation listing the different error cases? (Another error case I have found is for turner reference data: “There is no reference data below 1 year.”) . It would be nice to know what they are up-front so I can choose which measurements to skip if I know they will give an errror.
Thanks.