Search and extract data from a large table

I am a Japanese internist and a Text Blaze user.

has a table of salt content. We would like to import this into Data Blaze and include it in the medical record for foods that the patient often inoculates himself/herself with.

For example, if the patient drinks a lot of red wine, then

I want to state "Red wine contains (salt content retrieved from table) milligrams of salt per (weight retrieved from table) grams of red wine.

What should I do?Thank you in advance.

Yes, you can absolutely do something like that with Text Blaze and Data Blaze!

Is there is a specific part of it you had a question about and wanted guidance on?

@scott
Thanks for your reply. For example, I would like to have a text field that says "Foods the patient eat often" and then search the table in Data Blaze for the food that is freely entered in the field.
If a match is found, I would like to display the text as follows: "(name of food) contains (x) g of salt". Is it possible?

Let's imagine you had a space with a table called Foods that looked like this:

Name, Salt
Pizza, 10
Hamburger, 20
Cabbage, 1

You could then write a snippet that queried it like so:

{formtext: name=food_name}
{dbselect: SELECT salt FROM foods WHERE name = @food_name; space=xyz123}
{=food_name} contains {=salt} g of salt.

That's just a start, you would want to add things like error handling in case the food wasn't found, but that's the basic gist.

Does that help?

Edited (added demo):

{formtext: name=food_name; default=Pizza}
{dbselect: SELECT salt FROM foods WHERE name = {=food_name}; space=id}
{=food_name} contains {=salt} g of salt.

@scott Thanks, that helps.

Is the language of Data Blaze the same as SQL?

Well, I'll try it myself, I'm just a doctor and know little about programming.

It's a variant of SQL called Blaze SQL (BSQL), you can learn more here: Text Blaze | BSQL Reference

We have a graphical editor for it when your editing the command in the dashboard that allows you to do simple things like this without writing any SQL directly.

1 Like

@scott Thanks a lot.

1 Like