source: WorldVistAEHR/trunk/r/DRG_GROUPER-ICD--ICPT/ICD1812.m@ 1504

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

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1ICD1812 ;SLC/KER - ICD Environment Check ; 04/18/2004
2 ;;18.0;DRG Grouper;**12**;Oct 20, 2000
3 ;
4 ; External References
5 ; DBIA 10141 $$PATCH^XPDUTL
6 ; DBIA 10141 BMES^XPDUTL
7 ; DBIA 10141 MES^XPDUTL
8 ;
9ENV ; Environment Check
10 N PATCHES,PATCH,BUILD,ABORT,I
11 W !," ICD GROUPER Code Text Descriptors (CTD)",! S XPDABORT="",BUILD="ICD*18.0*12" S ABORT=0
12 S ABORT=$$PATCHES S:+ABORT'>0 ABORT=$$DATA(BUILD) S:+ABORT'>0 ABORT=$$VAR D:+ABORT>0 ABRT
13 I $G(XPDABORT)="" K XPDABORT D OK
14 Q
15ABRT ; Abort - All or nothing
16 S XPDABORT=1,XPDQUIT=1,XPDQUIT("LEX*2.0*30")=1
17 S XPDQUIT("ICD*18.0*12")=1,XPDQUIT("ICPT*6.0*19")=1
18 S XPDQUIT("CTD UTIL 1.0")=1
19 Q
20OK ; Environment is Ok
21 Q:+($G(XPDENV))>0 D BM((" Environment for patch/build "_BUILD_" is ok")),M(" ")
22 Q
23 ;
24 ; Checks
25PATCHES(X) ; Check Required Patches/Components
26 Q:+($G(ABORT))>0 1 N PATCHES,I,INS
27 S PATCHES="ICD*18.0*7;ICD*18.0*11"
28 F I=1:1 Q:'$L($P($G(PATCHES),";",I)) S PATCH=$P($G(PATCHES),";",I) D Q:+($G(ABORT))>0
29 . W !," Checking for ",PATCH S INS=$$PATCH^XPDUTL(PATCH) I +INS>0 H 1 W " - installed"
30 . I 'INS D BM((" >>> "_PATCH_" is required and MUST be installed prior to this patch.")) W ! S ABORT=1
31 Q:+($G(ABORT))>0 1 Q 0
32 ;
33DATA(X) ; Check Required Data
34 Q:+($G(ABORT))>0 1 Q:+($G(XPDENV))=0 0 N BUILD,BUILDI,CPD S BUILDI=$G(^LEXM(80,0,"BUILD")),BUILD=$G(X),CPD=$$CPD
35 W !," Checking for ICD installed data" H:+CPD>0 1 W:+CPD>0 " - Installed"
36 I +CPD'>0 D
37 . I $L(BUILD),BUILD=BUILDI H 1 W " - Ready for installation"
38 . I $L(BUILD),BUILD'=BUILDI D
39 . . I '$L(BUILDI) D
40 . . . D BM(" >>> Global ^LEXM either not found or incomplete.")
41 . . . D M((" Expecting data for "_BUILD_"."))
42 . . I $L(BUILDI) D
43 . . . D BM(" >>> Global ^LEXM incorrect for this installation.")
44 . . . D M((" Expecting data for "_BUILD_", found "_BUILDI_"."))
45 . . W ! S ABORT=1
46 . I '$L(BUILD) H 1 W " - Data not required"
47 Q:+($G(ABORT))>0 1 Q 0
48 ;
49VAR(X) ; Check Variables
50 W !," Checking required environment variables"
51 D HOME^%ZIS S U="^",DT=$$DT^XLFDT Q:+($G(ABORT))>0 1
52 I (+($G(DUZ))>0)&($G(DUZ(0))="@") H 1 W " - ok"
53 I '$G(DUZ)!($G(DUZ(0))'="@") D
54 . D BM(" >>> Programming variables are not set up properly.") W ! S ABORT=1
55 Q:+($G(ABORT))>0 1 Q 0
56 ;
57CPD(X) ; Check Current Patched Data is installed
58 N INS S INS=1
59 S:'$D(^ICD9("AST"))!('$D(^ICD9("ADS")))!('$D(^ICD0("AST")))!('$D(^ICD0("ADS")))!('$D(^ICD("ADS"))) INS=0
60 S:'$D(^ICD9(1,67,"B"))!('$D(^ICD9(1,68,"B"))) INS=0 S:'$D(^ICD0(1,67,"B"))!('$D(^ICD0(1,68,"B"))) INS=0
61 S:'$D(^ICD(1,68,"B")) INS=0 S X=INS
62 Q X
63 ;
64 ; Miscellaneous
65BM(X) ; Blank Line with Message
66 D BMES^XPDUTL($G(X)) Q
67M(X) ; Message
68 D MES^XPDUTL($G(X)) Q
Note: See TracBrowser for help on using the repository browser.