Turn ragdoll into NPC?

Anyone know how?

Spawn the NPC at the position of the ragdool (adjusted for height) and remove the ragdoll.