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)