@@ -29,7 +29,6 @@ def age_calculation(birth_date: datetime, observation_date: datetime, gestation_
2929 click .echo ("Calculates decimal age, either chronological or corrected for gestation if the adjustment flag is true. Params: birth_date, observation_date, gestation_weeks, gestation_days" )
3030 decimal_age = 0
3131 calendar_age = ""
32- print (birth_date )
3332 if adjustment :
3433 decimal_age = date_calculations .corrected_decimal_age (
3534 birth_date = datetime .strptime (birth_date , "%Y-%m-%d" ).date (),
@@ -47,7 +46,7 @@ def age_calculation(birth_date: datetime, observation_date: datetime, gestation_
4746 calendar_age = date_calculations .chronological_calendar_age (
4847 birth_date = datetime .strptime (birth_date , "%Y-%m-%d" ).date (),
4948 observation_date = datetime .strptime (observation_date ,"%Y-%m-%d" ).date ())
50- click .echo (f"{ decimal_age } y,\n { calendar_age } " )
49+ click .echo (f"{ round ( decimal_age , 1 ) } y,\n { calendar_age } " )
5150
5251@click .command ()
5352@click .option ('--reference' , '-r' , default = "uk-who" , show_default = True , type = click .Choice (["uk-who" , "trisomy-21" , "turners-syndrome" ], case_sensitive = True ))
@@ -67,7 +66,7 @@ def sds(reference: str, decimal_age: float, measurement_method: str, observation
6766 sex = sex
6867 )
6968 cent = centile (result )
70- click .echo (f"SDS: { result } \n Centile: { cent } \n " )
69+ click .echo (f"SDS: { round ( result , 3 ) } \n Centile: { round ( cent , 1 ) } % \n " )
7170
7271@click .command ()
7372@click .option ('--reference' , '-r' , default = "uk-who" , show_default = True , type = click .Choice (["uk-who" , "trisomy-21" , "turners-syndrome" ], case_sensitive = True ))
@@ -86,13 +85,13 @@ def measurement(reference: str, decimal_age: float, sex: str, measurement_method
8685 sex = sex ,
8786 age = decimal_age
8887 )
89- cent = centile (result )
88+ cent = centile (sds )
9089 suffix = "cm"
9190 if measurement_method == "weight" :
9291 suffix = "kg"
9392 elif measurement_method == "bmi" :
9493 suffix = "kg/m2"
95- click .echo (f"SDS { sds } \n Centile: { cent } \n { measurement_method } : { result } { suffix } " )
94+ click .echo (f"SDS { sds } \n Centile: { round ( cent , 3 ) } % \n { measurement_method } : { result } { suffix } " )
9695
9796fig = pyfiglet .Figlet (font = "standard" )
9897click .echo (fig .renderText ("RCPCHGrowth" ))
0 commit comments