Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pipliggins committed Aug 5, 2024
1 parent 5eaba4e commit 998823a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
42 changes: 42 additions & 0 deletions docs/howto/conversion-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,45 @@ The equivalent function to the CLI described above can be used as
```
fhirflat.convert_data_to_flat("data_file_path", "sheet_id", "%Y-%m-%d", "Brazil/East")
```

## Conversion without validation

If you wish to convert your data into FHIRflat, but not perform validation to check the
converted data conforms to the FHIR spec, you can add the `--no-validate` flag:

```bash
fhirflat transform data-file google-sheet-id date-format timezone-name --no-validate
```

The equivalent library function is
```python
fhirflat.convert_data_to_flat(<data_file_path>, <sheet_id>, <date_format>, <timezone>, validate=False)
```

We strongly recommend you don't do this unless necessary for time constraints; some
errors in conversion can cause the parquet file to fail to save (e.g. if columns contain
mixed types due to errors which would be caught during validation).

Data which is already in a FHIRflat format can be validated against the schema using

```bash
fhirflat validate <folder_name>
```

where `folder_name` is the path to the folder containing your flat files. The files **must**
be named according to the corresponding FHIR resource, e.g. the folder containing flat
Encounter data must be named `encounter.parquet`.

The folder can be provided in a compressed format, e.g. zipped; you can specifiy this
using
```bash
fhirflat validate <folder_name> -c "zip"
```

The output folder of validated data will be compressed using the same format.

The equivalent library function is

```python
fhirflat.validate(<folder_name>, compress_format="zip")
```
3 changes: 2 additions & 1 deletion tests/test_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,8 @@ def test_convert_data_to_flat_local_mapping_zipped():
os.remove("tests/ingestion_output.zip")


# This don't run intermittantly - because of the "#NAME" error i get with the googele sheets
# This doesn't run intermittantly - because of the "#NAME" error i get with the google
# sheets
# Turns out this is an issue with custom functions in Google Sheets, not a Python thing.
def test_main(capsys, monkeypatch):
# Simulate command line arguments
Expand Down

0 comments on commit 998823a

Please sign in to comment.