pathling 9.6.0.dev0__tar.gz → 9.7.0__tar.gz

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.
Files changed (39) hide show
  1. {pathling-9.6.0.dev0 → pathling-9.7.0}/PKG-INFO +1 -1
  2. {pathling-9.6.0.dev0 → pathling-9.7.0}/examples/bulk.py +13 -11
  3. pathling-9.7.0/examples/designation.py +40 -0
  4. pathling-9.7.0/examples/display.py +32 -0
  5. pathling-9.7.0/examples/encode_bundles.py +37 -0
  6. pathling-9.7.0/examples/encode_resources.py +34 -0
  7. pathling-9.7.0/examples/fhir_search.py +32 -0
  8. {pathling-9.6.0.dev0 → pathling-9.7.0}/examples/fhir_view.py +13 -11
  9. {pathling-9.6.0.dev0 → pathling-9.7.0}/examples/member_of.py +13 -11
  10. {pathling-9.6.0.dev0 → pathling-9.7.0}/examples/property_of.py +13 -11
  11. {pathling-9.6.0.dev0 → pathling-9.7.0}/examples/subsumes.py +13 -11
  12. {pathling-9.6.0.dev0 → pathling-9.7.0}/examples/translate.py +13 -11
  13. {pathling-9.6.0.dev0 → pathling-9.7.0}/pathling/__init__.py +13 -11
  14. {pathling-9.6.0.dev0 → pathling-9.7.0}/pathling/_version.py +2 -2
  15. {pathling-9.6.0.dev0 → pathling-9.7.0}/pathling/bulk.py +13 -11
  16. {pathling-9.6.0.dev0 → pathling-9.7.0}/pathling/coding.py +13 -11
  17. {pathling-9.6.0.dev0 → pathling-9.7.0}/pathling/context.py +13 -11
  18. {pathling-9.6.0.dev0 → pathling-9.7.0}/pathling/core.py +13 -11
  19. {pathling-9.6.0.dev0 → pathling-9.7.0}/pathling/datasink.py +13 -11
  20. {pathling-9.6.0.dev0 → pathling-9.7.0}/pathling/datasource.py +13 -11
  21. pathling-9.7.0/pathling/fhir.py +33 -0
  22. {pathling-9.6.0.dev0 → pathling-9.7.0}/pathling/functions.py +13 -11
  23. {pathling-9.6.0.dev0 → pathling-9.7.0}/pathling/spark.py +13 -12
  24. {pathling-9.6.0.dev0 → pathling-9.7.0}/pathling/udfs.py +13 -11
  25. pathling-9.6.0.dev0/examples/designation.py +0 -38
  26. pathling-9.6.0.dev0/examples/display.py +0 -30
  27. pathling-9.6.0.dev0/examples/encode_bundles.py +0 -35
  28. pathling-9.6.0.dev0/examples/encode_resources.py +0 -32
  29. pathling-9.6.0.dev0/examples/fhir_search.py +0 -30
  30. pathling-9.6.0.dev0/pathling/fhir.py +0 -31
  31. {pathling-9.6.0.dev0 → pathling-9.7.0}/.gitignore +0 -0
  32. {pathling-9.6.0.dev0 → pathling-9.7.0}/LICENSE +0 -0
  33. {pathling-9.6.0.dev0 → pathling-9.7.0}/README.md +0 -0
  34. {pathling-9.6.0.dev0 → pathling-9.7.0}/examples/data/bundles/Bennett146_Swaniawski813_704c9750-f6e6-473b-ee83-fbd48e07fe3f.json +0 -0
  35. {pathling-9.6.0.dev0 → pathling-9.7.0}/examples/data/bundles/Dino214_Parisian75_40d82b80-b682-cd8b-da6d-396809878641.json +0 -0
  36. {pathling-9.6.0.dev0 → pathling-9.7.0}/examples/data/csv/conditions.csv +0 -0
  37. {pathling-9.6.0.dev0 → pathling-9.7.0}/examples/data/resources/Condition.ndjson +0 -0
  38. {pathling-9.6.0.dev0 → pathling-9.7.0}/examples/data/resources/Patient.ndjson +0 -0
  39. {pathling-9.6.0.dev0 → pathling-9.7.0}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pathling
3
- Version: 9.6.0.dev0
3
+ Version: 9.7.0
4
4
  Summary: Python API for Pathling
5
5
  Project-URL: Homepage, https://github.com/aehrc/pathling
6
6
  Author-email: "Australian e-Health Research Centre, CSIRO" <pathling@csiro.au>
