PSXBPSUT ;BIR/MFR - BPS (ECME) Utilities ;13 Mar 2002 10:31 AM
;;2.0;CMOP;**48,63,65,69,76**;11 Apr 97;Build 5
;Reference to ^PS(52.5, supported by DBIA #1978
;Reference to ^PSOSULB1 supported by DBIA #2478
;
XMIT(REC) ; Checks if the prescription will be transmitted to CMOP or not
; Input: REC - Pointer to SUSPENSE file (#52.5)
; Output: XMIT - 0 - NO / 1 - YES
N VADM,DFN,RX,PSXOK,PSXBAOK,VAPA
I '$D(^PS(52.5,REC,0)) Q 0
I $P(^PS(52.5,REC,0),"^",7)="" Q 0
S RX=$P($G(^PS(52.5,REC,0)),"^",1) I RX="" Q 0
S DFN=$$GET1^DIQ(52,RX,2,"I") D DEM^VADPT I $G(VADM(6))'="" Q 0
D ADD^VADPT I (($G(VAPA(1))="")!($G(VAPA(4))="")!($P($G(VAPA(5)),"^",2)="")!($G(VAPA(6))'>0)!($P($G(VAPA(11)),"^",2)'>0)) Q 0
I ($P(^PS(52.5,REC,0),"^",3)'=DFN) Q 0
S PSXOK=0 D CHKDATA^PSXMISC1 I PSXOK Q 0
I '$$ADDROK^PSXMISC1(RX) Q 0 ;for PSX*2*69
Q 1
;
EXCEL() ; - Returns whether to capture data for Excel report.
; Output: EXCEL = 1 - YES (capture data) / 0 - NO (DO NOT capture data)
;
N EXCEL,DIR,DIRUT,DTOUT,DUOUT,DIROUT,Y
;
S DIR(0)="Y",DIR("B")="NO",DIR("T")=DTIME W !
S DIR("A")="Do you want to capture report data for an Excel document"
S DIR("?")="^D HEXC^PSXBPSUT"
D ^DIR K DIR I $D(DIRUT)!$D(DTOUT)!$D(DUOUT)!$D(DIROUT) Q "^"
K DIROUT,DTOUT,DUOUT,DIRUT
S EXCEL=0 I Y S EXCEL=1
;
;Display Excel display message
I EXCEL=1 D EXMSG
;
Q EXCEL
;
HEXC ; - 'Do you want to capture data...' prompt
W !!," Enter: 'Y' - To capture detail report data to transfer"
W !," to an Excel document"
W !," '<CR>' - To skip this option"
W !," '^' - To quit this option"
Q
;
;Display the message about capturing to an Excel file format
;
EXMSG ;
W !!?5,"Before continuing, please set up your terminal to capture the"
W !?5,"detail report data. On some terminals, this can be done by"
W !?5,"clicking on the 'Tools' menu above, then click on 'Capture"
W !?5,"Incoming Data' to save to Desktop. This report may take a"
W !?5,"while to run."
W !!?5,"Note: To avoid undesired wrapping of the data saved to the"
W !?5," file, please enter '0;256;999' at the 'DEVICE:' prompt.",!
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSXBPSUT 2236 printed Oct 16, 2024@17:44:26 Page 2
PSXBPSUT ;BIR/MFR - BPS (ECME) Utilities ;13 Mar 2002 10:31 AM
+1 ;;2.0;CMOP;**48,63,65,69,76**;11 Apr 97;Build 5
+2 ;Reference to ^PS(52.5, supported by DBIA #1978
+3 ;Reference to ^PSOSULB1 supported by DBIA #2478
+4 ;
XMIT(REC) ; Checks if the prescription will be transmitted to CMOP or not
+1 ; Input: REC - Pointer to SUSPENSE file (#52.5)
+2 ; Output: XMIT - 0 - NO / 1 - YES
+3 NEW VADM,DFN,RX,PSXOK,PSXBAOK,VAPA
+4 IF '$DATA(^PS(52.5,REC,0))
QUIT 0
+5 IF $PIECE(^PS(52.5,REC,0),"^",7)=""
QUIT 0
+6 SET RX=$PIECE($GET(^PS(52.5,REC,0)),"^",1)
IF RX=""
QUIT 0
+7 SET DFN=$$GET1^DIQ(52,RX,2,"I")
DO DEM^VADPT
IF $GET(VADM(6))'=""
QUIT 0
+8 DO ADD^VADPT
IF (($GET(VAPA(1))="")!($GET(VAPA(4))="")!($PIECE($GET(VAPA(5)),"^",2)="")!($GET(VAPA(6))'>0)!($PIECE($GET(VAPA(11)),"^",2)'>0))
QUIT 0
+9 IF ($PIECE(^PS(52.5,REC,0),"^",3)'=DFN)
QUIT 0
+10 SET PSXOK=0
DO CHKDATA^PSXMISC1
IF PSXOK
QUIT 0
+11 ;for PSX*2*69
IF '$$ADDROK^PSXMISC1(RX)
QUIT 0
+12 QUIT 1
+13 ;
EXCEL() ; - Returns whether to capture data for Excel report.
+1 ; Output: EXCEL = 1 - YES (capture data) / 0 - NO (DO NOT capture data)
+2 ;
+3 NEW EXCEL,DIR,DIRUT,DTOUT,DUOUT,DIROUT,Y
+4 ;
+5 SET DIR(0)="Y"
SET DIR("B")="NO"
SET DIR("T")=DTIME
WRITE !
+6 SET DIR("A")="Do you want to capture report data for an Excel document"
+7 SET DIR("?")="^D HEXC^PSXBPSUT"
+8 DO ^DIR
KILL DIR
IF $DATA(DIRUT)!$DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
QUIT "^"
+9 KILL DIROUT,DTOUT,DUOUT,DIRUT
+10 SET EXCEL=0
IF Y
SET EXCEL=1
+11 ;
+12 ;Display Excel display message
+13 IF EXCEL=1
DO EXMSG
+14 ;
+15 QUIT EXCEL
+16 ;
HEXC ; - 'Do you want to capture data...' prompt
+1 WRITE !!," Enter: 'Y' - To capture detail report data to transfer"
+2 WRITE !," to an Excel document"
+3 WRITE !," '<CR>' - To skip this option"
+4 WRITE !," '^' - To quit this option"
+5 QUIT
+6 ;
+7 ;Display the message about capturing to an Excel file format
+8 ;
EXMSG ;
+1 WRITE !!?5,"Before continuing, please set up your terminal to capture the"
+2 WRITE !?5,"detail report data. On some terminals, this can be done by"
+3 WRITE !?5,"clicking on the 'Tools' menu above, then click on 'Capture"
+4 WRITE !?5,"Incoming Data' to save to Desktop. This report may take a"
+5 WRITE !?5,"while to run."
+6 WRITE !!?5,"Note: To avoid undesired wrapping of the data saved to the"
+7 WRITE !?5," file, please enter '0;256;999' at the 'DEVICE:' prompt.",!
+8 QUIT
+9 ;