darwin-eu-dev / omopgenerics

https://darwin-eu-dev.github.io/omopgenerics/
Apache License 2.0
2 stars 1 forks source link

consider moving startDateColumn to omopgenerics #491

Open edward-burn opened 6 months ago

edward-burn commented 6 months ago

@catalamarti seems more like a function for omopgenerics? https://darwin-eu-dev.github.io/PatientProfiles/reference/startDateColumn.html

edward-burn commented 6 months ago

Similarly

catalamarti commented 6 months ago

should we have a vocab or sth similar package? @edward-burn I would agree it is not the place in pp but maybe neither in og? @edward-burn

edward-burn commented 6 months ago

I would have thought omopgenerics because it seems a useful function for CDMConnector, CodelistGenerator, and PatientProfiles. Similar with the others (except variableTypes) in that they are related to the definition of the omop cdm

catalamarti commented 3 weeks ago

create a set of functions vocabulary based

ilovemane commented 2 weeks ago

@catalamarti shall I re export of those functions ed mention above or just copy over?

catalamarti commented 2 weeks ago
ilovemane commented 2 weeks ago

This function is not used in anywhere.

catalamarti commented 1 week ago

vs

catalamarti commented 1 week ago
# OPTION 1
startDateColumn <- function(table) {
  omopColumn(table = table, field = "start_date")
}

omopColumn <- function(table, field, call = parent.frame()) {
  # initial checks
  assertChoice(table, optionsTable, call = call)

  # internal dataset
  fields$name[fields$table == table & fields$type == field]
}

# OPTION 2
omopColumn <- function(table, field) {
  # initial checks
  assertChoice(table, optionsTable)
  assertChoice(field, c("start_date", "end_date", ...))

  # internal dataset
  fields$name[fields$table == table & fields$type == field]
}