@@ -1,17 +1,19 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
1
  #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
7
4
  #
8
- # http://www.apache.org/licenses/LICENSE-2.0
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
9
16
  #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
17
 
16
18
  import os
17
19
  import tempfile
@@ -0,0 +1,40 @@
1
+ #
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ import os
19
+
20
+ from pathling import Coding, PathlingContext, designation, to_snomed_coding
21
+
22
+ HERE = os.path.abspath(os.path.dirname(__file__))
23
+
24
+ pc = PathlingContext.create()
25
+
26
+ csv = pc.spark.read.options(header=True).csv(
27
+ f"file://{os.path.join(HERE, 'data/csv/conditions.csv')}"
28
+ )
29
+
30
+ # Obtain display name for snomed codes
31
+
32
+ SNOMED_FULLY_SPECIFIED_NAME = Coding.of_snomed("900000000000003001")
33
+
34
+ result = csv.withColumn(
35
+ "FULL_NAME",
36
+ designation(to_snomed_coding(csv.CODE), SNOMED_FULLY_SPECIFIED_NAME, "en").getItem(
37
+ 0
38
+ ),
39
+ )
40
+ result.select("CODE", "DESCRIPTION", "FULL_NAME").show()
@@ -0,0 +1,32 @@
1
+ #
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ import os
19
+
20
+ from pathling import PathlingContext, display, to_snomed_coding
21
+
22
+ HERE = os.path.abspath(os.path.dirname(__file__))
23
+
24
+ pc = PathlingContext.create()
25
+
26
+ csv = pc.spark.read.options(header=True).csv(
27
+ f"file://{os.path.join(HERE, 'data/csv/conditions.csv')}"
28
+ )
29
+
30
+ # Obtain display name for snomed codes
31
+ result = csv.withColumn("DISPLAY_NAME", display(to_snomed_coding(csv.CODE)))
32
+ result.select("CODE", "DESCRIPTION", "DISPLAY_NAME").show()
@@ -0,0 +1,37 @@
1
+ #
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ import os
19
+
20
+ from pathling import PathlingContext
21
+
22
+ HERE = os.path.abspath(os.path.dirname(__file__))
23
+
24
+ pc = PathlingContext.create()
25
+
26
+ # Read each Bundle into a row within a Spark data set.
27
+ bundles_dir = os.path.join(HERE, "data/bundles/")
28
+ bundles = pc.spark.read.text(bundles_dir, wholetext=True)
29
+
30
+ # Convert the data set of strings into a structured FHIR data set.
31
+ patients = pc.encode_bundle(bundles, "Patient")
32
+
33
+ # JSON is the default format, XML Bundles can be encoded using input type.
34
+ # patients = pc.encodeBundle(bundles, 'Patient', inputType=MimeType.FHIR_XML)
35
+
36
+ # Do some stuff.
37
+ patients.select("id", "gender", "birthDate").show()
@@ -0,0 +1,34 @@
1
+ #
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ import os
19
+
20
+ from pathling import PathlingContext
21
+
22
+ HERE = os.path.abspath(os.path.dirname(__file__))
23
+
24
+ pc = PathlingContext.create()
25
+
26
+ # Read each line from the NDJSON into a row within a Spark data set.
27
+ ndjson_dir = os.path.join(HERE, "data/resources/")
28
+ json_resources = pc.spark.read.text(ndjson_dir)
29
+
30
+ # Convert the data set of strings into a structured FHIR data set.
31
+ patients = pc.encode(json_resources, "Patient")
32
+
33
+ # Do some stuff.
34
+ patients.select("id", "gender", "birthDate").show()
@@ -0,0 +1,32 @@
1
+ #
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ import os
19
+
20
+ from pathling import PathlingContext
21
+
22
+ HERE = os.path.abspath(os.path.dirname(__file__))
23
+ DATA_DIR = os.path.join(HERE, "data")
24
+ NDJSON_DIR = os.path.join(DATA_DIR, "resources")
25
+
26
+ pc = PathlingContext.create()
27
+ datasource = pc.read.ndjson(NDJSON_DIR)
28
+
29
+ search_filter = pc.search_to_column("Patient", "gender=male&family=MacGyver")
30
+ datasource.read("Patient").filter(search_filter).select(
31
+ "id", "gender", "name.family"
32
+ ).show()
@@ -1,17 +1,19 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
1
  #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
7
4
  #
8
- # http://www.apache.org/licenses/LICENSE-2.0
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
9
16
  #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
