I'll appreciate any help with the formula below in CR XI. Most part of the formula executes okay except for When PAYMENT_METHOD.LIST_ITEM_NAME = 'Insurance' and PATIENT_INSURANCE.BENEFITS_ID is either 1 or 2.
Any assistance will be appreciated.
Thanks.
If IsNull({PAYMENT_METHOD.LIST_ITEM_NAME}) and IsNull({PATIENT_INSURANCE.BENEFITS_ID}) and IsNull({BENEFITS.LIST_ITEM_NAME}) and IsNull({CUSTOMERS.PRIMARY_BENEFITS_ID})
Then 'Unkn'
else If ({PAYMENT_METHOD.LIST_ITEM_NAME}=trim('Insurance') and IsNull({PATIENT_INSURANCE.BENEFITS_ID}) and IsNull({BENEFITS.LIST_ITEM_NAME}) and IsNull({CUSTOMERS.PRIMARY_BENEFITS_ID}))
Then 'Unkn'
Else If {PAYMENT_METHOD.LIST_ITEM_NAME}=trim('Insurance') and {CUSTOMERS.PRIMARY_BENEFITS_ID} = 2
Then 'In/OutN'
Else If {PAYMENT_METHOD.LIST_ITEM_NAME}=trim('Insurance') and {CUSTOMERS.PRIMARY_BENEFITS_ID} = 1
Then 'In'
Else If {PAYMENT_METHOD.LIST_ITEM_NAME}=trim('Insurance') and {PATIENT_INSURANCE.BENEFITS_ID} = 2
Then 'In/OutN'
Else If {PAYMENT_METHOD.LIST_ITEM_NAME}=trim('Insurance') and {PATIENT_INSURANCE.BENEFITS_ID} = 1
Then 'In'
else If (not IsNull({PATIENT_INSURANCE.BENEFITS_ID}) and {PATIENT_INSURANCE.BENEFITS_ID}=3)
Then 'Cash'
Else If not IsNull({PAYMENT_METHOD.LIST_ITEM_NAME}) and {PAYMENT_METHOD.LIST_ITEM_NAME} like ['Cash*','Financ*','Capit*']
Then 'Cash'
Else If not IsNull({PATIENT_INSURANCE.BENEFITS_ID}) and {PATIENT_INSURANCE.BENEFITS_ID}=1
Then 'In'
Else If ({PATIENT_INSURANCE.BENEFITS_ID}=2 or {CUSTOMERS.PRIMARY_BENEFITS_ID}=2)
Then 'In/OutN'
Else If not IsNull({BENEFITS.LIST_ITEM_NAME}) and {BENEFITS.LIST_ITEM_NAME} = trim('In Network')
Then 'In'
Else If not IsNull({BENEFITS.LIST_ITEM_NAME}) and {BENEFITS.LIST_ITEM_NAME} = trim('In / Out of Network')
Then 'In/OutN'
Else If not IsNull({BENEFITS.LIST_ITEM_NAME}) and {BENEFITS.LIST_ITEM_NAME} = trim('Exclusion')
Then 'Cash'
Else If {PAYMENT_METHOD.LIST_ITEM_NAME}=trim('Insurance') and IsNull({PATIENT_INSURANCE.BENEFITS_ID}) and IsNull({BENEFITS.LIST_ITEM_NAME}) and {CUSTOMERS.PRIMARY_BENEFITS_ID} = 2
Then 'In/OutN'
Else If {PAYMENT_METHOD.LIST_ITEM_NAME}=trim('Insurance') and IsNull({PATIENT_INSURANCE.BENEFITS_ID}) and IsNull({BENEFITS.LIST_ITEM_NAME}) and {CUSTOMERS.PRIMARY_BENEFITS_ID} = 1
Then 'In'
Else If {PAYMENT_METHOD.LIST_ITEM_NAME}=trim('Insurance') and IsNull({PATIENT_INSURANCE.BENEFITS_ID}) and IsNull({BENEFITS.LIST_ITEM_NAME}) and {CUSTOMERS.PRIMARY_BENEFITS_ID} = 3
Then 'Cash'
Else If {PAYMENT_METHOD.LIST_ITEM_NAME}=trim('Insurance') and IsNull({PATIENT_INSURANCE.BENEFITS_ID}) and IsNull({BENEFITS.LIST_ITEM_NAME}) and IsNull({CUSTOMERS.PRIMARY_BENEFITS_ID})
Then 'Unkn'