views:

62

answers:

2

Hi Guys,

I'm doing a system with Codeigniter , this is my first system with CI, and i'm also novice to PHP too.

I'm doing this for a hospital, in this i have the following problem

  • junior doctor first check the 1st visit patients and then if he can't handle them he refer them to the senior doctor

  • from registration room some patients are send to the eye checking room to check their eyes and then they go to the junior doctor

like wise i have temporary data to be kept on the system, references from one room to another and so on...

i need to get this details to the main GUI of the each person; for example in the Senior doctors UI there will be a tab named 1St time patients, in that the patients that was referred by the junior doctor will be shown to him! so i need to refer to the patients that was sent to senior doctor from the junior doctor and show them in the senior doctor's UI.

so my problem is how can i keep this temporary data to be referenced by the system? keeping them in the tables is not appropriate as i think because at the end of the day these data is not stored any where, only the patient table and few other tables will be keeping the data.

guys how can i achieve this kind of thing? any method of achieving this? technology that is easier to master that will allow me to keep temporary data?please give me some references or help by code to over come this problem.

regards, Rangana

+3  A: 

If the data is truly temporary, and has to be used by only one user at a time you need to stick it in session.

An entry level tuorial is here: http://www.w3schools.com/PHP/php_sessions.asp

However if data is accessed by different users, but is simply not needed on following days, or you are storing a significant amount of data, you should probably keep it in the DB.

The DB should be able to store lots of data, so on a smallish app there is not much reason to keep clearing it out, but you could also include a housekeeping function that clears data that is old or irrelevant.

However when working with medical data, it may be a good idea to hang on to everything.

Matt
Thank you very much Matt! i have data that is referred by few people, so the session approach is not suitable, i will stick to tables!
ranganaMIT
A: 

everything will do with ajax (or something that always refresh the browser for number of time like meta refresh tag) that will notify senior / junior doctor if any patient referred to them.

you need to add a flag at database if the doctor already retrieve the notification so it will not notify the doctor twice.

for example your database table :

Name of patient | referral | referrer | flag_retrieved

you need to specify referral doctor at the session so it can retrieve the correct record and then notify the doctor

then your system should :

  • request to database if any doctor to refer patient to them over time (you can use ajax or meta tag)
  • database will check if any record match and not yet retrieved
  • send request to browser, than notify the doctor if any referred patient.

if you need to clean up the database, you can use cron every end of day for deleting any record at the table.

Swing Magic