Skip to content

Commit

Permalink
Prepare for 0.0.19 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
chaseastewart committed Jan 20, 2024
1 parent 79098e2 commit bf151c7
Show file tree
Hide file tree
Showing 36 changed files with 4,338 additions and 331 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/jekyll-gh-pages.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/mkdocs-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish docs

on:
push:
branches: [ "main" ]

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install project
run: poetry install --no-interaction
- name: Build Docstrings
run: |
poetry run lazydocs --output-path="./docs/docstrings" --overview-file="README.md" \
--src-base-url="https://github.com/chaseastewart/fhir-converter/blob/master/" \
fhir_converter
- name: Build Mkdocs
run: poetry run mkdocs build --site-dir ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 4 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
permissions:
statuses: write

concurrency:
group: "package"
cancel-in-progress: false

jobs:
linting-check:
runs-on: ubuntu-latest
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ __pycache__/
coverage.xml
junit/
htmlcov/
.pytest_cache
.pytest_cache

#mkdocs
site/
docs/docstrings/
32 changes: 14 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!--intro-start-->
<p align="center">
<img src="https://chaseastewart.github.io/fhir-converter/logo.png" width="360" alt="Python FHIR Converter"/>
<img src="https://github.com/chaseastewart/fhir-converter/blob/main/logo.png?raw=true" width="360" alt="Python FHIR Converter"/>
</p>
<p align="center">
<em>Python FHIR converter, fastish, most nuts and bolts included, ready for production</em>
Expand Down Expand Up @@ -38,6 +39,7 @@ The key features are:
* **Robust**: Get production-ready code

Limitations:

* **Only CDA->FHIR** is currently builtin. Additional work is needed to implement the filters, etc to support FHIR->FHIR and HL7v2->FHIR and back.
* **Python-liquid requires** a comma between parameters to filters. This does not appear to be a restriction with DotLiquid. As a result templates brought to this environment may need commas added.

