Skip to main content

HealthShare Personal Community Patient Entered Data: Public Forms Setup Guide



1. Overview

The Personal Community Form Builder allows organizations to create digital forms that can be flagged for public use. Public forms can be accessed and submitted by users without having to authenticate with Personal Community.

These forms can be made available on the unauthenticated home page, either using the existing content files, or a custom application.


2.  Creating a Public Form

Refer to the Personal Community Form Builder User Guide for information about creating and managing digital forms in Personal Community.

Personal Community uses a single processing mechanism for handling all forms that patients submit. When a patient submits a form, Personal Community processes it and performs the following actions:

  1. It uses the form key associated with the form to identify:

    • The transform associated with the form (if one is specified)

    • The recipient of the form, known as its   target

  2. It then delivers the submitted form to a target (usually a business operation in your Personal Community production).

  3. The target that receives the form then delivers the form to its ultimate recipient, which may be the Workbench or an external destination.

Personal Community supports two submission routes: to the Workbench as a Task, or a custom submission route.

2.1. Workbench Task Submission Route

With this option, the submitted response is returned to the Workbench as a task. These tasks are routed to particular workflow group where the assigned Workbench Agent can claim and complete the task.

To use this mode you must:

  • Create at least one workflow group.
  • Assign Workbench Agents to this workflow group.

Form more information on workflow groups and workflow group agents, refer to the HealthShare Personal Community Workflow, Agents, and Tasks User Guide.


2.2. Custom Submission Route

With this option, the submitted response is routed to a custom submission route.  This allows sites to send the submitted form to a trusted external system. Using this route requires a site to create a transform and a business operation to create the appropriate format for the submitted form, and deliver to the external system.

2.2.1. Form Submission Transform

The transform is responsible for taking the incoming HSPortal.Production.Message.TemplateFormSubmissionRequest  and transforming it into the correct format for the final destination.  The  HSPortal.Production.Message.TemplateFormSubmissionRequest contains the following properties:

  • FormData - An instance of  HSPortal.Templates.DataMart.Form.Form.
  • FormCompletedbyUserMRN  - This will be empty for public form submission.
  • FormAssignedToUserMRN  - This will be empty for public form submission.
  • SubmissionTime  - The time the form was submitted.

HSPortal.Templates.DataMart.Form.Form  contains the following properties:

  • Template - An instance of  HSPortal.Templates.Datamart.Template.   This class provides all the information about the form that the patient completed.
  • Answers - An array of  HSPortal.Templates.DataMart.Form.Answer .  This is the list of answers that a patient provided.
  • FDNBlob - An array of  HSPortal.Templates.DataMart.Form.JSON .  This is a JSON blob that contains the answers with a reference to their question identifier.

To create a new submission transform, follow the following steps:

  1. Create a new class that extends Ens.DataTransform
  2. Select  HSPortal.Production.Message.TemplateFormSubmissionRequest  as your source.
  3. Select your desired target format. Note that this  is likely a custom format you've defined.
  4. Map the appropriate Template FormSubmissionRequest properties to the appropriate location in the target message.
  5. Compile the class

Personal Community provides a helper method that can generate an HTML document of the completed for.  This can then be passed to a PDF generator to create a PDF version of the completed document. The code samples below illustrate how to create the HTML and PDF versions of the form.

HTML Document
Set tHTML = ##class(%Stream.GlobalCharacter).%New()
Do ##class(HSPortal.Templates.Utils).WriteFormContainerHTML(.tHTML,pSubmittedForm.FormData.Answers,pSubmittedForm.FormData.Language,pSubmittedForm.FormData.Template)
Do tHTML.Rewind()
PDF Document
Set tHTMLRequest = ##class(HSMOD.HTMLtoPDF.API.Auxil.HTMLRequest).%New()
Do tHTMLRequest.AddHTMLFileFromStream(tHTML, "temp.html")
Do $classmethod("HSPortal.Forms.Transform.PDF","GetHTMLToPDFOptions",.tOptions,pSubmittedForm.FormAssignedToUserMRN,pSubmittedForm.FormCompletedbyUserMRN,pSubmittedForm.FormData.Template.Name,pSubmittedForm.FormData.Template.TemplateVersion)
Set tStatus = ##class(HSMOD.HTMLtoPDF.API).CreatePDFFile(tHTMLRequest,,.tOptions,,.tPDFStream)
$$$ThrowOnError(tStatus)	

2.2.2. Form Submission Target

To support your custom submission route, you may need to create a business operation to interact with your external system.  This operation must be added to the Personal Community production prior to configuing the form settings in the form builder.

Sites that wish to deliver form responses to the Unified Care Record via SDA should use the HSPortal_EdgeGatewayOperation.

3. Configuring a Public Form Link in Personal Community

Public forms can be accessed by unauthenticated users through the following routes in Personal Community:

  • A link to the public form on the unauthenticated home page content file or footer content files
  • A custom application that has a link to the form

3.1. Configuring a Public Form link on a Content File

A public form link can be added to any of the following content files that are accessible without authenticating with a Personal Community account.

Application Page Content File
Home (Before authentication, Browser) content-home-splash
Home (Before authentication, Mobile) content-home-splash-mobile
Footer (About Us) content-aboutus
Footer (Legal Notices) content-legalnotices
Footer (Terms of Use) content-termsofuse


3.1.1. Modifying Page Content

To modify page content to include a public form link:

  1. If there is not already a custom copy of the content file, copy the existing file from

    <hspc-home>/base/content/en/

    to

    <hspc-home>/custom/content/en/

    Note

    If such a file already exists, do not create a new copy, as this may overwrite any customizations your organization has already made in it.

  2. Edit the custom copy of the file to add a link to the public form using the correct path for the PC instance and a valid form key in the href of the <a>:

    href= "/< path >/public/index.html#/form/< form key >/edit"
    Where < path > is the web server prefix defined by the site and < form key > is the published, public form key listed in the Form Builder of the Personal Community Workbench. 


    Example

    An example where the web server prefix is 'hspc':

    href="/hspc/public/index.html#/form/53621962/edit"

    An example where the PC instance does not have a web server prefix:

    href="/public/index.html#/form/53621962/edit"


  3. Refresh the content for your organization's site.



3.2. Configuring a Public Form link using a Custom Application

A public form link can be available through a custom application. A custom application displaying public forms should be configured with a Personal Community Location of Main Menu (unauthenticated only) in order to be publicly accessible. Refer to the Personal Community Custom Application Guide for more information on creating custom applications.

FeedbackOpens in a new tab