diff --git a/config/config.yaml b/config/config.yaml index 0f441a4..95cc1c1 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -47,6 +47,9 @@ httpclients: infores:multiomics-clinicaltrials: endpoint: query params: + infores:multiomics-drugapprovals: + endpoint: query + params: infores:molepro: endpoint: query params: diff --git a/config/tr_sys_settings.py b/config/tr_sys_settings.py index dca5f4c..204537c 100755 --- a/config/tr_sys_settings.py +++ b/config/tr_sys_settings.py @@ -52,6 +52,7 @@ 'tr_ara_wfr.wfr_app.AppConfig', 'tr_kp_genetics.genetics_app.AppConfig', 'tr_kp_clinical.clinical_app.AppConfig', + 'tr_kp_drug.drug_app.AppConfig', 'tr_kp_molecular.molecular_app.AppConfig', 'tr_kp_cam.cam_app.AppConfig', 'tr_kp_textmining.textmining_app.AppConfig', diff --git a/config/url-config-legacy.yaml b/config/url-config-legacy.yaml index ca12b97..5822192 100644 --- a/config/url-config-legacy.yaml +++ b/config/url-config-legacy.yaml @@ -19,6 +19,7 @@ infores:connections-hypothesis: https://chp-api.ci.transltr.io infores:cohd: https://cohd-api.ci.transltr.io/api infores:genetics-data-provider: https://genetics-kp.ci.transltr.io/genetics_provider/trapi/v1.5 infores:multiomics-clinicaltrials: https://multiomics.ci.transltr.io/ctkp +infores:multiomics-drugapprovals: https://multiomics.ci.transltr.io/dakp infores:molepro: https://molepro-trapi.ci.transltr.io/molepro/trapi/v1.5 infores:openpredict: https://openpredict.ci.transltr.io infores:text-mining-provider-targeted: https://biothings.ci.transltr.io/text_mining_targeted_association diff --git a/tr_sys/tr_kp_drug/drug_app.py b/tr_sys/tr_kp_drug/drug_app.py new file mode 100644 index 0000000..7746f24 --- /dev/null +++ b/tr_sys/tr_kp_drug/drug_app.py @@ -0,0 +1,27 @@ +from tr_ars.default_ars_app.ars_app import AppConfig as ARSAppConfig +from django.urls import path, include +from tr_ars.default_ars_app.api import * + +class AppConfig(ARSAppConfig): + name = 'tr_kp_drug.drug_app' # must be dot path for module + actors = [make_actorconf('infores:multiomics-drugapprovals', + 'runquery', ['general'], + 'query')] # tuple of remote, name, channel + app_path = 'kp-drug' + regex_path = '^' + app_path + '/' + +### code below this line is required, but doesn't require updating in most cases + +apipatterns = [path(r'', init_api_index(AppConfig.actors, AppConfig.app_path), name=AppConfig.app_path + '-api')] +for actor in AppConfig.actors: + query_path = actor.name() + query_name = AppConfig.app_path + '-' + query_path + apipatterns.append(path(query_path, init_api_fn(actor), name=query_name)) + +urlpatterns = [ + path(r'', init_redirect(AppConfig.app_path), name=AppConfig.app_path + '-base'), + path(r'api/', include(apipatterns)), +] + + + diff --git a/tr_sys/tr_sys/settings.py b/tr_sys/tr_sys/settings.py index 4c3cb6e..ab2fbc3 100644 --- a/tr_sys/tr_sys/settings.py +++ b/tr_sys/tr_sys/settings.py @@ -52,6 +52,7 @@ 'tr_ara_cqs.cqs_app.AppConfig', 'tr_kp_genetics.genetics_app.AppConfig', 'tr_kp_clinical.clinical_app.AppConfig', + 'tr_kp_drug.drug_app.AppConfig', 'tr_kp_molecular.molecular_app.AppConfig', 'tr_kp_cam.cam_app.AppConfig', 'tr_kp_textmining.textmining_app.AppConfig', diff --git a/tr_sys/tr_sys/urls.py b/tr_sys/tr_sys/urls.py index 3860088..9c0ce5b 100644 --- a/tr_sys/tr_sys/urls.py +++ b/tr_sys/tr_sys/urls.py @@ -31,6 +31,7 @@ from tr_ara_cqs.cqs_app import AppConfig as CqsApp from tr_kp_genetics.genetics_app import AppConfig as GeneticsApp from tr_kp_clinical.clinical_app import AppConfig as ClinicalApp +from tr_kp_drug.drug_app import AppConfig as DrugApp from tr_kp_molecular.molecular_app import AppConfig as MolecularApp from tr_kp_cam.cam_app import AppConfig as CamApp from tr_kp_textmining.textmining_app import AppConfig as TextMiningApp @@ -54,6 +55,7 @@ re_path(UnsecretApp.regex_path, include(UnsecretApp.name)), re_path(GeneticsApp.regex_path, include(GeneticsApp.name)), re_path(ClinicalApp.regex_path, include(ClinicalApp.name)), + re_path(DrugApp.regex_path, include(DrugApp.name)), re_path(MolecularApp.regex_path, include(MolecularApp.name)), re_path(CamApp.regex_path, include(CamApp.name)), re_path(TextMiningApp.regex_path, include(TextMiningApp.name)),