Procedure

TfrmReview.buDiagnosisClick

Module

fReview

Last Modified

7/15/2014 3:26:38 PM

Comments

Begin BillingAware
End BillingAware

Visibility

Public/Published

Owner

TfrmReview

Declaration

procedure buDiagnosisClick(Sender: TObject);

Calls Hierarchy


TfrmReview.buDiagnosisClick
 ├TfrmReview.GetCheckBoxStatus
 │ └TSigItems.GetSigItems
 ├tempDxNodeExists
 ├InitializeNewDxRec
 ├GetBADxListForOrder
 ├CountSelectedOrders
 ├CompareOrderDx
 │ ├InitializeNewDxRec
 │ ├GetBADxListForOrder
 │ └DiagnosesMatch
 ├AllSelectedDxBlank
 │ └tempDxNodeExists
 ├TfrmBALocalDiagnoses.Enter
 │ └TfrmBase508Form.Create
 │   ├TfrmBase508Form.UpdateAccessibilityActions
 │   ├UnfocusableControlEnter
 │   └AdjustControls
 │     ├TfrmBase508Form.ModifyUnfocusableControl
 │     └..(rec)..
 ├TfrmBase508Form.Create...
 ├SetTreatmentFactors
 │ └BALoadStsFlagsAsIs
 └TSigItems.DisplayPlTreatmentFactors
   └TSigItems.CopyCBValues
     ├TSigItems.ItemToTag
     ├TSigItems.TagInfo
     ├TSigItems.FindCBValues
     └TSigItems.GetTempCkBxState

Calls

Name Declaration Comments
AllSelectedDxBlank function AllSelectedDxBlank(const Caller: smallint) : boolean; -
CompareOrderDx function CompareOrderDx(const Caller: smallint) : boolean; -
CountSelectedOrders function CountSelectedOrders(const Caller: smallint) : smallint; -
TfrmBase508Form.Create constructor Create(AOwner: TComponent); override; -
TSigItems.DisplayPlTreatmentFactors procedure DisplayPlTreatmentFactors; -
TfrmBALocalDiagnoses.Enter procedure Enter(theCaller: smallint; pOrderIDList: TStringList); -
GetBADxListForOrder procedure GetBADxListForOrder(var thisRetVal: TBADxRecord; thisOrderID: string); -
TfrmReview.GetCheckBoxStatus function GetCheckBoxStatus(sourceOrderID : string) : string; overload; -
InitializeNewDxRec procedure InitializeNewDxRec(var thisDxRec: TBADxRecord); -
SetTreatmentFactors procedure SetTreatmentFactors(TFactors: string); -
tempDxNodeExists function tempDxNodeExists(thisOrderID: string) : boolean; -


Source

