Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DG531020P

DG531020P.m

Go to the documentation of this file.
DG531020P ;ISP/RFR - PATCH 1020 POST-INIT;Sep 21, 2020@15:56
 ;;5.3;Registration;**1020**;Aug 13, 1993;Build 11
 ;REMOVE PATCH 932 INDICES
PRE ;PRE-INIT ACTIONS
 D BMES^XPDUTL("  Removing unnecessary indices...")
 N INDICES,INSTALLED,INSTALLS,INDEXNUM,NAME,INDEX,NUMBER,FILE
 S INDICES(1,"ADRDPD")="",INDICES(1,"ADRDPD",45)=""
 S INDICES(2,"ADRDPD86")="",INDICES(2,"ADRDPD86",45)=""
 S INDICES(3,"ADRDSD")=24,INDICES(3,"ADRDSD",45)=""
 S INDICES(4,"ADRDD")=25,INDICES(4,"ADRDD",45.02)=""
 S INDICES(5,"ADRDSPDX")="",INDICES(5,"ADRDSPDX",45.06)=""
 S INDICES(6,"ADRDSPD")="",INDICES(6,"ADRDSPD",46)=""
 S INDICES(7,"ADRDSD")=7,INDICES(7,"ADRDSD",46)=""
 S INSTALLED=$$INSTALDT^XPDUTL("DG*5.3*1020",.INSTALLS)
 F INDEXNUM=1:1:7  S NAME="" F  S NAME=$O(INDICES(INDEXNUM,NAME)) Q:NAME=""  D
 .S FILE=$O(INDICES(INDEXNUM,NAME,0))
 .I INDICES(INDEXNUM,NAME)="" D DELETE(FILE,NAME) Q
 .F NUMBER=1:1:INDICES(INDEXNUM,NAME)  D
 ..S INDEX=NAME_$S(NUMBER<10:"0",1:"")_NUMBER
 ..D DELETE(FILE,INDEX)
 D BMES^XPDUTL("    DONE")
 N MESSAGE
 I $$LKOPT^XPDMENU("DG PTF ICD CODE NOTIFIER")>0 D
 .D BMES^XPDUTL("  Renaming option DG PTF ICD CODE NOTIFIER...")
 .D RENAME^XPDMENU("DG PTF ICD CODE NOTIFIER","DG EVENT NOTIFIER")
 .S MESSAGE(1)="    New name: DG EVENT NOTIFIER"
 .S MESSAGE(2)="    DONE"
 .D MES^XPDUTL(.MESSAGE)
 .K MESSAGE
 Q
DELETE(FILE,INDEX) ;DELETE THE SPECIFIED INDEX
 N ERROR,MESSAGE
 D BMES^XPDUTL("    INDEX "_INDEX_" IN FILE #"_FILE_":")
 D DELIXN^DDMOD(FILE,INDEX,"W",,"ERROR")
 I $D(ERROR) D
 .I $G(ERROR("DIERR",1))=202,INSTALLED>0 S MESSAGE(1)="    Previously removed"
 .E  D MSG^DIALOG("A",.MESSAGE,,3,"ERROR")
 I '$D(MESSAGE) S MESSAGE(1)="    Successfully removed"
 D MES^XPDUTL(.MESSAGE)
 Q
