The Massachusetts eHealth Collaborative, a nonprofit that has played a leading role in implementing electronic health records, is creating a for-profit subsidiary as it expands its business helping doctors and hospitals adopt the new technology. The move comes as Massachusetts prepares to implement the electronic health systems beyond a three-community pilot project, which the collaborative ran over the past few years. The new entity is already working for commercial customers including Beth Israel Deaconess Medical Center and its physician group.