Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
ArturoMuñoz
Employee
Employee

A few months ago we at the demo team accepted the challenge to create a prototype for the healthcare industry. The goal was to create a user-friendly way to analyze a huge dataset provided by one of our healthcare partners, DarkMatter2bd. They carefully explained to us some usage cases for their data and we agreed to create a mashup to analyze and visualize “comorbidity”.

So what does comorbidity means?

In medicine, comorbidity is the presence of one or more additional diseases or disorders co-occurring with (that is, concomitant or concurrent with) a primary disease or disorder; in the countable sense of the term, a comorbidity (plural comorbidities) is each additional disorder or disease.


Source: Wikipedia

If you are in the healthcare industry then I am sure you have heard someone asking something like: can you show me patients that have X and Y and Z? To answer that question and some more we came up with a new mash up called Pre-launch Targeting & Clinical Trial Recruitment. It contains non-real data for almost six hundred thousand patients located in the state of Pennsylvania.

When a user gets into the mashup we prompt them with a search box that performs a search across the entire range of diseases or disorders available in our data sample. Once the user has chosen a primary disease we take them to the Recruitment page where data can be freely explored and analyzed, and more importantly, where more disorders or diseases can be added to the query.

Real use case scenario.

An imaginary healthcare company is planning to launch a new drug for people suffering from diabetes and they need to find a group of patients that meet some requirements. They must have diabetes and must have hypertension but must not be allergic to penicillin.

step1.png

After we search for diabetes we get to a count of 62,861 patients in our data. It represents approximately a 10% of our sample. Next  is time to search for hypertension. We will add a second condition to our query.

step2.png

The inclusion of hypertension draws 42,491 patients that suffer from both diabetes & hypertension.

Our last search will be penicillin intolerance. Please notice that by default our mashup will add new search terms with AND condition to the query. The count of patients temporarily reflects 113 patients for the combination of diabetes AND hypertension AND penicillin allergy. Users can freely switch any condition to AND NOT by clicking into the tag. By doing so in the "Personal History of Allergy to Penicillin" tag we end up having a result set that matches our initial request, resulting in 42,378 patients with diabetes AND hypertension AND NOT penicillin allergy.

step3.png

Set analysis element function P()

The secret sauce in our recipe is the Set analysis element function P(), it helps us to create subsets of data which we can operate with.

We basically want to count patients where disease = X and disease = Y. If we use Qlik notation for that condition would look like:

Count({<patient = P({<disease={'X'}>}patient) * P({<disease={'Y'}>}patient)>} distinct Patient)

The expression above will create two sets, P({<disease={'X'}>}patient) will contain all the possible patients that have disease = X, while the second piece P({<disease={'Y'}>}patient), will retrieve all the possible patients with disease = Y. Finally the " * " operator will calculate the intersection of both sets.


The webapp Pre-launch Targeting & Clinical Trial Recruitment dynamically creates as many P sets as needed and the right operator to compose the right expression.


If you want to learn more about Set Analysis please check this posts:


Why is it called Set Analysis?

A Primer on Set Analysis

Natural Sets

I hope you like Pre-launch Targeting & Clinical Trial Recruitment

Arturo (@arturoqv)

19 Comments
ArturoMuñoz
Employee
Employee

So our main expression that helps us to count distinct patients looks like this:

=count({$<PATIENT_KEY=$(vExpression)>} DISTINCT PATIENT_KEY)


We are updating "vExpression" with the result of the user input in the search object and in the tags, using javascript we do something like:


angular.forEach(tags, function(tag) {

                var operand = tag.operand ? tag.operand : "";

                expression += operand + "P ({" + tag.uid + "}PATIENT_KEY)";

            });

1,314 Views
Clever_Anjos
Employee
Employee

Guys, you have shown me a new world Thanks a lot

1,314 Views
vkish16161
Creator III
Creator III

Can you please show us, how you've set the formatting for Tornado chart?  Just curious. We have a similar implementation that we may have to do where we need to change negative sign to positive. Please help

0 Likes
1,382 Views
vkish16161
Creator III
Creator III

For the Tornado chart, here's the solution.

Dimension: For e.g. Date

Measure_1: num(Sum(Sales),'#,##0;#,##0')

Measure_2: num(-Sum(Cost),'#,##0;#,##0')

Presentation Option in Qlik Sense: Stacked, Vertical option.

Caveat: Export option MAY reveal negative values. (I've seen sometimes it doesn't show negative values but sometimes it does)

Voila!

0 Likes
1,382 Views
vkish16161
Creator III
Creator III

For the Tornado chart, here's the solution.

Dimension: For e.g. Date

Measure_1: num(Sum(Sales),'#,##0;#,##0')

Measure_2: num(-Sum(Cost),'#,##0;#,##0')

Presentation Option in Qlik Sense: Stacked, Vertical option.

Caveat: Export option MAY reveal negative values. (I've seen sometimes it doesn't show negative values but sometimes it does)

Voila!

0 Likes
1,382 Views
ArturoMuñoz
Employee
Employee

Hi Vishnu,

I posted just about that chart, please take a look at it:

How to create a Butterfly (Tornado) Chart in Qlik Sense

0 Likes
1,382 Views
Lauri
Specialist
Specialist

Very relevant to what I'm working on, and very helpful! Many thanks.

0 Likes
1,382 Views
RadovanOresky
Partner Ambassador
Partner Ambassador

Hi Arturo,

I'm guessing that you use variables to assign values inside SET analysis. Is the "disease" dimension loaded multiple times in the data model, or are you using javascript to pass the searched values and construct the SET expression on the fly?

Is this actually doable in the standard Qlik Sense app environment or can it be done only in a mashup?

Regards,

Radovan

0 Likes
1,382 Views
ogatchell
Contributor III
Contributor III

Arturo,

Is the prototype script downloadable? 

The application no longer appears available in the link provided. Still I'm not sure the corresponding script would have been available tin the first place.

This appears to be one of the more elegant, simplified approaches to create and-mode solutions, since Qlik has yet to redeem in Sense, the and-mode feature made available in Qlikview. 

578 Views