ACDPCCLC ;IHS/ADC/EDE/KML - ENVIRONMENT CHECK FOR PCC LINK;
;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
;
START ;
NEW ACDPCCLC,Y,Z
S ACDPCCLC=0
D ICDCHK ; check for required icd codes
D LOCCHK ; check CDMIS LOCATION file
D EOJ
Q
;
ICDCHK ; CHECK FOR V65.4 & V70.8 ICD CODE FOR PCC LINK
S Y=$O(^ICD9("AB","V65.4",0))
I 'Y S ACDPCCLC=1 D ERROR^ACDPCCL("Cannot find ICD9 code V65.4 - without it you cannot run the PCC link.")
S Y=$O(^ICD9("AB","V70.8",0))
I 'Y S ACDPCCLC=1 D ERROR^ACDPCCL("Cannot find ICD9 code V70.8 - without it you cannot run the PCC link.")
Q
;
LOCCHK ; CHECK CDMIS LOCATION FILE FOR PCC LOCATION ENTRIES
S (Y,Z)=0
F S Y=$O(^ACDLOT(Y)) Q:'Y D:'$P($G(^(Y,0)),U,4)
. D ERROR^ACDPCCL("No PCC LOCATION for CDMIS LOCATION: "_$P(^ACDLOT(Y,0),U))
. S Z=1
. Q
I Z S ACDPCCLC=1 D ERROR^ACDPCCL("Without PCC LOCATION values you cannot run the PCC link.")
Q
;
EOJ ;
I ACDPCCLC K X H 3
Q
ACDPCCLC ;IHS/ADC/EDE/KML - ENVIRONMENT CHECK FOR PCC LINK;
+1 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
+2 ;
START ;
+1 NEW ACDPCCLC,Y,Z
+2 SET ACDPCCLC=0
+3 ; check for required icd codes
DO ICDCHK
+4 ; check CDMIS LOCATION file
DO LOCCHK
+5 DO EOJ
+6 QUIT
+7 ;
ICDCHK ; CHECK FOR V65.4 & V70.8 ICD CODE FOR PCC LINK
+1 SET Y=$ORDER(^ICD9("AB","V65.4",0))
+2 IF 'Y
SET ACDPCCLC=1
DO ERROR^ACDPCCL("Cannot find ICD9 code V65.4 - without it you cannot run the PCC link.")
+3 SET Y=$ORDER(^ICD9("AB","V70.8",0))
+4 IF 'Y
SET ACDPCCLC=1
DO ERROR^ACDPCCL("Cannot find ICD9 code V70.8 - without it you cannot run the PCC link.")
+5 QUIT
+6 ;
LOCCHK ; CHECK CDMIS LOCATION FILE FOR PCC LOCATION ENTRIES
+1 SET (Y,Z)=0
+2 FOR
SET Y=$ORDER(^ACDLOT(Y))
IF 'Y
QUIT
IF '$PIECE($GET(^(Y,0)),U,4)
Begin DoDot:1
+3 DO ERROR^ACDPCCL("No PCC LOCATION for CDMIS LOCATION: "_$PIECE(^ACDLOT(Y,0),U))
+4 SET Z=1
+5 QUIT
End DoDot:1
+6 IF Z
SET ACDPCCLC=1
DO ERROR^ACDPCCL("Without PCC LOCATION values you cannot run the PCC link.")
+7 QUIT
+8 ;
EOJ ;
+1 IF ACDPCCLC
KILL X
HANG 3
+2 QUIT