Procedure

TfrmGraphs.MakeLineSeries

Module

fGraphs

Last Modified

7/15/2014 3:26:36 PM

Visibility

Private

Owner

TfrmGraphs

Declaration

procedure MakeLineSeries(aChart: TChart; aTitle, aFileType, section: string;
  var aSerCnt, aNonCnt: integer; multiline: boolean);

Calls Hierarchy


TfrmGraphs.MakeLineSeries
 ├TfrmGraphs.MakeSeriesInfo
 │ ├TfrmGraphs.GetData
 │ │ └TfrmGraphs.FMCorrectedDate
 │ └TfrmGraphs.NextColor
 ├TfrmGraphs.NextPointerStyle
 ├TfrmGraphs.BPCheck
 │ └TfrmGraphs.MakeSeriesBP
 ├TfrmGraphs.FMCorrectedDate
 ├TfrmGraphs.HighLow
 │ └TfrmGraphs.FMToDateTime
 ├TfrmGraphs.BPAdd
 │ └TfrmGraphs.BorderValue
 ├TfrmGraphs.NumAdd
 │ ├TfrmGraphs.StdDev
 │ ├TfrmGraphs.BorderValue
 │ └TfrmGraphs.InvVal
 ├TfrmGraphs.NonNumSave
 ├TfrmGraphs.MakeSeriesRef
 │ └TfrmGraphs.BorderValue
 ├TfrmGraphs.MakeSeriesPoint
 ├TfrmGraphs.PainAdd
 └TfrmGraphs.FixedDates

