fhir-sheets 1.2.0__py3-none-any.whl → 1.3.0__py3-none-any.whl

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.

@@ -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>.*?)\^{state_pattern}\^{postal_code_pattern}\^{country_pattern}'
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
 
@@ -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.
@@ -2,15 +2,15 @@ fhir_sheets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  fhir_sheets/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  fhir_sheets/cli/main.py,sha256=UlQn3i_aaZEpCk7DaOQwiRRQoL7-lup_HepbR7x-Qkc,2668
4
4
  fhir_sheets/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- fhir_sheets/core/conversion.py,sha256=AkhAlQceI3U1Ho8711TPTmP-msY65XjpgbTYNq91mj0,18482
6
- fhir_sheets/core/fhir_formatting.py,sha256=kGnXZe3RusafxuCz_tp4bBZbdIAFWXJ4ZRrnG2iQYfo,13011
5
+ fhir_sheets/core/conversion.py,sha256=a1ZkKZ2fEdGQLyThZNyOBcOT0r9DARCxeFcbL9Dnhfk,18911
6
+ fhir_sheets/core/fhir_formatting.py,sha256=eNM38Cp7TEdND1fIKhp2HTwzGYDqgWtr13A1qRT06cY,13011
7
7
  fhir_sheets/core/model/cohort_data_entity.py,sha256=rcPwn_FecsYkX0wgi7DaZMBXJ43S8a5tg4Lxnp6PCyQ,3308
8
8
  fhir_sheets/core/model/resource_definition_entity.py,sha256=NYOBjGz2LyfjI9LVl7j34fcAp-qEmzrBTg9ZLpFfDxA,738
9
9
  fhir_sheets/core/model/resource_link_entity.py,sha256=-iCzGaKJt5ZISTSwBVmEuLIKzgRtbL_I7JRpoEc89h0,812
10
10
  fhir_sheets/core/read_input.py,sha256=08MFs_dxv-QidrloSS1w40CH-4__1M5Loq_rufb8aBc,5810
11
11
  fhir_sheets/core/special_values.py,sha256=KwpJLggH3-BSH8NrGtRTtVBz0fl-iH7swxPwBb3iMx4,15513
12
12
  fhir_sheets/core/util.py,sha256=gudEPi_xTDC9YHqUlGEkn_tA26HbhNjuqGgjtuOEINk,9
13
- fhir_sheets-1.2.0.dist-info/METADATA,sha256=LwFMslfkuJmVev_hcUFRgz00lZIV7jP4XDaS6hykIkw,739
14
- fhir_sheets-1.2.0.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
15
- fhir_sheets-1.2.0.dist-info/licenses/LICENSE,sha256=Qv2ilebwoUtMJnRsZwRy729xS5JZQzLauJ0tQzkAkTA,1088
16
- fhir_sheets-1.2.0.dist-info/RECORD,,
13
+ fhir_sheets-1.3.0.dist-info/METADATA,sha256=bdnzbYz0J2kVTDMxc4CFrXdPrfgpXWySUOFypmJZw84,2911
14
+ fhir_sheets-1.3.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
15
+ fhir_sheets-1.3.0.dist-info/licenses/LICENSE,sha256=Qv2ilebwoUtMJnRsZwRy729xS5JZQzLauJ0tQzkAkTA,1088
16
+ fhir_sheets-1.3.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.2.0
2
+ Generator: poetry-core 2.2.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -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)