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

DGRPE4.m

Go to the documentation of this file.
  1. DGRPE4 ;ALB/GTS - REGISTRATIONS EDITS ; 5/25/05 08:53am
  1. ;;5.3;Registration;**624,1015**;Aug 13, 1993;Build 21
  1. ;
  1. ;DGDR contains a string of edits; edit=screen*10+item #
  1. ;
  1. ;line tag screen*10+item*1000 = continuation line
  1. ;
  1. N DGPH,DGPHFLG,UPARROUT
  1. S UPARROUT=0
  1. K DR S (DA,Y)=DFN,DIE="^DPT(",DR="",DGDRS="DR",DGCT=0
  1. I (DGDR["401") DO
  1. . S J1="A401"
  1. . S DGDRD=$P($T(@J1),";;",2)
  1. . D S
  1. . D ^DIE
  1. . I $D(Y)'=0 S UPARROUT=1
  1. . I UPARROUT=0 DO
  1. . . K DR,DA,Y,DIE
  1. . . S (DA,Y)=DFN,DIE="^DPT(",DR="",DGDRS="DR",DGCT=0
  1. . . S J1="B401"
  1. . . S DGDRD=$P($T(@J1),";;",2)
  1. . . D S
  1. . . S DIE("NO^")=""
  1. . . D ^DIE
  1. . . K DR,DA,Y,DIE
  1. . . N DGEMPST
  1. . . S DGEMPST=(+$P($G(^DPT(DFN,.311)),"^",15))
  1. . . I (DGEMPST]"")!(DGEMPST'=3)!(DGEMPST'=9) DO
  1. . . . S (DA,Y)=DFN,DIE="^DPT(",DR="",DGDRS="DR",DGCT=0
  1. . . . S J1="C401"
  1. . . . S DGDRD=$P($T(@J1),";;",2)
  1. . . . D S
  1. . . . D ^DIE
  1. K DR,DA,Y,DIE
  1. F Q:DGDR'["401," S DGDR=$P(DGDR,"401,")_""_$P(DGDR,"401,",2,999)
  1. I (UPARROUT=0)&(DGDR["402") DO
  1. . K DR S (DA,Y)=DFN,DIE="^DPT(",DR="",DGDRS="DR",DGCT=0
  1. . S J1="A402"
  1. . S DGDRD=$P($T(@J1),";;",2)
  1. . D S
  1. . D ^DIE
  1. . I $D(Y)'=0 S UPARROUT=1
  1. . I UPARROUT=0 DO
  1. . . K DR,DA,Y,DIE
  1. . . S (DA,Y)=DFN,DIE="^DPT(",DR="",DGDRS="DR",DGCT=0
  1. . . S J1="B402"
  1. . . S DGDRD=$P($T(@J1),";;",2)
  1. . . D S
  1. . . S DIE("NO^")=""
  1. . . D ^DIE
  1. . . K DR,DA,Y,DIE
  1. . . N DGEMPST
  1. . . S DGEMPST=(+$P($G(^DPT(DFN,.311)),"^",15))
  1. . . I (DGEMPST]"")!(DGEMPST'=3)!(DGEMPST'=9) DO
  1. . . . S (DA,Y)=DFN,DIE="^DPT(",DR="",DGDRS="DR",DGCT=0
  1. . . . S J1="C402"
  1. . . . S DGDRD=$P($T(@J1),";;",2)
  1. . . . D S
  1. . . . D ^DIE
  1. K DR,DA,Y,DIE
  1. F Q:DGDR'["402," S DGDR=$P(DGDR,"402,")_""_$P(DGDR,"402,",2,999)
  1. K DR,DA,Y,DIE
  1. Q
  1. S I $L(@DGDRS)+$L(DGDRD)<241 S @DGDRS=@DGDRS_DGDRD Q
  1. S DGCT=DGCT+1,DGDRS="DR(1,2,"_DGCT_")",@DGDRS=DGDRD Q
  1. Q
  1. A401 ;;.07;
  1. B401 ;;.31115;
  1. C401 ;;S DGST=$P(^DPT(DA,.311),"^",15);S:$S(DGST']"":1,DGST=3:1,DGST=9:1,1:0) Y=0 I Y=0 K DGST;S:($P(^DPT(DA,.311),"^",15)'=5) Y=.3111;.31116;.3111;S:X']"" Y="@41";.3113;S:X']"" Y=.3116;.3114;S:X']"" Y=.3116;.3115:.3117;.2205;.3119;@41;K DGST;
  1. A402 ;;.2514;
  1. B402 ;;.2515;
  1. C402 ;;S DGST=$P(^DPT(DA,.25),"^",15);S:$S(DGST']"":1,DGST=3:1,DGST=9:1,1:0) Y=0 I Y=0 K DGST;S:($P(^DPT(DA,.25),"^",15)'=5) Y=.251;.2516;.251;S:X']"" Y="@42";.252;S:X']"" Y=.255;.253;S:X']"" Y=.255;.254:.256;.2206;.258;@42;K DGST;