cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Medical Data Storage and Display Part 3

No ratings

 

 

Step 7: Access Data

 

Now that we have a basic display in-place, we need to access the backend data.

 

To do so, we'll make use of built-in Mashup Data Services.

 

  1. At the top-right, ensure that the Data tab is selected.

    29-mlpd-data.png

     

  2. Click the green + button.

    30-mlpd-add-data.png

     

  3. In the Entities Filter field of the Add Data Pop-up, search for and select MDSD_Thing.
  4. In the Services Filter field, type getprop.
  5. Click the arrow beside GetProperties.
    • Note that the GetProperties() Service has been added to the right section.
  6. Check the Execute on Load checkbox.

    31-mlpd-getprops.png

     

  7. At the bottom-right of the pop-up, click Done.

    • Note how the GetProperties() Mashup Data Service has been added to the top-right under the Data tab.

    32-mlpd-getprops-added.png

     

Bind Info Table Property

 

Now that we have access to the Data Service within the Mashup, we'll use it to pull backend data into the Mashup (specifically, the aggregated Info Table Property), and then bind it to the Grid Widget.

 

  1. Expand the GetProperties Service.

    33-mlpd-expand-getprops.png

     

  2. Drag-and-drop MDSD_InfoTable_Property onto the Grid Advanced Widget.

    34-drag-drop-infotable.png

     

  3. On the Select Binding Target Pop-up, select Data.

    35-mlpd-bind-data.png

     

  4. Note how the bottom-center Connections Window indicates that the aggregated Info Table Property is now bound to the grid.

 

Access the Aggregation Service

 

Because we selected the Execute on Load option for GetProperties(), the Service will grab the information from the aggregated Info Table Property and propagate that into the Grid Advanced Widget on initially opening the Mashup in a web browser.

 

However, we currently have no way to call our custom aggregation Service besides diving into the backend as we did when we first created it and performed testing.

 

Instead, we want the Mashup itself to have the ability to call the aggregation Service.

 

We'll do so via the Button Widget's Clicked Event, but we first need to gain access to our custom Service in the Mashup.

 

  1. In the top-right Data tab beside Things_MDSD_Thing, click the green </> button.

    • Note that the Add Data Pop-up opens with the MDSD_Thing pre-selected.

    36-mlpd-more-data.png

     

  2. On the left of the Add Data Pop-up, expand Select Service Category, and choose **Uncategorized**.

    • Note our custom MDSD_Aggregation_Service.

    37-mlpd-uncategorized.png

     

  3. Beside MDSD_Aggregation_Service, click the right arrow to add it to the Selected Services section.

    • Note that we do NOT want to check "Execute on Load", because don't want the Service called upon initially opening the Mashup in a web browser.

    38-mlpd-custom-service.png

     

  4. At the bottom-right, click Done.

    • Note the MDSD_Aggregation_Service has been added to the far-right Data tab.

    39-mlpd-more-data-added.png

     

Bind Button to Aggregation Service

 

Now that we can reference the aggregation Service in the Mashup, we'll bind it to pressing the Button Widget.

 

  1. Click the Button Widget to select it.

    40-mlpd-select-button.png

     

  2. Click the top-left of the Button Widget to reveal the Drop Down Menu.

    41-mlpd-button-options.png

     

  3. Drag-and-drop the Clicked Event onto the MDSD_Aggregation_Service under the Data Tab.

    42-mlpd-bind-button-service.png

     

  4. On the bottom-right, with the MDSD_Aggregation_Service selected, drag-and-drop the MDSD_Aggregation_Service's ServiceInvokeCompleted Event onto GetProperties in the Data Tab.
    • This causes the completion of the aggregation Service to re-call GetProperties, which updates the grid; as such, a new entry into the Info Table Property created by the custom Service will immediately show up in the Grid Widget.
  5. In the top-right, click the GetProperties Service to see all of its interactions in the bottom-center Connections window.

    43-mlpd-serviceinvokecompleted.png

     

  6. At the top, click Save.

 

 

 

Step 8: Test Application

 

Our MVP MRI Service Application is now complete.

 

Let's test it.

 

  1. At the top, click View Mashup.

    • Note the pre-existing single entry from our Service test which we executed directly from the backend.

    91_mdsd_view_mashup.png

     

  2. Click Retrieve MRI Statistics.

    92_mdsd_retrieve_mri_statistics.png

     

  3. Wait a moment and click Retrieve MRI Statistics again.
    • Note that each click adds another entry to the Grid Widget.

 

Each time that you press the Button Widget, what you're really doing is calling our custom aggregation Service in the Foundation backend.

 

This Service then goes out and pulls in information from our various EMS-connected Edge sub-systems.

 

To add additional sub-systems (maybe a "friction" detection on the patient-bed indicating that it needs additional grease) all you would have to do is repeat the steps in this Learning Path, i.e. connect the additional sub-system with the EMS, add another Field Definition to the Data Shape, and modify the aggregation Service to retrieve that info and store it in the Info Table Property.

 

In addition, you may wish to improve the GUI. Rather than using a Positioning: Static Mashup, you could utilize a Responsive setup, sub-divide the Canvas into various sections, and then add items such as your company's logo. This would also make the GUI more friendly to different screen resolutions.

 

You can even add business logic to the Mashup itself. For instance, the Auto Refresh Widget (Legacy) can effectively be used as a "timer". In the same way that the Button Widget's Clicked Event calls the aggregation Service, the Auto Refresh Widget could be used to trigger the Service call at a set interval. Then, as long as the Mashup was open, the Button Widget would only be needed when you wanted an immediate status update.

 

For more information on implementing additional business logic, refer to the Create Custom Business Logic guide.

 

Or the Time Selector Widget could be used to restrict the information in the Grid Widget to only the timeframe you wanted to investigate.

 

 

 

Step 9: Next Steps

 

Congratulations! You've successfully completed the Medical Data Storage and Display guide, and learned how to:

 

  • Create a Data Shape and Info Table Property to store Medical Data
  • Create a Service to combine data from multiple Edge devices into a single, logical Thing
  • Create a Mashup to view and retrieve Medical data

 

This is the last guide in the Medical Device Service learning path.

 

Learn More

 

We recommend the following resources to continue your learning experience:

 

 Capability     Guide
BuildMethods for Data Storage
ExperienceCreate Your Application UI

 

Additional Resources

 

If you have questions, issues, or need additional information, refer to:

 

 Resource       Link
CommunityDeveloper Community Forum
SupportThingWorx Help Center

 

Version history
Last update:
‎Nov 29, 2022 03:32 PM
Updated by:
Labels (1)
Contributors