Now that the New York state budget is passed, Long Island hospitals, two-thirds of which will lose a total of more than $40 million, are scrambling to figure out how to close their budget gaps. Joe Baker, the deputy secretary to Gov. David A. Paterson for health and human services, said the state is willing to work with hospitals to ease the transition to more primary care and, in some cases, try to find additional funding.