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

DG53478I.m

Go to the documentation of this file.
  1. DG53478I ; SLC/PKR - Create cross-references for clinical reminder index. ;10/12/2004
  1. ;;5.3;Registration;**478,1015**;Aug 13, 1993;Build 21
  1. ;
  1. Q
  1. ;===============================================================
  1. CDGPTXR ;Create all the cross-references.
  1. D CDGPT0
  1. D CDGPT9
  1. D CHLOC
  1. Q
  1. ;
  1. ;===============================================================
  1. CDGPT0 ;Create cross-references for PTF ICD0 data.
  1. ;For node 401 surgery node:
  1. ;ICD0 from nodes: 45.01,8; 45.01,9; 45.01,10; 45.01,11; 45.01,12
  1. ;For node 601, procedure node:
  1. ;ICD0 from nodes: 45.05,4; 45.05,5; 45.05,6; 45.05,7; 45.05,8
  1. N IND,MSG,NAME,NODE,NODENUM,RESULT,XREF
  1. D BMES^XPDUTL("Creating PTF ICD0 cross-references.")
  1. ;Set the XREF nodes that are the same for all cross-references.
  1. S XREF("FILE")=45
  1. S XREF("WHOLE KILL")="K ^PXRMINDX(45,""ICD0"")"
  1. S XREF("TYPE")="MU"
  1. S XREF("SHORT DESCR")="Clinical Reminders index for ICD0 lookup."
  1. S XREF("DESCR",1)="This cross-reference builds two indexes, one for finding"
  1. S XREF("DESCR",2)="all patients with a particular ICD0 code and one for finding all"
  1. S XREF("DESCR",3)="the ICD0 codes a patient has."
  1. S XREF("DESCR",4)="The indexes are stored in the Clinical Reminders index global as:"
  1. S XREF("DESCR",5)=" ^PXRMINDX(45,""ICD0"",""INP"",ICD0,NODE,DFN,DATE,DAS) and"
  1. S XREF("DESCR",6)=" ^PXRMINDX(45,""ICD0"",""PNI"",DFN,NODE,ICD0,DATE,DAS)"
  1. S XREF("DESCR",7)="respectively. DATE is the surgery/procedure date."
  1. S XREF("USE")="ACTION"
  1. S XREF("EXECUTION")="R"
  1. S XREF("ACTIVITY")="IR"
  1. ;
  1. ;These XREF nodes change for each cross-reference.
  1. S XREF("ROOT FILE")=45.01
  1. S XREF("VAL",1)=.01
  1. S XREF("VAL",1,"SUBSCRIPT")=1
  1. S XREF("VAL",2,"SUBSCRIPT")=2
  1. S IND=0
  1. S NODE="S"
  1. S XREF("DESCR",8)="NODE is S followed by code number. For example,"
  1. S XREF("DESCR",10)="For all the details, see the Clinical Reminders Index Technical Guide/Programmer's Manual."
  1. F NODENUM=8,9,10,11,12 D
  1. . S IND=IND+1
  1. . S XREF("DESCR",9)=NODE_IND_" means it was found on the S node and it was operation code "_IND_"."
  1. . S NAME="ACR0S"_IND
  1. . S XREF("NAME")=NAME
  1. . S XREF("VAL",2)=NODENUM
  1. . S XREF("SET")="D SDGPT0^DGPTDDCR(.X,.DA,"""_NODE_""","_IND_")"
  1. . S XREF("KILL")="D KDGPT0^DGPTDDCR(.X,.DA,"""_NODE_""","_IND_")"
  1. . D CREIXN^DDMOD(.XREF,"k",.RESULT,"","MSG")
  1. . I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
  1. ;
  1. S XREF("ROOT FILE")=45.05
  1. S XREF("VAL",1)=.01
  1. S XREF("VAL",1,"SUBSCRIPT")=1
  1. S XREF("VAL",2,"SUBSCRIPT")=2
  1. S IND=0
  1. S NODE="P"
  1. S XREF("DESCR",8)="NODE is S followed by code number. For example,"
  1. S XREF("DESCR",10)="For all the details, see the Clinical Reminders Index Technical Guide/Programmer's Manual."
  1. F NODENUM=4,5,6,7,8 D
  1. . S IND=IND+1
  1. . S XREF("DESCR",9)=NODE_IND_" means it was found on the P node and it was operation code "_IND_"."
  1. . S NAME="ACR0P"_IND
  1. . S XREF("NAME")=NAME
  1. . S XREF("VAL",2)=NODENUM
  1. . S XREF("SET")="D SDGPT0^DGPTDDCR(.X,.DA,"""_NODE_""","_IND_")"
  1. . S XREF("KILL")="D KDGPT0^DGPTDDCR(.X,.DA,"""_NODE_""","_IND_")"
  1. . D CREIXN^DDMOD(.XREF,"k",.RESULT,"","MSG")
  1. . I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
  1. Q
  1. ;
  1. ;===============================================================
  1. CDGPT9 ;Create cross-references for PTF ICD9 data.
  1. ;ICD9 from nodes: 45,79; 45,80; 45,79.16 45,79.17; 45,79.18;
  1. ;45,79.19; 45,79.201; 45,79.21; 45,79.22; 45,79.22; 45.79.23;
  1. ;45,79.24; 45,79.241; 45,79.242; 45,79.243; 45,79.244
  1. ;By name these nodes are: DXLS, PRINCIPAL DIAGNOSIS, SECONDARY
  1. ;DIAGNOSIS 1, through SECONDARY DIAGNOSIS 12.
  1. N IND,MSG,NAME,NODE,RESULT,XREF
  1. D BMES^XPDUTL("Creating PTF ICD9 cross-references.")
  1. ;Set the XREF nodes that are the same for all cross-references.
  1. S XREF("FILE")=45
  1. S XREF("ROOT FILE")=45
  1. S XREF("WHOLE KILL")="K ^PXRMINDX(45)"
  1. S XREF("TYPE")="MU"
  1. S XREF("SHORT DESCR")="Clinical Reminders index for ICD9 lookup."
  1. S XREF("DESCR",1)="This cross-reference builds two indexes, one for finding"
  1. S XREF("DESCR",2)="all patients with a particular ICD9 code and one for finding all"
  1. S XREF("DESCR",3)="the ICD9 codes a patient has."
  1. S XREF("DESCR",4)="The indexes are stored in the Clinical Reminders index global as:"
  1. S XREF("DESCR",5)=" ^PXRMINDX(45,""ICD9"",""INP"",ICD9,NAME,DFN,DATE,DAS) and"
  1. S XREF("DESCR",6)=" ^PXRMINDX(45,""ICD9"",""PNI"",DFN,NAME,ICD9,DATE,DAS)"
  1. S XREF("DESCR",7)="respectively. DATE is the discharge date. If it does not"
  1. S XREF("DESCR",8)="exist then the admission date is used."
  1. S XREF("EXECUTION")="R"
  1. S XREF("ACTIVITY")="IR"
  1. S XREF("VAL",1)=.01
  1. S XREF("VAL",1,"SUBSCRIPT")=1
  1. S XREF("VAL",2)=2
  1. S XREF("VAL",2,"SUBSCRIPT")=2
  1. S XREF("VAL",3)=11
  1. S XREF("VAL",3,"SUBSCRIPT")=3
  1. S XREF("VAL",5)=70
  1. ;
  1. ;These XREF nodes change for each cross-reference.
  1. S XREF("DESCR",9)="NAME is the name of the ICD9 code field. An example is DXLS."
  1. S XREF("DESCR",10)="If the TYPE OF RECORD is CENSUS then the entry is not indexed."
  1. S XREF("DESCR",11)="For all the details, see the Clinical Reminders Index Technical Guide/Programmer's Manual."
  1. S XREF("NAME")="ACR9DXLS"
  1. S XREF("VAL",4)=79
  1. S XREF("VAL",4,"SUBSCRIPT")=4
  1. S XREF("SET")="D SDGPT9D^DGPTDDCR(.X,.DA,""DXLS"")"
  1. S XREF("KILL")="D KDGPT9D^DGPTDDCR(.X,.DA,""DXLS"")"
  1. D CREIXN^DDMOD(.XREF,"k",.RESULT,"","MSG")
  1. I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
  1. ;
  1. S XREF("DESCR",9)="NAME is the name of the ICD9 code field. An example is PDX."
  1. S XREF("DESCR",10)="If the TYPE OF RECORD is CENSUS then the entry is not indexed."
  1. S XREF("DESCR",11)="For all the details, see the Clinical Reminders Index Technical Guide/Programmer's Manual."
  1. S XREF("NAME")="ACR9PDX"
  1. S XREF("VAL",4)=80
  1. S XREF("VAL",4,"SUBSCRIPT")=4
  1. S XREF("SET")="D SDGPT9D^DGPTDDCR(.X,.DA,""PDX"")"
  1. S XREF("KILL")="D KDGPT9D^DGPTDDCR(.X,.DA,""PDX"")"
  1. D CREIXN^DDMOD(.XREF,"k",.RESULT,"","MSG")
  1. I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
  1. ;
  1. ;Remove the cross-references using the original names (this applies to
  1. ;test sites).
  1. S IND=1
  1. F FIELD=79.16,79.17,79.18,79.19,79.201,79.21,79.22,79.23,79.24 D
  1. . S IND=IND+1
  1. . S NAME="ACR9DICD"_IND
  1. . D DELIXN^DDMOD(45,NAME,"","","MSG")
  1. . I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
  1. ;Remove ACR9DSD14, it was created in error.
  1. D DELIXN^DDMOD(45,"ACR9DSD14","","","MSG")
  1. I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
  1. ;
  1. S IND=0
  1. F FIELD=79.16,79.17,79.18,79.19,79.201,79.21,79.22,79.23,79.24,79.241,79.242,79.243,79.244 D
  1. . S IND=IND+1
  1. . S XREF("DESCR",9)="NAME is the name of the ICD9 code field. An example is D SD"_IND_", where D SD tells us it is a discharge secondary diagnosis."
  1. . S XREF("DESCR",10)="If the TYPE OF RECORD is CENSUS then the entry is not indexed."
  1. . S XREF("DESCR",11)="For all the details, see the Clinical Reminders Index Technical Guide/Programmer's Manual."
  1. . S NAME="SD"_IND
  1. . S NODE="D "_NAME
  1. . S XREF("NAME")="ACR9D"_NAME
  1. . S XREF("VAL",4)=FIELD
  1. . S XREF("VAL",4,"SUBSCRIPT")=4
  1. . S XREF("SET")="D SDGPT9D^DGPTDDCR(.X,.DA,"""_NODE_""")"
  1. . S XREF("KILL")="D KDGPT9D^DGPTDDCR(.X,.DA,"""_NODE_""")"
  1. . D CREIXN^DDMOD(.XREF,"k",.RESULT,"","MSG")
  1. . I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
  1. ;
  1. ;Add the movement nodes.
  1. K XREF("VAL")
  1. S XREF("ROOT FILE")=45.02
  1. S XREF("VAL",1)=10
  1. S XREF("VAL",1,"SUBSCRIPT")=1
  1. S XREF("DESCR",7)="respectively. DATE is movement date."
  1. K XREF("DESCR",8),XREF("DESCR",9),XREF("DESCR",10),XREF("DESCR",11)
  1. S XREF("DESCR",9)="If the TYPE OF RECORD is CENSUS then the entry is not indexed."
  1. S XREF("DESCR",10)="For all the details, see the Clinical Reminders Index Technical Guide/Programmer's Manual."
  1. S IND=0
  1. F FIELD=5,6,7,8,9,11,12,13,14,15 D
  1. . S IND=IND+1
  1. . S XREF("DESCR",8)="NAME is the name of the ICD9 code field. An example is M ICD"_IND_", where M tells us it is a movement diagnosis."
  1. . S NAME="ICD"_IND
  1. . S NODE="M "_NAME
  1. . S XREF("NAME")="ACR9M"_NAME
  1. . S XREF("VAL",2)=FIELD
  1. . S XREF("VAL",2,"SUBSCRIPT")=2
  1. . S XREF("SET")="D SDGPT9M^DGPTDDCR(.X,.DA,"""_NODE_""")"
  1. . S XREF("KILL")="D KDGPT9M^DGPTDDCR(.X,.DA,"""_NODE_""")"
  1. . D CREIXN^DDMOD(.XREF,"k",.RESULT,"","MSG")
  1. . I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
  1. Q
  1. ;
  1. ;===============================================================
  1. CHLOC ;Create cross-references for Hospital Location.
  1. N MSG,RESULT,XREF
  1. D BMES^XPDUTL("Creating Hospital Location cross-references.")
  1. S XREF("FILE")=44
  1. S XREF("ROOT FILE")=44
  1. S XREF("TYPE")="R"
  1. S XREF("USE")="SORTING ONLY"
  1. S XREF("EXECUTION")="F"
  1. S XREF("ACTIVITY")="IR"
  1. S XREF("SHORT DESCR")="Index credit stop codes"
  1. S XREF("DESCR",1)="This index can be used to find all hospital locations in a"
  1. S XREF("DESCR",2)="credit stop code."
  1. S XREF("WHOLE KILL")="K ^SC(""ACST"")"
  1. S XREF("VAL",1)=2503
  1. S XREF("VAL",1,"SUBSCRIPT")=1
  1. S XREF("NAME")="ACST"
  1. S XREF("SET")="S ^SC(""ACST"",X,DA)"
  1. S XREF("KILL")="K ^SC(""ACST"",X,DA)"
  1. D CREIXN^DDMOD(.XREF,"kS",.RESULT,"","MSG")
  1. I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
  1. ;
  1. S XREF("SHORT DESCR")="Index stop codes"
  1. S XREF("DESCR",1)="This index can be used to find all hospital locations in a"
  1. S XREF("DESCR",2)="stop code."
  1. S XREF("WHOLE KILL")="K ^SC(""AST"")"
  1. S XREF("VAL",1)=8
  1. S XREF("VAL",1,"SUBSCRIPT")=1
  1. S XREF("NAME")="AST"
  1. S XREF("SET")="S ^SC(""AST"",X,DA)"
  1. S XREF("KILL")="K ^SC(""AST"",X,DA)"
  1. K MSG
  1. D CREIXN^DDMOD(.XREF,"kS",.RESULT,"","MSG")
  1. I RESULT="" D DCERRMSG^PXRMP12I(.MSG,.XREF)
  1. ;Eliminate the original CST and ST indexes.
  1. D DELIXN^DDMOD(44,"CST")
  1. D DELIXN^DDMOD(44,"ST")
  1. K ^SC("CST")
  1. K ^SC("ST")
  1. Q
  1. ;