Python表示FHIR®规范 https://www.hl7.org/fhir/。
项目描述
Python表示FHIR® https://www.hl7.org/fhir/规范。基于https://github.com/smart-on-fhir/fhir-parser的思想和类结构。
用法
fhirspec.Configuration
控制fhirspec.FHIRSpec行为的类,功能强大且非常方便。可以通过多种方式构建实例,例如从JSON文件(支持json5),从Python模块,从TOML文件,从纯文本文件等。 只接受大写字母变量
>>> import pathlib >>> import os >>> from foo.module import bar >>> from fhirspec import Configuration >>> config1 = Configuration.from_module(bar) >>> config2 = Configuration.from_json_file(pathlib.Path("/json/file/location")) >>> data_dict = { ... "BASE_URL": pathlib.Path(os.path.abspath(__file__)) ... } >>> config3 = Configuration(data_dict=data_dict)
fhirspec.FHIRSpec
主要加载类,构建此实例需要
- required_variables = [
“WRITE_RESOURCES”, “CLASS_MAP”, “REPLACE_MAP”, “NATIVES”, “JSON_MAP”, “JSON_MAP_DEFAULT”, “RESERVED_MAP”, “ENUM_MAP”, “ENUM_NAME_MAP”, “DEFAULT_BASES”, “MANUAL_PROFILES”, “CAMELCASE_CLASSES”, “CAMELCASE_ENUMS”, “BACKBONE_CLASS_ADDS_PARENT”, “RESOURCE_MODULE_LOWERCASE”,]
>>> from fhirspec import Configuration >>> from fhirspec import FHIRSpec >>> config = Configuration( ... { ... "BASE_PATH": "", "WRITE_RESOURCES": True ... } ... ) >>> spec = FHIRSpec(config) >>> "patient" in spec.profiles True
download
从服务器下载任何文件的完美工具,无需依赖第三方库。
>>> from fhirspec import download >>> url = "http://www.africau.edu/images/default/sample.pdf" >>> download_directory = pathlib.Path(os.path.expanduser("~/Downloads")) >>> download(url, download_directory) >>> (download_directory / "sample.pdf").exists() True
历史
0.4.0 (22-12-2022)
FHIR R4B规范支持已添加。
0.3.0 (18-03-2021)
现在每个FHIRClass都包含在规范中定义的其属性(元素)的原始序列。
此外,FHIRClass.expanded_properties_sequence按顺序返回所有可用的属性(与父级合并)。
0.2.5 (02-11-2020)
本版本包含对FHIRStructureDefinitionElement.represents_class问题的全面修复。
0.2.4 (02-11-2020)
没有更多改进,只是与0.2.1相同的版本,并对有问题的0.2.3版本进行覆盖。
0.2.3 (24-09-2020)
建议更新到版本0.2.4
使用FHIRStructureDefinitionElement.is_main_profile_element代替FHIRStructureDefinitionElement.represents_class
0.2.1 (15-06-2020)
对FHIRUnitTest处理空值的微小改进。
0.2.0 (06-06-2020)
FHIRClass.known属性已更改为FHIRClass.__know_classes__和FHIRClass.is_known_class。
支持Python 3.6和3.9
0.1.0 (28-04-2020)
初始版本[nazrulworld]
©版权所有HL7®标志、FHIR®标志和燃烧的火焰是Health Level Seven International拥有的注册商标健康层级七国际
“FHIR®是HL7的注册商标,并经HL7许可使用。FHIR商标的使用并不构成HL7对产品的认可”
项目详情
下载文件
下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源分布
构建分布
fhirspec-0.4.0.tar.gz的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 02a0524c8f58fa01d9c5640529025fff5a77fb013726b45b5a2cc5d3f8d305b4 |
|
MD5 | 86d9efced5e71c922614b831c5b36432 |
|
BLAKE2b-256 | 3cd5b09b748709cc4b8b1134307871952ba049d225e8bdd82539b97c62437f86 |
fhirspec-0.4.0-py3-none-any.whl的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 43b6dc4914c41a7c5a8440132c5fe835c1c9712ab9ee6c40044ecd88fdd798f1 |
|
MD5 | fcf744b3413b03364c99e02081d1a3f8 |
|
BLAKE2b-256 | 047bbeb1c5961f2b4192fab283ca4b254722578055a161709f0651bb51651536 |