source: WorldVistAEHR/trunk/r/MEDICINE-MC/MCARAM0A.m@ 1685

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

initial load of WorldVistAEHR

File size: 1.4 KB
RevLine 
[613]1MCARAM0A ;WASH ISC/JKL-MUSE AUTO INSTRUMENT REINIT-EXT DATE ;2/24/95 10:39
2 ;;2.3;Medicine;;09/13/1996
3 ;
4 ;
5 ;Called from ^MCARAM0
6 ;Deletes corruption of records filed with external dates
7 N MCLD,MCJ,MCNAM,MCDATE,MCIEN,MCPID,MCDT,DA,DIK
8 S MCLD=9999999
9 F I=1:1 S MCLD=$O(^MCAR(691.5,"B",MCLD)) Q:MCLD="ES"!(MCLD="") S MCNAME="",MCSSN="",MCPID="",MCDT=MCLD,MCERR="",MCTR="" D CHECK
10 ; deletes extraneous cross-reference on zero node
11 I $D(^MCAR(691.5,0,"ES")) K ^MCAR(691.5,0,"ES")
12 ; deletes extraneous cross-reference on "B" node
13 I $D(^MCAR(691.5,"B","ES")) K ^MCAR(691.5,"B","ES")
14 ; deletes extraneous cross-reference of EKG file
15 ; checks for matching cross-references of record
16 S (MCDATE,MCIEN)=0
17 F S MCDATE=$O(^MCAR(691.5,"B",MCDATE)) Q:MCDATE="" S MCIEN=0 F S MCIEN=$O(^MCAR(691.5,"B",MCDATE,MCIEN)) Q:MCIEN="" I '$D(^MCAR(691.5,MCIEN)) K ^MCAR(691.5,"B",MCDATE,MCIEN)
18 S (MCPID,MCIEN)=0
19 F S MCPID=$O(^MCAR(691.5,"C",MCPID)) Q:MCPID="" S MCIEN=0 F S MCIEN=$O(^MCAR(691.5,"C",MCPID,MCIEN)) Q:MCIEN="" I '$D(^MCAR(691.5,MCIEN)) K ^MCAR(691.5,"C",MCPID,MCIEN)
20 K MCLD,MCJ,MCNAM,MCDATE,MCIEN,MCPID,MCDT,DA,DIK
21 Q
22CHECK ;
23 S %DT="T",X=MCLD D ^%DT S MCDT=Y
24 S MCJ=0 F S MCJ=$O(^MCAR(691.5,"B",MCDT,MCJ)) Q:MCJ="" S MCIEN=MCJ,MCROOT="^MCAR(691.5," D DEL
25 S MCJ=0 F S MCJ=$O(^MCAR(700.5,"B",MCDT,MCJ)) Q:MCJ="" S MCIEN=MCJ,MCROOT="^MCAR(700.5," D DEL
26 Q
27DEL ;
28 S MCCNT=MCCNT+1
29 S DIK=MCROOT,DA=MCIEN D ^DIK
30 W:MCCNT#100=0 "."
31 Q
Note: See TracBrowser for help on using the repository browser.