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

FSCRPCLL.m

Go to the documentation of this file.
FSCRPCLL ;SLC/STAFF-NOIS RPC List Long ;4/4/98  17:56
 ;;1.1;NOIS;;Sep 06, 1998
 ;
FILE(IN,OUT) ; from FSCRPX (RPCStaticFile)
 N DIR,FILE,FROM,LINE
 S LINE=$G(^TMP("FSCRPC",$J,"INPUT",1)),FILE=$P(LINE,U),FROM=$P(LINE,U,2),DIR=$P(LINE,U,3)
 I '$L(FILE) Q
 S FROM=$$FROM(FROM,FILE)
 I $E(FROM,$L(FROM)-1,$L(FROM))="`~" S $E(FROM,$L(FROM)-1,$L(FROM))="@~"
 I FILE="LOC" D LOC(FROM,DIR) Q
 I FILE="ACLLOC" D ACLLOC(FROM,DIR) Q
 I FILE="MOD" D MOD(FROM,DIR) Q
 I FILE="ACLMOD" D ACLMOD(FROM,DIR) Q
 I FILE="PACK" D PACK(FROM,DIR) Q
 I FILE="ACLPACK" D ACLPACK(FROM,DIR) Q
 I FILE="MAILGP" D MAILGP(FROM,DIR) Q
 I FILE="PATCH" D PATCH(FROM,DIR) Q
 I FILE="USER" D USER(FROM,DIR) Q
 I FILE="LIST" D LIST(FROM,DIR) Q
 I FILE="CALL" D CALL(FROM,DIR) Q
 Q
 ;
LOC(FROM,DIR) ;
 N IEN,CNT,NUM,ZERO S CNT=44,NUM=0
 F  Q:NUM>CNT  S FROM=$O(^FSC("SITE","B",FROM),DIR) Q:FROM=""  D
 .S IEN=0 F  S IEN=$O(^FSC("SITE","B",FROM,IEN)) Q:'IEN  D
 ..S ZERO=$G(^FSC("SITE",IEN,0)) Q:'$L(ZERO)  Q:$P(ZERO,U,2)
 ..S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=IEN_U_ZERO
 Q
 ;
ACLLOC(FROM,DIR) ;
 N IEN,IEN1,CNT,NUM,TEXT,ZERO S CNT=44,NUM=0
 S FROM=$$UP^XLFSTR(FROM)
 F  Q:NUM>CNT  S FROM=$O(^FSC("SITE","ACL",FROM),DIR) Q:FROM=""  D
 .S IEN=0 F  S IEN=$O(^FSC("SITE","ACL",FROM,IEN)) Q:'IEN  D
 ..S ZERO=$G(^FSC("SITE",IEN,0)) Q:'$L(ZERO)  Q:$P(ZERO,U,2)
 ..S IEN1=0 F  S IEN1=$O(^FSC("SITE","ACL",FROM,IEN,IEN1)) Q:IEN1<1  D
 ...S TEXT=$G(^FSC("SITE",IEN,99,IEN1,0)) Q:'$L(TEXT)
 ..S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=IEN_U_TEXT_U_$P(ZERO,U,2,99)
 Q
 ;
ACLMOD(FROM,DIR) ;
 N IEN,IEN1,CNT,NUM,TEXT,ZERO S CNT=44,NUM=0
 S FROM=$$UP^XLFSTR(FROM)
 F  Q:NUM>CNT  S FROM=$O(^FSC("MOD","ACL",FROM),DIR) Q:FROM=""  D
 .S IEN=0 F  S IEN=$O(^FSC("MOD","ACL",FROM,IEN)) Q:'IEN  D
 ..S ZERO=$G(^FSC("MOD",IEN,0)) Q:'$L(ZERO)  Q:$P(ZERO,U,2)
 ..S IEN1=0 F  S IEN1=$O(^FSC("MOD","ACL",FROM,IEN,IEN1)) Q:IEN1<1  D
 ...S TEXT=$G(^FSC("MOD",IEN,99,IEN1,0)) Q:'$L(TEXT)
 ..S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=IEN_U_TEXT_U_$P(ZERO,U,2,99)
 Q
 ;
MOD(FROM,DIR) ;
 N IEN,CNT,NUM,ZERO S CNT=44,NUM=0
 F  Q:NUM>CNT  S FROM=$O(^FSC("MOD","B",FROM),DIR) Q:FROM=""  D
 .S IEN=0 F  S IEN=$O(^FSC("MOD","B",FROM,IEN)) Q:'IEN  D
 ..S ZERO=$G(^FSC("MOD",IEN,0)) Q:'$L(ZERO)  Q:$P(ZERO,U,2)
 ..S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=IEN_U_ZERO
 Q
 ;
PACK(FROM,DIR) ;
 N IEN,CNT,NUM S CNT=44,NUM=0
 F  Q:NUM>CNT  S FROM=$O(^FSC("PACK","B",FROM),DIR) Q:FROM=""  D
 .S IEN=0 F  S IEN=$O(^FSC("PACK","B",FROM,IEN)) Q:'IEN  D
 ..S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=IEN_U_$G(^FSC("PACK",IEN,0))
 Q
 ;
