HealthShare Personal Community Patient Entered Data: Patient Task Item Setup Guide
1. Patient Task Items Overview
The Personal Community Patient Task API supports two types of task items:
- Documents - used to send educational links or physical content to a patient
- Forms - used to send Personal Community digital forms to patients
- Document Uploads - used to request physical documentation or images from patients.
Each task item has specific configuration that needs to be completed before it can be used.
2. Document Task Item
The document task item is intended to be used to send patients education or instructions.
This task item supports three types of documents:
- Link - links to fully qualified URL to external content, such as educational materials, websites, or videos.
- OnDemand - documents and reports that can be generated on-demand.
- Stream - physical documentation, such as pdfs.
You must use the taskItem "type"="Document"
-
To use the
Link
task type, you must use the taskItem "documentType"="Link". Please note:
- a documentLink is required.
-
To use the
OnDemand
task type, you must use the taskItem "documentType"="Stream". Please note
- a documentLink is required
-
To use the
Stream
document type, you must use taskItem "documentType" = "Stream". Please note
- documentFileType is required
- documentStream is required, base64 encoded, and `maxLength` is constrained by maximum length of IRIS string (3161144 bytes) and 33% expansion from base64 conversion.
2.1. Configuring On-Demand Document Retrieval
To use the OnDemand document type, it is required to have a document retrieval class defined and registered. A document retrieval class is required for every external system that wishes to leverage the OnDemand document type. Document retrieval classes are stored against each external user's IRIS user account.
2.1.1. Create your Custom Document Retrieval Class
To create a new document retrieval class, follow the steps:
- Create a new class that extends HS.Portal.EHR.AbstractDocumentURLRetriever
-
Override the following methods:
- %GetFilename - Given the document URL, return the file name. This is applied to the Content-Disposition header of the HTTP response.
- %GetContentType - Given the document URL, return the MIME type. This impacts how the browser displays the data.
- %OutputDocumentToDevice - Within this method, implement the logic to write the data to the device.
- Compile the class
2.1.2. Create and Add Supporting Production Components [Optional]
To support your custom document retrieval processor, you may need to create an additional business service and business operation to interact with your external document provider
2.1.3. Registering your On-Demand Document Class
Register your on-demand document processor by using the $insert-document-processor API.
3. Form Task Item
Personal Community uses a single processing mechanism for handling all form task items that patients submit. When a patient submits a form task item, Personal Community processes it and performs the following actions:
-
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
-
-
It then delivers the submitted form to a target (usually a business operation in your Personal Community production).
-
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.
3.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.
3.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.
3.2.1. Form Submission Transform
The transform is responsibe 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 - The Personal Community MRN for the user that completed the form. Note that this will differ from the FormAssignedToUserMRN if the form was completed by the patient's proxy.
- FormAssignedToUserMRN - The Personal Community MRN for the patient who was assigned the form.
- 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:
- Create a new class that extends Ens.DataTransform
- Select HSPortal.Production.Message.TemplateFormSubmissionRequest as your source.
- Select your desired target format. Note that this is likely a custom format you've defined.
- Map the appropriate Template FormSubmissionRequest properties to the appropriate location in the target message.
- 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.
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()
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)
3.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.3. Create and Configure Personal Community Forms
Refer to the Personal Community Form Builder User Guide for information about creating and managing digital forms in Personal Community.
4. Document Upload Task Item
The upload document task item is used to request physical documentation or images from patients. Organizations enabling this feature will configure a set of system defaults that include what file types are accepted and how the documents will be processed and routed on submission. These settings may be overwritten in the API request to allow for more granular control of this feature on a upload document task item type basis.
4.1. Default Accepted File Types
INFORMATION
Supported file types is controlled by the recieving system. This list should be adjusted based on the support defined by the target upload location.
Personal Community can accept files of the following types:
File Description | Extension | Type |
---|---|---|
Bitmap digital images | BMP | Image |
DICOM | DCM | Image |
Graphics interchange format | GIF | Image |
Joing photographic experts group | JPEG, JPG | Image |
Portable network graphic | PNG | Image |
Scalable vector graphics | SVG | Image |
Word document | DOC, DOCX | Document |
Portable document format | Document | |
MIME HTML | MHTML | Document |
Hypertext markup language | HTML, HTM | Document |
Rich text format | RTF | Document |
Tagged image file format | TIF | Document |
Text file | TXT | Document |
Microsoft excel spreadsheet file | XLS, XLSX | Document |
Audio video interleave | AVI | Video |
Moving pictures experts group | MPG, MPEG | Video |
Moving picture experts group layer four | MP4 | Video |
QuickTime Movie file | MOV | Video |
Windows media video | WMV | Video |
Waveform audio file | WAV | Audio |
Windows medial audio | WMA | Audio |
Accepted file types may be further restricted on an individual upload document task item using the supportedFileTypes array in the patient task API request.
4.2. Default Patient Task Upload Mode
Personal Community requires that default upload mode is set to support the upload document task items. This setting is used to route the uploaded document.
Options include:
- TrakSDA - This will send the uploaded document to TrakCare where it will become available in the Scanned Patient Documents chart.
- UCRSDA - This will send the uploaded document to an Edge Gateway in the Unified Care Record. This document is then available as part of the patient's aggregrated record in the Unified Care Record.
- Custom - This mode allows a site to define a custom workflow to deliver the uploaded documents to an external system
4.3. Configuring the UCRSDA Submission Route
4.3.1. Setup Edge Gateway in Unified Care Record
As Personal Community will now be submitted data to the Unified Care Record, it is recommended that it has a dedicated Edge Gateway.
To perform setup tasks, use the Unified Care Record Installer Wizard:
-
Log in to the Management Portal.
-
Run the HealthShare Installer Wizard :
-
On the Management Portal home page, select HealthShare . This displays the HealthShare Management Portal .
-
In the banner of the HealthShare Management Portal , select Installer Wizard .
-
-
In the Installer Wizard , select ConfigureEdge Gateway . This displays the Configuration page for Edge Gateways.
-
On this page, specify values for the following fields:
- Local name — Required. The name of the Edge Gateway.
-
Network Name — Required. The unique identifier for the Edge Gateway on the network. The Installer Wizard populates this field with a string that is the network hostname, a colon, and the value of Local name.
-
Description — Optional. Any additional information about the local copy of the Edge Gateway.
-
Disabled — Whether or not the local copy of the Edge Gateway is available for use. The Edge Gateway is enabled by default.
-
Production — Required. The name of the business production for Edge Gateway. The Installer Wizard populates this field with a string that combines the value of Local name and the string PKG:HEdgeGatewayProduction.
-
Template — Required. The template for the Edge Gateway production. Select the HS.Sample.Production.EdgeGateway.FileProduction template.
-
Alternate Database Location — Optional. The default location for the production database, IRIS.DAT , is installDir /mgr/ localName . To specify a location for the database other than the default, enter the alternate location in the Alternate Database Location field. If you specify an absolute location, then that location will be created if it does not exist. Your database will be in alternateDatabaseLocation / localName . If you specify a relative location then the database will be created in installDir /mgr/hslib/ alternateDatabaseLocation / localName .
- Registration ID – Optional. A unique value that identifies this configuration. It will be generated automatically if you leave this field blank. If you wish to enter a specific value, you may enter it here. Once a configuration has been saved, this value cannot be changed.
-
Enter a Hub Host — Required. The name of the machine where the Unified Care Record Registry is located.
-
Enter a Hub Port — Required. The web server port number on which the Unified Care Record Registry accepts connections.
-
Enter a Hub Name — Required. The namespace of the Unified Care Record Registry, such as HSRegistry .
-
Connect to Hub Securely — Required if this is a production system. Optionally select it for a development or test system.
-
The web server on your Registry instance should be configured to only allow secure connections to the Registry.
-
You should have an SSL/TLS configuration on this instance that can communicate with the Unified Care Record Registry (see “ Using SSL/TLS ” in the “Setting Up Secure Communication in Unified Care Record” chapter of Securing Unified Care Record Instances ). This SSL/TLS configuration should have the same name as the SSL/TLS configuration on the Unified Care Record Registry, as all instances in a federation share a single service registry, and the HSRegistry service registry identifies which SSL/TLS configuration to use.
Once you select Connect to Hub Securely , enter the SSL/TLS configuration in the SSL Configuration field that appears. Now, the Hub endpoint URL will be created using “https” rather than “http”, and the identified SSL/TLS configuration will allow the Gateway to connect to the Unified Care Record Registry securely at initial startup.
-
-
Initial Hub End Point — Required. The web address for the HealthShare Registry. The Installer Wizard populates this field; you can, but are not required to, use the auto-populated string. The string is of the form:
protocol :// registry-host : registry-port /csp/healthshare/ registry-name /services /HS.Hub.HSWS.WebServices.cls
where the portions of the address in italics are:
-
protocol — https or http , depending on whether you selected the Connect to Hub Securely option.
-
registry-host — The name of the machine where the Unified Care Record Registry is located.
-
registry-port — The port number on which the Unified Care Record Registry accepts connections.
-
registry-name — The namespace of the Unified Care Record Registry.
For example, a Registry has an address such as:
http://RegistryHost:57772/csp/healthshare/HSREGISTRY/services/HS.Hub.HSWS.WebServices.cls
-
-
Select Save at the bottom of the page. Your configurations should now appear in the Defined Configurations table.
-
In your configuration’s row of the Defined Configurations table, select Activate . This displays the Activate Configuration dialog.
-
In the Activate Configuration dialog, select Start . This sets up the Personal Community namespaces, databases, and production mappings.
-
When activation is completed, the dialog displays an Activation Done message. Select Close to dismiss the dialog.
4.3.2. Setting Up a Facility for the Personal Community Edge Gateway in the Unified Care Record
The Personal Community Edge Gateway should have a dedicated facility defined in the Unified Care Record. Personal Community will use this facility when submitting clinical information to the Unified Care Record.
To establish a facility:
-
Log in to the Management Portal on the Unified Care Record associated with Personal Community.
-
On the Management Portal home page, select HealthShare .
-
Select the namespace for the Registry (for example, HSRegistry ).
-
Select Registry Management > Facility Registry . This displays the Facility Registry page.
-
On the Facility Registry page, specify values for the following fields — and only the following fields:
-
Facility Code — An identifier for the facility.
-
OID — A unique identifier for the Personal Community Edge Gateway, which is based on an OID obtained from HL7.org .
-
Create Assigning Authority — When selected, specifies that HealthShare should also create an assigning authority with the same code as the facility. Select this.
-
Gateway Name — Select the Edge Gateway you created for Personal Community.
-
-
Select Save to save the facility.
4.3.3. Configuring the Personal Community Production for UCRSDA Submission
To configure your Personal Community production to send uploaded documents to Unified Care Record:
- Logon to the Management Portal for Personal Community as a user with the %EnsRole_Administrator role.
-
In your Personal Community namespace, go to the
Production Configuration
page. Specifically:
- Go to your Personal Community namespace by selecting Switch from the title bar and choosing its name in the namespace chooser.
- From the Management Portal, select Interoperability > Configure > Production .
-
Configure the business process:
- Select the HSPortal_UploadDocumentSubmissionProcess component under Processes:
-
Under Basic Settings :
-
SendingFacilityCode - Enter the facility code for the facility you created in the previous step.
- DocumentTypeCode - Enter the document type code or string to represent this type of document in the Unified Care Record. This value is defaulted to "Patient Uploaded Document".
-
- Select OK to save the business process.
-
Configure the business operation:
- Select the HSPortal_EdgeGatewayOperation component under Operations:
-
Under Additional Settings:
- ServiceName - Set this to the Service Registry Name as defined in the Unified Care Record for your Personal Community Edge Gateway.
- Select OK to save the business operation.
4.4. Creating Document Upload Submission Routes
The upload document task item is designed to be flexible so that uploaded documents can be sent into any desired workflow for your organization.
4.4.1. Create your Custom Document Upload Processor
The document processor is responsible for taking the incoming HSPortal.Production.Message.UploadDocumentSubmissionRequest and transforming it into the correct format for the final destination. The HSPortal.Production.Message.UploadDocumentSubmissionRequest contains information about the task and task item the documents are associated with as well as information about the submitted document.
Task and task item properties include:
- ExternalTaskID - The task ID for this task in the external system.
- EpisodeID - The episode ID that this task is associated with.
- TaskID - The internal task ID.
- TaskItemID - The internal task item ID.
- CompletedbyUserMRN - The Personal Community MRN for the user that completed the task. Note that this will differ from the AssignedToUserMRN if the task was completed by the patient's proxy.
- AssignedToUserMRN - The Personal Community MRN for the patient who was assigned the task.
- SubmissionTime - The time that the documents were submitted.
Document properties include:
- UploadProcessorType - The selected upload processor mode for this document.
- ProcessorName - Used to route this request message to the appropriate processor.
- DocumentIDs - The list of document IDs for all documents uploaded as part of this task item.
Uploaded documents are stored as HSPortal.Session.UploadDocument objects for the duration of the user session. Your custom processor should use the DocumentIDs to open the corresponding HSPortal.Session.UploadDocument object to access infromation about the uploaded document, including the Filename , ContentType, and Content of the document.
Your document upload processor can be defined as either a business process or business operation.
4.4.2. Configuring the Personal Community Production for Document Uploads
To configure your Personal Community production for custom document uploads:
- Logon to the Management Portal for Personal Community as a user with the %EnsRole_Administrator role.
-
In your Personal Community namespace, go to the
Production Configuration
page. Specifically:
- Go to your Personal Community namespace by selecting Switch from the title bar and choosing its name in the namespace chooser.
- From the Management Portal, select Interoperability > Configure > Production .
- Set up the business processor and / or business operation created in the above step.
Note the name of your production component as that will be needed to complete configuration.
4.5. Creating and Enabling a Virus Scanner
IMPORTANT
Enabling the Personal Community Virus Scanner is a requirement for using the document upload task item on a production system.
Refer to the Personal Community Virus Scanner Setup Guide for information about creating and managing digital forms in Personal Community.
4.6. Configuring Document Uploads in the Workbench
To configure the upload document task item in the Workbench:
-
Log into the Workbench as a user with the
Configuration Manager
role. - Go to the Configuration Application page ( Setup > Configuration Application ) and select the Feature Control tab.
- Select Edit Mode to make edits to the fields described in the following steps.
-
In the
Patient Document Uploads
box, configure the following settings:
- Enable Virus Scanner - this must be enabled on a production system.
- Default Accepted File Types - this is the list of supported file types that can be accepted. This list can be further restricted by including supported file types in the patient task API.
- Default Patient Task Upload Mode - this is the upload mechanism that will be used if none is provided in the patient task API.
- Default Patient Task Upload Processor - required if Upload Mode is custom. This is the name of the production component to be called to process the uploaded document.
- After you have finished, select Submit at the bottom of the page to save your changes.