source: FOIAVistA/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YSD40050.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1YSD40050 ;DALISC/LJA - Repoint Gen.Progress Notes data to DSM ;04/12/94 08:19 [ 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","GPN NUMBER CONVERTED"))
14 S ^YSD(627.99,"AS","GPN CONVERSION STARTED")=$H
15 QUIT
16 ;
17CHECK ;
18 S YSD4OK=1
19 QUIT:$G(^YSD(627.99,"AS","GPN CONVERSION COMPLETED"))']"" ;->
20 W !!,"Generic Progress Notes Conversion has already been completed..."
21 S YSD4OK=0
22 QUIT
23 ;
24REPOINT ; Loop thru all Generic Progress Notes entries
25 D STARTNO^YSD40052
26 I YSD4IEN'?1.N D QUIT ;->
27 . K ^YSD(627.99,"AS","GPN LAST STARTED")
28 . S ^YSD(627.99,"AS","GPN CONVERSION COMPLETED")=$H
29 ;
30 ; YSD4IEN - set in STARTNO^YSD40052
31 F S YSD4IEN=$O(^GMR(121,YSD4IEN)) QUIT:YSD4IEN'>0 D
32 . S YSD4ND=$P($G(^GMR(121,+YSD4IEN,30)),U)
33 . I $P(YSD4ND,";",2)[627.5 D RECORD
34 ;
35 ; All done...
36 S ^YSD(627.99,"AS","GPN CONVERSION COMPLETED")=$H
37 ;
38 ; Set DSM-GPN CONVERSION COMPLETION field in Parameter file
39 D NOW^%DTC
40 S $P(^YSA(602,1,"DSM"),U,2)=%
41 ;
42 QUIT
43 ;
44RECORD ; Repoint 'found' entry...
45 S YSD4CIEN=0
46 D CONVNTRY^YSD40052 ; Records "failsafe" info in DSM CONVERSION file
47 QUIT:'$G(YSD4CIEN)!('YSD4OK)!(YSD4EREP) ;->
48 ;
49 ; YSD4ND = p(1) of ^(30)... The original DSM-III-R pointer value
50 S ^YSD(627.99,+YSD4CIEN,30)=YSD4ND
51 ;
52 ; Conversion file entry made... Repoint PN data now.
53 ; YSD4IEN -- req
54 ;
55 ; Actual repointing occurs here!
56 L +^GMR(121,+YSD4IEN):60
57 ;
58 ; If not locked...
59 I '$T D QUIT ;->
60 . D NOW^%DTC
61 . D PED^YSD4E010(%,"GPN locking problem",121,30,+YSD4IEN,"",$P($G(^GMR(121,+YSD4IEN,0)),U,2))
62 . S $P(^YSD(627.99,+YSD4CIEN,0),U,2)="E",YSD4EREP=1
63 ;
64 ; Set conversion flag now...
65 S YSD4CFLG=0
66 ;
67 ; Repoint data...
68 D REP^YSD40051
69 ;
70 ; Unlock
71 L -^GMR(121,+YSD4IEN)
72 QUIT:'YSD4CFLG ;->
73 ;
74 ; Conversion complete... Update counters
75 S YSD4NC=YSD4NC+1,^YSD(627.99,"AS","GPN NUMBER CONVERTED")=+YSD4NC
76 ;
77 QUIT
78 ;
79EOR ;YSD40050 - Repoint Gen.Progress Notes data to DSM ;12/7/93 15:12
Note: See TracBrowser for help on using the repository browser.