fhir-sheets 1.2.0__tar.gz → 1.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of fhir-sheets might be problematic. Click here for more details.
- fhir_sheets-1.3.0/PKG-INFO +75 -0
- fhir_sheets-1.3.0/README.md +57 -0
- {fhir_sheets-1.2.0 → fhir_sheets-1.3.0}/pyproject.toml +7 -2
- {fhir_sheets-1.2.0 → fhir_sheets-1.3.0}/src/fhir_sheets/core/conversion.py +13 -1
- {fhir_sheets-1.2.0 → fhir_sheets-1.3.0}/src/fhir_sheets/core/fhir_formatting.py +1 -1
- fhir_sheets-1.2.0/PKG-INFO +0 -16
- {fhir_sheets-1.2.0 → fhir_sheets-1.3.0}/LICENSE +0 -0
- {fhir_sheets-1.2.0 → fhir_sheets-1.3.0}/src/fhir_sheets/__init__.py +0 -0
- {fhir_sheets-1.2.0 → fhir_sheets-1.3.0}/src/fhir_sheets/cli/__init__.py +0 -0
- {fhir_sheets-1.2.0 → fhir_sheets-1.3.0}/src/fhir_sheets/cli/main.py +0 -0
- {fhir_sheets-1.2.0 → fhir_sheets-1.3.0}/src/fhir_sheets/core/__init__.py +0 -0
- {fhir_sheets-1.2.0 → fhir_sheets-1.3.0}/src/fhir_sheets/core/model/cohort_data_entity.py +0 -0
- {fhir_sheets-1.2.0 → fhir_sheets-1.3.0}/src/fhir_sheets/core/model/resource_definition_entity.py +0 -0
- {fhir_sheets-1.2.0 → fhir_sheets-1.3.0}/src/fhir_sheets/core/model/resource_link_entity.py +0 -0
- {fhir_sheets-1.2.0 → fhir_sheets-1.3.0}/src/fhir_sheets/core/read_input.py +0 -0
- {fhir_sheets-1.2.0 → fhir_sheets-1.3.0}/src/fhir_sheets/core/special_values.py +0 -0
- {fhir_sheets-1.2.0 → fhir_sheets-1.3.0}/src/fhir_sheets/core/util.py +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fhir-sheets
|
|
3
|
+
Version: 1.3.0
|
|
4
|
+
Summary: FhirSheets is a command-line tool that reads an Excel file in FHIR cohort format and generates FHIR bundle JSON files from it. Each row in the template Excel file is used to create an individual JSON file, outputting them to a specified folder.
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Author: Michael Riley
|
|
7
|
+
Author-email: Michael.Riley@gtri.gatech.edu
|
|
8
|
+
Requires-Python: >=3.13
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
12
|
+
Requires-Dist: et-xmlfile (==1.1.0)
|
|
13
|
+
Requires-Dist: jsonpath-ng (==1.6.1)
|
|
14
|
+
Requires-Dist: openpyxl (==3.1.5)
|
|
15
|
+
Requires-Dist: orjson (==3.10.7)
|
|
16
|
+
Requires-Dist: ply (==3.11)
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# FHIRSheets
|
|
20
|
+
|
|
21
|
+
FhirSheets is a command-line tool that reads an Excel file in FHIR cohort format and generates FHIR bundle JSON files from it. Each row in the template Excel file is used to create an individual JSON file, outputting them to a specified folder.
|
|
22
|
+
|
|
23
|
+
## Table of Contents
|
|
24
|
+
- [FHIRSheets](#fhirsheets)
|
|
25
|
+
- [Table of Contents](#table-of-contents)
|
|
26
|
+
- [Features](#features)
|
|
27
|
+
- [Requirements](#requirements)
|
|
28
|
+
- [Installation](#installation)
|
|
29
|
+
- [Usage](#Usage)
|
|
30
|
+
|
|
31
|
+
## Features
|
|
32
|
+
- Reads an Excel file following the FHIR cohort import template.
|
|
33
|
+
- Converts each row in the Excel file to a FHIR bundle JSON file.
|
|
34
|
+
- Exports generated JSON files to a specified output folder.
|
|
35
|
+
|
|
36
|
+
## Requirements
|
|
37
|
+
- Python 3.x
|
|
38
|
+
- Required Python packages (see `requirements.txt`)
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
1. Clone this repository:
|
|
42
|
+
```bash
|
|
43
|
+
git clone https://github.com/CDCgov/synthetic-data.git
|
|
44
|
+
cd fhir-python-cohort-generation
|
|
45
|
+
2. Install the required packages:
|
|
46
|
+
```bash
|
|
47
|
+
pip install -r requirements.txt
|
|
48
|
+
```
|
|
49
|
+
Or use poetry
|
|
50
|
+
```bash
|
|
51
|
+
poetry build
|
|
52
|
+
```
|
|
53
|
+
## Usage
|
|
54
|
+
1. **Fill Out the Template:**
|
|
55
|
+
- Open the template file `src/resources/Fhir_Cohort_Import_Template.xlsx`.
|
|
56
|
+
- Fill out each row with the relevant data.
|
|
57
|
+
|
|
58
|
+
2. **Run the Tool:**
|
|
59
|
+
- Use the `python -m src.cli.fhirsheets` module script with the required arguments:
|
|
60
|
+
- `--input-file`: The path to the input Excel file.
|
|
61
|
+
- `--output-folder`: The path to the output folder where the JSON files will be saved.
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
python -m src.fhir_sheets.cli.main --input_file src/resources/Fhir_Cohort_Import_Template.xlsx --output_folder /path/to/output/folder
|
|
65
|
+
3. The tool will generate one FHIR bundle JSON file for each row defined in the template.
|
|
66
|
+
|
|
67
|
+
## Example
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
python -m src.fhir_sheets.cli.main --input_file src/resources/Fhir_Cohort_Import_Template.xlsx --output_folder ./output_bundles
|
|
71
|
+
In this example, each row in the `Fhir_Cohort_Import_Template.xlsx` file will be processed, and a corresponding JSON file will be generated in the `output_bundles` folder.
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
This project is licensed under the MIT License. See the `LICENSE` file for more information.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# FHIRSheets
|
|
2
|
+
|
|
3
|
+
FhirSheets is a command-line tool that reads an Excel file in FHIR cohort format and generates FHIR bundle JSON files from it. Each row in the template Excel file is used to create an individual JSON file, outputting them to a specified folder.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
- [FHIRSheets](#fhirsheets)
|
|
7
|
+
- [Table of Contents](#table-of-contents)
|
|
8
|
+
- [Features](#features)
|
|
9
|
+
- [Requirements](#requirements)
|
|
10
|
+
- [Installation](#installation)
|
|
11
|
+
- [Usage](#Usage)
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
- Reads an Excel file following the FHIR cohort import template.
|
|
15
|
+
- Converts each row in the Excel file to a FHIR bundle JSON file.
|
|
16
|
+
- Exports generated JSON files to a specified output folder.
|
|
17
|
+
|
|
18
|
+
## Requirements
|
|
19
|
+
- Python 3.x
|
|
20
|
+
- Required Python packages (see `requirements.txt`)
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
1. Clone this repository:
|
|
24
|
+
```bash
|
|
25
|
+
git clone https://github.com/CDCgov/synthetic-data.git
|
|
26
|
+
cd fhir-python-cohort-generation
|
|
27
|
+
2. Install the required packages:
|
|
28
|
+
```bash
|
|
29
|
+
pip install -r requirements.txt
|
|
30
|
+
```
|
|
31
|
+
Or use poetry
|
|
32
|
+
```bash
|
|
33
|
+
poetry build
|
|
34
|
+
```
|
|
35
|
+
## Usage
|
|
36
|
+
1. **Fill Out the Template:**
|
|
37
|
+
- Open the template file `src/resources/Fhir_Cohort_Import_Template.xlsx`.
|
|
38
|
+
- Fill out each row with the relevant data.
|
|
39
|
+
|
|
40
|
+
2. **Run the Tool:**
|
|
41
|
+
- Use the `python -m src.cli.fhirsheets` module script with the required arguments:
|
|
42
|
+
- `--input-file`: The path to the input Excel file.
|
|
43
|
+
- `--output-folder`: The path to the output folder where the JSON files will be saved.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
python -m src.fhir_sheets.cli.main --input_file src/resources/Fhir_Cohort_Import_Template.xlsx --output_folder /path/to/output/folder
|
|
47
|
+
3. The tool will generate one FHIR bundle JSON file for each row defined in the template.
|
|
48
|
+
|
|
49
|
+
## Example
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
python -m src.fhir_sheets.cli.main --input_file src/resources/Fhir_Cohort_Import_Template.xlsx --output_folder ./output_bundles
|
|
53
|
+
In this example, each row in the `Fhir_Cohort_Import_Template.xlsx` file will be processed, and a corresponding JSON file will be generated in the `output_bundles` folder.
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## License
|
|
57
|
+
This project is licensed under the MIT License. See the `LICENSE` file for more information.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "fhir-sheets"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.3.0"
|
|
4
4
|
description = "FhirSheets is a command-line tool that reads an Excel file in FHIR cohort format and generates FHIR bundle JSON files from it. Each row in the template Excel file is used to create an individual JSON file, outputting them to a specified folder."
|
|
5
5
|
authors = ["Michael Riley <Michael.Riley@gtri.gatech.edu>"]
|
|
6
6
|
packages = [{include = "fhir_sheets", from = "src"}]
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
long-description-content-type = "text/markdown"
|
|
7
9
|
|
|
8
10
|
[tool.poetry.dependencies]
|
|
9
11
|
python = ">=3.13" # Specify the compatible Python version here
|
|
@@ -15,4 +17,7 @@ ply = "3.11"
|
|
|
15
17
|
|
|
16
18
|
[build-system]
|
|
17
19
|
requires = ["poetry-core"]
|
|
18
|
-
build-backend = "poetry.core.masonry.api"
|
|
20
|
+
build-backend = "poetry.core.masonry.api"
|
|
21
|
+
|
|
22
|
+
[pytest]
|
|
23
|
+
testpaths = ["tests"]
|
|
@@ -32,6 +32,13 @@ def initialize_bundle():
|
|
|
32
32
|
root_bundle = {}
|
|
33
33
|
root_bundle['resourceType'] = 'Bundle'
|
|
34
34
|
root_bundle['id'] = str(uuid.uuid4())
|
|
35
|
+
root_bundle['meta'] = {
|
|
36
|
+
'security': [{
|
|
37
|
+
'system': 'http://terminology.hl7.org/CodeSystem/v3-ActReason',
|
|
38
|
+
'code': 'HTEST',
|
|
39
|
+
'display': 'test health data'
|
|
40
|
+
}]
|
|
41
|
+
}
|
|
35
42
|
root_bundle['type'] = 'transaction'
|
|
36
43
|
root_bundle['entry'] = []
|
|
37
44
|
return root_bundle
|
|
@@ -43,7 +50,12 @@ def initialize_resource(resource_definition):
|
|
|
43
50
|
initial_resource['id'] = str(uuid.uuid4()).strip()
|
|
44
51
|
if resource_definition.profiles:
|
|
45
52
|
initial_resource['meta'] = {
|
|
46
|
-
'profile': resource_definition.profiles
|
|
53
|
+
'profile': resource_definition.profiles,
|
|
54
|
+
'security': [{
|
|
55
|
+
'system': 'http://terminology.hl7.org/CodeSystem/v3-ActReason',
|
|
56
|
+
'code': 'HTEST',
|
|
57
|
+
'display': 'test health data'
|
|
58
|
+
}]
|
|
47
59
|
}
|
|
48
60
|
return initial_resource
|
|
49
61
|
|
|
@@ -196,7 +196,7 @@ def parse_flexible_address(address):
|
|
|
196
196
|
country_pattern = r'(?:\s*(?P<country>[\w\s]+|))?$'
|
|
197
197
|
|
|
198
198
|
# Compile the full pattern to match the postal code, state, and country
|
|
199
|
-
full_pattern = rf'^(?P<line>.*?)\^(?P<city>.*?)\^(?P<district>.*?)\^{
|
|
199
|
+
full_pattern = rf'^(?P<line>.*?)\^(?P<city>.*?)\^(?P<district>.*?)\^{postal_code_pattern}\^{state_pattern}\^{country_pattern}'
|
|
200
200
|
|
|
201
201
|
match = re.search(full_pattern, address)
|
|
202
202
|
|
fhir_sheets-1.2.0/PKG-INFO
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: fhir-sheets
|
|
3
|
-
Version: 1.2.0
|
|
4
|
-
Summary: FhirSheets is a command-line tool that reads an Excel file in FHIR cohort format and generates FHIR bundle JSON files from it. Each row in the template Excel file is used to create an individual JSON file, outputting them to a specified folder.
|
|
5
|
-
License-File: LICENSE
|
|
6
|
-
Author: Michael Riley
|
|
7
|
-
Author-email: Michael.Riley@gtri.gatech.edu
|
|
8
|
-
Requires-Python: >=3.13
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
12
|
-
Requires-Dist: et-xmlfile (==1.1.0)
|
|
13
|
-
Requires-Dist: jsonpath-ng (==1.6.1)
|
|
14
|
-
Requires-Dist: openpyxl (==3.1.5)
|
|
15
|
-
Requires-Dist: orjson (==3.10.7)
|
|
16
|
-
Requires-Dist: ply (==3.11)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fhir_sheets-1.2.0 → fhir_sheets-1.3.0}/src/fhir_sheets/core/model/resource_definition_entity.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|