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

PXAPIEED.m

Go to the documentation of this file.
  1. PXAPIEED ;ISL/dee - PCE's API to ask standalone encounter or add then edit it or to delete a standalone ;9/5/96
  1. ;;1.0;PCE PATIENT CARE ENCOUNTER;**1**;Aug 12, 1996
  1. Q
  1. ;
  1. ENCEDIT(WHAT,PACKAGE,SOURCE,DFN,BEGINDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS) ;--Ask for encounter the edit it of delete it
  1. ;
  1. ; >0 = VISIT IEN
  1. ; D^Visit IEN = User selected to delete and the visit ien that was deleted
  1. ; -1 = nothing was done (user did not select visit or ^-out)
  1. ; -2^text = error of some kind^simple text message
  1. ; -3^text = error in deleting^simple text message
  1. ;
  1. N VISITIEN,PXRESULT,PXRETURN,PXVISIT,PXBEGDT
  1. I $G(DFN)<1 S DFN=$$ASKPAT^PXBAPI1()
  1. Q:DFN<1 -1
  1. S PXBEGDT=$S($$SWITCHD^PXAPI>BEGINDT:$$SWITCHD^PXAPI,1:BEGINDT)
  1. S VISITIEN=$$VISITLST^PXAPI(DFN,PXBEGDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS)
  1. I $P(VISITIEN,"^",1)="D" D
  1. . S PXRESULT=$$DELVFILE^PXAPI("ALL",$P(VISITIEN,"^",2),"","",1,1)
  1. . I PXRESULT=1 S PXRETURN=VISITIEN
  1. . E I PXRESULT=0 S PXRETURN="-3^ONLY PARTLY DELETED"
  1. . E I PXRESULT=-1 S PXRETURN=-1
  1. . E I PXRESULT<-1 S PXRETURN="-3^ERROR IN TRYING TO DELETE"
  1. E I VISITIEN>0!(VISITIEN="A") D
  1. . S PXVISIT=$S(VISITIEN>0:VISITIEN,1:"")
  1. . S PXRESULT=$$INTV^PXAPI(WHAT,PACKAGE,SOURCE,VISITIEN,$S(VISITIEN="A":HLOC,1:""),DFN,"",$$SWITCHD^PXAPI)
  1. . I PXRESULT'<0 S PXRETURN=PXVISIT
  1. . E I PXRESULT=-1 S PXRETURN=-1
  1. . E I PXRESULT<-1 S PXRETURN="-2^ERROR IN TRYING TO DO INTERVIEW"
  1. E S PXRETURN=VISITIEN
  1. Q PXRETURN
  1. ;
  1. LOPENCED(WHAT,PACKAGE,SOURCE,DFN,BEGINDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS) ;
  1. ;
  1. ; Returns:
  1. ; 0 = all oky doky
  1. ; -1 = nothing was done (user did not select visit or ^-out)
  1. ; -2^text = error of some kind^simple text message
  1. ; -3^text = error in deleting^simple text message
  1. ;
  1. N PXRETURN,PXRESULT
  1. S PXRESULT=-1
  1. F D Q:PXRETURN<0
  1. . S PXRETURN=$$ENCEDIT(WHAT,PACKAGE,SOURCE,DFN,BEGINDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS)
  1. . I PXRETURN'<0 S PXRESULT=0
  1. Q $S(PXRETURN<-1:PXRETURN,1:PXRESULT)
  1. ;