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

KMPPS44B.m

Go to the documentation of this file.
KMPPS44B ;SP/JML - KMP*4*4 POST INSTALL ROUTINE ;11/1/2023
 ;;4.0;CAPACITY MANAGEMENT;**4**;3/1/2018;Build 36
 ;
 ;
 ;
GETCONFIGP(MDEF) ;
 D MDEF.Implementation.WriteLine("    TRY {")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP GetConfigPEvent"")")
 D MDEF.Implementation.WriteLine("        Do %response.SetHeader(""Access-Control-Allow-Origin"",""*"")")
 D MDEF.Implementation.WriteLine("        Do %response.SetHeader(""Allow"",""HEAD,GET,POST,PUT,DELETE,OPTIONS"")")
 D MDEF.Implementation.WriteLine("        S KMPRET=##class(%DynamicObject).%New()")
 D MDEF.Implementation.WriteLine("        S KMPREQ=##class(%DynamicAbstractObject).%FromJSON(%request.Content)")
 D MDEF.Implementation.WriteLine("        I KMPREQ.Function'=""GetConfig"" D  Return $$$OK")
 D MDEF.Implementation.WriteLine("        .S KMPRET.ResultText=""Incorrect Function Type""")
 D MDEF.Implementation.WriteLine("        .W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("        D SITE^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("        D CPF^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("        D MON^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("        S KMPRET.ResultText=""OK""")
 D MDEF.Implementation.WriteLine("        S KMPRET.Function=KMPREQ.Function")
 D MDEF.Implementation.WriteLine("        W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP GetConfigPHandler"")")
 D MDEF.Implementation.WriteLine("        Return $$$OK")
 D MDEF.Implementation.WriteLine("    } CATCH KMPERR {")
 D MDEF.Implementation.WriteLine("        Return ..Http500(KMPERR)")
 D MDEF.Implementation.WriteLine("    }")
 Q
 ;
SETCONFIGP(MDEF) ;
 D MDEF.Implementation.WriteLine("    TRY {")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP SetConfigPEvent"")")
 D MDEF.Implementation.WriteLine("        Do %response.SetHeader(""Access-Control-Allow-Origin"",""*"")")
 D MDEF.Implementation.WriteLine("        Do %response.SetHeader(""Allow"",""HEAD,GET,POST,PUT,DELETE,OPTIONS"")")
 D MDEF.Implementation.WriteLine("        S KMPRET=##class(%DynamicObject).%New()")
 D MDEF.Implementation.WriteLine("        S KMPREQ=##class(%DynamicAbstractObject).%FromJSON(%request.Content)")
 D MDEF.Implementation.WriteLine("        I KMPREQ.Function'=""SetConfig"" D  Return $$$OK")
 D MDEF.Implementation.WriteLine("        .S KMPRET.ResultText=""Incorrect Function Type""")
 D MDEF.Implementation.WriteLine("        .W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("        S KMPRET.ResultText=$$SETCFG^KMPUTLW2(KMPREQ)")
 D MDEF.Implementation.WriteLine("        D SITE^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("        D CPF^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("        D MON^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("        S KMPRET.Function=KMPREQ.Function")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP SetConfigPHandler"")")
 D MDEF.Implementation.WriteLine("        W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("        Return $$$OK")
 D MDEF.Implementation.WriteLine("    } CATCH KMPERR {")
 D MDEF.Implementation.WriteLine("        Return ..Http500(KMPERR)")
 D MDEF.Implementation.WriteLine("    }")
 Q
 ;
GETERRORP(MDEF) ;
 D MDEF.Implementation.WriteLine("    TRY {")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP GetErrorPEvent"")")
 D MDEF.Implementation.WriteLine("        Do %response.SetHeader(""Access-Control-Allow-Origin"",""*"")")
 D MDEF.Implementation.WriteLine("        Do %response.SetHeader(""Allow"",""HEAD,GET,POST,PUT,DELETE,OPTIONS"")")
 D MDEF.Implementation.WriteLine("        S KMPRET=##class(%DynamicObject).%New()")
 D MDEF.Implementation.WriteLine("        S KMPREQ=##class(%DynamicAbstractObject).%FromJSON(%request.Content)")
 D MDEF.Implementation.WriteLine("        I KMPREQ.Function'=""GetError"" D  Return $$$OK")
 D MDEF.Implementation.WriteLine("        .S KMPRET.ResultText=""Incorrect Function Type""")
 D MDEF.Implementation.WriteLine("        .W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("        D GETERR^KMPUTLW2(KMPRET,KMPREQ)")
 D MDEF.Implementation.WriteLine("        D SITE^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("        S KMPRET.ResultText=""OK""")
 D MDEF.Implementation.WriteLine("        S KMPRET.Function=KMPREQ.Function")
 D MDEF.Implementation.WriteLine("        W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP GetErrorPHandler"")")
 D MDEF.Implementation.WriteLine("        Return $$$OK")
 D MDEF.Implementation.WriteLine("    } CATCH KMPERR {")
 D MDEF.Implementation.WriteLine("        Return ..Http500(KMPERR)")
 D MDEF.Implementation.WriteLine("    }")
 Q
 ;
GETCTMLOGP(MDEF) ;
 D MDEF.Implementation.WriteLine("    TRY {")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP GetCtmLogPEvent"")")
 D MDEF.Implementation.WriteLine("        Do %response.SetHeader(""Access-Control-Allow-Origin"",""*"")")
 D MDEF.Implementation.WriteLine("        Do %response.SetHeader(""Allow"",""HEAD,GET,POST,PUT,DELETE,OPTIONS"")")
 D MDEF.Implementation.WriteLine("        S KMPRET=##class(%DynamicObject).%New()")
 D MDEF.Implementation.WriteLine("        S KMPREQ=##class(%DynamicAbstractObject).%FromJSON(%request.Content)")
 D MDEF.Implementation.WriteLine("        I KMPREQ.Function'=""GetCtmLog"" D  Return $$$OK")
 D MDEF.Implementation.WriteLine("        .S KMPRET.ResultText=""Incorrect Function Type""")
 D MDEF.Implementation.WriteLine("        .W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("        D SITE^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("        D CTMLOG^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("        S KMPRET.ResultText=""OK""")
 D MDEF.Implementation.WriteLine("        S KMPRET.Function=KMPREQ.Function")
 D MDEF.Implementation.WriteLine("        W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP GetCtmLogPHandler"")")
 D MDEF.Implementation.WriteLine("        Return $$$OK")
 D MDEF.Implementation.WriteLine("    } CATCH KMPERR {")
 D MDEF.Implementation.WriteLine("        Return ..Http500(KMPERR)")
 D MDEF.Implementation.WriteLine("    }")
 Q
 ;
GETPATLISTP(MDEF) ;
 D MDEF.Implementation.WriteLine("    TRY {")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP GetPatientListPEvent"")")
 D MDEF.Implementation.WriteLine("        Do %response.SetHeader(""Access-Control-Allow-Origin"",""*"")")
 D MDEF.Implementation.WriteLine("        Do %response.SetHeader(""Allow"",""HEAD,GET,POST,PUT,DELETE,OPTIONS"")")
 D MDEF.Implementation.WriteLine("        S KMPRET=##class(%DynamicObject).%New()")
 D MDEF.Implementation.WriteLine("        S KMPREQ=##class(%DynamicAbstractObject).%FromJSON(%request.Content)")
 D MDEF.Implementation.WriteLine("        I KMPREQ.Function'=""GetPatientList"" D  Return $$$OK")
 D MDEF.Implementation.WriteLine("        .S KMPRET.ResultText=""Incorrect Function Type""")
 D MDEF.Implementation.WriteLine("        .W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("        D SITE^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("        D PATLIST^KMPSYNTH(KMPRET,KMPREQ.Count)")
 D MDEF.Implementation.WriteLine("        S KMPRET.Function=KMPREQ.Function")
 D MDEF.Implementation.WriteLine("        W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP GetPatientListPHandler"")")
 D MDEF.Implementation.WriteLine("        Return $$$OK")
 D MDEF.Implementation.WriteLine("    } CATCH KMPERR {")
 D MDEF.Implementation.WriteLine("        Return ..Http500(KMPERR)")
 D MDEF.Implementation.WriteLine("    }")
 Q
 ;
RETRYP(MDEF) ;
 D MDEF.Implementation.WriteLine("    TRY {")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP RetryPEvent"")")
 D MDEF.Implementation.WriteLine("        Do %response.SetHeader(""Access-Control-Allow-Origin"",""*"")")
 D MDEF.Implementation.WriteLine("        Do %response.SetHeader(""Allow"",""HEAD,GET,POST,PUT,DELETE,OPTIONS"")")
 D MDEF.Implementation.WriteLine("        S KMPRET=##class(%DynamicObject).%New()")
 D MDEF.Implementation.WriteLine("        S KMPREQ=##class(%DynamicAbstractObject).%FromJSON(%request.Content)")
 D MDEF.Implementation.WriteLine("        I KMPREQ.Function'=""Retry"" D  Return $$$OK")
 D MDEF.Implementation.WriteLine("        .S KMPRET.ResultText=""Incorrect Function Type""")
 D MDEF.Implementation.WriteLine("        .W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("        S KMPRET.ResultText=$$RETRY^KMPUTLW(KMPREQ)")
 D MDEF.Implementation.WriteLine("        D SITE^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("        S KMPRET.Function=KMPREQ.Function")
 D MDEF.Implementation.WriteLine("        W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP RetryPHandler"")")
 D MDEF.Implementation.WriteLine("        Return $$$OK")
 D MDEF.Implementation.WriteLine("    } CATCH KMPERR {")
 D MDEF.Implementation.WriteLine("        Return ..Http500(KMPERR)")
 D MDEF.Implementation.WriteLine("    }")
 Q
 ;
GETPACKAGESP(MDEF) ;
 D MDEF.Implementation.WriteLine("    TRY {")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP GetPackagesPEvent"")")
 D MDEF.Implementation.WriteLine("        Do %response.SetHeader(""Access-Control-Allow-Origin"",""*"")")
 D MDEF.Implementation.WriteLine("        Do %response.SetHeader(""Allow"",""HEAD,GET,POST,PUT,DELETE,OPTIONS"")")
 D MDEF.Implementation.WriteLine("        S KMPRET=##class(%DynamicObject).%New()")
 D MDEF.Implementation.WriteLine("        S KMPREQ=##class(%DynamicAbstractObject).%FromJSON(%request.Content)")
 D MDEF.Implementation.WriteLine("        I KMPREQ.Function'=""GetPackages"" D  Return $$$OK")
 D MDEF.Implementation.WriteLine("        .S KMPRET.ResultText=""Incorrect Function Type""")
 D MDEF.Implementation.WriteLine("        .W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("        D SITE^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("        D PACKAGES^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("        S KMPRET.ResultText=""OK""")
 D MDEF.Implementation.WriteLine("        S KMPRET.Function=KMPREQ.Function")
 D MDEF.Implementation.WriteLine("        W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP GetPackagesPHandler"")")
 D MDEF.Implementation.WriteLine("        Return $$$OK")
 D MDEF.Implementation.WriteLine("    } CATCH KMPERR {")
 D MDEF.Implementation.WriteLine("        Return ..Http500(KMPERR)")
 D MDEF.Implementation.WriteLine("    }")
 Q
 ;
GETHTTPP(MDEF) ;
 D MDEF.Implementation.WriteLine("    TRY {")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP GetHttpMetricsPEvent"")")
 D MDEF.Implementation.WriteLine("        Do %response.SetHeader(""Access-Control-Allow-Origin"",""*"")")
 D MDEF.Implementation.WriteLine("        Do %response.SetHeader(""Allow"",""HEAD,GET,POST,PUT,DELETE,OPTIONS"")")
 D MDEF.Implementation.WriteLine("        S KMPRET=##class(%DynamicObject).%New()")
 D MDEF.Implementation.WriteLine("        S KMPREQ=##class(%DynamicAbstractObject).%FromJSON(%request.Content)")
 D MDEF.Implementation.WriteLine("        I KMPREQ.Function'=""HttpMetrics"" D  Return $$$OK")
 D MDEF.Implementation.WriteLine("        .S KMPRET.ResultText=""Incorrect Function Type""")
 D MDEF.Implementation.WriteLine("        .W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("        D SITE^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("        S KMPMCHK=KMPREQ.Montype")
 D MDEF.Implementation.WriteLine("        I KMPMCHK="""" S KMPMCHK=""ALL""")
 D MDEF.Implementation.WriteLine("        S KMPDATE=KMPREQ.Date")
 D MDEF.Implementation.WriteLine("        ; parse odbc date format into fileman data format")
 D MDEF.Implementation.WriteLine("        S KMPDCHK=""3""_$E(KMPDATE,3,4)_$P(KMPDATE,""-"",2)_$P(KMPDATE,""-"",3)")
 D MDEF.Implementation.WriteLine("        S KMPRET.Date=KMPDATE")
 D MDEF.Implementation.WriteLine("        S KMPMLIST=##class(%DynamicArray).%New()")
 D MDEF.Implementation.WriteLine("        S KMPSUB=""KMP""")
 D MDEF.Implementation.WriteLine("        F  S KMPSUB=$O(^XTMP(KMPSUB)) Q:$E(KMPSUB,1,3)'=""KMP""  D")
 D MDEF.Implementation.WriteLine("        .S KMPDAY=$P(KMPSUB,"" "",2)")
 D MDEF.Implementation.WriteLine("        .Q:KMPDCHK'=KMPDAY")
 D MDEF.Implementation.WriteLine("        .S KMPMTYP=0")
 D MDEF.Implementation.WriteLine("        .F  S KMPMTYP=$O(^XTMP(KMPSUB,KMPMTYP)) Q:KMPMTYP=""""  D")
 D MDEF.Implementation.WriteLine("        ..Q:(KMPMCHK'[KMPMTYP)&&(KMPMCHK'=""ALL"")")
 D MDEF.Implementation.WriteLine("        ..S KMPMOBJ=##class(%DynamicObject).%New()")
 D MDEF.Implementation.WriteLine("        ..S KMPMOBJ.Monitor=KMPMTYP")
 D MDEF.Implementation.WriteLine("        ..S KMPDARR=##class(%DynamicArray).%New()")
 D MDEF.Implementation.WriteLine("        ..S KMPNODE=""""")
 D MDEF.Implementation.WriteLine("        ..F  S KMPNODE=$O(^XTMP(KMPSUB,KMPMTYP,""HTTP"",KMPNODE)) Q:KMPNODE=""""  D")
 D MDEF.Implementation.WriteLine("        ...S KMPT=""""")
 D MDEF.Implementation.WriteLine("        ...F  S KMPT=$O(^XTMP(KMPSUB,KMPMTYP,""HTTP"",KMPNODE,KMPT)) Q:KMPT=""""  D")
 D MDEF.Implementation.WriteLine("        ....S KMPTIME=$ZT(KMPT)")
 D MDEF.Implementation.WriteLine("        ....S KMPDATA=^XTMP(KMPSUB,KMPMTYP,""HTTP"",KMPNODE,KMPT)")
 D MDEF.Implementation.WriteLine("        ....S KMPDATA=KMPTIME_""^""_KMPNODE_""^""_KMPDATA")
 D MDEF.Implementation.WriteLine("        ....D KMPDARR.%Push(KMPDATA)")
 D MDEF.Implementation.WriteLine("        ..S KMPMOBJ.Data=KMPDARR")
 D MDEF.Implementation.WriteLine("        ..D KMPMLIST.%Push(KMPMOBJ)")
 D MDEF.Implementation.WriteLine("        S KMPRET.Monitors=KMPMLIST")
 D MDEF.Implementation.WriteLine("        S KMPRET.Function=KMPREQ.Function")
 D MDEF.Implementation.WriteLine("        S KMPRET.ResultText=""OK""")
 D MDEF.Implementation.WriteLine("        W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP GetHttpMetricsPHandler"")")
 D MDEF.Implementation.WriteLine("        Return $$$OK")
 D MDEF.Implementation.WriteLine("    } CATCH KMPERR {")
 D MDEF.Implementation.WriteLine("        Return ..Http500(KMPERR)")
 D MDEF.Implementation.WriteLine("    }")
 Q