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

DGPTFVC2.m

Go to the documentation of this file.
  1. DGPTFVC2 ;ALB/MJK - Expanded PTF Close-Out Edits ; Jul 20 88
  1. ;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
  1. ;called from Q+2^DGPTFTR
  1. ; input : PTF
  1. ; output: DGERR DGERR := 1 if record fails to pass a check
  1. ; DGERR := "" if record passes all checks
  1. EN ;
  1. Q:'$D(PTF)
  1. ; -- count mvts
  1. S DGMAX=25,DGERR="" N C,DGM,I,Y
  1. F DGM=501,535 S Y=PTF D @DGM I C>DGMAX S DGERR=1 W !,DGM," There are '",C,"' ",DGM," movements but only '",DGMAX,"' can be sent to Austin."
  1. I DGERR W !," *** Contact PTF supervisor ***" G ENQ
  1. ; -- check proc/surg dates
  1. G ENQ:T1
  1. S DGDCDT=+$S($D(^DGPT(PTF,70)):^(70),1:"")
  1. F DGM="P","S" F I=0:0 S I=$O(^DGPT(PTF,DGM,I)) Q:'I I $D(^(I,0)),+^(0)>DGDCDT S Y=^(0) D ERROR
  1. ENQ K DGMAX,DGDCDT Q
  1. ;
  1. ERROR ;
  1. S:'$D(^UTILITY("DG",$J,$S(DGM="P":601,1:401),I)) ^(I)="^" S X=^(I) S:X'["^1^" ^(I)=X_"1^"
  1. S DGERR=1,Y=+Y X ^DD("DD") W !,">>>> ",$S(DGM="P":"Procedure",1:"Surgery")," date/time of '",Y,"' is after the discharge date."
  1. ;
  1. LINES ; -- count the number of lines to be xmited for PTF rec
  1. ; input : Y := ifn of ^DGPT
  1. ; output: X := line count
  1. ;
  1. N NODE,C S X=2
  1. D 501 S X=X+C D 535 S X=X+C F NODE="P","S" F %=0:0 S %=$O(^DGPT(Y,NODE,%)) Q:'% I $D(^(%,0)),+^(0)'<T1,+^(0)'>T2 S X=X+1
  1. Q
  1. ;
  1. 501 ; -- count 501 mvts to xmit
  1. ; input : Y := IFN
  1. ; DGMTY := indicates entering from flag option [optional]
  1. ; output: C := # of entries
  1. ;
  1. N Z,D S C=1 ; always one 501
  1. ; count & check if between date range & ok to xmit
  1. F %=1:0 S %=$O(^DGPT(Y,"M",%)) Q:'% S C=C+1 I '$D(DGMTY),$D(^(%,0)) S Z=^(0),D=$P(Z,U,10) I D<T1!(D>T2)!($P(Z,U,17)="n") S C=C-1
  1. Q
  1. ;
  1. 535 ; -- count 535 mvts to xmit
  1. ; input : Y := IFN
  1. ; DGMTY := indicates entering from flag option [optional]
  1. ; output: C := # of entries
  1. ;
  1. N Z,D S C=0
  1. ; count & check if between date range & ok to xmit & not a 501 on date
  1. F %=0:0 S %=$O(^DGPT(Y,535,%)) Q:'% S C=C+1 I '$D(DGMTY),$D(^(%,0)) S Z=^(0),D=$P(Z,U,10) I 'D!(D<T1)!(D>T2)!($P(Z,U,17)="n")!($D(^DGPT(Y,"M","AM",+D))) S C=C-1
  1. Q
  1. ;