Called-By Hierarchy


                                  TfrmGraphs.MakeLineSeries
                             TfrmGraphs.MakeSeparateItems┤ 
                                TfrmGraphs.MakeSeparate┘ │ 
                               TfrmGraphs.DisplayData┤   │ 
                             TfrmFrame.ClearPatient┤ │   │ 
                           TfrmFrame.SetupPatient┘ │ │   │ 
                      UpdatePatientInfoForAlert┤   │ │   │ 
                   TfrmFrame.mnuFileNextClick┘ │   │ │   │ 
                 TfrmFrame.mnuFileOpenClick┤   │   │ │   │ 
                     TfrmFrame.UMInitiate┤ │   │   │ │   │ 
            TfrmFrame.mnuFileNextClick...┤ │   │   │ │   │ 
            TfrmFrame.mnuFileRefreshClick┤ │   │   │ │   │ 
            TfrmOrders.CheckOrderStatus┤ │ │   │   │ │   │ 
        TfrmOrders.mnuActChgEvntClick┤ │ │ │   │   │ │   │ 
           TfrmOrders.mnuActHoldClick┤ │ │ │   │   │ │   │ 
         TfrmOrders.mnuActUnholdClick┤ │ │ │   │   │ │   │ 
          TfrmOrders.mnuActRenewClick┤ │ │ │   │   │ │   │ 
         TfrmOrders.mnuActChangeClick┤ │ │ │   │   │ │   │ 
           TfrmOrders.mnuActCopyClick┘ │ │ │   │   │ │   │ 
                 TfrmMeds.mnuActDCClick┤ │ │   │   │ │   │ 
                TfrmMeds.CheckMedStatus┘ │ │   │   │ │   │ 
             TfrmMeds.mnuActHoldClick┤   │ │   │   │ │   │ 
            TfrmMeds.mnuActRenewClick┤   │ │   │   │ │   │ 
           TfrmMeds.mnuActUnholdClick┤   │ │   │   │ │   │ 
           TfrmMeds.mnuActChangeClick┤   │ │   │   │ │   │ 
             TfrmMeds.mnuActCopyClick┤   │ │   │   │ │   │ 
           TfrmMeds.mnuActRefillClick┘   │ │   │   │ │   │ 
                       TfrmFrame.ViewInfo┘ │   │   │ │   │ 
                    TfrmDCSumm.ViewInfo┤   │   │   │ │   │ 
                  TfrmConsults.ViewInfo┤   │   │   │ │   │ 
          TfrmFrame.pnlRemindersMouseUp┤   │   │   │ │   │ 
           TfrmFrame.RemindersChanged┘ │   │   │   │ │   │ 
               TfrmFrame.FormCreate┘   │   │   │   │ │   │ 
                 TfrmFrame.pnlCIRNClick┤   │   │   │ │   │ 
           TfrmFrame.pnlVistaWebClick┤ │   │   │   │ │   │ 
                TfrmFrame.FormKeyDown┘ │   │   │   │ │   │ 
              TfrmFrame.pnlPatientClick┤   │   │   │ │   │ 
                TfrmFrame.pnlVisitClick┤   │   │   │ │   │ 
          TfrmFrame.pnlPrimaryCareClick┤   │   │   │ │   │ 
            TfrmFrame.pnlRemindersClick┤   │   │   │ │   │ 
             TfrmFrame.pnlPostingsClick┤   │   │   │ │   │ 
                 TfrmFrame.pnlFlagClick┤   │   │   │ │   │ 
                   TfrmFrame.laMHVClick┤   │   │   │ │   │ 
                  TfrmFrame.laVAA2Click┤   │   │   │ │   │ 
                    TfrmOrders.ViewInfo┤   │   │   │ │   │ 
                      TfrmMeds.ViewInfo┤   │   │   │ │   │ 
                   TfrmSurgery.ViewInfo┤   │   │   │ │   │ 
                     TfrmNotes.ViewInfo┤   │   │   │ │   │ 
                  TfrmProblems.ViewInfo┘   │   │   │ │   │ 
          TfrmFrame.mnuFileNotifRemoveClick┤   │   │ │   │ 
                  TfrmFrame.NextButtonClick┘   │   │ │   │ 
                TfrmFrame.SetUpNextButton┘     │   │ │   │ 
          TfrmFrame.mnuFileOpenClick...┤       │   │ │   │ 
                   TfrmFrame.FormResize┘       │   │ │   │ 
                 TfrmFrame.ChangeFont┘         │   │ │   │ 
         TfrmFrame.LoadSizesForUser┤           │   │ │   │ 
    TfrmFrame.LoadUserPreferences┘ │           │   │ │   │ 
           TfrmFrame.UMInitiate┘   │           │   │ │   │ 
         TfrmFrame.mnuFontSizeClick┘           │   │ │   │ 
                  TfrmFrame.mnuFileOpenClick...┤   │ │   │ 
               TfrmFrame.AllowCCOWContextChange┤   │ │   │ 
                TfrmFrame.mnuFileNextClick...┤ │   │ │   │ 
                TfrmFrame.mnuFileOpenClick...┤ │   │ │   │ 
       TfrmFrame.mnuFileResumeContextSetClick┘ │   │ │   │ 
                    TfrmFrame.UpdateCCOWContext┤   │ │   │ 
                TfrmFrame.mnuFileOpenClick...┤ │   │ │   │ 
              TfrmFrame.ctxContextorCommitted┤ │   │ │   │ 
               TfrmFrame.StartCCOWContextor┘ │ │   │ │   │ 
                     TfrmFrame.FormCreate┘   │ │   │ │   │ 
       TfrmFrame.mnuFileResumeContextGetClick┘ │   │ │   │ 
         TfrmFrame.mnuFileResumeContextSetClick┘   │ │   │ 
                            TfrmReports.ClearPtData┤ │   │ 
                        TfrmFrame.ClearPatient...┘ │ │   │ 
                                  TfrmReports.Graph┤ │   │ 
                       TfrmReports.tvReportsClick┘ │ │   │ 
                TfrmFrame.lstCIRNLocationsClick┤   │ │   │ 
                          TfrmFrame.SetUpCIRN┘ │   │ │   │ 
                  TfrmFrame.SetupPatient...┘   │   │ │   │ 
                        TfrmReports.DisplayPage┤   │ │   │ 
                       TfrmReports.LoadTreeView┤   │ │   │ 
                      TfrmReports.DisplayPage┤ │   │ │   │ 
         TfrmOptionsReportsDefault.btnOKClick┤ │   │ │   │ 
      TfrmOptionsReportsDefault.btnResetClick┤ │   │ │   │ 
       TfrmOptionsReportsCustom.btnApplyClick┘ │   │ │   │ 
        TfrmOptionsReportsCustom.btnOKClick┘   │   │ │   │ 
               TfrmReports.ProcessNotifications┤   │ │   │ 
                      TfrmReports.DisplayPage┘ │   │ │   │ 
                   TfrmReports.tvReportsKeyDown┤   │ │   │ 
                TfrmReports.tvProceduresKeyDown┤   │ │   │ 
                    TfrmReports.chkMaxFreqClick┤   │ │   │ 
           TfrmOptionsReportsDefault.btnOKClick┤   │ │   │ 
        TfrmOptionsReportsDefault.btnResetClick┤   │ │   │ 
      TfrmOptionsReportsCustom.btnApplyClick...┘   │ │   │ 
                        TfrmGraphs.chkItemsTopClick┤ │   │ 
                     TfrmGraphs.chkItemsBottomClick┤ │   │ 
                 TfrmGraphs.mnuPopGraphIsolateClick┤ │   │ 
                      TfrmGraphs.cboDateRangeChange┤ │   │ 
                    TfrmReports.lstDateRangeClick┤ │ │   │ 
                         TfrmReports.GraphPanel┘ │ │ │   │ 
                         TfrmReports.Graph...┤   │ │ │   │ 
                TfrmReports.tvReportsClick...┘   │ │ │   │ 
                            TfrmGraphs.Initialize┤ │ │   │ 
                      TfrmFrame.ClearPatient...┤ │ │ │   │ 
                TfrmFrame.mnuToolsGraphingClick┤ │ │ │   │ 
                         TfrmLabs.grdLabClick┤ │ │ │ │   │ 
                      TfrmLabs.tvReportsClick┤ │ │ │ │   │ 
                       TfrmLabs.DisplayPage┤ │ │ │ │ │   │ 
                      TfrmLabs.LoadTreeView┤ │ │ │ │ │   │ 
                     TfrmLabs.DisplayPage┤ │ │ │ │ │ │   │ 
