//create a grid with all the patients, and each patient all the visits public void fillIndexFile() { for (int i = 0; i < patients.Count; i++) { Patient thisPatient = patients[i]; string toAdd = thisPatient.getSurname() + " --> "; List <Visit> visitsThisPatient = thisPatient.getVisits(); for (int a = 0; a < visitsThisPatient.Count; a++) { Visit v = visitsThisPatient[a]; toAdd = toAdd + " visit: " + v.getDate() + ";"; } toAdd = toAdd + "\n"; Global.addIndex(toAdd); } //Global.writeToFile(); }
public static AllPatients buildAllData() { //read al the folders in ROOT (each folder is a patient) FoldersHandler fh = new FoldersHandler("ROOT"); List <String> lsf = fh.getSubFolders(); //get all the patient in their objects AllPatients ap = new AllPatients("ROOT"); List <Patient> lp = ap.getPatients(); //for each patient show all the visits for (int i = 0; i < lp.Count; i++) { Patient p = lp[i]; List <Visit> lv = p.getVisits(); } //create in Global a structure with all the initial info about //patient and visitis ap.fillIndexFile(); return(ap); }
private void fillVisits() { if (thisP != null) { allVisits = thisP.getVisits(); this.Visits.Rows.Clear(); this.Visits.AllowUserToAddRows = false; int indexRow = 0; for (int i = 0; i < allVisits.Count; i++) { Visit thisV = allVisits[i]; this.Visits.Rows.Add(); this.Visits.Rows[indexRow].Cells[1].Value = thisV.getDate(); this.Visits.Rows[indexRow].Cells[2].Value = thisV.getResult(); indexRow++; } } else { this.Visits.Hide(); this.AddVisit.Hide(); } }