source: WorldVistAEHR/trunk/r/MEDICINE-MC/MCPFTI.m@ 1789

Last change on this file since 1789 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.5 KB
Line 
1MCPFTI ;WISC/TJK-PFT INTERPRETATION ENTRY ;7/9/99 10:11
2 ;;2.3;Medicine;**25,31,35**;09/13/1996
3 ; Reference IA #10061 for VADPT call.
4DIC ; PFT Interpretation Entry.
5 D MCEPROC^MCARE
6 S DIC="^MCAR(700,",DIC(0)="AEQMZ"
7 I MCESON S DIC("S")=$$PREEDIT^MCESSCR(MCFILE)
8 D ^DIC K DIC G EXIT:Y<0
9 S DFN=$P(Y(0),U,2),MCARGDA=+Y,MCARGDT=$P(Y,U,2)
10 I MCESON,$$ESTONUM^MCESSCR(MCFILE,MCARGDA)>2 D ESRC^MCESSCR(MCFILE,MCARGDA) G EXIT Q
11GETORDER D ORDERA G EXIT:$D(DUOUT)!$D(DTOUT)
12 D SETVAR^MCPFTP2
13 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)
14 S HT=HT*2.54,WT=WT/2.2
15 S:'HT HT=$P(MCPFT0,U,3) S:'WT WT=$P(MCPFT0,U,6)
16 S MC17="" D DEM^VADPT S RACE=$P(VADM(8),U,2),MCSEX=$P(VADM(5),U),X2=$P(VADM(3),U) D ^%DTC
17 N MCHOLD S MCHOLD=RACE,RACE=$$ETHN^MCPFTP1(MCHOLD,.VADM)
18 I RACE="" D RACEMSG^MCPFTSS
19 ; ---------------------
20 ; AGE = the patients age at the date of the procedure
21 ; ---------------------
22 S AGE=X\365.25 D PRED^MCPFTP1 W:$D(MCRCN) !,MCRCN
23 ;D INP^VADPT S MCARWARD=$S(VAIN(4)'="":$P(VAIN(4),U,2),1:"NOT INPATIENT"),MCARRB=VAIN(5)
24 S MCARZ="PULMONARY FUNCTION TEST" D INIT^MCARP1(MCARZ,MCARGDT,MCFILE)
25 S DIR(0)="E"
26 D ^DIR
27 I 'Y G EXIT
28I W @IOF,"***INTERPRETATION ENTRY***"
29 S HEAD1="VOLUMES",MCX=0,$P(MCDOT," ",81)=""
30 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"
31 D HEAD^MCARP,HEAD1^MCPFTP2,HEAD2^MCPFTP2 G EXIT:$D(MCOUT) D VOL^MCPFTP2 G EXIT:$D(MCOUT)
32PVPRT ;
33 S DIR(0)="E" D ^DIR G EXIT:'Y
34 W @IOF
35 D PV1^MCPFTP5 G EXIT:$D(MCOUT)
36ED D ^MCPFTIC G EXIT:$D(DUOUT)!$D(DTOUT)
37 S DIE="^MCAR(700,",DA=MCARGDA,DR="33.5;30;21;31;600"
38 ;MFD 2/10/93 DR(2,700.05)=.01
39 D ^DIE,ORDER1,QTASK^MCPARAM
40 D ESRC^MCESSCR(MCFILE,MCARGDA)
41 ;
42 ; Allow the user to print a PFT report now
43 S DIR(0)="Y",DIR("A")="Print report now",DIR("B")="YES" ; setup
44 D ^DIR ; ask
45 I Y S TEMP=MCARGDA D ^MCPFTP1A S MCARGDA=TEMP D SUM^MCPFTP ; yes, they want the report
46 ;
47EXIT D EXIT1^MCPFTP1 K A,J,F,SUB,FLD,NM,K,I,DIR,LN,DIRUT
48 K DIE,MCND,DA,DR,DBZZ
49 K MCAR,MCARDOB,MCARDTM,MCARHDR,MCARRB,MCARWARD,MCRHR,VADM,VAIN
50 K MCARP,MCFILE,MCESON,MCESKEY,MCROUT,MCTYPE
51 K MCPBRIEF,MCPFULL,MCPRTRTN,TEMP
52 Q
53ORDERA S MCARGNUM=$O(^MCAR(697.2,"C","MCAR(700",0)),MCFILE=700
54ORDER D:'$D(MCOEON) ORDER^MCPARAM Q:'$D(MCOEON)
55 Q
56ORDER1 G IM:'$D(MCOEON) Q:'$D(^MCAR(MCFILE,MCARGDA)) Q:$D(DTOUT)
57IM D EN1^MCMAG Q
Note: See TracBrowser for help on using the repository browser.