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

AGFACE11.m

Go to the documentation of this file.
AGFACE11 ; IHS/ASDS/EFG - FACE SHEET (ADDITIONAL INFORMATION) ; 
 ;;7.1;PATIENT REGISTRATION;**4**;AUG 25,2005
 ;Q:$G(AGOPT(13))'="Y"!'$D(^AUPNPAT(DFN,13,1))
 I $G(AGOPT(13))'="Y"!'$D(^AUPNPAT(DFN,13,1)) D HIST Q  ;IHS/SD/TPF BAR*7.1*4
 W !,$G(AG("-")),!,"ADDITIONAL REGISTRATION INFORMATION:"
 ;G FIRST:$E($G(AGOPT(21)),1,1)="F"!($E($G(AGOPT(21)),1,1)="f")
 ;G LAST:$E($G(AGOPT(21)),1,1)="L"!($E($G(AGOPT(21)),1,1)="l")
 ;G ALL:$G(AGOPT(21))="A"
 D FIRST:$E($G(AGOPT(21)),1,1)="F"!($E($G(AGOPT(21)),1,1)="f")
 D LAST:$E($G(AGOPT(21)),1,1)="L"!($E($G(AGOPT(21)),1,1)="l")
 D ALL:$G(AGOPT(21))="A"
 ;IHS/SD/TPF BAR*7.1*4 HISTORICAL ADDRESSES
 ;IF PARAM = 0, PRINT NOTHING
HIST ;EP -
 I $$GET1^DIQ(9009061,DUZ(2)_",",602,"I") D
 .D ADDRHIST  ;AG*7.1*4
 .D EMALHIST  ;AG*7.1*4
 Q:$G(AGOPT(21))=0
 Q
LAST ;PRINT THE LAST # LINES
 S AG=$O(^AUPNPAT(DFN,13,""),-1)
 Q:'+AG
 S AG=AG-($E($G(AGOPT(21)),2,4))
 ;IF THE REG PARAMETER IS GREATER THAN THE NUMBER
 ;OF RECORDS IN NODE 13, PRINT THEM ALL
 I AG<1 G ALL
 ;IF THE PARAM IS LESS THAN THE NUMBER OF RECORDS
 ;IN NODE 13, PRINT THE NUMBER OF LINES REQUESTED.
 F  S AG=$O(^AUPNPAT(DFN,13,AG)) Q:'AG  D
 . W !?5,AG,"). ",$G(^AUPNPAT(DFN,13,AG,0))
 Q
FIRST ;PRINT THE FIRST # LINES
 S AG=0
 F  S AG=$O(^AUPNPAT(DFN,13,AG)) Q:'AG!(AG>($E($G(AGOPT(21)),2,4)))  D
 . W !?5,AG,"). ",$G(^AUPNPAT(DFN,13,AG,0))
 Q
ALL ;THIS CODE PRINTS ALL LINES
 F AG=0:0 S AG=$O(^AUPNPAT(DFN,13,AG)) Q:'AG  W !?5,AG,"). ",$G(^AUPNPAT(DFN,13,AG,0))
 Q
 ;
 ;BEGIN NEW CODE FOR AG*7.1*4 HISTORICAL ADDRESSES
ADDRHIST ;EP - PRINT PREVIOUS MAIL ADRESSES
 ;BEGIN NEW CODE FOR HISTORICAL MAIL ADDRESSES
 N HISTLIM,HISTREC,IENS
 S HISTLIM=$$GET1^DIQ(9009061,DUZ(2)_",",601,"I")
 W !!,AG("=")
 W !,"HISTORICAL ADDRESS(S):"
 S HISTREC=0
 F CNT=1:1 S HISTREC=$O(^AUPNPAT(DFN,83,HISTREC)) Q:'HISTREC!(CNT>HISTLIM)  D
 .S IENS=HISTREC_","_DFN_","
 .W:$$GET1^DIQ(9000001.83,IENS,.02)'="" !?9,$$GET1^DIQ(9000001.83,IENS,.02)
 .W:$$GET1^DIQ(9000001.83,IENS,.03)'="" !?9,$$GET1^DIQ(9000001.83,IENS,.03)
 .W:$$GET1^DIQ(9000001.83,IENS,.04)'="" !?9,$$GET1^DIQ(9000001.83,IENS,.04)
 .W !?9,$$GET1^DIQ(9000001.83,IENS,.05)_", "
 .W $$GET1^DIQ(9000001.83,IENS,.06)
 .W "  ",$$GET1^DIQ(9000001.83,IENS,.07)
 .W !?9,$$GET1^DIQ(9000001.83,IENS,.08)
 ;END NEW CODE
 Q
EMALHIST ;EP - PRINT HISTORICAL EMAIL ADDRESSES
 N HISTLIM,HISTREC,IENS
 S HISTLIM=$$GET1^DIQ(9009061,DUZ(2)_",",601,"I")
 W !!,AG("=")
 W !,"HISTORICAL EMAIL ADDRESS(S):"
 S HISTREC=0
 F CNT=1:1 S HISTREC=$O(^AUPNPAT(DFN,82,HISTREC)) Q:'HISTREC!(CNT>HISTLIM)  D
 .S IENS=HISTREC_","_DFN_","
 .W !?9,$$GET1^DIQ(9000001.82,IENS,.02)
 Q