Patient Monitor Program in C#

February 6, 2014 at 12:15:11
Specs: Windows Vista
Hi could anyone help me? I've started programming but I've yet to master it completely and I'm trying to create program that is kind of like a patient monitor that reads patient data from a text file. Could someone help me?

This Data;
HR BP Temp RR SPo2
80 120 36.8 12 98
80 120 36.8 12 98
80 120 36.8 12 98
79 123 36.8 12 98

To import data as above into the memory from a text file. To associate flexible timestamps with each group of data that is imported. To return the most recent group of data given a particular time within a simulated diagnostic session.

message edited by WishingforSam


See More: Patient Monitor Program in C#

Report •

#1
February 6, 2014 at 13:07:41
Sounds a lot like homework.

Report •

#2
February 7, 2014 at 12:23:45
If it is homework then you have to make some sort of start, then we can assist. Similarly if you have difficulty with a particular aspect this forum can also assist.

We can't do your homework for you, which would defeat the reasons for homework being given in the first place - in order to learn.

EDIT:
See #3. My apologies to WishingforSam.

message edited by Derek


Report •

#3
February 7, 2014 at 12:58:49
It's not homework. It's a tutorial that I found on the web. There's many parts too it and I've been fine with most of them but this one stumped me a little. I've created the code to read from the file and I can store the file details in memory the issue I'm having is associating timestamps with the data in the file and specifying a particular range. I just wanted advice as to where I would find that out because the book I'm using doesn't tell me, it just gives the tutorials. I'm a veterinary student that's just trying to learn to code using tutorials. I'm competent with Python but now I've moved onto try and learn C#

message edited by WishingforSam


Report •

Related Solutions

#4
February 7, 2014 at 13:55:53
I'm not seeing time data. Unless you're going with file time, or the file name itself denotes the range?

How To Ask Questions The Smart Way


Report •

#5
February 7, 2014 at 14:09:09
Hi, @Razor2.3 Thanks for replying to me. The tutorial I'm using says;

To associate flexible timestamps with each group of data that is imported.
Note: A simulated diagnostic session always starts from 0 second, with a configurable sampling interval (SI) afterwards. For instance, if the SI was set to 5 seconds, then the first group of data would be collected at 0 second, the second group of data at 5 second, the third group of data at 10 second, and so on.

I took it to mean the time between each line of data? Which is where I was becoming confused.

message edited by WishingforSam


Report •

#6
February 7, 2014 at 14:44:32
Sounds like it. The real question is where to start, or where should you end up?

The formula ends up being <starting dateTime> + ( <line number> * <sampling interval> ). It'd probably look a little like this (untested, not IDE checked, no error checking):

var SI = 5;
var startTime = DateTime.Today;
var inFile = new System.IO.StreamReader("some.txt");
int lineNo = 0;
string line;
while ((line = inFile.ReadLine()) != null) {
  Console.WriteLine("{0}: {1}", startTime.AddSeconds(SI * lineNo++), line);
}
inFile.Close();

EDIT: Well, I did say untested and not IDE checked.

How To Ask Questions The Smart Way

message edited by Razor2.3


Report •

#7
February 7, 2014 at 14:49:55
@Razor2.3

Would it be best in a console? I was attempting make it into a windows application, mostly cause I like making them look pretty(don't judge me)

message edited by WishingforSam


Report •

#8
February 7, 2014 at 18:15:33
Meh, it's your program. Using the console's easier for me in this context, because it's a single function call.

How To Ask Questions The Smart Way


Report •

Ask Question