When Javier Artigas began needing kidney dialysis and found himself jobless, he developed an app to make it easier for people to get treatment when travelling. But his breakthrough came completely by chance, after he saved the life of a famous Argentine writer.
Without a job, Javier Artigas needed money to support his family, so he decided to rent out space in his Montevideo home on the home-sharing site, Airbnb.
It went well. One of his guests was the well-known Argentine writer, Hernán Casciari. But two days into his stay, Casciari had a heart attack. He needed to get to hospital quickly.
As chance would have it, Artigas's wife, Alejandra, worked for the Uruguayan senate, and was able to organise a police escort to speed up the journey. Instead of 40 minutes it took just 12. That, and the blood they donated, saved Casciari's life.
Later, once he had recovered and returned to Argentina, the writer left Javier and his wife a five-star review.
"Excellent house for sedentary travellers prone to myocardial infarctions. The area is beautiful and has direct access to the best hospitals. Javier and Alejandra instantly become guardian angels who will save your life without even knowing you. They will rush you to the hospital in their own car while you're dying and stay in the waiting room while doctors give you a bypass. They don't want you to feel lonely, they bring you books to read and they let you stay in their house extra nights without charging you. Highly recommend."
Translation: With the great @Casciari at home, alive and kicking!! Hugs from all the family!
But Artigas was more than a good host and Casciari's newly found guardian angel - he knew from personal experience just how hard it can be to be ill when you're far away from home.
Find out more
In 2007, Artigas was diagnosed with polycystic kidney disease, which caused his kidney function to decline rapidly. By 2014, he required haemodialysis treatment three times a week to do the work his kidneys no longer could. Each dialysis session - during which his blood would pass through an external waste-removing filtration machine before returning to his body - took four hours.
For patients like Artigas, their dialysis sessions need to be set in stone to prevent dangerous toxins from building up in the blood. Regular appointments cannot be missed, so visiting a foreign country where you may not speak the language, understand medical regulations, or be able to find affordable treatment, is a huge challenge.
Artigas's job involved lots of travel to Latin American and African countries where there was a further problem - finding somewhere safe to have dialysis, with uncontaminated water. After he revealed his condition and his need for dialysis to his employers he lost his job.
"I had four children and I didn't know what to do," he says. "Nobody was going to hire me. To be unemployed was a whole unknown world for me. I went into a crisis because I was my family's breadwinner - a deep emotional crisis."
It's estimated that chronic kidney disease (CKD) affects one in 10 people around the world, with millions dying every year due to lack of affordable treatment.
Artigas eventually managed to find work in IT, but this also involved some foreign travel. On one occasion he was sent to Córdoba, Argentina, where he had arranged a dialysis session, but when he arrived he was told that there was no record of his appointment. He had no access to the vital treatment he needed because he wasn't a resident of Argentina.
After almost 12 hours of desperate searching, terrified he was going to die from the toxins in his blood, he managed to find a hospital willing to provide him with dialysis.
"On my way back, on that 2,000km trek, I started thinking about this problem," he says.
It was a wake-up call. He decided he wanted to do something to help dialysis users, and in 2015 he developed an app, Connectus, to connect kidney patients with treatment centres when away from home.
"People used to try and find a dialysis centre first, and then plan their holiday," says Artigas. "We do it the other way around. You find the beach where you want to go and we'll find the dialysis centre for you."
Connectus initially launched in August 2015 as a small web platform, costing just $1,700. It focused on connecting patients from Uruguay with a small number of dialysis centres in Argentina and Brazil, the most popular destinations for Uruguayan tourists.
A month later, the Massachusetts Institute of Technology gave Connectus its prestigious Best Innovative Healthcare Solution award. This was a big success, but the breakthrough that enabled Artigas to expand the project to serve people in nearly 150 countries, providing access to more than 14,500 dialysis machines, came about in the most unexpected way - as a result of Hernán Casciari's Airbnb review.
Unbeknown to Artigas, an Airbnb representative in Miami had forwarded the review to Joe Gebbia, the company's multi-billionaire co-founder, who read it and sent Artigas an email.
On 31 December 2015, Artigas and his wife were driving to a beach 100km east of Montevideo to celebrate New Year when Gebbia's email arrived. It said he would like to fly to Uruguay to stay with Artigas's family.
At first, Artigas thought it was a hoax. But he handed the phone to his wife, and she replied to the email. Within an hour Gebbia had booked his flight. He would spend New Year's Eve in the air and arrive on New Year's Day.
As the two men got to know each other, Artigas asked what had driven Gebbia to make his sudden visit to Uruguay.
"He said, 'I've come here because I want to hear first-hand your story. I want to know every detail. I want to know your blood type. Everything you've gone through."
Artigas had not planned on talking to Gebbia about his app, Connectus, but he had already heard about it and asked lots of questions about that too.
Gebbia spent most of his time in Montevideo relaxing and reading in the garden. Then one day he told Artigas to go to his computer and look for an email from San Francisco.
"I thought it was going to be payment for his stay at my house - I wasn't going to charge him. Then all of a sudden I see that there's a contract to go into business with his company. I couldn't believe it," he says.
Since then Connectus Medical has gone from strength to strength. It's not the only app or website of its kind, but it has now been used by nearly 250,000 patients.
Artigas's precarious finances have stabilised and his health has also improved.
Kidney disease runs in the Artigas family. Javier's 22-year-old daughter has it, and his father died of it at the age of 48, only a few years older than Artigas is now.
On 9 August 2017, Artigas had a kidney transplant that changed his life. Two days later, on the anniversary of his father's death, while recovering in the intensive care unit, his doctor played him El Chiquilín de Bachín on the bandoneon, to help him relax. Little did the doctor know, El Chiquilín de Bachín - The Little Boy from the Tavern - was what his father used to call him.
It was a special moment. As he embarked on a new life with a functioning kidney he felt that his father was there, urging him to use the opportunity to the full.
He now no longer needs dialysis, but he continues to work to make life easier for those who do.
Listen to Javier Artigas speaking to Outlook on the BBC World Service