ICDZENT ; IHS/ANMC/MWR - ENTRY POINT FOR GROUPER VERSION 8; AUGUST 14, 1992
;; VERSION 8.0;DRG GROUPER;;AUG 14, 1992
;
; CALLING THIS ROUTINE WITH THE PROPER VARIABLES DEFINED WILL PRODUCE
; AN OUTPUT TO THE SCREEN GIVING THE DRG, HCFA WEIGHT AND GEOM MEAN
; LENGTH OF STAY.
;
; THE FOLLOWING VARIABLES NEED TO BE SET WHEN CALLING THE GROUPER
; AT THIS ENTRY POINT:
;
; SEX - SET SEX EQUAL TO "M" OR "F", E.G., S SEX="M"
;
; AGE - SET AGE EQUAL TO NUMBER OF YEARS, E.G., S AGE=35
;
; ICDEXP - SET ICDEXP=1 IF PATIENT DIED DURING EPISODE, 0 IF NOT.
;
; ICDTRS - SET ICDTRS=1 IF PATIENT TRANSFERRED TO ACUTE CARE
; FACILITY, 0 IF NOT.
;
; ICDDMS - SET ICDDMS=1 IF PATIENT DISCHARGED AGAINST MEDICAL
; ADVICE, 0 IF NOT.
;
; ICDDX(1) - SET ICDDX(1)=IE# OF THE PRIMARY DIAGNOSIS IN THE ICD9(
; GLOBAL (ICD DIAGNOSIS FILE).
;
; ICDDX(N) - SET ICDDX(N)=IE# OF SECONDARY DIAGNOSES IN THE ICD9(
; GLOBAL (ICD DIAGNOSIS FILE), WHERE N>1. IN OTHER WORDS,
; BUILD A LOCAL ARRAY OF SECONDARY DIAGNOSES.
;
; ICDPRC(N) - SET ICDPRC(N)=IE# OF PROCEDURES IN THE ICD0( GLOBAL
; (ICD OPERATION/PROCEDURE FILE). IN OTHER WORDS, BUILD
; A LOCAL ARRAY OF OPERATIONS/PROCEDURES.
; NOTE: IF THERE ARE NO OPERATIONS/PROCEDURES, THIS
; MAY BE LEFT UNDEFINED.
;
; EXAMPLE:
;
;S SEX="F"
;S AGE=35
;S ICDEXP=0,ICDTRS=1,ICDDMS=0
;S ICDDX(1)=8560,ICDDX(2)=8561
;S ICDPRC(1)=3229
;
; THE CALLING PROGRAM MAY ALSO DEFINE ICDZEN (S ICDZEN="") IN ORDER TO
; HAVE THE FOLLING VARIABLES RETURNED:
; ICDZDRG = THE CALCULATED DRG NUMBER
; ICDZDRT = TEXT OF THE DRG NUMBER
; ICDZWT = THE HCFA WEIGHT
; ICDZLOS = THE HCFA GEOM MEAN LOS
; NOTE: THESE VARIABLES WILL NOT BE KILLED BY THE ICD PROGRAM
; AND ARE THE RESPONSIBILITY OF THE CALLING PROGRAM.
;
; THE CALLING PROGRAM MAY ALSO DEFINE ICDZNOT (S ICDZNOT="") IN ORDER
; TO SUPPRESS ALL OUTPUT (FOR CASES WHEN ONLY THE RETURNED VARIABLES
; ARE DESIRED).
;
BEGIN ;
D ^XBKVAR
K ICDERR,ICDZDRG,ICDZLOS,ICDZWT
F ICDI="SEX","AGE","ICDEXP","ICDTRS","ICDDMS","ICDDX(1)" D
.I '$D(@ICDI) D S ICDERR=""
..W !,"The variable """,ICDI,""" is not defined. "
G:$D(ICDERR) EXIT
D ^ICDDRG
D WRT^ICDDRGM
;
EXIT ;
K ICDI,ICDERR,ICDZEN,ICDZNOT
ICDZENT ; IHS/ANMC/MWR - ENTRY POINT FOR GROUPER VERSION 8; AUGUST 14, 1992
+1 ;; VERSION 8.0;DRG GROUPER;;AUG 14, 1992
+2 ;
+3 ; CALLING THIS ROUTINE WITH THE PROPER VARIABLES DEFINED WILL PRODUCE
+4 ; AN OUTPUT TO THE SCREEN GIVING THE DRG, HCFA WEIGHT AND GEOM MEAN
+5 ; LENGTH OF STAY.
+6 ;
+7 ; THE FOLLOWING VARIABLES NEED TO BE SET WHEN CALLING THE GROUPER
+8 ; AT THIS ENTRY POINT:
+9 ;
+10 ; SEX - SET SEX EQUAL TO "M" OR "F", E.G., S SEX="M"
+11 ;
+12 ; AGE - SET AGE EQUAL TO NUMBER OF YEARS, E.G., S AGE=35
+13 ;
+14 ; ICDEXP - SET ICDEXP=1 IF PATIENT DIED DURING EPISODE, 0 IF NOT.
+15 ;
+16 ; ICDTRS - SET ICDTRS=1 IF PATIENT TRANSFERRED TO ACUTE CARE
+17 ; FACILITY, 0 IF NOT.
+18 ;
+19 ; ICDDMS - SET ICDDMS=1 IF PATIENT DISCHARGED AGAINST MEDICAL
+20 ; ADVICE, 0 IF NOT.
+21 ;
+22 ; ICDDX(1) - SET ICDDX(1)=IE# OF THE PRIMARY DIAGNOSIS IN THE ICD9(
+23 ; GLOBAL (ICD DIAGNOSIS FILE).
+24 ;
+25 ; ICDDX(N) - SET ICDDX(N)=IE# OF SECONDARY DIAGNOSES IN THE ICD9(
+26 ; GLOBAL (ICD DIAGNOSIS FILE), WHERE N>1. IN OTHER WORDS,
+27 ; BUILD A LOCAL ARRAY OF SECONDARY DIAGNOSES.
+28 ;
+29 ; ICDPRC(N) - SET ICDPRC(N)=IE# OF PROCEDURES IN THE ICD0( GLOBAL
+30 ; (ICD OPERATION/PROCEDURE FILE). IN OTHER WORDS, BUILD
+31 ; A LOCAL ARRAY OF OPERATIONS/PROCEDURES.
+32 ; NOTE: IF THERE ARE NO OPERATIONS/PROCEDURES, THIS
+33 ; MAY BE LEFT UNDEFINED.
+34 ;
+35 ; EXAMPLE:
+36 ;
+37 ;S SEX="F"
+38 ;S AGE=35
+39 ;S ICDEXP=0,ICDTRS=1,ICDDMS=0
+40 ;S ICDDX(1)=8560,ICDDX(2)=8561
+41 ;S ICDPRC(1)=3229
+42 ;
+43 ; THE CALLING PROGRAM MAY ALSO DEFINE ICDZEN (S ICDZEN="") IN ORDER TO
+44 ; HAVE THE FOLLING VARIABLES RETURNED:
+45 ; ICDZDRG = THE CALCULATED DRG NUMBER
+46 ; ICDZDRT = TEXT OF THE DRG NUMBER
+47 ; ICDZWT = THE HCFA WEIGHT
+48 ; ICDZLOS = THE HCFA GEOM MEAN LOS
+49 ; NOTE: THESE VARIABLES WILL NOT BE KILLED BY THE ICD PROGRAM
+50 ; AND ARE THE RESPONSIBILITY OF THE CALLING PROGRAM.
+51 ;
+52 ; THE CALLING PROGRAM MAY ALSO DEFINE ICDZNOT (S ICDZNOT="") IN ORDER
+53 ; TO SUPPRESS ALL OUTPUT (FOR CASES WHEN ONLY THE RETURNED VARIABLES
+54 ; ARE DESIRED).
+55 ;
BEGIN ;
+1 DO ^XBKVAR
+2 KILL ICDERR,ICDZDRG,ICDZLOS,ICDZWT
+3 FOR ICDI="SEX","AGE","ICDEXP","ICDTRS","ICDDMS","ICDDX(1)"
Begin DoDot:1
+4 IF '$DATA(@ICDI)
Begin DoDot:2
+5 WRITE !,"The variable """,ICDI,""" is not defined. "
End DoDot:2
SET ICDERR=""
End DoDot:1
+6 IF $DATA(ICDERR)
GOTO EXIT
+7 DO ^ICDDRG
+8 DO WRT^ICDDRGM
+9 ;
EXIT ;
+1 KILL ICDI,ICDERR,ICDZEN,ICDZNOT