TfrmOptionsReportsCustom.btnApplyClick...┘ │ │ │ │ │ │   │ 
                TfrmLabs.cmdOtherTestsClick┤ │ │ │ │ │   │ 
                   TfrmLabs.chkMaxFreqClick┤ │ │ │ │ │   │ 
              TfrmLabs.ProcessNotifications┤ │ │ │ │ │   │ 
                     TfrmLabs.DisplayPage┘ │ │ │ │ │ │   │ 
                                  ..(rec)..┤ │ │ │ │ │   │ 
                  TfrmLabs.tvReportsKeyDown┤ │ │ │ │ │   │ 
         TfrmFrame.lstCIRNLocationsClick...┘ │ │ │ │ │   │ 
                                    ..(rec)..┘ │ │ │ │   │ 
                     TfrmReports.ClearPtData...┤ │ │ │   │ 
                           TfrmReports.Graph...┘ │ │ │   │ 
                              TfrmGraphs.FormShow┤ │ │   │ 
                TfrmGraphs.btnChangeSettingsClick┤ │ │   │ 
                 TfrmReports.btnChangeViewClick┘ │ │ │   │ 
                     TfrmGraphs.CheckExpandedLabs┤ │ │   │ 
                          TfrmGraphs.ItemsClick┘ │ │ │   │ 
                    TfrmGraphs.DisplayData...┤   │ │ │   │ 
               TfrmGraphs.lvwItemsBottomClick┤   │ │ │   │ 
                   TfrmGraphs.Initialize...┤ │   │ │ │   │ 
                    TfrmGraphs.CheckContext┤ │   │ │ │   │ 
                      TfrmGraphs.FormShow┘ │ │   │ │ │   │ 
               TfrmGraphs.chkDualViewsClick┤ │   │ │ │   │ 
                 TfrmGraphs.Initialize...┤ │ │   │ │ │   │ 
                      TfrmGraphs.FormShow┤ │ │   │ │ │   │ 
                                   Layout┤ │ │   │ │ │   │ 
                     TfrmGraphs.GetSize┘ │ │ │   │ │ │   │ 
                  TfrmGraphs.FormShow┘   │ │ │   │ │ │   │ 
     TfrmGraphs.mnuPopGraphDualViewsClick┤ │ │   │ │ │   │ 
                TfrmGraphs.ViewSelections┘ │ │   │ │ │   │ 
          TfrmReports.tvReportsClick...┤   │ │   │ │ │   │ 
     TfrmGraphs.btnGraphSelectionsClick┘   │ │   │ │ │   │ 
  TfrmReports.btnGraphSelectionsClick┘     │ │   │ │ │   │ 
                     TfrmGraphs.GraphSwitch┤ │   │ │ │   │ 
                     TfrmGraphs.GraphSwap┘ │ │   │ │ │   │ 
        TfrmGraphs.mnuPopGraphSwapClick┘   │ │   │ │ │   │ 
                      TfrmGraphs.SplitClick┤ │   │ │ │   │ 
         TfrmGraphs.mnuPopGraphSplitClick┘ │ │   │ │ │   │ 
           TfrmGraphs.mnuPopGraphClearClick┤ │   │ │ │   │ 
                      TfrmGraphs.AutoSelect┤ │   │ │ │   │ 
                   TfrmGraphs.ViewsChange┘ │ │   │ │ │   │ 
           TfrmGraphs.lstViewsTopChange┤   │ │   │ │ │   │ 
             TfrmGraphs.Initialize...┤ │   │ │   │ │ │   │ 
            TfrmGraphs.GraphSwitch...┤ │   │ │   │ │ │   │ 
     TfrmGraphs.cboDateRangeChange...┤ │   │ │   │ │ │   │ 
         TfrmGraphs.ViewSelections...┘ │   │ │   │ │ │   │ 
        TfrmGraphs.lstViewsBottomChange┘   │ │   │ │ │   │ 
             TfrmGraphs.Initialize...┤     │ │   │ │ │   │ 
            TfrmGraphs.GraphSwitch...┤     │ │   │ │ │   │ 
     TfrmGraphs.cboDateRangeChange...┤     │ │   │ │ │   │ 
         TfrmGraphs.ViewSelections...┘     │ │   │ │ │   │ 
            TfrmGraphs.lvwItemsBottomChange┘ │   │ │ │   │ 
                  TfrmGraphs.lvwItemsTopClick┘   │ │ │   │ 
                   TfrmGraphs.Initialize...┤     │ │ │   │ 
                        TfrmGraphs.FormShow┤     │ │ │   │ 
            TfrmGraphs.chkDualViewsClick...┤     │ │ │   │ 
                  TfrmGraphs.GraphSwitch...┤     │ │ │   │ 
                   TfrmGraphs.SplitClick...┤     │ │ │   │ 
           TfrmGraphs.mnuPopGraphClearClick┤     │ │ │   │ 
                   TfrmGraphs.AutoSelect...┤     │ │ │   │ 
           TfrmGraphs.mnuPopGraphResetClick┤     │ │ │   │ 
                      TfrmGraphs.FormShow┤ │     │ │ │   │ 
    TfrmGraphs.mnuPopGraphHorizontalClick┤ │     │ │ │   │ 
      TfrmGraphs.mnuPopGraphVerticalClick┤ │     │ │ │   │ 
        TfrmGraphs.mnuPopGraphRemoveClick┤ │     │ │ │   │ 
      TfrmGraphs.mnuPopGraphZoomBackClick┘ │     │ │ │   │ 
               TfrmGraphs.lvwItemsTopChange┘     │ │ │   │ 
                        TfrmGraphs.ViewsChange...┤ │ │   │ 
             TfrmGraphs.mnuPopGraphMergeLabsClick┘ │ │   │ 
                           TfrmGraphs.ItemsClick...┤ │   │ 
                          TfrmGraphs.ViewsChange...┤ │   │ 
                  TfrmGraphs.mnuPopGraphRemoveClick┘ │   │ 
                         TfrmGraphs.MakeTogetherMaybe┘   │ 
                          TfrmGraphs.DisplayData...┘     │ 
                         TfrmGraphs.MakeTogetherOnlyLines┤ 
                                TfrmGraphs.MakeTogether┘ │ 
                      TfrmGraphs.MakeTogetherMaybe...┘   │ 
                          TfrmGraphs.MakeTogetherAnyLines┘ 
                             TfrmGraphs.MakeTogether...┘   

