Procedure

TfrmGraphProfiles.AssignProfilePost

Module

fGraphProfiles

Last Modified

7/15/2014 3:26:36 PM

Visibility

Public/Published

Owner

TfrmGraphProfiles

Declaration

procedure AssignProfilePost(aList: TStrings; var aProfile, typedata: string);

Called-By Hierarchy


        TfrmGraphProfiles.AssignProfilePost
          TfrmGraphProfiles.AssignProfile┘ 
     TfrmGraphProfiles.lstSourcesChange┤   
  TfrmGraphProfiles.radSourceAllClick┤ │   
          TfrmGraphProfiles.IDProfile┘ │   
   TfrmGraphProfiles.btnRenameClick┤   │   
     TfrmGraphProfiles.btnSaveClick┘   │   
TfrmGraphProfiles.lstOtherSourcesChange┤   
  TfrmGraphProfiles.radSourceAllClick┘ │   
  TfrmGraphProfiles.btnDefinitionsClick┘   

Called-By

Name Declaration Comments
TfrmGraphProfiles.AssignProfile procedure AssignProfile(aList: TStrings; aProfile: string; UserNum: int64; allitems: boolean); -


Source

1418  procedure TfrmGraphProfiles.AssignProfilePost(aList: TStrings; var aProfile, typedata: string);
1419  var
1420    stop: boolean;
1421    i, j, k: integer;
1422    itempart, itempart1, itempart2, itemnums, itemname, itemtest: string;
1423  begin
1424    aList.Clear;
1425    aList.Add(typedata);
1426    aList.Add('^' + LLS_LINE);
1427    for i := 1 to BIG_NUMBER do
1428    begin
1429      itempart := Piece(aProfile, '|', i);
1430      if itempart = '' then exit;
1431      itempart1 := Piece(itempart, '~', 1);
1432      itempart2 := Piece(itempart, '~', 2);
1433      itemnums := itempart1 + '^' + itempart2;
1434      itemname := '';
1435      if itempart1 = '0' then
1436      begin
1437        for j := 0 to lstSources.Items.Count - 1 do
1438          if itempart2 = Piece(lstSources.Items[j], '^', 1) then
1439          begin
1440            itemname := Piece(lstSources.Items[j], '^', 2);
1441            break;
1442          end;
1443        typedata := '0^' + itempart2 + '^_' + itemname + ' <any>';
1444        aList.Add(typedata);
1445      end
1446      else
1447      if (itempart1 <> '0') then    //DRUG CLASS NOT INCLUDED
1448      begin
1449        stop := false;
1450        for k := 0 to lstTests.Items.Count - 1 do
1451        begin
1452          itemtest := UpperCase(Pieces(lstTests.Items[k], '^', 1, 2));
1453          if itemtest = itemnums then
1454          begin
1455            itemname := Piece(lstTests.Items[k], '^', 3);
1456            itemnums := itemnums + '^' + itemname;
1457            aList.Add(itemnums);
1458            stop := true;
1459            break;
1460          end;
1461        end;
1462        if not stop then
1463        for k := 0 to lstDrugClass.Items.Count - 1 do
1464        begin
1465          itemtest := UpperCase(Pieces(lstDrugClass.Items[k], '^', 1, 2));
1466          if itemtest = itemnums then
1467          begin
1468            itemname := Piece(lstDrugClass.Items[k], '^', 3);
1469            itemnums := itemnums + '^' + itemname;
1470            aList.Add(itemnums);
1471            break;
1472          end;
1473        end;
1474      end;
1475    end;
1476  end;