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

YSGAFAPI.m

Go to the documentation of this file.
YSGAFAPI ;ALB/ASF- GAF API ;2/7/02  15:57
 ;;5.01;MENTAL HEALTH;**53,71,82**;Dec 30, 1994;Build 3
GAFHX(YSDATA,YS) ;
 N YSBEG,YSEND,YSLIMIT
 K YSDATA
 D PARSE(.YS)
 I DFN'>0 S YSDATA(1)="[ERROR]",YSDATA(2)="No dfn" Q
 S YSDATA(1)="[DATA]"
 S N=1
 D HXLP
 Q
PARSE(YS) ; -- array parsing
 N X,Y,%DT
 S DFN=$G(YS("DFN"),0)
 S YSBEG=$G(YS("BEGIN"),"01/01/1970") S X=YSBEG D ^%DT S YSBEG=Y
 S YSEND=$G(YS("END"),"01/01/2500") S X=YSEND D ^%DT S YSEND=Y
 S YSLIMIT=$G(YS("LIMIT"),9999)
 Q
HXLP ;
 N YSJJ,YSDD,X,Y,YSX,YSN
 S YSDD=9999999-YSEND-.00001
 F YSJJ=1:1:YSLIMIT S YSDD=$O(^YSD(627.8,"AX5",DFN,YSDD)) Q:YSDD'>0!(YSDD>(9999999-YSBEG))  D
  . S YSN=0 F  S YSN=$O(^YSD(627.8,"AX5",DFN,YSDD,YSN)) Q:YSN'>0  D
 .. S YSX=$P($G(^YSD(627.8,YSN,60)),U,3)
 .. S Y=$P($G(^YSD(627.8,YSN,0)),U,3)
 .. S YSX=Y_U_$$FMTE^XLFDT(Y,"5TZ")_"^GAF^GAF^"_YSX
 .. S YSX=YSX_U_YSN_U_$$EXTERNAL^DILFD(627.8,.04,"",$P($G(^YSD(627.8,YSN,0)),U,4)) ;ASF 2/7/02
 .. S YSX=YSX_U_$G(^YSD(627.8,YSN,80,1,0))
 .. D SET(YSX)
 Q
SET(X) ;
 S N=N+1
 S YSDATA(N)=X
 Q