anchor.diff:      if guid then
       begin
         id := FhirGUIDToString(CreateGUID);
  -      key := FRepository.NextResourceKeySetId(aType, id);
  +      key := FRepository.NextResourceKeySetId(FConnection, aType, id);
       end
       else
       begin
  
positive.code:     function ProfilesAsOptionList: String; override;
      function NextVersionKey: integer;
      function NextSearchKey: integer;
      function NextResourceKeySetId(aType: String; id: string) : integer;
      function NextResourceKeyGetId(connection : TKDBConnection; aType: String; var id: string): integer;
      function NextEntryKey: integer;
      function NextCompartmentKey: integer;
  
negative.code:         if ServerContext.ResConfig[aType].LastResourceId > ServerContext.ResConfig[aType].storedResourceId then
          begin
            ServerContext.ResConfig[aType].storedResourceId := ServerContext.ResConfig[aType].LastResourceId + KEY_SAVE_SIZE;
            connection.ExecSQL('Update Types set LastId = '+inttostr(ServerContext.ResConfig[aType].storedResourceId)+' where ResourceTypeKey = '+inttostr(ServerContext.ResConfig[aType].key));
          end;
        end;
      end;
  