{
  "_id": "6abb7b0499f7aa8c6aa449e4",
  "Package": "healthdb",
  "Type": "Package",
  "Title": "Working with Healthcare Databases",
  "Version": "0.5.1.9000",
  "Authors@R": "person(\"Kevin\", \"Hu\",\nemail = \"kevin.hu@bccdc.ca\",\nrole = c(\"aut\", \"cre\", \"cph\"),\ncomment = c(ORCID = \"0000-0003-0254-5277\"))",
  "Description": "A system for identifying diseases or events from\nhealthcare databases and preparing data for epidemiological\nstudies. It includes capabilities not supported by 'SQL', such\nas matching strings by 'stringr' style regular expressions, and\ncan compute comorbidity scores (Quan et al. (2005)\n<doi:10.1097/01.mlr.0000182534.19832.83>) directly on a\ndatabase server. The implementation is based on 'dbplyr' with\nfull 'tidyverse' compatibility.",
  "License": "MIT + file LICENSE",
  "Encoding": "UTF-8",
  "LazyData": "true",
  "URL": "https://github.com/KevinHzq/healthdb,\nhttps://kevinhzq.github.io/healthdb/",
  "BugReports": "https://github.com/KevinHzq/healthdb/issues",
  "Config/testthat/edition": "3",
  "VignetteBuilder": "knitr",
  "Config/roxygen2/version": "8.0.0",
  "Config/pak/sysreqs": "libicu-dev",
  "Repository": "https://kevinhzq.r-universe.dev",
  "Date/Publication": "2026-07-31 06:18:35 UTC",
  "RemoteUrl": "https://github.com/kevinhzq/healthdb",
  "RemoteRef": "HEAD",
  "RemoteSha": "03f31af47eb2204292f2ab8d66f34a86cbcdfaef",
  "NeedsCompilation": "no",
  "Packaged": {
    "Date": "2026-09-29 08:38:07 UTC",
    "User": "root"
  },
  "Author": "Kevin Hu [aut, cre, cph] (ORCID:\n<https://orcid.org/0000-0003-0254-5277>)",
  "Maintainer": "Kevin Hu <kevin.hu@bccdc.ca>",
  "_user": "kevinhzq",
  "_type": "src",
  "_file": "healthdb_0.5.1.9000.tar.gz",
  "_fileid": "https://r2.ropensci.org/50f30237ad8dedc2dd52ccfcca6cb424f05210fe7f50b9293d0e238b71bc3607",
  "_filesize": 468077,
  "_sha256": "50f30237ad8dedc2dd52ccfcca6cb424f05210fe7f50b9293d0e238b71bc3607",
  "_expires": "2027-01-07T08:46:58.000Z",
  "_created": "2026-09-29T08:38:07.000Z",
  "_published": "2026-09-29T08:47:00.615Z",
  "_jobs": [
    {
      "job": 109325945275,
      "time": 183,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "11021687741"
    },
    {
      "job": 109325945369,
      "time": 188,
      "config": "linux-release-x86_64",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "11021203593"
    },
    {
      "job": 109325945190,
      "time": 251,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "11021747178"
    },
    {
      "job": 109325945193,
      "time": 175,
      "config": "macos-release-arm64",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "11022336510"
    },
    {
      "job": 109324613244,
      "time": 228,
      "config": "source",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "11021842033"
    },
    {
      "job": 109325945249,
      "time": 132,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "11022271014"
    },
    {
      "job": 109325945318,
      "time": 134,
      "config": "windows-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "11021481813"
    },
    {
      "job": 109325945310,
      "time": 131,
      "config": "windows-oldrel-x86_64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "11022042189"
    },
    {
      "job": 109325945377,
      "time": 119,
      "config": "windows-release-x86_64",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "11021962304"
    }
  ],
  "_host": "GitHub-Actions",
  "_buildurl": "https://github.com/r-universe/kevinhzq/actions/runs/36543564256",
  "_status": "success",
  "_upstream": "https://github.com/kevinhzq/healthdb",
  "_commit": {
    "id": "03f31af47eb2204292f2ab8d66f34a86cbcdfaef",
    "author": "KevinHzq <38960619+KevinHzq@users.noreply.github.com>",
    "committer": "KevinHzq <38960619+KevinHzq@users.noreply.github.com>",
    "message": "gitignore the manuscript folder\n",
    "time": 1785478715
  },
  "_maintainer": {
    "name": "Kevin Hu",
    "email": "kevin.hu@bccdc.ca",
    "orcid": "0000-0003-0254-5277"
  },
  "_distro": "resolute",
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 3.5",
      "role": "Depends"
    },
    {
      "package": "clock",
      "role": "Imports"
    },
    {
      "package": "data.table",
      "version": ">= 1.18.4",
      "role": "Imports"
    },
    {
      "package": "dbplyr",
      "version": ">= 2.5.1",
      "role": "Imports"
    },
    {
      "package": "dplyr",
      "version": ">= 1.1.0",
      "role": "Imports"
    },
    {
      "package": "glue",
      "role": "Imports"
    },
    {
      "package": "lubridate",
      "role": "Imports"
    },
    {
      "package": "magrittr",
      "role": "Imports"
    },
    {
      "package": "purrr",
      "role": "Imports"
    },
    {
      "package": "rlang",
      "role": "Imports"
    },
    {
      "package": "stringr",
      "version": ">= 1.5.0",
      "role": "Imports"
    },
    {
      "package": "tidyr",
      "role": "Imports"
    },
    {
      "package": "DBI",
      "role": "Suggests"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "odbc",
      "role": "Suggests"
    },
    {
      "package": "rmarkdown",
      "role": "Suggests"
    },
    {
      "package": "RPostgres",
      "role": "Suggests"
    },
    {
      "package": "testthat",
      "version": ">= 3.0.0",
      "role": "Suggests"
    },
    {
      "package": "withr",
      "role": "Suggests"
    },
    {
      "package": "RSQLite",
      "role": "Suggests"
    }
  ],
  "_owner": "kevinhzq",
  "_selfowned": true,
  "_usedby": 0,
  "_updates": [
    {
      "week": "2025-47",
      "n": 5
    },
    {
      "week": "2025-48",
      "n": 1
    },
    {
      "week": "2025-52",
      "n": 3
    },
    {
      "week": "2026-01",
      "n": 1
    },
    {
      "week": "2026-02",
      "n": 1
    },
    {
      "week": "2026-20",
      "n": 1
    },
    {
      "week": "2026-22",
      "n": 3
    },
    {
      "week": "2026-24",
      "n": 27
    },
    {
      "week": "2026-31",
      "n": 5
    }
  ],
  "_tags": [
    {
      "name": "v0.5.0",
      "date": "2025-12-30"
    },
    {
      "name": "v0.5.1",
      "date": "2026-05-26"
    }
  ],
  "_stars": 2,
  "_contributors": [
    {
      "user": "kevinhzq",
      "count": 59,
      "uuid": 38960619
    },
    {
      "user": "hadley",
      "count": 1,
      "uuid": 4196
    },
    {
      "user": "michaelchirico",
      "count": 1,
      "uuid": 7606389
    }
  ],
  "_userbio": {
    "uuid": 38960619,
    "type": "user",
    "name": "Kevin Hu",
    "followers": 4,
    "description": "Biostatistician @BCCDC-PHSA"
  },
  "_downloads": {
    "count": 480,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/healthdb"
  },
  "_devurl": "https://github.com/kevinhzq/healthdb",
  "_pkgdown": "https://kevinhzq.github.io/healthdb/",
  "_searchresults": 0,
  "_rbuild": "4.6.1",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/healthdb.html",
    "extra/manual.pdf",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/readme.html",
    "extra/readme.md",
    "LICENSE"
  ],
  "_homeurl": "https://github.com/kevinhzq/healthdb",
  "_realowner": "kevinhzq",
  "_cranurl": true,
  "_releases": [
    {
      "version": "0.1.0",
      "date": "2024-04-27"
    },
    {
      "version": "0.2.0",
      "date": "2024-05-05"
    },
    {
      "version": "0.3.0",
      "date": "2024-05-16"
    },
    {
      "version": "0.3.1",
      "date": "2024-05-23"
    },
    {
      "version": "0.4.0",
      "date": "2025-02-28"
    },
    {
      "version": "0.4.1",
      "date": "2025-04-05"
    },
    {
      "version": "0.5.0",
      "date": "2026-01-08"
    },
    {
      "version": "0.5.1",
      "date": "2026-05-26"
    }
  ],
  "_exports": [
    "%>%",
    "bind_source",
    "build_def",
    "collapse_episode",
    "compute_comorbidity",
    "compute_duration",
    "cut_period",
    "define_case",
    "define_case_with_age",
    "exclude",
    "execute_def",
    "fetch_var",
    "identify_row",
    "identify_rows",
    "if_date",
    "lookup",
    "make_test_dat",
    "pool_case",
    "report_n",
    "restrict_date",
    "restrict_n"
  ],
  "_datasets": [
    {
      "name": "elix_codes",
      "title": "ICD codes defining the Elixhauser comorbidity categories",
      "object": "elix_codes",
      "class": [
        "data.frame"
      ],
      "fields": [
        "icd_ver",
        "category",
        "description",
        "code",
        "match_len"
      ],
      "rows": 1148,
      "table": true,
      "tojson": true
    }
  ],
  "_help": [
    {
      "page": "bind_source",
      "title": "Row-bind a list of data.frames or remote tables with variable selection and renaming",
      "topics": [
        "bind_source"
      ]
    },
    {
      "page": "build_def",
      "title": "Build case definition function calls",
      "topics": [
        "build_def"
      ]
    },
    {
      "page": "collapse_episode",
      "title": "Group records no more than n days apart as episodes",
      "topics": [
        "collapse_episode"
      ]
    },
    {
      "page": "compute_comorbidity",
      "title": "Compute Elixhauser Comorbidity Index",
      "topics": [
        "compute_comorbidity"
      ]
    },
    {
      "page": "compute_duration",
      "title": "Compute duration between two dates",
      "topics": [
        "compute_duration"
      ]
    },
    {
      "page": "cut_period",
      "title": "Cut the time period in one row into multiple rows by interval",
      "topics": [
        "cut_period"
      ]
    },
    {
      "page": "define_case",
      "title": "Identify diseases/events from administrative records",
      "topics": [
        "define_case"
      ]
    },
    {
      "page": "define_case_with_age",
      "title": "Identify diseases/events from administrative records with age restriction",
      "topics": [
        "define_case_with_age"
      ]
    },
    {
      "page": "elix_codes",
      "title": "ICD codes defining the Elixhauser comorbidity categories",
      "topics": [
        "elix_codes"
      ]
    },
    {
      "page": "exclude",
      "title": "Remove rows based on conditions or another data set",
      "topics": [
        "exclude"
      ]
    },
    {
      "page": "execute_def",
      "title": "Execute parameterized case definitions",
      "topics": [
        "execute_def"
      ]
    },
    {
      "page": "fetch_var",
      "title": "Get variables from multiple tables with common ID columns",
      "topics": [
        "fetch_var"
      ]
    },
    {
      "page": "identify_rows",
      "title": "Identify rows with a match",
      "topics": [
        "identify_row",
        "identify_rows"
      ]
    },
    {
      "page": "if_date",
      "title": "Interpret if any n elements drawn from a date vector could be some days apart within some time span",
      "topics": [
        "if_date"
      ]
    },
    {
      "page": "lookup",
      "title": "Find value corresponding to the input vector using a look-up table",
      "topics": [
        "lookup"
      ]
    },
    {
      "page": "make_test_dat",
      "title": "Make test data",
      "topics": [
        "make_test_dat"
      ]
    },
    {
      "page": "pool_case",
      "title": "Pool qualified clients from results of multiple definitions",
      "topics": [
        "pool_case"
      ]
    },
    {
      "page": "report_n",
      "title": "Report the number of distinct values in a column across data frames",
      "topics": [
        "report_n"
      ]
    },
    {
      "page": "restrict_date",
      "title": "Remove or flag groups that failed to meet conditions based on dates",
      "topics": [
        "restrict_date"
      ]
    },
    {
      "page": "restrict_n",
      "title": "Remove or flag groups smaller than a minimum size",
      "topics": [
        "restrict_n"
      ]
    }
  ],
  "_pkglogo": "https://github.com/kevinhzq/healthdb/raw/HEAD/man/figures/logo.png",
  "_readme": "https://github.com/kevinhzq/healthdb/raw/HEAD/README.md",
  "_rundeps": [
    "blob",
    "cli",
    "clock",
    "cpp11",
    "data.table",
    "DBI",
    "dbplyr",
    "dplyr",
    "generics",
    "glue",
    "lifecycle",
    "lubridate",
    "magrittr",
    "pillar",
    "pkgconfig",
    "purrr",
    "R6",
    "rlang",
    "stringi",
    "stringr",
    "tibble",
    "tidyr",
    "tidyselect",
    "timechange",
    "tzdb",
    "utf8",
    "vctrs",
    "withr"
  ],
  "_vignettes": [
    {
      "source": "wrangling.Rmd",
      "filename": "wrangling.html",
      "title": "Data wrangling helpers",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Report sample sizes for your flowchart with report_n()",
        "Compute age and age groups with compute_duration()",
        "Decode codes with lookup()",
        "Score comorbidity with compute_comorbidity()",
        "Combine related records into episodes with collapse_episode()",
        "Split long periods into regular intervals with cut_period()",
        "Check date patterns directly with if_date()",
        "Where these fit in a typical workflow"
      ],
      "created": "2026-06-11 05:23:42",
      "modified": "2026-06-11 06:12:35",
      "commits": 2
    },
    {
      "source": "healthdb.Rmd",
      "filename": "healthdb.html",
      "title": "Introduction to healthdb",
      "engine": "knitr::rmarkdown",
      "headings": [
        "What it does",
        "Motivation",
        "Installation",
        "Intended use case",
        "make_test_dat() makes either a toy data.frame or database table in memory with known number of rows that satisfy the query we will show later",
        "this is a database table",
        "note that in-memory SQLite database stores dates as numbers",
        "this is a local data.frame/tibble",
        "convert Date to numeric to be consistent with claim_db",
        "Interactive functions",
        "here we use filter mode to remove records that failed the restriction",
        "here we use flag mode to flag records that met the restriction instead of removing those",
        "Class of result4",
        "execute query and download the result",
        "Number of rows in source",
        "Number of rows in the current result",
        "make two look up tables",
        "get year from dates for matching",
        "note that keys must be present in all tables",
        "Call-building functions",
        "Next steps"
      ],
      "created": "2024-05-06 18:18:39",
      "modified": "2026-06-13 06:35:53",
      "commits": 10
    },
    {
      "source": "if_date_logic.Rmd",
      "filename": "if_date_logic.html",
      "title": "The logic behind if_date() and restrict_date()",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Why not brute force?",
        "The easy half: within",
        "The hard half: apart",
        "Anchor at the extremes",
        "A worked example",
        "Both conditions at once",
        "Teaching SQL to loop",
        "Trust, but verify",
        "Where this sits among known techniques"
      ],
      "created": "2026-06-11 06:12:35",
      "modified": "2026-06-11 06:12:35",
      "commits": 1
    }
  ],
  "_score": 5.732393759822968,
  "_indexed": true,
  "_nocasepkg": "healthdb",
  "_universes": [
    "kevinhzq"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "0.5.1.9000",
      "date": "2026-09-29T08:40:40.000Z",
      "distro": "resolute",
      "commit": "03f31af47eb2204292f2ab8d66f34a86cbcdfaef",
      "fileid": "https://r2.ropensci.org/d596c6464fde2d213c2b64c01474f340a9695c20efa99a3a1adc0d5d6641ea3a",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/kevinhzq/actions/runs/36543564256"
    },
    {
      "r": "4.6.1",
      "os": "linux",
      "version": "0.5.1.9000",
      "date": "2026-09-29T08:40:45.000Z",
      "distro": "resolute",
      "commit": "03f31af47eb2204292f2ab8d66f34a86cbcdfaef",
      "fileid": "https://r2.ropensci.org/f530372cf8272a7a0ffc7d5ddc003ec638105edefd281c24dd0e2eb744c1b06f",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/kevinhzq/actions/runs/36543564256"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "0.5.1.9000",
      "date": "2026-09-29T08:44:56.000Z",
      "commit": "03f31af47eb2204292f2ab8d66f34a86cbcdfaef",
      "fileid": "https://r2.ropensci.org/c661645b438faac95ee5247b2e9f6bff0f9af5974138e091998e0a07cf0b6181",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/kevinhzq/actions/runs/36543564256"
    },
    {
      "r": "4.6.1",
      "os": "mac",
      "version": "0.5.1.9000",
      "date": "2026-09-29T08:43:53.000Z",
      "commit": "03f31af47eb2204292f2ab8d66f34a86cbcdfaef",
      "fileid": "https://r2.ropensci.org/3be602a50130901295a2a9e1dbc66b52d981afbe03de85adadc7b0e26c8b4bfd",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/kevinhzq/actions/runs/36543564256"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "0.5.1.9000",
      "date": "2026-09-29T08:40:45.000Z",
      "commit": "03f31af47eb2204292f2ab8d66f34a86cbcdfaef",
      "fileid": "https://r2.ropensci.org/d77804553d93d190502c423a8d6a9e3ebd48f9f1b9739795fc6b8a157205330b",
      "status": "success",
      "buildurl": "https://github.com/r-universe/kevinhzq/actions/runs/36543564256"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "0.5.1.9000",
      "date": "2026-09-29T08:39:33.000Z",
      "commit": "03f31af47eb2204292f2ab8d66f34a86cbcdfaef",
      "fileid": "https://r2.ropensci.org/90007438282ca918e6059622ddcb68856e26f9d435542e71b78c15e6d1114984",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/kevinhzq/actions/runs/36543564256"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "0.5.1.9000",
      "date": "2026-09-29T08:39:31.000Z",
      "commit": "03f31af47eb2204292f2ab8d66f34a86cbcdfaef",
      "fileid": "https://r2.ropensci.org/6e52c7917bd4aed606d0c812ca758d1a429cfa2487c4e484b5316c75354d1f8c",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/kevinhzq/actions/runs/36543564256"
    },
    {
      "r": "4.6.1",
      "os": "win",
      "version": "0.5.1.9000",
      "date": "2026-09-29T08:39:24.000Z",
      "commit": "03f31af47eb2204292f2ab8d66f34a86cbcdfaef",
      "fileid": "https://r2.ropensci.org/62b23199fe4fd23d4ce3ae7e568a58be4004143082df12a79053c1322d9bc6df",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/kevinhzq/actions/runs/36543564256"
    }
  ]
}