Thirty thousand legal immigrants have begun receiving letters informing them that their state-subsidized health insurance is ending Aug. 31 and will be replaced by a patchwork system of care until Massachusetts officials can piece together a more comprehensive plan for the most critically ill. The state's interim plan only covers emergencies and other limited services, leaving advocates worried about the welfare of these immigrants. Under the plan, immigrants will be receiving emergency care in hospitals and a limited number of other services through community centers under two state programs.