Skip to content

Commit

Permalink
update variable name and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tianj7 committed Dec 18, 2024
1 parent 000e75b commit f3d9e81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions models/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
6 changes: 3 additions & 3 deletions utils/parsing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f3d9e81

Please sign in to comment.