Skip to content

Commit

Permalink
Rework the Spezi FHIR Package (#7)
Browse files Browse the repository at this point in the history
# Rework the Spezi FHIR Package

## ♻️ Current situation & Problem
- With the update to Spezi 0.7.0, a `FHIR` standard as originally
designed is no longer needed and a responsibility pushed to the
developers of a Spezi-based application, allowing a greater level of
customization functionality.

## 💡 Proposed solution & Release Notes
- The Mock Web Service functionality has moved to its own Swift Package:
https://github.com/StanfordSpezi/SpeziMockWebService
- The FHIR package will focus on building convenient extensions around
the FHIR Package, including extensions to existing FHIR types and other
future extensions.

## ➕ Additional Information
- This PR builds the first foundation for future extensions to the FHIR
package. It contains a minimal feature set from the previous version of
the package. Suggestions and ideas are more than welcome!


### Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
  • Loading branch information
PSchmiedmayer authored Aug 12, 2023
1 parent 6303e65 commit 4c7a5f4
Show file tree
Hide file tree
Showing 29 changed files with 178 additions and 909 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
name: Build and Test Swift Package
uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
with:
artifactname: SpeziFHIR-Package.xcresult
artifactname: SpeziFHIR.xcresult
runsonlabels: '["macOS", "self-hosted"]'
scheme: SpeziFHIR-Package
scheme: SpeziFHIR
buildandtestuitests:
name: Build and Test UI Tests
uses: StanfordSpezi/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
Expand All @@ -36,4 +36,4 @@ jobs:
needs: [buildandtest, buildandtestuitests]
uses: StanfordSpezi/.github/.github/workflows/create-and-upload-coverage-report.yml@v2
with:
coveragereports: SpeziFHIR-Package.xcresult TestApp.xcresult
coveragereports: SpeziFHIR.xcresult TestApp.xcresult
1 change: 0 additions & 1 deletion .spi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ builder:
- platform: ios
documentation_targets:
- SpeziFHIR
- SpeziFHIRMockDataStorageProvider
17 changes: 8 additions & 9 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#
# This source file is part of the Stanford Spezi open-source project
# This source file is part of the Stanford Spezi open source project
#
# SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#
#

# The whitelist_rules configuration also includes rules that are enabled by default to provide a good overview of all rules.
only_rules:
# All Images that provide context should have an accessibility label. Purely decorative images can be hidden from accessibility.
Expand Down Expand Up @@ -141,8 +141,6 @@ only_rules:
- implicitly_unwrapped_optional
# Identifiers should use inclusive language that avoids discrimination against groups of people based on race, gender, or socioeconomic status
- inclusive_language
# If defer is at the end of its parent scope, it will be executed right where it is anyway.
- inert_defer
# Prefer using Set.isDisjoint(with:) over Set.intersection(_:).isEmpty.
- is_disjoint
# Discouraged explicit usage of the default separator.
Expand All @@ -166,8 +164,6 @@ only_rules:
- legacy_multiple
# Struct extension properties and methods are preferred over legacy functions
- legacy_nsgeometry_functions
# Prefer Swift value types to bridged Objective-C reference types
- legacy_objc_type
# Prefer using type.random(in:) over legacy functions.
- legacy_random
# Lines should not span too many characters.
Expand Down Expand Up @@ -331,8 +327,6 @@ only_rules:
- unowned_variable_capture
# Catch statements should not declare error variables without type casting.
- untyped_error_in_catch
# Unused reference in a capture list should be removed.
- unused_capture_list
# Unused parameter in a closure should be replaced with _.
- unused_closure_parameter
# Unused control flow label should be removed.
Expand Down Expand Up @@ -373,13 +367,18 @@ only_rules:
# The variable should be placed on the left, the constant on the right of a comparison operator.
- yoda_condition

attributes:
attributes_with_arguments_always_on_line_above: false

deployment_target: # Availability checks or attributes shouldn’t be using older versions that are satisfied by the deployment target.
iOSApplicationExtension_deployment_target: 16.0
iOS_deployment_target: 16.0

excluded: # paths to ignore during linting. Takes precedence over `included`.
- .build
- .swiftpm
- .derivedData
- Tests/UITests/.derivedData

closure_body_length: # Closure bodies should not span too many lines.
- 35 # warning - default: 20
Expand Down
17 changes: 2 additions & 15 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ let package = Package(
.iOS(.v16)
],
products: [
.library(name: "SpeziFHIR", targets: ["SpeziFHIR"]),
.library(name: "SpeziFHIRMockDataStorageProvider", targets: ["SpeziFHIRMockDataStorageProvider"])
.library(name: "SpeziFHIR", targets: ["SpeziFHIR"])
],
dependencies: [
.package(url: "https://github.com/apple/FHIRModels", .upToNextMinor(from: "0.5.0")),
.package(url: "https://github.com/StanfordSpezi/Spezi", .upToNextMinor(from: "0.5.0")),
.package(url: "https://github.com/StanfordSpezi/SpeziViews", .upToNextMinor(from: "0.3.0"))
.package(url: "https://github.com/StanfordSpezi/Spezi", .upToNextMinor(from: "0.7.0"))
],
targets: [
.target(
Expand All @@ -39,17 +37,6 @@ let package = Package(
dependencies: [
.target(name: "SpeziFHIR")
]
),
.target(
name: "SpeziFHIRMockDataStorageProvider",
dependencies: [
.target(name: "SpeziFHIR"),
.product(name: "Spezi", package: "Spezi"),
.product(name: "SpeziViews", package: "SpeziViews")
],
resources: [
.process("Resources")
]
)
]
)
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@ SPDX-License-Identifier: MIT
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FStanfordSpezi%2FSpeziFHIR%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/StanfordSpezi/SpeziFHIR)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FStanfordSpezi%2FSpeziFHIR%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/StanfordSpezi/SpeziFHIR)

The FHIR Standard and related modules build a code building block of standard-based mobile appications using Spezi.
The Spezi FHIR modules build a building block of FHIR-based mobile appications using Spezi.

For more information, please refer to the [API documentation](https://swiftpackageindex.com/StanfordSpezi/SpeziFHIR/documentation).


## The Spezi Template Application

The [Spezi Template Application](https://github.com/StanfordSpezi/SpeziTemplateApplication) provides a great starting point and example using the Spezi FHIR Standard.


## Contributing

Contributions 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.
Expand Down
26 changes: 0 additions & 26 deletions Sources/SpeziFHIR/Configuration+FHIR.swift

This file was deleted.

9 changes: 9 additions & 0 deletions Sources/SpeziFHIR/Export.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//
// This source file is part of the Stanford Spezi open-source project
//
// SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)
//
// SPDX-License-Identifier: MIT
//

@_exported import ModelsR4
12 changes: 1 addition & 11 deletions Sources/SpeziFHIR/FHIR+Identifiable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,5 @@ extension Resource: Identifiable {
public typealias ID = FHIRPrimitive<FHIRString>?
}

extension FHIRPrimitive: Identifiable where PrimitiveType: Identifiable { }

extension Optional: Identifiable where Wrapped == FHIRPrimitive<FHIRString> {
public var id: FHIRPrimitive<FHIRString>? {
switch self {
case let .some(value):
return value
case .none:
return nil
}
}
}
extension FHIRPrimitive: Identifiable where PrimitiveType: Identifiable { }
134 changes: 0 additions & 134 deletions Sources/SpeziFHIR/FHIR.swift

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4c7a5f4

Please sign in to comment.