In British English if one is in hospital because one is a patient, one uses hospital without any article- eg He was in hospital last week having a simple operation.
No, the accusative is used to indicate the direct object of a transitive verb. In this sentence, although "the hospital" is definite, it is not acting as a direct object.
Here, "hastane" is acting as the object of the preposition. Although in some languages like German the object of the preposition does take accusative case endings, I do not believe Turkish is one of those languages.
My solution was "I am writing to you from a hospital", which was marked incorrect. Translating English definite and indefinite articles to/from Turkish is always a bit of a problem. However, Duolingo's translation states a definite hospital, which is not indicated in the original Turkish.
How do we differentiate?
"seni" is the accusative case, which marks the direct object in a sentence; however, here there is no direct object--"you" is an indirect object. There is motion toward the indirect object, rather than acting directly on the direct object. "I am writing to you." Because of this, it has to be in the dative case, so it must be "sana."
"Sana hastaneden yazıyorum." Translation: I am writing to you from the hospital.
The "patient" from the hospital is writing to somebody outside.
'I am waiting for you at the hospital'?
Seni hastaneden bekliyorum. - I am waiting for you from the hospital.
Hastanedeyim, seni bekliyorum. - I am at the hospital, waiting for you.
Seni beklerim hastanede. - I am waiting for you at the hospital.
Yes it is different from the given examples.