Skip to content

Commit

Permalink
OWL to FHIR
Browse files Browse the repository at this point in the history
- Add: New converter for OWL to FHIR CodeSystem JON (WIP)
- Add: Tests for new converter (WIP)

Misc
- Update: .gitignore: added: .DS_Store
  • Loading branch information
joeflack4 committed Oct 18, 2022
1 parent c5c304a commit 33d5aad
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ db/
notebooks/output/*json
notebooks/output/*tsv
notebooks/input/*


notebooks/api-key.txt

.template.db
.venv
.tox/
.coverage.*

.DS_Store
25 changes: 25 additions & 0 deletions src/oaklib/converters/owl_to_fhir.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Convert OWL to FHIR CodeSystem JSON
TODO's
1. Write functioning converter
2. Optional/Later: Schema mappings (Obograph -> FHIR CodeSystem). SchemaAutomator? Other approach?
3. Add converter to CLI
4. Test(s)
todo's (minor)
1. owl_to_fhir.py -> owl_to_fhir_codesystem.py?
"""
from typing import Dict


def convert(inpath: str, outpath: str) -> Dict:
"""Convert
Side effects:
- Writes file at `outpath`"""

return {}


if __name__ == '__main__':
convert('path/to/mondo-example.owl')
18 changes: 18 additions & 0 deletions tests/test_converters/test_owl_to_fhir.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""Tests for OWL to FHIR CodeSystem converter."""
import unittest

from oaklib.converters.owl_to_fhir import convert
from tests import INPUT_DIR, OUTPUT_DIR


ONT = INPUT_DIR / "mondo-example.owl"
OUT = OUTPUT_DIR / "mondo-example.json"


class OwlToFhirConversionTest(unittest.TestCase):
"""Tests"""

def test_convert(self):
"""Tests basic conversion"""
result = convert(ONT)
self.assertTrue(result != True) # todo

0 comments on commit 33d5aad

Please sign in to comment.