{"id":47694188,"url":"https://github.com/jlmnrc/custom_codebook","last_synced_at":"2026-04-02T16:17:42.682Z","repository":{"id":242996486,"uuid":"811166706","full_name":"jlmnrc/custom_codebook","owner":"jlmnrc","description":"Extract REDCap data dictionary/codebook and generate a Microsoft Word (docx) document for editing. It will add 'Export to Word' button at the Codebook page.","archived":false,"fork":false,"pushed_at":"2026-03-28T02:59:26.000Z","size":1284,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-28T08:40:08.716Z","etag":null,"topics":["redcap","redcap-external-module","redcap-repo"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jlmnrc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-06T04:23:31.000Z","updated_at":"2026-03-28T02:54:05.000Z","dependencies_parsed_at":"2025-06-04T00:24:48.882Z","dependency_job_id":"117b5332-81d8-4f90-b59a-1f87854945cb","html_url":"https://github.com/jlmnrc/custom_codebook","commit_stats":null,"previous_names":["monash-redcap/custom_codebook"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/jlmnrc/custom_codebook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlmnrc%2Fcustom_codebook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlmnrc%2Fcustom_codebook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlmnrc%2Fcustom_codebook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlmnrc%2Fcustom_codebook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jlmnrc","download_url":"https://codeload.github.com/jlmnrc/custom_codebook/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlmnrc%2Fcustom_codebook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31309808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["redcap","redcap-external-module","redcap-repo"],"created_at":"2026-04-02T16:17:41.413Z","updated_at":"2026-04-02T16:17:42.667Z","avatar_url":"https://github.com/jlmnrc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom Codebook Data Dictionary (REDCap External Module)\n\n**Custom Codebook** extends REDCap’s Codebook by adding:\n- **Custom Codebook** (simplified in-app view)\n- **Export to Word (.docx)** (data governance–friendly data dictionary)\n- **Export to CSV** (export the codebook in CSV format)\n\nWhen enabled, these buttons appear on the project **Codebook** page. The module **does not replace** the native REDCap Codebook.\n\n![Codebook buttons](images/01_codebook.jpg)\n\n---\n\n## Background\n\nData dictionaries are commonly used in IT governance to document systems. As data governance has emerged, the need to properly **define and catalogue data elements** has made dictionaries central to governance practice.\n\nIn research projects (especially health research), REDCap is used not only to collect/store data but also to support workflows and governance activities (e.g., data quality checks). While REDCap can generate an IT-focused codebook, it is not designed to capture richer governance metadata (definitions, standards, collection guidance). This often forces projects to maintain **two separate dictionaries**, which is inefficient and can lead to inconsistencies.\n\n---\n\n## Purpose\n\nThis module generates a data dictionary document that can be used as a **data governance tool** for communication with stakeholders such as funders, ethics committees, collaborators, and potential re-users of the data.\n\nThe Word export is based on the **Helix (Monash University) Health Data Dictionary** template and is mapped to REDCap field metadata and action tags.\n\n---\n\n## Features\n\nWhen generating the codebook, the module will automatically:\n- Exclude `descriptive` field types **unless** the field contains the `@DD` action tag\n- Exclude `[instrument]_complete` fields\n- Hide fields tagged with `@DD-HIDDEN`\n- Remove embedded/piped text and HTML formatting from labels/choices (where possible)\n- Use action tags to populate governance metadata in the Word export\n- Exclude choice options tagged with `@HIDECHOICES`\n\n---\n\n## Configuration\n\nIn module settings you can:\n- Enable for **all instruments/forms** (default), or limit to **specific instruments**\n- Define a **standard unknown value** (used in “unknown allowed” detection, see *Unknown/Missing Codes*)\n\n---\n\n## Usage\n\n1. Go to **REDCap Project → Codebook**\n2. Use the new buttons:\n    - **Custom Codebook**: simplified in-app view\n    - **Export to Word**: governance-friendly data dictionary (.docx)\n    - **Export to CSV**: spreadsheet-friendly export\n\n---\n\n## Action tags\n\nUse these tags in field annotations to add information to the output.\n\n| Tag | Description (override + default)                                                                                                                                                                             | Example |\n|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| `@DD` | **Override:** includes a `descriptive` field type in exports. **Default (no tag):** `descriptive` field types are excluded from exports.                                                                     | `@DD` |\n| `@DD-HIDDEN` | **Override:** hides the field from exports. **Default (no tag):** field is included (subject to general exclusions like `[instrument]_complete`).                                                            | `@DD-HIDDEN` |\n| `@DD-ELEMENTNAME=\"...\"` | **Override:** sets the “Data Element” name in the export. **Default (no tag):** “Data Element” = REDCap Field Label (cleaned of piping/HTML where possible).                                            | `@DD-ELEMENTNAME=\"Participant Identifier\"` |\n| `@DD-FIELDDEF=\"...\"` | **Override:** sets the “Description/Definition” text in the Word export. **Default (no tag):** blank / not populated.                                                                                        | `@DD-FIELDDEF=\"Auto-generated unique identifier...\"` |\n| `@DD-PURPOSE=\"...\"` | **Override:** sets the “Purpose” text in the Word export. **Default (no tag):** blank / not populated.                                                                                                       | `@DD-PURPOSE=\"Registration requirement\"` |\n| `@DD-DATACOLLECT=\"...\"` | **Additive:** appends extra “Data Collection” description text. **Default (no tag):** “Data Collection” shows **Always collected** (no branching logic) or **Conditional collection** (has branching logic). | `@DD-DATACOLLECT=\"Auto-generated\"` |\n| `@DD-CALCDESC=\"...\"` | **Additive:** adds a calculation description for calculated fields. **Default (no tag):** no calculation description is shown.                                                                               | `@DD-CALCDESC=\"BMI = weight / height^2\"` |\n| `@DD-STANDARDS=\"...\"` | **Override:** sets “Data Source, Standard / Terminology”. **Default (no tag):** blank / not populated.                                                                                                       | `@DD-STANDARDS=\"SNOMED CT; FHIR\"` |\n| `@DD-UNKNOWN` | **Override:** forces **(unknown allowed)** label for the field. **Default (no tag):** unknown/missing label is determined by project/module rules.                                                           | `@DD-UNKNOWN` |\n\n\n---\n\n## Word export mapping (summary)\n\nThe Word export maps REDCap metadata into a structured dictionary layout including:\n- Form name, field label (or overridden element name), definition, purpose\n- Data collection status (always vs conditional) and branching logic presentation\n- Obligation (mandatory vs non-mandatory)\n- Permitted values (choices/validation/calculation description/defaults)\n- Standards/terminologies references\n\nThe following word document will be generated when clicking on **Export to Word** option\n![Word export example](images/00_word_doc.jpg)\n\n\u003e For full Word component-by-component mapping and screenshots, see [Word export format mapping](?prefix=custom_codebook\u0026page=word-docx-format.md).\n\n---\n\n## Custom Codebook page\n\nThe Custom Codebook provides a simplified view of the REDCap Codebook for projects that want an in-app dictionary view when Word export is not required.\n\n---\n\n\n## Export to CSV\n\nThe **Export to CSV** button exports the project codebook/data dictionary into a **flat, spreadsheet-friendly** format (one row per field). This is useful for sharing with stakeholders, reviewing definitions, and doing bulk QA in Excel.\n\n### CSV columns (in order)\n\n| Column | Description |\n|---|---|\n| Data Element Name | Display name for the data element (uses `@DD-ELEMENTNAME` override when provided; otherwise uses the REDCap Field Label). |\n| Form/Instrument Name | REDCap instrument/form name. |\n| Description | Field definition/description (from `@DD-FIELDDEF` when provided; otherwise blank). |\n| Field Name | REDCap variable/field name. |\n| Field Type | REDCap field type (e.g., text, dropdown, radio, checkbox, calc, etc.). |\n| Purpose | Purpose of collecting the field (from `@DD-PURPOSE` when provided; otherwise blank). |\n| Data Collection | Derived from branching logic: **Always Collected** (no branching logic) or **Conditional collection** (has branching logic). Can include additional notes from `@DD-DATACOLLECT` when provided. |\n| Default Value | Documented default value (from `@DEFAULT` when provided; otherwise blank). |\n| Collected When | Branching logic expression (blank if none). |\n| Data Obligation | Mandatory/optional indicator (based on required field setting and unknown/missing rules). |\n| Permitted Values | Codeset / validation restrictions / calculation notes, depending on field type. Options tagged `@HIDECHOICES` are excluded. |\n| Collection Guide | Detailed collection guidance (may include field label and field note guidance depending on configuration/tags). |\n| Data Source/Standards/Terminology | Standards / references (from `@DD-STANDARDS` when provided; otherwise blank). |\n\n### Example output\n\n| Data Element Name | Form/Instrument Name | Description | Field Name | Field Type | Purpose | Data Collection | Default Value | Collected When | Data Obligation | Permitted Values | Collection Guide | Data Source/Standards/Terminology |\n|---|---|---|---|---|---|---|---|---|---|---|---|---|\n| Smoking Status | Basic Demography Form | Records the participant’s current tobacco smoking status at time of enrolment. | smoking_status | dropdown | Baseline risk factor assessment for cohort profiling and adjustment in analysis. | Conditional collection (entered by site staff at enrolment) | 9 | `[consent_complete] = '1'` | Mandatory (unknown allowed) | `1, Current smoker \\| 2, Ex-smoker \\| 3, Never smoker \\| 9, Unknown` | Ask the participant: “Do you currently smoke tobacco products?” If unsure, select **Unknown (9)**. | METEOR: 613340 (AIHW); SNOMED CT concepts for tobacco smoking status; FHIR Observation (Tobacco use) |\n\n---\n\n## Support / Issues\n\nWhen reporting an issue, include:\n- REDCap version\n- Module version\n- Steps to reproduce\n- Screenshot(s) and/or a small example project xml file (if possible)\n\n---\n\n## License\n\nGNU General Public License v2.0 ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlmnrc%2Fcustom_codebook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlmnrc%2Fcustom_codebook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlmnrc%2Fcustom_codebook/lists"}