Ignore:
Timestamp:
May 7, 2015, 12:34:29 PM (9 years ago)
Author:
healthsevak
Message:

Updating the working copy to CPRS version 28

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/trunk/CPRS-Chart/fReports.pas

    r830 r1679  
    172172uses ORFn, rCore, rReports, fFrame, uCore, uReports, fReportsPrint,
    173173     fReportsAdhocComponent1, activex, mshtml, dShared, fGraphs, fGraphData, rGraphs,
    174      VA508AccessibilityRouter, VAUtils
    175      { TODO -oRV -cWVEHR Long Age : Changed to use long age }
    176      , rWVEHR;
     174     VA508AccessibilityRouter, VAUtils; 
    177175
    178176const
     
    278276  else if GraphForm.btnClose.Tag = 1 then
    279277    Exit
    280   else
    281   begin
     278  else if GraphFormActive and (frmGraphData.pnlData.Hint = Patient.DFN) then
     279  begin   // displaying same patient
     280    if Tag <> reportien then
    282281    with GraphForm do
    283     if pnlMain.Tag <> reportien then
    284     begin  // different report
     282    begin  // new report
    285283      pnlMain.Tag := reportien;
    286284      Initialize;
     285      //DisplayData('top');
     286      //DisplayData('bottom');
    287287      GtslCheck.Clear;
    288288      GraphPanel(true);
    289289      BringToFront;
    290290    end;
     291    //no action
     292  end
     293  else if frmGraphData.pnlData.Hint = Patient.DFN then
     294  begin   // same patient, bring back graph
     295    GraphPanel(true);
     296    BringToFront;
     297    GraphFormActive := true;
     298  end
     299  else
     300  with GraphForm do
     301  begin  // new patient
     302    pnlMain.Tag := reportien;
     303    Initialize;
     304    DisplayData('top');
     305    DisplayData('bottom');
     306    GtslCheck.Clear;
     307    frmGraphData.pnlData.Hint := Patient.DFN;
     308    GraphPanel(true);
     309    BringToFront;
     310    GraphFormActive := true;
    291311  end;
    292312end;
     
    420440procedure TfrmReports.DisplayPage;
    421441var
    422   i: integer;
     442  i{, OrigSelection}: integer;
     443  {OrigDateIEN: Int64;
     444  OrigDateItemID: Variant;
     445  OrigReportCat, OrigProcedure: TTreeNode; }
    423446begin
    424447  inherited DisplayPage;
     
    436459                  + '<TD nowrap><B>Patient: ' + Patient.Name + '</B></TD>'
    437460                  + '<TD nowrap><B>' + Patient.SSN + '</B></TD>'
    438 { TODO -oRV -cWVEHR Long Age : Changed to use long age }
    439                   //+ '<TD nowrap><B>Age: ' + IntToStr(Patient.Age) + '</B></TD>'
    440                   + '<TD nowrap><B>Age: ' + GetPatientBriefAge(Patient.DFN) + '</B></TD>'
    441 {}
     461                  + '<TD nowrap><B>Age: ' + IntToStr(Patient.Age) + '</B></TD>'
    442462                  + '</TR></TABLE></DIV><HR>';
    443463                  //the preferred method would be to use headers and footers
    444464                  //so this is just an interim solution.
    445   if not GraphFormActive then
    446     pnlLeftBottom.Visible := False;
     465  {if not GraphFormActive then
     466    pnlLeftBottom.Visible := False;  } //This was keeping Date Range selection box from appearing when leaving and coming back to this Tab
    447467  if InitPage then
    448468    begin
     
    503523                        end;
    504524    CC_NOTIFICATION:  ProcessNotifications;
    505   end;
     525   
     526    //This corrects the reload of the reports when switching back to the tab.
     527     {Remove this since it has already been corrected. Related code was also removed from fLabs.
     528    CC_CLICK: if not InitPatient then
     529      begin
     530        //Clear our local variables
     531        OrigReportCat := nil;
     532        OrigDateIEN := -1;
     533        OrigSelection := -1;
     534        OrigDateItemID := '';
     535        OrigProcedure := nil;
     536
     537        //What was last selected before they switched tabs.
     538        if tvReports.Selected <> nil then OrigReportCat := tvReports.Selected;
     539        if lstDateRange.ItemIEN > 0 then OrigDateIEN := lstDateRange.ItemIEN;
     540        if lvReports.Selected <> nil then OrigSelection := lvReports.Selected.Index;
     541        if lstQualifier.ItemID <> '' then OrigDateItemID := lstQualifier.ItemID;
     542        if tvProcedures.Selected <> nil then OrigProcedure := tvProcedures.Selected;
     543
     544        //Load the tree and select the last selected
     545        if OrigReportCat <> nil then begin
     546         tvReports.Select(OrigReportCat);
     547         tvReportsClick(self);
     548        end;
     549
     550        //Did they click on a date (lstDates box)
     551        if OrigDateIEN > -1 then begin
     552          lstDateRange.SelectByIEN(OrigDateIEN);
     553          lstDateRangeClick(self);
     554        end;
     555
     556        //Did they click on a date (lstQualifier)
     557         if OrigDateItemID <> '' then begin
     558          lstQualifier.SelectByID(OrigDateItemID);
     559          lstQualifierClick(self);
     560        end;
     561
     562        //Did they click on a procedure
     563        if OrigProcedure <> nil then begin
     564          tvProcedures.Select(OrigProcedure);
     565          tvProceduresClick(tvProcedures);
     566        end;
     567
     568
     569        //Did they click on a report
     570        if OrigSelection > -1 then begin
     571         lvReports.Selected := lvReports.Items[OrigSelection];
     572         lvReportsSelectItem(self, lvReports.Selected, true);
     573        end;
     574      end;  }
     575  end; 
    506576end;
    507577
     
    872942var
    873943  MoreID: String;  //Restores MaxOcc value
    874   aRemote, aHDR, aFHIE: string;
     944  aRemote, aHDR, aFHIE, aMax: string;
    875945  i: integer;
    876946begin
     
    887957      SetPiece(uQualifier,';',3,'');
    888958    end;
     959  aMax := piece(uQualifier,';',3);
     960  if (CharAt(lstQualifier.ItemID,1) = 'd')
     961    and (length(aMax)>0)
     962    and (StrToInt(aMax)<101) then
     963      MoreID := ';101';
    889964  aRemote :=  piece(uRemoteType,'^',1);
    890965  aHDR := piece(uRemoteType,'^',7);
     
    10971172
    10981173procedure TfrmReports.GotoTop1Click(Sender: TObject);
    1099 var
    1100   Current, Desired : Longint;
    1101 begin
    1102   inherited;
    1103   with memText do
    1104   begin
    1105     SetFocus;
    1106     SelStart :=0;
    1107     SelLength :=0;
    1108     Current := SendMessage(memText.handle, EM_GETFIRSTVISIBLELINE, 0, 0);
    1109     Desired := SendMessage(memText.handle, EM_LINEFROMCHAR,
    1110                memText.SelStart + memText.SelLength ,0) - 1;
    1111     SendMessage(memText.Handle,EM_LINESCROLL, 0, Desired - Current);
    1112   end;
     1174begin
     1175  inherited;
     1176  SendMessage(memText.Handle, WM_VSCROLL, SB_TOP, 0);
     1177  {GoToTop1.Enabled := false;
     1178  GoToBottom1.Enabled := true;    }
    11131179end;
    11141180
    11151181procedure TfrmReports.GotoBottom1Click(Sender: TObject);
    1116 var
    1117   Current, Desired : Longint;
    1118   I,LineCount : Integer;
    11191182begin
    11201183  Inherited;
    1121   LineCount :=0;
    1122   with memText do
    1123     begin
    1124       for I := 0 to lines.count-1 do
    1125         LineCount := LineCount + Length(Lines[I]) + 2;
    1126       SetFocus;
    1127       SelStart := LineCount;
    1128       SelLength :=0;
    1129     end;
    1130   Current := SendMessage(memText.handle, EM_GETFIRSTVISIBLELINE, 0, 0);
    1131   Desired := SendMessage(memText.handle, EM_LINEFROMCHAR,
    1132              memText.SelStart + memText.SelLength ,0);
    1133   SendMessage(memText.Handle,EM_LINESCROLL, 0, Desired - Current - 5);
     1184  SendMessage(memText.Handle, WM_VSCROLL, SB_BOTTOM, 0);
     1185  {GoToTop1.Enabled := true;
     1186  GoToBottom1.Enabled := false;    }
    11341187end;
    11351188
     
    11831236  If Memo1.Visible Then
    11841237    UnFreezeText1.Enabled := True;
    1185   If memText.SelStart > 0 then
     1238  {If memText.SelStart > 0 then
    11861239    GotoTop1.Enabled := True
    11871240  Else
     
    11911244    GotoBottom1.Enabled := True
    11921245  Else
    1193     GotoBottom1.Enabled := False;
     1246    GotoBottom1.Enabled := False;   }
    11941247end;
    11951248
     
    13061359      //OR_AU^Autopsy
    13071360      begin
    1308         if Notifications.AlertData = '^1^^^0^0^0' then   //code snippet to handle the processing of v26 AP alerts in a v27 environment.
     1361        if Notifications.AlertData = '^1^^^0^0^0' then  //code snippet to handle the processing of v26 AP alerts in a v27 environment.
    13091362          begin
    13101363            if pnlRightMiddle.Visible then pnlRightMiddle.Visible := FALSE;
     
    13931446          end;
    13941447        if length(piece(aRanges,';',1)) > 0 then
    1395           if uReportType <> 'G' then    // graphs don't display date ranges here
    13961448          begin
    13971449            d1 := ValidDateTimeStr(piece(aRanges,';',1),'');
     
    14151467        end;
    14161468      end;
    1417     if piece(uRemoteType, '^', 9) = '1' then x := x + ' <<ONLY REMOTE DOD DATA INCLUDED IN REPORT>>';
     1469    if piece(uRemoteType, '^', 9) = '1' then x := x + ' <<ONLY REMOTE DATA INCLUDED IN REPORT>>';
    14181470    Caption := x;
    14191471  end;
     
    16471699      if HDRActive = '0' then
    16481700        begin
    1649           InfoBox('The HDR is currently inactive.' + CRLF + 'Unable to retrieve HDR data at this time.', 'HDR Error', MB_OK);
     1701          InfoBox('The HDR is currently inactive in CPRS.' + CRLF + 'You must use VistaWeb to view this report.', 'Use VistaWeb for HDR data', MB_OK);
    16501702          Exit;
    16511703        end;
    1652       InfoBox('You must use VistaWeb to view this report.', 'Use VistaWeb for HDR data', MB_OK);
     1704      //InfoBox('You must use VistaWeb to view this report.', 'Use VistaWeb for HDR data', MB_OK);
    16531705      if (Piece(AItem, ':', 1) = 'OR_VWAL') or (Piece(AItem, ':', 1) = 'OR_VWRX') then
    16541706        AQualifier := 'T-50000;T+50000;99999';
     
    16841736    if (AHDR='1') and (LeftStr(TRemoteSite(Items[i]).SiteID, 5) = '200HD') then
    16851737      begin
    1686         TRemoteSite(Items[i]).Selected := true;
    1687         frmFrame.lstCIRNLocations.Checked[i+2] := true;
     1738        //TRemoteSite(Items[i]).Selected := true;
     1739        //frmFrame.lstCIRNLocations.Checked[i+1] := true;
    16881740      end;
    16891741    if TRemoteSite(Items[i]).Selected then
     
    19902042  uReportRPC := aRPC;
    19912043  uRptID := aID;
     2044  uReportID := aID;
    19922045  uDirect := aDirect;
    19932046  uReportType := aReportType;
     
    22432296                pnlLeftBottom.Visible := FALSE;
    22442297                pnlProcedures.Visible := TRUE;
    2245                 Splitter1.Visible := True;
     2298                Splitter1.Visible := True;                                     
    22462299                if lvReports.Columns.Count > 0 then lvReports.Columns[1].Width := 0;
    22472300                Items.EndUpdate;
     
    28882941                                    FastAssign(TCellObject(RowObjects.ColumnList[j]).Data, aBasket);
    28892942                                    for k := 0 to aBasket.Count - 1 do
    2890                                       MemText.Lines.Add('  ' + aBasket[k]);
     2943                                      MemText.Lines.Add(' ' + aBasket[k]);
    28912944                                  end;
    28922945                          if aWPFlag = true then
     
    29092962                          FastAssign(TCellObject(RowObjects.ColumnList[i]).Data, aBasket);
    29102963                          for j := 0 to aBasket.Count - 1 do
    2911                             MemText.Lines.Add('  ' + aBasket[j]);
     2964                            MemText.Lines.Add(' ' + aBasket[j]);
    29122965                        end;
    29132966                if aWPFlag = true then
Note: See TracChangeset for help on using the changeset viewer.