source: WorldVistAEHR/trunk/r/AUTOMATED_INFO_COLLECTION_SYS-IBD/IBD3KPT.m@ 862

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

initial load of WorldVistAEHR

File size: 6.4 KB
RevLine 
[613]1IBD3KPT ;ALB/MAF - Post Init routine for AICS v 3.0 - 11 NOV 96
2 ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
3 ;
4 D ADDNAR,GARBAGE,SCDATA,AUTOINS,LEX,FORMSPEC,RECOMP,ICD9,SELEX,DELFLD,RESOURC,ACTIVAT,OPTRF
5 Q
6 ;
7ADDNAR ; -- Sets fields .17 ASK FOR ADDITIONAL NARRATIVE and
8 ; .18 ASK FOR CLINICAL LEXICON to 1 'YES'.
9 N IBDIFN,IBI
10 S IBDIFN=$O(^IBE(357.6,"B","DG SELECT ICD-9 DIAGNOSIS CODE",0)) I $G(^IBE(357.6,IBDIFN,0))]"" D
11 .S DIE="^IBE(357.6,",DA=IBDIFN F IBI=.17,.18 S DR=IBI_"////^S X=1" D ^DIE
12 .K DIE,DA,DR
13 Q
14 ;
15GARBAGE ; -- Changing the name of the GARBAGE form to WORKCOPY
16 N IBDIFN
17 I $D(^IBE(357,"B","GARBAGE")) D
18 .S IBDIFN=$O(^IBE(357,"B","GARBAGE",0)) I $G(^IBE(357,IBDIFN,0))]"" D
19 ..S DIE="^IBE(357,",DA=IBDIFN S DR=".01///WORKCOPY" D ^DIE
20 ..K DIE,DA,DR
21 ..Q
22 Q
23SELEX ; -- Correct selector for PX INPUT EXAMS
24 N IBDIFN
25 S IBDIFN=$O(^IBE(357.6,"B","PX INPUT EXAMS",0))
26 Q:$G(^IBE(357.6,IBDIFN,0))=""
27 I $G(^IBE(357.6,IBDIFN,17))'="D SLCTEX^IBDFN12(.X)" S ^IBE(357.6,IBDIFN,17)="D SLCTEX^IBDFN12(.X)"
28 Q
29 ;
30SCDATA ; -- changes PI for SC data fields (did not work as originally defined)
31 N IBDIFN,VAR,IBDIFN1
32 S IBDIFN=$O(^IBE(357.6,"B","PX INPUT VISIT CLASSIFICATION",0)) I $G(^IBE(357.6,IBDIFN,0))]"" D
33 .S VAR="S X=$$VARVAL^IBDFN9(Y)"
34 .S DIE="^IBE(357.6,",DA=IBDIFN,DR="20////1;21////^S X=VAR"
35 .D ^DIE K DIE,DA,DR
36 .S IBDIFN1=0 F S IBDIFN1=$O(^IBE(357.6,IBDIFN,13,IBDIFN1)) Q:'IBDIFN1 D
37 ..S DIE="^IBE(357.6,IBDIFN,13,",DA(1)=IBDIFN,DA=IBDIFN1,DR=".03////0;.08////@"
38 ..D ^DIE K DIE,DA,DR
39 ; -- loop through 357.93 and add ID for each classification
40 N IBDIFN1,IBDIFN2,VAL,NODE
41 S IBDIFN1=0 F S IBDIFN1=$O(^IBE(357.93,IBDIFN1)) Q:'IBDIFN1 I $P($G(^IBE(357.93,IBDIFN1,0)),"^",6)=IBDIFN D
42 .S IBDIFN2=0 F S IBDIFN2=$O(^IBE(357.93,IBDIFN1,1,IBDIFN2)) Q:'IBDIFN2 D
43 ..S NODE=$G(^IBE(357.93,IBDIFN1,1,IBDIFN2,0)) Q:NODE']""
44 ..Q:$P(NODE,"^",8)'=""
45 ..S VAL=$P(NODE,"^",5)
46 ..S DIE="^IBE(357.93,IBDIFN1,1,",DA(1)=IBDIFN1,DA=IBDIFN2,DR=".08////^S X=VAL"
47 ..D ^DIE K DIE,DA,DR
48 ..Q
49 Q
50 ;
51AUTOINS ; -- auto install tool kit into production
52 N FORM,NEWFORM,FORMNM,CNT,CNT1,ARY,NAME,X,Y,NEWBLOCK,A,EXCLUDE,BLK,CNTF,CNTB
53 D MES^XPDUTL(">>> Now Attempting to automatically update Tool Kit forms and Tool Kit Blocks.")
54 S (CNTB,CNTF)=0
55 ;
56 ; -- add all tool kit blocks
57 S FORMNM="TOOL KIT"
58 I '$O(^IBE(357,"B",FORMNM,0)) G FRM
59 S ORD="" F S ORD=$O(^IBE(358.1,"D",ORD)) Q:ORD="" S BLK=0 F S BLK=$O(^IBE(358.1,"D",ORD,BLK)) Q:'BLK D
60 .S NAME=$P($G(^IBE(358.1,+BLK,0)),"^")
61 .Q:$P($G(^IBE(358.1,BLK,0)),"^",14)'=1 ;not toolkit
62 .Q:$O(^IBE(357.1,"B",NAME,0)) ;already installed
63 .D MES^XPDUTL(" Moving Block '"_$P($G(^IBE(358.1,+BLK,0)),"^")_"' from import/export to Tool Kit")
64 .N IBTKBLK S IBTKBLK=1
65 .S NEWBLOCK=$$COPYBLK^IBDFU2(BLK,$$TKFORM^IBDFU2C,358.1,357.1,"","",$$TKORDER^IBDF13),CNTB=CNTB+1
66 .D:$G(NEWBLOCK) DLTBLK^IBDFU3(BLK,"",358.1)
67 ;
68FRM ; -- Add tool kit forms
69 F CNT=1:1 S FORMNM=$P($T(FORMS+CNT),";;",2,99) Q:FORMNM="" D
70 .S FORM=$O(^IBE(358,"B",$E(FORMNM,1,30),0))
71 .Q:$O(^IBE(357,"B",$E(FORMNM,1,30),0))
72 .D MES^XPDUTL(" Moving Form '"_FORMNM_"' from import export utility to AICS")
73 .S NEWFORM=$$COPYFORM^IBDFU2C(FORM,358,357,"",1),CNTF=CNTF+1
74 ;
75 I CNTF=0,CNTB=0 D MES^XPDUTL(">>> Tool Kit Forms and Blocks are already installed.") Q
76 ;D MES^XPDUTL(">>> Tool Kit Forms sent (4): ") D MES^XPDUTL($J(CNTF,3)) D MES^XPDUTL(" installed")
77 D MES^XPDUTL(">>> Tool Kit Forms sent (4): "_$J(CNTF,3)_" installed")
78 D MES^XPDUTL(">>> Tool Kit Blocks sent (28): "_$J(CNTB,3)_" installed")
79 ;D MES^XPDUTL(">>> Tool Kit Blocks sent (28): ") D MES^XPDUTL($J(CNTB,3)) D MES^XPDUTL(" installed")
80 Q
81 ;
82 ;
83LEX ; -- if clinic lex version two installed, update dd nodes
84 I $D(^LEX) D ; -- maybe add $$ver^xpdutl(lex2_0??)
85 .S ^DD(357.3,2.02,0)="CLINICAL LEXICON ENTRY^P757.01'^LEX(757.01,^2;2^Q"
86 .S ^DD(358.3,2.02,0)="CLINICAL LEXICON ENTRY^P757.01'^LEX(757.01,^2;2^Q"
87 .S ^DD(357.951,2.02,0)="CLINICAL LEXICON^P757.01'^LEX(757.01,^2;2^Q"
88 .D MES^XPDUTL(">>> AICS Data Dictionaries updated to use Lexicon Utility version 2.0")
89 E D MES^XPDUTL(">>> AICS Data Dictionaries updated to use Clinical Lexicon Utility version 1.0")
90 Q
91 ;
92FORMSPEC ;Form Specs deleted from the file 359.2 FORM SPEC file.
93 D MES^XPDUTL(">>> Form Specs being deleted and recreated for scanning.")
94 N IBDIFN
95 S IBDIFN=0
96 F S IBDIFN=$O(^IBD(359.2,IBDIFN)) Q:IBDIFN']"" I $D(^IBD(357.95,IBDIFN,0)) D SCAN^IBDFBKS(IBDIFN)
97 Q
98 ;
99RECOMP ; -- recompile all forms
100 S IBFORM=0
101 F S IBFORM=$O(^IBE(357,IBFORM)) Q:'IBFORM D UNCMPALL^IBDF19(IBFORM)
102 Q
103 ;
104ICD9 ; -- make sure ICD9 input interface uses diagnosis/problem node
105 N IBDA,IBDX
106 S IBDA=0 F S IBDA=$O(^IBE(357.6,"B","INPUT DIAGNOSIS CODE (ICD9)",IBDA)) Q:'IBDA D
107 .S IBDX=$G(^IBE(357.6,IBDA,0))
108 .Q:IBDX=""!($P(IBDX,"^")'="INPUT DIAGNOSIS CODE (ICD9)")
109 .Q:$P($G(^IBE(357.6,IBDA,12)),"^")="DIAGNOSIS/PROBLEM"
110 .S ^IBE(357.6,IBDA,12)="DIAGNOSIS/PROBLEM^1^13^14^2^^^"
111 .D MES^XPDUTL(">>> Updating Package Interface Entry for INPUT DIAGNOSIS CODE (ICD9)")
112 ;
113SCRN S IBDA=$O(^IBE(357.6,"B","INPUT PROVIDER",0)) Q:'IBDA D
114 .S IBDX=$G(^IBE(357.6,IBDA,0))
115 .Q:IBDX=""!($P(IBDX,"^")'="INPUT PROVIDER")
116 S ^IBE(357.6,IBDA,18)="S IBDF(""OTHER"")=""200^I $$SCREEN^IBDFDE10(+Y)"" D LIST^IBDFDE2(.IBDSEL,.IBDF,""Provider"")"
117 Q
118 ;
119ACTIVAT ; -- activate two entries in 357.69 that were erroniously inactivated
120 I $P($G(^IBE(357.69,99220,0)),"^",4) S $P(^IBE(357.69,99220,0),"^",4)=""
121 I $P($G(^IBE(357.69,99232,0)),"^",4) S $P(^IBE(357.69,99232,0),"^",4)=""
122 Q
123 ;
124OPTRF ; -- remove erroneous output transform for PX INPUT PATIENT PROBLEMS
125 N IBDFA
126 S IBDFA=$O(^IBE(357.6,"B","PX INPUT PATIENT ACTIVE PROBLE",0)) Q:'IBDFA
127 I $G(^IBE(357.6,IBDFA,14))="S Y=$$DSPLYICD^IBDFN9(Y)" K ^IBE(357.6,IBDFA,14)
128 Q
129DELFLD ; -- delete fields *'d for deletion
130 Q:'$D(^DD(357.6,2.14)) ;already removed
131 S DIK="^DD(357.6,",DA(1)=357.6
132 F DA=8.01,8.02,8.03,8.04,8.05,8.06,8.07,2.03,2.04,2.05,2.06,2.07,2.08,2.09,2.1,2.11,2.12,2.13,2.14 D ^DIK
133 K DIK,DA
134 D MES^XPDUTL(">>> Deleting Fields *'d for Deletion in Package Interface file (357.6)")
135 Q
136 ;
137RESOURC ; -- add scanning resource device
138 I $D(^%ZIS(1,"B","IBD RESOURCE")) Q
139 D MES^XPDUTL(">>> Adding Resouce Device 'IBD RESOURCE' for scanning.")
140 S DIC="^%ZIS(1,",DIC(0)="L",DLAYGO=3.5,X="IBD RESOURCE" D FILE^DICN
141 S DA=+Y Q:DA<1
142 S DR="1////IBD RESOURCE;.02////NA;2///RESOURCE"
143 S DIE=DIC D ^DIE K DIC,DIE,DR,DA
144 Q
145 ;
146FORMS ;;
147 ;;DEFAULTS
148 ;;
149 ;;
150 ;;AMBULATORY SURGERY SAMPLE V2.1
151 ;;EMERGENCY SERVICES SAMPLE V2.1
152 ;;PRIMARY CARE SAMPLE V2.1
153 ;;
154BLOCKS ;;
155 ;;TOOL KIT
156 ;;
157 Q
Note: See TracBrowser for help on using the repository browser.