Function

UpdateModifierList

Module

rPCE

Last Modified

10/7/2014 12:48:38 PM

Scope

Interfaced

Declaration

function UpdateModifierList(Dest: TStrings; Index: integer): string;

Calls Hierarchy


UpdateModifierList
 └ModifierList
   ├TPCEData.VisitDateTime
   │ └TPCEData.IsSecondaryVisit
   └MixedCaseModifier

Called-By Hierarchy


                    UpdateModifierList
       TfrmProcedures.CheckModifiers┤ 
      TfrmProcedures.ShowModifiers┘ │ 
     TfrmProcedures.clbListClick┤   │ 
     TfrmProcedures.lbGridSelect┤   │ 
TfrmProcedures.btnSelectAllClick┤   │ 
   TfrmProcedures.lbSectionClick┤   │ 
    TfrmProcedures.btnOtherClick┤   │ 
   TfrmProcedures.btnRemoveClick┘   │ 
 TfrmProcedures.lbxSectionClickCheck┘ 

Calls

Name Declaration Comments
ModifierList function ModifierList(CPTCode: string): string; -

Called-By

Name Declaration Comments
TfrmProcedures.CheckModifiers procedure CheckModifiers; -
TfrmProcedures.lbxSectionClickCheck procedure lbxSectionClickCheck(Sender: TObject; Index: Integer); -


Source

795   function UpdateModifierList(Dest: TStrings; Index: integer): string;
796   var
797     i, idx, LastIdx: integer;
798     Tmp, OKMods, Code: string;
799     OK: boolean;
800   
801   begin
802     if(Piece(Dest[Index], U, 5) = '1') then
803       Result := Piece(Dest[Index],U,4)
804     else
805     begin
806       Tmp := Piece(Dest[Index], U, 4);
807       Result := '';
808       OKMods := ModifierList(Piece(Dest[Index], U, 1))+U;
809       i := 1;
810       repeat
811         Code := Piece(Tmp,';',i);
812         if(Code <> '') then
813         begin
814           LastIdx := -1;
815           OK := FALSE;
816           repeat
817             idx := uModifiers.IndexOfPiece(Code, U, 3, LastIdx);
818             if(idx > 0) then
819             begin
820               if(pos(U + IntToStr(idx) + U, OKMods)>0) then
821               begin
822                 Result := Result + piece(uModifiers[idx],U,1) + ';';
823                 OK := TRUE;
824               end
825               else
826                 LastIdx := Idx;
827             end;
828           until(idx < 0) or OK;
829           inc(i);
830         end
831       until(Code = '');
832       Tmp := Dest[Index];
833       SetPiece(Tmp,U,4,Result);
834       SetPiece(Tmp,U,5,'1');
835       Dest[Index] := Tmp;
836       idx := StrToIntDef(piece(Tmp,U,6),-1);
837       if(idx >= 0) then
838       begin
839         Tmp := uProcedures[idx];
840         SetPiece(Tmp,U,12,Result);
841         SetPiece(Tmp,U,13,'1');
842         uProcedures[idx] := Tmp;
843       end;
844     end;
845   end;