OHDSI Home | Forums | Wiki | Github

Deleting a DB Source at config page

I have a list of sources and there is one I want to delete:

I tried deleting all entries at webapi.source and webapi.source_daimon to have:

ohdsi=> select * from webapi.source_daimon;
source_daimon_id | source_id | daimon_type | table_qualifier | priority
------------------±----------±------------±------------------------±---------
27 | 10 | 0 | ccae2003_2020 | 0
29 | 10 | 2 | ar_ccae2003_2020 | 0
30 | 10 | 5 | tmp_atlas_ccae2003_2020 | 0
28 | 10 | 1 | omop_20220331 | 0
35 | 12 | 0 | mdcr2003_2021 | 0
37 | 12 | 2 | ar_mdcr2003_2021 | 0
38 | 12 | 5 | tmp_atlas_mdcr2003_2021 | 0
39 | 12 | 1 | omop_20220331 | 0
(8 rows)

ohdsi=> select source_id, source_name, source_key, source_dialect from webapi.source;
source_id | source_name | source_key | source_dialect
-----------±--------------------------±------------------±---------------
10 | Results for ccae2003_2020 | src_ccae2003_2020 | postgresql
12 | Results for mdcr2003_2021 | src_mdcr2003_2021 | postgresql
(2 rows)

Yet, the
" Results for mdcr2003_2020_oud [src_mdcr2003_2020_oud]"
persist. How can I do to delete this one from the list of sources?

Thanks
Jose

Have you run /source/refresh endpoint?

Also, I find it best not to delete entries but rather to invalidate them. Use the source.deleted_date field to do this.

I can not see the refresh button anymore:

I also cleared caches but… that " Results for mdcr2003_2020_oud [src_mdcr2003_2020_oud]" still persist.

First grant yourself permission to it. Then click on the source name and then click on the trash can button to “delete” it. This just keeps the entry in the source table, but updates the “deleted_date” field.

After this, clear config cache.

I gave me the permission, clicked on the problematic source and I got the message:

errormsg_atlas_4missing_source

hmmmm
thanks

Ah, cause the record is gone. Can you restart your WebAPI instance?

Just did and worked!
Is there another way to do this “refreshing” (as powerful as rebooting webapi) without re-starting webapi?

Thanks
Jose

Yep, next time you want to remove a source, just use the GUI method (the trash can icon). This will cleanly remove it from everyone’s view in Atlas. The records remain, but the deleted_date field value means it’s not in Atlas.

1 Like

However when I try to delete a source as you indicated I get a message I do not understand and the deletion does not proceed:

Any suggestions, please?

Thanks
Jose

It is telling you that you have set up daimon priority to be > 0 on one of the daimon’s of the source. The priority is used to determine which source should be used by default in the application.

To work around this, update the sources to change the priority to zero on the source you want. then change a different source to have priority 1. You should then be able to delete the original source.

Hi
I don’t know how to set the daimon priority to be > 0 or equal to 0. How to do this?

Thanks

Here is an example where source_id = 3 is to be deleted. Change the priority column to 0 for all its daimons

Then return to the page and you’ll get a confirmation dialog to delete after clicking the trash can.

Unfortunately, I don’t see an obvious way to alter the priorities through the Atlas GUI.

After deletion, the deleted date field in the source table will be populated, and the source_daimon priority will change to -1

Screen Shot 2023-03-17 at 20.46.02

I’m having trouble on my system so I was unable to verify the steps ont he UI, thank you for checking.

I think we need to request the feature to assign priorities to the daimon.

I think I found it: at the top of the configuration screen, you have this dropdown:

image

If you select ‘Whole Application’ that will update the daimon priority when you change the radio button under the ‘Vocabulary Version’ column.

I tried changing to Whole Application but I still get that error message. Also:

ohdsi=> select * from webapi.source_daimon;
source_daimon_id | source_id | daimon_type | table_qualifier | priority
------------------±----------±------------±------------------------±---------
27 | 10 | 0 | ccae2003_2020 | 0
29 | 10 | 2 | ar_ccae2003_2020 | 0
30 | 10 | 5 | tmp_atlas_ccae2003_2020 | 0
28 | 10 | 1 | omop_20220331 | 0
35 | 12 | 0 | mdcr2003_2021 | 0
37 | 12 | 2 | ar_mdcr2003_2021 | 0
38 | 12 | 5 | tmp_atlas_mdcr2003_2021 | 0
39 | 12 | 1 | omop_20220331 | 0
(8 rows)

ohdsi=>

This shows all my priorities are 0 and this makes me wonder what to do as I still get the "Some daimons … " message.

Thanks

t