Restitution is an obligation imposed by law on ground of justice and equity. Its purpose is to prevent unjust enrichment. Unlike express contracts or contracts implied in fact, restitution does not rest upon the assent of the contracting parties.
The "officious intermeddler doctrine" holds that where a person performs labor for another without the latter's request or implied consent, however beneficial such labor may be, he cannot recover therefor.
An exception is that of emergency aid, where the service is needed to prevent the others' bodily harm and the helper is a doctor and therefor doesn't give the implication of gratuitousness.