{"id":21233182,"url":"https://github.com/stanfordspezi/spezifhir","last_synced_at":"2025-12-11T22:53:18.018Z","repository":{"id":79564951,"uuid":"602415289","full_name":"StanfordSpezi/SpeziFHIR","owner":"StanfordSpezi","description":"The Spezi FHIR Standard \u0026 Related Modules","archived":false,"fork":false,"pushed_at":"2025-06-05T01:07:12.000Z","size":3994,"stargazers_count":12,"open_issues_count":9,"forks_count":3,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-07-06T19:58:22.042Z","etag":null,"topics":["fhir","ios","spezi","stanford","swift","xcode"],"latest_commit_sha":null,"homepage":"https://swiftpackageindex.com/StanfordSpezi/SpeziFHIR/documentation/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StanfordSpezi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":["spezi.sites.stanford.edu"]}},"created_at":"2023-02-16T06:45:47.000Z","updated_at":"2025-05-07T22:23:18.000Z","dependencies_parsed_at":"2023-11-12T00:22:23.286Z","dependency_job_id":"4439f02f-3d7f-41ea-b165-b3fdb6d9b653","html_url":"https://github.com/StanfordSpezi/SpeziFHIR","commit_stats":null,"previous_names":["StanfordBDHG/CardinalKitFHIR","stanfordbdhg/cardinalkitfhir"],"tags_count":23,"template":false,"template_full_name":"StanfordBDHG/SwiftPackageTemplate","purl":"pkg:github/StanfordSpezi/SpeziFHIR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanfordSpezi%2FSpeziFHIR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanfordSpezi%2FSpeziFHIR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanfordSpezi%2FSpeziFHIR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanfordSpezi%2FSpeziFHIR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StanfordSpezi","download_url":"https://codeload.github.com/StanfordSpezi/SpeziFHIR/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanfordSpezi%2FSpeziFHIR/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264618998,"owners_count":23638389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fhir","ios","spezi","stanford","swift","xcode"],"created_at":"2024-11-20T23:56:21.606Z","updated_at":"2025-12-11T22:53:18.014Z","avatar_url":"https://github.com/StanfordSpezi.png","language":"Swift","funding_links":["spezi.sites.stanford.edu"],"categories":[],"sub_categories":[],"readme":"\u003c!--\n\nThis source file is part of the Stanford Spezi open-source project.\n\nSPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)\n\nSPDX-License-Identifier: MIT\n  \n--\u003e\n\n# Spezi FHIR\n\n[![Build and Test](https://github.com/StanfordSpezi/SpeziFHIR/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/StanfordSpezi/SpeziFHIR/actions/workflows/build-and-test.yml)\n[![codecov](https://codecov.io/gh/StanfordSpezi/SpeziFHIR/branch/main/graph/badge.svg?token=zVpvbIrHL6)](https://codecov.io/gh/StanfordSpezi/SpeziFHIR)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7803123.svg)](https://doi.org/10.5281/zenodo.7803123)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FStanfordSpezi%2FSpeziFHIR%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/StanfordSpezi/SpeziFHIR)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FStanfordSpezi%2FSpeziFHIR%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/StanfordSpezi/SpeziFHIR)\n\nBuild FHIR-based healthcare applications with Spezi.\n\n## Overview\n\nThe Spezi FHIR Swift Package provides essential building blocks for developing FHIR-based mobile healthcare applications using the Spezi framework. It includes comprehensive tools for FHIR resource management, HealthKit integration, and mock patient data for testing and development.\n\n## Setup\n\n### Add SpeziFHIR as a Dependency\n\nYou need to add the SpeziFHIR Swift package to\n[your app in Xcode](https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app#) or\n[Swift package](https://developer.apple.com/documentation/xcode/creating-a-standalone-swift-package-with-xcode#Add-a-dependency-on-another-Swift-package).\n\n\u003e [!IMPORTANT]  \n\u003e If your application is not yet configured to use Spezi, follow the [Spezi setup article](https://swiftpackageindex.com/stanfordspezi/spezi/documentation/spezi/initial-setup) to set up the core Spezi infrastructure.\n\n\n## Targets\n\nSpezi FHIR provides a number of targets to help developers integrate FHIR functionality in their Spezi-based applications:\n\n- [`SpeziFHIR`](https://swiftpackageindex.com/stanfordspezi/spezifhir/documentation/spezifhir): Core FHIR resource management, storage, and utilities for working with FHIR R4 and DSTU2 resources.\n- [`SpeziFHIRHealthKit`](https://swiftpackageindex.com/stanfordspezi/spezifhir/documentation/spezifhirhealthkit): Seamless integration between HealthKit data and FHIR resources, enabling conversion of health data to FHIR format.\n- [`SpeziFHIRMockPatients`](https://swiftpackageindex.com/stanfordspezi/spezifhir/documentation/spezifhirmockpatients): Mock patient data and FHIR bundles for testing and development purposes.\n\n### SpeziFHIR\n\nThe core module provides essential FHIR functionality including the `FHIRStore`, an observable store for managing and organizing FHIR resources by category. The `FHIRResource` type serves as a wrapper for FHIR resources with additional metadata and utilities. Combined, they provide tools for searching, copying, and manipulating FHIR resources that are compatible with both FHIR R4 and DSTU2 specifications.\n\n#### FHIRStore\n\nConfigure the `FHIRStore` in your `SpeziAppDelegate` to manage FHIR resources in your application:\n\n```swift\nimport Spezi\nimport SpeziFHIR\n\n\nclass ExampleAppDelegate: SpeziAppDelegate {\n    override var configuration: Configuration {\n        Configuration {\n            FHIRStore()\n        }\n    }\n}\n```\n\nUse the `FHIRStore` to manage FHIR resources in your application as well as adding and removing `FHIRResource`s in the `FHIRStore`.\n\n```swift\nimport SpeziFHIR\nimport SwiftUI\n\n\nstruct ExampleView: View {\n    @Environment(FHIRStore.self) private var fhirStore\n    \n\n    var body: some View {\n        List {\n            Section(\"Observations\") {\n                ForEach(fhirStore.observations) { observation in\n                    Text(observation.displayName)\n                }\n            }\n            \n            Section(\"Conditions\") {\n                ForEach(fhirStore.conditions) { condition in\n                    Text(condition.displayName)\n                }\n            }\n        }\n    }\n}\n```\n\n### SpeziFHIRHealthKit\n\nSeamlessly integrate HealthKit data with FHIR resources including easy ways to add `HKSample`s to the `FHIRStore` while loading attachments from the FHIR resources stored in HealthKit or attached information such as voltage information of symptoms for electrocardiograms.\nFor more information, please refer to the [API documentation](https://swiftpackageindex.com/stanfordspezi/spezifhir/documentation/spezifhirhealthkit).\n\n### SpeziFHIRMockPatients\n\nThe target offers easily loadable mock patient data for testing and development.\nFor more information, please refer to the [API documentation](https://swiftpackageindex.com/stanfordspezi/spezifhir/documentation/spezifhirmockpatients).\n\n## Contributing\n\nContributions to this project are welcome. Please make sure to read the [contribution guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md) and the [contributor covenant code of conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) first.\n\n## License\n\nThis project is licensed under the MIT License. See [Licenses](https://github.com/StanfordSpezi/SpeziFHIR/tree/main/LICENSES) for more information.\n\n![Spezi Footer](https://raw.githubusercontent.com/StanfordSpezi/.github/main/assets/FooterLight.png#gh-light-mode-only)\n![Spezi Footer](https://raw.githubusercontent.com/StanfordSpezi/.github/main/assets/FooterDark.png#gh-dark-mode-only)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstanfordspezi%2Fspezifhir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstanfordspezi%2Fspezifhir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstanfordspezi%2Fspezifhir/lists"}