source: FOIAVistA/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YSD4POS0.m@ 1713

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

initial load of FOIAVistA 6/30/08 version

File size: 4.3 KB
Line 
1YSD4POS0 ;DALISC/LJA -MH 5.01 Post-init subutility - Check DSM environment [ 07/13/94 3:03 PM ]
2 ;;5.01;MENTAL HEALTH;;Dec 30, 1994
3 ;
4DSMCK ; Check that all necessary files, etc, are in place
5 ;
6 ; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 ; Programmer, be careful!!! Do NOT-NOT use YSD4OK in subroutines!!!!
8 ; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9 ;
10 S YSD4OK=0
11 ;
12 W !!,"Performing DSM environment checks...",!!
13 ;
14 ; Has the necessary DSM3 and DSM-III-R data been installed?
15 ;
16 ; DSM3 file check...
17 S YSD4CNT3=1,YSD4NO=0
18 F S YSD4NO=$O(^DIC(627,YSD4NO)) QUIT:YSD4NO'>0!('YSD4CNT3) D
19 . S YSD40=$G(^DIC(627,+YSD4NO,0))
20 . QUIT:$P(YSD40,U,4)>0 ;-> All ok w/this entry...
21 . S YSD4CNT3=0
22 . W !,?5,"... DSM3 file missing conversion node(s)!!"
23 ;
24 ; DSM-III-R file check...
25 S YSD4CNTR=1
26 F S YSD4NO=$O(^DIC(627.5,YSD4NO)) QUIT:YSD4NO'>0!('YSD4CNTR) D
27 . S YSD40=$G(^DIC(627.5,+YSD4NO,0))
28 . QUIT:$P(YSD40,U,3)>0 ;-> All ok w/this entry...
29 . S YSD4CNTR=0
30 . W !,?5,"... DSM-III-R file missing conversion node(s)!!"
31 ;
32 ; DSM3 or DSM-III-R file check failure?
33 I 'YSD4CNT3!('YSD4CNTR) D
34 . W !!,"The DSM Conversion cannot continue! Some conversion entries are missing "
35 . W !,"from the "
36 . I 'YSD4CNT3&('YSD4CNTR) W "DSM3 (#627) and DSM-III-R (#627.5) files."
37 . I 'YSD4CNT3&(YSD4CNTR) W "DSM3 (#627) file."
38 . I YSD4CNT3&('YSD4CNTR) W "DSM-III-R (#627.5) file."
39 . W !!,"(Correct versions of these files should have been installed during the"
40 . W !,"Mental Health V. 5.01 initialization process.)"
41 . H 3
42 ;
43 ; Does Conversion file data exist?
44 S YSD4CONT=1
45 I $O(^YSD(627.99,0)),YSD4CNT3,YSD4CNTR D QUIT:'YSD4CONT ;->
46 . S YSD4CONT=0
47 . W !!,"The data in the DSM Conversion file controls the conversion of DSM3 and "
48 . W !,"DSM-III-R data. DSM Conversion file data exists on your system. You can"
49 . W !,"continue with the conversion of DSM3 and DSM-III-R data if desired, but"
50 . W !,"please note: the conversion of patient data will resume where the"
51 . W !,"previously invoked conversion process ended..."
52 . H 1
53 . W !
54 . N DIR
55 . S DIR(0)="Y",DIR("A")="OK to continue"
56 . D ^DIR
57 . QUIT:+Y'=1 ;->
58 . S YSD4CONT=1
59 ;
60 ; Check whether MH 5.01 has been installed, DSM data converted,
61 ; DSM Conversion file deleted, and site attempting to RECONVERT
62 ; already converted Medical Record (#90) file DSM data.
63 ;
64 ; (Note: Reconversion is not a problem with variable pointers.
65 ; However, the reconversion of Medical Record pointers would
66 ; create erroneous data!)
67 ;
68 ; (Bckgrd: The init installs the DSM Conversion file. The ONLY way
69 ; the IF check (see below) could be true is if the DSM
70 ; conversion of Medical Record file entries was completed,
71 ; the site parameter field tracking MR conversion completion
72 ; was set, and there was NO data in the DSM Conversion
73 ; (#627.99) file.
74 ;
75 ; No data in the DSM Conversion file means that this code
76 ; is not being executed by a call from the init to the
77 ; post-init, but is being called directly!!!
78 ;
79 ; If there WAS data in 627.99, the "LAST MR" entries
80 ; allow for safe MR conversion, as the "LAST MR" entries
81 ; would ensure that entries are not converted twice.)
82 ;
83 ; Set required variables...
84 S YSD451=1
85 S YSD4COM=$G(^YSA(602,1,"DSM")) ;The 3 DSM Completion nodes
86 ;
87 ; IF: DSM-MR CONVERSION COMPLETION="SET" & NO DSM CONVERSION DATA
88 I $P(YSD4COM,U)&('$D(^YSD(627.99))) D
89 .
90 . ; If YSD(627.99 - DSM Conversion file data exists, it's "LAST MR"
91 . ; entry should make double conversion impossible!
92 .
93 . S YSD451=0
94 . W !!,"The Medical Record (#90) file's DSM data has already been repointed, and"
95 . W !,"there is no DSM Conversion (#627.99) file data to guide the conversion"
96 . W !,"of Medical Record (#90) file entries. If conversion continued, Medical"
97 . W !,"Record (#90) file entries, which have already been repointed, would be"
98 . W !,"converted again. This would produce erroneous and serious results!!!"
99 . W !!
100 ;
101 ; Now, set YSD4OK for use by CTRL
102 S YSD4CNT3=$G(YSD4CNT3),YSD4CNTR=$G(YSD4CNTR),YSD4CONT=$G(YSD4CONT)
103 S YSD4OK=(YSD4CNT3=1&(YSD4CNTR=1)&(YSD4CONT=1)&(YSD451))
104 QUIT
105 ;
106EOR ;YSD4POS0 - MH 5.01 Post-init subutility - Check DSM environment ;4/11/94 11:40
Note: See TracBrowser for help on using the repository browser.