Deleting Studies in dcm4chee-arc with command line, like i do with twiddle in dcm4chee2 ?

1,078 views
Skip to first unread message

Clédio Moreira Paiva

unread,
Dec 20, 2019, 10:27:47 PM12/20/19
to dcm...@googlegroups.com
Hello ! there is a way to delete studies in dcm4chee-arc-5 from the command line  ?
like we can do in dcm4chee2 with twiddle:

sh /var/lib/dcm4chee/bin/twiddle.sh -s localhost -u admin -p pass invoke "dcm4chee.archive:service=ContentEditService" moveStudyToTrash $study

Thanks !

Gunter Zeilinger

unread,
Dec 23, 2019, 4:14:13 AM12/23/19
to dcm...@googlegroups.com

*   Trying 127.0.0.1:8080...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /dcm4chee-arc/aets/DCM4CHEE/rs/studies/1.2.840.113674.1115.261.200/reject/113039%5EDCM HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.65.3
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Connection: keep-alive
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: origin, content-type, accept, authorization
< Access-Control-Allow-Credentials: true
< Content-Type: application/json
< Content-Length: 12
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, HEAD
< Date: Mon, 23 Dec 2019 09:04:58 GMT
<
* Connection #0 to host localhost left intact
{"count":10}


Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, December 21, 2019 4:27 AM, Clédio Moreira Paiva <cled...@gmail.com> wrote:

Hello ! there is a way to delete studies in dcm4chee-arc-5 from the command line  ?
like we can do in dcm4chee2 with twiddle:

sh /var/lib/dcm4chee/bin/twiddle.sh -s localhost -u admin -p pass invoke "dcm4chee.archive:service=ContentEditService" moveStudyToTrash ' . $study

Thanks !


--
You received this message because you are subscribed to the Google Groups "dcm4che" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dcm4che+u...@googlegroups.com.

Clédio Moreira Paiva

unread,
Dec 24, 2019, 2:45:28 PM12/24/19
to dcm4che
Thank you Gunter this tool is great ! I was able to delete the study sucessfuly ! And i see that there is a lot of another RESTful services ! I can do many things here.

Thank you again !
To unsubscribe from this group and stop receiving emails from it, send an email to dcm...@googlegroups.com.

antoine

unread,
Dec 24, 2019, 6:24:21 PM12/24/19
to dcm...@googlegroups.com

Hi, I’m searching the same kind of tool to delete duplicate patient. I can’t delete them from the UI.

 

Kind regards.

Antoine

 

 

 

 

De : <dcm...@googlegroups.com> au nom de Clédio Moreira Paiva <cled...@gmail.com>
Répondre à : "dcm...@googlegroups.com" <dcm...@googlegroups.com>
Date : mardi, 24 décembre 2019 à 20:45
À : dcm4che <dcm...@googlegroups.com>
Objet : Re: [dcm4che-group] Deleting Studies in dcm4chee-arc with command line, like i do with twiddle in dcm4chee2 ?

To unsubscribe from this group and stop receiving emails from it, send an email to dcm4che+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dcm4che/7f32aabe-88bd-42b9-9abc-b86d60082ad7%40googlegroups.com.

Antoine Adam

unread,
Dec 26, 2019, 7:52:32 AM12/26/19
to dcm4che
Hi sorry to ask again but I'm searching a solution ofr deleting patient with command line.

I can manage with restful delete, but sometimes when there is a duplicate patient ID or duplicate something, hte server is blocked and I can't create or merge or delete anything.

Do you have a solution or a link where I can find the way of deleting this duoplicated entries ?
Kind regards
Antoine

Gunter Zeilinger

unread,
Dec 27, 2019, 10:22:27 AM12/27/19
to dcm...@googlegroups.com
You can't. There is something wrong with your archive configuration and/or workflow, if duplicate Patient IDs occurs, which make Patient Management operations impossible.


Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
--
You received this message because you are subscribed to the Google Groups "dcm4che" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dcm4che+u...@googlegroups.com.

Antoine

unread,
Dec 27, 2019, 1:24:11 PM12/27/19
to dcm...@googlegroups.com

Thank you for the reply.

 

Do you mean that it should be impossible to have duplicate even if the resful post is wrong ? The archive should prevent duplicate patient to occur ?

 

It looks like when I try to update patient informations then it creates duplicates…

 

Antoine

 

 

 

 

