Products Technologies Demo Docs Blog Support Company

Healthcare Use Case: Digital Forms Workflow with Electronic Signatures

Forms play an important role in healthcare processes and offer a huge potential for automation and digital forms processing. This article and sample show how to use TX Text Control to streamline forms processes based on a Vaccine Administration Record (VAR) form.

Healthcare Use Case: Digital Forms Workflow with Electronic Signatures

The healthcare industry is highly bureaucratic (for good reasons) which involves a lot of paperwork. Based on a survey of healthcare professionals1 90% of providers use paper and manual processes. More important is that 72% of users expect electronic statements for health plan premium invoices, but only 58% of consumers can technically get those statements from their providers.

Digital Forms Processing

Forms play an important role in healthcare processes and offer a huge potential for automation and digital forms processing. Together with partners in the healthcare software industry, we are constantly working on similar workflows and implementing missing functionality in our products. This article and sample show how TX Text Control can be used to streamline forms processes based on a Vaccine Administration Record (VAR) form.

Consider the following scenario:

  • A patient schedules a vaccination appointment with a healthcare provider.
  • Based on an account with this portal, the web application knows some of the patient's information.
  • Missing information can be acquired through a simple HTML form.
  • All data is merged into a template that is presented to the patient for a signature.

The Sample Application

The template consists of various elements that are filled in at different stages of the process. It contains static text, merge fields for known data, dynamic form fields for user data acquisition and signature fields for the patient to sign.

Vaccine Administration Record (VAR) Template

HTML Form

In the first step, an HTML form is rendered with known patient data for an effortless data acquisition.

Vaccine Administration Record (VAR) Form

After the patient completes the form and submits it, the method Create receives the form data that is finally merged into the template using the MailMerge class.

public IActionResult Create(FormData data) {

  SignData signData = new SignData();

  byte[] document;

  using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) {
    tx.Create();
    tx.Load("App_Data/vaccination_form.tx", TXTextControl.StreamType.InternalUnicodeFormat);

    using (TXTextControl.DocumentServer.MailMerge mm = new TXTextControl.DocumentServer.MailMerge()) {
      mm.TextComponent = tx;
      mm.FormFieldMergeType = TXTextControl.DocumentServer.FormFieldMergeType.Preselect;
      mm.RemoveEmptyFields = false;

      // pre-select form fields with known data and merge
      // data into merge fields
      mm.MergeObject(data);
    }

    tx.Save(out document, TXTextControl.BinaryStreamType.InternalUnicodeFormat);

  }

  signData.document = document;
  signData.formData = data;

  return View(signData);
}

Document Viewer

The prepared form is then forwarded to a view that uses the Document Viewer to present the created form to the patient:

Vaccine Administration Record (VAR) Form

The following screenshot shows the completed form and the signed signature fields.

Vaccine Administration Record (VAR) Form

After all form fields have been filled out and the document has been signed, the ExportPDF controller method creates a PDF server-side and returns it to the client. In a typical workflow, the PDF is stored in a database and a copy is emailed to the patient.

[HttpPost]
public string ExportPDF([FromBody] TXTextControl.Web.MVC.DocumentViewer.Models.SignatureData data) {

  byte[] bPDF;

  // create temporary ServerTextControl
  using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) {
    tx.Create();

    // load the document
    tx.Load(Convert.FromBase64String(data.SignedDocument.Document), TXTextControl.BinaryStreamType.InternalUnicodeFormat);

    FlattenFormFields(tx);

    // save the document as PDF
    tx.Save(out bPDF, TXTextControl.BinaryStreamType.AdobePDFA);
  }

  return Convert.ToBase64String(bPDF);
}

Export as PDF

The resulting PDF document merges all data, flattens form fields, and embeds the signature in the document.

Vaccine Administration Record (VAR) Form

You can test this sample yourself by downloading it from our GitHub repository.

1 InstaMed Releases Ninth Annual Trends in Healthcare Payments Report. https://www.businesswire.com/news/home/20190415005538/en/

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

GitHub

Download and Fork This Sample on GitHub

We proudly host our sample code on github.com/TextControl.

Please fork and contribute.

Download ZIP

Open on GitHub

Open in Visual Studio

Requirements for this sample

  • TX Text Control .NET Server 31.0
  • Visual Studio 2022

Related Posts

ASP.NETASP.NET CoreForm Fields

Create Fillable PDF Forms in .NET C#

This article shows how to create fillable PDF forms in .NET C# using the TX Text Control .NET Server component. The created forms can be filled out using Adobe Reader or any other PDF viewer that…


ASP.NETASP.NET CoreForm Fields

Extension Method: Flatten Forms Fields in PDF Documents using .NET C#

This article shows how to flatten form fields in TX Text Control before exporting the document to PDF. This is a common requirement when documents should be shared with others and the form fields…


AngularASP.NETReact

Form Field Compatibility: Work with AcroForms, Legacy MS Word Forms, and…

This article shows how to work with form fields in TX Text Control and how they are compatible with other industry standards. It explains how to load and save AcroForms, legacy MS Word forms and…


ASP.NETForm FieldsPDF

Document Viewer: Save the Values of Form Fields in Documents

The TX Text Control Document Viewer is used to allow users to fill in form fields in documents. This article explains how to save a document with the values of the filled in form fields.


ASP.NETAcroFormsForms

How to Load and View PDF Documents in ASP.NET Core C#

A very typical task in business applications is to view PDF documents in web applications. This article describes how to use the TX Text Control Document Viewer to display PDF documents in ASP.NET…