Azure AI Language– Detect Healthcare Content in Optimizely CMS

In this blog post, I showcase how the Azure AI Language service’s Text Analytics for health feature can be used to detect healthcare content within Optimizely CMS, when content is being published.

Text Analytics for Health is a feature included in the Azure AI Language service. This cloud-based API uses machine-learning to extract and organise important medical information. This is done from different types of unstructured texts, such as doctor’s notes, discharge summaries, clinical documents, and electronic health records.

One use case of the Text Analytics for health feature within Optimizely CMS is to restrict content editors from uploading healthcare related content. For websites outside the healthcare sector, having healthcare-related content in the CMS may not align with the business’s promotional or sales objectives.

This feature can be implemented by downloading the “Patel.AzureAILanguage.Optimizely” NuGet package. You can get this package from the Optimizely NuGet Feed or the NuGet Feed.

Once the NuGet Package has been downloaded and required setup has been done, the user must add a boolean property with the [TextAnalyticsAllowed] attribute to the Start Page in Optimizely to activate this functionality. This is detailed here TextAnalyticsAllowed Documentation.

A boolean property with the [HealthcareContentAllowed] attribute also needs to be added to the Start Page in Optimizely. This aspect is detailed in the following link: HealthcareContentAllowed Documentation.

The next step is to create one or multiple string properties with a [HealthcareContent] attribute. These string properties can be added to any Optimizely CMS Content type that inherits from IContent. Additional details are available via the following link: HealthcareContent Documentation.

Upon successfully adding these properties, Text Analytics for Health can be performed when publishing content in the CMS. There is a screenshot below which demonstrates the code used for this.

If the feature has detected any content relating to Healthcare and the boolean property with the [HealthcareContentAllowed] attribute has not been ticked to allow healthcare content to be uploaded in the CMS, then an error message will be shown to the user. Below is a screenshot of this