PXAPI ;ISL/dee - PCE's APIs ;4/16/97
;;1.0;PCE PATIENT CARE ENCOUNTER;**14,15,27,28**;Aug 12, 1996
Q
;
PROVNARR(PXPNAR,PXFILE,PXCLEX) ;Convert external Provider Narrative to internal.
;Input:
; PXPNAR Is the text of the provider narrative.
; PXFILE Is the file that the returned pointer will be stored in.
; If a new entry is created then this tells the context
; that it was created under by the file using it.
; PXCLEX Is and optional pointer to the Lexicon for this narrative.
;
;Returns:
; Pointer to the provider narrative file ^ narrative
; or pointer to the provider narrative file ^ narrative ^1
; where 1 indicates that the entry has just been added
; or -1 if was unsuccessful.
;
N DIC,Y,DLAYGO,DD,DO,DA
S DIC="^AUTNPOV(",DIC(0)="L",DLAYGO=9999999.27
S (DA,Y)=0
S X=$E(PXPNAR,1,245)
Q:X="" -1
L +^AUTNPOV(0):60
E W !,"The Provider Narrative is LOCKED try again." Q -1
F S DA=$O(^AUTNPOV("B",$E(X,1,30),DA)) Q:DA'>0 I $P(^AUTNPOV(DA,0),"^")=X S Y=DA_"^"_X Q
I '(+Y) D
. K DA,Y
. D FILE^DICN
. I +Y>0,($G(PXCLEX)!$G(PXFILE)) S ^AUTNPOV(+Y,757)=$G(PXCLEX)_"^"_$G(PXFILE)
L -^AUTNPOV(0)
Q $S(+Y>0:Y,1:-1)
;
STOPCODE(PXASTOP,PXAPAT,PXADATE) ;This is the function call to return the quantity
; of a particular Stop Code for a patient on one day.
;Input
; PXASTOP (required) pointer to #40.7
; PXAPAT (required) pointer to #2
; PXADATE (required) the date in Fileman format
; (time is ignored if passed)
;Returns
; the count of how many of that stop code are stored for that one day
;
N PXAVST,PXREVDAT,PXENDDAT,PXACOUNT
S PXASTOP=$G(PXASTOP)
S PXAPAT=+$G(PXAPAT)
S PXADATE=+$G(PXADATE)
S (PXACOUNT,PXAVST)=0
S PXREVDAT=9999999-$P(PXADATE,".")-.00000001
S PXENDDAT=PXREVDAT+.9
F S PXREVDAT=$O(^AUPNVSIT("AA",PXAPAT,PXREVDAT)) Q:'PXREVDAT!(PXREVDAT>PXENDDAT) D
. F S PXAVST=$O(^AUPNVSIT("AA",PXAPAT,PXREVDAT,PXAVST)) Q:'PXAVST D
.. I PXASTOP=$P(^AUPNVSIT(PXAVST,0),"^",8),"E"'=$P(^AUPNVSIT(PXAVST,0),"^",7) S PXACOUNT=PXACOUNT+1
Q PXACOUNT
;
CPT(PXACPT,PXAPAT,PXADATE,PXAHLOC) ;This is the function call to return the quantity
; of a particular CPT for a patient on one day and for
; one hospital location if passed.
;Input
; PXACPT (required) pointer to #81
; PXAPAT (required) pointer to #2
; PXADATE (required) the date in Fileman format
; (time is ignored if passed)
; PXAHLOC (optional) pointer to #44
;Returns
; the count of how many (and quinity) of that cpt code are stored for that one day
;
;
N PXAVST,PXAVCPT,PXREVDAT,PXENDDAT,PXACOUNT
S PXACPT=$G(PXACPT)
S PXAPAT=+$G(PXAPAT)
S PXADATE=+$G(PXADATE)
S PXAHLOC=+$G(PXAHLOC)
S (PXACOUNT,PXAVST)=0
S PXREVDAT=9999999-$P(PXADATE,".")-.00000001
S PXENDDAT=PXREVDAT+.9
F S PXREVDAT=$O(^AUPNVSIT("AA",PXAPAT,PXREVDAT)) Q:'PXREVDAT!(PXREVDAT>PXENDDAT) D
. F S PXAVST=$O(^AUPNVSIT("AA",PXAPAT,PXREVDAT,PXAVST)) Q:'PXAVST D
.. Q:"E"=$P(^AUPNVSIT(PXAVST,0),"^",7)
.. Q:"1"=$P(^AUPNVSIT(PXAVST,150),"^",2)
.. I PXAHLOC>0,PXAHLOC'=$P(^AUPNVSIT(PXAVST,0),"^",22) Q
.. S PXAVCPT=0
.. F S PXAVCPT=$O(^AUPNVCPT("AD",PXAVST,PXAVCPT)) Q:'PXAVCPT D
... I PXACPT=$P(^AUPNVCPT(PXAVCPT,0),"^",1) S PXACOUNT=PXACOUNT+$P(^(0),"^",16)
Q PXACOUNT
;
INTV(WHAT,PACKAGE,SOURCE,VISIT,HL,DFN,APPT,LIMITDT,ALLHLOC) ;This api will prompt the user for Visit and related V-file data used to document an encounter.
;See INTV^PXBAPI for parameters and return values.
;
I '($D(VISIT)#2) S VISIT=""
I '($D(DFN)#2) S DFN=""
I '($D(HL)#2) S HL=""
;
Q $$INTV^PXBAPI(WHAT,PACKAGE,SOURCE,.VISIT,.HL,.DFN,$G(APPT),$G(LIMITDT),$G(ALLHLOC))
;
DELVFILE(WHICH,VISIT,PACKAGE,SOURCE,ASK,ECHO,USER) ;Deletes the requesed data related to the visit.
;See DELVFILE^PXAPIDEL for parameters and return values.
;
Q $$DELVFILE^PXAPIDEL(WHICH,VISIT,$G(PACKAGE),$G(SOURCE),$G(ASK),$G(ECHO),$G(USER))
;
DATA2PCE(DATA,PACKAGE,SOURCE,VISIT,USER,DISPLAY,ERROR,SCREEN,ARRAY) ;API to pass data for add/edit/delete to PCE
;See DATA2PCE^PXAI for parameters and return values.
;
I '($D(DATA)#2) Q -3
I '($D(PACKAGE)#2) Q -3
I '($D(SOURCE)#2) Q -3
I '($D(VISIT)#2) S VISIT=""
Q $$DATA2PCE^PXAI(DATA,PACKAGE,SOURCE,.VISIT,$G(USER),$G(DISPLAY),$G(ERROR),$G(SCREEN),.ARRAY)
;
SOURCE(SOURCE) ;Get IEN of data source in the PCE Data Source file
Q $$SOURCE^PXAPIUTL($G(SOURCE))
;
VISITLST(DFN,BEGINDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS) ;--GATHER VISITS
;See VISITLST^PXBGVST for parameters and return values.
;
I '($D(DFN)#2) Q "-2^NO PATIENT SELECTED"
Q $$VISITLST^PXBGVST(DFN,$G(BEGINDT),$G(ENDDT),$G(HLOC),$G(SCREEN),$G(APPOINT),$G(PROMPT),$G(COSTATUS))
;
ENCEDIT(WHAT,PACKAGE,SOURCE,DFN,BEGINDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS) ;--Ask for encounter the edit it of delete it
;See ENCEDIT^PXAPIEED for parameters and return values.
;
Q $$ENCEDIT^PXAPIEED($G(WHAT),$G(PACKAGE),$G(SOURCE),$G(DFN),$G(BEGINDT),$G(ENDDT),$G(HLOC),$G(SCREEN),$G(APPOINT),$G(PROMPT),$G(COSTATUS))
;
LOPENCED(WHAT,PACKAGE,SOURCE,DFN,BEGINDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS) ;--Ask for encounter the edit it of delete it
;See LOPENCED^PXAPIEED for parameters and return values.
;
Q $$LOPENCED^PXAPIEED($G(WHAT),$G(PACKAGE),$G(SOURCE),$G(DFN),$G(BEGINDT),$G(ENDDT),$G(HLOC),$G(SCREEN),$G(APPOINT),$G(PROMPT),$G(COSTATUS))
;
GETENC(DFN,ENCDT,HLOC) ;--Get all of the encounter data
;See GETENC^PXKENC for parameters and return values.
;
Q $$GETENC^PXKENC($G(DFN),$G(ENCDT),$G(HLOC))
;
ENCEVENT(VISIT,DONTKILL) ;--Get all of the encounter data
;See ENCEVENT^PXKENC for parameters and return values.
;
D ENCEVENT^PXKENC($G(VISIT),$G(DONTKILL))
Q
;
VST2APPT(VISIT) ;Is this visit related to an appointment
;See VST2APPT^PXUTL1 for parameters and return values.
;
Q $$VST2APPT^PXUTL1($G(VISIT))
;
APPT2VST(DFN,ENCDT,HLOC) ;Get the visit for an Appointment
;See APPT2VST^PXUTL1 for parameters and return values.
;
Q $$APPT2VST^PXUTL1($G(DFN),$G(ENCDT),$G(HLOC))
;
SWITCHD() ;This returns the date that PCE starts collecting the data
; instead Scheduling (switch over date).
Q $P($G(^PX(815,1,0)),"^",2)
;
SWITCHCK(DATE) ;Returns 1 if after the switch over date 0 otherwise.
N SWITCH
S SWITCH=$P($G(^PX(815,1,0)),"^",2)
Q:SWITCH<2960000 0
Q SWITCH'>DATE
;
DISPVSIT ;Called by Scheduling to create a visit for a disposition
;Add to fix scheduling calling visit tracking wrong without the
; dispositioning clinic. Hospital Location is required by Visit
; Tracking to work correctly.
I $G(VSIT("LOC"))>0,'$D(^PX(815,1,"DHL","B",VSIT("LOC"))) S VSIT("LOC")=""
I $G(VSIT("LOC"))'>0,'$D(ZTQUEUED) D
. I $P(^PX(815,1,"DHL",0),"^",4)=1 S VSIT("LOC")=$O(^PX(815,1,"DHL","B",0))
. E D
.. ;ask for Hospital location from those that can disposition
.. N DIC,DA,X,Y
DISPASK .. S DA(1)=1
.. S DIC="^PX(815,1,""DHL"","
.. S DIC("P")=$P(^DD(815,401,0),"^",2)
.. S DIC(0)="AEOQ"
.. D ^DIC
.. I Y>0 S VSIT("LOC")=$P(Y,"^",2)
.. ;E I '$D(DTOUT),'$D(DUOUT) W !!,$C(7),"Disposition Hospital Location is required." G DISPASK
.. E W !!,$C(7),"Disposition Hospital Location is required." G DISPASK
I $G(VSIT("LOC"))'>0 S VSIT("IEN")=-1
E D ^VSIT
Q
;
ACTIVPRV(PROVIDER,VISITDT) ;See if this is a good provider on the date of
;VISITDT and returns 1 if it is 0 if it is not.
;Can be used like S DIC("S")="I $$ACTIVPRV^PXAPIUTL(PRV,DATE)"
Q:+$$PRVCLASS^PXAPIUTL($G(PROVIDER),$G(VISITDT))>0 1
Q 0
;
PRVCLASS(PROVIDER,VISITDT) ;See if this is a good provider
;See PRVCLASS^PXAPIUTL for parameters and return values.
Q $$PRVCLASS^PXAPIUTL($G(PROVIDER),$G(VISITDT))
;
PXAPI ;ISL/dee - PCE's APIs ;4/16/97
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**14,15,27,28**;Aug 12, 1996
+2 QUIT
+3 ;
PROVNARR(PXPNAR,PXFILE,PXCLEX) ;Convert external Provider Narrative to internal.
+1 ;Input:
+2 ; PXPNAR Is the text of the provider narrative.
+3 ; PXFILE Is the file that the returned pointer will be stored in.
+4 ; If a new entry is created then this tells the context
+5 ; that it was created under by the file using it.
+6 ; PXCLEX Is and optional pointer to the Lexicon for this narrative.
+7 ;
+8 ;Returns:
+9 ; Pointer to the provider narrative file ^ narrative
+10 ; or pointer to the provider narrative file ^ narrative ^1
+11 ; where 1 indicates that the entry has just been added
+12 ; or -1 if was unsuccessful.
+13 ;
+14 NEW DIC,Y,DLAYGO,DD,DO,DA
+15 SET DIC="^AUTNPOV("
SET DIC(0)="L"
SET DLAYGO=9999999.27
+16 SET (DA,Y)=0
+17 SET X=$EXTRACT(PXPNAR,1,245)
+18 IF X=""
QUIT -1
+19 LOCK +^AUTNPOV(0):60
+20 IF '$TEST
WRITE !,"The Provider Narrative is LOCKED try again."
QUIT -1
+21 FOR
SET DA=$ORDER(^AUTNPOV("B",$EXTRACT(X,1,30),DA))
IF DA'>0
QUIT
IF $PIECE(^AUTNPOV(DA,0),"^")=X
SET Y=DA_"^"_X
QUIT
+22 IF '(+Y)
Begin DoDot:1
+23 KILL DA,Y
+24 DO FILE^DICN
+25 IF +Y>0
IF ($GET(PXCLEX)!$GET(PXFILE))
SET ^AUTNPOV(+Y,757)=$GET(PXCLEX)_"^"_$GET(PXFILE)
End DoDot:1
+26 LOCK -^AUTNPOV(0)
+27 QUIT $SELECT(+Y>0:Y,1:-1)
+28 ;
STOPCODE(PXASTOP,PXAPAT,PXADATE) ;This is the function call to return the quantity
+1 ; of a particular Stop Code for a patient on one day.
+2 ;Input
+3 ; PXASTOP (required) pointer to #40.7
+4 ; PXAPAT (required) pointer to #2
+5 ; PXADATE (required) the date in Fileman format
+6 ; (time is ignored if passed)
+7 ;Returns
+8 ; the count of how many of that stop code are stored for that one day
+9 ;
+10 NEW PXAVST,PXREVDAT,PXENDDAT,PXACOUNT
+11 SET PXASTOP=$GET(PXASTOP)
+12 SET PXAPAT=+$GET(PXAPAT)
+13 SET PXADATE=+$GET(PXADATE)
+14 SET (PXACOUNT,PXAVST)=0
+15 SET PXREVDAT=9999999-$PIECE(PXADATE,".")-.00000001
+16 SET PXENDDAT=PXREVDAT+.9
+17 FOR
SET PXREVDAT=$ORDER(^AUPNVSIT("AA",PXAPAT,PXREVDAT))
IF 'PXREVDAT!(PXREVDAT>PXENDDAT)
QUIT
Begin DoDot:1
+18 FOR
SET PXAVST=$ORDER(^AUPNVSIT("AA",PXAPAT,PXREVDAT,PXAVST))
IF 'PXAVST
QUIT
Begin DoDot:2
+19 IF PXASTOP=$PIECE(^AUPNVSIT(PXAVST,0),"^",8)
IF "E"'=$PIECE(^AUPNVSIT(PXAVST,0),"^",7)
SET PXACOUNT=PXACOUNT+1
End DoDot:2
End DoDot:1
+20 QUIT PXACOUNT
+21 ;
CPT(PXACPT,PXAPAT,PXADATE,PXAHLOC) ;This is the function call to return the quantity
+1 ; of a particular CPT for a patient on one day and for
+2 ; one hospital location if passed.
+3 ;Input
+4 ; PXACPT (required) pointer to #81
+5 ; PXAPAT (required) pointer to #2
+6 ; PXADATE (required) the date in Fileman format
+7 ; (time is ignored if passed)
+8 ; PXAHLOC (optional) pointer to #44
+9 ;Returns
+10 ; the count of how many (and quinity) of that cpt code are stored for that one day
+11 ;
+12 ;
+13 NEW PXAVST,PXAVCPT,PXREVDAT,PXENDDAT,PXACOUNT
+14 SET PXACPT=$GET(PXACPT)
+15 SET PXAPAT=+$GET(PXAPAT)
+16 SET PXADATE=+$GET(PXADATE)
+17 SET PXAHLOC=+$GET(PXAHLOC)
+18 SET (PXACOUNT,PXAVST)=0
+19 SET PXREVDAT=9999999-$PIECE(PXADATE,".")-.00000001
+20 SET PXENDDAT=PXREVDAT+.9
+21 FOR
SET PXREVDAT=$ORDER(^AUPNVSIT("AA",PXAPAT,PXREVDAT))
IF 'PXREVDAT!(PXREVDAT>PXENDDAT)
QUIT
Begin DoDot:1
+22 FOR
SET PXAVST=$ORDER(^AUPNVSIT("AA",PXAPAT,PXREVDAT,PXAVST))
IF 'PXAVST
QUIT
Begin DoDot:2
+23 IF "E"=$PIECE(^AUPNVSIT(PXAVST,0),"^",7)
QUIT
+24 IF "1"=$PIECE(^AUPNVSIT(PXAVST,150),"^",2)
QUIT
+25 IF PXAHLOC>0
IF PXAHLOC'=$PIECE(^AUPNVSIT(PXAVST,0),"^",22)
QUIT
+26 SET PXAVCPT=0
+27 FOR
SET PXAVCPT=$ORDER(^AUPNVCPT("AD",PXAVST,PXAVCPT))
IF 'PXAVCPT
QUIT
Begin DoDot:3
+28 IF PXACPT=$PIECE(^AUPNVCPT(PXAVCPT,0),"^",1)
SET PXACOUNT=PXACOUNT+$PIECE(^(0),"^",16)
End DoDot:3
End DoDot:2
End DoDot:1
+29 QUIT PXACOUNT
+30 ;
INTV(WHAT,PACKAGE,SOURCE,VISIT,HL,DFN,APPT,LIMITDT,ALLHLOC) ;This api will prompt the user for Visit and related V-file data used to document an encounter.
+1 ;See INTV^PXBAPI for parameters and return values.
+2 ;
+3 IF '($DATA(VISIT)#2)
SET VISIT=""
+4 IF '($DATA(DFN)#2)
SET DFN=""
+5 IF '($DATA(HL)#2)
SET HL=""
+6 ;
+7 QUIT $$INTV^PXBAPI(WHAT,PACKAGE,SOURCE,.VISIT,.HL,.DFN,$GET(APPT),$GET(LIMITDT),$GET(ALLHLOC))
+8 ;
DELVFILE(WHICH,VISIT,PACKAGE,SOURCE,ASK,ECHO,USER) ;Deletes the requesed data related to the visit.
+1 ;See DELVFILE^PXAPIDEL for parameters and return values.
+2 ;
+3 QUIT $$DELVFILE^PXAPIDEL(WHICH,VISIT,$GET(PACKAGE),$GET(SOURCE),$GET(ASK),$GET(ECHO),$GET(USER))
+4 ;
DATA2PCE(DATA,PACKAGE,SOURCE,VISIT,USER,DISPLAY,ERROR,SCREEN,ARRAY) ;API to pass data for add/edit/delete to PCE
+1 ;See DATA2PCE^PXAI for parameters and return values.
+2 ;
+3 IF '($DATA(DATA)#2)
QUIT -3
+4 IF '($DATA(PACKAGE)#2)
QUIT -3
+5 IF '($DATA(SOURCE)#2)
QUIT -3
+6 IF '($DATA(VISIT)#2)
SET VISIT=""
+7 QUIT $$DATA2PCE^PXAI(DATA,PACKAGE,SOURCE,.VISIT,$GET(USER),$GET(DISPLAY),$GET(ERROR),$GET(SCREEN),.ARRAY)
+8 ;
SOURCE(SOURCE) ;Get IEN of data source in the PCE Data Source file
+1 QUIT $$SOURCE^PXAPIUTL($GET(SOURCE))
+2 ;
VISITLST(DFN,BEGINDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS) ;--GATHER VISITS
+1 ;See VISITLST^PXBGVST for parameters and return values.
+2 ;
+3 IF '($DATA(DFN)#2)
QUIT "-2^NO PATIENT SELECTED"
+4 QUIT $$VISITLST^PXBGVST(DFN,$GET(BEGINDT),$GET(ENDDT),$GET(HLOC),$GET(SCREEN),$GET(APPOINT),$GET(PROMPT),$GET(COSTATUS))
+5 ;
ENCEDIT(WHAT,PACKAGE,SOURCE,DFN,BEGINDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS) ;--Ask for encounter the edit it of delete it
+1 ;See ENCEDIT^PXAPIEED for parameters and return values.
+2 ;
+3 QUIT $$ENCEDIT^PXAPIEED($GET(WHAT),$GET(PACKAGE),$GET(SOURCE),$GET(DFN),$GET(BEGINDT),$GET(ENDDT),$GET(HLOC),$GET(SCREEN),$GET(APPOINT),$GET(PROMPT),$GET(COSTATUS))
+4 ;
LOPENCED(WHAT,PACKAGE,SOURCE,DFN,BEGINDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS) ;--Ask for encounter the edit it of delete it
+1 ;See LOPENCED^PXAPIEED for parameters and return values.
+2 ;
+3 QUIT $$LOPENCED^PXAPIEED($GET(WHAT),$GET(PACKAGE),$GET(SOURCE),$GET(DFN),$GET(BEGINDT),$GET(ENDDT),$GET(HLOC),$GET(SCREEN),$GET(APPOINT),$GET(PROMPT),$GET(COSTATUS))
+4 ;
GETENC(DFN,ENCDT,HLOC) ;--Get all of the encounter data
+1 ;See GETENC^PXKENC for parameters and return values.
+2 ;
+3 QUIT $$GETENC^PXKENC($GET(DFN),$GET(ENCDT),$GET(HLOC))
+4 ;
ENCEVENT(VISIT,DONTKILL) ;--Get all of the encounter data
+1 ;See ENCEVENT^PXKENC for parameters and return values.
+2 ;
+3 DO ENCEVENT^PXKENC($GET(VISIT),$GET(DONTKILL))
+4 QUIT
+5 ;
VST2APPT(VISIT) ;Is this visit related to an appointment
+1 ;See VST2APPT^PXUTL1 for parameters and return values.
+2 ;
+3 QUIT $$VST2APPT^PXUTL1($GET(VISIT))
+4 ;
APPT2VST(DFN,ENCDT,HLOC) ;Get the visit for an Appointment
+1 ;See APPT2VST^PXUTL1 for parameters and return values.
+2 ;
+3 QUIT $$APPT2VST^PXUTL1($GET(DFN),$GET(ENCDT),$GET(HLOC))
+4 ;
SWITCHD() ;This returns the date that PCE starts collecting the data
+1 ; instead Scheduling (switch over date).
+2 QUIT $PIECE($GET(^PX(815,1,0)),"^",2)
+3 ;
SWITCHCK(DATE) ;Returns 1 if after the switch over date 0 otherwise.
+1 NEW SWITCH
+2 SET SWITCH=$PIECE($GET(^PX(815,1,0)),"^",2)
+3 IF SWITCH<2960000
QUIT 0
+4 QUIT SWITCH'>DATE
+5 ;
DISPVSIT ;Called by Scheduling to create a visit for a disposition
+1 ;Add to fix scheduling calling visit tracking wrong without the
+2 ; dispositioning clinic. Hospital Location is required by Visit
+3 ; Tracking to work correctly.
+4 IF $GET(VSIT("LOC"))>0
IF '$DATA(^PX(815,1,"DHL","B",VSIT("LOC")))
SET VSIT("LOC")=""
+5 IF $GET(VSIT("LOC"))'>0
IF '$DATA(ZTQUEUED)
Begin DoDot:1
+6 IF $PIECE(^PX(815,1,"DHL",0),"^",4)=1
SET VSIT("LOC")=$ORDER(^PX(815,1,"DHL","B",0))
+7 IF '$TEST
Begin DoDot:2
+8 ;ask for Hospital location from those that can disposition
+9 NEW DIC,DA,X,Y
DISPASK SET DA(1)=1
+1 SET DIC="^PX(815,1,""DHL"","
+2 SET DIC("P")=$PIECE(^DD(815,401,0),"^",2)
+3 SET DIC(0)="AEOQ"
+4 DO ^DIC
+5 IF Y>0
SET VSIT("LOC")=$PIECE(Y,"^",2)
+6 ;E I '$D(DTOUT),'$D(DUOUT) W !!,$C(7),"Disposition Hospital Location is required." G DISPASK
+7 IF '$TEST
WRITE !!,$CHAR(7),"Disposition Hospital Location is required."
GOTO DISPASK
End DoDot:2
End DoDot:1
+8 IF $GET(VSIT("LOC"))'>0
SET VSIT("IEN")=-1
+9 IF '$TEST
DO ^VSIT
+10 QUIT
+11 ;
ACTIVPRV(PROVIDER,VISITDT) ;See if this is a good provider on the date of
+1 ;VISITDT and returns 1 if it is 0 if it is not.
+2 ;Can be used like S DIC("S")="I $$ACTIVPRV^PXAPIUTL(PRV,DATE)"
+3 IF +$$PRVCLASS^PXAPIUTL($GET(PROVIDER),$GET(VISITDT))>0
QUIT 1
+4 QUIT 0
+5 ;
PRVCLASS(PROVIDER,VISITDT) ;See if this is a good provider
+1 ;See PRVCLASS^PXAPIUTL for parameters and return values.
+2 QUIT $$PRVCLASS^PXAPIUTL($GET(PROVIDER),$GET(VISITDT))
+3 ;