POST ;POST-INIT ACTIONS
 N INDEX,FILENUMS
 S FILENUMS("AICN")="PTF FILE (#45)"
 S FILENUMS("AICNS")="CPT RECORD DATE/TIME SUB-FILE (#45.06) IN THE PTF FILE (#45)"
 S FILENUMS("AICNM")="501 SUB-FILE (#45.02) IN THE PTF FILE (#45)"
 S FILENUMS("AICNC")="INPATIENT CPT CODE FILE (#46)"
 S FILENUMS("AC")="SCHEDULED ADMISSION FILE (#41.1)"
 D BMES^XPDUTL("  Creating new-style indexes...")
 F INDEX="AICN","AICNS","AICNM","AICNC","AC" D
 .D MES^XPDUTL("    "_INDEX_" IN "_FILENUMS(INDEX)_":"),@INDEX
 N X,Y,DMAX,MESSAGE,OUTPUT,LINE
 S Y=$$FIND1^DIC(.402,"","X","DGSCHADMIT")
 I +Y=0 D
 .S MESSAGE(1)="    ERROR! Could not find the input template."
 .I Y=0 S MESSAGE(2)="    The template does not exist." Q
 .D MSG^DIALOG("AE",.OUTPUT,75)
 .S LINE=0 F  S LINE=$O(OUTPUT(LINE)) Q:'+LINE  S MESSAGE(LINE+1)=OUTPUT(LINE)
 I +Y'=0 S DMAX=$$ROUSIZE^DILF,X="DGSATX" D EN^DIEZ S MESSAGE(1)="    DONE"
 D MES^XPDUTL(.MESSAGE)
 Q