Calls

Name Declaration Comments
TfrmGraphs.BPAdd procedure BPAdd(itemvalue: string; adatetime: TDateTime; var fixeddatevalue: double; serLine, serBPDiastolic, serBPMean: TLineSeries); -
TfrmGraphs.BPCheck procedure BPCheck(aChart: TChart; aFileType: string; serLine, serBPDiastolic, serBPMean: TLineSeries); -
TfrmGraphs.FixedDates procedure FixedDates(var adatetime, adatetime1: TDateTime); -
TfrmGraphs.FMCorrectedDate function FMCorrectedDate(fmtime: string): string; -
TfrmGraphs.HighLow procedure HighLow(fmtime, fmtime1: string; aChart: TChart; var adatetime, adatetime1: TDateTime); -
TfrmGraphs.MakeSeriesInfo procedure MakeSeriesInfo(aChart: TChart; aSeries: TChartSeries; aTitle, aFileType: string; aSerCnt: integer); -
TfrmGraphs.MakeSeriesPoint procedure MakeSeriesPoint(aChart: TChart; aPointSeries: TPointSeries); -
TfrmGraphs.MakeSeriesRef procedure MakeSeriesRef(aChart: TChart; aTest, aRef: TLineSeries; aTitle, aValue: string; aDate: double); -
TfrmGraphs.NextPointerStyle procedure NextPointerStyle(aSeries: TChartSeries; aSerCnt: integer); -
TfrmGraphs.NonNumSave procedure NonNumSave(aChart: TChart; aTitle, aSection: string; adatetime: TDateTime; var noncnt: integer; newcnt, aIndex: integer); -
TfrmGraphs.NumAdd procedure NumAdd(serLine: TLineSeries; value: double; adatetime: TDateTime; var fixeddatevalue, hi, lo: double; var high, low: string); -
TfrmGraphs.PainAdd procedure PainAdd(serBlank: TPointSeries); -

