ONCNPI ;Hines OIFO/GWB - National Provider Identifier ;02/16/07
;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
;
FNPI ;Check FACILITY (160.19) for NPI (National Provider Identifier)
N Y
I FACPNT="" G FEXIT
D DTDXCK I DTDXCK="N" G FEXIT
S FAC=$P($G(^ONCO(160.19,FACPNT,0)),U,1)
S FACNAM=$P($G(^ONCO(160.19,FACPNT,0)),U,2)
I (FAC="00000000")!(FAC=9999999) G FEXIT
S NPI=$P($G(^ONCO(160.19,FACPNT,0)),U,6)
I NPI="" D ADDFNPI
FEXIT K DTDXCK,NPI,FACIEN,FAC,FACNAM,FACPNT
Q
;
DTDXCK ;Check for 2007+ DATE DX (165.5,3)
N PRI
I '$D(ONCOD0) S DTDXCK="Y" Q
S DTDXCK="N"
S PRI=0 F S PRI=$O(^ONCO(165.5,"C",ONCOD0,PRI)) Q:PRI'>0 I $P($G(^ONCO(165.5,PRI,0)),U,16)>3069999 S DTDXCK="Y" Q
Q
;
ADDFNPI ;Enter Organizational Provider NPI value
W !
W !," This facility needs to be associated with"
W !," an NPI (National Provider Identifier) code."
W !
FNPIR K DIR
S DIR("A")=" Select method of NPI entry: "
S DIR(0)="SAO^1:Get NPI from INSTITUTION file;2:Enter NPI code manually"
S DIR("??")="^D FNPIHLP^ONCNPI"
D ^DIR
I $D(DIRUT) S OUT=1 K DIRUT G FNPIEX
I Y<1 S OUT=1 G FNPIEX
S NPIANS=Y
I NPIANS=2 W ! R " Enter 10-digit NPI: ",NPI:60 G FNPICHK
DIC4 N DIC,DTOUT,DUOUT,INSTIEN
S DIC="^DIC(4,"
S DIC("A")=" Select INSTITUTION: "
S DIC(0)="AEQM"
S DIC("S")="I $P($G(^(""NPI"")),U,1)'="""""
D ^DIC
G:($D(DUOUT))!($D(DTOUT))!(Y=-1) FNPIEX
S INSTIEN=+Y
K DIR
S DIR("A")=" Is this the correct institution",DIR("B")="Y",DIR(0)="Y"
D ^DIR
G SETFNPI:Y,DIC4:Y=0 Q
SETFNPI S NPI=$P(^DIC(4,INSTIEN,"NPI"),U,1)
FNPICHK I (NPI="")!(NPI=U) W ! G FNPIEX
I NPI'?10N W !!,"The NPI code must be 10 digits.",!! G FNPIR
I $D(^ONCO(160.19,"F",NPI)) D G FNPIR
.S FACIEN=$O(^ONCO(160.19,"F",NPI,0))
.S FAC=$P(^ONCO(160.19,FACIEN,0),U,2)
.W !!," This NPI is already being used by ",FAC,".",!
W !!," NPI code ",NPI," has been added for:"
W !," ",FACNAM
S $P(^ONCO(160.19,FACPNT,0),U,6)=NPI
S ^ONCO(160.19,"F",NPI,FACPNT)=""
FNPIEX W !
K NPIANS Q
;
FNPIIT ;NPI (160.19,101) INPUT TRANSFORM
I $D(^ONCO(160.19,"F",X)) D
.S FACIEN=$O(^ONCO(160.19,"F",X,0))
.I FACIEN'=DA D K X
..S FAC=$P(^ONCO(160.19,FACIEN,0),U,2)
..W !!," This NPI code is already being used by ",FAC,".",!
K FACIEN,FAC
Q
;
PNPI ;Check ONCOLOGY CONTACT (165) for NPI (National Provider Identifier)
N Y,DATEDX
I PHYPNT="" G PEXIT
S DATEDX=$$GET1^DIQ(165.5,D0,3,"I")
I (DATEDX<3070000)&(DATEDX'="") G PEXIT
S PHY=$P($G(^ONCO(165,PHYPNT,0)),U,1)
I (PHY="00000000")!(PHY=88888888)!(PHY=99999999) G PEXIT
S NPI=$P($G(^ONCO(165,PHYPNT,0)),U,5)
I NPI="" D ADDPNPI
PEXIT K NPI,FACIEN,FAC,FACPNT,PHY,PHYPNT
Q
;
ADDPNPI ;Enter Individual Provider NPI value
W !
W !," This provider needs to be associated with"
W !," an NPI (National Provider Identifier) code."
W !
;
PNPIR K DIR
S DIR("A")=" Select method of NPI entry: "
S DIR(0)="SAO^1:Get NPI from NEW PERSON file;2:Enter NPI code manually"
S DIR("??")="^D PNPIHLP^ONCNPI"
D ^DIR
I $D(DIRUT) S OUT=1 K DIRUT G PNPIEX
I Y<1 S OUT=1 G PNPIEX
S NPIANS=Y
I NPIANS=2 W ! R " Enter 10-digit NPI: ",NPI:60 G PNPICHK
DIC200 N DTOUT,DUOUT,VAIEN
S DIC="^VA(200,"
S DIC("A")=" Select PROVIDER: "
S DIC(0)="AEQM"
S DIC("S")="I $P($G(^(""NPI"")),U,1)'="""""
D ^DIC
G:($D(DUOUT))!($D(DTOUT))!(Y=-1) PNPIEX
S VAIEN=+Y
K DIR
S DIR("A")=" Is this the correct provider",DIR("B")="Y",DIR(0)="Y"
D ^DIR
G SETPNPI:Y,DIC200:Y=0 Q
SETPNPI S NPI=$P(^VA(200,VAIEN,"NPI"),U,1)
PNPICHK I (NPI="")!(NPI=U) W ! G PNPIEX
I NPI'?10N W !!,"The NPI code must be 10 digits.",!! G PNPIR
;I $D(^ONCO(165,"F",NPI)) D G PNPIR
;.S PHYIEN=$O(^ONCO(165,"F",NPI,0))
;.S PHY=$P(^ONCO(165,PHYIEN,0),U,1)
;.W !!," This NPI code is already being used by ",PHY,".",!!
W !!," NPI code ",NPI," has been added for ",PHY,"."
S $P(^ONCO(165,PHYPNT,0),U,5)=NPI
S ^ONCO(165,"F",NPI,PHYPNT)=""
PNPIEX W !
K NPIANS,PHY Q
;
PNPIIT ;NPI (165,101) INPUT TRANSFORM
;I $D(^ONCO(165,"F",X)) D
;.S PHYIEN=$O(^ONCO(165,"F",X,0))
;.I PHYIEN'=DA D K X
;..S PHY=$P(^ONCO(165,PHYIEN,0),U,1)
;..W !!," This NPI code is already being used by ",PHY,".",!
;K PHYIEN,PHY
Q
;
FNPIHLP ;"??" NPI help
W !," Select 'Get NPI from INSTITUTION file' if you wish to"
W !," extract the Organizational Provider NPI code from the"
W !," INSTITUTION file."
W !
W !," Select 'Enter NPI code manually' if you wish to enter"
W !," the 10-digit NPI code manually."
W !
W !," NPI codes for Organizational Providers can be found by"
W !," searching the NPI Registry at the following websites:"
W !
W !," https://nppes.cms.hhs.gov"
W !," Click on ""Search the NPI Registry""."
W !
W !," http://www.npinumberlookup.org/"
Q
;
PNPIHLP ;"??" NPI help
W !," Select 'Get NPI from NEW PERSON file' if you wish to"
W !," extract the Individual Provider NPI code from the"
W !," NEW PERSON file."
W !
W !," Select 'Enter NPI code manually' if you wish to enter"
W !," the 10-digit NPI code manually."
W !
W !," NPI codes for Individual Providers can be found by searching"
W !," the NPI Registry at the following websites:"
W !
W !," https://nppes.cms.hhs.gov"
W !," Click on ""Search the NPI Registry""."
W !
W !," http://www.npinumberlookup.org/"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HONCNPI 5366 printed Oct 16, 2024@18:24:45 Page 2
ONCNPI ;Hines OIFO/GWB - National Provider Identifier ;02/16/07
+1 ;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
+2 ;
FNPI ;Check FACILITY (160.19) for NPI (National Provider Identifier)
+1 NEW Y
+2 IF FACPNT=""
GOTO FEXIT
+3 DO DTDXCK
IF DTDXCK="N"
GOTO FEXIT
+4 SET FAC=$PIECE($GET(^ONCO(160.19,FACPNT,0)),U,1)
+5 SET FACNAM=$PIECE($GET(^ONCO(160.19,FACPNT,0)),U,2)
+6 IF (FAC="00000000")!(FAC=9999999)
GOTO FEXIT
+7 SET NPI=$PIECE($GET(^ONCO(160.19,FACPNT,0)),U,6)
+8 IF NPI=""
DO ADDFNPI
FEXIT KILL DTDXCK,NPI,FACIEN,FAC,FACNAM,FACPNT
+1 QUIT
+2 ;
DTDXCK ;Check for 2007+ DATE DX (165.5,3)
+1 NEW PRI
+2 IF '$DATA(ONCOD0)
SET DTDXCK="Y"
QUIT
+3 SET DTDXCK="N"
+4 SET PRI=0
FOR
SET PRI=$ORDER(^ONCO(165.5,"C",ONCOD0,PRI))
if PRI'>0
QUIT
IF $PIECE($GET(^ONCO(165.5,PRI,0)),U,16)>3069999
SET DTDXCK="Y"
QUIT
+5 QUIT
+6 ;
ADDFNPI ;Enter Organizational Provider NPI value
+1 WRITE !
+2 WRITE !," This facility needs to be associated with"
+3 WRITE !," an NPI (National Provider Identifier) code."
+4 WRITE !
FNPIR KILL DIR
+1 SET DIR("A")=" Select method of NPI entry: "
+2 SET DIR(0)="SAO^1:Get NPI from INSTITUTION file;2:Enter NPI code manually"
+3 SET DIR("??")="^D FNPIHLP^ONCNPI"
+4 DO ^DIR
+5 IF $DATA(DIRUT)
SET OUT=1
KILL DIRUT
GOTO FNPIEX
+6 IF Y<1
SET OUT=1
GOTO FNPIEX
+7 SET NPIANS=Y
+8 IF NPIANS=2
WRITE !
READ " Enter 10-digit NPI: ",NPI:60
GOTO FNPICHK
DIC4 NEW DIC,DTOUT,DUOUT,INSTIEN
+1 SET DIC="^DIC(4,"
+2 SET DIC("A")=" Select INSTITUTION: "
+3 SET DIC(0)="AEQM"
+4 SET DIC("S")="I $P($G(^(""NPI"")),U,1)'="""""
+5 DO ^DIC
+6 if ($DATA(DUOUT))!($DATA(DTOUT))!(Y=-1)
GOTO FNPIEX
+7 SET INSTIEN=+Y
+8 KILL DIR
+9 SET DIR("A")=" Is this the correct institution"
SET DIR("B")="Y"
SET DIR(0)="Y"
+10 DO ^DIR
+11 if Y
GOTO SETFNPI
if Y=0
GOTO DIC4
QUIT
SETFNPI SET NPI=$PIECE(^DIC(4,INSTIEN,"NPI"),U,1)
FNPICHK IF (NPI="")!(NPI=U)
WRITE !
GOTO FNPIEX
+1 IF NPI'?10N
WRITE !!,"The NPI code must be 10 digits.",!!
GOTO FNPIR
+2 IF $DATA(^ONCO(160.19,"F",NPI))
Begin DoDot:1
+3 SET FACIEN=$ORDER(^ONCO(160.19,"F",NPI,0))
+4 SET FAC=$PIECE(^ONCO(160.19,FACIEN,0),U,2)
+5 WRITE !!," This NPI is already being used by ",FAC,".",!
End DoDot:1
GOTO FNPIR
+6 WRITE !!," NPI code ",NPI," has been added for:"
+7 WRITE !," ",FACNAM
+8 SET $PIECE(^ONCO(160.19,FACPNT,0),U,6)=NPI
+9 SET ^ONCO(160.19,"F",NPI,FACPNT)=""
FNPIEX WRITE !
+1 KILL NPIANS
QUIT
+2 ;
FNPIIT ;NPI (160.19,101) INPUT TRANSFORM
+1 IF $DATA(^ONCO(160.19,"F",X))
Begin DoDot:1
+2 SET FACIEN=$ORDER(^ONCO(160.19,"F",X,0))
+3 IF FACIEN'=DA
Begin DoDot:2
+4 SET FAC=$PIECE(^ONCO(160.19,FACIEN,0),U,2)
+5 WRITE !!," This NPI code is already being used by ",FAC,".",!
End DoDot:2
KILL X
End DoDot:1
+6 KILL FACIEN,FAC
+7 QUIT
+8 ;
PNPI ;Check ONCOLOGY CONTACT (165) for NPI (National Provider Identifier)
+1 NEW Y,DATEDX
+2 IF PHYPNT=""
GOTO PEXIT
+3 SET DATEDX=$$GET1^DIQ(165.5,D0,3,"I")
+4 IF (DATEDX<3070000)&(DATEDX'="")
GOTO PEXIT
+5 SET PHY=$PIECE($GET(^ONCO(165,PHYPNT,0)),U,1)
+6 IF (PHY="00000000")!(PHY=88888888)!(PHY=99999999)
GOTO PEXIT
+7 SET NPI=$PIECE($GET(^ONCO(165,PHYPNT,0)),U,5)
+8 IF NPI=""
DO ADDPNPI
PEXIT KILL NPI,FACIEN,FAC,FACPNT,PHY,PHYPNT
+1 QUIT
+2 ;
ADDPNPI ;Enter Individual Provider NPI value
+1 WRITE !
+2 WRITE !," This provider needs to be associated with"
+3 WRITE !," an NPI (National Provider Identifier) code."
+4 WRITE !
+5 ;
PNPIR KILL DIR
+1 SET DIR("A")=" Select method of NPI entry: "
+2 SET DIR(0)="SAO^1:Get NPI from NEW PERSON file;2:Enter NPI code manually"
+3 SET DIR("??")="^D PNPIHLP^ONCNPI"
+4 DO ^DIR
+5 IF $DATA(DIRUT)
SET OUT=1
KILL DIRUT
GOTO PNPIEX
+6 IF Y<1
SET OUT=1
GOTO PNPIEX
+7 SET NPIANS=Y
+8 IF NPIANS=2
WRITE !
READ " Enter 10-digit NPI: ",NPI:60
GOTO PNPICHK
DIC200 NEW DTOUT,DUOUT,VAIEN
+1 SET DIC="^VA(200,"
+2 SET DIC("A")=" Select PROVIDER: "
+3 SET DIC(0)="AEQM"
+4 SET DIC("S")="I $P($G(^(""NPI"")),U,1)'="""""
+5 DO ^DIC
+6 if ($DATA(DUOUT))!($DATA(DTOUT))!(Y=-1)
GOTO PNPIEX
+7 SET VAIEN=+Y
+8 KILL DIR
+9 SET DIR("A")=" Is this the correct provider"
SET DIR("B")="Y"
SET DIR(0)="Y"
+10 DO ^DIR
+11 if Y
GOTO SETPNPI
if Y=0
GOTO DIC200
QUIT
SETPNPI SET NPI=$PIECE(^VA(200,VAIEN,"NPI"),U,1)
PNPICHK IF (NPI="")!(NPI=U)
WRITE !
GOTO PNPIEX
+1 IF NPI'?10N
WRITE !!,"The NPI code must be 10 digits.",!!
GOTO PNPIR
+2 ;I $D(^ONCO(165,"F",NPI)) D G PNPIR
+3 ;.S PHYIEN=$O(^ONCO(165,"F",NPI,0))
+4 ;.S PHY=$P(^ONCO(165,PHYIEN,0),U,1)
+5 ;.W !!," This NPI code is already being used by ",PHY,".",!!
+6 WRITE !!," NPI code ",NPI," has been added for ",PHY,"."
+7 SET $PIECE(^ONCO(165,PHYPNT,0),U,5)=NPI
+8 SET ^ONCO(165,"F",NPI,PHYPNT)=""
PNPIEX WRITE !
+1 KILL NPIANS,PHY
QUIT
+2 ;
PNPIIT ;NPI (165,101) INPUT TRANSFORM
+1 ;I $D(^ONCO(165,"F",X)) D
+2 ;.S PHYIEN=$O(^ONCO(165,"F",X,0))
+3 ;.I PHYIEN'=DA D K X
+4 ;..S PHY=$P(^ONCO(165,PHYIEN,0),U,1)
+5 ;..W !!," This NPI code is already being used by ",PHY,".",!
+6 ;K PHYIEN,PHY
+7 QUIT
+8 ;
FNPIHLP ;"??" NPI help
+1 WRITE !," Select 'Get NPI from INSTITUTION file' if you wish to"
+2 WRITE !," extract the Organizational Provider NPI code from the"
+3 WRITE !," INSTITUTION file."
+4 WRITE !
+5 WRITE !," Select 'Enter NPI code manually' if you wish to enter"
+6 WRITE !," the 10-digit NPI code manually."
+7 WRITE !
+8 WRITE !," NPI codes for Organizational Providers can be found by"
+9 WRITE !," searching the NPI Registry at the following websites:"
+10 WRITE !
+11 WRITE !," https://nppes.cms.hhs.gov"
+12 WRITE !," Click on ""Search the NPI Registry""."
+13 WRITE !
+14 WRITE !," http://www.npinumberlookup.org/"
+15 QUIT
+16 ;
PNPIHLP ;"??" NPI help
+1 WRITE !," Select 'Get NPI from NEW PERSON file' if you wish to"
+2 WRITE !," extract the Individual Provider NPI code from the"
+3 WRITE !," NEW PERSON file."
+4 WRITE !
+5 WRITE !," Select 'Enter NPI code manually' if you wish to enter"
+6 WRITE !," the 10-digit NPI code manually."
+7 WRITE !
+8 WRITE !," NPI codes for Individual Providers can be found by searching"
+9 WRITE !," the NPI Registry at the following websites:"
+10 WRITE !
+11 WRITE !," https://nppes.cms.hhs.gov"
+12 WRITE !," Click on ""Search the NPI Registry""."
+13 WRITE !
+14 WRITE !," http://www.npinumberlookup.org/"
+15 QUIT