A Mathematical Model to Plan the Adoption of EHR Systems