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

31 lines
953 B
Mathematica

MCARED ;WISC/MLH-ENTER/EDIT CARDIAC PROCEDURES-PROCESS A NEW PROCEDURE DATE ;8/3/92 15:52
;;2.3;Medicine;;09/13/1996
;
S DIC=MCARDIC,DIC(0)="LZ",DIC("DR")=".01;1"
S DIC("S")="D:Y>0&'$P(Y,U,3) CAUTION^MCARED(MCFILE,+Y) I $P(Y,U,3)=1"
S (DLAYGO,MCFILE,DIDEL)=+$P(DIC,"(",2) D ^DIC K DIC,DLAYGO
IF $P(Y,U,3)'=1 S:(X=U)!(X="") USEREND=1 ; record didn't file
ELSE D
. S (DJDN,MCARGDA)=$P(Y,U,1),DFN=$P(Y(0),U,2) S:MCARDIC[691.8 MCARGDA1=DJDN D ORDER^MCAREO
. IF $D(DUOUT)!$D(DTOUT) S USEREND=1
. ELSE D
.. S DJSC=MCARDJSC
.. D EN4^MCARATVE,ORDER1^MCAREO,QTASK^MCPARAM
.. K DIDEL
.. I $G(MCFILE)=691.8 D EN4^MCARATVE
.. Q
. ;END IF
. ;
. Q
;END IF
;
QUIT
;
CAUTION(X,Y) ;WARN USER ON POSSIBLE DUPE ENTRY
N MCARPAT
S MCARPAT=$P(^MCAR(X,Y,0),U,2),MCARPAT=$P(^DPT(MCARPAT,0),U)
W !!,"CAUTION: POSSIBLE DUPLICATE!",*7
W !,"A procedure with this date and time is already on file",*7
W !," for ",MCARPAT,!
Q