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

70 lines
3.0 KiB
Mathematica

MCPFTE ;WISC/TJK-PULMONARY FUNCTION TEST ENTER/EDIT ;7/9/99 10:08
;;2.3;Medicine;**25,31,35**;09/13/1996
; Reference IA #10061 for VADPT call.
DIC ; Pulmonary Function Test Enter/Edit
D MCEPROC^MCARE,DATE^MCAREH
S DIC="^MCAR(700,",DIC(0)="AEQLMZ",(DLAYGO,DIDEL,MCFILE)=700
I MCESON S DIC("S")=$$PREEDIT^MCESSCR(MCFILE)
D ^DIC K DIC,DLAYGO G EXIT:Y<0
I $D(DTOUT),'$P(Y(0),U,2) S DIK="^MCAR(700,",DA=+Y D ^DIK G EXIT
S DFN=$P(Y(0),U,2),MCARGDA=+Y
I MCESON,$$ESTONUM^MCESSCR(MCFILE,MCARGDA)>2 D ESRC^MCESSCR(MCFILE,MCARGDA) I '$D(MCBACK) G EXIT
D:$D(MCBACK) BACK
D DEM^VADPT S MCSEX=$P(VADM(5),U),MCRACE=$P(VADM(8),U,2)
N MCMRACE,MCHOLD S MCMRACE=0,MCHOLD=MCRACE,MCRACE=$$ETHN^MCPFTP1(MCHOLD,.VADM) D KVAR^VADPT
I MCRACE="" D RACEMSG^MCPFTSS
I MCRACE'="" D
.S:MCRACE["ASIAN" MCMRACE=MCMRACE+1
.S:MCRACE["BLACK" MCMRACE=MCMRACE+1
.K:MCMRACE<2 MCMRACE
S MCRACE=$S(MCRACE["ASIAN":"O",MCRACE["BLACK":"B",1:"") K:MCRACE="" MCRACE
S DIE="^MCAR(700,",DA=MCARGDA
; MFD 2-23-93 S DR=$S($G(MCBL)=1:"[MCPFTBRIEF]",1:"[MCPFTEDIT]")
S DR="["_MCEPROC_"]"
D ORDERA G EXIT:$D(DUOUT)!$D(DTOUT)
S DIE="^MCAR(700,",DA=MCARGDA
S DR="["_MCEPROC_"]"
D ^DIE,ORDER1,QTASK^MCPARAM
D ESRC^MCESSCR(MCFILE,MCARGDA)
I $D(MCMRACE) D
.I $$GET1^DIQ(700,+MCARGDA_",",38,"E")="YES"&($$GET1^DIQ(700,+MCARGDA,38.5,"E")="") D
..N MCFDA
..S MCFDA(700,+MCARGDA_",",38)=""
..D FILE^DIE("","MCFDA")
..W !!?5,"*** Patient has both race values BLACK and ASIAN. ***"
..W !?5,"*** MUST enter a value for the RACE CORRECTIONS FOR RACE TYPE field.***"
..W !?5,"*** USE RACE CORRECTIONS field will be set to NULL. ***"
..Q
.Q
EXIT ; Leave gracefully
K DIC,DIK,DA,DIE,DR,DFN,MCRACE,DIWF,MCSEX,MCARGDA,DIR,DIDEL
K MCESON,MCESKEY,MCROUT,MCARCODE,MCEBRIEF,MCEFULL,MCPBRIEF,MCPFULL,MCPRTRTN,MCBS,MCPATFLD,MCSFULL,MCSBRIEF,MCBACK
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
PVFASS ;Entry point to Associate Predicted Value Formulas
S DIC("A")="Select the SEX for which the Predicted Value will be applied: "
S DIC="^MCAR(700.1,",DIC(0)="AEQM" D ^DIC I Y<0 D EXIT Q
S DIE=DIC,DA=+Y,DR=".01;1:10;11;12:15"
D ^DIE K DIC,DIE,DLAYGO,DA,DR G PVFASS
PVFEDT ;Entry point to Enter/Edit Predicited Value Formulas
S DIC("A")="Select the Predicted Value Formula: "
S DIC(0)="AELQ",DLAYGO=700.2
S DIC=700.2,D="D" D IX^DIC I Y<0 D EXIT Q
S DIE=DIC,DA=+Y,DR=".01:9"
D ^DIE K DIC,DIE,DLAYGO,DA,DR G PVFEDT
DISP N MCX S MCX=^MCAR(700.2,+Y,0)
W ?35,"REFERENCE: ",$P(MCX,U,3)
W !,?5,"SEX: ",$S($P(MCX,U,4)="F":"Female",$P(MCX,U,4)="M":"Male",1:"")
W !,?5,"CI: ",$P(MCX,U,5),?18,"SEE: ",$P(MCX,U,6)
W !,?5,"METHOD: ",$P(MCX,U,7)
W !,?5,"DEMOGRAPHICS: ",$P(MCX,U,8)
W !,?5,"SMOKERS INCLUDED: ",$S($P(MCX,U,9)="N":"NO",$P(MCX,U,9)="Y":"YES",1:""),?30,"ALTITUDE: ",$P(MCX,U,10),! Q
BACK ;Set Y to the new record and allow the user to edit the new record
S Y=MCY,Y(0)=MCY(0),Y(0,0)=MCY(0,0),MCARGDA=+Y K MCY,DIROUT,DUOUT,DTOUT,EXIT
Q