top of page

Develop pact_case_patient and Case History with its logic

Requirement

Requirements: 

Build pact_case_patient from case_patient and case_patient_history tables. The solution must:  

  • Apply defaulting logic (ENROLLMENT_COMPLETE) 

  • Convert datetime fields to PST/PDT 

  • Split multi-select values 


Transformation Logic: 

  • ENROLLMENT_COMPLETE_FLAG: If NULL - 'Yes' 

  • closed_reason_split: Replace {{;}} with {{,}} 

  • Datetime Conversion: UTC - PST/PDT 

  • Foundation_BI: TRUE only if Foundation_BI__c = TRUE AND RecordType = 'BI_PA' 

Final output: 

Display the result

Purgo AI Agentic Code

bottom of page