Dynamics 365 Healthcare Accelerator

Continuing to Dynamics 365 Healthcare Accelerator. Let’s learn how to setup the App on our trail instance. Click here to create a new instance. Once the trial instance is ready.

Go to Admin Center, and follow the below steps:

Healthcare Accelerator has few dependencies on other solutions like:

  • Field Service
  • Project Service Automation

Click here for navigating to Microsoft App Source and follow the below steps:

Going back to the solution we can see that installation for Dynamics 365 Electronic Medical Records has been started.

Once the installation is successfully completed we can see the Dynamics Health 365 app.

App: Dynamics Health 365 installed

Dynamics 365 Contact Entity Forms 

The Healthcare Accelerator combines standard CRM entities with customized entities to make it easier to build solutions on top. This section describes examples of built-in forms and views that demonstrate these entities. 

Patient/Practitioner 360 

This view shows Electronic Medical Record (EMR) data directly within a patient or practitioner-specific form in Dynamics. The data model shows appointments, procedures, medications, and other patient/practitioner data in context and a user-friendly interface. 


Patient/Provider Timeline

This view provides a sequential look at all activities that have occurred with the patient or provider. The timeline provides the ability to scale, leveraging a slider, and interact with data directly.

Care Team Viewer

A clear understanding of which member of a patient’s care team owns each facet of care is paramount, as this view clearly and concisely shows.

To know more about Dynamics 365 healthcare accelerator, Click here.

I hope this helps!!!

Omnichannel for Customer Service – Part 2

Continuing to Omnichannel for Customer Service. We will learn the process to setup a Live chat widget inside Dynamics CRM using the Omnichannel Administration app.

To know about, how to setup Omnichannel for Customer Service, Click here.

Select Queues from the site map and click +New button. A queue is required for routing the question from users to a particular department based on the business process.

  • Provide the Queue name and set the priority of the queue.
  • Add the users to the queue who would be taking the incoming chat request which comes under this queue.

Once the queue has been defined we need to create a record under Work Streams. 
Here we need to select the desired channel for our Work Stream. There are multiple channels like Live Chat, SMS, Facebook, WhatsApp, Twitter, Microsoft Teams, etc. Name the Channel and select the capacity. We are setting up Live Chat.
We can also identify the incoming chat preference based on the agent status. Let’s select the Allowed Presences value too Available, Busy. This means that the agent would get the live chat pop-up on their screen when they have the capacity and their status is either Available or Busy.

Create Work Stream for Live Chat

Now, we will create a Chat Widget. For that, we need to navigate to Chat from the site map.
Provide a name to the chat widget record, select the language, and the work stream which we create a minute before.

Under Agent display name, we have the option to select agent First Name, Last Name, Nick Name or Full Name.

Create Chat Widget record

Once the record is saved, we will get a code snippet.

Code snippet gets populated under Chat Widget. This will be required later.

After this, we need to go back to our work stream record and create a routing rule for Live Chat channel.

For creating of routing rule, we need to link it with the queue which we created and Work Stream created by us. Hit the Save button.
Once the record is saved, we need to add a condition to the routing rule as shown in the above image.

Assuming Portal is installed on the instance where the Omnichannel has been setup.
If not below are the step of Portal Configuration.

Under Instances tab, select Dynamics 365 Portals- Customer Self-Service Portal and Click Install.

Once we have the Customer Self-Service Portal installed on our instance.

Now, let’s go to Portal Management app –> under Content Snippets we need to paste the code snippet which we received from Chat Widget record.

Next, enable Portal Add-On as shown below:

We can see a Chat icon appearing on the Portal bottom right.

Now, open CRM using Test User credential which is has been part of our Live Chat channel. We can see a yellow box on the top right of the screenshot, the green icon denotes the status of our agent is available when the agent is busy it turns to be red.

Steps we need to perform for testing the Live Chat channel configuration.

Once the conversation is completed agent can close the chat session by clicking in the End button.