AICN ;CREATE AICN CROSS-REFERENCE IN PTF FILE (#45)
 N DGXR,DGRES,DGOUT
 S DGXR("FILE")=45
 S DGXR("NAME")="AICN"
 S DGXR("TYPE")="MU"
 S DGXR("USE")="A"
 S DGXR("EXECUTION")="R"
 S DGXR("SHORT DESCR")="Notify packages of ICD diagnosis code change."
 S DGXR("DESCR",1)="This cross-reference will notify subscribing packages via protocol DG PTF "
 S DGXR("DESCR",2)="ICD DIAGNOSIS NOTIFIER when an ICD diagnosis code is added, edited or "
 S DGXR("DESCR",3)="removed."
 S DGXR("SET")="D NOTIFY^DGPTDD(.X1,.X2,.DA,45,""DISCHARGE"",""SET"")"
 S DGXR("KILL")="D NOTIFY^DGPTDD(.X1,.X2,.DA,45,""DISCHARGE"",""KILL"")"
 S DGXR("VAL",1)=.01
 S DGXR("VAL",1,"COLLATION")="F"
 S DGXR("VAL",2)=11
 S DGXR("VAL",2,"COLLATION")="F"
 S DGXR("VAL",3)=79
 S DGXR("VAL",3,"COLLATION")="F"
 S DGXR("VAL",4)=79.16
 S DGXR("VAL",4,"COLLATION")="F"
 S DGXR("VAL",5)=79.17
 S DGXR("VAL",5,"COLLATION")="F"
 S DGXR("VAL",6)=79.18
 S DGXR("VAL",6,"COLLATION")="F"
 S DGXR("VAL",7)=79.19
 S DGXR("VAL",7,"COLLATION")="F"
 S DGXR("VAL",8)=79.201
 S DGXR("VAL",8,"COLLATION")="F"
 S DGXR("VAL",9)=79.21
 S DGXR("VAL",9,"COLLATION")="F"
 S DGXR("VAL",10)=79.22
 S DGXR("VAL",10,"COLLATION")="F"
 S DGXR("VAL",11)=79.23
 S DGXR("VAL",11,"COLLATION")="F"
 S DGXR("VAL",12)=79.24
 S DGXR("VAL",12,"COLLATION")="F"
 S DGXR("VAL",13)=79.241
 S DGXR("VAL",13,"COLLATION")="F"
 S DGXR("VAL",14)=79.242
 S DGXR("VAL",14,"COLLATION")="F"
 S DGXR("VAL",15)=79.243
 S DGXR("VAL",15,"COLLATION")="F"
 S DGXR("VAL",16)=79.244
 S DGXR("VAL",16,"COLLATION")="F"
 S DGXR("VAL",17)=79.245
 S DGXR("VAL",17,"COLLATION")="F"
 S DGXR("VAL",18)=79.246
 S DGXR("VAL",18,"COLLATION")="F"
 S DGXR("VAL",19)=79.247
 S DGXR("VAL",19,"COLLATION")="F"
 S DGXR("VAL",20)=79.248
 S DGXR("VAL",20,"COLLATION")="F"
 S DGXR("VAL",21)=79.249
 S DGXR("VAL",21,"COLLATION")="F"
 S DGXR("VAL",22)=79.2491
 S DGXR("VAL",22,"COLLATION")="F"
 S DGXR("VAL",23)=79.24911
 S DGXR("VAL",23,"COLLATION")="F"
 S DGXR("VAL",24)=79.24912
 S DGXR("VAL",24,"COLLATION")="F"
 S DGXR("VAL",25)=79.24913
 S DGXR("VAL",25,"COLLATION")="F"
 S DGXR("VAL",26)=79.24914
 S DGXR("VAL",26,"COLLATION")="F"
 S DGXR("VAL",27)=79.24915
 S DGXR("VAL",27,"COLLATION")="F"
 S DGXR("VAL",28)=80
 S DGXR("VAL",28,"COLLATION")="F"
 D CREIXN^DDMOD(.DGXR,"W",.DGRES,"DGOUT"),CHECK(.DGRES)
 Q
AICNS ;CREATE AICNS CROSS-REFERENCE IN PTF FILE (#45)
 N DGXR,DGRES,DGOUT
 S DGXR("FILE")=45.06
 S DGXR("NAME")="AICNS"
 S DGXR("TYPE")="MU"
 S DGXR("USE")="A"
 S DGXR("EXECUTION")="F"
 S DGXR("SHORT DESCR")="Notify packages of ICD diagnosis code change."
 S DGXR("DESCR",1)="This cross-reference will notify subscribing packages via protocol DG PTF "
 S DGXR("DESCR",2)="ICD DIAGNOSIS NOTIFIER when an ICD diagnosis code is added, edited or "
 S DGXR("DESCR",3)="removed."
 S DGXR("SET")="D NOTIFY^DGPTDD(.X1,.X2,.DA,45,""SERVICE"",""SET"")"
 S DGXR("KILL")="D NOTIFY^DGPTDD(.X1,.X2,.DA,45,""SERVICE"",""KILL"")"
 S DGXR("VAL",1)=.01
 S DGXR("VAL",1,"COLLATION")="F"
 S DGXR("VAL",2)=.04
 S DGXR("VAL",2,"COLLATION")="F"
 S DGXR("VAL",3)=.09
 S DGXR("VAL",3,"COLLATION")="F"
 D CREIXN^DDMOD(.DGXR,"W",.DGRES,"DGOUT"),CHECK(.DGRES)
 Q
AICNM ;CREATE AICNM CROSS-REFERENCE IN PTF FILE (#45)
 N DGXR,DGRES,DGOUT
 S DGXR("FILE")=45.02
 S DGXR("NAME")="AICNM"
 S DGXR("TYPE")="MU"
 S DGXR("USE")="A"
 S DGXR("EXECUTION")="R"
 S DGXR("SHORT DESCR")="Notify packages of ICD diagnosis code change."
 S DGXR("DESCR",1)="This cross-reference will notify subscribing packages via protocol DG PTF "
 S DGXR("DESCR",2)="ICD DIAGNOSIS NOTIFIER when an ICD diagnosis code is added, edited or "
 S DGXR("DESCR",3)="removed."
 S DGXR("SET")="D NOTIFY^DGPTDD(.X1,.X2,.DA,45,""MOVEMENT"",""SET"")"
 S DGXR("KILL")="D NOTIFY^DGPTDD(.X1,.X2,.DA,45,""MOVEMENT"",""KILL"")"
 S DGXR("VAL",1)=.01
 S DGXR("VAL",1,"COLLATION")="F"
 S DGXR("VAL",2)=5
 S DGXR("VAL",2,"COLLATION")="F"
 S DGXR("VAL",3)=6
 S DGXR("VAL",3,"COLLATION")="F"
 S DGXR("VAL",4)=7
 S DGXR("VAL",4,"COLLATION")="F"
 S DGXR("VAL",5)=8
 S DGXR("VAL",5,"COLLATION")="F"
 S DGXR("VAL",6)=9
 S DGXR("VAL",6,"COLLATION")="F"
 S DGXR("VAL",7)=11
 S DGXR("VAL",7,"COLLATION")="F"
 S DGXR("VAL",8)=12
 S DGXR("VAL",8,"COLLATION")="F"
 S DGXR("VAL",9)=13
 S DGXR("VAL",9,"COLLATION")="F"
 S DGXR("VAL",10)=14
 S DGXR("VAL",10,"COLLATION")="F"
 S DGXR("VAL",11)=15
 S DGXR("VAL",11,"COLLATION")="F"
 S DGXR("VAL",12)=81.01
 S DGXR("VAL",12,"COLLATION")="F"
 S DGXR("VAL",13)=81.02
 S DGXR("VAL",13,"COLLATION")="F"
 S DGXR("VAL",14)=81.03
 S DGXR("VAL",14,"COLLATION")="F"
 S DGXR("VAL",15)=81.04
 S DGXR("VAL",15,"COLLATION")="F"
 S DGXR("VAL",16)=81.05
 S DGXR("VAL",16,"COLLATION")="F"
 S DGXR("VAL",17)=81.06
 S DGXR("VAL",17,"COLLATION")="F"
 S DGXR("VAL",18)=81.07
 S DGXR("VAL",18,"COLLATION")="F"
 S DGXR("VAL",19)=81.08
 S DGXR("VAL",19,"COLLATION")="F"
 S DGXR("VAL",20)=81.09
 S DGXR("VAL",20,"COLLATION")="F"
 S DGXR("VAL",21)=81.1
 S DGXR("VAL",21,"COLLATION")="F"
 S DGXR("VAL",22)=81.11
 S DGXR("VAL",22,"COLLATION")="F"
 S DGXR("VAL",23)=81.12
 S DGXR("VAL",23,"COLLATION")="F"
 S DGXR("VAL",24)=81.13
 S DGXR("VAL",24,"COLLATION")="F"
 S DGXR("VAL",25)=81.14
 S DGXR("VAL",25,"COLLATION")="F"
 S DGXR("VAL",26)=81.15
 S DGXR("VAL",26,"COLLATION")="F"
 D CREIXN^DDMOD(.DGXR,"W",.DGRES,"DGOUT"),CHECK(.DGRES)
 Q
AICNC ;CREATE AICNC CROSS-REFERENCE IN INPATIENT CPT CODE FILE (#46)
 N DGXR,DGRES,DGOUT
 S DGXR("FILE")=46
 S DGXR("NAME")="AICNC"
 S DGXR("TYPE")="MU"
 S DGXR("USE")="A"
 S DGXR("EXECUTION")="R"
 S DGXR("SHORT DESCR")="Notify packages of ICD diagnosis code change."
 S DGXR("DESCR",1)="This cross-reference will notify subscribing packages via protocol DG PTF "
 S DGXR("DESCR",2)="ICD DIAGNOSIS NOTIFIER when an ICD diagnosis code is added, edited or "
 S DGXR("DESCR",3)="removed."
 S DGXR("SET")="D NOTIFY^DGPTDD(.X1,.X2,.DA,46,""SERVICE46"",""SET"")"
 S DGXR("KILL")="D NOTIFY^DGPTDD(.X1,.X2,.DA,46,""SERVICE46"",""KILL"")"
 S DGXR("VAL",1)=.01
 S DGXR("VAL",1,"COLLATION")="F"
 S DGXR("VAL",2)=.16
 S DGXR("VAL",2,"COLLATION")="F"
 S DGXR("VAL",3)=.04
 S DGXR("VAL",3,"COLLATION")="F"
 S DGXR("VAL",4)=.05
 S DGXR("VAL",4,"COLLATION")="F"
 S DGXR("VAL",5)=.06
 S DGXR("VAL",5,"COLLATION")="F"
 S DGXR("VAL",6)=.07
 S DGXR("VAL",6,"COLLATION")="F"
 S DGXR("VAL",7)=.21
 S DGXR("VAL",7,"COLLATION")="F"
 S DGXR("VAL",8)=.22
 S DGXR("VAL",8,"COLLATION")="F"
 S DGXR("VAL",9)=.23
 S DGXR("VAL",9,"COLLATION")="F"
 S DGXR("VAL",10)=.24
 S DGXR("VAL",10,"COLLATION")="F"
 S DGXR("VAL",11)=1
 S DGXR("VAL",11,"COLLATION")="F"
 D CREIXN^DDMOD(.DGXR,"W",.DGRES,"DGOUT"),CHECK(.DGRES)
 Q
AC ;CREATE AC CROSS-REFERENCE IN SCHEDULED ADMISSION FILE (#41.1)
 N DGXR,DGRES,DGOUT
 S DGXR("FILE")=41.1
 S DGXR("NAME")="AC"
 S DGXR("TYPE")="MU"
 S DGXR("USE")="A"
 S DGXR("EXECUTION")="R"
 S DGXR("SHORT DESCR")="Notify packages when an entry is acted upon."
 S DGXR("DESCR",1)="This cross-reference will notify subscribing packages via protocol DG SA "
 S DGXR("DESCR",2)="FILE ENTRY NOTIFIER when an entry in this file is added, modified or "
 S DGXR("DESCR",3)="removed."
 S DGXR("SET")="D NOTIFY^DGSCHAD(.X1,.X2,.DA,""SET"")"
 S DGXR("KILL")="D NOTIFY^DGSCHAD(.X1,.X2,.DA,""KILL"")"
 S DGXR("VAL",1)=.01
 S DGXR("VAL",1,"COLLATION")="F"
 S DGXR("VAL",2)=2
 S DGXR("VAL",2,"COLLATION")="F"
 S DGXR("VAL",3)=3
 S DGXR("VAL",3,"COLLATION")="F"
 S DGXR("VAL",4)=4
 S DGXR("VAL",4,"COLLATION")="F"
 S DGXR("VAL",5)=5
 S DGXR("VAL",5,"COLLATION")="F"
 S DGXR("VAL",6)=6
 S DGXR("VAL",6,"COLLATION")="F"
 S DGXR("VAL",7)=7
 S DGXR("VAL",7,"COLLATION")="F"
 S DGXR("VAL",8)=8
 S DGXR("VAL",8,"COLLATION")="F"
 S DGXR("VAL",9)=9
 S DGXR("VAL",9,"COLLATION")="F"
 S DGXR("VAL",10)=10
 S DGXR("VAL",10,"COLLATION")="F"
 S DGXR("VAL",11)=11
 S DGXR("VAL",11,"COLLATION")="F"
 S DGXR("VAL",12)=12
 S DGXR("VAL",12,"COLLATION")="F"
 S DGXR("VAL",13)=13
 S DGXR("VAL",13,"COLLATION")="F"
 S DGXR("VAL",14)=14
 S DGXR("VAL",14,"COLLATION")="F"
 S DGXR("VAL",15)=15
 S DGXR("VAL",15,"COLLATION")="F"
 S DGXR("VAL",16)=16
 S DGXR("VAL",16,"COLLATION")="F"
 S DGXR("VAL",17)=17
 S DGXR("VAL",17,"COLLATION")="F"
 D CREIXN^DDMOD(.DGXR,"W",.DGRES,"DGOUT"),CHECK(.DGRES)
 Q
CHECK(RESULT) ;CHECK STATUS OF INDEX CREATION
 N MESSAGE,LINE
 I RESULT="" D
 .S MESSAGE(1)="    Index creation failed;"
 .I $D(ERROR) D
 ..D MSG^DIALOG("AE",.OUTPUT,75)
 ..S LINE=0 F  S LINE=$O(OUTPUT(LINE)) Q:'+LINE  S MESSAGE(LINE+1)="    "_OUTPUT(LINE)
 I +RESULT>0 S MESSAGE(1)="    Index creation succeeded"
 D MES^XPDUTL(.MESSAGE)
 Q