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

AGGRFCE.m

Go to the documentation of this file.
AGGRFCE ;VNGT/HS/ALA-FACE Sheet ; 28 Apr 2010  11:40 AM
 ;;1.0;PATIENT REGISTRATION GUI;;Nov 15, 2010
 ;
 ;
 Q
 ;
EN(DATA,DFN) ; EP -- AGG PATIENT FACE SHEET
 ;Description
 ;  Generates a Patient Face Sheet for a given DFN
 ;
 ;Input
 ;  DFN - Patient Internal ID
 ;
 ;Output
 ;  DATA - Name of global in which data is stored(^TMP("AGGRFCE"))
 ;
 NEW UID,X,II,HSTEXT,HSPATH,HSFN,Y,IOSL,IOST,IOM,I,N,RHIFLAG,RHI,NLN,AGG
 NEW %I,AGDENT,AGQI,AGQT,AGTP,C,DA,DG20NAME,DGNEWVAL,DIC,DIW,DIWT,DN,DR,REC
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("AGGRFCE",UID))
 K @DATA
 ;
 S II=0
 ;
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^AGGRFCE D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 S RHI="",TEXT=""
 S IOSL=999,IOM=80,IOST="P-OTHER80"
 S IOST(0)=$$FIND1^DIC(3.2,,"X",IOST)
 D CHKRHI^AG
 I $G(RHIFLAG)'="",RHIFLAG="A" S RHI="This patient has Restricted Health Information"
 ;
 D HDR
 ;
 I $$TMPFL^AGGUL1("W",UID,DFN) G DONE
 ;
 K AG,AGOPT
 D ^AGDATCK
 I AG("DTOT")>0 D ^AGGRFCRQ
 I $D(AGG)>1 S TEXT="",NLN="" F  S NLN=$O(AGG(NLN)) Q:NLN=""  S TEXT=TEXT_AGG(NLN)_$C(10)
 S TEXT=$$TKO^AGGUL1(TEXT,$C(10))
 S AGVQQFS=1
 U IO D START^AGFACE
 U IO W $C(9)
 ;
 K AGVQQFS
 ;
 I $$TMPFL^AGGUL1("C") G DONE
 I $$TMPFL^AGGUL1("R",UID,DFN) G DONE
 ;
 S II=II+1,@DATA@(II)=RHI_"^"_TEXT_"^"
 F  U IO R HSTEXT:.1 Q:HSTEXT[$C(9)  D
 . S HSTEXT=$$STRIP^XLFSTR(HSTEXT,"^"),HSTEXT=$$CTRL^AGGUL1(HSTEXT)
 . I HSTEXT="" S HSTEXT=" "
 . S II=II+1,@DATA@(II)=HSTEXT_$C(13)_$C(10)
 S II=II+1,@DATA@(II)=$C(30)
 ;
 I $$TMPFL^AGGUL1("C") G DONE
 I $$TMPFL^AGGUL1("D",UID,DFN) G DONE
 ;
DONE ;
 ;
 S II=II+1,@DATA@(II)=$C(31)
 K AG,AGOPT
 Q
 ;
HDR ;
 S @DATA@(II)="T00120RHI_MSG^T01024WARN_TEXT^T02048REPORT_TEXT"_$C(30)
 Q
 ;
ERR ;
 D ^%ZTER
 NEW Y,ERRDTM
 S Y=$$NOW^XLFDT() X ^DD("DD") S ERRDTM=Y
 S BMXSEC="Recording that an error occurred at "_ERRDTM
 I $D(II),$D(DATA) S II=II+1,@DATA@(II)=$C(31)
 I $$TMPFL^AGGUL1("C")
 Q