From 7d68956c9127eec06b77f7c5ddda6ea824fb73f9 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Fri, 3 Jul 2020 17:34:38 +0100 Subject: [PATCH 1/7] Add Travis CI build --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..53ce36e3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: python +script: + - echo "from Default.settings import *" > settings.py + - ./generate.py \ No newline at end of file From 187c72f2286fb034953de95530e507a8e3f52e17 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Fri, 3 Jul 2020 17:36:17 +0100 Subject: [PATCH 2/7] Add "ne" to mappings --- Default/mappings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Default/mappings.py b/Default/mappings.py index dc80c4a4..973d96fe 100644 --- a/Default/mappings.py +++ b/Default/mappings.py @@ -63,6 +63,7 @@ # For enum codes where a computer just cannot generate reasonable names enum_map = { '=': 'eq', + '!=': 'ne', '<': 'lt', '<=': 'lte', '>': 'gt', From 54ff6d4dd23a864e59db55852d42b402441524bf Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Fri, 3 Jul 2020 17:36:31 +0100 Subject: [PATCH 3/7] Fix enum name for FHIRUnitTestItem --- fhirunittest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fhirunittest.py b/fhirunittest.py index d976ac46..d411fabd 100644 --- a/fhirunittest.py +++ b/fhirunittest.py @@ -154,7 +154,7 @@ def __init__(self, filepath, path, value, klass, array_item, enum_item): self.value = value self.klass = klass self.array_item = array_item - self.enum = enum_item['name'] if enum_item is not None else None + self.enum = enum_item.name if enum_item is not None else None def create_tests(self, controller): """ Creates as many FHIRUnitTestItem instances as the item defines, or From 60b4a63511611f234a6f5d5777ccdf2da9dd9499 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Fri, 3 Jul 2020 17:43:26 +0100 Subject: [PATCH 4/7] Add exception for broken data --- fhirunittest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fhirunittest.py b/fhirunittest.py index d411fabd..31c76d6a 100644 --- a/fhirunittest.py +++ b/fhirunittest.py @@ -147,7 +147,8 @@ class FHIRUnitTestItem(object): def __init__(self, filepath, path, value, klass, array_item, enum_item): assert path - assert value is not None + if filepath.find("plandefinition-example-cardiology-os") == -1: # this example has a null value + assert value is not None, (filepath, path) assert klass self.filepath = filepath # needed for debug logging self.path = path From 2f96f1235a9353c05d419b1ef22ac5dafe3966dd Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Fri, 3 Jul 2020 17:43:37 +0100 Subject: [PATCH 5/7] Add build badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cfeb44c8..ba7dcdc5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ Python FHIR Parser ================== +[![Build Status](https://travis-ci.org/palfrey/fhir-parser.svg?branch=master)](https://travis-ci.org/palfrey/fhir-parser) A Python FHIR specification parser for model class generation. If you've come here because you want _Swift_ or _Python_ classes for FHIR data models, look at our client libraries instead: From a7be9e8dba42bc58c5ef29538e374b089f583bfc Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Mon, 3 Aug 2020 17:15:54 +0100 Subject: [PATCH 6/7] Set default specification_url to R4 to avoid breaking tests --- Default/settings.py | 3 ++- fhirunittest.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Default/settings.py b/Default/settings.py index c4fd56df..7c374d06 100644 --- a/Default/settings.py +++ b/Default/settings.py @@ -7,7 +7,8 @@ # Base URL for where to load specification data from -specification_url = 'http://hl7.org/fhir/2018May/' +specification_url = 'http://hl7.org/fhir/R4' +#specification_url = 'http://hl7.org/fhir/2018May/' #specification_url = 'http://build.fhir.org' # To which directory to download to diff --git a/fhirunittest.py b/fhirunittest.py index 31c76d6a..f5ad9b0f 100644 --- a/fhirunittest.py +++ b/fhirunittest.py @@ -147,8 +147,7 @@ class FHIRUnitTestItem(object): def __init__(self, filepath, path, value, klass, array_item, enum_item): assert path - if filepath.find("plandefinition-example-cardiology-os") == -1: # this example has a null value - assert value is not None, (filepath, path) + assert value is not None, (filepath, path) assert klass self.filepath = filepath # needed for debug logging self.path = path From 0a8b16fb13ed555a6d8793dc72fa7663b5e00d31 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Tue, 4 Aug 2020 10:16:59 +0100 Subject: [PATCH 7/7] Remove 2018May line --- Default/settings.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Default/settings.py b/Default/settings.py index 7c374d06..252e8655 100644 --- a/Default/settings.py +++ b/Default/settings.py @@ -8,7 +8,6 @@ # Base URL for where to load specification data from specification_url = 'http://hl7.org/fhir/R4' -#specification_url = 'http://hl7.org/fhir/2018May/' #specification_url = 'http://build.fhir.org' # To which directory to download to