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

AGGINSUR.m

Go to the documentation of this file.
AGGINSUR ;VNGT/HS/ALA-Insurance Data ; 29 Apr 2010  4:32 PM
 ;;1.0;PATIENT REGISTRATION GUI;;Nov 15, 2010
 ;
GET(DATA,INIEN) ; EP -- AGG GET INSURANCE DATA
 NEW UID,II
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("AGGINSUR",UID))
 K @DATA
 ;
 S II=0
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^AGGINSUR D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 S @DATA@(II)="I00010IEN^T00030NAME^T00030STREET^T00015CITY^T00030STATE^T00010ZIP^T00015PHONE^T00015STATUS^T00025TYPE"_$C(30)
 I $G(INIEN)="" D
 . S IIEN=0
 . F  S IIEN=$O(^AUTNINS(IIEN)) Q:'IIEN  D RET(IIEN)
 ;
 I $G(INIEN)'="" D RET(INIEN)
 ;
DONE ;
 S II=II+1,@DATA@(II)=$C(31)
 Q
 ;
RET(IIEN) ;
 S STATUS=$P($G(^AUTNINS(IIEN,1)),"^",7),STATUS=$$STC^AGGUL1(9999999.18,.17,STATUS)
 S INS=^AUTNINS(IIEN,0)
 S ST=$P(INS,U,4) I ST'="" S ST=$P(^DIC(5,ST,0),U,1)
 S TYP=$P($G(^AUTNINS(IIEN,2)),U,1),TYP=$$STC^AGGUL1(9999999.18,.21,TYP)
 S II=II+1,@DATA@(II)=IIEN_U_$P(INS,U,1)_U_$P(INS,U,2)_U_$P(INS,U,3)_U_ST_U_$P(INS,U,5)_U_$P(INS,U,6)_U_STATUS_U_TYP_$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)
 Q