source: FOIAVistA/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YSD40040.m@ 1528

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

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1YSD40040 ;DALISC/LJA - Repoint Diag Results data to DSM ;12/10/93 09:15 [ 07/13/94 2:52 PM ]
2 ;;5.01;MENTAL HEALTH;;Dec 30, 1994
3 ;;
4 ;
5CTRL ;
6 D INIT
7 D CHECK QUIT:'YSD4OK ;->
8 D REPOINT
9 QUIT
10 ;
11INIT ;
12 S YSD4MLC=0 ; Dot-generator counter
13 S YSD4NC=+$G(^YSD(627.99,"AS","DR NUMBER CONVERTED"))
14 S ^YSD(627.99,"AS","DR CONVERSION STARTED")=$H
15 QUIT
16 ;
17CHECK ;
18 S YSD4OK=1
19 QUIT:$G(^YSD(627.99,"AS","DR CONVERSION COMPLETED"))']"" ;->
20 W !!,"Diagnostic Results Conversion has already been completed..."
21 S YSD4OK=0
22 QUIT
23 ;
24REPOINT ; Loop thru all Diagnostic Results entries
25 ;
26 D STARTNO^YSD40042
27 I YSD4IEN'?1.N D QUIT ;->
28 . K ^YSD(627.99,"AS","DR LAST STARTED")
29 . S ^YSD(627.99,"AS","DR CONVERSION COMPLETED")=$H
30 ;
31 F S YSD4IEN=$O(^YSD(627.8,YSD4IEN)) QUIT:YSD4IEN'>0 D
32 . S YSD4MLC=YSD4MLC+1 W:'(YSD4MLC#50) "."
33 . S YSD4ND=$P($G(^YSD(627.8,+YSD4IEN,1)),U)
34 . I $P(YSD4ND,";",2)[627.5 D RECORD
35 ;
36 S ^YSD(627.99,"AS","DR CONVERSION COMPLETED")=$H
37 ;
38 ; Set the DSM-DR CONVERSION COMPLETION field in Parameter file
39 D NOW^%DTC
40 S $P(^YSA(602,1,"DSM"),U,3)=%
41 ;
42 QUIT
43 ;
44RECORD ; Repoint 'found' entry...
45 S YSD4CIEN=0
46 D CONVNTRY^YSD40042
47 QUIT:'$G(YSD4CIEN)!('YSD4OK)!(YSD4EREP) ;->
48 ;
49 ; YSD4ND = p(1) of ^(1)
50 S ^YSD(627.99,+YSD4CIEN,1)=YSD4ND
51 ;
52 ; Conversion file entry now made... Repoint DR data now.
53 ; YSD4IEN -- req (Conversion reloops thru all nodes again...)
54 ;
55 ; Lock DR entry...
56 L +^YSD(627.8,+YSD4IEN):60
57 ;
58 ; Successfully locked?
59 I '$T D QUIT ;->
60 . D NOW^%DTC
61 . D PED^YSD4E010(%,"DR Locking problem",627.8,1,+YSD4IEN,"",+$P($G(^YSD(627.8,+YSD4IEN,0)),U,2))
62 . S $P(^YSD(627.99,+YSD4CIEN,0),U,2)="E",YSD4EREP=1
63 ;
64 D REP^YSD40041
65 ;
66 ; Now, unlock it...
67 L -^YSD(627.8,+YSD4IEN)
68 ;
69 QUIT:'YSD4CFLG ;->
70 ;
71 ; Update counters...
72 S YSD4NC=YSD4NC+1,^YSD(627.99,"AS","DR NUMBER CONVERTED")=+YSD4NC
73 QUIT
74 ;
75EOR ;YSD40040 - Repoint Diag Results data to DSM ;12/7/93 15:12
Note: See TracBrowser for help on using the repository browser.