Procedure

TfrmLabs.VGrid

Module

fLabs

Last Modified

7/15/2014 3:26:38 PM

Visibility

Private

Owner

TfrmLabs

Declaration

procedure VGrid(griddata: TStrings);

Calls Hierarchy


TfrmLabs.VGrid
 └LabPatchInstalled
   └ServerHasPatch

Called-By Hierarchy


                                         TfrmLabs.VGrid
                           TfrmLabs.lstQualifierClick┤ 
                            TfrmLabs.tvReportsClick┘ │ 
                             TfrmLabs.DisplayPage┤   │ 
                            TfrmLabs.LoadTreeView┤   │ 
                           TfrmLabs.DisplayPage┤ │   │ 
         TfrmOptionsReportsCustom.btnApplyClick┘ │   │ 
          TfrmOptionsReportsCustom.btnOKClick┘   │   │ 
                      TfrmLabs.cmdOtherTestsClick┤   │ 
                         TfrmLabs.chkMaxFreqClick┤   │ 
                    TfrmLabs.ProcessNotifications┤   │ 
                           TfrmLabs.DisplayPage┘ │   │ 
                                        ..(rec)..┤   │ 
                        TfrmLabs.tvReportsKeyDown┤   │ 
                  TfrmFrame.lstCIRNLocationsClick┘   │ 
                            TfrmFrame.SetUpCIRN┘     │ 
                       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┘         │ 
                               TfrmLabs.lstDatesClick┤ 
                         TfrmLabs.tvReportsClick...┘ │ 
                                TfrmLabs.ragHorVClick┘ 

Calls

Name Declaration Comments
LabPatchInstalled function LabPatchInstalled: boolean; -

Called-By

Name Declaration Comments
TfrmLabs.lstDatesClick procedure lstDatesClick(Sender: TObject); -
TfrmLabs.lstQualifierClick procedure lstQualifierClick(Sender: TObject); -
TfrmLabs.ragHorVClick procedure ragHorVClick(Sender: TObject); -


Source

1855  procedure TfrmLabs.VGrid(griddata: TStrings);
1856  var
1857    testcnt, datecnt, datacnt, linecnt, offset, x, y, i: integer;
1858    DisplayDateTime: string;
1859  begin
1860    offset := 0;
1861    testcnt := strtoint(Piece(griddata[offset], '^', 1));
1862    datecnt := strtoint(Piece(griddata[offset], '^', 2));
1863    datacnt := strtoint(Piece(griddata[offset], '^', 3));
1864    linecnt := testcnt + datecnt + datacnt;
1865    if chkAbnormals.Checked and (linecnt > 0) then
1866    begin
1867      offset := linecnt + 1;
1868      testcnt := strtoint(Piece(griddata[offset], '^', 1));
1869      datecnt := strtoint(Piece(griddata[offset], '^', 2));
1870      datacnt := strtoint(Piece(griddata[offset], '^', 3));
1871      linecnt := testcnt + datecnt + datacnt;
1872    end;
1873    with grdLab do
1874    begin
1875      if datecnt = 0 then ColCount := 2 else ColCount := datecnt + 1;
1876      if testcnt = 0 then RowCount := 3 else RowCount := testcnt + 2;
1877      DefaultColWidth := ResizeWidth( BaseFont, MainFont, 80);
1878      ColWidths[0] := ResizeWidth( BaseFont, MainFont, 60);
1879      FixedCols := 1;
1880      FixedRows := 2;
1881      for y := 0 to RowCount - 1 do
1882        for x := 0 to ColCount - 1 do
1883          Cells[x, y] := '';
1884      Cells[0, 0] := 'Date/Time';
1885      Cells[0, 1] := 'Specimen';
1886      for i := 1 to testcnt do
1887      begin
1888        Cells[0, i + 1] := Piece(griddata[i + offset], '^', 3);
1889      end;
1890      if datecnt = 0 then
1891      begin
1892        Cells[1, 0] := 'no results';
1893        for x := 1 to RowCount - 1 do
1894          Cells[x, 1] := '';
1895      end;
1896      for i := testcnt + 1 to testcnt + datecnt do
1897      begin
1898        //------------------------------------------------------------------------------------------
1899        if LabPatchInstalled then        // Requires lab patch in const "PSI_05_118"
1900        begin
1901          DisplayDateTime := Piece(griddata[i + offset], '^', 2);
1902          if length(DisplayDateTime) > 7 then
1903            Cells[i - testcnt, 0] := FormatFMDateTime('mm/dd/yy hh:nn',MakeFMDateTime(DisplayDateTime))
1904          else if length(DisplayDateTime) > 0 then
1905            Cells[i - testcnt, 0] := FormatFMDateTime('mm/dd/yy',MakeFMDateTime(DisplayDateTime))
1906          else
1907            Cells[i - testcnt, 0] := FormatFMDateTime('mm/dd/yy hh:nn',MakeFMDateTime(Piece(griddata[i + offset], '^', 2)));
1908        end
1909        else                             // If no lab patch in const "PSI_05_118", continue as is
1910        begin
1911          Cells[i - testcnt, 0] := FormatFMDateTime('mm/dd/yy hh:nn',MakeFMDateTime(Piece(griddata[i + offset], '^', 2)));
1912        end;
1913        //------------------------------------------------------------------------------------------
1914        Cells[i - testcnt, 1] := MixedCase(Piece(griddata[i + offset], '^', 4)) + ' ' + Piece(griddata[i + offset], '^', 5);
1915      end;
1916      for i := testcnt + datecnt + 1 to linecnt do
1917      begin
1918        x := strtoint(Piece(griddata[i + offset], '^', 1));
1919        y := strtoint(Piece(griddata[i + offset], '^', 2)) + 1;
1920        Cells[x, y]  := Piece(griddata[i + offset], '^', 3) + ' ' + Piece(griddata[i + offset], '^', 4);
1921      end;
1922    end;
1923  end;