phc-ingestion 0.10.18__tar.gz → 0.10.19__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/PKG-INFO +1 -1
- phc-ingestion-0.10.19/ingestion/shared_util/fetch_patient.py +76 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/pyproject.toml +1 -1
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/PYPI.md +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/__init__.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/caris/__init__.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/caris/process.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/caris/util/__init__.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/caris/util/cnv.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/caris/util/detect_genome_ref.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/caris/util/hla.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/caris/util/ihc.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/caris/util/interpretation.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/caris/util/json.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/caris/util/metadata.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/caris/util/specimen_details.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/caris/util/structural.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/caris/util/tests.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/caris/util/tmb.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/caris/util/tsv.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/caris/util/vcf.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/foundation/__init__.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/foundation/process.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/foundation/util/__init__.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/foundation/util/cnv.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/foundation/util/fnv.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/foundation/util/ga4gh.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/foundation/util/interpretation.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/foundation/util/vcf_etl.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/generic/__init__.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/generic/process.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/generic/utils.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nebula/__init__.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nebula/constants.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nebula/manifest_assembler.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nebula/process.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nextgen/__init__.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nextgen/process.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nextgen/util/alteration_table.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nextgen/util/interpretation.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nextgen/util/manifest_helpers.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nextgen/util/nextgen_specific_genes.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nextgen/util/pre_filter_somatic_vcf.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nextgen/util/process_cnv.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nextgen/util/process_manifest.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nextgen/util/process_structural.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nextgen/util/process_vcf.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nextgen/util/types.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/resources/GRCh37_map.csv.gz +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/resources/GRCh38_map.csv.gz +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/shared_util/__init__.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/shared_util/coords_to_genes.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/shared_util/ga4gh.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/shared_util/gene_to_coords.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/shared_util/lambda_client.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/shared_util/open_maybe_gzipped.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/shared_util/tar.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/shared_util/types.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/vcf_standardization/Variant.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/vcf_standardization/__init__.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/vcf_standardization/standardize.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/vcf_standardization/util/__init__.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/vcf_standardization/util/af_helpers.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/vcf_standardization/util/dp_helpers.py +0 -0
- {phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/vcf_standardization/util/read_write.py +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from lifeomic_logging import scoped_logger
|
|
3
|
+
from ingestion.shared_util.lambda_client import LambdaClient
|
|
4
|
+
|
|
5
|
+
# Constants
|
|
6
|
+
DATASET_SYSTEM = "http://lifeomic.com/fhir/dataset"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def fetch_patient(
|
|
10
|
+
*,
|
|
11
|
+
elation_id: str,
|
|
12
|
+
given_name: str,
|
|
13
|
+
birthdate: str,
|
|
14
|
+
project_id: str,
|
|
15
|
+
account_id: str,
|
|
16
|
+
ingestion_id: str,
|
|
17
|
+
) -> dict[str, Any] | None:
|
|
18
|
+
"""
|
|
19
|
+
Fetch a patient from the patient-service lambda using Elation ID AND given name AND
|
|
20
|
+
birthdate.
|
|
21
|
+
|
|
22
|
+
Returns:
|
|
23
|
+
The patient resource if found, None otherwise
|
|
24
|
+
|
|
25
|
+
Raises:
|
|
26
|
+
RuntimeError: When multiple patients are found (ambiguous match)
|
|
27
|
+
"""
|
|
28
|
+
log_context = {
|
|
29
|
+
"accountId": account_id,
|
|
30
|
+
"projectId": project_id,
|
|
31
|
+
"elationId": elation_id,
|
|
32
|
+
"ingestionId": ingestion_id,
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
with scoped_logger(__name__, log_context) as log:
|
|
36
|
+
# Create LambdaClient instance with proper headers
|
|
37
|
+
client = LambdaClient(
|
|
38
|
+
"patient-service",
|
|
39
|
+
{
|
|
40
|
+
"Content-Type": "application/json",
|
|
41
|
+
"LifeOmic-Account": account_id,
|
|
42
|
+
"LifeOmic-Correlation-Id": ingestion_id,
|
|
43
|
+
},
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
# Search by Elation ID AND given name AND birthdate
|
|
47
|
+
log.info(
|
|
48
|
+
f"Searching for patient with Elation ID: {elation_id}, given name: {given_name}, birthdate: {birthdate}"
|
|
49
|
+
)
|
|
50
|
+
response = client.invoke(
|
|
51
|
+
f"/{account_id}/dstu3/Patient",
|
|
52
|
+
"get",
|
|
53
|
+
None,
|
|
54
|
+
{
|
|
55
|
+
"_tag": f"{DATASET_SYSTEM}|{project_id}",
|
|
56
|
+
"identifier": elation_id,
|
|
57
|
+
"name": given_name,
|
|
58
|
+
"birthdate": birthdate,
|
|
59
|
+
},
|
|
60
|
+
)
|
|
61
|
+
entries = response.get("entry", [])
|
|
62
|
+
|
|
63
|
+
if len(entries) == 0:
|
|
64
|
+
error_msg = f"No patient found with Elation ID: {elation_id}, given name: {given_name}, birthdate: {birthdate}"
|
|
65
|
+
log.error(error_msg)
|
|
66
|
+
raise RuntimeError(error_msg)
|
|
67
|
+
|
|
68
|
+
if len(entries) > 1:
|
|
69
|
+
error_msg = f"Found multiple patients when one was expected. Found {len(entries)}. Elation ID {elation_id}, given name {given_name}, birthdate {birthdate}."
|
|
70
|
+
log.error(error_msg)
|
|
71
|
+
raise RuntimeError(error_msg)
|
|
72
|
+
|
|
73
|
+
log.info(
|
|
74
|
+
f"Found patient with Elation ID: {elation_id}, given name: {given_name}, birthdate: {birthdate}"
|
|
75
|
+
)
|
|
76
|
+
return entries[0]["resource"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nextgen/util/nextgen_specific_genes.py
RENAMED
|
File without changes
|
{phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nextgen/util/pre_filter_somatic_vcf.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/nextgen/util/process_structural.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/vcf_standardization/standardize.py
RENAMED
|
File without changes
|
{phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/vcf_standardization/util/__init__.py
RENAMED
|
File without changes
|
{phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/vcf_standardization/util/af_helpers.py
RENAMED
|
File without changes
|
{phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/vcf_standardization/util/dp_helpers.py
RENAMED
|
File without changes
|
{phc-ingestion-0.10.18 → phc-ingestion-0.10.19}/ingestion/vcf_standardization/util/read_write.py
RENAMED
|
File without changes
|