As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I have modified a fex that creates a column (VNT_EVNT) to indicate whether a patient has been off a ventilator long enough to qualify as a separate ventilation event. Basically, if a patient is off the Vent GE 48 hours then they are on a NEW event. Otherwise, the patient is on the same event.
I am having a problem assigning a status of FINL to a patient who has come off the ventilator for reasons other than being an ORGAN DONOR. Re: A patient may also end ventilation because of mortality.
Below is the code and a sample of my output: CODE: [ DEFINE FILE HSPAT_ENC_HSP LRCDTIME/HYYMDS = LAST RECORDED_TIME; TST_LRCDTM/A20 = HCNVRT(LRCDTIME, '(HYYMDS)', 20, 'A20'); TST_RCDTM1/A20 = HCNVRT(RECORDED_TIME, '(HYYMDS)', 20, 'A20'); RCD_TIME_DIFF/D12.2 = HDIFF(RECORDED_TIME,LRCDTIME,'MINUTE','D12.2'); RCD_TIME_HRS/D12.2 = RCD_TIME_DIFF/60; VENT_FLAG/A1 = IF PAT_ID EQ LAST PAT_ID AND MEAS_VALUE EQ 'COMPLETED' AND FLO_DIS_NAME EQ 'EXTUBATION' THEN '1' ELSE '0'; -* DONR_FLAG/A1 = IF PAT_ID EQ LAST PAT_ID AND MEAS_VALUE EQ 'Withdraw-WithdrawnOrgDonor-Organ Donor' AND FLO_DIS_NAME EQ 'Reason Vent Discontinued' THEN '1' ELSE '0'; -* VENT_EVNT/A4 = IF VENT_FLAG EQ '1' AND RCD_TIME_HRS GE 48 THEN 'NEW ' ELSE IF PAT_ID NE LAST PAT_ID THEN 'NEW*' ELSE IF DONR_FLAG EQ '1' THEN 'FINL' ELSE IF PAT_ID EQ LAST PAT_ID AND VENT_FLAG EQ '1'
THEN 'FINL' ELSE 'SAME'; END -* TABLE FILE HSPAT_ENC_HSP HEADING CENTER "Test Report" "Patients Intubated" "in MICU" PRINT BILL_NUM AS 'EDP#' PAT_NAME AS 'PAT NAME' ADMISSION_PROV_ID AS 'ADMIT,DR. ' MEAS_VALUE AS 'MEAS ,VALUE' FLO_DIS_NAME AS 'FS ENTRY' RECORDED_TIME AS 'RECORD_TIME' RCD_TIME_HRS AS 'REC,TIME,HRS' VENT_FLAG AS 'VNT,FLAG' VENT_EVNT AS 'VNT,EVNT' BY PAT_ID SKIP-LINE AS 'MRNO' BY BILL_NUM NOPRINT BY RECORDED_TIME NOPRINT WHERE FLO_MEAS_ID EQ '380343' OR '380353' OR '380512' OR '380166' OR '380508' OR '380276' OR '380277' ; WHERE DEPARTMENT_NAME EQ 'MICU'; WHERE ENTRY_TIME FROM DT(&BEG1 00:00:00) TO DT(&END1 23:59:59); WHERE HOSP_ADMSN_TIME LE DT(&BEG1 00:00:00); ON TABLE PCHOLD FORMAT EXL2K END -RUN -EXIT ]
OUTPUT: [ MRNO PAT NAME MEAS VALUE FS ENTRY Recorded Time VFLG VNT EVNT 123456 Smith,Carly A Weaned Reason Vent Disc 2007/10/01 18:05:00 0 Same 123456 Smith,Carly A Completed $ Extubation 2007/10/10 18:08:00 0 Same 123456 Smith,Carly A On $ Vent Daily Charge 2007/10/11 00:14:00 0 Same 123456 Smith,Carly A On $ Vent Daily Charge 2007/10/11 05:09:00 0 Same 123456 Smith,Carly A On $ Vent Daily Charge 2007/10/11 08:52:00 0 Same 123456 Smith,Carly A On $ Vent Daily Charge 2007/10/12 08:07:00 0 Same 123456 Smith,Carly A Completed $ Extubation 2007/10/01 08:37:00 0 Same - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 654321 Taylor,Annette S Weaned Reason Vent Disc 2007/10/01 18:05:00 0 Same 654321 Taylor,Annette S Completed $ Extubation 2007/10/10 18:08:00 0 Same 654321 Taylor,Annette S On $ Vent Dly Chrge 2007/10/11 00:14:00 0 Same 654321 Taylor,Annette S On $ Vent Dly Chrge 2007/10/11 05:09:00 0 Same 654321 Taylor,Annette S On $ Vent Dly Chrge 2007/10/11 08:52:00 0 Same 654321 Taylor,Annette S On $ Vent Daily Charge 2007/10/12 08:07:00 0 Same 654321 Taylor,Annette S Completed $ Extubation 2007/10/01 08:37:00 0 Same 654321 Taylor,Annette S Withdraw-WithdrawnOrgDonor 2007/10/12 08:07:00 0 Same 654321 Taylor,Annette S On $ Vent Daily Charge 2007/10/11 08:52:00 0 FINL ]
You are correct, the data is actually stored in mixed case. Therefore, COMPLETED is actually Completed, EXTUBATION is actually Extubation, etc.
Below is the code and a sample of my output: CODE: < DEFINE FILE HSPAT_ENC_HSP LRCDTIME/HYYMDS = LAST RECORDED_TIME; TST_LRCDTM/A20 = HCNVRT(LRCDTIME, '(HYYMDS)', 20, 'A20'); TST_RCDTM1/A20 = HCNVRT(RECORDED_TIME, '(HYYMDS)', 20, 'A20'); RCD_TIME_DIFF/D12.2 = HDIFF(RECORDED_TIME,LRCDTIME,'MINUTE','D12.2'); RCD_TIME_HRS/D12.2 = RCD_TIME_DIFF/60; VENT_FLAG/A1 = IF PAT_ID EQ LAST PAT_ID AND MEAS_VALUE EQ 'Completed' AND FLO_DIS_NAME EQ 'Extubation' THEN '1' ELSE '0'; -* DONR_FLAG/A1 = IF PAT_ID EQ LAST PAT_ID AND MEAS_VALUE EQ 'Withdraw-WithdrawnOrgDonor-Organ Donor' AND FLO_DIS_NAME EQ 'Reason Vent Discontinued' THEN '1' ELSE '0'; -* VENT_EVNT/A4 = IF VENT_FLAG EQ '1' AND RCD_TIME_HRS GE 48 THEN 'NEW ' ELSE IF PAT_ID NE LAST PAT_ID THEN 'NEW*' ELSE IF DONR_FLAG EQ '1' THEN 'FINL' ELSE IF PAT_ID EQ LAST PAT_ID AND VENT_FLAG EQ '1'
THEN 'FINL' ELSE 'SAME'; END -* TABLE FILE HSPAT_ENC_HSP HEADING CENTER "Test Report" "Patients Intubated" "in MICU" PRINT BILL_NUM AS 'EDP#' PAT_NAME AS 'PAT NAME' ADMISSION_PROV_ID AS 'ADMIT,DR. ' MEAS_VALUE AS 'MEAS ,VALUE' FLO_DIS_NAME AS 'FS ENTRY' RECORDED_TIME AS 'RECORD_TIME' RCD_TIME_HRS AS 'REC,TIME,HRS' VENT_FLAG AS 'VNT,FLAG' VENT_EVNT AS 'VNT,EVNT' BY PAT_ID SKIP-LINE AS 'MRNO' BY BILL_NUM NOPRINT BY RECORDED_TIME NOPRINT WHERE FLO_MEAS_ID EQ '380343' OR '380353' OR '380512' OR '380166' OR '380508' OR '380276' OR '380277' ; WHERE DEPARTMENT_NAME EQ 'MICU'; WHERE ENTRY_TIME FROM DT(&BEG1 00:00:00) TO DT(&END1 23:59:59); WHERE HOSP_ADMSN_TIME LE DT(&BEG1 00:00:00); ON TABLE PCHOLD FORMAT EXL2K END -RUN -EXIT >
OUTPUT: < MRNO PAT NAME MEAS VALUE FS ENTRY Recorded Time VFLG VNT EVNT 123456 Smith,Carly A Weaned Reason Vent Disc 2007/10/01 18:05:00 0 Same 123456 Smith,Carly A Completed $ Extubation 2007/10/10 18:08:00 0 Same 123456 Smith,Carly A On $ Vent Daily Charge 2007/10/11 00:14:00 0 Same 123456 Smith,Carly A On $ Vent Daily Charge 2007/10/11 05:09:00 0 Same 123456 Smith,Carly A On $ Vent Daily Charge 2007/10/11 08:52:00 0 Same 123456 Smith,Carly A On $ Vent Daily Charge 2007/10/12 08:07:00 0 Same 123456 Smith,Carly A Completed $ Extubation 2007/10/01 08:37:00 0 Same - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 654321 Taylor,Annette S Weaned Reason Vent Disc 2007/10/01 18:05:00 0 Same 654321 Taylor,Annette S Completed $ Extubation 2007/10/10 18:08:00 0 Same 654321 Taylor,Annette S On $ Vent Dly Chrge 2007/10/11 00:14:00 0 Same 654321 Taylor,Annette S On $ Vent Dly Chrge 2007/10/11 05:09:00 0 Same 654321 Taylor,Annette S On $ Vent Dly Chrge 2007/10/11 08:52:00 0 Same 654321 Taylor,Annette S On $ Vent Daily Charge 2007/10/12 08:07:00 0 Same 654321 Taylor,Annette S Completed $ Extubation 2007/10/01 08:37:00 0 Same 654321 Taylor,Annette S Withdraw-WithdrawnOrgDonor 2007/10/12 08:07:00 0 Same 654321 Taylor,Annette S On $ Vent Daily Charge 2007/10/11 08:52:00 0 FINL >
You're really not helping us to help you! You say that the lower portion of your post is your "ouptut" but your table request has an "ADMIT,DR." column which doesn't appear in your "output".
Also, take note of what Jack has mentioned, put your code between [ code] and [/code] tags or use the icon marked </> so that your spacing is retained - particularly in your "output".
Also the sample input with an MFD would help as the "output" doesn't give much in the way of being able to discern the input and it's formatting!
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
For reasons of convenience for the reader and confidentiality of my employer, the fex code posted earlier included several fields EDP# ADMIT DR. REC TIME HRS which did not display in the output sample. I have elminated those fields from the code posted below.
Code:
-SET &ECHO=ALL;
-*
-MRNOEDIT -INCLUDE APPDEF
-RUN
-*
-SET &BEG1 = '20071001';
-SET &END1 = '20080930';
-*
DEFINE FILE HSPAT_ENC_HSP
LRCDTIME/HYYMDS = LAST RECORDED_TIME;
TST_LRCDTM/A20 = HCNVRT(LRCDTIME, '(HYYMDS)', 20, 'A20');
TST_RCDTM1/A20 = HCNVRT(RECORDED_TIME, '(HYYMDS)', 20, 'A20');
RCD_TIME_DIFF/D12.2 = HDIFF(RECORDED_TIME,LRCDTIME,'MINUTE','D12.2');
RCD_TIME_HRS/D12.2 = RCD_TIME_DIFF/60;
VENT_FLAG/A1 = IF PAT_ID EQ LAST PAT_ID
AND MEAS_VALUE EQ 'COMPLETED'
AND FLO_DIS_NAME EQ 'EXTUBATION' THEN '1' ELSE '0';
-*
DONR_FLAG/A1 = IF PAT_ID EQ LAST PAT_ID
AND MEAS_VALUE EQ 'Withdraw-WithdrawnOrgDonor-Organ Donor'
AND FLO_DIS_NAME EQ 'Reason Vent Discontinued' THEN '1' ELSE '0';
-*
VENT_EVNT/A4 = IF VENT_FLAG EQ '1' AND RCD_TIME_HRS GE 48 THEN 'NEW '
ELSE IF PAT_ID NE LAST PAT_ID THEN 'NEW*'
ELSE IF DONR_FLAG EQ '1' THEN 'FINL'
ELSE IF PAT_ID EQ LAST PAT_ID AND VENT_FLAG EQ '1'
THEN 'FINL'
ELSE 'SAME';
END
-*
TABLE FILE HSPAT_ENC_HSP
HEADING CENTER
"Test Report"
"Patients Intubated"
"in MICU"
PRINT
PAT_NAME AS 'PAT NAME'
MEAS_VALUE AS 'MEAS ,VALUE'
FLO_DIS_NAME AS 'FS ENTRY'
RECORDED_TIME AS 'RECORD_TIME'
VENT_FLAG AS 'VNT,FLAG'
VENT_EVNT AS 'VNT,EVNT'
BY PAT_ID SKIP-LINE AS 'MRNO'
BY BILL_NUM NOPRINT
BY RECORDED_TIME NOPRINT
WHERE FLO_MEAS_ID EQ '380343' OR '380353' OR '380512'
OR '380166' OR '380508' OR '380276'
OR '380277' ;
WHERE DEPARTMENT_NAME EQ 'MICU';
WHERE ENTRY_TIME FROM DT(&BEG1 00:00:00) TO DT(&END1 23:59:59);
WHERE HOSP_ADMSN_TIME LE DT(&BEG1 00:00:00);
ON TABLE PCHOLD FORMAT EXL2K
END
-RUN
-EXIT
NOTE: There are mulitple records for each patient because their time on the ventilator is monitored for health status and billing purposes (per the RECORDED_TIME field).
Output:
123456 Smith,Carly A Weaned Reason Vent Disc 2007/10/01 18:05:00 0 Same
123456 Smith,Carly A Completed $ Extubation 2007/10/10 18:08:00 0 Same
123456 Smith,Carly A On $ Vent Daily Charge 2007/10/11 00:14:00 0 Same
123456 Smith,Carly A On $ Vent Daily Charge 2007/10/11 05:09:00 0 Same
123456 Smith,Carly A On $ Vent Daily Charge 2007/10/11 08:52:00 0 Same
123456 Smith,Carly A On $ Vent Daily Charge 2007/10/12 08:07:00 0 Same
123456 Smith,Carly A Completed $ Extubation 2007/10/01 08:37:00 0 Same
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
654321 Taylor,Annette S Weaned Reason Vent Disc 2007/10/01 18:05:00 0 Same
654321 Taylor,Annette S Completed $ Extubation 2007/10/10 18:08:00 0 Same
654321 Taylor,Annette S On $ Vent Dly Chrge 2007/10/11 00:14:00 0 Same
654321 Taylor,Annette S On $ Vent Dly Chrge 2007/10/11 05:09:00 0 Same
654321 Taylor,Annette S On $ Vent Dly Chrge 2007/10/11 08:52:00 0 Same
654321 Taylor,Annette S On $ Vent Daily Charge 2007/10/12 08:07:00 0 Same
654321 Taylor,Annette S Completed $ Extubation 2007/10/01 08:37:00 0 Same
654321 Taylor,Annette S Withdraw-WithdrawnOrgDonor 2007/10/12 08:07:00 0 Same
654321 Taylor,Annette S On $ Vent Daily Charge 2007/10/12 08:52:00 0 FINL
VENT_FLAG/A1 = IF PAT_ID EQ LAST PAT_ID AND MEAS_VALUE EQ 'Completed' AND LAST MEAS_VALUE EQ 'Weaned' AND FLO_DIS_NAME EQ '$ Extubation' AND LAST FLO_DIS_NAME EQ 'Reason Vent Discontinued' THEN '1' ELSE IF PAT_ID EQ LAST PAT_ID AND MEAS_VALUE EQ 'Completed' AND LAST MEAS_VALUE EQ 'On' AND FLO_DIS_NAME EQ '$ Extubation' AND LAST FLO_DIS_NAME EQ '$ Vent Daily Charge' THEN '2' ELSE IF PAT_ID EQ LAST PAT_ID AND MEAS_VALUE EQ 'Completed' AND LAST MEAS_VALUE EQ 'D/Cd' AND FLO_DIS_NAME EQ '$ Extubation' AND LAST FLO_DIS_NAME EQ '$ Vent Daily Charge' THEN '3' ELSE ' '; DONR_FLAG/A1 = IF PAT_ID EQ LAST PAT_ID AND MEAS_VALUE EQ 'Withdraw-WithdrawnOrgDonor-Organ Donor' AND LAST MEAS_VALUE EQ 'Completed' AND FLO_DIS_NAME EQ 'Reason Vent Discontinued' AND LAST FLO_DIS_NAME EQ '$ Extubation' THEN '1' ELSE '0'; VENT_EVNT/A4 = IF VENT_FLAG EQ '1' AND RCD_TIME_HRS GE 48 THEN 'NEW ' ELSE IF PAT_ID NE LAST PAT_ID THEN 'NEW*' ELSE IF DONR_FLAG EQ '1' AND LAST VENT_FLAG EQ '3' THEN 'FINL' ELSE IF DONR_FLAG EQ '1' AND LAST VENT_FLAG EQ '2' THEN 'FINL' ELSE IF VENT_FLAG EQ '2' AND DONR_FLAG EQ '0' THEN 'FINL' ELSE ''; END -*
TABLE FILE HSPAT_ENC_HSP HEADING CENTER "Test Report" "Patients Intubated" "in MICU" -* PRINT BILL_NUM PAT_NAME ADMISSION_PROV_ID MEAS_VALUE FLO_DIS_NAME RECORDED_TIME RCD_TIME_HRS VENT_FLAG DONR_FLAG VENT_EVNT BY PAT_ID BY BILL_NUM NOPRINT BY RECORDED_TIME NOPRINT -* PAT_ID SUBHEAD -*WHERE FLO_MEAS_ID EQ '380343' OR '380353' OR '380512' OR '380166' OR '380508' OR '380276' OR '380277' ; WHERE DEPARTMENT_NAME EQ 'MICU'; WHERE ENTRY_TIME FROM DT(&BEG1 00:00:00) TO DT(&END1 23:59:59); WHERE HOSP_ADMSN_TIME LE DT(&BEG1 00:00:00); ON TABLE HOLD AS TUBES END
Again, you'r enot really helping us to help you. There are still columns in your report that do not exist in your output, meaning that we have no hope of discerning your input. If you want us to help you then we need sample input. We are not asking for confidential or sensitive data - any old data will do providing it follows the format of your input so that we can try and identify a possible way forward for you.
For instance, supply some sample code that allows us to build your sample input data such as this -
With all the holiday work gatherings, I am sorry
I have not been able to get to this posting.
Below I have posted the data (VERY generic sample) I am working with:
REC #1
3567 Jane 1C1 1C2 1C3 1C4 1DATE
1C21 1C22 1C32 1C42 1DATE2
1C31 1C32 1C33 1C33 1DATE3
1C41 1C42 1C43 1C44 1DATE4
REC #2
8876 Mark 2C1 2C2 2C3 2C4 2DATE
2C11 2C12 2C32 2C42 2DATE1
2C31 2C32 2C33 2C43 2DATE2
2C41 2C42 2C43 2C44 2DATE3
REC #2
8876 Ralph 3C1 3C2 3C3 3C4 3DATE
3C21 3C22 3C32 3C24 3DATE1
3C31 3C32 3C33 3C34 3DATE2
3C41 3C42 3C43 3C44 3DATE3
3C51 3C52 3C53 3C54 3DATE4
Bascially, I am struggling to create a report
which will print all the first and last rows of the data
I am trying to create a report like this
3567 Jane X X X X 1DATE 1DATE4
8876 Mark Y Y Y Y 2DATE 2DATE4
5751 Ralph Z Z Z Z 3DATE 3DATE4
Thanks!