From f3d9e81efa967a49e3f76fc5b0f2e6c24b7be304 Mon Sep 17 00:00:00 2001 From: tianj7 Date: Wed, 18 Dec 2024 12:20:12 -0600 Subject: [PATCH] update variable name and comment --- models/helper.go | 1 + utils/parsing.go | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/models/helper.go b/models/helper.go index 7562a2a..1d52326 100644 --- a/models/helper.go +++ b/models/helper.go @@ -37,6 +37,7 @@ func QueryFilterByConceptIdsAndValuesHelper(query *gorm.DB, sourceId int, filter Where(observationTableAlias+".observation_concept_id = ?", filterConceptIdAndValue.ConceptId). Where(GetConceptValueNotNullCheckBasedOnConceptType(observationTableAlias, sourceId, filterConceptIdAndValue.ConceptId)) + //If filter by value, add the value filtering clauses to the query if len(filterConceptIdAndValue.ConceptValues) > 0 { query = query.Where(observationTableAlias+".value_as_concept_id in ?", filterConceptIdAndValue.ConceptValues) } diff --git a/utils/parsing.go b/utils/parsing.go index fa6b207..7639e3d 100644 --- a/utils/parsing.go +++ b/utils/parsing.go @@ -267,17 +267,17 @@ func ParseSourceAndCohortId(c *gin.Context) (int, int, error) { // separates a conceptIdsAndCohortPairs into a conceptIds list and a cohortPairs list func GetConceptIdsAndCohortPairsAsSeparateLists(conceptIdsAndCohortPairs []interface{}) ([]CustomConceptVariableDef, []CustomDichotomousVariableDef) { - conceptIds := []CustomConceptVariableDef{} + conceptIdsAndValues := []CustomConceptVariableDef{} cohortPairs := []CustomDichotomousVariableDef{} for _, item := range conceptIdsAndCohortPairs { switch convertedItem := item.(type) { case CustomConceptVariableDef: - conceptIds = append(conceptIds, convertedItem) + conceptIdsAndValues = append(conceptIdsAndValues, convertedItem) case CustomDichotomousVariableDef: cohortPairs = append(cohortPairs, convertedItem) } } - return conceptIds, cohortPairs + return conceptIdsAndValues, cohortPairs } // deprecated: returns the conceptIds and cohortPairs as separate lists (for backwards compatibility)