compressedfhir 1.0.5__py3-none-any.whl → 1.0.6__py3-none-any.whl

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.

Potentially problematic release.


This version of compressedfhir might be problematic. Click here for more details.

@@ -156,3 +156,11 @@ class FhirResource(CompressedDict[str, Any]):
156
156
  raw_dict
157
157
  )
158
158
  return json.dumps(obj=raw_dict, cls=FhirJSONEncoder)
159
+
160
+ def to_fhir_dict(self) -> Dict[str, Any]:
161
+ """
162
+ Convert the resource to a FHIR-compliant dictionary.
163
+
164
+ :return: A dictionary representation of the resource.
165
+ """
166
+ return cast(Dict[str, Any], json.loads(self.json()))
@@ -1,4 +1,5 @@
1
1
  import logging
2
+ from collections import OrderedDict
2
3
  from datetime import datetime, timezone, date
3
4
  from decimal import Decimal
4
5
  from logging import Logger
@@ -68,6 +69,8 @@ def test_nested_dict() -> None:
68
69
  """
69
70
  logger: Logger = logging.getLogger(__name__)
70
71
  nested_dict = {
72
+ "resourceType": "Coverage",
73
+ "id": "3456789012345670304",
71
74
  "beneficiary": {"reference": "Patient/1234567890123456703", "type": "Patient"},
72
75
  "class": [
73
76
  {
@@ -94,7 +97,6 @@ def test_nested_dict() -> None:
94
97
  },
95
98
  }
96
99
  ],
97
- "id": "3456789012345670304",
98
100
  "identifier": [
99
101
  {
100
102
  "system": "https://sources.aetna.com/coverage/identifier/membershipid/59",
@@ -144,7 +146,6 @@ def test_nested_dict() -> None:
144
146
  }
145
147
  ]
146
148
  },
147
- "resourceType": "Coverage",
148
149
  "status": "active",
149
150
  "subscriber": {"reference": "Patient/1234567890123456703", "type": "Patient"},
150
151
  "subscriberId": "435679010300",
@@ -160,12 +161,16 @@ def test_nested_dict() -> None:
160
161
  }
161
162
 
162
163
  logger.info("-------- Serialized --------")
163
- serialized = TypePreservationSerializer.serialize(nested_dict)
164
+ serialized: str = TypePreservationSerializer.serialize(nested_dict)
164
165
  logger.info(serialized)
165
166
  logger.info("-------- Deserialized --------")
166
- deserialized = TypePreservationSerializer.deserialize(serialized)
167
+ deserialized: OrderedDict[str, Any] = TypePreservationSerializer.deserialize(
168
+ serialized
169
+ )
167
170
  logger.info(deserialized)
168
171
 
172
+ assert isinstance(deserialized, OrderedDict)
173
+
169
174
  assert isinstance(deserialized["period"]["start"], date)
170
175
  assert isinstance(deserialized["period"]["end"], date)
171
176
  assert nested_dict == deserialized
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compressedfhir
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Summary: Stores FHIR JSON resources in compressed form in memory
5
5
  Home-page: https://github.com/icanbwell/compressed-fhir
6
6
  Author: Imran Qureshi
@@ -11,7 +11,7 @@ compressedfhir/fhir/fhir_bundle_entry_search.py,sha256=uYVJxuNN3gt3Q6BZ5FhRs47x7
11
11
  compressedfhir/fhir/fhir_identifier.py,sha256=tA_nmhBaYHu5zjJdE0IWMFEF8lrIPV3_nu-yairiIKw,2711
12
12
  compressedfhir/fhir/fhir_link.py,sha256=jf2RrwmsPrKW3saP77y42xVqI0xwHFYXxm6YHQJk7gU,1922
13
13
  compressedfhir/fhir/fhir_meta.py,sha256=vNI4O6SoG4hJRHyd-bJ_QnYFTfBHyR3UA6h21ByQmWo,1669
14
- compressedfhir/fhir/fhir_resource.py,sha256=5v_xcAUCFcqzQodT8uiw292NUG86gWJ4UbyhY2Vy79c,5084
14
+ compressedfhir/fhir/fhir_resource.py,sha256=WDrS6ZAQARsTfEsKNhNIgCw8vir_U-1nBzFGt510OBw,5340
15
15
  compressedfhir/fhir/fhir_resource_list.py,sha256=qlAAwWWphtFicBxPG8iriz2eOHGcrWJk5kGThmvkbPE,4480
16
16
  compressedfhir/fhir/fhir_resource_map.py,sha256=XFJ0o5_kLUeHYKp1q_Bxsoyp2-rLX7P4c9FwQ7YfGWM,6571
17
17
  compressedfhir/fhir/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -40,7 +40,7 @@ compressedfhir/utilities/json_serializers/type_preservation_serializer.py,sha256
40
40
  compressedfhir/utilities/json_serializers/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  compressedfhir/utilities/json_serializers/test/test_type_preservation_decoder.py,sha256=GQotwYQJe9VZQotvLWmQWMkSIBne53bolmgflBoR7DU,4752
42
42
  compressedfhir/utilities/json_serializers/test/test_type_preservation_encoder.py,sha256=O4VczBdsJF35WozZiwSdJ8638qDn01JQsai2wTXu5Vo,1737
43
- compressedfhir/utilities/json_serializers/test/test_type_preservation_serializer.py,sha256=dTYdgI1wMgWU0DJCNJlbMmsnhr-Q_2SPXeydLsn70rA,6043
43
+ compressedfhir/utilities/json_serializers/test/test_type_preservation_serializer.py,sha256=jRl0UEzvsjj1Kl2_7VYCf3kaJch9UZ2-8VHdKZC69xo,6171
44
44
  compressedfhir/utilities/ordered_dict_to_dict_converter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
45
  compressedfhir/utilities/ordered_dict_to_dict_converter/ordered_dict_to_dict_converter.py,sha256=CMerJQD7O0vMyGtUp1rKSerZA1tDZeY5GTQT3AykL4w,831
46
46
  compressedfhir/utilities/string_compressor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -51,9 +51,9 @@ compressedfhir/utilities/string_compressor/v1/test/test_string_compressor.py,sha
51
51
  compressedfhir/utilities/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  compressedfhir/utilities/test/test_fhir_json_encoder.py,sha256=6pbNmZp5eBWY66bHjgjm_pZVhs5HDKP8hCGnwNFzpEw,5171
53
53
  compressedfhir/utilities/test/test_json_helpers.py,sha256=V0R9oHDQAs0m0012niEz50sHJxMSUQvA3km7kK8HgjE,3860
54
- compressedfhir-1.0.5.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
54
+ compressedfhir-1.0.6.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
55
55
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
- compressedfhir-1.0.5.dist-info/METADATA,sha256=jitzP2jc8_vqD1C9RYDNyetYivS_DOHuUplgJZy8t20,3456
57
- compressedfhir-1.0.5.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
58
- compressedfhir-1.0.5.dist-info/top_level.txt,sha256=YMKdvBBdiCzFbpI9fG8BUDjaRd-f4R0qAvUoVETpoWw,21
59
- compressedfhir-1.0.5.dist-info/RECORD,,
56
+ compressedfhir-1.0.6.dist-info/METADATA,sha256=v6J1S0AOuckbI1u8KvB-OlP1BU1XyIqZ4TPnldH7sAI,3456
57
+ compressedfhir-1.0.6.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
58
+ compressedfhir-1.0.6.dist-info/top_level.txt,sha256=YMKdvBBdiCzFbpI9fG8BUDjaRd-f4R0qAvUoVETpoWw,21
59
+ compressedfhir-1.0.6.dist-info/RECORD,,