Hi,
In my patient database app, I have a table called โPersonal Detailsโ that has a key column that generates unique IDs for each row. This table has all the personal details of patients of the entire database. Then I have 3 different tables called โLiverโ, โPancreasโ, โBiliary Tractโ. All patients in โPersonal Detailsโ table have been divided among these 3 tables based on the pathology they have (Liver diseases in โLiverโ table, Pancreatic diseases in โPancreasโ table and so on). Each of these 3 tables (Liver/Pancreas/Biliary Tract), has a separate โKeyโ column that records exactly the unique ID of the patients extracted from the โPersonal Detailsโ table as these 3 tables have been referenced as โChildโ tables for the โPersonal Detailsโ table which is the โParentโ table.
What I want to do is to isolate the Unique IDs in the โKeyโ column of the โLiverโ table from the entire set of Unique IDs in the โKeyโ column of โPersonal Detailsโ table using a SLICE, so that I can create various charts from the โPersonal Detailsโ table for just โLiverโ patients (A row filter condition in the Slice).
Can I do this? Appreciate your help!
Thank you very much.
Hey Malaka.
What Iโve done in the past is to create slices for each individual sub-group I wanted to create; so for your example youโd create 3 slices (each of the Patients table):
Liver_Patients, Pancreas_Patients, and Biliary_Tract_Patients
To accomplish the slice filtering, you need a way to tell (on the patient level) whether or not someone has the presence of a โLiverโ record, for example.
You said youโve got things split into separate tables, yes? Using a reference between them and the patient table?
Then we can use the presence of a record in the [Related Liver] column; for your slices, try something like this:
isnotblank([Related Liver])
One slice for each of the Related tables youโve got - so when someone creates a liver record, that patientโs [Related Liver] column is no longer blank, and it will then show up in the Liver_Patients slice.
Hope that made sense.
Thank you so much for the reply.
I tried something else, and it kind of worked for me.
I had an intermediate table called โDiagnosisโ in which the user could select whether patientโs diagnosis is Liver related/pancreas related/biliary tract related using an Enum type column called the [Involved organ]. So this Diagnosis table was recording all the UniqueIDs from the parent table โPersonal Detailsโ, as it too was a child table of the โPersonal Detailsโ parent table. And when the user selects โLiverโ from the [Involved organ] Enum in the โDiagnosisโ table, the app then opens up the โLiverโ table (as I have referenced the โLiverโ table to that โDiagnosisโ table) so that the user can enter the liver pathology data at that point.
So what I did was, I created a virtual column in the parent table โPersonal Detailsโ called [Involved organ_VC] to grab the [Involved organ] columnโs data in the โDiagnosisโ table. For this purpose, I wrote the following app formula.
INDEX(SELECT([Diagnosis][Involved organ],TRUE),1)
This made [Involved organ_VC] in the โPersonal Detailsโ table to exactly act as the [Involved organ] column of the โDiagnosisโ table that recorded either of the following three words โLiverโ, โPancreasโ, or โBiliary Tractโ (the values Iโve included in the Enum column properties of the [Involved organ] column in โDiagnosisโ table). So afterward, I simply isolated the โLiverโ word in this [Involved organ_VC] that is now in the โPersonal Detailsโ parent table using a row filter expression called [Involved organ_VC]=โLiverโ, and that isolated all the liver patients and from there on I could simply chart the gender distribution/age distribution and other parameters that were collected in the โPersonal Detailsโ table pertaining to โLiverโ patients.
I donโt know what I did was prudent or not, but somehow it worked. Iโm wondering if what youโve said could get the same results. Should check that out.
Thank you again for the reply. Appreciate it!
The way you went about it is exactly another way to do it! Thatโs one of the best things about the AppSheet platform, thereโs X number of ways to do anything.
When I was typing out my explanation, this was actually the first method that came to mind: create a flag on the patient level - then you can slice based on that.
But trying to explain the whole SELECT([Diagnosis][Involved organ],TRUE) thing can be complicated.
I would create [Liver_Flag] or something like that, and use:
in(โLiverโ, [Diagnosis][Involved organ])
Should give the same results - TRUE whenever thereโs a Liver in the Involved Organs.
Happy it worked out!
Thank you so much!
User | Count |
---|---|
35 | |
35 | |
28 | |
23 | |
18 |