phc-ingestion 0.10.4__py3-none-any.whl → 0.10.5__py3-none-any.whl
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.
- ingestion/nebula/constants.py +6 -0
- ingestion/nebula/manifest_assembler.py +20 -11
- {phc_ingestion-0.10.4.dist-info → phc_ingestion-0.10.5.dist-info}/METADATA +1 -1
- {phc_ingestion-0.10.4.dist-info → phc_ingestion-0.10.5.dist-info}/RECORD +5 -5
- {phc_ingestion-0.10.4.dist-info → phc_ingestion-0.10.5.dist-info}/WHEEL +0 -0
ingestion/nebula/constants.py
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
1
|
NEBULA_TEST_TYPE = "WGS-30x"
|
|
2
|
+
DATASET_SYSTEM = "http://lifeomic.com/fhir/dataset"
|
|
3
|
+
NEBULA_KIT_ID_SYSTEM = "http://lifeomic.com/fhir/nebula-kit-id"
|
|
4
|
+
BODY_SITE_SYSTEM = "http://lifeomic.com/fhir/sequence-body-site"
|
|
5
|
+
NEBULA_BODY_SITE = "Buccal Swab"
|
|
6
|
+
INDICATION_SYSTEM = "http://lifeomic.com/fhir/sequence-indication"
|
|
7
|
+
NEBULA_INDICATION = "Genetic Health Screening"
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
from typing import Optional, TypedDict, Any
|
|
2
2
|
from datetime import datetime
|
|
3
3
|
from ingestion.shared_util.lambda_client import LambdaClient
|
|
4
|
+
from ingestion.nebula.constants import (
|
|
5
|
+
DATASET_SYSTEM,
|
|
6
|
+
NEBULA_KIT_ID_SYSTEM,
|
|
7
|
+
BODY_SITE_SYSTEM,
|
|
8
|
+
INDICATION_SYSTEM,
|
|
9
|
+
NEBULA_BODY_SITE,
|
|
10
|
+
NEBULA_INDICATION,
|
|
11
|
+
)
|
|
4
12
|
|
|
5
13
|
|
|
6
14
|
class HumanName(TypedDict):
|
|
@@ -57,8 +65,8 @@ class ManifestAssembler:
|
|
|
57
65
|
def __fetch_patient_by_kit_id(self) -> Optional[Patient]:
|
|
58
66
|
path = f"/{self.account_id}/dstu3/Patient"
|
|
59
67
|
params = {
|
|
60
|
-
"_tag": f"
|
|
61
|
-
"identifier": f"
|
|
68
|
+
"_tag": f"{DATASET_SYSTEM}|{self.project_id}",
|
|
69
|
+
"identifier": f"{NEBULA_KIT_ID_SYSTEM}|{self.kit_id}",
|
|
62
70
|
}
|
|
63
71
|
|
|
64
72
|
response = self.client.invoke(path, "get", None, params)
|
|
@@ -80,7 +88,7 @@ class ManifestAssembler:
|
|
|
80
88
|
|
|
81
89
|
try:
|
|
82
90
|
return self.client.invoke(path, "get")
|
|
83
|
-
except RuntimeError
|
|
91
|
+
except RuntimeError:
|
|
84
92
|
return None
|
|
85
93
|
|
|
86
94
|
def __extract_identifier_from_resource(self, resource: Resource | None) -> str:
|
|
@@ -121,7 +129,7 @@ class ManifestAssembler:
|
|
|
121
129
|
raise RuntimeError(f"Patient with kit id {self.kit_id} not found")
|
|
122
130
|
patient_birth_date = patient.get("birthDate")
|
|
123
131
|
if not patient_birth_date:
|
|
124
|
-
raise RuntimeError(
|
|
132
|
+
raise RuntimeError("Patient birth date is a required to create a manifest")
|
|
125
133
|
|
|
126
134
|
organization: Organization | None = self.__fetch_resource_by_type_and_reference(
|
|
127
135
|
"Organization", patient.get("managingOrganization")
|
|
@@ -139,14 +147,15 @@ class ManifestAssembler:
|
|
|
139
147
|
return {
|
|
140
148
|
"name": "Nebula",
|
|
141
149
|
"indexedDate": datetime.now().strftime("%Y-%m-%d"),
|
|
142
|
-
"reference": "GRCh38",
|
|
150
|
+
"reference": "GRCh38",
|
|
151
|
+
"patientId": patient.get("id"),
|
|
143
152
|
"mrn": patient.get("id"),
|
|
144
|
-
"bodySite":
|
|
145
|
-
"bodySiteDisplay":
|
|
146
|
-
"bodySiteSystem":
|
|
147
|
-
"indicationSystem":
|
|
148
|
-
"indication":
|
|
149
|
-
"indicationDisplay":
|
|
153
|
+
"bodySite": NEBULA_BODY_SITE,
|
|
154
|
+
"bodySiteDisplay": NEBULA_BODY_SITE,
|
|
155
|
+
"bodySiteSystem": BODY_SITE_SYSTEM,
|
|
156
|
+
"indicationSystem": INDICATION_SYSTEM,
|
|
157
|
+
"indication": NEBULA_INDICATION,
|
|
158
|
+
"indicationDisplay": NEBULA_INDICATION,
|
|
150
159
|
"patientInfo": {
|
|
151
160
|
"lastName": patient_info.get("lastName"),
|
|
152
161
|
"dob": datetime.fromisoformat(patient_birth_date).strftime("%Y-%m-%d"),
|
|
@@ -27,8 +27,8 @@ ingestion/generic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
|
|
|
27
27
|
ingestion/generic/process.py,sha256=ZaVnZ_gx9faDUsuresI1A0oCegTa-dPQT7DBFMeZGyY,1777
|
|
28
28
|
ingestion/generic/utils.py,sha256=1MEIru7uq38IjUdL8lcHqDH0oTki9uWrz1f2e-pmRoU,2814
|
|
29
29
|
ingestion/nebula/__init__.py,sha256=VauK-rup_N8ZXVohx3HYqHX_PE_WoPyMUhdv2R7al4o,45
|
|
30
|
-
ingestion/nebula/constants.py,sha256=
|
|
31
|
-
ingestion/nebula/manifest_assembler.py,sha256=
|
|
30
|
+
ingestion/nebula/constants.py,sha256=thKqSwemdaAwAmKvF4FEVI9l1Ph5ergsnMlx6nWte7E,357
|
|
31
|
+
ingestion/nebula/manifest_assembler.py,sha256=sGZdeMpMT4osOBXlxY9CPZKUJSQXaShT77JJVB30I1s,5704
|
|
32
32
|
ingestion/nebula/process.py,sha256=D2ct9tF60ZIP_jZdjvgjfTkhEAkNNEhxaSqa04CtNR8,2237
|
|
33
33
|
ingestion/nextgen/__init__.py,sha256=7LQ-h_Bvc5P1QcHMdzsqi1Qm4fTJn04-ozar2ty9wSc,59
|
|
34
34
|
ingestion/nextgen/process.py,sha256=5Z0RfclwTAYZruGDiLPutjPCYFh1DJpoWY9dnttghT4,3993
|
|
@@ -59,6 +59,6 @@ ingestion/vcf_standardization/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQe
|
|
|
59
59
|
ingestion/vcf_standardization/util/af_helpers.py,sha256=dpTzoeIQVeBRt0ETF3a9rp5ojZqznHg4x_hCZ8OPcOg,1061
|
|
60
60
|
ingestion/vcf_standardization/util/dp_helpers.py,sha256=Nq8oLOLObu4_pv16qwwgpALRlUoJVCULrd9cFOD-eoI,823
|
|
61
61
|
ingestion/vcf_standardization/util/read_write.py,sha256=x3Pf6Dq8tmolblbCS5CrNmrcHS3FGfqBSFpFgvFGC4g,2526
|
|
62
|
-
phc_ingestion-0.10.
|
|
63
|
-
phc_ingestion-0.10.
|
|
64
|
-
phc_ingestion-0.10.
|
|
62
|
+
phc_ingestion-0.10.5.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
|
|
63
|
+
phc_ingestion-0.10.5.dist-info/METADATA,sha256=qf_dLgOkjhiTmAL2LjoyPJWs-38ggs82qXsc8wc66eg,677
|
|
64
|
+
phc_ingestion-0.10.5.dist-info/RECORD,,
|
|
File without changes
|