{
  "_id": "6a10a7a1acfb0bcc41cbc827",
  "Package": "rcprd",
  "Title": "Extraction and Management of Clinical Practice Research Datalink\nData",
  "Version": "0.0.2",
  "Authors@R": "c(person(given = \"Alexander\", family = \"Pate\", email = \"alexander.pate@manchester.ac.uk\", role = c(\"aut\", \"cre\", \"cph\"),\ncomment = c(ORCID = \"0000-0002-0849-3458\")))",
  "Description": "Simplify the process of extracting and processing Clinical\nPractice Research Datalink (CPRD) data in order to build\ndatasets ready for statistical analysis. This process is\ndifficult in 'R', as the raw data is very large and cannot be\nread into the R workspace. 'rcprd' utilises 'RSQLite' to create\n'SQLite' databases which are stored on the hard disk. These are\nthen queried to extract the required information for a cohort\nof interest, and create datasets ready for statistical\nanalysis. The processes follow closely that from the 'rEHR'\npackage, see Springate et al., (2017)\n<doi:10.1371/journal.pone.0171784>.",
  "License": "MIT + file LICENSE",
  "Encoding": "UTF-8",
  "Roxygen": "list(markdown = TRUE)",
  "RoxygenNote": "7.3.3",
  "VignetteBuilder": "knitr",
  "Config/testthat/edition": "3",
  "URL": "https://alexpate30.github.io/rcprd/",
  "Config/pak/sysreqs": "libicu-dev",
  "Repository": "https://alexpate30.r-universe.dev",
  "Date/Publication": "2026-05-21 21:15:01 UTC",
  "RemoteUrl": "https://github.com/alexpate30/rcprd",
  "RemoteRef": "HEAD",
  "RemoteSha": "0817decda29d7ef0aa7166e2b16f82831e5d9afb",
  "NeedsCompilation": "no",
  "Packaged": {
    "Date": "2026-05-22 18:49:10 UTC",
    "User": "root"
  },
  "Author": "Alexander Pate [aut, cre, cph] (ORCID:\n<https://orcid.org/0000-0002-0849-3458>)",
  "Maintainer": "Alexander Pate <alexander.pate@manchester.ac.uk>",
  "MD5sum": "8358f1dda16d34e548a8a789d5354929",
  "_user": "alexpate30",
  "_type": "src",
  "_file": "rcprd_0.0.2.tar.gz",
  "_fileid": "e0aa52a7ebe40f9c394aac5744698616e4dc193f3a35ad8241e020795c50e918",
  "_filesize": 1019956,
  "_sha256": "e0aa52a7ebe40f9c394aac5744698616e4dc193f3a35ad8241e020795c50e918",
  "_created": "2026-05-22T18:49:10.000Z",
  "_published": "2026-05-22T18:59:45.938Z",
  "_distro": "noble",
  "_jobs": [
    {
      "job": 77442859276,
      "time": 128,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7168066726"
    },
    {
      "job": 77442859238,
      "time": 131,
      "config": "linux-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7168070875"
    },
    {
      "job": 77442859231,
      "time": 117,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7168087045"
    },
    {
      "job": 77442859256,
      "time": 95,
      "config": "macos-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7168123234"
    },
    {
      "job": 77442362746,
      "time": 192,
      "config": "source",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7168019066"
    },
    {
      "job": 77442859207,
      "time": 107,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7168059823"
    },
    {
      "job": 77442859243,
      "time": 146,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7168067906"
    },
    {
      "job": 77442859251,
      "time": 82,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7168048577"
    },
    {
      "job": 77442859252,
      "time": 152,
      "config": "windows-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7168071379"
    }
  ],
  "_buildurl": "https://github.com/r-universe/alexpate30/actions/runs/26256404228",
  "_status": "success",
  "_host": "GitHub-Actions",
  "_upstream": "https://github.com/alexpate30/rcprd",
  "_commit": {
    "id": "0817decda29d7ef0aa7166e2b16f82831e5d9afb",
    "author": "alexpate30 <alexander.pate@manchester.ac.uk>",
    "committer": "alexpate30 <alexander.pate@manchester.ac.uk>",
    "message": "add consultation to db_query\n",
    "time": 1779398101
  },
  "_maintainer": {
    "name": "Alexander Pate",
    "email": "alexander.pate@manchester.ac.uk",
    "login": "alexpate30",
    "description": "",
    "uuid": 52957704,
    "orcid": "0000-0002-0849-3458"
  },
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 4.1.0",
      "role": "Depends"
    },
    {
      "package": "dplyr",
      "role": "Imports"
    },
    {
      "package": "data.table",
      "role": "Imports"
    },
    {
      "package": "fastmatch",
      "role": "Imports"
    },
    {
      "package": "lubridate",
      "role": "Imports"
    },
    {
      "package": "RSQLite",
      "role": "Imports"
    },
    {
      "package": "stringr",
      "role": "Imports"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "rmarkdown",
      "role": "Suggests"
    },
    {
      "package": "testthat",
      "version": ">= 3.0.0",
      "role": "Suggests"
    }
  ],
  "_owner": "alexpate30",
  "_selfowned": true,
  "_usedby": 0,
  "_updates": [
    {
      "week": "2025-26",
      "n": 2
    },
    {
      "week": "2025-28",
      "n": 1
    },
    {
      "week": "2025-32",
      "n": 1
    },
    {
      "week": "2025-33",
      "n": 5
    },
    {
      "week": "2025-36",
      "n": 2
    },
    {
      "week": "2026-07",
      "n": 2
    },
    {
      "week": "2026-21",
      "n": 2
    }
  ],
  "_tags": [],
  "_stars": 3,
  "_contributors": [
    {
      "user": "alexpate30",
      "count": 150,
      "uuid": 52957704
    }
  ],
  "_userbio": {
    "uuid": 52957704,
    "type": "user",
    "name": "alexpate30"
  },
  "_downloads": {
    "count": 595,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/rcprd"
  },
  "_devurl": "https://github.com/alexpate30/rcprd",
  "_pkgdown": "https://alexpate30.github.io/rcprd/",
  "_searchresults": 13,
  "_rbuild": "4.6.0",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/rcprd.html",
    "extra/readme.html",
    "extra/readme.md",
    "manual.pdf"
  ],
  "_homeurl": "https://github.com/alexpate30/rcprd",
  "_realowner": "alexpate30",
  "_cranurl": true,
  "_releases": [
    {
      "version": "0.0.1",
      "date": "2024-11-14"
    },
    {
      "version": "0.0.2",
      "date": "2025-09-07"
    }
  ],
  "_exports": [
    "add_to_database",
    "combine_query",
    "combine_query_boolean",
    "connect_database",
    "cprd_extract",
    "create_directory_system",
    "db_query",
    "delete_directory_system",
    "extract_bmi",
    "extract_cholhdl_ratio",
    "extract_cohort",
    "extract_diabetes",
    "extract_ho",
    "extract_practices",
    "extract_smoking",
    "extract_test_data",
    "extract_test_data_var",
    "extract_test_recent",
    "extract_time_until"
  ],
  "_help": [
    {
      "page": "add_to_database",
      "title": "Adds a single .txt file to an SQLite database on the hard disk.",
      "topics": [
        "add_to_database"
      ]
    },
    {
      "page": "combine_query",
      "title": "Combine a database query with a cohort.",
      "topics": [
        "combine_query"
      ]
    },
    {
      "page": "combine_query_boolean",
      "title": "Combine a database query with a cohort returning a 0/1 vector depending on whether each individual has a recorded code of interest.",
      "topics": [
        "combine_query_boolean"
      ]
    },
    {
      "page": "combine_query_boolean.aurum",
      "title": "Combine a CPRD aurum database query with a cohort returning a 0/1 vector depending on whether each individual has a recorded code of interest.",
      "topics": [
        "combine_query_boolean.aurum"
      ]
    },
    {
      "page": "combine_query.aurum",
      "title": "Combine a CPRD aurum database query with a cohort.",
      "topics": [
        "combine_query.aurum"
      ]
    },
    {
      "page": "connect_database",
      "title": "Open connection to SQLite database",
      "topics": [
        "connect_database"
      ]
    },
    {
      "page": "cprd_extract",
      "title": "Adds all the .txt files in a directory, with certain file names, to an SQLite database on the hard disk.",
      "topics": [
        "cprd_extract"
      ]
    },
    {
      "page": "create_directory_system",
      "title": "Create the appropriate directory system to be able to run functions without specifying hard filepaths",
      "topics": [
        "create_directory_system"
      ]
    },
    {
      "page": "db_query",
      "title": "Query an RSQLite database.",
      "topics": [
        "db_query"
      ]
    },
    {
      "page": "delete_directory_system",
      "title": "Deletes directory system created by 'delete_directory_system'",
      "topics": [
        "delete_directory_system"
      ]
    },
    {
      "page": "extract_bmi",
      "title": "Extract most recent BMI score relative to an index date.",
      "topics": [
        "extract_bmi"
      ]
    },
    {
      "page": "extract_cholhdl_ratio",
      "title": "Extract most recent total cholesterol/high-density lipoprotein ratio score relative to an index date.",
      "topics": [
        "extract_cholhdl_ratio"
      ]
    },
    {
      "page": "extract_cohort",
      "title": "Create cohort from patient files",
      "topics": [
        "extract_cohort"
      ]
    },
    {
      "page": "extract_diabetes",
      "title": "Extract diabetes status prior to an index date.",
      "topics": [
        "extract_diabetes"
      ]
    },
    {
      "page": "extract_ho",
      "title": "Extract a 'history of' type variable",
      "topics": [
        "extract_ho"
      ]
    },
    {
      "page": "extract_practices",
      "title": "Combine practice files",
      "topics": [
        "extract_practices"
      ]
    },
    {
      "page": "extract_smoking",
      "title": "Extract smoking status prior to index date.",
      "topics": [
        "extract_smoking"
      ]
    },
    {
      "page": "extract_test_data",
      "title": "Extract test data.",
      "topics": [
        "extract_test_data"
      ]
    },
    {
      "page": "extract_test_data_var",
      "title": "Extract standard deviation of all test data values over a specified time period relative to an index date.",
      "topics": [
        "extract_test_data_var"
      ]
    },
    {
      "page": "extract_test_recent",
      "title": "Extract test data.",
      "topics": [
        "extract_test_recent"
      ]
    },
    {
      "page": "extract_time_until",
      "title": "Extract a 'time until' type variable",
      "topics": [
        "extract_time_until"
      ]
    },
    {
      "page": "extract_txt_char",
      "title": "Read in txt file with all colClasses = \"character\"",
      "topics": [
        "extract_txt_char"
      ]
    },
    {
      "page": "extract_txt_cons",
      "title": "Read in raw .txt consultation file",
      "topics": [
        "extract_txt_cons"
      ]
    },
    {
      "page": "extract_txt_death",
      "title": "Read in raw ONS death data file",
      "topics": [
        "extract_txt_death"
      ]
    },
    {
      "page": "extract_txt_drug",
      "title": "Read in raw .txt drugissue file",
      "topics": [
        "extract_txt_drug"
      ]
    },
    {
      "page": "extract_txt_hes_primary",
      "title": "Read in raw HES primary diagnoses file",
      "topics": [
        "extract_txt_hes_primary"
      ]
    },
    {
      "page": "extract_txt_linkage",
      "title": "Read in linkage eligibility file",
      "topics": [
        "extract_txt_linkage"
      ]
    },
    {
      "page": "extract_txt_obs",
      "title": "Read in raw .txt observation file",
      "topics": [
        "extract_txt_obs"
      ]
    },
    {
      "page": "extract_txt_pat",
      "title": "Read in raw .txt patient file",
      "topics": [
        "extract_txt_pat"
      ]
    },
    {
      "page": "extract_txt_prac",
      "title": "Read in raw .txt practice file",
      "topics": [
        "extract_txt_prac"
      ]
    },
    {
      "page": "extract_txt_prob",
      "title": "Read in raw .txt problem file",
      "topics": [
        "extract_txt_prob"
      ]
    },
    {
      "page": "extract_txt_ref",
      "title": "Read in raw .txt referral file",
      "topics": [
        "extract_txt_ref"
      ]
    },
    {
      "page": "implement_output",
      "title": "Internal function to implement saving extracted variable to disk or returning into R workspace.",
      "topics": [
        "implement_output"
      ]
    }
  ],
  "_readme": "https://github.com/alexpate30/rcprd/raw/HEAD/README.md",
  "_rundeps": [
    "bit",
    "bit64",
    "blob",
    "cachem",
    "cli",
    "cpp11",
    "data.table",
    "DBI",
    "dplyr",
    "fastmap",
    "fastmatch",
    "generics",
    "glue",
    "lifecycle",
    "lubridate",
    "magrittr",
    "memoise",
    "pillar",
    "pkgconfig",
    "R6",
    "rlang",
    "RSQLite",
    "stringi",
    "stringr",
    "tibble",
    "tidyselect",
    "timechange",
    "utf8",
    "vctrs",
    "withr"
  ],
  "_vignettes": [
    {
      "source": "Details-on-algorithms-for-extracting-specific-variables.Rmd",
      "filename": "Details-on-algorithms-for-extracting-specific-variables.html",
      "title": "Details-on-algorithms-for-extracting-specific-variables",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Introduction",
        "Algorithms for variable extraction",
        "BMI (extract_BMI)",
        "Cholesterol/HDL ratio (extract_cholhdl_ratio)",
        "Diabetes status (extract_diabetes)",
        "Smoking status (extract_smoking)",
        "Summary of units of measurement for test data"
      ],
      "created": "2024-07-15 15:25:27",
      "modified": "2025-03-26 17:45:10",
      "commits": 8
    },
    {
      "source": "rcprd.Rmd",
      "filename": "rcprd.html",
      "title": "rcprd: An R package to simplify the extraction and processing of CPRD data, and create analysis-ready datasets",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Introduction",
        "Data Structure and Extraction Process",
        "Structure of CPRD Aurum data",
        "Recommended process for extraction",
        "Worked example for data extraction",
        "Steps 1 - 4: Defining a cohort",
        "Step 5: Reading in data and creating an SQLite database",
        "Add individual files to SQLite database using add_to_database",
        "Add all relevant files to SQLite database using cprd_extract",
        "Add all relevant files to SQLite database in a computationally efficient manner using the set functionality.",
        "Step 6: Querying the SQLite database to extract variables",
        "Functions for extracting common variable types",
        "Functions for extracting specific variables",
        "Functions for database queries and custom variable extraction",
        "Saving extracted variables directly to a disk drive, and utilising rAURUMs suggested directory system",
        "Extracting longitudinal data/time varying covariates",
        "Working with linked data",
        "Discussion",
        "References"
      ],
      "created": "2024-10-30 17:38:05",
      "modified": "2025-09-07 13:09:51",
      "commits": 22
    }
  ],
  "_score": 5.4361626470407565,
  "_indexed": true,
  "_nocasepkg": "rcprd",
  "_universes": [
    "alexpate30"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "0.0.2",
      "date": "2026-05-22T18:51:38.000Z",
      "distro": "noble",
      "commit": "0817decda29d7ef0aa7166e2b16f82831e5d9afb",
      "fileid": "b473c857de7db3e54ab6f990b274c4b129dcc8a46c8e71dd96604a3719364c53",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/alexpate30/actions/runs/26256404228"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "0.0.2",
      "date": "2026-05-22T18:51:50.000Z",
      "distro": "noble",
      "commit": "0817decda29d7ef0aa7166e2b16f82831e5d9afb",
      "fileid": "44519566043a36c9cdf544ced2b2aec4791ed5467d79a5f67c774b664edcf172",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/alexpate30/actions/runs/26256404228"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "0.0.2",
      "date": "2026-05-22T18:52:40.000Z",
      "commit": "0817decda29d7ef0aa7166e2b16f82831e5d9afb",
      "fileid": "fe922a5a3ed4419f5cfba9a84b6397b1c4c12da3426d88ab6de36262248e411e",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/alexpate30/actions/runs/26256404228"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "0.0.2",
      "date": "2026-05-22T18:54:43.000Z",
      "commit": "0817decda29d7ef0aa7166e2b16f82831e5d9afb",
      "fileid": "925db18888e8bbf48b005574af9bb0eb3d7ba3bd0f0f54be84cdfe7b1f766e05",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/alexpate30/actions/runs/26256404228"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "0.0.2",
      "date": "2026-05-22T18:51:34.000Z",
      "commit": "0817decda29d7ef0aa7166e2b16f82831e5d9afb",
      "fileid": "de1c398b4d75b807040cb6148a5ae11c4849a3906f3a13adf365aa818d56d776",
      "status": "success",
      "buildurl": "https://github.com/r-universe/alexpate30/actions/runs/26256404228"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "0.0.2",
      "date": "2026-05-22T18:51:28.000Z",
      "commit": "0817decda29d7ef0aa7166e2b16f82831e5d9afb",
      "fileid": "3c075372fd636467781b598878cc24051bf6f3072630359067cf3573ff6efaea",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/alexpate30/actions/runs/26256404228"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "0.0.2",
      "date": "2026-05-22T18:50:31.000Z",
      "commit": "0817decda29d7ef0aa7166e2b16f82831e5d9afb",
      "fileid": "96f3a13d44ff15483885ad813a940a3500776deed441fcce8aa785105e70a90b",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/alexpate30/actions/runs/26256404228"
    },
    {
      "r": "4.6.0",
      "os": "win",
      "version": "0.0.2",
      "date": "2026-05-22T18:51:38.000Z",
      "commit": "0817decda29d7ef0aa7166e2b16f82831e5d9afb",
      "fileid": "e54a8a3bceabc4575f5f5c56ba19966355742e80a4eaab0704b2a175685bbe6e",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/alexpate30/actions/runs/26256404228"
    }
  ]
}