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

18 lines
768 B
Mathematica

MCARAM0E ;WASH ISC/JKL-MUSE AUTO INSTRUMENT REINIT-NOTED REC IN ERR ;1/31/95 11:30
;;2.3;Medicine;;09/13/1996
;
;
;Called from ^MCARAM0
;Delete automated EKGs that are marked for deletion
; and corresponding transaction records
N MCIEN,MCSTAT,MCTIEN,MCDATE,MCSSN
S (MCIEN,MCTIEN,MCDATE)=0
F S MCIEN=$O(^MCAR(691.5,MCIEN)) Q:MCIEN="B" I $D(^MCAR(691.5,MCIEN,"A")),$D(^MCAR(691.5,MCIEN,"ES")) S MCSTAT=$P(^MCAR(691.5,MCIEN,"ES"),"^",12) I MCSTAT=1 D DEL
Q
DEL ;
S MCTIEN=0
S MCSSN=^MCAR(691.5,MCIEN,.1)
S MCDATE=$P(^MCAR(691.5,MCIEN,0),"^")
F S MCTIEN=$O(^MCAR(700.5,"B",MCDATE,MCTIEN)) Q:MCTIEN="" I $P(^MCAR(700.5,MCTIEN,0),"^",3)=MCSSN S DIK="^MCAR(700.5,",DA=MCTIEN D ^DIK S DIK="^MCAR(691.5,",DA=MCIEN D ^DIK S MCCNT=MCCNT+1 W:MCCNT#100=0 "."
Q