WinForms FHIR Form Viewer
$ dotnet add package Tiro.Health.Winforms.FormViewer.Net48A powerful WinForms UserControl for displaying and interacting with Tiro.health FHIR Questionnaires. Built with WebView2 and SMART web messaging integration.
Install-Package Tiro.Health.Winforms.FormViewer.Net48
PM> Install-Package Tiro.Health.Winforms.FormViewer.Net48
dotnet add package Tiro.Health.Winforms.FormViewer.Net48
TiroFormViewer in the Toolbox under "Tiro.Health.WinForms.FormViewer Components"Imports Tiro.Health.Winforms.FormViewer.Net48
Imports Hl7.Fhir.Model
Public Class Form1
Private tiroFormViewer As TiroFormViewer
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' Create and configure the FormViewer
tiroFormViewer = New TiroFormViewer()
tiroFormViewer.Dock = DockStyle.Fill
' Subscribe to events
AddHandler tiroFormViewer.FormSubmitted, AddressOf OnFormSubmitted
' Add to form
Me.Controls.Add(tiroFormViewer)
End Sub
Private Sub OnFormSubmitted(sender As Object, e As FormSubmittedEventArgs)
' Handle form submission
Dim response As QuestionnaireResponse = e.Response
Dim outcome As OperationOutcome = e.Outcome
' Process the submitted form data
MessageBox.Show($"Form submitted with status: {response.Status}")
End Sub
End ClassPrivate Async Sub LoadQuestionnaire()
Try
' Create FHIR resources
Dim patient = New Patient() With {
.Id = "patient-123"
}
patient.Name.Add(New HumanName() With {
.Family = "Doe",
.Given = {"John"}
})
Dim encounter = New Encounter() With {
.Id = "encounter-456",
.Status = EncounterStatus.InProgress
}
Dim practitioner = New Practitioner() With {
.Id = "practitioner-789"
}
' Set the questionnaire context
Await tiroFormViewer.SetContextAsync(
"http://example.com/questionnaire/patient-intake",
patient,
encounter,
practitioner
)
Catch ex As Exception
MessageBox.Show($"Error loading questionnaire: {ex.Message}")
End Try
End SubPrivate Async Sub RequestFormSubmission()
Try
Await tiroFormViewer.SendFormRequestSubmitAsync()
Catch ex As Exception
MessageBox.Show($"Error requesting form submission: {ex.Message}")
End Try
End Sub| Event | Description |
|---|---|
FormSubmitted(sender, FormSubmittedEventArgs) | Fired when a form is successfully submitted |
| Method | Description |
|---|---|
SetContextAsync(url, patient, [encounter], [author], [initialResponse]) | Sets up the questionnaire context with FHIR resources |
SendFormRequestSubmitAsync([responseHandler]) | Requests the form to be submitted |
| Property | Type | Description |
|---|---|---|
Response | QuestionnaireResponse | The completed FHIR QuestionnaireResponse |
Outcome | OperationOutcome | FHIR OperationOutcome with validation results |
The control requires Microsoft WebView2 Runtime to be installed: