Procedure

TLabTest.FillCollSampList

Module

fODLab

Last Modified

7/15/2014 3:26:42 PM

Comments

1  2        3         4       5         6          7         8          9               10   
n^IEN^CollSampName^SpecIEN^TubeTop^MinInterval^MaxPerDay^LabCollect^SampReqCommentIEN;name^SpecName

Visibility

Public/Published

Owner

TLabTest

Declaration

procedure FillCollSampList(LoadData: TStringList; DfltCollSamp: Integer);

Called-By Hierarchy


            TLabTest.FillCollSampList
                    TLabTest.Create┤ 
     TfrmODLab.cboAvailTestSelect┘ │ 
          TfrmODLab.SetupDialog┤   │ 
     TfrmODLab.cboAvailTestExit┘   │ 
            TLabTest.LoadAllSamples┘ 
            TfrmODLab.SetupDialog┤   
               TLabTest.Create...┤   
  TfrmODLab.cboAvailTestSelect...┤   
      TfrmODLab.GetAllCollSamples┘   
             TfrmODLab.Validate┤     
  TfrmODLab.cboCollSampKeyPause┤     
TfrmODLab.cboCollSampMouseClick┘     

Called-By

Name Declaration Comments
TLabTest.Create constructor Create(const LabTestIEN: string; Responses: TResponses); -
TLabTest.LoadAllSamples procedure LoadAllSamples; -


Source

553   procedure TLabTest.FillCollSampList(LoadData: TStringList; DfltCollSamp: Integer);
554   {1  2        3         4       5         6          7         8          9               10   }
555   {n^IEN^CollSampName^SpecIEN^TubeTop^MinInterval^MaxPerDay^LabCollect^SampReqCommentIEN;name^SpecName}
556   var
557     i, LastListItem, AnIndex: Integer;
558     ACollSamp: TCollSamp;
559     LabCollSamp: Integer;
560   begin
561     i := -1;
562     if CollSampList = nil then CollSampList := TList.Create;
563     LastListItem := CollSampList.Count ;
564     LabCollSamp := StrToIntDef(ExtractDefault(LoadData, 'Lab CollSamp'), 0);
565     repeat Inc(i) until (i = LoadData.Count) or (LoadData[i] = '~CollSamp');
566     Inc(i);
567     if i < LoadData.Count then repeat
568       if LoadData[i][1] = 'i' then
569         begin
570           ACollSamp := TCollSamp.Create;
571           with ACollSamp do
572             begin
573               AnIndex         := StrToIntDef(Copy(Piece(LoadData[i], '^', 1), 2, 999), -1);
574               CollSampID      := StrToInt(Piece(LoadData[i], '^', 2));
575               CollSampName    := Piece(LoadData[i], '^', 3);
576               SpecimenID      := StrToIntDef(Piece(LoadData[i], '^', 4), 0);
577               SpecimenName    := Piece(LoadData[i], '^', 10);
578               TubeColor       := Piece(LoadData[i], '^', 5);
579               MinInterval     := StrToIntDef(Piece(LoadData[i], '^', 6), 0);
580               MaxPerDay       := StrToIntDef(Piece(LoadData[i], '^', 7), 0);
581               LabCanCollect   := AnIndex = LabCollSamp;
582               SampReqComment  := Piece(LoadData[i], '^', 9);
583               WardComment     := TStringList.Create;
584               if CollSampID  = StrToIntDef(LRFSAMP, 0) then
585                 CollSamp := CollSampID
586               else if AnIndex = DfltCollSamp then
587                 CollSamp := CollSampID;
588             end; {with}
589           LastListItem := CollSampList.Add(ACollSamp);
590         end; {if}
591       if (LoadData[i][1] = 't') then
592         TCollSamp(CollSampList.Items[LastListItem]).WardComment.Add(Copy(LoadData[i], 2, 255));
593       Inc(i);
594     until (i = LoadData.Count) or (LoadData[i][1] = '~');
595   end;