Called-By

Name Declaration Comments
TfrmGraphs.MakeSeparateItems procedure MakeSeparateItems(aScrollBox: TScrollBox; aListView: TListView; section: string); -
TfrmGraphs.MakeTogetherAnyLines procedure MakeTogetherAnyLines(aListView: TListView; section: string; aChart: TChart); -
TfrmGraphs.MakeTogetherOnlyLines procedure MakeTogetherOnlyLines(aListView: TListView; section: string; aChart: TChart); -


Source

6430  procedure TfrmGraphs.MakeLineSeries(aChart: TChart; aTitle, aFileType, section: string;
6431    var aSerCnt, aNonCnt: integer; multiline: boolean);
6432  var
6433    i, noncnt, newcnt: integer;
6434    fixeddatevalue, hi, lo, testint, testpad, value: double;
6435    checkdata, fmtime, itemvalue: string;
6436    comments, high, low, specimen: string;
6437    afixeddate, afixeddate1: TDateTime;
6438    adatetime, adatetime1: TDateTime;
6439    serBPDiastolic, serBPMean, serHigh, serLine, serLow: TLineSeries;
6440    serBlank: TPointSeries;
6441  begin
6442    fixeddatevalue := -BIG_NUMBER;
6443    noncnt := 0; //GtslNonNum.Count;
6444    aChart.LeftAxis.LabelsFont.Color := aChart.BottomAxis.LabelsFont.Color;
6445    aSerCnt := aSerCnt + 1;
6446    specimen := LowerCase(Piece(aTitle, '^', 4));
6447    low := Piece(aTitle, '^', 5);
6448    high := Piece(aTitle, '^', 6);
6449    lo := strtofloatdef(low, -BIG_NUMBER);
6450    hi := strtofloatdef(high, -BIG_NUMBER);
6451    serLine := TLineSeries.Create(aChart);
6452    newcnt := aChart.SeriesCount;
6453    serBPDiastolic := TLineSeries.Create(aChart);
6454    serBPMean := TLineSeries.Create(aChart);
6455    serLow := TLineSeries.Create(aChart);
6456    serLow.Active := false;
6457    serHigh := TLineSeries.Create(aChart);
6458    serHigh.Active := false;
6459    serBlank := TPointSeries.Create(aChart);
6460    serBlank.Active := false;
6461    with serLine do
6462    begin
6463      MakeSeriesInfo(aChart, serLine, aTitle, aFileType, aSerCnt);
6464      LinePen.Visible := FGraphSetting.Lines;
6465      if (length(specimen) > 0) and (not ansicontainsstr(Title, specimen)) then
6466        Title := Title + ' (' + specimen + ')';
6467      Pointer.Visible := true;
6468      Pointer.InflateMargins := true;
6469      NextPointerStyle(serLine, aSerCnt);
6470      Tag := newcnt;
6471    end;
6472    if serLine.Title = 'Blood Pressure' then
6473      BPCheck(aChart, aFileType, serLine, serBPDiastolic, serBPMean);
6474    for i := GtslTemp.Count - 1 downto 0 do         // go from oldest first
6475    begin
6476      checkdata := GtslTemp[i];
6477      fmtime := FMCorrectedDate(Piece(checkdata, '^', 3));
6478      if IsFMDateTime(fmtime) then
6479      begin
6480        HighLow(fmtime, '', aChart, adatetime, adatetime1);
6481        comments := Piece(checkdata, '^', 9);
6482        if strtointdef(comments, -1) > 0  then aChart.Hint := comments;  // for any occurrence
6483        itemvalue := Piece(checkdata, '^', 5);
6484        itemvalue := trim(itemvalue);
6485        itemvalue := StringReplace(itemvalue, ',', '', [rfReplaceAll]);
6486        if serLine.Title = 'Blood Pressure' then
6487          BPAdd(itemvalue, adatetime, fixeddatevalue, serLine, serBPDiastolic, serBPMean)
6488        else
6489        begin
6490          value := strtofloatdef(itemvalue, -BIG_NUMBER);
6491          if (value <> -BIG_NUMBER) and (GtslTemp.Count = 1) and (lo = -BIG_NUMBER) and (hi = -BIG_NUMBER) then
6492          begin   // pad single numbers (without refs) to avoid exceptions
6493            testint := int(value);
6494            if testint = 0 then
6495            begin
6496              testint := value;
6497              testpad := value;
6498            end
6499            else
6500              testpad := 1;
6501            serBlank.AddXY(adatetime, testint + testpad, '', aChart.Color);
6502            serBlank.AddXY(adatetime, testint - testpad, '', aChart.Color);
6503          end;
6504          if value <> -BIG_NUMBER then
6505            NumAdd(serLine, value, adatetime, fixeddatevalue, hi, lo, high, low)
6506          else
6507            NonNumSave(aChart, serLine.Title, section, adatetime, noncnt, newcnt, i);
6508        end;
6509      end;
6510    end;
6511    if (length(low) > 0) and (splGraphs.Tag = 1) then
6512      MakeSeriesRef(aChart, serLine, serLow, 'Ref Low ', low, fixeddatevalue);
6513    if (length(high) > 0) and (splGraphs.Tag = 1) then
6514      MakeSeriesRef(aChart, serLine, serHigh, 'Ref High ', high, fixeddatevalue);
6515    splGraphs.Tag := 0;
6516    MakeSeriesPoint(aChart, serBlank);
6517    if serLine.Title = 'Pain' then
6518      PainAdd(serBlank);
6519    if multiline then
6520    begin
6521      // do nothing for now
6522    end;
6523    if fixeddatevalue <> -BIG_NUMBER then
6524    begin
6525      serBlank.Active := true;
6526      serBlank.Pointer.Pen.Visible := false;
6527      FixedDates(afixeddate, afixeddate1);
6528      serBlank.AddXY(afixeddate, fixeddatevalue, '', aChart.Color);
6529      serBlank.AddXY(afixeddate1, fixeddatevalue, '', aChart.Color);
6530    end;
6531  end;