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

GMPLP44I.m

Go to the documentation of this file.
  1. GMPLP44I ; SLC/PKR - Update cross-references for Clinical Reminders Index. ;04/18/2014
  1. ;;2.0;Problem List;**44**;Aug 25, 1994;Build 92
  1. ;
  1. Q
  1. ;===========================================
  1. AWRITE(REF) ;Write all the descendants of the array.
  1. N DONE,IND,LEN,LN,PROOT,ROOT,START,TEMP,TEXT
  1. I REF="" Q
  1. S LN=0
  1. S PROOT=$P(REF,")",1)
  1. ;Build the root so we can tell when we are done.
  1. S TEMP=$NA(@REF)
  1. S ROOT=$P(TEMP,")",1)
  1. S REF=$Q(@REF)
  1. I REF'[ROOT Q
  1. S DONE=0
  1. F Q:(REF="")!(DONE) D
  1. . S START=$F(REF,ROOT)
  1. . S LEN=$L(REF)
  1. . S IND=$E(REF,START,LEN)
  1. . S LN=LN+1,TEXT(LN)=PROOT_IND_"="_@REF
  1. . S REF=$Q(@REF)
  1. . I REF'[ROOT S DONE=1
  1. D MES^XPDUTL(.TEXT)
  1. Q
  1. ;
  1. ;===========================================
  1. CACR01 ;Update the cross-reference for the .01 field.
  1. N MSG,NAME,RESULT,XREF
  1. D BMES^XPDUTL("Creating Problem List .01 diagnosis cross-reference.")
  1. S XREF("FILE")=9000011
  1. S XREF("ROOT FILE")=9000011
  1. S XREF("TYPE")="MU"
  1. S XREF("SHORT DESCR")="Clinical Reminders Index for ICD diagnosis code 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 ICD diagnosis code and one for"
  1. S XREF("DESCR",3)="finding all the ICD diagnosis codes a patient has. The indexes are"
  1. S XREF("DESCR",4)="stored in the Clinical Reminders Index global as:"
  1. S XREF("DESCR",5)=" ^PXRMINDX(9000011,CODESYS,""ISPP"",CODE,STATUS,PRIORITY,DFN,DLM,DAS)"
  1. S XREF("DESCR",6)=" ^PXRMINDX(9000011,CODESYS,""PSPI"",DFN,STATUS,PRIORITY,CODE,DLM,DAS)"
  1. S XREF("DESCR",7)="respectively."
  1. S XREF("DESCR",8)=" "
  1. S XREF("DESCR",9)="CODESYS is the standard three-character abbreviation for the coding system."
  1. S XREF("DESCR",10)="STATUS can be ""A"" for active or ""I"" for inactive. PRIORITY"
  1. S XREF("DESCR",11)="can be ""A"" for acute or ""C"" for chronic. If PRIORITY is"
  1. S XREF("DESCR",12)="missing, then a ""U"" will be stored in the Index. For"
  1. S XREF("DESCR",13)="Problems whose PRIORITY is ""C"", Clinical Reminders uses"
  1. S XREF("DESCR",14)="today's date for the date of the Problem. In all other"
  1. S XREF("DESCR",15)="cases, Clinical Reminders uses DLM, where DLM is the Date"
  1. S XREF("DESCR",16)="Last Modified. When Problems are ""removed"", then CONDITION"
  1. S XREF("DESCR",17)="is set to ""H"" for hidden. Hidden Problems are not indexed."
  1. S XREF("DESCR",18)="For complete details, see the Clinical Reminders Index"
  1. S XREF("DESCR",19)="Technical Guide/Programmer's Manual."
  1. ;
  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)=.02
  1. S XREF("VAL",2,"SUBSCRIPT")=2
  1. S XREF("VAL",3)=.03
  1. S XREF("VAL",3,"SUBSCRIPT")=3
  1. S XREF("VAL",4)=.12
  1. S XREF("VAL",4,"SUBSCRIPT")=4
  1. S XREF("VAL",5)=1.14
  1. S XREF("VAL",6)=1.02
  1. S XREF("VAL",7)=80202
  1. ;
  1. S XREF("NAME")="ACR01"
  1. S XREF("SET")="D SPROB01^GMPLPXRM(.X,.DA)"
  1. S XREF("KILL")="D KPROB01^GMPLPXRM(.X,.DA)"
  1. ;Remove any existing cross-references before creating the new one.
  1. D DELIXN^DDMOD(9000011,"ACR","","MSG")
  1. D DELIXN^DDMOD(9000011,"ACR01","","MSG")
  1. K MSG
  1. D CREIXN^DDMOD(.XREF,"",.RESULT,"","MSG")
  1. I RESULT="" D DCERRMSG^GMPLP44I(.MSG,.XREF)
  1. Q
  1. ;
  1. ;===========================================
  1. CACRMT ;Create the cross-reference for Mapping Targets multiple.
  1. ;Make sure the field exists.
  1. I $$GET1^DID(9000011,80300,"","GLOBAL SUBSCRIPT LOCATION")="" Q
  1. N MSG,NAME,RESULT,XREF
  1. D BMES^XPDUTL("Creating Problem List Mapping Targets cross-reference.")
  1. S XREF("FILE")=9000011
  1. S XREF("ROOT FILE")=9000011.803
  1. S XREF("TYPE")="MU"
  1. S XREF("SHORT DESCR")="Clinical Reminders Index for Mapping Targets code 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 Mapping Target code and one for"
  1. S XREF("DESCR",3)="finding all the Mapping Target codes a patient has. The indexes are"
  1. S XREF("DESCR",4)="stored in the Clinical Reminders Index global as:"
  1. S XREF("DESCR",5)=" ^PXRMINDX(9000011,CODESYS,""ISPP"",CODE,STATUS,PRIORITY,DFN,DLM,DAS)"
  1. S XREF("DESCR",6)=" ^PXRMINDX(9000011,CODESYS,""PSPI"",DFN,STATUS,PRIORITY,CODE,DLM,DAS)"
  1. S XREF("DESCR",7)="respectively."
  1. S XREF("DESCR",8)=" "
  1. S XREF("DESCR",9)="CODESYS is the standard three-character abbreviation for the coding system."
  1. S XREF("DESCR",10)="STATUS can be ""A"" for active or ""I"" for inactive. PRIORITY"
  1. S XREF("DESCR",11)="can be ""A"" for acute or ""C"" for chronic. If PRIORITY is"
  1. S XREF("DESCR",12)="missing, then a ""U"" will be stored in the Index. For"
  1. S XREF("DESCR",13)="Problems whose PRIORITY is ""C"", Clinical Reminders uses"
  1. S XREF("DESCR",14)="today's date for the date of the Problem. In all other"
  1. S XREF("DESCR",15)="cases, Clinical Reminders uses DLM, where DLM is the Date"
  1. S XREF("DESCR",16)="Last Modified. When Problems are ""removed"", then CONDITION"
  1. S XREF("DESCR",17)="is set to ""H"" for hidden. Hidden Problems are not indexed."
  1. S XREF("DESCR",18)="For complete details, see the Clinical Reminders Index"
  1. S XREF("DESCR",19)="Technical Guide/Programmer's Manual."
  1. ;
  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)=.02
  1. S XREF("VAL",2,"SUBSCRIPT")=2
  1. ;
  1. S XREF("NAME")="ACRMT"
  1. S XREF("SET")="D SPROBMT^GMPLPXRM(.X,.DA)"
  1. S XREF("KILL")="D KPROBMT^GMPLPXRM(.X,.DA)"
  1. ;Remove any existing cross-references before creating the new one.
  1. D DELIXN^DDMOD(9000011,"ACRMT","","MSG")
  1. K MSG
  1. D CREIXN^DDMOD(.XREF,"",.RESULT,"","MSG")
  1. I RESULT="" D DCERRMSG^GMPLP44I(.MSG,.XREF)
  1. Q
  1. ;
  1. ;===========================================
  1. CACRSCT ;Create the cross-reference for the SNOMED CT CONCEPT CODE.
  1. ;Make sure the field exists.
  1. I $$GET1^DID(9000011,80001,"","GLOBAL SUBSCRIPT LOCATION")="" Q
  1. N MSG,NAME,RESULT,XREF
  1. D BMES^XPDUTL("Creating Problem List SNOMED CT cross-reference.")
  1. S XREF("FILE")=9000011
  1. S XREF("ROOT FILE")=9000011
  1. S XREF("TYPE")="MU"
  1. S XREF("SHORT DESCR")="Clinical Reminders Index for SNOMED CT concept code 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 SNOMED CT code and one for"
  1. S XREF("DESCR",3)="finding all the SNOMED CT codes a patient has. The indexes are"
  1. S XREF("DESCR",4)="stored in the Clinical Reminders Index global as:"
  1. S XREF("DESCR",5)=" ^PXRMINDX(9000011,CODESYS,""ISPP"",CODE,STATUS,PRIORITY,DFN,DLM,DAS)"
  1. S XREF("DESCR",6)=" ^PXRMINDX(9000011,CODESYS,""PSPI"",DFN,STATUS,PRIORITY,CODE,DLM,DAS)"
  1. S XREF("DESCR",7)="respectively."
  1. S XREF("DESCR",8)=" "
  1. S XREF("DESCR",9)="CODESYS is the standard three-character abbreviation for the coding system."
  1. S XREF("DESCR",10)="STATUS can be ""A"" for active or ""I"" for inactive. PRIORITY"
  1. S XREF("DESCR",11)="can be ""A"" for acute or ""C"" for chronic. If PRIORITY is"
  1. S XREF("DESCR",12)="missing, then a ""U"" will be stored in the Index. For"
  1. S XREF("DESCR",13)="Problems whose PRIORITY is ""C"", Clinical Reminders uses"
  1. S XREF("DESCR",14)="today's date for the date of the Problem. In all other"
  1. S XREF("DESCR",15)="cases, Clinical Reminders uses DLM, where DLM is the Date"
  1. S XREF("DESCR",16)="Last Modified. When Problems are ""removed"", then CONDITION"
  1. S XREF("DESCR",17)="is set to ""H"" for hidden. Hidden Problems are not indexed."
  1. S XREF("DESCR",18)="For complete details, see the Clinical Reminders Index"
  1. S XREF("DESCR",19)="Technical Guide/Programmer's Manual."
  1. ;
  1. S XREF("EXECUTION")="R"
  1. S XREF("ACTIVITY")="IR"
  1. S XREF("VAL",1)=80001
  1. S XREF("VAL",1,"SUBSCRIPT")=1
  1. S XREF("VAL",2)=.02
  1. S XREF("VAL",2,"SUBSCRIPT")=2
  1. S XREF("VAL",3)=.03
  1. S XREF("VAL",3,"SUBSCRIPT")=3
  1. S XREF("VAL",4)=.12
  1. S XREF("VAL",4,"SUBSCRIPT")=4
  1. S XREF("VAL",5)=1.14
  1. S XREF("VAL",6)=1.02
  1. ;
  1. S XREF("NAME")="ACRSCT"
  1. S XREF("SET")="D SPROBSCT^GMPLPXRM(.X,.DA)"
  1. S XREF("KILL")="D KPROBSCT^GMPLPXRM(.X,.DA)"
  1. ;Remove any existing cross-references before creating the new one.
  1. D DELIXN^DDMOD(9000011,"ACRSCT","","MSG")
  1. K MSG
  1. D CREIXN^DDMOD(.XREF,"",.RESULT,"","MSG")
  1. I RESULT="" D DCERRMSG^GMPLP44I(.MSG,.XREF)
  1. Q
  1. ;
  1. ;===========================================
  1. CPROBXR ;Create all the cross-references.
  1. D BMES^XPDUTL("Creating Clinical Reminders Index cross-references.")
  1. D CACR01^GMPLP44I
  1. D CACRSCT^GMPLP44I
  1. D CACRMT^GMPLP44I
  1. Q
  1. ;
  1. ;===========================================
  1. DCERRMSG(MSG,XREF) ;Display cross-reference creation errors.
  1. D BMES^XPDUTL("A cross-reference could not be created. The error message is:")
  1. D AWRITE^DG53862I("MSG")
  1. D BMES^XPDUTL("Cross-reference information:")
  1. D AWRITE^DG53862I("XREF")
  1. Q
  1. ;
  1. ;===========================================
  1. POST ;Post-init
  1. ;Update the cross-references.
  1. D CPROBXR^GMPLP44I
  1. ;Rebuild the Index in the new format.
  1. D REINDEX^GMPLP44I
  1. Q
  1. ;
  1. ;===========================================
  1. REINDEX ;Rebuild the Problem List portion of the Clinical Reminders Index in
  1. ;the new structure.
  1. N TEXT,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSK
  1. ;If the Index has already been restructured don't do it again.
  1. I $D(^PXRMINDX(9000011,"ICD")),$D(^PXRMINDX(9000011,"DATE BUILT")) D
  1. . S TEXT(1)="The Problem List Index has already been rebuilt, skipping another rebuild."
  1. I $D(^PXRMINDX(9000011,"ICD")),'$D(^PXRMINDX(9000011,"DATE BUILT")) D
  1. . S TEXT(1)="The Problem List Index has been partially rebuilt; not starting another rebuild in case a rebuild is in progress."
  1. . S TEXT(2)="Please make sure the Index is completely rebuilt."
  1. I $D(TEXT(1)) D BMES^XPDUTL(.TEXT) Q
  1. S ZTRTN="INDEX^GMPLPXRM"
  1. S ZTDESC="Problem List Clinical Reminders Index rebuild"
  1. S ZTDTH=$H
  1. S ZTIO=""
  1. D ^%ZTLOAD
  1. S TEXT(1)="Problem List Clinical Reminders Index rebuild queued."
  1. S TEXT(2)="The task number is "_ZTSK_"."
  1. D MES^XPDUTL(.TEXT)
  1. Q
  1. ;