Hi Charity,
Let me see if I can help (as I’m learning here too) and Frank can chime in if I missed anything.
Essentially, the SOURCE table holds the DB connection information and the SOURCE_KEY is used when referencing the service that access this data source in the webAPI. In the example below, I’m creating a source called Laertes with a dummy connection string that uses postgreSQL. The SOURCE_KEY value of “LAERTES” is then used when I want to access the webAPI to obtain data from this source:
http://localhost:8080/WebAPI/LAERTES/
or more generically:
http://{your_web_server}/WebAPI{SOURCE_KEY}
The SOURCE_DAIMON table holds information on what type of data that the referenced SOURCE entry provides. In the example below, this source is used to provide VOCABULARY (1) and EVIDENCE (3) data. Other values are CDM (0) and RESULTS (2). If you do a search in the org.ohdsi.webapi.service namespace for SourceDaimon.DaimonType you will see how SOURCE and SOURCE_DAIMON values are used to query a data source for values. If you also look at the org.ohdsi.webapi.source namespace, you’ll see how the SOURCE and SOURCE_DAIMON classes map to the data model.
When you get this set up properly and get WebAPI running, you can call this service which will describe the sources available in WebAPI:
http://localhost:8080/WebAPI/source/sources
Below is an example script that I generated using some of the data we have in SQL Server for reference.
USE [OHDSI_MULTIHOMED]
GO
SET IDENTITY_INSERT [dbo].[source] ON
INSERT [dbo].[source] ([SOURCE_ID], [SOURCE_NAME], [SOURCE_KEY], [SOURCE_CONNECTION], [SOURCE_DIALECT]) VALUES (14, N’Laertes’, N’LAERTES’, N’jdbc:postgresql://server:port/schema?user=user_name&password=yourpassword’, N’postgresql’)
SET IDENTITY_INSERT [dbo].[source] OFF
USE [OHDSI_MULTIHOMED]
GO
SET IDENTITY_INSERT [dbo].[source_daimon] ON
INSERT [dbo].[source_daimon] ([source_daimon_id], [source_id], [daimon_type], [table_qualifier], [priority]) VALUES (1, 14, 3, N’vocabularyv5.public’, 0)
INSERT [dbo].[source_daimon] ([source_daimon_id], [source_id], [daimon_type], [table_qualifier], [priority]) VALUES (2, 14, 1, N’vocabularyv5.public’, 0)
SET IDENTITY_INSERT [dbo].[source_daimon] OFF
I hope this helps and reach out with any further questions!