Expand All @@ -46,7 +48,7 @@ Built on the back of:
* [FHIR-Converter](https://github.com/microsoft/FHIR-Converter)
* [python-liquid](https://github.com/jg-rp/liquid)


<!--intro-end-->
**Table of Contents**

- [Install](#install)
Expand All @@ -58,6 +60,7 @@ Built on the back of:
- [Related Projects](#related-projects)


<!--body-start-->
## Install

Install Python FHIR Converter using [Pipenv](https://pipenv.pypa.io/en/latest/):
Expand All @@ -74,6 +77,7 @@ $ pip install python-fhir-converter

## Links

- Documentation: https://chaseastewart.github.io/fhir-converter/
- PyPi: https://pypi.org/project/python-fhir-converter/
- Source Code: https://github.com/chaseastewart/fhir-converter
- Issue Tracker: https://github.com/chaseastewart/fhir-converter/issues
Expand Down Expand Up @@ -103,21 +107,12 @@ Total time: 0.14s
Finished at: 2024-01-11 10:49:44.182033
Final Memory: 32M
---------------------------------------------------------------

fhir-converter % fhir_converter_cli --template-dir ./data/templates/ccda --from-dir ./data/sample/ccda --to-dir ./data/out --template-name pampi
---------------------------------------------------------------
RENDER SUCCESS
---------------------------------------------------------------
Total time: 0.32s
Finished at: 2024-01-11 10:49:44.182033
Final Memory: 37M
---------------------------------------------------------------
```


## Templates

Templates can be loaded from any python-liquid supported mechanism. To make packaging easier a [ResourceLoader](https://github.com/chaseastewart/fhir-converter/blob/main/fhir_converter/loaders.py#L119) is provided. When a rendering environment is not provided, templates will be loaded from the module [resources](https://github.com/chaseastewart/fhir-converter/tree/main/fhir_converter/templates/ccda). To ease the creation of user defined templates a [TemplateSystemLoader](https://github.com/chaseastewart/fhir-converter/blob/main/fhir_converter/loaders.py#L21) is provided that allows templates to be loaded from a primary and optionally default location. This allows user defined templates to reference templates in the default location. The example user defined [templates](https://github.com/chaseastewart/fhir-converter/tree/main/data/templates/ccda) reuse the default section / header templates.
Templates can be loaded from any python-liquid supported mechanism. To make packaging easier a [ResourceLoader](https://chaseastewart.github.io/fhir-converter/docstrings/loaders/#class-resourceloader) is provided. When a rendering environment is not provided, templates will be loaded from the module [resources](https://github.com/chaseastewart/fhir-converter/tree/main/fhir_converter/templates/ccda). To ease the creation of user defined templates a [TemplateSystemLoader](https://chaseastewart.github.io/fhir-converter/docstrings/loaders/#class-templatesystemloader) is provided that allows templates to be loaded from a primary and optionally default location. This allows user defined templates to reference templates in the default location. The example user defined [templates](https://github.com/chaseastewart/fhir-converter/tree/main/data/templates/ccda) reuse the default section / header templates.


## Benchmark
Expand All @@ -127,11 +122,11 @@ You can run the [benchmark](https://github.com/chaseastewart/fhir-converter/blob
Ordered by: cumulative time
ncalls tottime percall cumtime percall filename:lineno(function)
3 0.000 0.000 12.273 4.091 ./scripts/benchmark.py:75(render_samples)
22 0.003 0.000 12.272 0.558 ./fhir-converter/fhir_converter/renderers.py:187(render_files_to_dir)
484 0.002 0.000 12.258 0.025 ./fhir-converter/fhir_converter/renderers.py:220(render_to_dir)
484 0.010 0.000 12.172 0.025 ./fhir-converter/fhir_converter/renderers.py:93(render_fhir)
484 0.003 0.000 12.004 0.025 ./fhir-converter/fhir_converter/renderers.py:117(render_to_fhir)
3 0.000 0.000 11.164 3.721 ./scripts/benchmark.py:75(render_samples)
22 0.003 0.000 11.164 0.507 ./fhir-converter/fhir_converter/renderers.py:187(render_files_to_dir)
484 0.002 0.000 11.154 0.023 ./fhir-converter/fhir_converter/renderers.py:220(render_to_dir)
484 0.010 0.000 11.017 0.023 ./fhir-converter/fhir_converter/renderers.py:93(render_fhir)
484 0.003 0.000 10.876 0.022 ./fhir-converter/fhir_converter/renderers.py:117(render_to_fhir)
```


Expand All @@ -140,4 +135,5 @@ You can run the [benchmark](https://github.com/chaseastewart/fhir-converter/blob
- [FHIR-Converter](https://github.com/microsoft/FHIR-Converter)
- [python-liquid](https://github.com/jg-rp/liquid)
- [pyjson5](https://github.com/Kijewski/pyjson5)
- [xmltodict](https://github.com/martinblech/xmltodict)
- [xmltodict](https://github.com/martinblech/xmltodict)
<!--body-end-->
Empty file removed data/sample/bad_data/empty.xml
Empty file.
Empty file.
11 changes: 11 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{%
include-markdown "../README.md"
start="<!--intro-start-->"
end="<!--intro-end-->"
%}

{%
include-markdown "../README.md"
start="<!--body-start-->"
end="<!--body-end-->"
%}
123 changes: 123 additions & 0 deletions docs/css/github-dark-dimmed.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/*!
Theme: GitHub Dark Dimmed
Description: Dark dimmed theme as seen on github.com
Author: github.com
Maintainer: @Hirse
Updated: 2021-05-15
Colors taken from GitHub's CSS
*/
.hljs {
color: #adbac7;
background: #22272e;
}

.hljs-doctag,
.hljs-keyword,
.hljs-meta .hljs-keyword,
.hljs-template-tag,
.hljs-template-variable,
.hljs-type,
.hljs-variable.language_ {
/* prettylights-syntax-keyword */
color: #f47067;
}

.hljs-title,
.hljs-title.class_,
.hljs-title.class_.inherited__,
.hljs-title.function_ {
/* prettylights-syntax-entity */
color: #dcbdfb;
}

.hljs-attr,
.hljs-attribute,
.hljs-literal,
.hljs-meta,
.hljs-number,
.hljs-operator,
.hljs-variable,
.hljs-selector-attr,
.hljs-selector-class,
.hljs-selector-id {
/* prettylights-syntax-constant */
color: #6cb6ff;
}

.hljs-regexp,
.hljs-string,
.hljs-meta .hljs-string {
/* prettylights-syntax-string */
color: #96d0ff;
}

.hljs-built_in,
.hljs-symbol {
/* prettylights-syntax-variable */
color: #f69d50;
}

.hljs-comment,
.hljs-code,
.hljs-formula {
/* prettylights-syntax-comment */
color: #768390;
}

.hljs-name,
.hljs-quote,
.hljs-selector-tag,
.hljs-selector-pseudo {
/* prettylights-syntax-entity-tag */
color: #8ddb8c;
}

.hljs-subst {
/* prettylights-syntax-storage-modifier-import */
color: #adbac7;
}

.hljs-section {
/* prettylights-syntax-markup-heading */
color: #316dca;
font-weight: bold;
}

.hljs-bullet {
/* prettylights-syntax-markup-list */
color: #eac55f;
}

.hljs-emphasis {
/* prettylights-syntax-markup-italic */
color: #adbac7;
font-style: italic;
}

.hljs-strong {
/* prettylights-syntax-markup-bold */
color: #adbac7;
font-weight: bold;
}

.hljs-addition {
/* prettylights-syntax-markup-inserted */
color: #b4f1b4;
background-color: #1b4721;
}

.hljs-deletion {
/* prettylights-syntax-markup-deleted */
color: #ffd8d3;
background-color: #78191b;
}

.hljs-char.escape_,
.hljs-link,
.hljs-params,
.hljs-property,
.hljs-punctuation,
.hljs-tag {
/* purposely ignored */
}
Loading

0 comments on commit bf151c7

Please sign in to comment.