VistA-WorldVistAEHR/r/MEDICINE-MC/MCPFTP.m

30 lines
1.3 KiB
Mathematica

MCPFTP ;WISC/TJK-PULMONARY FUNCTION TEST PRINT ;3/6/98 16:29
;;2.3;Medicine;**17,18**;09/13/1996
DIC ;
D MCPPROC^MCARP
S MCBP=$S($E(XQY0,3,3)="B":1,1:0)
S DIC="^MCAR(700,",DIC(0)="AEQMZ"
G:$G(MCARGDA)>0 SUM
S:MCESON DIC("S")=$$PREVIEW^MCESSCR(MCFILE)
D ^DIC K DIC G EXIT:Y<0
S MCARGDA=+Y
;
SUM ; Entry point when procedure # (MCARGDA) is already defined.
; Called by Summary of Patient Procedures, Interpretation Enter/
; Edit.
S MCARZ="PULMONARY FUNCTION TEST REPORT"
D:$G(MCESON) STATUS^MCESPRT(MCFILE,MCARGDA)
S MCPFT0=^MCAR(700,MCARGDA,0),MCFILE=700,DFN=$P(^(0),U,2)
I $D(ORHFS) U IO G PRINT ;dcm/slc added for CPRS
DEVQUE ; Device Control and Queuing Control
K IO("Q") S %ZIS="MQ" D ^%ZIS I POP G EXIT
I $D(IO("Q")) K IO("Q") S (ZTSAVE("MC*"),ZTSAVE("DFN"),ZTSAVE("DIC"))="",ZTRTN=$S($G(MCBP)=1:"^MCBPFTP1",1:"^MCPFTP1"),ZTDESC="PFT REPORT" D ^%ZTLOAD K ZTSK G EXIT
U IO
PRINT S HOSP=$P($G(^DPT(DFN,.1)),U) S:HOSP'="" HOSP=$O(^SC("B",HOSP,"")) S:HOSP'="" HOSP=$P(^SC(HOSP,0),U,15) S:HOSP'="" HOSP=$P($G(^DG(40.8,HOSP,0)),U) S PG=0
G:$G(MCBP)=1 ^MCBPFTP1 G ^MCPFTP1
EXIT K DFN,MCARGDA,MCPFT0,Y,POP
K MCAR,MCARDOB,MCARDTM,MCARHDR,MCARRB,MCARWARD,MCRHR,VADM,VAIN
K MCARP,MCFILE,MCESON,MCESKEY,MCROUT,MCTYPE,MCARGDA
K MCPBRIEF,MCPFULL,MCPRTRTN,MCBS
D ^%ZISC Q