---
schema_version: "1"
id: 2b085b515cd258ccce8e0d48f2c36b0705d7c8da0f7d9f153fd4c115d5154d28
title: |-
  IUnifiedHealthScore
        Interface
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/health_cloud_object_reference/apex_interface_healthcloudext_IUnifiedHealthScore.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.health_cloud_object_reference.meta/health_cloud_object_reference/apex_interface_healthcloudext_IUnifiedHealthScore.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0361c00a5e804b25007ea580aa9b27836fb9a935d0deea2f2873e376d81b20a7
description: Stores additional information in the action logs.Stores health score information in the Health Score Action Log object. The action history logged in Health Score Action Log doesn’t include score information by default.
---
# IUnifiedHealthScore Interface

Stores additional information in the action logs.

## Namespace

[healthcloudext](https://developer.salesforce.com/docs/atlas.en-us.health_cloud_object_reference.meta/health_cloud_object_reference/apex_namespace_healthcloudext.htm "The HealthCloudExt namespace provides an interface and classes for Health Cloud to integrate with a source electronic health records (EHR) system.")

## Usage

Actions triggered from the Dynamic Actions for Unified Health Scoring component are logged in the Health Score Action Log object. You can customize the information logged in this object using the IUnifiedHealthScore Apex interface in a custom Apex class.

- **[IUnifiedHealthScore Methods](https://developer.salesforce.com/docs/atlas.en-us.health_cloud_object_reference.meta/health_cloud_object_reference/apex_interface_healthcloudext_IUnifiedHealthScore.htm#apex_healthcloudext_IUnifiedHealthScore_methods)**
- **[IUnifiedHealthScore Example Implementation](https://developer.salesforce.com/docs/atlas.en-us.health_cloud_object_reference.meta/health_cloud_object_reference/apex_interface_healthcloudext_IUnifiedHealthScore.htm#apex_interface_healthcloudext_IUnifiedHealthScore_Example)**

## IUnifiedHealthScore Methods

The following are methods for IUnifiedHealthScore.

- **[saveActionDetail(var1)](https://developer.salesforce.com/docs/atlas.en-us.health_cloud_object_reference.meta/health_cloud_object_reference/apex_interface_healthcloudext_IUnifiedHealthScore.htm#apex_healthcloudext_IUnifiedHealthScore_saveActionDetail)**  
    Stores health score information in the Health Score Action Log object. The action history logged in Health Score Action Log doesn’t include score information by default.

### saveActionDetail(var1)

Stores health score information in the Health Score Action Log object. The action history logged in Health Score Action Log doesn’t include score information by default.

#### Signature

public Boolean saveActionDetail(Map<String,String\> var1)

#### Parameters

var1

Type: Map<[String](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_methods_system_string.htm),[String](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_methods_system_string.htm)\>

A map of key-value pairs for the attributes, including subject ID, action status, action date, action label, action name, action description, action icon URL, and performed by ID.

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_methods_system_boolean.htm)

## IUnifiedHealthScore Example Implementation

This example shows an implementation of the healthcloudext.IUnifiedHealthScore interface.

Using this sample code, your action logs now also mention the specified score category and its score value at the time the action was triggered.

global class ApexClassForCustomLogs implements healthcloudext.IUnifiedHealthScore{//IMPORTANT: replace CustomActionLog with the name the Apex class 
    public Boolean saveActionDetail(Map<String, String\> request){
        try {
            String aSubject = request.get('subjectId');
            List<HealthScore> aHealthScore = \[select CurrentScore from HealthScore where SubjectId=:aSubject and ScoreCategoryId='0gzRN00000001drYAA'\];
            //IMPORTANT: Replace 0gzRN00000001drYAA with the Id of your score category.
            List<HealthScoreActionLog> acctList = new List<HealthScoreActionLog>();
        HealthScoreActionLog aHealthScoreActionLog = new HealthScoreActionLog(
             ActionDescription=request.get('actionDescription'),
             ActionIconUrl=request.get('actionIconUrl'),
             ActionLabel=request.get('actionLabel'),
             ActionName=request.get('actionName'),
             ActionStatus=request.get('actionStatus'),
             PerformedById=request.get('performedById'),
             SubjectId=request.get('subjectId'),
             ActionDate=datetime.now(),
            Score=aHealthScore\[0\].CurrentScore,
            ScoreCategoryId='0gzRN00000001drYAA'//IMPORTANT: Replace 0gzRN00000001drYAA with the Id of your score category.
        );
            acctList.add(aHealthScoreActionLog);
            Database.SaveResult\[\] srList = Database.insert(acctList, false);
            for (Database.SaveResult sr : srList) {
    if (sr.isSuccess()) {
        // Operation was successful, so get the ID of the record that was processed
        System.debug('Successfully inserted account. HealthScoreActionLog ID: ' + sr.getId());
    }
    else {
        // Operation failed, so get all errors
        for(Database.Error err : sr.getErrors()) {
            System.debug('The following error has occurred.');
            System.debug(err.getStatusCode() + ': ' + err.getMessage());
            System.debug('Account fields that affected this error: ' + err.getFields());
        }
    }
}
            //insert aHealthScoreActionLog;
            return true;
        }catch(DmlException e) {
          System.debug('An unexpected error has occurred: ' + e.getMessage());
          return false;
        }
    }
}

![Note](https://developer.salesforce.com/docs/atlas.en-us.health_cloud_object_reference.meta/health_cloud_object_reference/images/icon_note.png)

#### Note

Ensure that you replace the category ID in this sample code with the ID of the category that you want to log score information for. You can find the IDs of your score categories by either inspecting a category page’s URL, or you can run this query in the Developer Console Query Editor:

Select Id,CategoryName from ScoreCategory