diff --git a/pkg/datasource/database/statistics_query.go b/pkg/datasource/database/statistics_query.go index bac4bee..9ca9ccc 100644 --- a/pkg/datasource/database/statistics_query.go +++ b/pkg/datasource/database/statistics_query.go @@ -104,15 +104,15 @@ func convertIntListToString(intList []int64) string { } /* - * This query will return the numerical values from all observations where - * the patient_num is contained within the list passed as argument (the list is in principle a list of patient from a specific cohort). +* This query will return the numerical values from all observations where +* the patient_num is contained within the list passed as argument (the list is in principle a list of patient from a specific cohort). - TODO In the same way I gathered the schema and table in which the ontology is contained, gather the schema in which observations are contained. - For the moment I hardcode the table and schema. +TODO In the same way I gathered the schema and table in which the ontology is contained, gather the schema in which observations are contained. +For the moment I hardcode the table and schema. - We only keep rows where nval_num is exactly equal to a specific values hence the required value of TVAL_CHAR. - We could keep values which are GE or LE or L or G the problem is that we would need open brackets for intervals. - VALTYPE_CD = 'N' because we only care about numerical values. +We only keep rows where nval_num is exactly equal to a specific values hence the required value of TVAL_CHAR. +We could keep values which are GE or LE or L or G the problem is that we would need open brackets for intervals. +VALTYPE_CD = 'N' because we only care about numerical values. */ const sqlStart string = ` SELECT nval_num, patient_num, units_cd FROM i2b2demodata.observation_fact diff --git a/pkg/datasource/models/survival_query_time_points.go b/pkg/datasource/models/survival_query_time_points.go index 4f08ed8..0c64e9f 100644 --- a/pkg/datasource/models/survival_query_time_points.go +++ b/pkg/datasource/models/survival_query_time_points.go @@ -30,7 +30,7 @@ func (tps TimePoints) Less(i, j int) bool { return tps[i].Time < tps[j].Time } -//Swap implements Swap method for sort.Interface interface. +// Swap implements Swap method for sort.Interface interface. func (tps TimePoints) Swap(i, j int) { tps[i], tps[j] = tps[j], tps[i] } diff --git a/pkg/datasource/statistics_query_test.go b/pkg/datasource/statistics_query_test.go index c329a0f..7336669 100644 --- a/pkg/datasource/statistics_query_test.go +++ b/pkg/datasource/statistics_query_test.go @@ -109,7 +109,7 @@ func TestProcessObservations(t *testing.T) { } -//to generate sample with specific sample std and sample mean: https://stackoverflow.com/questions/51515423/generate-sample-data-with-an-exact-mean-and-standard-deviation +// to generate sample with specific sample std and sample mean: https://stackoverflow.com/questions/51515423/generate-sample-data-with-an-exact-mean-and-standard-deviation func TestOutlierRemoval(t *testing.T) { t.Run("outlier_removal_normal_0_mean_1_std", func(t *testing.T) { @@ -154,7 +154,7 @@ func newStatsObservations(observations []float64) (queryResults []dbmodels.Stats return } -//to generate sample with specific sample std and sample mean: https://stackoverflow.com/questions/51515423/generate-sample-data-with-an-exact-mean-and-standard-deviation +// to generate sample with specific sample std and sample mean: https://stackoverflow.com/questions/51515423/generate-sample-data-with-an-exact-mean-and-standard-deviation func TestOutlierRemovalNormal0Mean1Std(t *testing.T) { observations := []float64{ -4.504332807814968, -3.588438949993705, -1.4253477722082, 4.481350113178383, -0.05858067548906476, 8.695616991288777, 0.8911308392424653, 9.391114371637403, 8.094555884981943, -4.290838531517852, 10.79099641135041, 1.3150492298392589, 10.902284491587732, -0.8873436991601062, 2.228352198498256, 3.60927053212485, -1.1011040410767086, 10.284889522654836, 2.635879581548595, 2.535496309327691,