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

KMPPS44C.m

Go to the documentation of this file.
KMPPS44C ;SP/JML - KMP*4*4 POST INSTALL ROUTINE ;11/1/2023
 ;;4.0;CAPACITY MANAGEMENT;**4**;3/1/2018;Build 36
 ;
 ;
 ;
STOPMONG(MDEF) ;
 D MDEF.Implementation.WriteLine("    TRY {")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP GetStartMonitorGEvent"")")
 D MDEF.Implementation.WriteLine("        S KMPRET=##class(%DynamicObject).%New()")
 D MDEF.Implementation.WriteLine("        D SITE^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("        W ""<H1>Site</H1>""")
 D MDEF.Implementation.WriteLine("        S KMPITER = KMPRET.Site.%GetIterator()")
 D MDEF.Implementation.WriteLine("        WHILE KMPITER.%GetNext(.KEY,.KMPVALUE) {")
 D MDEF.Implementation.WriteLine("            W KEY_"": ""_KMPVALUE_""<BR>""")
 D MDEF.Implementation.WriteLine("        }")
 D MDEF.Implementation.WriteLine("        S KMPMCHK=%request.Get(""MONTYPE"")")
 D MDEF.Implementation.WriteLine("        I KMPMCHK=""ALL"" S KMPMCHK=""VBEM:VCSM:VETM:VHLM:VMCM:VSTM:VTCM""")
 D MDEF.Implementation.WriteLine("        F KMPI=1:1:$L(KMPMCHK,"":"") D")
 D MDEF.Implementation.WriteLine("        .S KMPQUIT=0")
 D MDEF.Implementation.WriteLine("        .S KMPVMKEY=$P(KMPMCHK,"":"",KMPI)")
 D MDEF.Implementation.WriteLine("        .W ""<H3>""_KMPVMKEY_""</H3>""")
 D MDEF.Implementation.WriteLine("        .I '$D(^KMPV(8969,""B"",KMPVMKEY)) D  Q:KMPQUIT")
 D MDEF.Implementation.WriteLine("        ..W ""    ""_KMPVMKEY_"" not a valid monitor""")
 D MDEF.Implementation.WriteLine("        ..S KMPQUIT=1")
 D MDEF.Implementation.WriteLine("        .D STOPMON^KMPVCBG(KMPVMKEY,1,1)")
 D MDEF.Implementation.WriteLine("        .W !,""    ""_KMPVMKEY_"" Stopped""")
 D MDEF.Implementation.WriteLine("        D RU^%ZOSVKR(""KMP GetStartMonitorGHandler"")")
 D MDEF.Implementation.WriteLine("        RETURN $$$OK")
 D MDEF.Implementation.WriteLine("    } CATCH KMPERR {")
 D MDEF.Implementation.WriteLine("        Return ..Http500(KMPERR)")
 D MDEF.Implementation.WriteLine("    }")
 Q
 ;