ACLPACK(FROM,DIR) ;
 N IEN,IEN1,CNT,NUM,TEXT,ZERO S CNT=44,NUM=0
 S FROM=$$UP^XLFSTR(FROM)
 F  Q:NUM>CNT  S FROM=$O(^FSC("MOD","ACL",FROM),DIR) Q:FROM=""  D
 .S IEN=0 F  S IEN=$O(^FSC("MOD","ACL",FROM,IEN)) Q:'IEN  D
 ..S ZERO=$G(^FSC("MOD",IEN,0)) Q:'$L(ZERO)  Q:$P(ZERO,U,2)
 ..S IEN1=0 F  S IEN1=$O(^FSC("MOD","ACL",FROM,IEN,IEN1)) Q:IEN1<1  D
 ...S TEXT=$G(^FSC("MOD",IEN,99,IEN1,0)) Q:'$L(TEXT)
 ..S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=IEN_U_TEXT_U_$P(ZERO,U,2,99)
 Q
 ;
MAILGP(FROM,DIR) ;
 N IEN,CNT,NUM,ZERO S CNT=44,NUM=0
 F  Q:NUM>CNT  S FROM=$O(^XMB(3.8,"B",FROM),DIR) Q:FROM=""  D
 .S IEN=0 F  S IEN=$O(^XMB(3.8,"B",FROM,IEN)) Q:'IEN  D
 ..S ZERO=$G(^XMB(3.8,IEN,0)) Q:'$L(ZERO)  Q:$P(ZERO,U,2)="PR"  Q:$O(^XMB(3.8,IEN,4,0))
 ..S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=IEN_U_ZERO
 Q
 ;
PATCH(FROM,DIR) ;
 N IEN,CNT,NUM,ZERO S CNT=44,NUM=0
 F  Q:NUM>CNT  S FROM=$O(^A1AE(11005,"B",FROM),DIR) Q:FROM=""  D
 .S IEN=0 F  S IEN=$O(^A1AE(11005,"B",FROM,IEN)) Q:'IEN  D
 ..S ZERO=$G(^A1AE(11005,IEN,0)) Q:'$L(ZERO)
 ..S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=IEN_U_$P(ZERO,U)_"   Seq# "_$P(ZERO,U,6)_"  "_$P(ZERO,U,5)
 Q
 ;
USER(FROM,DIR) ;
 N IEN,CNT,NUM,ZERO S CNT=44,NUM=0
 F  Q:NUM>CNT  S FROM=$O(^VA(200,"B",FROM),DIR) Q:FROM=""  D
 .S IEN=0 F  S IEN=$O(^VA(200,"B",FROM,IEN)) Q:'IEN  D
 ..S ZERO=$G(^VA(200,IEN,0)) Q:'$L(ZERO)  Q:ZERO  I $P(ZERO,U,11),$P(ZERO,U,11)<DT Q
 ..S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=IEN_U_$P(ZERO,U)
 Q
 ;
LIST(FROM,DIR) ;
 N IEN,CNT,NUM S CNT=44,NUM=0
 F  Q:NUM>CNT  S FROM=$O(^FSC("LIST","B",FROM),DIR) Q:FROM=""  D
 .S IEN=0 F  S IEN=$O(^FSC("LIST","B",FROM,IEN)) Q:'IEN  D
 ..Q:$P($G(^FSC("LIST",IEN,0)),U,99)="INACTIVE"  ;*** fix
 ..S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=IEN_U_$G(^FSC("LIST",IEN,0))
 Q
 ;
CALL(FROM,DIR) ;
 N IEN,CNT,NUM S CNT=44,NUM=0
 F  Q:NUM>CNT  S FROM=$O(^FSCD("CALL","B",FROM),DIR) Q:FROM=""  D
 .S IEN=0 F  S IEN=$O(^FSCD("CALL","B",FROM,IEN)) Q:'IEN  D
 ..S NUM=NUM+1,^TMP("FSCRPC",$J,"OUTPUT",NUM)=IEN_U_$G(^FSCD("CALL",IEN,0))
 Q
 ;
FROM(FROM,FILE) ; $$(from) -> exteral value for `ien lookups
 N EXACT
 I $E(FROM)="`" D  Q FROM
 .I $E(FROM,$L(FROM)-1)="/" S EXACT=+$E(FROM,2,245)*10
 .E  S EXACT=1+$E(FROM,2,245)
 .I FILE="USER" S FROM=$P($G(^VA(200,EXACT,0)),U)
 .I FILE="MOD" S FROM=$P($G(^FSC("MOD",EXACT,0)),U)
 .I FILE="ACLMOD" S FROM=$G(^FSC("MOD",EXACT,99,+$O(^FSC("MOD",EXACT,99,0)),0))
 .I FILE="LOC" S FROM=$P($G(^FSC("SITE",EXACT,0)),U)
 .I FILE="ACLLOC" S FROM=$G(^FSC("SITE",EXACT,99,+$O(^FSC("SITE",EXACT,99,0)),0))
 .I FILE="MAILGP" S FROM=$P($G(^XMB(3.8,EXACT,0)),U)
 .I FILE="PATCH" S FROM=$P($G(^A1AE(11005,EXACT,0)),U)
 .I FILE="PACK" S FROM=$P($G(^FSC("PACK",EXACT,0)),U)
 .I FILE="ACLPACK" S FROM=$G(^FSC("PACK",EXACT,99,+$O(^FSC("PACK",EXACT,99,0)),0))
 .I FILE="LIST" S FROM=$P($G(^FSC("LIST",EXACT,0)),U)
 .S FROM=$E(FROM,1,$L(FROM)-1)_$C($A($E(FROM,$L(FROM)))-1)_"~"
 Q FROM