The comments provided by Agent after ending the chat session would stay within CRM only. For internal team references.

Here is the end of Omnichannel for Customer Service.

I hope this helps!!!

Dynamics 365 Healthcare Accelerator

Microsoft came up with Healthcare Accelerator app for their customers who serve in Healthcare domain. The app is built considering the HL7/FHIR based data model.

The app designed solution has:

Pre-built entities and forms: Access to a wide range of FHIR-based entities and relationships allowing for rapid development of new healthcare solutions

Compliance: Standard based model built on a foundation of trust within a platform that is fully compliant with industry compliance standards including HIPAA and HITRUST

Care Team Visualization: A connected view of the care team associated with a patient and their roles that can be configured to include family and other related relationships

Patient Timeline: Presentation of clinical information about a patient in chronological order enabling providers to visualize all patient interactions and make informed care decisions 

Native CDM Support: Health entities unified with standard CDM entities ensuring consistency across applications which allows rapid and seamless integration to 3rd party EMR and EHR systems

List of entities in support of the FHIR HL7 (Health Level Seven) specification:

PatientsHealthcare ServicesCare PlansEncounters
PractitionersClinical Impression ProblemsRisk AssessmentsSpecimens
OrganizationsAllergy IntolerancesObservationsMedications
DevicesMedication AdministrationEpisodes of CareLocations
Healthcare ServicesMedication Requests
Figure 1: Pre-built entity for Healthcare Accelerator App

In my next blog, we will learn how to setup and configure the Healthcare Accelerator app.

Omnichannel for Customer Service

Microsoft came up with an app called Omnichannel for Customer Service.

The app is a part of Customer Service which helps the organizations to immediately connect and engage with their customers on a digital platform, like Chat, SMS, Social Media(Facebook, Twitter, WhatsApp, Microsoft Teams, and many more).

We can test this on the trials instance. Click here to create a new instance.

Select Customer Service while creating a trial instance. If we select any other option, Omnichannel for Customer Service application will not get enabled in your tenant.

Figure 1: Select Customer Service for Trial Instance

Once the instance is setup. Check whether the Customer Service Hub is available or not.

Figure 2: Installed Customer Service Hub

Now, let’s go to the admin center to configure a few settings. Click on Billing -> Purchase services -> Add-ons

Figure 3: Steps to set up subscription

Here for trial purpose, if needed we can get Power BI (free) subscription. Also, there are multiple add-ons that we can have access to like Dynamics 365 Customer Service Digital Messaging add-on trial.

Once the add-ons are configured go to users and assign license accordingly.

Figure 5: Assign license to user

For Provisioning Omnichannel for Customer Service, we will have a provide the data access consent. For that we need to go to the Data access consent URL which would navigate us to the below page where we need to check the consent box and hit the Accept button.

Figure 7: The page appears once the Accept button is clicked.

Next, when we have the data access granted successfully. We need to go back to the admin center and start configuring Omnichannel for our instance.

Figure 8: Admin Center – Power Apps
Figure 9: Select Instance
Figure 10: Click Dynamics 365 Administration Center link
Figure 11: Go to Application tab, Select Omnichannel for Customer Service and hit Manage button

Go to the Application tab, select Omnichannel for Customer Service, and hit the Manage button. The manage button option allows us to configure and remove the channels which are use or no use.

Figure 12: Provide the Consent by clicking on the Check box and hit Accept
Figure 13: Add Environment on which Omnichannel needs to be configured.
Figure 14: Select the instance from the drop down.

For, practice let’s configure all the options which we have on trials instance. This can be turned off when needed.

Figure 15: Enable Chat Feature
Figure 16: Enable SMS feature
Figure 17: Enable Social Media
Figure 18: Enable Microsoft Team
Figure 19: Click on Finish button

By clicking on the Finish button, we confirm the options we opted for Chat, SMS, Social, and Teams. This would take some time to install all the option which we opted for Omnichannel.

Once the installation is completed under the selected instance (MRC), we would the below screen.