17
 
16
18
  import os
17
19
 
@@ -1,17 +1,19 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
1
  #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
7
4
  #
8
- # http://www.apache.org/licenses/LICENSE-2.0
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
9
16
  #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
17
 
16
18
  import os
17
19
 
@@ -1,17 +1,19 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
1
  #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
7
4
  #
8
- # http://www.apache.org/licenses/LICENSE-2.0
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
9
16
  #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
17
 
16
18
  import os
17
19
 
@@ -1,17 +1,19 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
1
  #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
7
4
  #
8
- # http://www.apache.org/licenses/LICENSE-2.0
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
9
16
  #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
17
 
16
18
  import os
17
19
 
@@ -1,17 +1,19 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
1
  #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
7
4
  #
8
- # http://www.apache.org/licenses/LICENSE-2.0
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
9
16
  #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
17
 
16
18
  import os
17
19
 
@@ -1,17 +1,19 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
1
  #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
7
4
  #
8
- # http://www.apache.org/licenses/LICENSE-2.0
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
9
16
  #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
17
 
16
18
  from .coding import Coding
17
19
  from .context import PathlingContext, StorageType
@@ -2,8 +2,8 @@
2
2
  # Auto generated from POM project version.
3
3
  # Please do not modify.
4
4
  #
5
- __version__="9.6.0.dev0"
6
- __java_version__="9.6.0-SNAPSHOT"
5
+ __version__="9.7.0"
6
+ __java_version__="9.7.0-SNAPSHOT"
7
7
  __scala_version__="2.13"
8
8
  __delta_version__="4.0.0"
9
9
  __hadoop_version__="3.4.1"
@@ -1,17 +1,19 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
1
  #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
7
4
  #
8
- # http://www.apache.org/licenses/LICENSE-2.0
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
9
16
  #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
17
 
16
18
  from dataclasses import dataclass
17
19
  from datetime import datetime, timezone
@@ -1,17 +1,19 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
1
  #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
7
4
  #
8
- # http://www.apache.org/licenses/LICENSE-2.0
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
9
16
  #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
17
 
16
18
  from typing import Optional
17
19
 
@@ -1,17 +1,19 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
1
  #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
7
4
  #
8
- # http://www.apache.org/licenses/LICENSE-2.0
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
9
16
  #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
17
 
16
18
  # noinspection PyPackageRequirements
17
19
 
@@ -1,17 +1,19 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
1
  #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
7
4
  #
8
- # http://www.apache.org/licenses/LICENSE-2.0
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
9
16
  #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
17
 
16
18
  from typing import Any, Callable, Optional, Sequence, Tuple, Union
17
19
 
@@ -1,17 +1,19 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
1
  #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
7
4
  #
8
- # http://www.apache.org/licenses/LICENSE-2.0
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
9
16
  #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
17
 
16
18
  from dataclasses import dataclass
17
19
  from typing import TYPE_CHECKING, Callable, List, Optional
@@ -1,17 +1,19 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
1
  #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
7
4
  #
8
- # http://www.apache.org/licenses/LICENSE-2.0
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
9
16
  #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
17
 
16
18
  from datetime import datetime
17
19
  from json import dumps, loads
@@ -0,0 +1,33 @@
1
+ #
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+
19
+ class MimeType:
20
+ """
21
+ Constants for FHIR encoding mime types.
22
+ """
23
+
24
+ FHIR_JSON: str = "application/fhir+json"
25
+ FHIR_XML: str = "application/fhir+xml"
26
+
27
+
28
+ class Version:
29
+ """
30
+ Constants for FHIR versions.
31
+ """
32
+
33
+ R4: str = "R4"
@@ -1,17 +1,19 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
1
  #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
7
4
  #
8
- # http://www.apache.org/licenses/LICENSE-2.0
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
9
16
  #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
17
 
16
18
  import urllib.parse
17
19
  from typing import Optional
@@ -1,18 +1,19 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
1
  #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
7
4
  #
8
- # http://www.apache.org/licenses/LICENSE-2.0
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
9
16
  #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
17
 
17
18
  import uuid
18
19
 
@@ -1,17 +1,19 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
1
  #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
2
+ # Copyright © 2018-2026 Commonwealth Scientific and Industrial Research
3
+ # Organisation (CSIRO) ABN 41 687 119 230.
7
4
  #
8
- # http://www.apache.org/licenses/LICENSE-2.0
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
9
16
  #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
17
 
16
18
  from typing import Any, Collection, Optional, Union
