Page 1 of 1

MedStats (Data Files for Multiple Users)

Posted: Tue Jun 28, 2005 6:18 pm
by Welopez
Recently, long time friends of ours were visiting our place in Nevada for a few days. He is 75 years of age and has recently had both a pace-maker and defibrillator implanted. He also has diabetes. To keep a check on these illnesses and the effect of his medications, he keeps a log for his doctor to review the results of his home testing.

What could be more useful than a data file to maintain these records and compute updated averages? Short-term trends can also be revealed long before the latest readings will become apparent in the overall average.

For those who may not be aware, Janet Terra has a great deal of experience as a health-care professional. Janet assisted me with her knowledge of what data would be useful, both to the patient and the doctor, and as an uncomplaining "beta tester" as I developed the code for this project.

MedStats is written entirely in JB as a DEMO using a multi-dimensioned array for up to 10 user files. MedStats allows users to keep tabs on their weight, blood sugar and blood pressure. The EXE file is a stand-alone version which can be run on any Windows Operating System. It can be downloaded from my website, www.jbmailroom.com/guest/MedStats_Prog.exe The BAS file is included so you can edit or customize the program to suit your needs. I used Alyce Watson's LB Workshop to create my own icon and attach it to the runtime engine. The executable program was created using WinRAR. When installed, it creates a desktop icon for the program, and automatically runs the help file for the user.

For Just Basic users who do not need the runtime engine, DLL and SLL files, the version uploaded here is MedStats_LITE.zip, an open source program which you can modify as desired. It is intended as a DEMO to illustrate the use of a multi-dimensioned array, a text file to store and update multiple data files for up to 10 users, a users log-on, a CHM help file (which is the bulk of the zip file), and computing/displaying three averages for several types of data. MedStats_LITE should be unzipped to your Just Basic program folder and will create a folder of it's own, containing the sample data file, .ini file, images, and BAS program. The first time you run MedStats, you should log on as SAMPLE user. Any time you wish, you can add a user name and create your own data file.

MedStats is a GUI allowing the user to enter weight, blood sugar, blood pressure and heart rate to be saved as a data file. Every time the program is run, three averages for each field are presented to the user:

1. The overall average.
2. The average of the 30 most recent values.
3. The average of the 3 most recent values.

Separate data files can be saved for up to 10 users. Error checking means you do not have to fill in all data fields in the event your doctor does not require data for all fields. You can make one entry for weight and several entries for blood sugar or blood pressure each day. Non-entries will not affect computed averages.

When desired, results can be displayed on screen using NOTEPAD, then saved as a text file and/or sent to the printer. This is convenient if you want a hard copy to take with you to your next office visit, or send by email.

MedStats is free-ware. Feel free to copy and share with any persons you desire, and to modify the code to suit your individual needs.

Edit 07/16/05 to allow new user to begin with only one record and properly display averages.
Edit 07/27/05 Updated CHM Help file. New program displays values less than 3 day and 30 day averages. Also includes the Personal History File for individual users.

Posted: Tue Jun 28, 2005 10:48 pm
by wayne
When I run this either in JB or the .exe, all I get is a logon window that does nothing!

It has an empty combobox and a cancel button.

<edit>
The combobox just doesn't have any room to drop down to display any names. The down-arrow selects "NEW USER" and won't let me select anything else!

<2nd-edit>
I changed the COMBOBOX to a LISTBOX and made it a little bigger, and it works perfectly. Only difference from a COMBOBOX is that you have to double-click it.

<3rd-edit>
I added an IF - THEN to avoid adding blank lines to the .ini file when no name is entered. Blank lines add an empty element to the username variable and cause a duplicate user error message if no name is added (when the prompt is cancelled, it adds an empty username)

<4th edit>
changed how the average record entries are displayed
changed logon back to a combobox

MedStats (Data Files for Multiple Users)

Posted: Tue Jun 28, 2005 11:15 pm
by Welopez
Thanks for the reply, Wayne. I'll look into this. I had a similar problem when I ran the program on a Win 95 machine. The combobox would not display anything at all. I think it is because Win 95 has only 16-bit capability, but I'm not a chip architect! :oops:

So far I have installed it on my desktop and laptop, both by downloading from the post instead of files on my computer. Both computers have Win XP SP2. I wish I had another machine to test it on Win 98 and 2000, that's one of the reasons I posted the file. The more comments I get, hopefully the more corrections I can make.

Thanks again! :D

Posted: Tue Jun 28, 2005 11:42 pm
by John Davidson
Hey Bill
Cool app but I had to change the logon combobox height.

Code: Select all

COMBOBOX #log.bx, user$(), [thisFile], 10, 10, 150, 125
I'm running 98se
John

MedStats (Data Files for Multiple Users)me

Posted: Wed Jun 29, 2005 12:02 am
by Welopez
Thanks for the clue, John! I'm sure that's the problem, but it's not apparent until the program is run on a computer with a different screen resolution. I'm going to make that change in the BAS program and try it again with Win 95. Perhaps it will work this time!

Thanks again! :D

MedStats (Data Files for Multiple Users)

Posted: Wed Jun 29, 2005 12:42 am
by Welopez
You found the problem, John! I wrote and tested the program on two computers with a display of 1024 by 768. When I tried to run it on an older laptop with Win 95 and screen resolution of 800 by 600, the logon screen was completely blank and would not display any user names.

By going into the BAS code and changing the height of the COMBOBOX to 150, everything runs find now, even on Win 95!

All I have to do now is make another EXE file with the corrected height for the COMBOBOX, and MedStats should be compatible for all users.

Thanks again! :lol: