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

SCUTIE1.m

Go to the documentation of this file.
  1. SCUTIE1 ;ALB/SCK - INCOMPLETE ENCOUNTER MGMT API CALLS ; 6/17/97
  1. ;;5.3;Scheduling;**66,1015**;AUG 13, 1993;Build 21
  1. ;
  1. Q
  1. ;
  1. OPENC(SDXMT,SDARRAY) ; API to return whether Transmitted Outpatient Encounter File entry
  1. ; points to a deleted encounter.
  1. ;
  1. ; Input:
  1. ; SDXMT - IEN of the Transmitted Outpatient Encounter file entry
  1. ; SDARRAY - [optional] - if passed in (as "xxxx"), will return encounter information
  1. ; DFN, Clinic IEN, and Encounter date
  1. ;
  1. ; Return:
  1. ; 1 - if encounter is deleted
  1. ; 0 - if encounter is not deleted.
  1. ; -1 - if error condition
  1. ;
  1. ; If SDARRAY is passed in, returns:
  1. ; SDARRAY["DFN"] = DFN
  1. ; SDARRAY["CLINIC"] = Clinic IEN
  1. ; SDARRAY["ENCOUNTER"] = Encounter date
  1. ; SDARRAY["ERROR"] = Error Condition
  1. ; SDARRAY["DELIEN"] = Ien of Deleted Encounter
  1. ; SDARRAY["SDOIEN"] = Ien of OP Encounter
  1. ; SDARRAY["AE"] = 0 if Originating process is an appointment,
  1. ; 1 if not.
  1. ;
  1. N SDOK,NODE0,NODE1
  1. ;
  1. K @SDARRAY
  1. I +$G(SDXMT)=0 D G DELQ
  1. . S SDOK=-1
  1. . I $G(SDARRAY)]"" S @SDARRAY@("ERROR")="NULL XMT POINTER"
  1. ;
  1. I +$P($G(^SD(409.73,SDXMT,0)),U,2)>0,$D(^SCE(+$P(^SD(409.73,SDXMT,0),U,2))) D G DELQ
  1. . S SDOK=0
  1. . I $G(SDARRAY)]"" D
  1. .. K @SDARRAY
  1. .. S NODE0=$G(^SCE($P(^SD(409.73,SDXMT,0),U,2),0))
  1. .. S @SDARRAY@("DFN")=$P(NODE0,U,2)
  1. .. S @SDARRAY@("CLINIC")=$P(NODE0,U,4)
  1. .. S @SDARRAY@("ENCOUNTER")=$P(NODE0,U)
  1. .. S @SDARRAY@("SDOIEN")=$P(^SD(409.73,SDXMT,0),U,2)
  1. .. S @SDARRAY@("AE")=$S($P(NODE0,U,8)=1:0,1:1)
  1. ;
  1. I +$P($G(^SD(409.73,SDXMT,0)),U,3)>0,$D(^SD(409.74,+$P(^SD(409.73,SDXMT,0),U,3))) D G DELQ
  1. . S SDOK=1
  1. . I $G(SDARRAY)]"" D
  1. .. K @SDARRAY
  1. .. S NODE0=$G(^SD(409.74,$P(^SD(409.73,SDXMT,0),U,3),0))
  1. .. S NODE1=$G(^SD(409.74,$P(^SD(409.73,SDXMT,0),U,3),1))
  1. .. S @SDARRAY@("DFN")=$P(NODE0,U,2)
  1. .. S @SDARRAY@("CLINIC")=$P(NODE1,U,4)
  1. .. S @SDARRAY@("ENCOUNTER")=$P(NODE1,U)
  1. .. S @SDARRAY@("DELIEN")=$P(^SD(409.73,SDXMT,0),U,3)
  1. .. S @SDARRAY@("AE")=$S($P(NODE1,U,8)=1:0,1:1)
  1. ;
  1. S SDOK=-1
  1. I $G(SDARRAY)]"" S @SDARRAY@("ERROR")="No (Deleted) Outpatient Encounter entry found."
  1. DELQ Q SDOK