2086  procedure TfrmReview.buDiagnosisClick(Sender: TObject);
2087  {Begin BillingAware}
2088  var
2089    i: smallint;
2090    thisOrderID: string;
2091    match: boolean;
2092    allBlank: boolean;
2093    numSelected: smallint;
2094    tmpOrderIDList: TStringList;
2095    thisChangeItem: TChangeItem;
2096  {End BillingAware}
2097  begin
2098  {Begin BillingAware}
2099  try
2100   if  BILLING_AWARE then
2101   begin
2102  
2103    tmpOrderIDList := TStringList.Create;
2104    if Assigned(tmpOrderIDList) then tmpOrderIDList.Clear;
2105    BAtmpOrderList.Clear;
2106    UBAGlobals.PLFactorsIndexes.Clear;
2107  
2108    match := false;
2109    allBlank := false;
2110  
2111    try
2112        // User has selected no orders to sign
2113       for i := 0 to fReview.frmReview.lstReview.Items.Count-1 do
2114          begin
2115           if (fReview.frmReview.lstReview.Selected[i]) then
2116           //*********************************
2117              begin    //Access Violation fix
2118              thisChangeItem := TChangeItem(fReview.frmReview.lstReview.Items.Objects[i]);
2119              if thisChangeItem = nil then
2120                begin
2121                fReview.frmReview.lstReview.Selected[i] := false;
2122                Continue;
2123                end;
2124            //*********************************
2125                thisOrderID := TChangeItem(fReview.frmReview.lstReview.Items.Objects[i]).ID;
2126                {BAV25 Code} //Used to pass selected orders to Lookup DX form
2127                BAtmpOrderList.Add(TChangeItem(fReview.frmReview.lstReview.Items.Objects[i]).TEXT);
2128                tmpOrderIDList.Add(thisOrderID);
2129                chkBoxStatus := GetCheckBoxStatus(thisOrderID);
2130                UBAGlobals.PLFactorsIndexes.Add(IntToStr(i)+ U + chkBoxStatus);
2131               {BAV25 Code}
2132               
2133              // Test for blank Dx on current grid item
2134              if Not (tempDxNodeExists(thisOrderID)) then
2135                 if Assigned(UBAGlobals.GlobalDxRec) then
2136                    InitializeNewDxRec(UBAGlobals.globalDxRec);
2137              begin
2138                 if (tempDxNodeExists(thisOrderID) ) then
2139                   if not Assigned(UBAGlobals.globalDxRec) then
2140                      begin
2141                      UBAGlobals.globalDxRec := UBAGlobals.TBADxRecord.Create;
2142                      InitializeNewDxRec(UBAGlobals.globalDxRec);
2143                      GetBADxListForOrder(UBAGlobals.globalDxRec, thisOrderID);
2144                      end
2145                   else
2146                      GetBADxListForOrder(UBAGlobals.globalDxRec, thisOrderID);
2147  
2148                    end
2149             end; //if
2150          end; //for
2151    except
2152       on EListError do
2153          begin
2154          {$ifdef debug}Show508Message('EListError in fReview.buDiagnosisClick()');{$endif}
2155          raise;
2156          end;
2157    end;
2158  
2159    numSelected  := CountSelectedOrders(UBAConst.F_REVIEW);
2160  
2161    if numSelected = 0 then
2162       begin
2163       ShowMsg(UBAMessages.BA_NO_ORDERS_SELECTED);
2164       Exit;
2165       end
2166    else
2167       if numSelected = 1 then
2168          match := true;
2169  
2170    if (UBAGlobals.CompareOrderDx(UBAConst.F_REVIEW)) then
2171       match := true;
2172  
2173  
2174    if UBAGlobals.AllSelectedDxBlank(UBAConst.F_REVIEW) then
2175       allBlank := true;
2176  
2177    if ((match and allBlank) or (match and (not allBlank))) then  // All selected are blank or matching-not-blank
2178       begin
2179          frmBALocalDiagnoses.Enter(UBAConst.F_REVIEW,  tmpOrderIDList);
2180       end
2181    else
2182       begin
2183       //Warning message
2184       //If 'Yes' on warning message then open localDiagnosis
2185       if (not allBlank) then
2186           if MessageDlg(UBAMessages.BA_CONFIRM_DX_OVERWRITE, mtConfirmation, [mbYes, mbNo], 0) = mrYes then
2187                    begin
2188                    if Assigned(UBAGlobals.globalDxRec) then
2189                       InitializeNewDxRec(UBAGlobals.globalDxRec);
2190  
2191                    frmBALocalDiagnoses := TfrmBALocalDiagnoses.Create(frmReview);
2192                    frmBALocalDiagnoses.ShowModal;
2193                    frmBALocalDiagnoses.Release;
2194  
2195                    end;
2196       end;
2197       // TFactors come from FBALocalDiagnoses(Problem List Dx's Only).
2198       if Length(UBAGlobals.TFactors) > 0 then
2199       begin
2200          UBACore.SetTreatmentFactors(UBAGlobals.TFactors);
2201          SigItems.DisplayPlTreatmentFactors;
2202       end;
2203   {End BillingAware}
2204   if pnlSignature.Visible then
2205      txtESCode.SetFocus;
2206     end;
2207   finally
2208       if Assigned(tmpOrderIDList) then FreeAndNil(tmpOrderIDList);
2209   end;
2210  end;