Scottish Liberal Democrat leader Alex Cole-Hamilton raised the case at First Minister's Questions in Holyrood.
He said one in six people who were unable to secure a GP appointment last year carried out a medical procedure on themselves or had someone else do it.
Mr Cole-Hamilton said: “Maria is 22 years old. She is a Ukrainian refugee who has been living in Scotland since the summer. She suffers from a hormonal thyroid condition, which requires regular testing and treatment.
“But when she presented at her new GP, she faced an unexpected dilemma. The wait was so long that it actually made more sense for her to risk travelling back to a war zone to see her doctor in Kyiv and so she did.
“Presiding Officer, the air raid sirens, the drone strikes and the cruise missile attacks of the Ukrainian capital were less daunting to Maria than the wait for treatment on Scotland’s NHS. That is appalling.
“These are the risks that people are taking for the sake of their health and all for the want of basic access to primary care. Can I ask the First Minister, is she embarrassed by this?”
Ms Sturgeon said she did not know the details and it would be wrong to comment on an individual case. However, she said there were more GPs per head of population in Scotland than anywhere else in the UK.
She said: “Access to GPs, like access to other areas of the health service right now, is challenging – and very challenging for some patients – and we continue to work to address that.”
The Liberal Democrats said Maria, who is based in Glasgow, was waiting for blood tests to monitor her condition and avoid taking medication unnecessarily. She was told there were no appointments for her to give blood or for other tests.
Elsewhere, Ms Sturgeon was challenged over the case of an 80-year-old man who waited more than 12 hours for an ambulance after breaking his neck on Hogmanay.
Scottish Tory leader Douglas Ross called on the First Minister to sack health secretary Humza Yousaf “for the good of Scotland”.
He said: “On Hogmanay, a family visited their 80-year-old uncle. He’s had major heart surgery, hip operations and often struggles to breathe. When they arrived, they discovered he had fallen and broken his neck. The family dialled 999 seven times and it took more than 12-and-a-half hours for the ambulance to arrive.
“Seven emergency calls, 12-and-a-half hours, for an 80-year-old who had broken their neck. His niece told us ‘the ambulance crews were brilliant, but we are disgusted at what our uncle has been put through’.”
Ms Sturgeon told him: “There are too many patients right now waiting too long for treatment.” However, she said she was working “every single day” with the health secretary to “take the actions that are necessary to support our NHS during these very difficult times”.
The First Minister said she hoped pressures on the NHS caused by rising Covid and flu cases would “abate over the weeks to come”.
Ms Sturgeon said: “The vast majority of patients in this country, even during these extremely difficult times, get excellent care on our National Health Service and that is down to the dedication of those who work in it.
“That is why they have my grateful thanks each and every single day.”