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

DVB4P66I.m

Go to the documentation of this file.
  1. DVB4P66I ;ALB/MJB/RC - DISABILITY FILE UPDATE ; 11/16/10 3:57pm
  1. ;;4.0;HINQ;**66**;03/25/92;Build 14
  1. ;
  1. ;This routine will delete ICD DIAGNOSIS mappings for DISABILITY
  1. ;CONDITIONS in the DISABILITY CONDITION (#31) file.
  1. ;
  1. Q ;no direct entry
  1. ;
  1. POST(DVBTMP,DVBTOT) ;post-install driver for updating the (#31) file
  1. ;This procedure will call a series of routines that contain the data
  1. ;element values that will be used to delete requested VBA-ICD9 mapping.
  1. ;
  1. ; Input:
  1. ; DVBTMP - Closed Root global reference for error reporting
  1. ; DVBTOT - Total number of ICD9 codes filed
  1. ;
  1. ; Output:
  1. ; DVBTMP - Temp file of error messages (if any)
  1. ; DVBTOT - Total number of ICD9 codes filed
  1. ;
  1. N DVBCNT
  1. S DVBTMP=$G(DVBTMP)
  1. S DVBTOT=$G(DVBTOT) I DVBTOT']"" S DVBTOT=0
  1. I DVBTMP']"" S DVBTMP=$NA(^TMP("DVB4P66",$J,"DELICD")) K @DVBTMP
  1. D BLDXRF(DVBTMP,.DVBTOT)
  1. ;
  1. BLDXRF(DVBTMP,DVBTOT) ;call delete VBA/ICD9 codes
  1. ;
  1. ; Input:
  1. ; DVBRTN - Post Install routine to process VBA/ICD9 codes
  1. ; DVBTMP - Closed Root global reference for error reporting
  1. ; DVBTOT - Total number of ICD9 codes filed
  1. ;
  1. ; Output:
  1. ; DVBTOT - Total number of ICD9 codes filed
  1. ;
  1. N DVBLINE ;$TEXT code line
  1. N DVBLN ;line counter incrementer
  1. N DVBTAG ;line tag of routine to process
  1. N DVBVBA ;VBA DX code (external value)
  1. N DVBVB ;DX CODE
  1. ;
  1. S (DVBLN,DVBVBA)=0
  1. ;
  1. F DVBLN=1:1 S DVBTAG="DELCODE+"_DVBLN,DVBLINE=$T(@DVBTAG) S DVBVB=$P(DVBLINE,";",3,999) Q:DVBLINE["EXIT" D
  1. .;get VBA DX CODE var setup
  1. .S DVBVBA=$P(DVBVB,"^",1)
  1. .I '$O(^DIC(31,"C",DVBVBA,"")) D
  1. ..S @DVBTMP@("ERROR",DVBVBA)="DX CODE not found in (#31) file"
  1. ..S DVBVBA=0
  1. ..;
  1. .;quit back to loop if no VBA code ien found (just in case)
  1. .I 'DVBVBA Q
  1. .;
  1. .D BLDVBA(DVBVBA,DVBLINE,.DVBTOT)
  1. Q
  1. ; ;
  1. BLDVBA(DVBVBA,DVBLINE,DVBTOT) ;extract ICD9 codes from text line
  1. ;
  1. ; Input:
  1. ; DVBVBA - VBA DX code (external value)
  1. ; DVBLINE - $TEXT code line of ICD9's
  1. ; DVBTOT - Total number of ICD9 codes filed
  1. ;
  1. ; Output:
  1. ; DVBTOT - Total number of ICD9 codes filed
  1. ;
  1. Q:'$G(DVBVBA)
  1. Q:$G(DVBLINE)'[";"
  1. ;
  1. N DVBDATA,DVBI,DVBICD,DVBICDEN,DVBIEN,DVBMATCH,DVBX
  1. ;
  1. ;loop in case there are multiple VBA iens setup
  1. I DVBVBA'="" S DVBIEN=0
  1. F S DVBIEN=$O(^DIC(31,"C",DVBVBA,DVBIEN)) Q:DVBIEN="" D
  1. . S DVBX=$P(DVBVB,"^",1)
  1. . S (DVBI,DVBICD)=0
  1. . F DVBI=1:1 S DVBDATA=$P(DVBX,"^",DVBI) Q:DVBDATA="" D
  1. . . Q:DVBDATA[";"
  1. . . S DVBICD=$P(DVBVB,"^",2),DVBMATCH=+$P(DVBVB,"^",3)
  1. . . ; - get ICD9 pointer from ICD DIAGNOSIS (#80) file
  1. . . S DVBICDEN=+$$ICDDX^ICDCODE(DVBICD,DT)
  1. . . I 'DVBICDEN!(DVBICDEN<0)!(DVBICD=DVBICDEN) D Q
  1. . . . S @DVBTMP@("ERROR",DVBVBA,DVBIEN,DVBICD)="not found in ICD DIAGNOSIS (#80) file"
  1. . . ;
  1. . . Q:'$D(^DIC(31,DVBIEN,"ICD","B",DVBICDEN)) ;
  1. . . ;
  1. . . I '$$FILEICD(DVBIEN,DVBICDEN,DVBMATCH) D Q
  1. . . . S @DVBTMP@("ERROR",DVBVBA,DVBIEN,DVBICD)="error filing to (#31) file"
  1. . . S DVBTOT=DVBTOT+1
  1. Q
  1. ;
  1. ;
  1. FILEICD(DVBIEN,DVBICDEN,DVBMATCH) ;file code mapping to delete icds from (#31) file
  1. ;
  1. ; Input:
  1. ; DVBIEN - ien of VBA DX CODE in file (#31)
  1. ; DVBICDEN - ien of ICD9 code in file (#80)
  1. ; DVBMATCH - match code (1 or 0)
  1. ;
  1. ; Output:
  1. ; Function result - 1 on success, 0 on failure
  1. ;
  1. ; Fields :
  1. ; (#20) RELATED ICD9 CODES - ICD;0 POINTER Multiple (#31.01)
  1. ; (#31.01) -- RELATED ICD9 CODES SUB-FILE
  1. ; Field(s):
  1. ; .01 RELATED ICD9 CODES - 0;1 POINTER TO ICD DIAGNOSIS FILE (#80)
  1. ; .02 ICD9 MATCH - 0;2 SET ('0' FOR PARTIAL MATCH; '1' FOR MATCH;)
  1. ;
  1. N DVBERR,DVBFDA,DVBRSLT,DIK
  1. S DVBRSLT=0
  1. ;
  1. I $G(DVBIEN),$G(DVBICDEN),$G(DVBMATCH)]"" D
  1. .S DA(1)=DVBIEN
  1. .S DA=$O(^DIC(31,DA(1),"ICD","B",DVBICDEN,0)) Q:DA'>0 D
  1. ..W !!,"DELETING FROM DISABILITY CODE "_DVBVBA_""
  1. ..W !!,"DELETING ICD CODE "_DVBICD_" FROM MAPPING"
  1. ..;I DA'>0 D Q:DA'>0
  1. ..S DIK="^DIC(31,"_DA(1)_",""ICD""," D ^DIK K DA
  1. .S:'$D(DVBERR) DVBRSLT=1
  1. Q DVBRSLT
  1. ;
  1. ;
  1. ;codes to be deleted
  1. DELCODE ;DISABILITY CODE^ICDCODE
  1. ;;7705^287.4
  1. ;;7332^787.6
  1. ;;EXIT
  1. Q