source: WorldVistAEHR/trunk/r/PCE_PATIENT_CARE_ENCOUNTER-AUTN-EFDP-PX-VSIT--PXRM/PXAPIEED.m@ 837

Last change on this file since 837 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1PXAPIEED ;ISL/dee - PCE's API to ask standalone encounter or add then edit it or to delete a standalone ; 8/14/00 2:47pm
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**1,147**;Aug 12, 1996
3 Q
4 ;
5ENCEDIT(WHAT,PACKAGE,SOURCE,DFN,BEGINDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS) ;--Ask for encounter the edit it of delete it
6 ;
7 ; >0 = VISIT IEN
8 ; D^Visit IEN = User selected to delete and the visit ien that was deleted
9 ; -1 = nothing was done (user did not select visit or ^-out)
10 ; -2^text = error of some kind^simple text message
11 ; -3^text = error in deleting^simple text message
12 ;
13 N VISITIEN,PXRESULT,PXRETURN,PXVISIT,PXBEGDT,PXX
14 I $G(DFN)<1 S DFN=$$ASKPAT^PXBAPI1()
15 Q:DFN<1 -1
16 D 2^VADPT I +VADM(6) D Q:$D(DUOUT)!$D(DIRUT) -1
17 . S DIR(0)="E",DIR("A")="Enter RETURN to continue or '^' to exit"
18 . S DIR("A",2)="WARNING "_VADM(7) D ^DIR
19 S PXBEGDT=$S($$SWITCHD^PXAPI>BEGINDT:$$SWITCHD^PXAPI,1:BEGINDT)
20 S VISITIEN=$$VISITLST^PXAPI(DFN,PXBEGDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS)
21 I $P(VISITIEN,"^",1)="D" D
22 . S PXRESULT=$$DELVFILE^PXAPI("ALL",$P(VISITIEN,"^",2),"","",1,1)
23 . I PXRESULT=1 S PXRETURN=VISITIEN
24 . E I PXRESULT=0 S PXRETURN="-3^ONLY PARTLY DELETED"
25 . E I PXRESULT=-1 S PXRETURN=-1
26 . E I PXRESULT<-1 S PXRETURN="-3^ERROR IN TRYING TO DELETE"
27 E I VISITIEN>0!(VISITIEN="A") D
28 . S PXVISIT=$S(VISITIEN>0:VISITIEN,1:"")
29 . S PXRESULT=$$INTV^PXAPI(WHAT,PACKAGE,SOURCE,VISITIEN,$S(VISITIEN="A":HLOC,1:""),DFN,"",$$SWITCHD^PXAPI)
30 . I PXRESULT'<0 S PXRETURN=PXVISIT
31 . E I PXRESULT=-1 S PXRETURN=-1
32 . E I PXRESULT<-1 S PXRETURN="-2^ERROR IN TRYING TO DO INTERVIEW"
33 E S PXRETURN=VISITIEN
34 Q PXRETURN
35 ;
36LOPENCED(WHAT,PACKAGE,SOURCE,DFN,BEGINDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS) ;
37 ;
38 ; Returns:
39 ; 0 = all oky doky
40 ; -1 = nothing was done (user did not select visit or ^-out)
41 ; -2^text = error of some kind^simple text message
42 ; -3^text = error in deleting^simple text message
43 ;
44 N PXRETURN,PXRESULT
45 S PXRESULT=-1
46 F D Q:PXRETURN<0
47 . S PXRETURN=$$ENCEDIT(WHAT,PACKAGE,SOURCE,DFN,BEGINDT,ENDDT,HLOC,SCREEN,APPOINT,PROMPT,COSTATUS)
48 . I PXRETURN'<0 S PXRESULT=0
49 Q $S(PXRETURN<-1:PXRETURN,1:PXRESULT)
50 ;
Note: See TracBrowser for help on using the repository browser.