Skip to content

Commit

Permalink
Merge pull request #630 from OHDSI/docs_jan_2024
Browse files Browse the repository at this point in the history
Docs jan 2024
  • Loading branch information
rtmill authored Jan 16, 2024
2 parents 05042bc + c56e5e5 commit 2b1c4ff
Show file tree
Hide file tree
Showing 127 changed files with 34,128 additions and 20,384 deletions.
58 changes: 58 additions & 0 deletions .github/ISSUE_TEMPLATE/use-case.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Use Case
description: Proposal for a new OHDSI Oncology WG Use Case.
title: "[Use Case]: <Add your project's name here>"
labels: ["Use Case"]
projects: "OHDSI/26"
body:
- type: markdown
attributes:
value: |
# OHDSI Oncology WG Use Case
## Project Deliverable
Please provide the following information about your project's deliverable:
- type: textarea
id: deliverable
attributes:
label: Description
description: "What is your deliverable?"
placeholder: "Give a description of your deliverable here"
- type: textarea
id: infrastructure
attributes:
label: Infrastructure
description: "Can this be delivered with existing Infrastructure? If no, what needs to be added?"
placeholder: "Can this be delivered with existing infrastructure?"
- type: textarea
id: timeline
attributes:
label: Timeline
description: "What is your desired timeline for completing this work?"
placeholder: "Explain your desired timeline here"
- type: textarea
id: credit
attributes:
label: Credit
description: "How would you and your team like to receive credit for this work?"
placeholder: "Can this be delivered with existing infrastructure?"
- type: textarea
id: support
attributes:
label: Support
description: "What kind of support does your team need from the workgroup?"
placeholder: "Describe the type of support you will need"
- type: textarea
id: datasets
attributes:
label: Datasets of Interest
description: "Provide a list of datasets (titles, links, descriptions, etc.) that your project is interested in using."
placeholder: "List the datasets your project is interested in using"
- type: markdown
attributes:
value: |
# Use Case Work Orders
- type: textarea
id: depends
attributes:
label: Depends On
description: "Work orders that are associated with this Use Case."
placeholder: "Issue task list goes here. This can be filled out after "
9 changes: 7 additions & 2 deletions NaaccrParser/R/parse_NAACCR.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# main function for parsing fixed-width data
NAACCR_to_db <- function(file_path
,record_id_prefix = NULL
,ndp_schema
,connectionDetails){


Expand Down Expand Up @@ -148,7 +149,7 @@ NAACCR_to_db <- function(file_path

DatabaseConnector::insertTable(connection = conn,
tableName = "naaccr_data_points",
databaseSchema = "NAACCR_OMOP.dbo",
databaseSchema = ndp_schema,
data = tmp_df,
dropTableIfExists = FALSE,
createTable = FALSE,
Expand Down Expand Up @@ -196,6 +197,7 @@ assign_person_id <- function(connectionDetails
# main function for parsing XML
parse_XML_to_DB <- function(file_path
,record_id_prefix = NULL
,ndp_schema
,connectionDetails){

if(is.null(file_path)){
Expand Down Expand Up @@ -420,7 +422,7 @@ parse_XML_to_DB <- function(file_path

DatabaseConnector::insertTable(connection = conn,
tableName = "naaccr_data_points",
databaseSchema = "NAACCR_OMOP.dbo",
databaseSchema = ndp_schema,
data = res,
dropTableIfExists = FALSE,
createTable = FALSE,
Expand All @@ -439,6 +441,7 @@ parse_XML_to_DB <- function(file_path
# umbrella function to parse directory of source files
# can be either fixed width or XML
parse_directory <- function(dir_path
,ndp_schema
,connectionDetails){


Expand All @@ -456,10 +459,12 @@ parse_directory <- function(dir_path
if(fext == "XML"){
parse_XML_to_DB(file_path = curr_file
,record_id_prefix = NULL
,ndp_schema = ndp_schema
,connectionDetails = connectionDetails)
}else{
NAACCR_to_db(file_path = curr_file
,record_id_prefix = NULL
,ndp_schema = ndp_schema
,connectionDetails = connectionDetails)
}

Expand Down
12 changes: 11 additions & 1 deletion NaaccrParser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,21 @@ connectionDetails <- createConnectionDetails(

```

Specify the database schema where the NAACCR_DATA_POINTS table exists.

```r
ndp_schema <- 'NAACCR_OMOP.dbo'

```

There are separate functions for parsing and ingesting fixed-width source files (v16-18) as well as for XML formatted source files (v20+). If you have a collection of files in the same directory you can leverage an umbrella function that parses all files, regardless of version.

### Option 1: (directory specific)

Parse and ingest **all NAACCR files within a specified directory**
```r
parse_directory(dir_path = dir_path # folder containing NAACCR files
,ndp_schema = ndp_schema
,connectionDetails = connectionDetails)

```
Expand All @@ -63,6 +71,7 @@ Parse and ingest a **fixed-width file**:
# Import data into database
NAACCR_to_db(file_path = "path_to_data/naaccr_file.csv"
, record_id_prefix = record_id_prefix # optional
, ndp_schema = ndp_schema
, connectionDetails = connectionDetails)
```

Expand All @@ -73,6 +82,7 @@ Parse and ingest a **XML file**:
# Import data into database
parse_XML_to_DB(file_path = file_path
,record_id_prefix = NULL # optional
,ndp_schema = ndp_schema
,connectionDetails = connectionDetails)
```

Expand All @@ -82,7 +92,7 @@ At this point the data exists in your database without person_id assigned. This

```r
assign_person_id(connectionDetails = connectionDetails
,ndp_schema = 'NAACCR_OMOP.dbo'
,ndp_schema = ndp_schema
,person_map_schema = 'OMOP_COMMON.dbo'
,person_map_table = 'person_map'
,person_map_field = "MRN")
Expand Down
Loading

0 comments on commit 2b1c4ff

Please sign in to comment.