Show logged in user's case details in IBM Case Manager

815 views Asked by At

I am creating a Healthcare solution in IBM Case Manager Case Builder. I have a role called 'Patient'. I would like to show the case details of the patient when they log in. Is there any way I can show the case details when the patient logs in.

I have another role called 'Doctor', who can view the case details of any patient by clicking the link in the row of the list of returned search results on searching the patient. However, on the patient side, there is no search and they have to see their case details as soon as they log in.

If someone could point me in the right direction regarding this, I would really appreciate it.

Thanks in advance.

1

There are 1 answers

0
Ivo Jonker On

Allright, i guess there are many ways to accomplish this, but having thought about it a few minutes, here's a suggestion.

a. Create a script-adapter on the landing page (Case Manager page).

While it would be more intuitive to connect to the ecm.moel.desktop.onLogin event, the onLogin is within the navigator scope, and we need to be sure that ICM was started because we need to acces role info / ICM api. By using a scriptadapter on the landing page, we not only ensure the ICM context/api is loaded, but we'll also be able to use the ICM api to retrieve a case, and open it...

b. In the script adapter, do your role check; this can be done through: var role = ecm.model.desktop.currentRole.name; (see this blog)

c. If the role is patient, find out the case(id's) you want to open; you might want to query using the ecm.model.SearchQuery or you could construct a pluginservice (see this redbook on services).

d. With the result of c, you'd then be able to open the case-page using the OpenCase event with a corresponding payload.

var caseId = "the id resulting from c.";

this.getSolution().retrieveCase(caseId, lang.hitch(this, function(caseFolder) {
    this.onBroadcastEvent ('icm.OpenCase', { 
                                "caseEditable": caseFolder.createEditable(), 
                                "coordination": new icm.util.Coordination()
                        });
});