Figure 20: Omnichannel setup under MRC Instance

Navigate to My Apps, here we can see Omnichannel has been successfully installed.

Figure 21: Omnichannel successfully installed.

I hope this helps!!!

Add related entity view on the Main Form

Today will learn how to populate the related associated entity in the main form.

I have a Contact entity and it has a (1:N) parental relationship with the entity “Signs & symptom“. The aim of this blog is to populate the Signs & symptoms next to the Summary tab so that the number of clicks gets limited.

Figure 1: Contact Form
Figure 2: Signs & symptoms related entity.

Let’s navigate to the Contact entity form editor. There we will have to add a new tab just below the Summary tab.

Figure 3: Adding new tab on Contact Form, below Summary tab.
Figure 4: Add label to the tab as “Signs & symptoms”.

Now, we will add a sub-gird inside the Signs & symptoms tab.

Figure 5: Add Sub-Grid to Tab

Then we will set the properties of the sub-grid by providing it a name, label. We will also do the entity and view mapping.

Figure 6: Set Properties of a section
Figure 7: Entity Mapping and selecting the default view

Once this is done. Hit the OK button and publish the changes.

Figure 8: Contact related entity “Signs & symptoms” populate next to Summary tab

In the above image, we can see that the Contact related entity “Signs & symptoms” populates next to the Summary tab.

By clicking on the Signs & symptoms tab we would get the same associated view which we would get when we navigate from related to Signs & symptoms.

Hope this blog helps you.

Calculate Age using Power Automate

Today, let’s learn how to calculate a person’s age using Power Automate.

There are multiple ways to calculate a person’s age. The DOB field which I have is of string type. So, I thought of using Power Automate to achieve this.

Search for Common Data Service and the trigger should be When a record is created, updated, or deleted as shown in the below image. Next, enter the required details like the environment and the entity name.

Figure 1: Selecting trigger for this flow

Then we will add a condition to our flow, where we will check whether the Date of Birth field is null or not.

Figure 2: Check Date of Birth field is null or not

If the Data of Birth field is not null then we will calculate the age. For that when the condition is met the flow would go under IF yes condition, where we will have to provide the entity name and field under which the calculated age needs to be populated.

Figure 3: Mapping of entity under which the calculated age value to be populated
div(div(sub(ticks(utcNow('yyyy-MM-dd')),ticks(triggerBody()['new_dateofbirth'])),864000000000),365.25)

We will use the above expression for calculating the age. 
Place the cursor inside the Calculate Age field and paste the above expression under the expression section and click on the Update button.

Figure 4: Using expression for calculating value.

Now, we need to test our flow. Hit the Test button on the right top of your screen.

Figure 5: Test Flow

After a successful run of the flow. We can see age would have been populated under the Calculate Age field under the Contact entity.

Hope this helps anyone !!!

Retrieve data from Azure Cosmos DB using Power Automate

Let’s learn about how to fetch data from Cosmos DB using Power Automate and push into Dynamics CRM.

For retrieving the data from Azure Cosmos DB we will need a few details from Azure:

1. URI
2. Primary Key

Figure 1: Azure Key for Cosmos DB connectivity

Let’s jump to Power Automate and start adding the necessary component for achieving this activity.

I have used a manual trigger for reading the data from Azure Cosmos DB and pushing it into Dynamics CRM.
Chose an action –> Search for Azure Cosmos DB, then under action select Get all documents.

Figure 2: Creating Flow using Azure Cosmos DB component

We will use the Azure Cosmos DB detail for establishing the connection as shown in the below image. Access Key to your Azure Cosmos DB account here we have to enter Primary Key as shown under Figure 1. Hit Create button.

Figure 3: Establishing connection with Cosmos DB
Figure 4: Select the DB and table

Select the desired database under the Database ID and table under the Collection ID field and hit the + New step button.

After the connection has been successfully established. Search for Parse JSON and add Documents under the Content field. Paste the JSON output under the schema. Hit the + New step button.

