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

DVB4P66A.m

Go to the documentation of this file.
  1. DVB4P66A ;ALB/MJB/RC - DISABILITY FILE UPDATE ; 11/16/10 3:56pm
  1. ;;4.0;HINQ;**66**;03/25/92;Build 14
  1. ;
  1. ;This routine is the post-install driver that will map DISABILITY
  1. ;CONDITIONS in the DISABILITY CONDITION (#31) file with ICD
  1. ;DIAGNOSIS codes
  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 update the 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 DVBRTN,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,"ADDICD")) K @DVBTMP
  1. ;
  1. ;loop each routine
  1. ;F DVBCNT=1:1:2 S DVBRTN="^DVB464P"_DVBCNT D
  1. ;. Q:($T(@DVBRTN)="")
  1. ;. D BLDXRF(DVBRTN,DVBTMP,.DVBTOT)
  1. D BLDXRF("DVB4P66A",DVBTMP,.DVBTOT)
  1. Q
  1. ;
  1. ;
  1. BLDXRF(DVBRTN,DVBTMP,DVBTOT) ;call each routine to file 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="TEXT+"_DVBLN_U_DVBRTN,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. .;S DVBVBA=$P(DVBVB,"^",1),DVBLN=DVBLN+1
  1. .; - if code not found setup ^TMP() file error record
  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. ;
  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)) ;ICD9 already setup
  1. . . ;
  1. . . ;call to add multiple field (#20) RELATED ICD9 CODES
  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 (#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,DIC,DIE,DA,DR
  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))
  1. .I DA'>0 D Q:DA'>0
  1. ..W !!,"ADDING TO DISABILITY CODE "_DVBVBA_""
  1. ..W !!,"ADDING ICD CODE "_DVBICD_" TO MAPPING"
  1. ..S DIC="^DIC(31,"_DA(1)_",""ICD"",",DIC(0)="L",DIC("P")="31.01PA",DLAYGO=31.01
  1. ..S X=DVBICDEN
  1. ..K DD,DO D FILE^DICN
  1. ..S DA=+Y
  1. ..K DIC,DLAYGO,X,Y
  1. .;
  1. .S DIE="^DIC(31,"_DA(1)_",""ICD"","
  1. .S DR=".02///^S X=DVBMATCH"
  1. .D ^DIE
  1. .S:'$D(DVBERR) DVBRSLT=1
  1. Q DVBRSLT
  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. ;The following TEXT lines are a combination of a single 4 digit VBA
  1. ;rated disabilities code and related ICD9 DIAGNOSIS code to be
  1. ;mapped together. Each IDC9 code also has a (1/0)
  1. ;match value that will be filed with it.
  1. ;
  1. ;DISABILITY CODE^ICDCODE^MATCH - FULL(1) OR PARTIAL(0)
  1. TEXT ;
  1. ;;7705^287.41^1
  1. ;;7705^287.49^1
  1. ;;5238^724.03^0
  1. ;;7332^787.60^1
  1. ;;7332^787.61^1
  1. ;;7332^787.62^1
  1. ;;7332^787.63^1
  1. ;;8045^780.33^1
  1. ;;8861^389.9^1
  1. ;;8867^011.90^0
  1. ;;8882^352.9^0
  1. ;;8883^352.9^0
  1. ;;8884^352.9^0
  1. ;;8886^356.9^0
  1. ;;8887^356.9^0
  1. ;;8889^345.90^0
  1. ;;8892^298.9^1
  1. ;;8893^310.9^1
  1. ;;8894^300.9^1
  1. ;;8895^306.9^1
  1. ;;9007^298.9^1
  1. ;;EXIT