- 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
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HKMPPS44C 11862 printed Feb 18, 2025@23:07:55 Page 2
- KMPPS44C ;SP/JML - KMP*4*4 POST INSTALL ROUTINE ;11/1/2023
- +1 ;;4.0;CAPACITY MANAGEMENT;**4**;3/1/2018;Build 36
- +2 ;
- +3 ;
- +4 ;
- STOPMONG(MDEF) ;
- +1 DO MDEF.Implementation.WriteLine(" TRY {")
- +2 DO MDEF.Implementation.WriteLine(" D RU^%ZOSVKR(""KMP GetStartMonitorGEvent"")")
- +3 DO MDEF.Implementation.WriteLine(" S KMPRET=##class(%DynamicObject).%New()")
- +4 DO MDEF.Implementation.WriteLine(" D SITE^KMPUTLW(KMPRET)")
- +5 DO MDEF.Implementation.WriteLine(" W ""<H1>Site</H1>""")
- +6 DO MDEF.Implementation.WriteLine(" S KMPITER = KMPRET.Site.%GetIterator()")
- +7 DO MDEF.Implementation.WriteLine(" WHILE KMPITER.%GetNext(.KEY,.KMPVALUE) {")
- +8 DO MDEF.Implementation.WriteLine(" W KEY_"": ""_KMPVALUE_""<BR>""")
- +9 DO MDEF.Implementation.WriteLine(" }")
- +10 DO MDEF.Implementation.WriteLine(" S KMPMCHK=%request.Get(""MONTYPE"")")
- +11 DO MDEF.Implementation.WriteLine(" I KMPMCHK=""ALL"" S KMPMCHK=""VBEM:VCSM:VETM:VHLM:VMCM:VSTM:VTCM""")
- +12 DO MDEF.Implementation.WriteLine(" F KMPI=1:1:$L(KMPMCHK,"":"") D")
- +13 DO MDEF.Implementation.WriteLine(" .S KMPQUIT=0")
- +14 DO MDEF.Implementation.WriteLine(" .S KMPVMKEY=$P(KMPMCHK,"":"",KMPI)")
- +15 DO MDEF.Implementation.WriteLine(" .W ""<H3>""_KMPVMKEY_""</H3>""")
- +16 DO MDEF.Implementation.WriteLine(" .I '$D(^KMPV(8969,""B"",KMPVMKEY)) D Q:KMPQUIT")
- +17 DO MDEF.Implementation.WriteLine(" ..W "" ""_KMPVMKEY_"" not a valid monitor""")
- +18 DO MDEF.Implementation.WriteLine(" ..S KMPQUIT=1")
- +19 DO MDEF.Implementation.WriteLine(" .D STOPMON^KMPVCBG(KMPVMKEY,1,1)")
- +20 DO MDEF.Implementation.WriteLine(" .W !,"" ""_KMPVMKEY_"" Stopped""")
- +21 DO MDEF.Implementation.WriteLine(" D RU^%ZOSVKR(""KMP GetStartMonitorGHandler"")")
- +22 DO MDEF.Implementation.WriteLine(" RETURN $$$OK")
- +23 DO MDEF.Implementation.WriteLine(" } CATCH KMPERR {")
- +24 DO MDEF.Implementation.WriteLine(" Return ..Http500(KMPERR)")
- +25 DO MDEF.Implementation.WriteLine(" }")
- +26 QUIT
- +27 ;
- IMALIVEP(MDEF) ;
- +1 DO MDEF.Implementation.WriteLine(" TRY {")
- +2 DO MDEF.Implementation.WriteLine(" D RU^%ZOSVKR(""KMP SynthImAliveEvent"")")
- +3 DO MDEF.Implementation.WriteLine(" Do %response.SetHeader(""Access-Control-Allow-Origin"",""*"")")
- +4 DO MDEF.Implementation.WriteLine(" Do %response.SetHeader(""Allow"",""HEAD,GET,POST,PUT,DELETE,OPTIONS"")")
- +5 DO MDEF.Implementation.WriteLine(" S KMPREQ=##class(%DynamicAbstractObject).%FromJSON(%request.Content)")
- +6 DO MDEF.Implementation.WriteLine(" S KMPRET=##class(%DynamicObject).%New()")
- +7 DO MDEF.Implementation.WriteLine(" S KMPINST=##class(%SYS.System).GetInstanceName(),KMPNDTYP=$$NODETYPE^KMPUTLW(KMPINST)")
- +8 DO MDEF.Implementation.WriteLine(" I KMPNDTYP=""BE"",##CLASS(%SYSTEM.Mirror).IsPrimary()=0,##CLASS(%SYSTEM.Mirror).GetStatus()'=""NOTINIT"" D Return $$$OK")
- +9 DO MDEF.Implementation.WriteLine(" .S KMPRET.ResultText=""Not Primary Backend""")
- +10 DO MDEF.Implementation.WriteLine(" .D RU^%ZOSVKR(""KMP SynthImAliveHandler"")")
- +11 DO MDEF.Implementation.WriteLine(" .W KMPRET.%ToJSON()")
- +12 DO MDEF.Implementation.WriteLine(" I KMPREQ.Function'=""ImAlive"" D Return $$$OK")
- +13 DO MDEF.Implementation.WriteLine(" .S KMPRET.ResultText=""Incorrect Function Type""")
- +14 DO MDEF.Implementation.WriteLine(" .D RU^%ZOSVKR(""KMP SynthImAliveHandler"")")
- +15 DO MDEF.Implementation.WriteLine(" .W KMPRET.%ToJSON()")
- +16 DO MDEF.Implementation.WriteLine(" D SITE^KMPUTLW(KMPRET)")
- +17 DO MDEF.Implementation.WriteLine(" S KMPRET.Function=KMPREQ.Function")
- +18 DO MDEF.Implementation.WriteLine(" S KMPRET.ResultText=""OK""")
- +19 DO MDEF.Implementation.WriteLine(" W KMPRET.%ToJSON()")
- +20 DO MDEF.Implementation.WriteLine(" D RU^%ZOSVKR(""KMP SynthImAliveHandler"")")
- +21 DO MDEF.Implementation.WriteLine(" Return $$$OK")
- +22 DO MDEF.Implementation.WriteLine(" } CATCH KMPERR {")
- +23 DO MDEF.Implementation.WriteLine(" Return ..Http500(KMPERR)")
- +24 DO MDEF.Implementation.WriteLine(" }")
- +25 QUIT
- +26 ;
- SYNTHRCMDP(MDEF) ;
- +1 DO MDEF.Implementation.WriteLine(" TRY {")
- +2 DO MDEF.Implementation.WriteLine(" D RU^%ZOSVKR(""KMP SynthRcmdEvent"")")
- +3 DO MDEF.Implementation.WriteLine(" Do %response.SetHeader(""Access-Control-Allow-Origin"",""*"")")
- +4 DO MDEF.Implementation.WriteLine(" Do %response.SetHeader(""Allow"",""HEAD,GET,POST,PUT,DELETE,OPTIONS"")")
- +5 DO MDEF.Implementation.WriteLine(" S KMPREQ=##class(%DynamicAbstractObject).%FromJSON(%request.Content)")
- +6 DO MDEF.Implementation.WriteLine(" S KMPRET=##class(%DynamicObject).%New()")
- +7 DO MDEF.Implementation.WriteLine(" S KMPINST=##class(%SYS.System).GetInstanceName(),KMPNDTYP=$$NODETYPE^KMPUTLW(KMPINST)")
- +8 DO MDEF.Implementation.WriteLine(" I KMPNDTYP=""BE"",##CLASS(%SYSTEM.Mirror).IsPrimary()=0,##CLASS(%SYSTEM.Mirror).GetStatus()'=""NOTINIT"" D Return $$$OK")
- +9 DO MDEF.Implementation.WriteLine(" .S KMPRET.ResultText=""Not Primary Backend""")
- +10 DO MDEF.Implementation.WriteLine(" .D RU^%ZOSVKR(""KMP SynthRcmdHandler"")")
- +11 DO MDEF.Implementation.WriteLine(" .W KMPRET.%ToJSON()")
- +12 DO MDEF.Implementation.WriteLine(" I KMPREQ.Function'=""SynthRcmd"" D Return $$$OK")
- +13 DO MDEF.Implementation.WriteLine(" .S KMPRET.ResultText=""Incorrect Function Type""")
- +14 DO MDEF.Implementation.WriteLine(" .D RU^%ZOSVKR(""KMP SynthRcmdHandler"")")
- +15 DO MDEF.Implementation.WriteLine(" .W KMPRET.%ToJSON()")
- +16 DO MDEF.Implementation.WriteLine(" D SITE^KMPUTLW(KMPRET)")
- +17 DO MDEF.Implementation.WriteLine(" D SYNRCMD^KMPSYNTH(KMPRET)")
- +18 DO MDEF.Implementation.WriteLine(" S KMPRET.Function=KMPREQ.Function")
- +19 DO MDEF.Implementation.WriteLine(" S KMPRET.ResultText=""OK""")
- +20 DO MDEF.Implementation.WriteLine(" W KMPRET.%ToJSON()")
- +21 DO MDEF.Implementation.WriteLine(" D RU^%ZOSVKR(""KMP SynthRcmdHandler"")")
- +22 DO MDEF.Implementation.WriteLine(" Return $$$OK")
- +23 DO MDEF.Implementation.WriteLine(" } CATCH KMPERR{")
- +24 DO MDEF.Implementation.WriteLine(" Return ..Http500(KMPERR)")
- +25 DO MDEF.Implementation.WriteLine(" }")
- +26 QUIT
- +27 ;
- SYNTHFILEP(MDEF) ;
- +1 DO MDEF.Implementation.WriteLine(" TRY {")
- +2 DO MDEF.Implementation.WriteLine(" D RU^%ZOSVKR(""KMP SynthFileEvent"")")
- +3 DO MDEF.Implementation.WriteLine(" Do %response.SetHeader(""Access-Control-Allow-Origin"",""*"")")
- +4 DO MDEF.Implementation.WriteLine(" Do %response.SetHeader(""Allow"",""HEAD,GET,POST,PUT,DELETE,OPTIONS"")")
- +5 DO MDEF.Implementation.WriteLine(" S KMPREQ=##class(%DynamicAbstractObject).%FromJSON(%request.Content)")
- +6 DO MDEF.Implementation.WriteLine(" S KMPRET=##class(%DynamicObject).%New()")
- +7 DO MDEF.Implementation.WriteLine(" S KMPINST=##class(%SYS.System).GetInstanceName(),KMPNDTYP=$$NODETYPE^KMPUTLW(KMPINST)")
- +8 DO MDEF.Implementation.WriteLine(" I KMPNDTYP=""BE"",##CLASS(%SYSTEM.Mirror).IsPrimary()=0,##CLASS(%SYSTEM.Mirror).GetStatus()'=""NOTINIT"" D Return $$$OK")
- +9 DO MDEF.Implementation.WriteLine(" .S KMPRET.ResultText=""Not Primary Backend""")
- +10 DO MDEF.Implementation.WriteLine(" .D RU^%ZOSVKR(""KMP SynthFileHandler"")")
- +11 DO MDEF.Implementation.WriteLine(" .W KMPRET.%ToJSON()")
- +12 DO MDEF.Implementation.WriteLine(" I KMPREQ.Function'=""SynthFile"" D Return $$$OK")
- +13 DO MDEF.Implementation.WriteLine(" .S KMPRET.ResultText=""Incorrect Function Type""")
- +14 DO MDEF.Implementation.WriteLine(" .D RU^%ZOSVKR(""KMP SynthFileHandler"")")
- +15 DO MDEF.Implementation.WriteLine(" .W KMPRET.%ToJSON()")
- +16 DO MDEF.Implementation.WriteLine(" D SITE^KMPUTLW(KMPRET)")
- +17 DO MDEF.Implementation.WriteLine(" D SYNFILE^KMPSYNTH(KMPRET)")
- +18 DO MDEF.Implementation.WriteLine(" S KMPRET.Function=KMPREQ.Function")
- +19 DO MDEF.Implementation.WriteLine(" S KMPRET.ResultText=""OK""")
- +20 DO MDEF.Implementation.WriteLine(" W KMPRET.%ToJSON()")
- +21 DO MDEF.Implementation.WriteLine(" D RU^%ZOSVKR(""KMP SynthFileHandler"")")
- +22 DO MDEF.Implementation.WriteLine(" Return $$$OK")
- +23 DO MDEF.Implementation.WriteLine(" } CATCH KMPERR{")
- +24 DO MDEF.Implementation.WriteLine(" Return ..Http500(KMPERR)")
- +25 DO MDEF.Implementation.WriteLine(" }")
- +26 QUIT
- +27 ;
- SYNTHVPRP(MDEF) ;
- +1 DO MDEF.Implementation.WriteLine(" TRY {")
- +2 DO MDEF.Implementation.WriteLine(" ;demographics;reactions;problems;vitals;labs;meds;immunizations;observation;visits;appointments;documents;procedures;consults;flags;factors;skinTests;exams;education;insurance")
- +3 DO MDEF.Implementation.WriteLine(" D RU^%ZOSVKR(""KMP SynthVprEvent"")")
- +4 DO MDEF.Implementation.WriteLine(" Do %response.SetHeader(""Access-Control-Allow-Origin"",""*"")")
- +5 DO MDEF.Implementation.WriteLine(" Do %response.SetHeader(""Allow"",""HEAD,GET,POST,PUT,DELETE,OPTIONS"")")
- +6 DO MDEF.Implementation.WriteLine(" S KMPREQ=##class(%DynamicAbstractObject).%FromJSON(%request.Content)")
- +7 DO MDEF.Implementation.WriteLine(" S KMPRET=##class(%DynamicObject).%New()")
- +8 DO MDEF.Implementation.WriteLine(" S KMPINST=##class(%SYS.System).GetInstanceName(),KMPNDTYP=$$NODETYPE^KMPUTLW(KMPINST)")
- +9 DO MDEF.Implementation.WriteLine(" I KMPNDTYP=""BE"",##CLASS(%SYSTEM.Mirror).IsPrimary()=0,##CLASS(%SYSTEM.Mirror).GetStatus()'=""NOTINIT"" D Return $$$OK")
- +10 DO MDEF.Implementation.WriteLine(" .S KMPRET.ResultText=""Not Primary Backend""")
- +11 DO MDEF.Implementation.WriteLine(" .D RU^%ZOSVKR(""KMP SynthVprHandler"")")
- +12 DO MDEF.Implementation.WriteLine(" .W KMPRET.%ToJSON()")
- +13 DO MDEF.Implementation.WriteLine(" I KMPREQ.Function'=""SynthVpr"" D Return $$$OK")
- +14 DO MDEF.Implementation.WriteLine(" .S KMPRET.ResultText=""Incorrect Function Type""")
- +15 DO MDEF.Implementation.WriteLine(" .D RU^%ZOSVKR(""KMP SynthVprHandler"")")
- +16 DO MDEF.Implementation.WriteLine(" .W KMPRET.%ToJSON()")
- +17 DO MDEF.Implementation.WriteLine(" D SITE^KMPUTLW(KMPRET)")
- +18 DO MDEF.Implementation.WriteLine(" D SYNVPR^KMPSYNTH(KMPRET,KMPREQ.PatientDfn,KMPREQ.ClinicalDomains)")
- +19 DO MDEF.Implementation.WriteLine(" S KMPRET.Function=KMPREQ.Function")
- +20 DO MDEF.Implementation.WriteLine(" S KMPRET.ResultText=""OK""")
- +21 DO MDEF.Implementation.WriteLine(" W KMPRET.%ToJSON()")
- +22 DO MDEF.Implementation.WriteLine(" D RU^%ZOSVKR(""KMP SynthVprHandler"")")
- +23 DO MDEF.Implementation.WriteLine(" Return $$$OK")
- +24 DO MDEF.Implementation.WriteLine(" } CATCH KMPERR{")
- +25 DO MDEF.Implementation.WriteLine(" Return ..Http500(KMPERR)")
- +26 DO MDEF.Implementation.WriteLine(" }")
- +27 QUIT
- +28 ;
- GETGLOBUFFG(MDEF) ;
- +1 DO MDEF.Implementation.WriteLine(" TRY {")
- +2 DO MDEF.Implementation.WriteLine(" D RU^%ZOSVKR(""KMP GetGlobuffEvent"")")
- +3 DO MDEF.Implementation.WriteLine(" S KMPRNS=$NAMESPACE")
- +4 DO MDEF.Implementation.WriteLine(" S $NAMESPACE=""%SYS""")
- +5 DO MDEF.Implementation.WriteLine(" S KMPTBUFF=$V($ZU(40,2,17),-2,$ZU(40,0,1))")
- +6 DO MDEF.Implementation.WriteLine(" S KMPBUFF=1")
- +7 DO MDEF.Implementation.WriteLine(" D display^GLOBUFF(3000,.KMPBUFF)")
- +8 DO MDEF.Implementation.WriteLine(" S $NAMESPACE=KMPRNS")
- +9 DO MDEF.Implementation.WriteLine(" W ""total_buffers ""_KMPTBUFF")
- +10 DO MDEF.Implementation.WriteLine(" S KMPI=0")
- +11 DO MDEF.Implementation.WriteLine(" F S KMPI=$O(KMPBUFF(KMPI)) Q:KMPI="""" D")
- +12 DO MDEF.Implementation.WriteLine(" .S KMPL=KMPBUFF(KMPI)")
- +13 DO MDEF.Implementation.WriteLine(" .W ""<BR>percent_buffers{global=""""""_$LISTGET(KMPL,1)_"""""",database=""""""_$LISTGET(KMPL,2)_""""""} ""_$LISTGET(KMPL,3)")
- +14 DO MDEF.Implementation.WriteLine(" D RU^%ZOSVKR(""KMP GetGlobuffHandler"")")
- +15 DO MDEF.Implementation.WriteLine(" Return $$$OK")
- +16 DO MDEF.Implementation.WriteLine(" } CATCH KMPERR{")
- +17 DO MDEF.Implementation.WriteLine(" Return ..Http500(KMPERR)")
- +18 DO MDEF.Implementation.WriteLine(" }")
- +19 QUIT