Figure 5: Parse JSON as an output

Next, we will search for a control Apply to each.

Figure 6: Add control Apply to each

Under, Select an output from previous steps field pastes the Body from the Dynamic content and click Add an action button.

Figure 7: Add Body from Dynamic content
Figure 8: Search for Common Data Service(current environment), Action: Create a new record

The above action is needed as it will allow us to map the value coming from JSON to be stored inside Dynamics CRM entity attributes. 

Figure 9: Mapping CRM attributes with the output columns.

Now, we need to test our flow with a few more clicks to be performed. Click on the Test button which would appear on the right top of the screen.

Figure 10: Test Flow

The flow will start executing, once the flow has run successfully we will get the below screen. 

Figure 12: Flow execution

Now, go into CRM and we will see the records have been created under the expected entity.

Hope this help anyone!

Mobile Timeline: Activate Camera feature under timeline from Dynamics 365 for Phone Mobile App

Taking a picture from Dynamics 365 mobile app and attaching it on the timeline at the same time is now possible.

We will just have to enable few setting from mobile app. Here are the step to follow:

Login to the mobile app using admin credential and go to Setting –> Mobile Setting

Below screen would appear after clicking on Mobile Setting. Enable Allow Access under Camera. If we want to save the picture taken from the phone into the phone gallery then, we also need to enable Save Photo to Library option. Hit the OK button.

Enabled the Camera feature from timeline

Now. let navigate to Opportunity. I have opened a record under opportunity.

Now, we see that the note has got saved under timeline of “Adobe Opportunity” record .

Thanks for reading the blog.

Restrict Auto Save at entity form level

Auto Save feature was introduced during CRM 2013 version and it is still will us today in Dynamics 365 version.

To activate AutoSave feature navigate to Settings ->Administrator –> System Settings -> Under General Tab -> Select Yes.

Enable Auto Save feature

Some important points about auto save:

  1. It works for update form means where form type = 2
  2. It does not work on create form means where form type = 1
  3. Auto save automatically triggers after 30 seconds.
  4. Once the auto save feature is enabled the Save button would disappear from the ribbon. User can save the form either by using Ctrl+S or by clicking the save icon which would appear on the right hand bottom side.
  5. Auto save feature can be enabled or disabled at organisation level. It cannot be enabled or disabled at entity level.

Considering 5 point in mind there are multiple scenarios where the Auto Save feature becomes a bottleneck for user. Example: If an organization has plug-ins, workflows, or jscripts that run on the OnSave event, they will trigger each time when auto-save occurs. This may potentially cause undesirable results especially if these customizations were not designed to work with auto-save.

For disabling the auto-save feature for a form, we will need a webresource of Javascript type.

Below is code logic which can be used for restricting a form from getting auto save.

function preventAutoSave(econtext) 
{ var eventArgs = econtext.getEventArgs(); 
if (eventArgs.getSaveMode() == 70 || eventArgs.getSaveMode() == 2) 
{ eventArgs.preventDefault(); } 
}

To know more about the Save event arguments(getSaveMode), Click Here.

Value Save ModeEntity
2Save and CloseAll
70Auto SaveAll
getSaveMode (Client API reference)

Let’s continue with the same javascript which we have used in our previous blog, I have added a new function formOnSave for preventing the auto save getting triggered.

