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

HMP0311Q.m

Go to the documentation of this file.
HMP0311Q ;ASMR/MAT - HMP Subscribe Client Protocols to VAFC;10/1/2015 12:49pm
 ;;2.0;ENTERPRISE HEALTH MANAGEMENT PLATFORM;**;November 30,2015;Build 63
 ;Per VA Directive 6402, this routine should not be modified.
 ;
 ; DE2393 - MAT - Subscribe HMP ADT-A0# CLIENT Protocol to VAFC ADT-A0# SERVER
 ;
 ; Called from POST^HMPP3I.
 Q
 ;
POST ;
 D MES^XPDUTL($T(+0)_" post-init routine started "_$$HTE^XLFDT($H))
 D MES^XPDUTL($$HMPA04())
 D MES^XPDUTL($$HMPA08())
 D MES^XPDUTL("HMP ADT-A0# CLIENT protocols subscribed "_$$HTE^XLFDT($H))
 Q
 ;
HMPA04() ;
 N HMPSUBS
 S HMPSUBS=$$PROTSUBS("HMP ADT-A04 CLIENT","VAFC ADT-A04 SERVER")
 Q HMPSUBS
 ;
HMPA08() ;
 N HMPSUBS
 S HMPSUBS=$$PROTSUBS("HMP ADT-A08 CLIENT","VAFC ADT-A08 SERVER")
 Q HMPSUBS
 ;
 ;=== Subscribe PROTSRC to PROTARG.
 ;
PROTSUBS(PROTSRC,PROTARG) ;
 ;
 ;--- Validate SOURCE and TARGET exist.
 N IENPSRC S IENPSRC=$$YNPROTO(PROTSRC)
 Q:IENPSRC=-1 "SOURCE PROTOCOL "_PROTSRC_" NOT FOUND."
 ;
 N IENPTRG S IENPTRG=$$YNPROTO(PROTARG)
 Q:IENPTRG=-1 "TARGET PROTOCOL "_PROTARG_" NOT FOUND."
 ;
 ;--- Validate SOURCE is not a subscriber of TARGET.
 N IENPSUB S IENPSUB=$$YNSUBSCR(PROTSRC,IENPTRG)
 Q:IENPSUB>0 "PROTOCOL "_PROTSRC_" ALREADY SUBSCRIBED TO "_PROTARG_"."
 ;
 ;--- Subscribe SOURCE to TARGET.
 N FDA S FDA(1,101.0775,"+1,"_IENPTRG_",",.01)=PROTSRC
 D UPDATE^DIE("E","FDA(1)")
 Q "PROTOCOL "_PROTSRC_" IS NOW SUBSCRIBED TO "_PROTARG_"."
 ;
 ;=== Return the PROTOCOL File IEN or -1 if not exist.
 ;
YNPROTO(PROTO) ;
 N DIC,X,Y S X=PROTO,DIC="^ORD(101," D ^DIC
 Q +Y
 ;
 ;=== Return the SUBSCRIBER Sub-File IEN or -1 if not exist.
 ;
YNSUBSCR(PROTSRC,IENPTRG) ;
 N DIC,X,Y S X=PROTSRC,DIC="^ORD(101,"_IENPTRG_",775," D ^DIC
 Q +Y
 ;
 ; HMP0311Q