Procedure

TPCEData.SetHealthFactors

Module

uPCE

Last Modified

7/15/2014 3:26:36 PM

Visibility

Public

Owner

TPCEData

Declaration

Procedure SetHealthFactors(Src: TStrings; FromForm: boolean = TRUE);

Calls Hierarchy


TPCEData.SetHealthFactors
 ├TPCEData.MarkDeletions
 │ ├TPCEItem.Match
 │ └TPCEItem.MatchProvider
 ├TPCEData.MatchItem
 │ ├TPCEItem.Match
 │ └TPCEItem.MatchProvider
 ├TPCEItem.SetComment
 └TPCEHealth.Assign
   └TPCEItem.Assign
     └TPCEItem.SetComment

Called-By Hierarchy


              TPCEData.SetHealthFactors
                                  Add┤ 
          TfrmRemDlg.btnFinishClick┘ │ 
   TfrmEncounterFrame.UpdateEncounter┘ 
        TfrmEncounterFrame.SendData┤   
TfrmEncounterFrame.FormCloseQuery┘ │   
  TfrmEncounterFrame.FormCloseQuery┘   

Calls

Name Declaration Comments
TPCEHealth.Assign procedure Assign(Src: TPCEItem); override; -
TPCEData.MarkDeletions procedure MarkDeletions(PreList: TList; PostList: TStrings); -
TPCEData.MatchItem function MatchItem(AList: TList; AnItem: TPCEItem): Integer; -
TPCEItem.SetComment procedure SetComment(const Value: String); -

Called-By

Name Declaration Comments
Add procedure Add(PCEItemClass: TPCEItemClass); -
TfrmEncounterFrame.UpdateEncounter procedure UpdateEncounter(PCE: TPCEData); -


Source

2523  procedure TPCEData.SetHealthFactors(Src: TStrings; FromForm: boolean = TRUE);
2524  
2525  var
2526    i, MatchIndex: Integer;
2527    SrcHealthFactor, CurHealthFactor: TPCEHealth;
2528  begin
2529    if FromForm then MarkDeletions(FHealthFactors, Src);
2530    for i := 0 to Src.Count - 1 do
2531    begin
2532      SrcHealthFactor := TPCEHealth(Src.Objects[i]);
2533      MatchIndex := MatchItem(FHealthFactors, SrcHealthFactor);
2534      if MatchIndex > -1 then
2535      begin
2536        CurHealthFactor := TPCEHealth(FHealthFactors.Items[MatchIndex]);
2537  
2538        if CurHealthFactor.level = '' then CurHealthFactor.level := NoPCEValue;
2539        if SrcHealthFactor.level = '' then SrcHealthFactor.level := NoPCEValue;
2540        if(SrcHealthFactor.Level <> CurHealthFactor.Level) or
2541          (CurHealthFactor.Comment <> SrcHealthFactor.Comment) then  
2542        begin
2543          CurHealthFactor.Level  := SrcHealthFactor.Level;
2544          CurHealthFactor.Comment := SrcHealthFactor.Comment;  
2545          CurHealthFactor.FSend := True;
2546        end;
2547         if(SrcHealthFactor.GecRem <> CurHealthFactor.GecRem) then
2548            CurHealthFactor.GecRem := SrcHealthFactor.GecRem;
2549      end else
2550      begin
2551        CurHealthFactor := TPCEHealth.Create;
2552        CurHealthFactor.Assign(SrcHealthFactor);
2553        CurHealthFactor.FSend := True;
2554        CurHealthFactor.GecRem := SrcHealthFactor.GecRem;
2555        FHealthFactors.Add(CurHealthFactor);
2556      end; {if MatchIndex}
2557    end; {for}
2558  end;