17
19
 
@@ -1,38 +0,0 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- import os
17
-
18
- from pathling import Coding, PathlingContext, designation, to_snomed_coding
19
-
20
- HERE = os.path.abspath(os.path.dirname(__file__))
21
-
22
- pc = PathlingContext.create()
23
-
24
- csv = pc.spark.read.options(header=True).csv(
25
- f"file://{os.path.join(HERE, 'data/csv/conditions.csv')}"
26
- )
27
-
28
- # Obtain display name for snomed codes
29
-
30
- SNOMED_FULLY_SPECIFIED_NAME = Coding.of_snomed("900000000000003001")
31
-
32
- result = csv.withColumn(
33
- "FULL_NAME",
34
- designation(to_snomed_coding(csv.CODE), SNOMED_FULLY_SPECIFIED_NAME, "en").getItem(
35
- 0
36
- ),
37
- )
38
- result.select("CODE", "DESCRIPTION", "FULL_NAME").show()
@@ -1,30 +0,0 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- import os
17
-
18
- from pathling import PathlingContext, display, to_snomed_coding
19
-
20
- HERE = os.path.abspath(os.path.dirname(__file__))
21
-
22
- pc = PathlingContext.create()
23
-
24
- csv = pc.spark.read.options(header=True).csv(
25
- f"file://{os.path.join(HERE, 'data/csv/conditions.csv')}"
26
- )
27
-
28
- # Obtain display name for snomed codes
29
- result = csv.withColumn("DISPLAY_NAME", display(to_snomed_coding(csv.CODE)))
30
- result.select("CODE", "DESCRIPTION", "DISPLAY_NAME").show()
@@ -1,35 +0,0 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- import os
17
-
18
- from pathling import PathlingContext
19
-
20
- HERE = os.path.abspath(os.path.dirname(__file__))
21
-
22
- pc = PathlingContext.create()
23
-
24
- # Read each Bundle into a row within a Spark data set.
25
- bundles_dir = os.path.join(HERE, "data/bundles/")
26
- bundles = pc.spark.read.text(bundles_dir, wholetext=True)
27
-
28
- # Convert the data set of strings into a structured FHIR data set.
29
- patients = pc.encode_bundle(bundles, "Patient")
30
-
31
- # JSON is the default format, XML Bundles can be encoded using input type.
32
- # patients = pc.encodeBundle(bundles, 'Patient', inputType=MimeType.FHIR_XML)
33
-
34
- # Do some stuff.
35
- patients.select("id", "gender", "birthDate").show()
@@ -1,32 +0,0 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- import os
17
-
18
- from pathling import PathlingContext
19
-
20
- HERE = os.path.abspath(os.path.dirname(__file__))
21
-
22
- pc = PathlingContext.create()
23
-
24
- # Read each line from the NDJSON into a row within a Spark data set.
25
- ndjson_dir = os.path.join(HERE, "data/resources/")
26
- json_resources = pc.spark.read.text(ndjson_dir)
27
-
28
- # Convert the data set of strings into a structured FHIR data set.
29
- patients = pc.encode(json_resources, "Patient")
30
-
31
- # Do some stuff.
32
- patients.select("id", "gender", "birthDate").show()
@@ -1,30 +0,0 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- import os
17
-
18
- from pathling import PathlingContext
19
-
20
- HERE = os.path.abspath(os.path.dirname(__file__))
21
- DATA_DIR = os.path.join(HERE, "data")
22
- NDJSON_DIR = os.path.join(DATA_DIR, "resources")
23
-
24
- pc = PathlingContext.create()
25
- datasource = pc.read.ndjson(NDJSON_DIR)
26
-
27
- search_filter = pc.search_to_column("Patient", "gender=male&family=MacGyver")
28
- datasource.read("Patient").filter(search_filter).select(
29
- "id", "gender", "name.family"
30
- ).show()
@@ -1,31 +0,0 @@
1
- # Copyright © 2018-2025 Commonwealth Scientific and Industrial Research
2
- # Organisation (CSIRO) ABN 41 687 119 230.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
-
17
- class MimeType:
18
- """
19
- Constants for FHIR encoding mime types.
20
- """
21
-
22
- FHIR_JSON: str = "application/fhir+json"
23
- FHIR_XML: str = "application/fhir+xml"
24
-
25
-
26
- class Version:
27
- """
28
- Constants for FHIR versions.
29
- """
30
-
31
- R4: str = "R4"
File without changes
File without changes
File without changes
File without changes