Under the new patent law - the first inventor to file wins in such a situation. For your application to succeed - it must be new, useful and not-obvious in view of the first-filed case - as well as any other prior art found by the patent examiner. Claim amendments might make your invention different enough to be patentable over the first filed case. However - if the first filed case has broad claims that issue - and those claims cover your invention - you would need a license to make, use or sell your invention. If you applications are under the old patent law - that is, they were filed before March 16, 2012 - then the first to invent wins in such a situation - if certain requirements for interferences are met. GOOD LUCK!
Answered on Jun 05th, 2015 at 7:06 PM