Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 11-test-fix-tests-to-handle-licensed-data-resources-from-trud-snd-omop
  • 61-feature-add-optional-backwards-mapping-for-consistency-with-older-version
  • dev
  • general
  • main
  • old-main
  • pypi
  • v0.0.3
8 results

Target

Select target project
  • meldb/concepts-processing
1 result
Select Git revision
  • 11-test-fix-tests-to-handle-licensed-data-resources-from-trud-snd-omop
  • 61-feature-add-optional-backwards-mapping-for-consistency-with-older-version
  • dev
  • general
  • main
  • old-main
  • pypi
  • v0.0.3
8 results
Show changes
Commits on Source (18)
......@@ -58,7 +58,7 @@ def _phen_validate(args: argparse.Namespace):
def _phen_map(args: argparse.Namespace):
"""Handle the `phen map` command."""
phen.map(args.phen_dir, args.target_coding)
phen.map(args.phen_dir, args.target_coding, args.not_translate, args.no_metadata)
def _phen_export(args: argparse.Namespace):
......@@ -78,7 +78,7 @@ def _phen_copy(args: argparse.Namespace):
def _phen_diff(args: argparse.Namespace):
"""Handle the `phen diff` command."""
phen.diff(args.phen_dir, args.version, args.old_phen_dir, args.old_version)
phen.diff(args.phen_dir, args.version, args.old_phen_dir, args.old_version, args.not_check_config)
def main():
......@@ -217,6 +217,18 @@ def main():
choices=parse.SUPPORTED_CODE_TYPES,
help=f"Specify the target coding {parse.SUPPORTED_CODE_TYPES}",
)
phen_map_parser.add_argument(
"--not-translate",
action='store_true',
default=False,
help="(Optional) Prevent any phenotype translation using NHS TRUD vocabularies.",
)
phen_map_parser.add_argument(
"--no-metadata",
action='store_true',
default=False,
help="(Optional) Prevent copying of metadata columns to output.",
)
phen_map_parser.set_defaults(func=_phen_map)
# phen export
......@@ -323,6 +335,12 @@ def main():
required=True,
help="Old phenotype version to compare with the changed version",
)
phen_diff_parser.add_argument(
"--not-check-config",
action='store_true',
default=False,
help="(Optional) Prevent loading and comparing config file, in the case where one does not exist",
)
phen_diff_parser.set_defaults(func=_phen_diff)
# Parse arguments
......
......@@ -192,7 +192,7 @@ class Read2(Proto):
class Read3(Proto):
def __init__(self):
super().__init__("Read3", trud.PROCESSED_PATH / "read3.parquet")
super().__init__("read3", trud.PROCESSED_PATH / "read3.parquet")
self.checks = [
(
......@@ -231,7 +231,7 @@ class Read3(Proto):
f"QA Alphanumeric Dot",
codes=codes,
codes_file=codes_file,
check_regex=codes.str.match(r"^[a-zA-Z0-9.]+$"),
mask=None,
code_type=self.name,
)
)
......@@ -246,7 +246,7 @@ class Read3(Proto):
f"QA In Database",
codes=codes,
codes_file=codes_file,
check_regex=self.in_database(codes, self.db, self.name),
mask=None,
code_type=self.name,
)
)
......
This diff is collapsed.
......@@ -760,7 +760,7 @@
<section id="SUPPORTED_CODE_TYPES">
<div class="attr variable">
<span class="name">SUPPORTED_CODE_TYPES</span> =
<span class="default_value">{&#39;opcs4&#39;, &#39;icd10&#39;, &#39;atc&#39;, &#39;snomed&#39;, &#39;read2&#39;, &#39;read3&#39;}</span>
<span class="default_value">{&#39;atc&#39;, &#39;read2&#39;, &#39;read3&#39;, &#39;opcs4&#39;, &#39;snomed&#39;, &#39;icd10&#39;}</span>
</div>
......
This diff is collapsed.
This diff is collapsed.
......@@ -111,6 +111,9 @@ The `phen` command is used phenotype-related operations.
- `-t`, `--target-coding`: (Optional) Specify the target coding (e.g., `read2`, `read3`, `icd10`, `snomed`, `opcs4`).
- `-d`, `--phen-dir`: (Optional) Local phenotype workspace directory (default is ./workspace/phen).
- `--not-translate`: (Optional) Prevent any phenotype translation using NHS TRUD vocabularies. Therefore only concepts in already in the traget coding will be mapped.
- `--no-metadata`: (Optional) Prevent copying of metadata columns to output.
- **Publish Phenotype Configuration**
......
......@@ -8,9 +8,8 @@ phenotype:
- "read2"
- "read3"
concept_sets:
- name: "ABDO_PAIN"
file:
path: "clinical-codes-org/Symptom code lists/Abdominal pain/res176-abdominal-pain.csv"
- name: "ABDO_PAIN"
files:
- path: "clinical-codes-org/Symptom code lists/Abdominal pain/res176-abdominal-pain.csv"
columns:
read2: "code"
......@@ -8,13 +8,13 @@ phenotype:
- "read2"
- "read3"
concept_sets:
- name: "CVD_EVENTS"
file:
path: "clinical-codes-org/Cardiovascular events (ICD10)/res52-cardiovascular-events-icd10.csv"
- name: "CVD_EVENTS"
files:
- path: "clinical-codes-org/Cardiovascular events (ICD10)/res52-cardiovascular-events-icd10.csv"
columns:
icd10: "code"
- name: "DID_NOT_ATTEND"
file:
path: "clinical-codes-org/Non-attendance codes/res201-did-not-attend-appointment.csv"
icd10: "code"
- name: "DID_NOT_ATTEND"
files:
- path: "clinical-codes-org/Non-attendance codes/res201-did-not-attend-appointment.csv"
columns:
read2: "code"
\ No newline at end of file
......@@ -10,29 +10,29 @@ phenotype:
- "snomed"
concept_sets:
- name: "CVD_EVENTS"
file:
path: "clinical-codes-org/Cardiovascular events (ICD10)/res52-cardiovascular-events-icd10.csv"
columns:
icd10: "code"
files:
- path: "clinical-codes-org/Cardiovascular events (ICD10)/res52-cardiovascular-events-icd10.csv"
columns:
icd10: "code"
- name: "DID_NOT_ATTEND"
file:
path: "clinical-codes-org/Non-attendance codes/res201-did-not-attend-appointment.csv"
columns:
read2: "code"
files:
- path: "clinical-codes-org/Non-attendance codes/res201-did-not-attend-appointment.csv"
columns:
read2: "code"
- name: "HYPERTENSION"
file:
path: "hanlon/Read_codes_for_diagnoses.csv"
columns:
read2: "Read Code"
category: "2"
actions:
divide_col: "MMCode"
files:
- path: "hanlon/Read_codes_for_diagnoses.csv"
columns:
read2: "Read Code"
category: "2"
actions:
divide_col: "MMCode"
- name: "DEPRESSION"
file:
path: "hanlon/Read_codes_for_diagnoses.csv"
columns:
read2: "Read Code"
category: "3"
actions:
divide_col: "MMCode"
files:
- path: "hanlon/Read_codes_for_diagnoses.csv"
columns:
read2: "Read Code"
category: "3"
actions:
divide_col: "MMCode"
......@@ -128,26 +128,6 @@ def test_phen_workflow(tmp_dir, monkeypatch, caplog, config_file):
main.main()
assert "Phenotype published successfully" in caplog.text
# copy phenotype'
with caplog.at_level(logging.DEBUG):
monkeypatch.setattr(
sys,
"argv",
[
"main.py",
"phen",
"copy",
"-d",
str(phen_path.resolve()),
"-td",
str(tmp_dir.resolve()),
"-v",
"0.0.1",
],
)
main.main()
assert "Phenotype copied successfully" in caplog.text
# diff phenotype
with caplog.at_level(logging.DEBUG):
old_path = tmp_dir / "0.0.1"
......