source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SDAMVSC.m@ 1582

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

initial load of FOIAVistA 6/30/08 version

File size: 2.9 KB
Line 
1SDAMVSC ;;OIFO-BAY PINES/TEH - Appt Event Driver Utilities-Validate SC Appt type ; 12/1/91 [ 09/19/96 1:39 PM ]
2 ;;5.3;Scheduling;**394,417**;Aug 13, 1993
3 ;
4 ;***************************************************************************************************************************
5 ;
6 ; ***** NOTE *****
7 ;
8 ;This software was created to be used with the SCHEDULING V5.3 appointment management package. The SRA API (SDAMA301)
9 ;was employed to retrieve data from the PATIENT APPOINTMENT file (2.98) due inpart to VA Fileman non-compliance.
10 ;
11 ;DBIA #4433 SUBSCRIPTION
12 ;
13 ;Entry Point EN. This routine requires the OUTPATIENT ENOUNTER IEN (variable SDOE)
14 ;
15 ;GLOBALS: ^SCE(IEN,0) (#.1) APPOINTMENT TYPE [10P:409.1]
16 ; ^DPT(IEN,"S",DATE,0) ^ (#9.5) APPOINTMENT TYPE [16P:409.1]
17 ; ^SD(409.41,0)=OUTPATIENT CLASSIFCATION TYPE "Was treatment for SC Condition? " QUESTION FOR CHECKOUT.
18 ;
19 ;PROTOCOLS: This routine is called from the SDAM APPOINTMENT EVENTS.
20 ;
21 ;This validates that both the OUTPATIENT ENCOUNTER and the PATIENT SCHEDULING NODES for APPOINTMENT TYPE are (pointer to
22 ;409.1 APPOINTMENT TYPE) are set to the "SERVICE CONNECTED" appointment type when the response to the CLASSIFICATION TYPE
23 ;"Was treatment for SC Condition?" question is answered "YES". If the question is answered "NO" and the APPOINTMENT TYPE
24 ;is SERVICE CONNECTED, then the APPOINTMENT TYPE is reverted to REGULAR.
25 ;
26 ;
27 ;****************************************************************************************************************************
28 Q
29EN ;Entry Point
30 G END:'$D(SDOE),END:'$G(SDOE),END:SDOE=""
31 N SDVSCL,SDVSTD,SDAPDF,SDDPTYP,SDOED,SDVSTD,SDVDPTD,SDVSCD,SDSCV,SDAPPTY,SDAPDT,SDDFN,SDVSTD,SDIENS,SDARRAY,SDAPDF
32 S SDOED=$G(^SCE(SDOE,0)) G END:SDOED=""
33 S SDDFN=$P(SDOED,U,2),SDAPDT=$P(SDOED,U) I '$D(^DPT(SDDFN,"S",SDAPDT,0)) Q
34 ;GET APPOINTMENT FROM 2.98
35 N SDAMIENS S SDAMIENS=SDAPDT_","_SDDFN_","
36 S SDAPDPT=$$GET1^DIQ(2.98,SDAMIENS,9.5,"I")
37 S SDVSCL=$P(SDOED,U,4)
38 S SDVSTD=$P(SDOED,U,5),SDSCV=$$GET1^DIQ(9000010,SDVSTD_",",80001,"I")
39 S SDAPDF=$$GET1^DIQ(44,SDVSCL_",",2507,"I")
40 S SDAPPTY=$S(SDSCV=1:11,$D(SDAPDPT):SDAPDPT,SDAPDT'="":SDAPDF,1:9) D
41 .;Set FDA for SCE(ien,0) OUTPATIENT ENCOUNTER
42 .S SDIENS=SDOE_"," K ^TMP("SDAMSCE",$J)
43 .D FDA^DILF(409.68,SDIENS,.1,,SDAPPTY,"^TMP(""SDAMSCE"",$J)","^TMP(""SDAMSCE"",$J)")
44 .I $D(^TMP("SDAMSCE",$J,"DIERR")) D
45 ..W !,"Processing Error ",^TMP("SDAMSCE",$J,"DIERR",1) Q
46 .D FILE^DIE(,"^TMP(""SDAMSCE"",$J)","^TMP(""SDAMSCE"",$J)")
47 .;Set FDA for ^DPT(ien,"S") PATIENT APPOINTMENT.
48 .K ^TMP($J,"SDAMA301")
49 .N SDAMVSCX S SDARRAY(1)=SDAPDT_";"_SDAPDT,SDARRAY(4)=SDDFN,SDARRAY("FLDS")=10,SDAMVSCX=$$SDAPI^SDAMA301(.SDARRAY)
50 .I 'SDAMVSCX D Q
51 ..W !,"Processing Error "
52 .S SDDPTYP=+$P($G(^TMP($J,"SDAMA301",SDDFN,SDVSCL,SDAPDT)),U,10) I SDDPTYP'=SDAPPTY D
53 ..S $P(^DPT(SDDFN,"S",SDAPDT,0),U,16)=SDAPPTY
54END Q
Note: See TracBrowser for help on using the repository browser.