AVA200E ;IHS/OIT/FBD - EPCS-SPECIFIC PROVIDER EDIT SUBROUTINES
;;93.2;VA SUPPORT FILES;**24**;SEP 30, 2010;Build 6
;PATCH #24: Conditionalized DEA-related field edits in Add Provider - EPCS CR 09865 - IHS/OIT/FBD
;
Q
;
EPCSEDIT(AVADA) ;DETERMINE IF EDIT OF DEA# AND DEA EXPIRATION DATE FIELDS SHOULD BE PERMITTED
;AVADA = PROVIDER RECORD IEN IN FILE 200
;
N DA,DIE,DR,EPCSTAT,PROVIDER
S EPCSTAT=0
I +AVADA D ;PROCEED IF VALID FILE 200 ENTRY SELECTED
. S PROVIDER=+AVADA
. I $$CHKPATCH("OR*3.0*1017") D ;OR*3.0*1017 PATCH PRESENCE INDICATES EPCS HAS BEEN INSTALLED
. . D PKIUSE^ORWOR(.EPCSTAT,PROVIDER) ;IF SO, CHECK IF PROVIDER IS EPCS-ENABLED
. . I 'EPCSTAT D ;IF PROVIDER IS _NOT_ EPCS-ENABLED...
. . . D DEAEDIT(PROVIDER) ;...ALLOW DIRECT EDIT OF PROVIDER'S DEA-RELATED FIELDS
. . . I 1
. E D ;IF EPCS HAS NOT BEEN INSTALLED...
. . D DEAEDIT(PROVIDER) ;...ALLOW THE DIRECT EDIT OF DEA-RELATED FIELDS
. . I 1
Q
;
DEAEDIT(PROV) ;EDIT DEA-RELATED FIELDS FOR A PROVIDER
N DA,DIE,DR
S DIE=200,DA=PROV
;S DR="53.2;747.44" ;DEA#, DEA EXPIRATION DATE
;S DR=DR_";53.11;53.3;55.1;55.2;55.3;55.4;55.5;55.6" ;DETOX/MAINTENANCE ID NUMBER, VA#, SCHEDULE II NARCOTIC, SCHEDULE II NON-NARCOTIC, SCHEDULE III NARCOTIC, SCHEDULE III NON-NARCOTIC, SCHEDULE IV, SCHEDULE V
S DR="[AVA EPCS DEA EDIT]" ;SAME FIELD EDITS AS SPECIFIED IN ABOVE COMMENTS, W/REPLACEMENT "DEA X" DISPLAY LABEL FOR 53.11
D ^DIE
Q
;
CHKPATCH(X) ;CHECK IF A SPECIFIC PATCH HAS BEEN INSTALLED
; RETURNS 1 IF PATCH HAS BEEN INSTALLED, 0 IF NOT
;
N XPDA,OK
S OK=0
S XPDA=0
F S XPDA=$O(^XPD(9.7,"B",X,XPDA)) Q:'XPDA D
. I $P($G(^XPD(9.7,XPDA,0)),U,9)=3 S OK=1
;S AVAMSG=$S(OK'=1:"Missing <<<--- FIX IT!",1:"Present.")
;W !,$$CJ^XLFSTR("Need patch "_X_"....."_AVAMSG,IOM)
Q OK
AVA200E ;IHS/OIT/FBD - EPCS-SPECIFIC PROVIDER EDIT SUBROUTINES
+1 ;;93.2;VA SUPPORT FILES;**24**;SEP 30, 2010;Build 6
+2 ;PATCH #24: Conditionalized DEA-related field edits in Add Provider - EPCS CR 09865 - IHS/OIT/FBD
+3 ;
+4 QUIT
+5 ;
EPCSEDIT(AVADA) ;DETERMINE IF EDIT OF DEA# AND DEA EXPIRATION DATE FIELDS SHOULD BE PERMITTED
+1 ;AVADA = PROVIDER RECORD IEN IN FILE 200
+2 ;
+3 NEW DA,DIE,DR,EPCSTAT,PROVIDER
+4 SET EPCSTAT=0
+5 ;PROCEED IF VALID FILE 200 ENTRY SELECTED
IF +AVADA
Begin DoDot:1
+6 SET PROVIDER=+AVADA
+7 ;OR*3.0*1017 PATCH PRESENCE INDICATES EPCS HAS BEEN INSTALLED
IF $$CHKPATCH("OR*3.0*1017")
Begin DoDot:2
+8 ;IF SO, CHECK IF PROVIDER IS EPCS-ENABLED
DO PKIUSE^ORWOR(.EPCSTAT,PROVIDER)
+9 ;IF PROVIDER IS _NOT_ EPCS-ENABLED...
IF 'EPCSTAT
Begin DoDot:3
+10 ;...ALLOW DIRECT EDIT OF PROVIDER'S DEA-RELATED FIELDS
DO DEAEDIT(PROVIDER)
+11 IF 1
End DoDot:3
End DoDot:2
+12 ;IF EPCS HAS NOT BEEN INSTALLED...
IF '$TEST
Begin DoDot:2
+13 ;...ALLOW THE DIRECT EDIT OF DEA-RELATED FIELDS
DO DEAEDIT(PROVIDER)
+14 IF 1
End DoDot:2
End DoDot:1
+15 QUIT
+16 ;
DEAEDIT(PROV) ;EDIT DEA-RELATED FIELDS FOR A PROVIDER
+1 NEW DA,DIE,DR
+2 SET DIE=200
SET DA=PROV
+3 ;S DR="53.2;747.44" ;DEA#, DEA EXPIRATION DATE
+4 ;S DR=DR_";53.11;53.3;55.1;55.2;55.3;55.4;55.5;55.6" ;DETOX/MAINTENANCE ID NUMBER, VA#, SCHEDULE II NARCOTIC, SCHEDULE II NON-NARCOTIC, SCHEDULE III NARCOTIC, SCHEDULE III NON-NARCOTIC, SCHEDULE IV, SCHEDULE V
+5 ;SAME FIELD EDITS AS SPECIFIED IN ABOVE COMMENTS, W/REPLACEMENT "DEA X" DISPLAY LABEL FOR 53.11
SET DR="[AVA EPCS DEA EDIT]"
+6 DO ^DIE
+7 QUIT
+8 ;
CHKPATCH(X) ;CHECK IF A SPECIFIC PATCH HAS BEEN INSTALLED
+1 ; RETURNS 1 IF PATCH HAS BEEN INSTALLED, 0 IF NOT
+2 ;
+3 NEW XPDA,OK
+4 SET OK=0
+5 SET XPDA=0
+6 FOR
SET XPDA=$ORDER(^XPD(9.7,"B",X,XPDA))
IF 'XPDA
QUIT
Begin DoDot:1
+7 IF $PIECE($GET(^XPD(9.7,XPDA,0)),U,9)=3
SET OK=1
End DoDot:1
+8 ;S AVAMSG=$S(OK'=1:"Missing <<<--- FIX IT!",1:"Present.")
+9 ;W !,$$CJ^XLFSTR("Need patch "_X_"....."_AVAMSG,IOM)
+10 QUIT OK