Procedure

TfrmPtSel.cmdProcessClick

Module

fPtSel

Last Modified

7/15/2014 3:26:38 PM

Visibility

Public/Published

Owner

TfrmPtSel

Declaration

procedure cmdProcessClick(Sender: TObject);

Calls Hierarchy


TfrmPtSel.cmdProcessClick
 ├DeleteAlert
 ├TNotifications.Add
 ├GetTIUAlertInfo
 ├TfrmPtSel.AlertList
 │ └LoadNotifications
 ├TfrmPtSel.FormShow
 │ ├GetSortMethod
 │ └TfrmPtSel.lstvAlertsColumnClick
 │   ├TfrmPtSel.ReformatAlertDateTime
 │   └SetSortMethod
 ├TfrmPtSel.ShowButts
 │ └TfrmPtSel.ShowDisabledButtonTexts
 └GetBAStatus
   └TfrmFrame.SetBADxList

Called-By Hierarchy


      TfrmPtSel.cmdProcessClick
TfrmPtSel.cmdProcessInfoClick┤ 
 TfrmPtSel.cmdProcessAllClick┤ 
 TfrmPtSel.lstvAlertsDblClick┤ 
  TfrmPtSel.lstvAlertsKeyDown┘ 

Calls

Name Declaration Comments
TNotifications.Add procedure Add(const ADFN: string; AFollowUp: Integer; const ARecordID: string; AHighLightSection : string = ''); -
TfrmPtSel.AlertList procedure AlertList; -
DeleteAlert procedure DeleteAlert(XQAID: string); -
TfrmPtSel.FormShow procedure FormShow(Sender: TObject); -
GetBAStatus procedure GetBAStatus(pProvider:int64; pPatientDFN: string); -
GetTIUAlertInfo function GetTIUAlertInfo(XQAID: string): string; -
TfrmPtSel.ShowButts procedure ShowButts(ShowButts: Boolean); -

Called-By

Name Declaration Comments
TfrmPtSel.cmdProcessAllClick procedure cmdProcessAllClick(Sender: TObject); -
TfrmPtSel.cmdProcessInfoClick procedure cmdProcessInfoClick(Sender: TObject); -
TfrmPtSel.lstvAlertsDblClick procedure lstvAlertsDblClick(Sender: TObject); -
TfrmPtSel.lstvAlertsKeyDown procedure lstvAlertsKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); -


Source

597   procedure TfrmPtSel.cmdProcessClick(Sender: TObject);
598   var
599     AFollowUp, i, infocount: Integer;
600     enableclose: boolean;
601     ADFN, x, RecordID, XQAID: string;  //*DFN*
602   begin
603     if FAlertsNotReady then exit;  
604     enableclose := false;
605     with lstvAlerts do
606     begin
607       if SelCount <= 0 then Exit;
608   
609       // Count information-only selections for gauge
610       infocount := 0;
611       for i:= 0 to Items.Count - 1 do if Items[i].Selected then
612         if (Items[i].SubItems[0] = 'I') then Inc(infocount);
613   
614       if infocount >= 1 then
615       begin
616         ggeInfo.Visible := true; (*BOB*)
617         ggeInfo.MaxValue := infocount;
618       end;
619   
620       for i := 0 to Items.Count - 1 do if Items[i].Selected then
621         { Items[i].Selected    =  Boolean TRUE if item is selected
622               "   .Caption     =  Info flag ('I')
623               "   .SubItems[0] =  Patient ('ABC,PATIE (A4321)')
624               "   .    "   [1] =  Patient location ('[2B]')
625               "   .    "   [2] =  Alert urgency level ('HIGH, Moderate, low')
626               "   .    "   [3] =  Alert date/time ('2002/12/31@12:10')
627               "   .    "   [4] =  Alert message ('New order(s) placed.')
628               "   .    "   [5] =  Forwarded by/when
629               "   .    "   [6] =  XQAID ('OR,66,50;1416;3021231.121024')
630                                          'TIU6028;1423;3021203.09')
631               "   .    "   [7] =  Remove without processing flag ('YES')
632               "   .    "   [8] =  Forwarding comments (if applicable) }
633       begin
634         XQAID := Items[i].SubItems[6];
635         RecordID := Items[i].SubItems[0] + ': ' + Items[i].SubItems[4] + '^' + XQAID;
636         //RecordID := patient: alert message^XQAID  ('ABC,PATIE (A4321): New order(s) placed.^OR,66,50;1416;3021231.121024')
637         if Items[i].Caption = 'I' then
638       // If Caption is 'I' delete the information only alert.
639           begin
640             ggeInfo.Progress := ggeInfo.Progress + 1;
641             DeleteAlert(XQAID);
642           end
643         else if Piece(XQAID, ',', 1) = 'OR' then
644       //  OR,16,50;1311;2980626.100756
645           begin
646             ADFN := Piece(XQAID, ',', 2);  //*DFN*
647             AFollowUp := StrToIntDef(Piece(Piece(XQAID, ';', 1), ',', 3), 0);
648             Notifications.Add(ADFN, AFollowUp, RecordID, Items[i].SubItems[3]); //CB
649             enableclose := true;
650           end
651         else if Copy(XQAID, 1, 6) = 'TIUERR' then
652           InfoBox(Piece(RecordID, U, 1) + #13#10#13#10 +
653              'The CPRS GUI cannot yet process this type of alert.  Please use List Manager.',
654              'Unable to Process Alert', MB_OK)
655         else if Copy(XQAID, 1, 3) = 'TIU' then
656       //   TIU6028;1423;3021203.09
657           begin
658             x := GetTIUAlertInfo(XQAID);
659             if Piece(x, U, 2) <> '' then
660               begin
661                 ADFN := Piece(x, U, 2);  //*DFN*
662                 AFollowUp := StrToIntDef(Piece(Piece(x, U, 3), ';', 1), 0);
663                 Notifications.Add(ADFN, AFollowUp, RecordID + '^^' + Piece(x, U, 3));
664                 enableclose := true;
665               end
666             else
667               DeleteAlert(XQAID);
668           end
669         else  //other alerts cannot be processed
670           InfoBox('This alert cannot be processed by the CPRS GUI.', Items[i].SubItems[0] + ': ' + Items[i].SubItems[4], MB_OK);    end;
671       if enableclose = true then
672         Close
673       else
674         begin
675           ggeInfo.Visible := False;
676           // Update notification list:
677           lstvAlerts.Clear;
678           AlertList;
679           //display alerts sorted according to parameter settings:
680           FsortCol := -1;     //CA - display alerts in correct sort
681           FormShow(Sender);
682         end;
683       if Items.Count = 0 then ShowButts(False);
684       if SelCount <= 0 then ShowButts(False);
685     end;
686     GetBAStatus(User.DUZ,Patient.DFN);
687   end;