Home » Developer & Programmer » Forms » Check box
Check box [message #614098] |
Fri, 16 May 2014 05:43 |
![](http://www.gravatar.com/avatar/a59247482a11edb9544247f102223e8d?s=64&d=mm&r=g) |
mist598
Messages: 1195 Registered: February 2013 Location: Hyderabad
|
Senior Member |
|
|
Hi all ,
i have two blocks
1- the patients' data
2- doctors' data and a check box
what i want is ,
when i check the check box , i see the patients of this doctor in the other block ,
but the problem is that i have a pre-query trigger sets the "query data source name" to some query ,
so if i write my query into the "when-checkbox-changed" trigger , it will not execute because of the query in the pre-query trigger ?
what can i do to avoid the pre-query trigger ?
- the pre-query trigger has IF statements , and based on each IF statement , it changes the "query data source name" .??
The situation is , i have this code in "pre-query" trigger on the "ALL_ADMITTED_PATIENT" block .
begin
IF :PATIENT_SEARCH.PATIENT_NAME IS NOT NULL AND :PATIENT_SEARCH.PATIENT_FILE_NO IS NULL THEN
SET_BLOCK_PROPERTY('ALL_ADMITTED_PATIENT',QUERY_DATA_SOURCE_NAME,
'(SELECT PM.PATIENT_FILE_NO,
PE.EPISODE_NO,
DECODE(CURRENT_LANG_P_S,''P'', PATIENT_NAME_P ||'' ''||PATIENT_NAME_2_P||'' ''||
PATIENT_NAME_3_P||'' ''||PATIENT_NAME_F_P,
PATIENT_NAME_S ||'' ''||PATIENT_NAME_2_S||'' ''||
PATIENT_NAME_3_S||'' ''||PATIENT_NAME_F_S ) PATIENT_NAME ,
EXSYS.GET_AGE(PM.DATE_OF_BIRTH,SYSDATE) AGE ,
CODES_PKG.GET_DESCRIPTION(PM.GENDER,103) GENDER,
CODES_PKG.GET_DESCRIPTION(PM.PATIENT_CATEGORY,110) PATIENT_CATEGORY,
PE.ATTENDANCE_TYPE ,
PE.START_DATE ,
NVL(PE.ACTUAL_END_DATE,PE.END_DATE)END_DATE
FROM RC_PATIENTS PM,
RC_PATIENT_EPISODES PE,
AD_PATIENT_ADMISSIONS PA
WHERE PM.PATIENT_FILE_NO =PE.PATIENT_FILE_NO
AND PE.ADMISSION_NO =PA.ADMISSION_NO
AND PE.STATUS != ''C''
AND DECODE(CURRENT_LANG_P_S,''P'', PM.PATIENT_NAME_P ||'' ''||PM.PATIENT_NAME_2_P||'' ''||
PM.PATIENT_NAME_3_P||'' ''||PM.PATIENT_NAME_F_P,
PM.PATIENT_NAME_S ||'' ''||PM.PATIENT_NAME_2_S||'' ''||
PM.PATIENT_NAME_3_S||'' ''||PM.PATIENT_NAME_F_S )
LIKE '''||'%'||REPLACE(:PATIENT_SEARCH.PATIENT_NAME,' ','%')||'%'||'''
AND PA.CLINICAL_DISCHARGE_DATE IS NULL
AND PE.PRIMARY_ELIGIBILITY =''Y''
AND PE.ATTENDANCE_TYPE in (''I'',''D'')
and '''||:SEARCH.DOCTOR_ID||'''
IN (SELECT RCST1.STAFF_ID
FROM RC_CLINICAL_TEAMS RCTE,
RC_CLINICAL_TEAM_STAFF RCST,
RC_CLINICAL_TEAM_STAFF RCST1
WHERE RCTE.CLINICAL_TEAM_ID =RCST.CLINICAL_TEAM_ID
AND RCTE.CLINICAL_TEAM_ID =RCST1.CLINICAL_TEAM_ID
AND RCTE.WARD_ALLOCATION =''Y''
AND RCST.STAFF_ID =PE.DOCTOR_ID
AND trunc(PE.start_date) BETWEEN RCTE.APPLIES_START AND nvl(RCTE.APPLIES_END,trunc(PE.start_date))
AND trunc(PE.start_date) BETWEEN RCST.APPLIES_START AND nvl(RCST.APPLIES_END,trunc(PE.start_date))))'
) ;
ELSE
SET_BLOCK_PROPERTY('ALL_ADMITTED_PATIENT',QUERY_DATA_SOURCE_NAME,
'(SELECT PM.PATIENT_FILE_NO,
PE.EPISODE_NO,
DECODE(CURRENT_LANG_P_S,''P'', PATIENT_NAME_P ||'' ''||PATIENT_NAME_2_P||'' ''||
PATIENT_NAME_3_P||'' ''||PATIENT_NAME_F_P,
PATIENT_NAME_S ||'' ''||PATIENT_NAME_2_S||'' ''||
PATIENT_NAME_3_S||'' ''||PATIENT_NAME_F_S ) PATIENT_NAME ,
EXSYS.GET_AGE(PM.DATE_OF_BIRTH,SYSDATE) AGE ,
CODES_PKG.GET_DESCRIPTION(PM.GENDER,103) GENDER,
CODES_PKG.GET_DESCRIPTION(PM.PATIENT_CATEGORY,110) PATIENT_CATEGORY,
PE.ATTENDANCE_TYPE ,
PE.START_DATE ,
NVL(PE.ACTUAL_END_DATE,PE.END_DATE)END_DATE
FROM RC_PATIENTS PM,
RC_PATIENT_EPISODES PE,
AD_PATIENT_ADMISSIONS PA
WHERE PM.PATIENT_FILE_NO =PE.PATIENT_FILE_NO
AND PE.ADMISSION_NO =PA.ADMISSION_NO
AND PE.STATUS != ''C''
AND PM.PATIENT_FILE_NO =NVL('''||:PATIENT_SEARCH.PATIENT_FILE_NO||''',PM.PATIENT_FILE_NO)
AND PA.CLINICAL_DISCHARGE_DATE IS NULL
AND PE.PRIMARY_ELIGIBILITY =''Y''
AND PE.ATTENDANCE_TYPE in (''I'',''D'')
and '''||:SEARCH.DOCTOR_ID||'''
IN (SELECT RCST1.STAFF_ID
FROM RC_CLINICAL_TEAMS RCTE,
RC_CLINICAL_TEAM_STAFF RCST,
RC_CLINICAL_TEAM_STAFF RCST1
WHERE RCTE.CLINICAL_TEAM_ID =RCST.CLINICAL_TEAM_ID
AND RCTE.CLINICAL_TEAM_ID =RCST1.CLINICAL_TEAM_ID
AND RCTE.WARD_ALLOCATION =''Y''
AND RCST.STAFF_ID =PE.DOCTOR_ID
AND trunc(PE.start_date) BETWEEN RCTE.APPLIES_START AND nvl(RCTE.APPLIES_END,trunc(PE.start_date))
AND trunc(PE.start_date) BETWEEN RCST.APPLIES_START AND nvl(RCST.APPLIES_END,trunc(PE.start_date))))'
);
END IF ;
END;
in the other block , i have "doctors" and check box beside each doctor ,
i want , when i check beside a doctor name , the "Query data source name" is changed to specific query , and the data is retrieved in the "all_admitted_patient" block .
- if i use "when-checkbox-changed" to change the "query data source" , it will not work because of the "pre-query" on the "all_admitted_patient" .
how to deal with such situation ?
Thanks
|
|
|
Goto Forum:
Current Time: Mon Sep 09 08:50:24 CDT 2024
|