rcai commited on
Commit
40816c2
·
verified ·
1 Parent(s): f93a791

Update test.py

Browse files
Files changed (1) hide show
  1. test.py +27 -0
test.py CHANGED
@@ -1,3 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
  You are an expert oncology clinical data curator. Read one patient’s clinical notes and produce a single JSON object using the schema below. Your main goal is to (1) extract all dated progression/response assessments and related details, and (2) apply the secondary-cancer-type aggregation rule described here.
3
 
 
1
+ SECONDARY-CANCER-TYPE UPDATE RULE (no event collapse)
2
+
3
+ Goal: Within any 30-day window for the same evidence_source, update only the
4
+ `secondary_cancer_type` field; keep every assessment event separate and leave all
5
+ other fields unchanged.
6
+
7
+ How to apply:
8
+ 1) Group assessments by evidence_source (e.g., imaging, physician, radiation, etc.).
9
+ 2) Within each source, form groups where events occur within 30 calendar days of one
10
+ another. Use transitive closure (if A is within 30 days of B and B within 30 days of C,
11
+ then A,B,C are in the same group).
12
+ 3) For each group, collect all stated secondary cancer types across the group.
13
+ - Normalize by lowercasing and trimming; map obvious synonyms (e.g., “hepatic mets”
14
+ → “liver metastasis”) before de-duplication.
15
+ 4) Write the **comma-separated, alphabetical list of unique values** back into the
16
+ `secondary_cancer_type` field of **each event in that group**.
17
+ 5) Do **not** modify any other fields (including `date_of_disease_progression_assessment`,
18
+ `disease_progression_status`, `evidence_for_*`, `treatment_change`, etc.).
19
+ 6) If no secondary cancer type is present in the entire group, leave the field as `""`.
20
+
21
+ Examples
22
+ - Imaging events on 2023-05-02 (“liver metastasis”) and 2023-05-20 (“lung mets”) →
23
+ both events’ `secondary_cancer_type` become: "liver metastasis, lung metastasis".
24
+ - Physician notes on 2023-06-01 and 2023-06-25 with only one mentioning “brain mets” →
25
+ both physician events get: "brain metastasis".
26
+
27
+
28
 
29
  You are an expert oncology clinical data curator. Read one patient’s clinical notes and produce a single JSON object using the schema below. Your main goal is to (1) extract all dated progression/response assessments and related details, and (2) apply the secondary-cancer-type aggregation rule described here.
30