Procedure

TPCEData.SetExams

Module

uPCE

Last Modified

7/15/2014 3:26:36 PM

Visibility

Public

Owner

TPCEData

Declaration

procedure SetExams(Src: TStrings; FromForm: boolean = TRUE);

Calls Hierarchy


TPCEData.SetExams
 ├TPCEData.MarkDeletions
 │ ├TPCEItem.Match
 │ └TPCEItem.MatchProvider
 ├TPCEData.MatchItem
 │ ├TPCEItem.Match
 │ └TPCEItem.MatchProvider
 ├TPCEItem.SetComment
 └TPCEExams.Assign
   └TPCEItem.Assign
     └TPCEItem.SetComment

Called-By Hierarchy


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

Calls

Name Declaration Comments
TPCEExams.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

2561  procedure TPCEData.SetExams(Src: TStrings; FromForm: boolean = TRUE);
2562  
2563  var
2564    i, MatchIndex: Integer;
2565    SrcExam, CurExam: TPCEExams;
2566  begin
2567    if FromForm then MarkDeletions(FExams, Src);
2568    for i := 0 to Src.Count - 1 do
2569    begin
2570      SrcExam := TPCEExams(Src.Objects[i]);
2571      MatchIndex := MatchItem(FExams, SrcExam);
2572      if MatchIndex > -1 then
2573      begin
2574        CurExam := TPCEExams(FExams.Items[MatchIndex]);
2575        if CurExam.Results = '' then CurExam.Results := NoPCEValue;
2576        if SrcExam.Results = '' then SrcExam.Results := NoPCEValue;
2577        if(SrcExam.Results <> CurExam.Results) or
2578          (CurExam.Comment <> SrcExam.Comment) then  
2579        begin
2580          CurExam.Results  := SrcExam.Results;
2581          CurExam.Comment := SrcExam.Comment;  
2582          CurExam.Fsend := True;
2583        end;
2584      end else
2585      begin
2586        CurExam := TPCEExams.Create;
2587        CurExam.Assign(SrcExam);
2588        CurExam.FSend := True;
2589        FExams.Add(CurExam);
2590      end; {if MatchIndex}
2591    end; {for}
2592  end;