var Namespace = window.Namespace || {};
(
function (){
this.formOnLoad = function(executionContext)
{
}

//Prevent form from triggering AutoSave 
this.formOnSave = function(executionContext)
{
var eventArgs = executionContext.getEventArgs();
if (eventArgs.getSaveMode() == 70 || eventArgs.getSaveMode() == 2) {
eventArgs.preventDefault();
}
}

this.validatephonenumber = function(executionContext)
{
var formContext = executionContext.getFormContext();
var phoneNumber = formContext.getAttribute("mobilephone").getValue();

//Using Regular expression
var regexpr = /(((\d{3}) ?)|(\d{3}-))?\d{3}-\d{4}/;

//Uing test for a match in a string. Returns true or false
if(!regexpr.test(phoneNumber))
{
/*Using field notification for displaying the error msg. User won't be able to save the form until the error is cleared up.*/
formContext.getControl("mobilephone").setNotification("Entered Phone number is not in a correct format", "validatephn");

//Using form notification for displaying the msg on the Form.
formContext.ui.setFormNotification("Warning Message", "WARNING", "formwarning");
}
else
{
/*Clear error notfication when the entered phone number is in the correct format. For clearing the notification only uniqueid is required.*/
formContext.getControl("mobilephone").clearNotification("validatephn");

/*Clearing form notification when the criteria is met. For clearing the notification only uniqueid is required.*/
formContext.ui.clearFormNotification("formwarning");
}
}
}
).call(Namespace);

Now, the JScript formOnSave function needs to be called on OnSave event of contact entity form.

formOnSave function has been added on OnSave event of Contact entity.

Hit the OK button. Save and Publish the changes.

Navigate to the Contact entity form, press Ctrl+F5 for clearing cache.

Now the Auto-Save would not trigger on the Contact entity form. User will need to press Ctrl+S or click on the Save button on the right button side of the screen.

Dynamics CRM: Notification for Client API Scripting

We have two types of notification which are useful when we want to populate any message to a user using client-side scripting.

  1. Form Notification
    • Syntax: formContext.ui.setFormNotification(message, level, uniqueid);
  2. Field Notification
    • Syntax: formContext.getControl(“logicalname”).setNotification(message, uniqueid);
  1. Form Notification is used when we want to populate any message to users on the form level. This is not specific to any attribute. It does not stop the user from saving the form,
    • Syntax: formContext.ui.setFormNotification(message, level, uniqueid);
    • message –> Here we need to write the message/alert which would get populated to the user.
    • level –> we have three types of levels. This is used to display an appropriate icon in front of the message.
      • INFO
      • ERROR
      • WARNING
    • uniqueid –> This can be any user define string value.

Field Notification is used when we want to display any error message to a user and restrict the user from saving the form until the error is cleared up.

We will learn how to validate the phone number format entered by the users.
I will use the namespace pattern for writing the Javascript. I have already explained the namespace function in one of my previous blogs. Click here to visit the blog.

Now, let’s continue with the contact entity where we would validate the phone number format for the mobile phone attribute.
Below is the code which can be used for validating the phone number format and notify the user when the entered phone number does not meet the required format criteria.

var Namespace = window.Namespace || {};
(
function (){
this.formOnLoad = function(executionContext)
{
}
this.validatephonenumber = function(executionContext)
{
var formContext = executionContext.getFormContext();
var phoneNumber = formContext.getAttribute("mobilephone").getValue();

//Using Regular expression
var regexpr = /(((\d{3}) ?)|(\d{3}-))?\d{3}-\d{4}/;

//Uing test for a match in a string. Returns true or false
if(!regexpr.test(phoneNumber))
{
/*Using field notification for displaying the error msg. User won't be able to save the form until the error is cleared up.*/
formContext.getControl("mobilephone").setNotification("Entered Phone number is not in a correct format", "validatephn");

//Using form notification for displaying the msg on the Form.
formContext.ui.setFormNotification("Warning Message", "WARNING", "formwarning");
}
else
{
/*Clear error notfication when the entered phone number is in the correct format. For clearing the notification only uniqueid is required.*/
formContext.getControl("mobilephone").clearNotification("validatephn");

/*Clearing form notification when the criteria is met. For clearing the notification only uniqueid is required.*/
formContext.ui.clearFormNotification("formwarning");
}
}
}
).call(Namespace);

Below is the screenshots of field/form notification. I have called the script on Contact entity and it would trigger on mobile phone attribute On Change event.

We can see that once the error(phone number format) is resolved the notification has been automatically cleared up.

Use the link to know more about Regular Expression.

I hope this blog helps in understanding the notifications, their types and when to use form or field notification.