De : 'Gunter Zeilinger' via dcm4che <dcm...@googlegroups.com>
Répondre à : "dcm...@googlegroups.com" <dcm...@googlegroups.com>
Date : vendredi 27 décembre 2019 à 16:22
À : "dcm...@googlegroups.com" <dcm...@googlegroups.com>
Objet : Re: [dcm4che-group] Re: Deleting Studies in dcm4chee-arc with command line, like i do with twiddle in dcm4chee2 ?

Gunter Zeilinger

unread,
Dec 27, 2019, 1:41:27 PM12/27/19
to dcm...@googlegroups.com
It should not be possible to create duplicate Patient ID records by any RESTful service - you may fill a bug report at https://github.com/dcm4che/dcm4chee-arc-light/issues if one does.

There are only use cases on receiving DICOM objects, where creating duplicate Patient ID records may happen....


Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

antoine

unread,
Dec 27, 2019, 3:24:12 PM12/27/19
to dcm...@googlegroups.com

Thank you I will open an issue.

 

Now I’m shy to use the put method to update patient tag because it could block my database. It happened 3 times.

 

I will do it one more time and if it fails send the command to the issue list.

 

Do you have a well explain webpage to connect to the sql data base with ssh command ?
I would like to learn how to clean the database in case it happens again.

 

Kind regards.

 

Antoine

 

 

De : 'Gunter Zeilinger' via dcm4che <dcm...@googlegroups.com>
Répondre à : <dcm...@googlegroups.com>
Date : vendredi, 27 décembre 2019 à 19:41

Gunter Zeilinger

unread,
Dec 27, 2019, 3:34:54 PM12/27/19
to dcm...@googlegroups.com
You always can repair it by SQL, by linking all Studies (by update study.patient_pk) to one of the Patient records with duplicate Patient IDs and removing the orphaned Patient and Patient ID from the DB. You may also remove the referred dicomattr, person_name and soundex_code records before, if you want to avoid to keep any orphaned record in the DB.


Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

antoine

unread,
Dec 27, 2019, 3:50:00 PM12/27/19
to dcm...@googlegroups.com

Thank you.

 

Is there a wiki page for that ?

Antoine

 

 

 

De : 'Gunter Zeilinger' via dcm4che <dcm...@googlegroups.com>
Répondre à : "dcm...@googlegroups.com" <dcm...@googlegroups.com>
Date : vendredi, 27 décembre 2019 à 21:35

Gunter Zeilinger

unread,
Dec 27, 2019, 4:20:50 PM12/27/19
to dcm...@googlegroups.com
Assuming there are 2 patient records with patient id = '583295', and you want to eliminate the patient record with pk=5:

pacsdb=# select patient.pk, patient_id_fk, pat_name_fk, dicomattrs_fk from patient join patient_id on patient.patient_id_fk = patient_id.pk  where pat_id='583295';
pk | patient_id_fk | pat_name_fk | dicomattrs_fk
----+---------------+-------------+---------------
  5 |             5 |           7 |            51
  2 |             2 |           2 |             2
(2 rows)

pacsdb=# update study set patient_fk=2 where patient_fk=5;
UPDATE 1
pacsdb=# delete from patient where pk=5;
DELETE 1
pacsdb=# delete from patient_id where pk=5;
DELETE 1
pacsdb=# delete from dicomattrs where pk=51;
DELETE 1
pacsdb=# select pk from soundex_code where person_name_fk=7;
pk
----
16
15
(2 rows)

pacsdb=# delete from soundex_code where pk in (15, 16);
DELETE 2
pacsdb=# delete from person_name where pk=7;
DELETE 1



Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

antoine

unread,
Dec 27, 2019, 4:30:01 PM12/27/19
to dcm...@googlegroups.com

Thank you very much. I’ll try it.

Antoine

 

 

 

De : 'Gunter Zeilinger' via dcm4che <dcm...@googlegroups.com>
Répondre à : "dcm...@googlegroups.com" <dcm...@googlegroups.com>
Date : vendredi, 27 décembre 2019 à 22:20

Anderson Sousa (AndersonX)

unread,
Apr 16, 2024, 9:07:01 AMApr 16
to dcm4che
Please, sorry to bother you, if possible, send me a code example of how you did it. I'm using PHP, but any language helps
Reply all
Reply to author
Forward
Message has been deleted
0 new messages