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

PXBPMOD.m

Go to the documentation of this file.
  1. PXBPMOD ;ISA/EW,ESW - PROMPT MOD ; 10/31/02 12:12pm
  1. ;;1.0;PCE PATIENT CARE ENCOUNTER;**73,88,89,108**Aug 12, 1996
  1. ;
  1. ;
  1. ;
  1. Q
  1. ;
  1. MOD(PXVST,PXPAT,PXCPT,PXMODSTR,PXCPTIEN,PXVSTDAT,PXCNT,PXARR) ;
  1. ;CPT Modifier prompt
  1. ; Input:
  1. ; PXVST - Visit IEN.
  1. ; PXPAT - Patient IEN
  1. ; PXCPT - CPT code or IEN of its entry in CPT file (#81)
  1. ; PXMODSTR - User entered string of modifier codes in external
  1. ; format
  1. ; PXCPTIEN - IEN of CPT code entry in V CPT file (#9000010.18)
  1. ; PXVSTDAT - Visit date
  1. ; PXCNT - Number of active modifiers defined for CPT code
  1. ; Output:
  1. ; PXARR - Array containing modifiers.
  1. ;
  1. ;
  1. N DTOUT,DUOUT,DIROUT,DA,DIC,DR,PXGLB,Y
  1. S PXGLB="^AUPNVCPT"
  1. I $$VALCPT(PXCPT)<1 Q
  1. I +$$CPTOK^PXBUTL(PXCPT,PXVSTDAT)=0 Q
  1. I $G(PXCPTIEN)]"" S DA=PXCPTIEN
  1. I $G(PXCPTIEN)']"" D
  1. .D FILECPT
  1. .S (PXARR,PXNEWIEN)=DA
  1. ;Only prompt if there are active modifiers for the CPT code
  1. D:PXCNT>0 CPTMOD
  1. I $D(DTOUT)!$D(Y) D Q
  1. .S (EDATA,DATA)="^C"
  1. .;Remove incomplete V CPT entry
  1. .I $G(PXNEWIEN)]"" D REMOVE^PXCEVFIL(PXNEWIEN)
  1. D BLDARRY
  1. Q
  1. ;
  1. FILECPT ;Create a new entry in V CPT file and get IEN
  1. N X,Y,DD,DO,DR
  1. S DIC=PXGLB_"("
  1. S DIC(0)=""
  1. S X=PXCPT
  1. D FILE^DICN
  1. ;
  1. S DA=+Y
  1. S DIE=PXGLB_"("
  1. S DR=".02////^S X=PXPAT;.03////^S X=PXVST;"
  1. L +@(PXGLB_"(DA)"):10
  1. D ^DIE
  1. L -@(PXGLB_"(DA)")
  1. Q
  1. ;
  1. CPTMOD ;Prompt for CPT Modifiers
  1. N PXMOD,PXERR,PXI
  1. S DR=1
  1. S DIE=PXGLB_"("
  1. S DIC(0)="AELMQ"
  1. L +@(PXGLB_"(DA)")
  1. ;--File modifiers entered before prompting user
  1. I $G(PXMODSTR)]"" D
  1. .I $L(PXMODSTR,",")=1 S DR="1//"_PXMODSTR Q
  1. .S PXMOD=""
  1. .F PXI=1:1 S PXMOD=$P(PXMODSTR,",",PXI) Q:PXMOD="" D
  1. ..S PXERR=""
  1. ..D VAL^DIE(9000010.181,DA,.01,"",PXMOD,.PXERR)
  1. ..Q:PXERR="^"
  1. ..S DR="1///^S X=PXMOD"
  1. ..D ^DIE
  1. .S DR=1
  1. D ^DIE
  1. L -@(PXGLB_"(DA)")
  1. Q
  1. ;
  1. BLDARRY ;Copy new modifiers into local array
  1. N PXFIL,PXSUBFIL,PXSUB,PXARR2
  1. S PXFIL=9000010.18,PXSUBFIL=9000010.181
  1. D GETS^DIQ(PXFIL,DA,"1*","I","PXARR2")
  1. S PXSUB=""
  1. F S PXSUB=$O(PXARR2(PXSUBFIL,PXSUB)) Q:PXSUB="" D
  1. .S PXARR(1,+PXSUB)=PXARR2(PXSUBFIL,PXSUB,.01,"I")
  1. Q
  1. ;
  1. VALCPT(X) ;Determine if CPT code is valid
  1. ;internal or external value of CPT is evaluated
  1. N DIC,Y
  1. S DIC=81
  1. S DIC(0)="BN"
  1. D ^DIC
  1. Q Y