Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to specify "EraStartDate"? #103

Open
ablack3 opened this issue Sep 2, 2024 · 0 comments
Open

Is there a way to specify "EraStartDate"? #103

ablack3 opened this issue Sep 2, 2024 · 0 comments

Comments

@ablack3
Copy link
Collaborator

ablack3 commented Sep 2, 2024

when I use the startDate attribute with a drugEra query the json includes an attribute "OccurrenceStartDate".
I think in Atlas this should be "EraStartDate"
I'm not sure if there is another function I should be using. In the example below, Atlas will simply ignore my startDate attribute and remove it from the cohort definition when I upload the json.

library(Capr)
drug <- cs(1, name = "a")
ch <- cohort(
  entry = entry(drugEra(drug, startDate(bt(as.Date("2000-01-01"), as.Date("2023-12-31")))))
  )

jsonlite::prettify(compile(ch)) 
#> {
#>     "ConceptSets": [
#>         {
#>             "id": 0,
#>             "name": "a",
#>             "expression": {
#>                 "items": [
#>                     {
#>                         "concept": {
#>                             "CONCEPT_ID": 1,
#>                             "CONCEPT_NAME": "",
#>                             "STANDARD_CONCEPT": "",
#>                             "STANDARD_CONCEPT_CAPTION": "",
#>                             "INVALID_REASON": "",
#>                             "INVALID_REASON_CAPTION": "",
#>                             "CONCEPT_CODE": "",
#>                             "DOMAIN_ID": "",
#>                             "VOCABULARY_ID": "",
#>                             "CONCEPT_CLASS_ID": ""
#>                         },
#>                         "isExcluded": false,
#>                         "includeDescendants": false,
#>                         "includeMapped": false
#>                     }
#>                 ]
#>             }
#>         }
#>     ],
#>     "PrimaryCriteria": {
#>         "CriteriaList": [
#>             {
#>                 "DrugEra": {
#>                     "CodesetId": 0,
#>                     "OccurrenceStartDate": {
#>                         "Op": "bt",
#>                         "Value": "2000-01-01",
#>                         "Extent": "2023-12-31"
#>                     }
#>                 }
#>             }
#>         ],
#>         "ObservationWindow": {
#>             "PriorDays": 0,
#>             "PostDays": 0
#>         },
#>         "PrimaryCriteriaLimit": {
#>             "Type": "First"
#>         }
#>     },
#>     "QualifiedLimit": {
#>         "Type": "First"
#>     },
#>     "ExpressionLimit": {
#>         "Type": "First"
#>     },
#>     "InclusionRules": [
#> 
#>     ],
#>     "CensoringCriteria": [
#> 
#>     ],
#>     "CollapseSettings": {
#>         "CollapseType": "ERA",
#>         "EraPad": 0
#>     },
#>     "CensorWindow": {
#> 
#>     },
#>     "cdmVersionRange": ">=5.0.0"
#> }
#> 

Created on 2024-09-02 with reprex v2.1.1

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.3.3 (2024-02-29)
#>  os       macOS Sonoma 14.1
#>  system   aarch64, darwin20
#>  ui       X11
#>  language (EN)
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       Europe/Amsterdam
#>  date     2024-09-02
#>  pandoc   3.1.11 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/aarch64/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version date (UTC) lib source
#>  backports     1.5.0   2024-05-23 [1] CRAN (R 4.3.3)
#>  Capr        * 2.0.8   2024-09-02 [1] Github (ohdsi/Capr@c25f736)
#>  checkmate     2.3.2   2024-07-29 [1] CRAN (R 4.3.3)
#>  cli           3.6.3   2024-06-21 [1] CRAN (R 4.3.3)
#>  digest        0.6.37  2024-08-19 [1] CRAN (R 4.3.3)
#>  dplyr         1.1.4   2023-11-17 [1] CRAN (R 4.3.1)
#>  evaluate      0.24.0  2024-06-10 [1] CRAN (R 4.3.3)
#>  fansi         1.0.6   2023-12-08 [1] CRAN (R 4.3.1)
#>  fastmap       1.2.0   2024-05-15 [1] CRAN (R 4.3.3)
#>  fs            1.6.4   2024-04-25 [1] CRAN (R 4.3.1)
#>  generics      0.1.3   2022-07-05 [1] CRAN (R 4.3.0)
#>  glue          1.7.0   2024-01-09 [1] CRAN (R 4.3.1)
#>  htmltools     0.5.8.1 2024-04-04 [1] CRAN (R 4.3.1)
#>  jsonlite      1.8.8   2023-12-04 [1] CRAN (R 4.3.1)
#>  knitr         1.48    2024-07-07 [1] CRAN (R 4.3.3)
#>  lifecycle     1.0.4   2023-11-07 [1] CRAN (R 4.3.1)
#>  lubridate     1.9.3   2023-09-27 [1] CRAN (R 4.3.1)
#>  magrittr      2.0.3   2022-03-30 [1] CRAN (R 4.3.0)
#>  pillar        1.9.0   2023-03-22 [1] CRAN (R 4.3.0)
#>  pkgconfig     2.0.3   2019-09-22 [1] CRAN (R 4.3.0)
#>  purrr         1.0.2   2023-08-10 [1] CRAN (R 4.3.0)
#>  R6            2.5.1   2021-08-19 [1] CRAN (R 4.3.0)
#>  reprex        2.1.1   2024-07-06 [1] CRAN (R 4.3.3)
#>  rlang         1.1.4   2024-06-04 [1] CRAN (R 4.3.3)
#>  rmarkdown     2.27    2024-05-17 [1] CRAN (R 4.3.3)
#>  rstudioapi    0.16.0  2024-03-24 [1] CRAN (R 4.3.1)
#>  sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.3.0)
#>  tibble        3.2.1   2023-03-20 [1] CRAN (R 4.3.0)
#>  tidyselect    1.2.1   2024-03-11 [1] CRAN (R 4.3.1)
#>  timechange    0.3.0   2024-01-18 [1] CRAN (R 4.3.1)
#>  utf8          1.2.4   2023-10-22 [1] CRAN (R 4.3.1)
#>  vctrs         0.6.5   2023-12-01 [1] CRAN (R 4.3.1)
#>  withr         3.0.1   2024-07-31 [1] CRAN (R 4.3.3)
#>  xfun          0.46    2024-07-18 [1] CRAN (R 4.3.3)
#>  yaml          2.3.10  2024-07-26 [1] CRAN (R 4.3.3)
#> 
#>  [1] /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant