source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDCOAM.m@ 724

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

initial load of WorldVistAEHR

File size: 3.7 KB
RevLine 
[613]1SDCOAM ;ALB/RMO - Appt Mgmt Actions - Check Out; 11 FEB 1993 10:00 am
2 ;;5.3;Scheduling;**1,20,27,66,132**;08/13/93
3 ;
4CO(SDCOACT,SDCOACTD) ;Check Out Classification, Provider and Diagnosis
5 ; Actions on Appt Mgmt
6 N DFN,SDCL,SDCOAP,SDDA,SDOE,SDT,VALMY
7 S VALMBCK=""
8 D EN^VALM2(XQORNOD(0))
9 D FULL^VALM1
10 S SDCOAP=0
11 F S SDCOAP=$O(VALMY(SDCOAP)) Q:'SDCOAP D
12 .I $D(^TMP("SDAMIDX",$J,SDCOAP)) K SDAT S SDAT=^(SDCOAP) D
13 ..W !!,^TMP("SDAM",$J,+SDAT,0)
14 ..S DFN=+$P(SDAT,"^",2),SDT=+$P(SDAT,"^",3),SDCL=+$P(SDAT,"^",4),SDDA=$$FIND^SDAM2(DFN,SDT,SDCL)
15 ..S SDOE=+$P($G(^DPT(DFN,"S",SDT,0)),"^",20)
16 ..I 'SDOE!('$$CODT^SDCOU(DFN,SDT,SDCL)) W !!,*7,">>> The appointment must have a check out date/time to update ",SDCOACTD,"." D PAUSE^VALM1 Q
17 ..D ACT(SDCOACT,SDOE,DFN,SDT,SDCL,SDDA,+SDAT)
18 S VALMBCK="R"
19 K SDAT
20COQ Q
21 ;
22ACT(SDCOACT,SDOE,DFN,SDT,SDCL,SDDA,SDLNE) ; -- Check Out Actions
23 N SDCOMF,SDCOQUIT,SDHL,SDVISIT,SDATA,SDHDL
24 ;
25 S SDVISIT=+$P($G(^SCE(+SDOE,0)),U,5)
26 ;
27 ; -- quit if not ok to edit
28 IF '$$EDITOK^SDCO3($G(SDOE),1) G ACTQ
29 ;
30 ; -- set pce action parameter
31 S SDPXACT=""
32 I $G(SDCOACT)="CL" S SDPXACT="SCC"
33 I $G(SDCOACT)="PR" S SDPXACT="PRV"
34 I $G(SDCOACT)="DX" S SDPXACT="POV"
35 I $G(SDCOACT)="CPT" S SDPXACT="CPT"
36 ;
37 ; -- quit if no action set
38 IF SDPXACT="" G ACTQ
39 ;
40 ; -- do pce interview then rebuild appt list
41 S X=$$INTV^PXAPI(SDPXACT,"SD","PIMS",.SDVISIT,.SDHL,DFN)
42 D BLD^SDAM
43ACTQ Q
44 ;
45PD ;Entry point for SDAM PATIENT DEMOGRAPHICS protocol
46 N SDCOAP,VALMY
47 S VALMBCK=""
48 D FULL^VALM1
49 I SDAMTYP="P" W !!,VALMHDR(1),! D DEM(SDFN)
50 I SDAMTYP="C" D
51 .D EN^VALM2(XQORNOD(0))
52 .S SDCOAP=0 F S SDCOAP=$O(VALMY(SDCOAP)) Q:'SDCOAP D
53 ..I $D(^TMP("SDAMIDX",$J,SDCOAP)) K SDAT S SDAT=^(SDCOAP) D
54 ...W !!,^TMP("SDAM",$J,+SDAT,0),!
55 ...D DEM(+$P(SDAT,"^",2))
56 S VALMBCK="R"
57PDQ Q
58 ;
59DEM(DFN) ;Demographics
60 D QUES^DGRPU1(DFN,"ADD")
61 Q
62 ;
63DC ;Entry point for SDAM DISCHARGE CLINIC protocol
64 N SDCOAP,VALMY
65 S VALMBCK=""
66 D FULL^VALM1
67 I SDAMTYP="P" W !!,VALMHDR(1),! D DIS(SDFN)
68 I SDAMTYP="C" D
69 .D EN^VALM2(XQORNOD(0))
70 .S SDCOAP=0 F S SDCOAP=$O(VALMY(SDCOAP)) Q:'SDCOAP D
71 ..I $D(^TMP("SDAMIDX",$J,SDCOAP)) K SDAT S SDAT=^(SDCOAP) D
72 ...W !!,^TMP("SDAM",$J,+SDAT,0),!
73 ...D DIS(+$P(SDAT,"^",2),$P(SDAT,"^",4))
74 S VALMBCK="R"
75DCQ Q
76 ;
77DIS(SDFN,SDCLN) ;Discharge from Clinic
78 N SDAMERR
79 D ^SDCD
80 I $D(SDAMERR) D PAUSE^VALM1
81 Q
82 ;
83DEL ;Entry point for SDAM DELETE CHECK OUT protocol
84 I '$D(^XUSEC("SD SUPERVISOR",DUZ)) W !!,*7,">>> You must have the 'SD SUPERVISOR' key to delete an appointment check out." D PAUSE^VALM1 S VALMBCK="R" G DELQ
85 N DFN,SDCL,SDCOAP,SDDA,SDOE,SDT,VALMY,VALSTP
86 S VALMBCK="",VALSTP="" ;VALSTP is used in scdxhldr to identify deletes
87 D EN^VALM2(XQORNOD(0))
88 D FULL^VALM1
89 S SDCOAP=0
90 F S SDCOAP=$O(VALMY(SDCOAP)) Q:'SDCOAP D
91 .I $D(^TMP("SDAMIDX",$J,SDCOAP)) K SDAT S SDAT=^(SDCOAP) D
92 ..W !!,^TMP("SDAM",$J,+SDAT,0)
93 ..S DFN=+$P(SDAT,"^",2),SDT=+$P(SDAT,"^",3),SDCL=+$P(SDAT,"^",4),SDDA=$$FIND^SDAM2(DFN,SDT,SDCL)
94 ..S SDOE=+$P($G(^DPT(DFN,"S",SDT,0)),"^",20)
95 ..I 'SDOE!('$$CODT^SDCOU(DFN,SDT,SDCL)) W !!,*7,">>> The appointment must have a check out date/time to delete." D PAUSE^VALM1 Q
96 ..I '$$ASK Q
97 ..N SDATA,SDELHDL
98 ..IF '$$EDITOK^SDCO3(SDOE,1) Q
99 ..S SDELHDL=$$HANDLE^SDAMEVT(1)
100 ..D EN^SDCODEL(SDOE,1,SDELHDL),PAUSE^VALM1
101 ..D BLD^SDAM
102 ..S SDOE=$$GETAPT^SDVSIT2(DFN,SDT,SDCL)
103 S VALMBCK="R"
104 K SDAT
105DELQ Q
106 ;
107ASK() ;Ask if user is sure they want to delete the check out
108 N DIR,DTOUT,DUOUT,Y
109 W !!,*7,">>> Deleting the appointment check out will also delete any check out related",!?4,"information. This information may include classifications, procedures,",!?4,"providers and diagnoses."
110 S DIR("A")="Are you sure you want to delete the appointment check out"
111 S DIR("B")="NO",DIR(0)="Y" W ! D ^DIR
112 Q +$G(Y)
Note: See TracBrowser for help on using the repository browser.