NICOSIA, Cyprus (AP) _ Despite their obsession with security, the Shiite Moslem militants holding Western hostages in Lebanon sometimes bring in doctors from Iranian-funded hospitals to care for ailing captives, informed sources say.

American Robert Polhill, freed Sunday, suffered from diabetes. But apart from loss of weight, a growth on his vocal cords and malnourishment during his 39 months in captivity, he clearly was given medication.

''The hostages have common health problems such as diabetes, high blood pressure or high levels of uric acid,'' said a Shiite physician, who spoke on condition of anonymity.

''Medicines for such health problems are not a problem. They can be obtained anywhere in Lebanon,'' he told The Associated Press.

West German businessman Rudolf Cordes, freed by ntified hostage who was believed to be suffering from a severe heart condition.

It underlined that the hostage-holders make some effort to aid ailing captives, possibly because at least one and maybe two captives have died from neglect.

Frenchman Michel Seurat, a researcher, died of a severe illness believed to be hepatitis in December 1985, released hostages reported.

His captors, Islamic Jihad, claimed on March 5, 1986, that they had killed him in retaliation for France extraditing two pro-Iranian Iraqi dissidents to Baghdad.

Briton Alec Collett, a New-York based writer who suffered from diabetes, is believed to have died in captivity through illness.

Medical personnel from the Khomeini Hospital in Baalbek in eastern Lebanon, and clinics run by the fundamentalist Iranian-backed Hezbollah in Beirut's southern slums are summoned to help ailing hostages, other Shiite sources said.

Baalbek and Beirut's southern shantytowns are Shiite strongholds and most of the 17 Westerners missing in Lebanon are believed to be held in the slums.

Various groups hold seven Americans, four Britons, two West Germans, two Swiss, an Irishman and an Italian. The longest-held hostage is American Terry Anderson, 42, chief Middle East correspondent of The Associated Press. He was kidnapped March 16, 1985.

While medicine might help treat the hostages' physical ailments, there is nothing that can be done to alleviate the immense psychological trauma of being chained day and night, usually blindfolded, beaten and submitted to mock executions, not to mention poor food and unsanitary conditions.

''You have to learn to master your sadness, your desperation, to channel your misery,'' former French hostage Jean-Paul Kauffmann said after he was freed May 4, 1988.

''The worst thing for a hostage is not the physical suffering, but the feeling of having been forgotten.''