MHERPC ;OIT/RRP - Create Application Proxy user for Mental Health Escreening ;April 8,2021@17:09
 ;;1.0;MEDICAL HEALTH ESCREENING;**0**;08-APR-21;Build 7
 ;
 ; ICR #4677 = $$CREATE^XUSAP (API for Application Proxy)
 ; ICR #10141 = BMES^XPDUTL & MES^XPDUTL
 ; 
 ; Application Proxy name = "MHEAPPLICATIONPROXY,MHE"
 ; Secondary Menu Option name = "MHE RPCS CONTEXT"
 ;
RUNALL ; Entry point in the (Patch - MHE*1.0*0) to run ALL 2 steps
 D BMSG("Starting Post-Init")
 D PROXY
 D MSG("Post-Init Complete")
 Q
 ;
PROXY ; Create an Application Proxy for MHE application
 N X
 S X=$$CREATE^XUSAP("MHEAPPLICATIONPROXY,MHE","","MHE RPCS CONTEXT")
 ;
 I +X=0 D  Q
 . D BMSG("   Application Proxy User - 'MHEAPPLICATIONPROXY,MHE'")
 . D MSG("   already exists in the NEW PERSON file (#200)"),MSG("")
 ;
 I +X=-1 D  Q
 . D BMSG("   Application Proxy User - 'MHEAPPLICATIONPROXY,MHE'")
 . D MSG("   Unsuccessful; could not create Application Proxy User")
 . D MSG("   OR error in call to UPDATE^DIE)"),MSG("")
 ;
 D BMSG("   ********************************************************************")
 D MSG("   ** Application Proxy User - 'MHEAPPLICATIONPROXY,MHE' = created **")
 D MSG("   ** Secondary Menu Option - 'MHE RPCS CONTEXT' = linked    **")
 D MSG("   **                         to the Application Proxy.              **")
 D MSG("   ********************************************************************")
 D MSG("")
 Q
 ;
 ; A message is also recorded in INSTALL file
 ; (#9.7) entry for the installation.
 ;
 ; Output a message.
MSG(MSG) ; Integration Agreement #10141
 D MES^XPDUTL(MSG)
 Q
 ;
 ; Output a message with a blank line added.
BMSG(MSG) ; Integration Agreement #10141
 D BMES^XPDUTL(MSG)
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMHERPC   1749     printed  Sep 23, 2025@19:47:35                                                                                                                                                                                                      Page 2
MHERPC    ;OIT/RRP - Create Application Proxy user for Mental Health Escreening ;April 8,2021@17:09
 +1       ;;1.0;MEDICAL HEALTH ESCREENING;**0**;08-APR-21;Build 7
 +2       ;
 +3       ; ICR #4677 = $$CREATE^XUSAP (API for Application Proxy)
 +4       ; ICR #10141 = BMES^XPDUTL & MES^XPDUTL
 +5       ; 
 +6       ; Application Proxy name = "MHEAPPLICATIONPROXY,MHE"
 +7       ; Secondary Menu Option name = "MHE RPCS CONTEXT"
 +8       ;
RUNALL    ; Entry point in the (Patch - MHE*1.0*0) to run ALL 2 steps
 +1        DO BMSG("Starting Post-Init")
 +2        DO PROXY
 +3        DO MSG("Post-Init Complete")
 +4        QUIT 
 +5       ;
PROXY     ; Create an Application Proxy for MHE application
 +1        NEW X
 +2        SET X=$$CREATE^XUSAP("MHEAPPLICATIONPROXY,MHE","","MHE RPCS CONTEXT")
 +3       ;
 +4        IF +X=0
               Begin DoDot:1
 +5                DO BMSG("   Application Proxy User - 'MHEAPPLICATIONPROXY,MHE'")
 +6                DO MSG("   already exists in the NEW PERSON file (#200)")
                   DO MSG("")
               End DoDot:1
               QUIT 
 +7       ;
 +8        IF +X=-1
               Begin DoDot:1
 +9                DO BMSG("   Application Proxy User - 'MHEAPPLICATIONPROXY,MHE'")
 +10               DO MSG("   Unsuccessful; could not create Application Proxy User")
 +11               DO MSG("   OR error in call to UPDATE^DIE)")
                   DO MSG("")
               End DoDot:1
               QUIT 
 +12      ;
 +13       DO BMSG("   ********************************************************************")
 +14       DO MSG("   ** Application Proxy User - 'MHEAPPLICATIONPROXY,MHE' = created **")
 +15       DO MSG("   ** Secondary Menu Option - 'MHE RPCS CONTEXT' = linked    **")
 +16       DO MSG("   **                         to the Application Proxy.              **")
 +17       DO MSG("   ********************************************************************")
 +18       DO MSG("")
 +19       QUIT 
 +20      ;
 +21      ; A message is also recorded in INSTALL file
 +22      ; (#9.7) entry for the installation.
 +23      ;
 +24      ; Output a message.
MSG(MSG)  ; Integration Agreement #10141
 +1        DO MES^XPDUTL(MSG)
 +2        QUIT 
 +3       ;
 +4       ; Output a message with a blank line added.
BMSG(MSG) ; Integration Agreement #10141
 +1        DO BMES^XPDUTL(MSG)
 +2        QUIT