const
  ClinicID=1;
var
  DbCfgFn,IdLstFn,FullRenumFn,RenumFn,Cmd: string;
begin
  {Get VisiQuick database configuration file}
  DbCfgFn:=GetDbCfgFnFromVqWorkDir('');
  {Dump image ID's to file}
  IdLstFn:=GenerateTempFn;
  Cmd:='FindClinicImages /db="'+DbCfgFn+'" /out='+'"'+IdLstFn+'" /clinic='+IntToStr(ClinicID);
  ExecUtilsProc(Cmd);
  {Format image tooth positions}
  FullRenumFn:=GenerateTempFn;
  Cmd:='PatchImageProps /db="'+DbCfgFn+'" /images="'+IdLstFn+'" /formattoothpos';
  ExecUtilsProc(Cmd);
end.
