StoreSCP throws NullPointerException for Patient with identical PatientId

99 views
Skip to first unread message

Antonio Morelli

unread,
Feb 27, 2015, 9:31:06 AM2/27/15
to dcm...@googlegroups.com
Hi all,
when I try to enter a study for a patient with the same pid of another patient that already exists in the database, dcm4chee generates a new pid, but then throws NullPointerException in StoreScp.java (dcm4chee 2.18.0)

How can I avoid this?

Thanks for any help

Antonio

2015-02-27 15:03:26,033 WARN  IM_QR_OLD->DCMRM (TCPServer-1-1) [org.dcm4chex.archive.ejb.session.StorageBean] inserting records for instance[uid=1.2.392.200036.9107.500.305.2222.20110401.100700.102222] failed: Existing Patient[pk=32299, pid=1, issuer=STC1, name=AAA^CARLO^^^] with equal Patient ID but different demographis than Patient[id=1, issuer=STC1, name=DE^BBBBB^null^null]
2015-02-27 15:03:26,034 INFO  IM_QR_OLD->DCMRM (TCPServer-1-1) [org.dcm4chex.archive.dcm.storescp.StoreScpService] Generate Patient ID: RM-2385870852^^^DCMRM for Patient: DE^BBBBB^MATTEO
2015-02-27 15:03:26,034 ERROR IM_QR_OLD->DCMRM (TCPServer-1-1) [org.dcm4chex.archive.dcm.storescp.StoreScpService]
java.lang.NullPointerException
        at org.dcm4chex.archive.dcm.storescp.StoreScp.doActualCStore(StoreScp.java:750)
        at org.dcm4chex.archive.dcm.storescp.StoreScp.doCStore(StoreScp.java:496)
        at org.dcm4che.net.DcmServiceBase.c_store(DcmServiceBase.java:116)
        at org.dcm4cheri.net.ActiveAssociationImpl.run(ActiveAssociationImpl.java:230)
        at org.dcm4cheri.util.LF_ThreadPool.join(LF_ThreadPool.java:174)
        at org.dcm4cheri.net.ActiveAssociationImpl.run(ActiveAssociationImpl.java:164)
        at org.dcm4cheri.server.DcmHandlerImpl.handle(DcmHandlerImpl.java:249)
        at org.dcm4cheri.server.ServerImpl.run(ServerImpl.java:288)
        at org.dcm4cheri.util.LF_ThreadPool.join(LF_ThreadPool.java:174)
        at org.dcm4cheri.util.LF_ThreadPool$1.run(LF_ThreadPool.java:221)
        at java.lang.Thread.run(Thread.java:745)

fleetwoodfc

unread,
Feb 27, 2015, 10:14:32 AM2/27/15
to dcm...@googlegroups.com
What is the value of the StoreSCP PatientMatching Attribute - default is:

pid,issuer?,[familyname,givenname,middlename?,birthdate]

Which (to my understanding) means that only the pid and issuer need to match with an existing record -  the demographics are not considered. 

Antonio Morelli

unread,
Feb 28, 2015, 2:08:26 AM2/28/15
to dcm...@googlegroups.com
The value I am using is pid,issuer?,familyname,givenname,middlename?,birthdate without brackets.
 I need to match all these values to distinguish patients with same pid and a different name.

Antonio Morelli

unread,
Feb 28, 2015, 3:43:06 AM2/28/15
to dcm...@googlegroups.com
I have some new elements to understand the causes of the error...
The exception is thrown only if the new patient does not have a "PatientId Issuer", and the calling AE is configured in dcm4chee to force a pat id issuer.  

Antonio Morelli

unread,
Mar 4, 2015, 11:06:28 AM3/4/15
to

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

Reply all
Reply to author
Forward
0 new messages