Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: MCPFTI

MCPFTI.m

Go to the documentation of this file.
MCPFTI ;WISC/TJK-PFT INTERPRETATION ENTRY ;7/9/99  10:11
 ;;2.3;Medicine;**25,31,35**;09/13/1996
 ; Reference IA #10061 for VADPT call.
DIC ; PFT Interpretation Entry.
 D MCEPROC^MCARE
 S DIC="^MCAR(700,",DIC(0)="AEQMZ"
 I MCESON S DIC("S")=$$PREEDIT^MCESSCR(MCFILE)
 D ^DIC K DIC G EXIT:Y<0
 S DFN=$P(Y(0),U,2),MCARGDA=+Y,MCARGDT=$P(Y,U,2)
 I MCESON,$$ESTONUM^MCESSCR(MCFILE,MCARGDA)>2 D ESRC^MCESSCR(MCFILE,MCARGDA) G EXIT Q
GETORDER D ORDERA G EXIT:$D(DUOUT)!$D(DTOUT)
 D SETVAR^MCPFTP2
 S RDATE=9999999.9999-$P(^MCAR(700,MCARGDA,0),U),MCPFT0=^(0),HT=$P(MCPFT0,U,4),WT=$P(MCPFT0,U,5),X1=$E($P(MCPFT0,U,1),1,7)
 S HT=HT*2.54,WT=WT/2.2
 S:'HT HT=$P(MCPFT0,U,3) S:'WT WT=$P(MCPFT0,U,6)
 S MC17="" D DEM^VADPT S RACE=$P(VADM(8),U,2),MCSEX=$P(VADM(5),U),X2=$P(VADM(3),U) D ^%DTC
 N MCHOLD S MCHOLD=RACE,RACE=$$ETHN^MCPFTP1(MCHOLD,.VADM)
 I RACE="" D RACEMSG^MCPFTSS
 ; ---------------------
 ; AGE = the patients age at the date of the procedure
 ; ---------------------
 S AGE=X\365.25 D PRED^MCPFTP1 W:$D(MCRCN) !,MCRCN
 ;D INP^VADPT S MCARWARD=$S(VAIN(4)'="":$P(VAIN(4),U,2),1:"NOT INPATIENT"),MCARRB=VAIN(5) 
 S MCARZ="PULMONARY FUNCTION TEST" D INIT^MCARP1(MCARZ,MCARGDT,MCFILE)
 S DIR(0)="E"
 D ^DIR
 I 'Y G EXIT
I W @IOF,"***INTERPRETATION ENTRY***"
 S HEAD1="VOLUMES",MCX=0,$P(MCDOT," ",81)=""
 S MCFF="S DN=1,MCY="""" I $Y>(IOSL-3) R:$E(IOST,1,2)=""C-"" !!,""Press Return to Continue, '^' to escape: "",MCY:DTIME S:'$T MCY=U S:MCY=U MCOUT=1,DN=0 Q:$D(MCOUT)  W:DN @IOF D HEAD^MCARP D:$D(HEAD1) HEAD1^MCPFTP2,HEAD2^MCPFTP2 K MCY"
 D HEAD^MCARP,HEAD1^MCPFTP2,HEAD2^MCPFTP2 G EXIT:$D(MCOUT) D VOL^MCPFTP2 G EXIT:$D(MCOUT)
PVPRT ;
 S DIR(0)="E" D ^DIR G EXIT:'Y
 W @IOF
 D PV1^MCPFTP5 G EXIT:$D(MCOUT)
ED D ^MCPFTIC G EXIT:$D(DUOUT)!$D(DTOUT)
 S DIE="^MCAR(700,",DA=MCARGDA,DR="33.5;30;21;31;600"
 ;MFD 2/10/93 DR(2,700.05)=.01
 D ^DIE,ORDER1,QTASK^MCPARAM
 D ESRC^MCESSCR(MCFILE,MCARGDA)
 ;
 ;    Allow the user to print a PFT report now
 S DIR(0)="Y",DIR("A")="Print report now",DIR("B")="YES" ;    setup
 D ^DIR ;    ask
 I Y S TEMP=MCARGDA D ^MCPFTP1A S MCARGDA=TEMP D SUM^MCPFTP ;    yes, they want the report
 ;
EXIT D EXIT1^MCPFTP1 K A,J,F,SUB,FLD,NM,K,I,DIR,LN,DIRUT
 K DIE,MCND,DA,DR,DBZZ
 K MCAR,MCARDOB,MCARDTM,MCARHDR,MCARRB,MCARWARD,MCRHR,VADM,VAIN
 K MCARP,MCFILE,MCESON,MCESKEY,MCROUT,MCTYPE
 K MCPBRIEF,MCPFULL,MCPRTRTN,TEMP
 Q
ORDERA S MCARGNUM=$O(^MCAR(697.2,"C","MCAR(700",0)),MCFILE=700
ORDER D:'$D(MCOEON) ORDER^MCPARAM Q:'$D(MCOEON)
 Q
ORDER1 G IM:'$D(MCOEON) Q:'$D(^MCAR(MCFILE,MCARGDA))  Q:$D(DTOUT)
IM D EN1^MCMAG Q