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

SDAMVSC.m

Go to the documentation of this file.
  1. SDAMVSC ;;OIFO-BAY PINES/TEH - Appt Event Driver Utilities-Validate SC Appt type ; 12/1/91 [ 09/19/96 1:39 PM ] ; Compiled August 20, 2007 14:28:26
  1. ;;5.3;Scheduling;**394,417,491,1015**;Aug 13, 1993;Build 21
  1. ;
  1. ;
  1. ;***************************************************************************************************************************
  1. ;
  1. ; ***** NOTE *****
  1. ;
  1. ;This software was created to be used with the SCHEDULING V5.3 appointment management package. The SRA API (SDAMA301)
  1. ;was employed to retrieve data from the PATIENT APPOINTMENT file (2.98) due inpart to VA Fileman non-compliance.
  1. ;
  1. ;DBIA #4433 SUBSCRIPTION
  1. ;
  1. ;
  1. ;Entry Point EN. This routine requires the OUTPATIENT ENOUNTER IEN (variable SDOE)
  1. ;
  1. ;GLOBALS: ^SCE(IEN,0) (#.1) APPOINTMENT TYPE [10P:409.1]
  1. ; ^DPT(IEN,"S",DATE,0) ^ (#9.5) APPOINTMENT TYPE [16P:409.1]
  1. ; ^SD(409.41,0)=OUTPATIENT CLASSIFCATION TYPE "Was treatment for SC Condition? " QUESTION FOR CHECKOUT.
  1. ;
  1. ;PROTOCOLS: This routine is called from the SDAM APPOINTMENT EVENTS.
  1. ;
  1. ;This validates that both the OUTPATIENT ENCOUNTER and the PATIENT SCHEDULING NODES for APPOINTMENT TYPE are (pointer to
  1. ;409.1 APPOINTMENT TYPE) are set to the "SERVICE CONNECTED" appointment type when the response to the CLASSIFICATION TYPE
  1. ;"Was treatment for SC Condition?" question is answered "YES". If the question is answered "NO" and the APPOINTMENT TYPE
  1. ;is SERVICE CONNECTED, then the APPOINTMENT TYPE is reverted to REGULAR.
  1. ;
  1. ;
  1. ;****************************************************************************************************************************
  1. Q
  1. EN ;Entry Point
  1. Q:'$G(SDOE)
  1. N SDN,SDVSCL,SDVSTD,SDAPDF,SDDPTYP,SDOED,SDVSTD,SDVDPTD,SDVSCD,SDSCV,SDAPPTY,SDAPDT,SDDFN,SDVSTD,SDIENS,SDARRAY,SDAPDF
  1. S SDOED=$G(^SCE(SDOE,0)) Q:SDOED=""
  1. S SDDFN=$P(SDOED,U,2),SDAPDT=$P(SDOED,U)
  1. ;GET APPOINTMENT FROM EVENT OUTPUT ARRAY
  1. I $G(^TMP("SDAMEVT",$J,"AFTER","DPT")) S SDAPDPT=$P($G(^TMP("SDAMEVT",$J,"AFTER","DPT")),"^",16)
  1. E S SDAPDPT=$P(SDOED,"^",10) ;APP TYPE
  1. S SDVSCL=$P(SDOED,U,4)
  1. S SDVSTD=$P(SDOED,U,5)
  1. Q:'SDVSTD ; ticket #194210 ; do not proceed if no pointer to a visit
  1. Q:'$D(^AUPNVSIT(SDVSTD,800))
  1. S SDSCV=+$$GET1^DIQ(9000010,SDVSTD_",",80001,"I") ;SC flag in Visit file
  1. S SDAPDF=$$GET1^DIQ(44,SDVSCL_",",2507,"I") ;default appt type
  1. ;find if credit stop secondary visit exists.
  1. N SDVSTDS,SDOE1 S SDOE1="" S SDVSTDS=$O(^AUPNVSIT("AD",SDVSTD,""))
  1. I SDVSTDS>0 S SDOE1=$O(^SCE("AVSIT",SDVSTDS,""))
  1. I SDSCV I SDAPDPT'=11 S SDAPDPT=11 D APPT F SDE=SDOE,SDOE1 I SDE>0 D SCE(SDE)
  1. I 'SDSCV I SDAPDPT=11 D D APPT F SDE=SDOE,SDOE1 I SDE>0 D SCE(SDE)
  1. . I SDAPDF'="" S SDAPDPT=SDAPDF ; set to default if exists for this clinic
  1. . E S SDAPDPT=9 ; set to regular
  1. Q
  1. SCE(SDE) ;Set FDA for SCE(ien,0) OUTPATIENT ENCOUNTER
  1. S SDIENS=SDE_"," K ^TMP("SDAMSCE",$J)
  1. D FDA^DILF(409.68,SDIENS,.1,,SDAPDPT,"^TMP(""SDAMSCE"",$J)","^TMP(""SDAMSCE"",$J)")
  1. I $D(^TMP("SDAMSCE",$J,"DIERR")) D Q
  1. .W !,"Processing Error ",^TMP("SDAMSCE",$J,"DIERR",1) Q
  1. D FILE^DIE(,"^TMP(""SDAMSCE"",$J)","^TMP(""SDAMSCE"",$J)")
  1. Q
  1. APPT ;quit if clinic in event doesn't match clinic in ^DPT
  1. ;set up app type in DPT
  1. I +$G(^TMP("SDAMEVT",$J,"AFTER","DPT"))'=+$G(^DPT(SDDFN,"S",SDAPDT,0)) Q
  1. I $D(^DPT(SDDFN,"S",SDAPDT,0)) S $P(^DPT(SDDFN,"S",SDAPDT,0),U,16)=SDAPDPT
  1. END Q