Swiftpack.co - StanfordSpezi/SpeziQuestionnaire as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by StanfordSpezi.
StanfordSpezi/SpeziQuestionnaire 1.0.2
Spezi Questionnaire Module
⭐️ 5
🕓 1 week ago
iOS
.package(url: "https://github.com/StanfordSpezi/SpeziQuestionnaire.git", from: "1.0.2")

Spezi Questionnaire

Build and Test codecov DOI

Enables apps to display and collect responses from HL7® FHIR® questionnaires.

Overview

The Spezi Questionnaire package enables HL7® FHIR® Questionnaires to be displayed in your Spezi application.

Questionnaires are displayed using ResearchKit and the ResearchKitOnFHIR package.

Screenshot showing a Questionnaire rendered using the Spezi Questionnaire module. Screenshot showing a Questionnaire rendered using the Spezi Questionnaire module.
An HL7® FHIR® Questionnaire is rendered using the QuestionnaireView

Setup

You need to add the Spezi Questionnaire Swift package to your app in Xcode or Swift package.

[!IMPORTANT] If your application is not yet configured to use Spezi, follow the Spezi setup article and set up the core Spezi infrastructure.

Example

In the following example, we create a SwiftUI view with a button that displays a sample questionnaire from the FHIRQuestionnaires package using QuestionnaireView.

import FHIRQuestionnaires
import SpeziQuestionnaire
import SwiftUI


struct ExampleQuestionnaireView: View {
    @State var displayQuestionnaire = false


    var body: some View {
        Button("Display Questionnaire") {
            displayQuestionnaire.toggle()
        }
            .sheet(isPresented: $displayQuestionnaire) {
                QuestionnaireView(
                    questionnaire: Questionnaire.gcs
                ) { result in
                    guard case let .completed(response) = result else {
                        return // user cancelled
                    }

                    // ... save the FHIR response to your data store
                }
            }
    }
}

For more information, please refer to the API documentation.

The Spezi Template Application

The Spezi Template Application provides a great starting point and example using the Spezi Questionnaire module.

Contributing

Contributions to this project are welcome. Please make sure to read the contribution guidelines and the contributor covenant code of conduct first.

Notices

FHIR is a registered trademark of Health Level Seven International.

License

This project is licensed under the MIT License. See Licenses for more information.

Spezi Footer Spezi Footer

GitHub

link
Stars: 5
Last commit: 1 week ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

1.0.2
1 week ago

What's Changed

Full Changelog: https://github.com/StanfordSpezi/SpeziQuestionnaire/compare/1.0.1...1.0.2

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics