From 43cba16344dc4090b07823db71e9c92f515d1d89 Mon Sep 17 00:00:00 2001 From: Michael Boniface <m.j.boniface@soton.ac.uk> Date: Tue, 18 Feb 2025 11:05:56 +0000 Subject: [PATCH] added ACMC_GITHUB_PAT and ACMC_GITLAB_PAT as environmnet variables and reconstructed the url, no now need to username and password, or to include tokens in the API --- .../clinical-codes-org/About the source.docx | Bin .../Where this code list comes from .docx | Bin .../Alcohol intake/res47-alcohol-intake.csv | 0 .../Where this code list comes from .docx | Bin .../res47-physical-activity.csv | 0 .../Where this code list comes from .docx | Bin .../Smoking status/res56-smoking-status.csv | 0 .../Where this code list comes from .docx | Bin .../res52-cardiovascular-events-icd10.csv | 0 .../Where this code list comes from .docx | Bin ..._PH62_ver_124_concepts_20230719T112819.csv | 0 .../Where this code list comes from .docx | Bin .../res201-did-not-attend-appointment.csv | 0 .../Where this code list comes from .docx | Bin ...PH223_ver_446_concepts_20230719T114228.csv | 0 .../Where this code list comes from .docx | Bin ...res176-palliative-and-end-of-life-care.csv | 0 .../Where this code list comes from .docx | Bin ...1091_ver_2385_concepts_20230719T122902.csv | 0 .../Where this code list comes from .docx | Bin .../res38-personality-disorder.csv | 0 .../Where this code list comes from .docx | Bin .../Self harm/res41-self-harm.csv | 0 .../Where this code list comes from .docx | Bin .../Abdominal pain/res176-abdominal-pain.csv | 0 .../Where this code list comes from .docx | Bin .../Symptom code lists/Falls/res178-fall.csv | 0 .../Falls/res202-falls-outcome.csv | 0 .../Where this code list comes from .docx | Bin .../Fatigue/res175-fatigue.csv | 0 .../Where this code list comes from .docx | Bin .../Headache/res175-headache.csv | 0 .../Where this code list comes from .docx | Bin .../Incontinence/res11-incontinence.csv | 0 .../Where this code list comes from .docx | Bin .../Musculoskeletal pain/res175-msk-pain.csv | 0 .../Where this code list comes from .docx | Bin .../res55-neuropathic_pain.csv | 0 .../Where this code list comes from .docx | Bin .../Sleep problems/res175-sleep-problems.csv | 0 .../Where this code list comes from .docx | Bin .../Stress/res175-stress.csv | 0 .../Where this code list comes from .docx | Bin ..._PH87_ver_174_concepts_20230719T113229.csv | 0 .../Where this code list comes from .docx | Bin ...PH331_ver_662_concepts_20230719T121545.csv | 0 {example => examples}/config.json | 0 {example => examples}/config2.json | 0 phen.py | 62 ++++++++++-------- trud.py | 5 +- 50 files changed, 38 insertions(+), 29 deletions(-) rename {example => examples}/codes/clinical-codes-org/About the source.docx (100%) rename {example => examples}/codes/clinical-codes-org/Behaviours code lists/Alcohol intake/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Behaviours code lists/Alcohol intake/res47-alcohol-intake.csv (100%) rename {example => examples}/codes/clinical-codes-org/Behaviours code lists/Physical activity/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Behaviours code lists/Physical activity/res47-physical-activity.csv (100%) rename {example => examples}/codes/clinical-codes-org/Behaviours code lists/Smoking status/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Behaviours code lists/Smoking status/res56-smoking-status.csv (100%) rename {example => examples}/codes/clinical-codes-org/Cardiovascular events (ICD10)/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Cardiovascular events (ICD10)/res52-cardiovascular-events-icd10.csv (100%) rename {example => examples}/codes/clinical-codes-org/Motor neurone disease/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Motor neurone disease/phenotype_PH62_ver_124_concepts_20230719T112819.csv (100%) rename {example => examples}/codes/clinical-codes-org/Non-attendance codes/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Non-attendance codes/res201-did-not-attend-appointment.csv (100%) rename {example => examples}/codes/clinical-codes-org/Obsessive Compulsive Disorder/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Obsessive Compulsive Disorder/phenotype_PH223_ver_446_concepts_20230719T114228.csv (100%) rename {example => examples}/codes/clinical-codes-org/Palliative care codes/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Palliative care codes/res176-palliative-and-end-of-life-care.csv (100%) rename {example => examples}/codes/clinical-codes-org/Peptic ulcer/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Peptic ulcer/phenotype_PH1091_ver_2385_concepts_20230719T122902.csv (100%) rename {example => examples}/codes/clinical-codes-org/Personality disorders/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Personality disorders/res38-personality-disorder.csv (100%) rename {example => examples}/codes/clinical-codes-org/Self harm/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Self harm/res41-self-harm.csv (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Abdominal pain/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Abdominal pain/res176-abdominal-pain.csv (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Falls/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Falls/res178-fall.csv (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Falls/res202-falls-outcome.csv (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Fatigue/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Fatigue/res175-fatigue.csv (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Headache/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Headache/res175-headache.csv (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Incontinence/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Incontinence/res11-incontinence.csv (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Musculoskeletal pain/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Musculoskeletal pain/res175-msk-pain.csv (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Neuropathic pain/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Neuropathic pain/res55-neuropathic_pain.csv (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Sleep problems/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Sleep problems/res175-sleep-problems.csv (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Stress/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Symptom code lists/Stress/res175-stress.csv (100%) rename {example => examples}/codes/clinical-codes-org/Tuberculosis/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Tuberculosis/phenotype_PH87_ver_174_concepts_20230719T113229.csv (100%) rename {example => examples}/codes/clinical-codes-org/Urinary tract stones/Where this code list comes from .docx (100%) rename {example => examples}/codes/clinical-codes-org/Urinary tract stones/phenotype_PH331_ver_662_concepts_20230719T121545.csv (100%) rename {example => examples}/config.json (100%) rename {example => examples}/config2.json (100%) diff --git a/example/codes/clinical-codes-org/About the source.docx b/examples/codes/clinical-codes-org/About the source.docx similarity index 100% rename from example/codes/clinical-codes-org/About the source.docx rename to examples/codes/clinical-codes-org/About the source.docx diff --git a/example/codes/clinical-codes-org/Behaviours code lists/Alcohol intake/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Behaviours code lists/Alcohol intake/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Behaviours code lists/Alcohol intake/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Behaviours code lists/Alcohol intake/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Behaviours code lists/Alcohol intake/res47-alcohol-intake.csv b/examples/codes/clinical-codes-org/Behaviours code lists/Alcohol intake/res47-alcohol-intake.csv similarity index 100% rename from example/codes/clinical-codes-org/Behaviours code lists/Alcohol intake/res47-alcohol-intake.csv rename to examples/codes/clinical-codes-org/Behaviours code lists/Alcohol intake/res47-alcohol-intake.csv diff --git a/example/codes/clinical-codes-org/Behaviours code lists/Physical activity/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Behaviours code lists/Physical activity/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Behaviours code lists/Physical activity/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Behaviours code lists/Physical activity/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Behaviours code lists/Physical activity/res47-physical-activity.csv b/examples/codes/clinical-codes-org/Behaviours code lists/Physical activity/res47-physical-activity.csv similarity index 100% rename from example/codes/clinical-codes-org/Behaviours code lists/Physical activity/res47-physical-activity.csv rename to examples/codes/clinical-codes-org/Behaviours code lists/Physical activity/res47-physical-activity.csv diff --git a/example/codes/clinical-codes-org/Behaviours code lists/Smoking status/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Behaviours code lists/Smoking status/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Behaviours code lists/Smoking status/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Behaviours code lists/Smoking status/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Behaviours code lists/Smoking status/res56-smoking-status.csv b/examples/codes/clinical-codes-org/Behaviours code lists/Smoking status/res56-smoking-status.csv similarity index 100% rename from example/codes/clinical-codes-org/Behaviours code lists/Smoking status/res56-smoking-status.csv rename to examples/codes/clinical-codes-org/Behaviours code lists/Smoking status/res56-smoking-status.csv diff --git a/example/codes/clinical-codes-org/Cardiovascular events (ICD10)/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Cardiovascular events (ICD10)/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Cardiovascular events (ICD10)/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Cardiovascular events (ICD10)/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Cardiovascular events (ICD10)/res52-cardiovascular-events-icd10.csv b/examples/codes/clinical-codes-org/Cardiovascular events (ICD10)/res52-cardiovascular-events-icd10.csv similarity index 100% rename from example/codes/clinical-codes-org/Cardiovascular events (ICD10)/res52-cardiovascular-events-icd10.csv rename to examples/codes/clinical-codes-org/Cardiovascular events (ICD10)/res52-cardiovascular-events-icd10.csv diff --git a/example/codes/clinical-codes-org/Motor neurone disease/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Motor neurone disease/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Motor neurone disease/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Motor neurone disease/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Motor neurone disease/phenotype_PH62_ver_124_concepts_20230719T112819.csv b/examples/codes/clinical-codes-org/Motor neurone disease/phenotype_PH62_ver_124_concepts_20230719T112819.csv similarity index 100% rename from example/codes/clinical-codes-org/Motor neurone disease/phenotype_PH62_ver_124_concepts_20230719T112819.csv rename to examples/codes/clinical-codes-org/Motor neurone disease/phenotype_PH62_ver_124_concepts_20230719T112819.csv diff --git a/example/codes/clinical-codes-org/Non-attendance codes/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Non-attendance codes/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Non-attendance codes/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Non-attendance codes/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Non-attendance codes/res201-did-not-attend-appointment.csv b/examples/codes/clinical-codes-org/Non-attendance codes/res201-did-not-attend-appointment.csv similarity index 100% rename from example/codes/clinical-codes-org/Non-attendance codes/res201-did-not-attend-appointment.csv rename to examples/codes/clinical-codes-org/Non-attendance codes/res201-did-not-attend-appointment.csv diff --git a/example/codes/clinical-codes-org/Obsessive Compulsive Disorder/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Obsessive Compulsive Disorder/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Obsessive Compulsive Disorder/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Obsessive Compulsive Disorder/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Obsessive Compulsive Disorder/phenotype_PH223_ver_446_concepts_20230719T114228.csv b/examples/codes/clinical-codes-org/Obsessive Compulsive Disorder/phenotype_PH223_ver_446_concepts_20230719T114228.csv similarity index 100% rename from example/codes/clinical-codes-org/Obsessive Compulsive Disorder/phenotype_PH223_ver_446_concepts_20230719T114228.csv rename to examples/codes/clinical-codes-org/Obsessive Compulsive Disorder/phenotype_PH223_ver_446_concepts_20230719T114228.csv diff --git a/example/codes/clinical-codes-org/Palliative care codes/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Palliative care codes/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Palliative care codes/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Palliative care codes/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Palliative care codes/res176-palliative-and-end-of-life-care.csv b/examples/codes/clinical-codes-org/Palliative care codes/res176-palliative-and-end-of-life-care.csv similarity index 100% rename from example/codes/clinical-codes-org/Palliative care codes/res176-palliative-and-end-of-life-care.csv rename to examples/codes/clinical-codes-org/Palliative care codes/res176-palliative-and-end-of-life-care.csv diff --git a/example/codes/clinical-codes-org/Peptic ulcer/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Peptic ulcer/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Peptic ulcer/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Peptic ulcer/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Peptic ulcer/phenotype_PH1091_ver_2385_concepts_20230719T122902.csv b/examples/codes/clinical-codes-org/Peptic ulcer/phenotype_PH1091_ver_2385_concepts_20230719T122902.csv similarity index 100% rename from example/codes/clinical-codes-org/Peptic ulcer/phenotype_PH1091_ver_2385_concepts_20230719T122902.csv rename to examples/codes/clinical-codes-org/Peptic ulcer/phenotype_PH1091_ver_2385_concepts_20230719T122902.csv diff --git a/example/codes/clinical-codes-org/Personality disorders/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Personality disorders/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Personality disorders/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Personality disorders/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Personality disorders/res38-personality-disorder.csv b/examples/codes/clinical-codes-org/Personality disorders/res38-personality-disorder.csv similarity index 100% rename from example/codes/clinical-codes-org/Personality disorders/res38-personality-disorder.csv rename to examples/codes/clinical-codes-org/Personality disorders/res38-personality-disorder.csv diff --git a/example/codes/clinical-codes-org/Self harm/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Self harm/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Self harm/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Self harm/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Self harm/res41-self-harm.csv b/examples/codes/clinical-codes-org/Self harm/res41-self-harm.csv similarity index 100% rename from example/codes/clinical-codes-org/Self harm/res41-self-harm.csv rename to examples/codes/clinical-codes-org/Self harm/res41-self-harm.csv diff --git a/example/codes/clinical-codes-org/Symptom code lists/Abdominal pain/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Symptom code lists/Abdominal pain/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Abdominal pain/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Symptom code lists/Abdominal pain/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Symptom code lists/Abdominal pain/res176-abdominal-pain.csv b/examples/codes/clinical-codes-org/Symptom code lists/Abdominal pain/res176-abdominal-pain.csv similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Abdominal pain/res176-abdominal-pain.csv rename to examples/codes/clinical-codes-org/Symptom code lists/Abdominal pain/res176-abdominal-pain.csv diff --git a/example/codes/clinical-codes-org/Symptom code lists/Falls/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Symptom code lists/Falls/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Falls/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Symptom code lists/Falls/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Symptom code lists/Falls/res178-fall.csv b/examples/codes/clinical-codes-org/Symptom code lists/Falls/res178-fall.csv similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Falls/res178-fall.csv rename to examples/codes/clinical-codes-org/Symptom code lists/Falls/res178-fall.csv diff --git a/example/codes/clinical-codes-org/Symptom code lists/Falls/res202-falls-outcome.csv b/examples/codes/clinical-codes-org/Symptom code lists/Falls/res202-falls-outcome.csv similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Falls/res202-falls-outcome.csv rename to examples/codes/clinical-codes-org/Symptom code lists/Falls/res202-falls-outcome.csv diff --git a/example/codes/clinical-codes-org/Symptom code lists/Fatigue/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Symptom code lists/Fatigue/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Fatigue/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Symptom code lists/Fatigue/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Symptom code lists/Fatigue/res175-fatigue.csv b/examples/codes/clinical-codes-org/Symptom code lists/Fatigue/res175-fatigue.csv similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Fatigue/res175-fatigue.csv rename to examples/codes/clinical-codes-org/Symptom code lists/Fatigue/res175-fatigue.csv diff --git a/example/codes/clinical-codes-org/Symptom code lists/Headache/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Symptom code lists/Headache/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Headache/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Symptom code lists/Headache/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Symptom code lists/Headache/res175-headache.csv b/examples/codes/clinical-codes-org/Symptom code lists/Headache/res175-headache.csv similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Headache/res175-headache.csv rename to examples/codes/clinical-codes-org/Symptom code lists/Headache/res175-headache.csv diff --git a/example/codes/clinical-codes-org/Symptom code lists/Incontinence/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Symptom code lists/Incontinence/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Incontinence/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Symptom code lists/Incontinence/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Symptom code lists/Incontinence/res11-incontinence.csv b/examples/codes/clinical-codes-org/Symptom code lists/Incontinence/res11-incontinence.csv similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Incontinence/res11-incontinence.csv rename to examples/codes/clinical-codes-org/Symptom code lists/Incontinence/res11-incontinence.csv diff --git a/example/codes/clinical-codes-org/Symptom code lists/Musculoskeletal pain/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Symptom code lists/Musculoskeletal pain/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Musculoskeletal pain/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Symptom code lists/Musculoskeletal pain/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Symptom code lists/Musculoskeletal pain/res175-msk-pain.csv b/examples/codes/clinical-codes-org/Symptom code lists/Musculoskeletal pain/res175-msk-pain.csv similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Musculoskeletal pain/res175-msk-pain.csv rename to examples/codes/clinical-codes-org/Symptom code lists/Musculoskeletal pain/res175-msk-pain.csv diff --git a/example/codes/clinical-codes-org/Symptom code lists/Neuropathic pain/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Symptom code lists/Neuropathic pain/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Neuropathic pain/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Symptom code lists/Neuropathic pain/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Symptom code lists/Neuropathic pain/res55-neuropathic_pain.csv b/examples/codes/clinical-codes-org/Symptom code lists/Neuropathic pain/res55-neuropathic_pain.csv similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Neuropathic pain/res55-neuropathic_pain.csv rename to examples/codes/clinical-codes-org/Symptom code lists/Neuropathic pain/res55-neuropathic_pain.csv diff --git a/example/codes/clinical-codes-org/Symptom code lists/Sleep problems/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Symptom code lists/Sleep problems/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Sleep problems/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Symptom code lists/Sleep problems/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Symptom code lists/Sleep problems/res175-sleep-problems.csv b/examples/codes/clinical-codes-org/Symptom code lists/Sleep problems/res175-sleep-problems.csv similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Sleep problems/res175-sleep-problems.csv rename to examples/codes/clinical-codes-org/Symptom code lists/Sleep problems/res175-sleep-problems.csv diff --git a/example/codes/clinical-codes-org/Symptom code lists/Stress/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Symptom code lists/Stress/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Stress/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Symptom code lists/Stress/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Symptom code lists/Stress/res175-stress.csv b/examples/codes/clinical-codes-org/Symptom code lists/Stress/res175-stress.csv similarity index 100% rename from example/codes/clinical-codes-org/Symptom code lists/Stress/res175-stress.csv rename to examples/codes/clinical-codes-org/Symptom code lists/Stress/res175-stress.csv diff --git a/example/codes/clinical-codes-org/Tuberculosis/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Tuberculosis/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Tuberculosis/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Tuberculosis/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Tuberculosis/phenotype_PH87_ver_174_concepts_20230719T113229.csv b/examples/codes/clinical-codes-org/Tuberculosis/phenotype_PH87_ver_174_concepts_20230719T113229.csv similarity index 100% rename from example/codes/clinical-codes-org/Tuberculosis/phenotype_PH87_ver_174_concepts_20230719T113229.csv rename to examples/codes/clinical-codes-org/Tuberculosis/phenotype_PH87_ver_174_concepts_20230719T113229.csv diff --git a/example/codes/clinical-codes-org/Urinary tract stones/Where this code list comes from .docx b/examples/codes/clinical-codes-org/Urinary tract stones/Where this code list comes from .docx similarity index 100% rename from example/codes/clinical-codes-org/Urinary tract stones/Where this code list comes from .docx rename to examples/codes/clinical-codes-org/Urinary tract stones/Where this code list comes from .docx diff --git a/example/codes/clinical-codes-org/Urinary tract stones/phenotype_PH331_ver_662_concepts_20230719T121545.csv b/examples/codes/clinical-codes-org/Urinary tract stones/phenotype_PH331_ver_662_concepts_20230719T121545.csv similarity index 100% rename from example/codes/clinical-codes-org/Urinary tract stones/phenotype_PH331_ver_662_concepts_20230719T121545.csv rename to examples/codes/clinical-codes-org/Urinary tract stones/phenotype_PH331_ver_662_concepts_20230719T121545.csv diff --git a/example/config.json b/examples/config.json similarity index 100% rename from example/config.json rename to examples/config.json diff --git a/example/config2.json b/examples/config2.json similarity index 100% rename from example/config2.json rename to examples/config2.json diff --git a/phen.py b/phen.py index 7af3ebc..ebfcc33 100644 --- a/phen.py +++ b/phen.py @@ -10,23 +10,13 @@ import git import re import requests from pathlib import Path +from urllib.parse import urlparse, urlunparse +# acmc dependencies import trud -from base import log_invalid_code -from base import bcolors -from base import raise_ -from parse import Read2_code -from parse import Read3_code -from parse import Icd10_code -from parse import Snomed_code -from parse import Opcs4_code -from parse import Atc_code -from parse import Med_code -from parse import code_types -from parse import vocab_types -from omop import OMOP_DB_PATH -from omop import publish_concept_sets -from omop import setup +from base import log_invalid_code, bcolors, raise_ +from parse import Read2_code, Read3_code, Icd10_code, Snomed_code, Opcs4_code, Atc_code, code_types, vocab_types +from omop import OMOP_DB_PATH, publish_concept_sets, setup pd.set_option("mode.chained_assignment", None) @@ -49,6 +39,26 @@ class PhenValidationException(Exception): super().__init__(message) self.validation_errors = validation_errors +def construct_git_url(remote_url): + # check the url + parsed_url = urlparse(remote_url) + + if "github.com" in parsed_url.netloc: + # get GitHub PAT from environment variable + auth = os.getenv("ACMC_GITHUB_PAT") + if not auth: + raise ValueError("GitHub PAT not found. Set the ACMC_GITHUB_PAT environment variable.") + else: + # get GitLab PAT from environment variable + auth = os.getenv("ACMC_GITLAB_PAT") + if not auth: + raise ValueError("GitLab PAT not found. Set the ACMC_GITLAB_PAT environment variable.") + auth = f"oauth2:{auth}" + + # Construct the new URL with credentials + new_netloc = f"{auth}@{parsed_url.netloc}" + return urlunparse((parsed_url.scheme, new_netloc, parsed_url.path, parsed_url.params, parsed_url.query, parsed_url.fragment)) + def init(phen_dir, remote_url): """Initial phenotype directory as git repo with standard structure""" print(f"Initialising Phenotype in directory: {phen_dir}") @@ -66,24 +76,25 @@ def init(phen_dir, remote_url): else: configure=True - # configure the phen directories + # configure phen directories if configure: repo = None - # remote then clone the repo + # if remote then clone the repo otherwise init a local repo if remote_url != None: - try: - repo = git.cmd.Git() - repo.clone(remote_url, phen_path) - repo = git.Repo(phen_path) - except Exception: - raise Exception(f"Error: remote_url for the repo {remote_url} ") + # add PAT token to the URL + git_url = construct_git_url(remote_url) + + # clone the repo + repo = git.cmd.Git() + repo.clone(git_url, phen_path) + repo = git.Repo(phen_path) else: - # local then create the directories and init + # local repo, create the directories and init phen_path.mkdir(parents=True, exist_ok=True) print(f"Phen directory '{phen_path}' has been created.") repo = git.Repo.init(phen_path) - # check if the phen path has already been configured which would be the case for remote clones + # if the phen path does not contain the config file then initialise the phen type config_path = phen_path / CONFIG_FILE if not config_path.exists(): print("Creating configuration files") @@ -541,7 +552,6 @@ def publish(phen_dir): # push to origin if a remote repo try: origin = repo.remotes.origin - print(f"Remote 'origin' exists: {origin.url}") origin.push(tags=True) print("Changes pushed to 'origin'.") except AttributeError: diff --git a/trud.py b/trud.py index a491684..cf758d2 100644 --- a/trud.py +++ b/trud.py @@ -271,6 +271,7 @@ def create_map_directories(): def install(): print(f"Installing TRUD") + # get TRUD api key from environment variable api_key = os.getenv("ACMC_TRUD_API_KEY") if not api_key: @@ -347,7 +348,5 @@ def install(): item["extract"]() print(f"Downloaded {release_ordinal} release(s) for item {item_id}.") - - - + print(f"TRUD installation completed") \ No newline at end of file -- GitLab