He said that while action has been taken to delete the information that had been leaked, the authorities are still monitoring further exposure of the data.
In a ministerial statement after nine MPs raised questions on the issue, Mr Gan said that the well-being of the affected persons weighed heavily in the authorities' considerations.
When the Ministry of Health (MOH) first found out in 2016 that rogue American lecturer Mikhy K Farrera Brochez had access to the confidential HIV information, it had to decide whether to inform those affected and to publicise it.
"These were not straightforward decisions. On the one hand, there is the need to be transparent. On the other hand, we need to consider the impact of an announcement on the affected persons with HIV - would it serve their interest, or harm them instead?" he said.
Doctors at MOH said particular attention had to be paid to the concerns and needs of HIV patients as HIV status is a deeply emotional and personal matter.
At that time, there was also no evidence that the confidential information had been disseminated to the public, and whatever information Brochez had revealed had been seized or deleted by the police.
The decision in 2016 was to not inform those on the list or make public the data leak.
However, in 2018, when Brochez revealed more information and 31 records could not be retrieved, MOH decided to contact the 31 people and alert them to the matter.
Then in January this year, when Brochez put the full HIV registry online and provided the link to a non-government party, the likelihood of the identities being made public increased significantly.
"MOH therefore decided to make a public announcement on Jan 28 even though we remained deeply concerned about the impact this would h...