Procedure

TPCEData.SetPatientEds

Module

uPCE

Last Modified

7/15/2014 3:26:36 PM

Visibility

Public

Owner

TPCEData

Declaration

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

Calls Hierarchy


TPCEData.SetPatientEds
 ├TPCEData.MarkDeletions
 │ ├TPCEItem.Match
 │ └TPCEItem.MatchProvider
 ├TPCEData.MatchItem
 │ ├TPCEItem.Match
 │ └TPCEItem.MatchProvider
 ├TPCEItem.SetComment
 └TPCEPat.Assign
   └TPCEItem.Assign
     └TPCEItem.SetComment

Called-By Hierarchy


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

Calls

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

2489  procedure TPCEData.SetPatientEds(Src: TStrings; FromForm: boolean = TRUE);
2490  var
2491    i, MatchIndex: Integer;
2492    SrcPatientEd, CurPatientEd: TPCEPat;
2493  begin
2494    if FromForm then MarkDeletions(FPatientEds, Src);
2495    for i := 0 to Src.Count - 1 do
2496    begin
2497      SrcPatientEd := TPCEPat(Src.Objects[i]);
2498      MatchIndex := MatchItem(FPatientEds, SrcPatientEd);
2499      if MatchIndex > -1 then
2500      begin
2501        CurPatientEd := TPCEPat(FPatientEds.Items[MatchIndex]);
2502  
2503        if CurPatientEd.level = '' then CurPatientEd.level := NoPCEValue;
2504        if SrcPatientEd.level = '' then SrcPatientEd.level := NoPCEValue;
2505        if(SrcPatientEd.Level <> CurPatientEd.Level) or
2506          (CurPatientEd.Comment <> SrcPatientEd.Comment) then
2507        begin
2508          CurPatientEd.Level  := SrcPatientEd.Level;
2509          CurPatientEd.Comment := SrcPatientEd.Comment;  
2510          CurPatientEd.FSend := True;
2511        end;
2512      end else
2513      begin
2514        CurPatientEd := TPCEPat.Create;
2515        CurPatientEd.Assign(SrcPatientEd);
2516        CurPatientEd.FSend := True;
2517        FPatientEds.Add(CurPatientEd);
2518      end; {if MatchIndex}
2519    end; {for}
2520  end;