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

AQALDG53.m

Go to the documentation of this file.
  1. AQALDG53 ; IHS/ORDC/LJF - LINK EDITED ADT EVENTS ;
  1. ;;1;QI LINKAGES-RPMS;;AUG 15, 1994
  1. ;
  1. ;This routine handles edits to ADT events and decides what, if any
  1. ;action to perform on the QI Occurrence file.
  1. ;
  1. INIT ; >> find ind for event type
  1. K AQALPAR
  1. I DGPMT=1 F I=2,12,22 D PARAM
  1. I DGPMT=2 F I=32,72 D PARAM
  1. I DGPMT=3 F I=42,52,62 D PARAM
  1. ;
  1. ; >> find all auto occ from ADT for pt and visit and event type
  1. S AQALN=0
  1. F S AQALN=$O(^AQAOC("AE",DFN,AQALVST,AQALN)) Q:AQALN="" D
  1. .Q:'$D(^AQAOC(AQALN,0)) Q:$P(^(0),U,11)="" ;not automatic entry
  1. .I DGPMT=2 Q:+DGPMP'=$P(^AQAOC(AQALN,0),U,4) ;not same transf dt
  1. .S X=$P($G(^AQAO(2,+$P(^AQAOC(AQALN,0),U,8),0)),U) ;ind number
  1. .Q:'$D(AQALPAR(X)) ;occ not for same admit event
  1. .S AQALAUT(X)=AQALN ;set array of occ for DGPMT that exist
  1. ;
  1. ; >> calculate event and create or modify occ
  1. I DGPMA]"" S X=DGPMT_"^AQALDG5" D @X
  1. ;
  1. ; >> delete any occurrences not edited (aqalaut(x) deleted if edited)
  1. S AQALX=0
  1. F S AQALX=$O(AQALAUT(AQALX)) Q:AQALX="" D
  1. .S AQALN=AQALAUT(AQALX) D DEL^AQALNK1(AQALN) ;delete occ
  1. Q
  1. ;
  1. ;
  1. PARAM ; >> SUBRTN to find indicator numbers for adt event type
  1. S X=$P($G(^AQAGP(DUZ(2),"ADT")),U,I)
  1. I X]"" S AQALPAR(X)=""
  1. Q