Health Secretary Jeane Freeman has said all hospital workers are not yet being regularly tested for Covid-19.
She also told the BBC's Politics Scotland programme testing of care home staff was not happening "fast enough".
Ms Freeman said the testing of hospital staff was part of work to "slowly and safely" reopen parts of the NHS.
She said she could not give a timescale for when all workers would be tested because health boards were working out how to restart more of their services.
Ms Freeman said: "We are looking at the possibility of testing staff perhaps in certain areas of the hospital.
"Cancer UK, for example, has asked for what they describe as the creation of a 'safe space'. That would be for the increase in cancer work that is part of the remobilising of the NHS and we would look at testing there for both staff and possibly patients."
The health secretary said discussions were under way between health boards and clinical teams about testing patients before surgery, alongside all staff involved in a patient's treatment.
Following news that hundreds of patients were found to have Covid-19 after being admitted to hospital for other conditions, Ms Freeman said work was still being done to establish whether the patients were infected in hospital or before they were admitted.
A total of 908 patients were found with the infection and 218 of them died.
Ms Freeman she hoped to have validated information on these cases, which spanned a period from the middle of March to 3 June, by the end of this month.
Asked about the regular testing of all care home workers, Ms Freeman said this was not yet being done consistently or quickly enough across Scotland.
She said health boards had been testing in homes where there were active cases of Covid-19, though she added some boards had gone further and were testing workers in homes with no cases.
"Not all of them have moved as fast enough as I need them to," said Ms Freeman.
From this week, the Scottish government will publish weekly data from every health board of how many care home staff and residents have been tested.
Ms Freeman said: "It is not correct to say (testing) is not happening. It is correct it is not happening consistently in a planned way across the country, which is precisely why I issued that letter of instruction to every health board chief executive and have said that every week I will publish that information."