Procedure

TPCEData.SetSkinTests

Module

uPCE

Last Modified

7/15/2014 3:26:36 PM

Comments

Load SkinTests for this encounter into TPCESkin records, assumes all SkinTests for the
  encounter will be listed in Src and marks those that are not in Src for deletion

Visibility

Public

Owner

TPCEData

Declaration

procedure SetSkinTests(Src: TStrings; FromForm: boolean = TRUE);        //

Calls Hierarchy


TPCEData.SetSkinTests
 ├TPCEData.MarkDeletions
 │ ├TPCEItem.Match
 │ └TPCEItem.MatchProvider
 ├TPCEData.MatchItem
 │ ├TPCEItem.Match
 │ └TPCEItem.MatchProvider
 ├TPCEItem.SetComment
 └TPCESkin.Assign
   └TPCEItem.Assign
     └TPCEItem.SetComment

Called-By Hierarchy


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

Calls

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

2451  procedure TPCEData.SetSkinTests(Src: TStrings; FromForm: boolean = TRUE);
2452  { load SkinTests for this encounter into TPCESkin records, assumes all SkinTests for the
2453    encounter will be listed in Src and marks those that are not in Src for deletion }
2454  var
2455    i, MatchIndex: Integer;
2456    SrcSkinTest, CurSkinTest: TPCESkin;
2457  begin
2458    if FromForm then MarkDeletions(FSKinTests, Src);
2459    for i := 0 to Src.Count - 1 do
2460    begin
2461      SrcSkinTest := TPCESkin(Src.Objects[i]);
2462      MatchIndex := MatchItem(FSKinTests, SrcSkinTest);
2463      if MatchIndex > -1 then
2464      begin
2465        CurSkinTest := TPCESkin(FSkinTests.Items[MatchIndex]);
2466        if CurSkinTest.Results = '' then CurSkinTest.Results := NoPCEValue;
2467        if SrcSkinTest.Results = '' then SrcSkinTest.Results := NoPCEValue;
2468  
2469        if(SrcSkinTest.Results <> CurSkinTest.Results) or
2470          (SrcSkinTest.Reading <> CurSkinTest.Reading) or
2471          (CurSkinTest.Comment <> SrcSkinTest.Comment) then
2472        begin
2473  
2474          CurSkinTest.Results := SrcSkinTest.Results;
2475          CurSkinTest.Reading := SrcSkinTest.Reading;
2476          CurSkinTest.Comment := SrcSkinTest.Comment;
2477          CurSkinTest.FSend := True;
2478        end;
2479      end else
2480      begin
2481        CurSKinTest := TPCESkin.Create;
2482        CurSkinTest.Assign(SrcSkinTest);
2483        CurSkinTest.FSend := True;
2484        FSkinTests.Add(CurSkinTest);
2485      end; {if MatchIndex}
2486    end; {for}
2487  end;