Skip to content

Commit 63e5d45

Browse files
committed
[NRL-1606] Set patient_id in report to non-included if flag is not set
1 parent 857d7be commit 63e5d45

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

reports/get_pointer_masterids_for_custodian.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,15 @@ def _get_masterids_for_custodians(table_name: str, custodians: str | tuple[str])
5656
pointer_type = item.get("type_id", {}).get("S", "no-type")
5757
master_id = item.get("master_identifier", {}).get("S", "no-master-id")
5858
custodian = item.get("custodian", {}).get("S", "no-custodian")
59+
patient_id = item.get("nhs_number", {}).get("S", "no-patient-id")
5960

6061
pointers_info.append(
6162
{
6263
"nrl-id": pointer_id,
6364
"pointer-type": pointer_type,
6465
"master_identifier": master_id,
6566
"custodian": custodian,
66-
"patient_id": item.get("nhs_number", {}).get("S", "no-patient-id"),
67+
"patient_id": patient_id if INCLUDE_PATIENT_IDS else "not-included",
6768
}
6869
)
6970

0 commit comments

Comments
 (0)