notebook
This commit is contained in:
@@ -4,6 +4,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
TOKEN_PATH = Path("token.txt")
|
TOKEN_PATH = Path("token.txt")
|
||||||
REQUEST_ID = "092a0c63-28be-4c6b-ab3b-204e1e2641d4"
|
REQUEST_ID = "092a0c63-28be-4c6b-ab3b-204e1e2641d4"
|
||||||
|
CLINIC_SLUG = "mudr-buzalkova"
|
||||||
|
|
||||||
def read_token(p: Path) -> str:
|
def read_token(p: Path) -> str:
|
||||||
tok = p.read_text(encoding="utf-8").strip()
|
tok = p.read_text(encoding="utf-8").strip()
|
||||||
@@ -14,7 +15,7 @@ def read_token(p: Path) -> str:
|
|||||||
GRAPHQL_QUERY = r"""
|
GRAPHQL_QUERY = r"""
|
||||||
query ClinicRequestDetail_GetPatientRequest2(
|
query ClinicRequestDetail_GetPatientRequest2(
|
||||||
$requestId: UUID!,
|
$requestId: UUID!,
|
||||||
$isDoctor: Boolean!
|
|
||||||
) {
|
) {
|
||||||
patientRequestMedicalRecords: listMedicalRecordsForPatientRequest(
|
patientRequestMedicalRecords: listMedicalRecordsForPatientRequest(
|
||||||
attachmentTypes: [ECRF_FILL_ATTACHMENT, MESSAGE_ATTACHMENT, PATIENT_REQUEST_ATTACHMENT]
|
attachmentTypes: [ECRF_FILL_ATTACHMENT, MESSAGE_ATTACHMENT, PATIENT_REQUEST_ATTACHMENT]
|
||||||
@@ -29,14 +30,14 @@ query ClinicRequestDetail_GetPatientRequest2(
|
|||||||
downloadUrl
|
downloadUrl
|
||||||
id
|
id
|
||||||
url
|
url
|
||||||
visibleToPatient @include(if: $isDoctor)
|
visibleToPatient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
variables = {
|
variables = {
|
||||||
"isDoctor": True,
|
|
||||||
"requestId": REQUEST_ID,
|
"requestId": REQUEST_ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,6 @@ DB_CONFIG = {
|
|||||||
GRAPHQL_QUERY = r"""
|
GRAPHQL_QUERY = r"""
|
||||||
query ClinicRequestDetail_GetPatientRequest2(
|
query ClinicRequestDetail_GetPatientRequest2(
|
||||||
$requestId: UUID!,
|
$requestId: UUID!,
|
||||||
$clinicSlug: String!,
|
|
||||||
$isDoctor: Boolean!,
|
|
||||||
$locale: Locale!
|
|
||||||
) {
|
) {
|
||||||
patientRequestMedicalRecords: listMedicalRecordsForPatientRequest(
|
patientRequestMedicalRecords: listMedicalRecordsForPatientRequest(
|
||||||
attachmentTypes: [ECRF_FILL_ATTACHMENT, MESSAGE_ATTACHMENT, PATIENT_REQUEST_ATTACHMENT]
|
attachmentTypes: [ECRF_FILL_ATTACHMENT, MESSAGE_ATTACHMENT, PATIENT_REQUEST_ATTACHMENT]
|
||||||
@@ -81,9 +78,6 @@ def download_file(url: str, out_path: Path):
|
|||||||
def fetch_attachments(headers, request_id):
|
def fetch_attachments(headers, request_id):
|
||||||
variables = {
|
variables = {
|
||||||
"requestId": request_id,
|
"requestId": request_id,
|
||||||
"clinicSlug": CLINIC_SLUG,
|
|
||||||
"isDoctor": True,
|
|
||||||
"locale": "cs",
|
|
||||||
}
|
}
|
||||||
payload = {
|
payload = {
|
||||||
"operationName": "ClinicRequestDetail_GetPatientRequest2",
|
"operationName": "ClinicRequestDetail_GetPatientRequest2",
|
||||||
|
|||||||
Reference in New Issue
Block a user