Example #1
0
        public void setNumberOfInterventionsPerClassification()
        {
            foreach (Intervention i in Intervention.getActiveInterventionList())
            {
                if (i.getChiefComplaint() != null)
                {
                    if (numberOfInterventionsPerClassification.ContainsKey(i.getChiefComplaint()))
                    {
                        numberOfInterventionsPerClassification[i.getChiefComplaint()]++;
                    }
                    else
                    {
                        numberOfInterventionsPerClassification.Add(i.getChiefComplaint(), 1);
                    }
                }
            }
            try
            {
                foreach (KeyValuePair <string, int> pair in numberOfInterventionsPerClassification)
                {
                    Label lbl = new Label();
                    lbl.Content = pair.Key + ": ";
                    statisticsPage.LabelStackPanel.Children.Add(lbl);

                    Label lblValue = new Label();
                    lblValue.Content = pair.Value;
                    statisticsPage.InfoStackPanel.Children.Add(lblValue);
                }
            }
            catch { }
        }
        public InterventionAdditionalInfo(Intervention intervention, String information, DateTime timestamp)
        {
            this.information = information;
            this.timestamp   = timestamp;

            this.interventionID   = intervention.getID();
            this.additionalInfoID = StaticDBConnection.NonQueryDatabaseWithID("INSERT INTO [Additional_Informations] (Intervention_ID, Information, Timestamp) VALUES (" + interventionID + ", '" + information.Replace("'", "''") + "', '" + StaticDBConnection.DateTimeSQLite(timestamp) + "')");
        }
Example #3
0
 public Resource(Intervention intervention, Team team)
 {
     this.team           = team;
     this.intervening    = true;
     this.moving         = DateTime.Now;
     this.movingBool     = true;
     this.interventionID = intervention.getID();
     this.resourceID     = StaticDBConnection.NonQueryDatabaseWithID("INSERT INTO [Resources] (Intervention_ID, Team_ID) VALUES (" + interventionID + ", " + team.getID() + ")");
 }
Example #4
0
        public void setInterventionsPerTeam()
        {
            foreach (Intervention i in Intervention.getActiveInterventionList())
            {
                foreach (Team team in i.getInterveningTeamList())
                {
                    if (i.getCode() == 1)
                    {
                        team.IncrementCode1();
                    }
                    if (i.getCode() == 2)
                    {
                        team.IncrementCode2();
                    }
                }
            }

            foreach (Intervention i in Intervention.getCompletedInterventionList())
            {
                foreach (Team team in i.getInterveningTeamList())
                {
                    if (i.getCode() == 1)
                    {
                        team.IncrementCode1();
                    }
                    if (i.getCode() == 2)
                    {
                        team.IncrementCode2();
                    }
                }
            }

            foreach (Team team in Team.getTeamList())
            {
                if (team.getCode1Count() != 0)
                {
                    Label lblCode1 = new Label();
                    lblCode1.Content = "Team " + team.getName() + " Code 1: ";
                    statisticsPage.LabelStackPanel.Children.Add(lblCode1);

                    Label infoLbl1 = new Label();
                    infoLbl1.Content = team.getCode1Count();
                    statisticsPage.InfoStackPanel.Children.Add(infoLbl1);
                }
                if (team.getCode2Count() != 0)
                {
                    Label lblCode2 = new Label();
                    lblCode2.Content = "Team " + team.getName() + " Code 2: ";
                    statisticsPage.LabelStackPanel.Children.Add(lblCode2);

                    Label infoLbl2 = new Label();
                    infoLbl2.Content = team.getCode2Count();
                    statisticsPage.InfoStackPanel.Children.Add(infoLbl2);
                }
                team.ResetCodeCount();
            }
        }
Example #5
0
        public ABC(Intervention intervention)
        {
            this.consciousness        = "notSet";
            this.disoriented          = false;
            this.airways              = "notSet";
            this.breathing            = "notSet";
            this.breathingFrequency   = -1;
            this.circulation          = "notSet";
            this.circulationFrequency = -1;
            this.interventionID       = intervention.getID();

            this.abcID = StaticDBConnection.NonQueryDatabaseWithID("INSERT INTO [ABCs] (Intervention_ID) VALUES (" + interventionID + ");");
        }
Example #6
0
        public void setAverageInterventionDuration()
        {
            List <TimeSpan> durationTimes = new List <TimeSpan>();

            foreach (Intervention i in Intervention.getCompletedInterventionList())
            {
                durationTimes.Add(i.getConclusionTime() - i.getFirstTeamArrivalTime());
            }
            try
            {
                double doubleAverageTicks = durationTimes.Average(timeSpan => timeSpan.Ticks);
                long   longAverageTicks   = Convert.ToInt64(doubleAverageTicks);

                this.averageDuration = new TimeSpan(longAverageTicks);
            }
            catch { }
        }
Example #7
0
        public void setAverageResponseTime()
        {
            List <TimeSpan> responseTimes = new List <TimeSpan>();

            foreach (Intervention i in Intervention.getActiveInterventionList())
            {
                if (i.getFirstTeamArrivalTime() != DateTime.MinValue)
                {
                    responseTimes.Add(i.getFirstTeamArrivalTime() - i.getTimeOfCall());
                }
            }
            try
            {
                double doubleAverageTicks = responseTimes.Average(timeSpan => timeSpan.Ticks);
                long   longAverageTicks   = Convert.ToInt64(doubleAverageTicks);

                this.averageResponseTime = new TimeSpan(longAverageTicks);
            }
            catch { }
        }
Example #8
0
 //Add the completed intervention to the completed intervention list
 public static void AddCompletedIntervention(Intervention intervention)
 {
     completedInterventionList.Add(intervention);
     ClassModifiedNotification(typeof(Intervention));
 }
Example #9
0
 //Add active interventions to the list of active interventions
 public static void AddActiveIntervention(Intervention intervention)
 {
     activeInterventionList.Add(intervention);
     ClassModifiedNotification(typeof(Intervention));
 }
Example #10
0
 public void setNumberOfInterventions()
 {
     numberOfOngoingInterventions   = Intervention.getActiveInterventionList().Count;
     numberOfCompletedInterventions = Intervention.getCompletedInterventionList().Count;
 }