IMALIVEP(MDEF) ;
 D MDEF.Implementation.WriteLine("    TRY {")
 D MDEF.Implementation.WriteLine("      D RU^%ZOSVKR(""KMP SynthImAliveEvent"")")
 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 KMPREQ=##class(%DynamicAbstractObject).%FromJSON(%request.Content)")
 D MDEF.Implementation.WriteLine("      S KMPRET=##class(%DynamicObject).%New()")
 D MDEF.Implementation.WriteLine("      S KMPINST=##class(%SYS.System).GetInstanceName(),KMPNDTYP=$$NODETYPE^KMPUTLW(KMPINST)")
 D MDEF.Implementation.WriteLine("      I KMPNDTYP=""BE"",##CLASS(%SYSTEM.Mirror).IsPrimary()=0,##CLASS(%SYSTEM.Mirror).GetStatus()'=""NOTINIT""  D  Return $$$OK")
 D MDEF.Implementation.WriteLine("      .S KMPRET.ResultText=""Not Primary Backend""")
 D MDEF.Implementation.WriteLine("      .D RU^%ZOSVKR(""KMP SynthImAliveHandler"")")
 D MDEF.Implementation.WriteLine("      .W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("      I KMPREQ.Function'=""ImAlive"" D  Return $$$OK")
 D MDEF.Implementation.WriteLine("      .S KMPRET.ResultText=""Incorrect Function Type""")
 D MDEF.Implementation.WriteLine("      .D RU^%ZOSVKR(""KMP SynthImAliveHandler"")")
 D MDEF.Implementation.WriteLine("      .W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("      D SITE^KMPUTLW(KMPRET)")
 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 SynthImAliveHandler"")")
 D MDEF.Implementation.WriteLine("      Return $$$OK")
 D MDEF.Implementation.WriteLine("    } CATCH KMPERR {")
 D MDEF.Implementation.WriteLine("      Return ..Http500(KMPERR)")
 D MDEF.Implementation.WriteLine("    }")
 Q
 ;
SYNTHRCMDP(MDEF) ;
 D MDEF.Implementation.WriteLine("    TRY {")
 D MDEF.Implementation.WriteLine("      D RU^%ZOSVKR(""KMP SynthRcmdEvent"")")
 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 KMPREQ=##class(%DynamicAbstractObject).%FromJSON(%request.Content)")
 D MDEF.Implementation.WriteLine("      S KMPRET=##class(%DynamicObject).%New()")
 D MDEF.Implementation.WriteLine("      S KMPINST=##class(%SYS.System).GetInstanceName(),KMPNDTYP=$$NODETYPE^KMPUTLW(KMPINST)")
 D MDEF.Implementation.WriteLine("      I KMPNDTYP=""BE"",##CLASS(%SYSTEM.Mirror).IsPrimary()=0,##CLASS(%SYSTEM.Mirror).GetStatus()'=""NOTINIT""  D  Return $$$OK")
 D MDEF.Implementation.WriteLine("      .S KMPRET.ResultText=""Not Primary Backend""")
 D MDEF.Implementation.WriteLine("      .D RU^%ZOSVKR(""KMP SynthRcmdHandler"")")
 D MDEF.Implementation.WriteLine("      .W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("      I KMPREQ.Function'=""SynthRcmd"" D  Return $$$OK")
 D MDEF.Implementation.WriteLine("      .S KMPRET.ResultText=""Incorrect Function Type""")
 D MDEF.Implementation.WriteLine("      .D RU^%ZOSVKR(""KMP SynthRcmdHandler"")")
 D MDEF.Implementation.WriteLine("      .W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("      D SITE^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("      D SYNRCMD^KMPSYNTH(KMPRET)")
 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 SynthRcmdHandler"")")
 D MDEF.Implementation.WriteLine("      Return $$$OK")
 D MDEF.Implementation.WriteLine("    } CATCH KMPERR{")
 D MDEF.Implementation.WriteLine("      Return ..Http500(KMPERR)")
 D MDEF.Implementation.WriteLine("    }")
 Q
 ;
SYNTHFILEP(MDEF) ;
 D MDEF.Implementation.WriteLine("    TRY {")
 D MDEF.Implementation.WriteLine("      D RU^%ZOSVKR(""KMP SynthFileEvent"")")
 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 KMPREQ=##class(%DynamicAbstractObject).%FromJSON(%request.Content)")
 D MDEF.Implementation.WriteLine("      S KMPRET=##class(%DynamicObject).%New()")
 D MDEF.Implementation.WriteLine("      S KMPINST=##class(%SYS.System).GetInstanceName(),KMPNDTYP=$$NODETYPE^KMPUTLW(KMPINST)")
 D MDEF.Implementation.WriteLine("      I KMPNDTYP=""BE"",##CLASS(%SYSTEM.Mirror).IsPrimary()=0,##CLASS(%SYSTEM.Mirror).GetStatus()'=""NOTINIT""  D  Return $$$OK")
 D MDEF.Implementation.WriteLine("      .S KMPRET.ResultText=""Not Primary Backend""")
 D MDEF.Implementation.WriteLine("      .D RU^%ZOSVKR(""KMP SynthFileHandler"")")
 D MDEF.Implementation.WriteLine("      .W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("      I KMPREQ.Function'=""SynthFile"" D  Return $$$OK")
 D MDEF.Implementation.WriteLine("      .S KMPRET.ResultText=""Incorrect Function Type""")
 D MDEF.Implementation.WriteLine("      .D RU^%ZOSVKR(""KMP SynthFileHandler"")")
 D MDEF.Implementation.WriteLine("      .W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("      D SITE^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("      D SYNFILE^KMPSYNTH(KMPRET)")
 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 SynthFileHandler"")")
 D MDEF.Implementation.WriteLine("      Return $$$OK")
 D MDEF.Implementation.WriteLine("    } CATCH KMPERR{")
 D MDEF.Implementation.WriteLine("      Return ..Http500(KMPERR)")
 D MDEF.Implementation.WriteLine("    }")
 Q
 ;
SYNTHVPRP(MDEF) ;
 D MDEF.Implementation.WriteLine("    TRY {")
 D MDEF.Implementation.WriteLine("      ;demographics;reactions;problems;vitals;labs;meds;immunizations;observation;visits;appointments;documents;procedures;consults;flags;factors;skinTests;exams;education;insurance")
 D MDEF.Implementation.WriteLine("      D RU^%ZOSVKR(""KMP SynthVprEvent"")")
 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 KMPREQ=##class(%DynamicAbstractObject).%FromJSON(%request.Content)")
 D MDEF.Implementation.WriteLine("      S KMPRET=##class(%DynamicObject).%New()")
 D MDEF.Implementation.WriteLine("      S KMPINST=##class(%SYS.System).GetInstanceName(),KMPNDTYP=$$NODETYPE^KMPUTLW(KMPINST)")
 D MDEF.Implementation.WriteLine("      I KMPNDTYP=""BE"",##CLASS(%SYSTEM.Mirror).IsPrimary()=0,##CLASS(%SYSTEM.Mirror).GetStatus()'=""NOTINIT""  D  Return $$$OK")
 D MDEF.Implementation.WriteLine("      .S KMPRET.ResultText=""Not Primary Backend""")
 D MDEF.Implementation.WriteLine("      .D RU^%ZOSVKR(""KMP SynthVprHandler"")")
 D MDEF.Implementation.WriteLine("      .W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("      I KMPREQ.Function'=""SynthVpr"" D  Return $$$OK")
 D MDEF.Implementation.WriteLine("      .S KMPRET.ResultText=""Incorrect Function Type""")
 D MDEF.Implementation.WriteLine("      .D RU^%ZOSVKR(""KMP SynthVprHandler"")")
 D MDEF.Implementation.WriteLine("      .W KMPRET.%ToJSON()")
 D MDEF.Implementation.WriteLine("      D SITE^KMPUTLW(KMPRET)")
 D MDEF.Implementation.WriteLine("      D SYNVPR^KMPSYNTH(KMPRET,KMPREQ.PatientDfn,KMPREQ.ClinicalDomains)")
 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 SynthVprHandler"")")
 D MDEF.Implementation.WriteLine("      Return $$$OK")
 D MDEF.Implementation.WriteLine("    } CATCH KMPERR{")
 D MDEF.Implementation.WriteLine("      Return ..Http500(KMPERR)")
 D MDEF.Implementation.WriteLine("    }")
 Q
 ;
GETGLOBUFFG(MDEF) ;
 D MDEF.Implementation.WriteLine("    TRY {")
 D MDEF.Implementation.WriteLine("      D RU^%ZOSVKR(""KMP GetGlobuffEvent"")")
 D MDEF.Implementation.WriteLine("      S KMPRNS=$NAMESPACE")
 D MDEF.Implementation.WriteLine("      S $NAMESPACE=""%SYS""")
 D MDEF.Implementation.WriteLine("      S KMPTBUFF=$V($ZU(40,2,17),-2,$ZU(40,0,1))")
 D MDEF.Implementation.WriteLine("      S KMPBUFF=1")
 D MDEF.Implementation.WriteLine("      D display^GLOBUFF(3000,.KMPBUFF)")
 D MDEF.Implementation.WriteLine("      S $NAMESPACE=KMPRNS")
 D MDEF.Implementation.WriteLine("      W ""total_buffers ""_KMPTBUFF")
 D MDEF.Implementation.WriteLine("      S KMPI=0")
 D MDEF.Implementation.WriteLine("      F  S KMPI=$O(KMPBUFF(KMPI)) Q:KMPI=""""  D")
 D MDEF.Implementation.WriteLine("      .S KMPL=KMPBUFF(KMPI)")
 D MDEF.Implementation.WriteLine("      .W ""<BR>percent_buffers{global=""""""_$LISTGET(KMPL,1)_"""""",database=""""""_$LISTGET(KMPL,2)_""""""} ""_$LISTGET(KMPL,3)")
 D MDEF.Implementation.WriteLine("      D RU^%ZOSVKR(""KMP GetGlobuffHandler"")")
 D MDEF.Implementation.WriteLine("      Return $$$OK")
 D MDEF.Implementation.WriteLine("    } CATCH KMPERR{")
 D MDEF.Implementation.WriteLine("      Return ..Http500(KMPERR)")
 D MDEF.Implementation.WriteLine("    }")
 Q