I solved the error in my environment:
At line 750 of StoreScp.java the statement coerced.putLO(Tags.PatientID, ds.getString(Tags.PatientID));
fails because coerced variable is null.
I solved the error applying this simple condition to test if coerced is null:
748 } catch (NonUniquePatientIDException e) {
749 service.coercePatientID(ds);
750 +++ if (coerced != null) {
751 coerced.putLO(Tags.PatientID, ds.getString(Tags.PatientID));
752 coerced.putLO(Tags.IssuerOfPatientID,
753 ds.getString(Tags.IssuerOfPatientID));
754 +++ }
I think this is a valid patch because at line 765 the statement:
765 coerced = merge(coerced, coercedElements);
checks if coerced is null before processing the merge.
see also http://www.dcm4che.org/jira/browse/DCMEE-2099
Any suggestion is appreciated
Antonio