Encontrar

Pergunta
· Mar. 5

Enable/Disable a scheduler task

Hi ,

I have a scheduler task and an associated class that works.

Class Sample.Util.CreateTask Extends (%SYS.Task.Definition, %Persistent)
{

Parameter PROPERTYVALIDATION = 1;

Parameter TaskName = "Sample.Util.CreateTask";

Method OnTask() As %Status
{
// Perform the logic
}

}

Is there a way to Enable or Disable the above task "CreateTask()" from an external function/Method/class ?

2 Comments
Discussão (2)1
Entre ou crie uma conta para continuar
Artigo
· Mar. 4 2min de leitura

ObjectScriptを使用し、ローカルファイルを他のサーバーにアップロード(POST)する方法

これは InterSystems FAQ サイトの記事です。
 

ObjectScriptの%Netパッケージのライブラリクラスを利用して、ファイルを他のサーバーにアップロードすることができます。

以下のCurl コマンドと同じことを ObjectScript で実現する方法を紹介します。

curl -X POST "http://localhost/api/upload/csv?a=123&b=999" -F file=@"C:/temp/a.csv":/temp/a.csv"

クライアントのObjectScriptコードを以下の様に作成します。

Class User.MyRestClient Extends %Base
{

ClassMethod readMimeData() As %Status
{
    // form-data (for CSV)
    set msg= ##class(%Net.MIMEPart).%New()

    set msg.ContentType = "multipart/form-data"
    set inputstream=##class(%Stream.FileBinary).%New()
    set sc=inputstream.LinkToFile("c:¥temp¥a.csv")
    If $$$ISERR(sc) Do $system.OBJ.DisplayError(sc) Quit
    set filePart = ##class(%Net.MIMEPart).%New(inputstream)
    set filePart.ContentType = "text/csv; charset=utf-8"
    do filePart.SetHeader("Content-Disposition","form-data; name=""csvfile""; filename=""upload.csv"";")
    do msg.Parts.Insert(filePart) 
    set tempstream = ##class(%Stream.TmpCharacter).%New()

    set writer = ##class(%Net.MIMEWriter).%New()

    do writer.OutputToStream(.tempstream)

    do writer.WriteMIMEBody(msg)

    // POST with the above form-data
    set req=##class(%Net.HttpRequest).%New()

    set req.Server="127.0.0.1"
    set req.Port=80
    do req.SetParam("a","123")   ;; a=123
    do req.SetParam("b","999")   ;; b=999
    set req.EntityBody = tempstream

    set req.ContentType = "multipart/form-data; boundary="_msg.Boundary

    set sc = req.Post("/api/upload/csv")

    If $$$ISERR(sc) Do $system.OBJ.DisplayError(sc) Quit
    set res=req.HttpResponse

    write res.Data.Read(1000)
    quit $$$OK
}

}
Discussão (0)1
Entre ou crie uma conta para continuar
Pergunta
· Mar. 4

Debugging embedded python library

I have an Embedded Python method, which is essentially a call to one third-party module.

Most of the time, the method takes <0.1 seconds to execute, but sometimes it takes 30 or 60 seconds.

The server is relatively idle (20-30% CPU load).

How can I debug this issue further? Ideally, I want to know where this library spends the time. The library is mainly Python code (it's boto3, so it's not a Python C API proxy library).

2 Comments
Discussão (2)2
Entre ou crie uma conta para continuar
Pergunta
· Mar. 4

Using Lists and ListFind within BPL

I already mentioned in a Previous post I am trying to build a list from a repeatable field within a HL7 message. I figured out how to build the list by using a context list string variable within the Business Process (BPL) and doing a

do context.<variable>.Insert = <value>

 when I am looping through the field. I want to do it one step farther though... I want to search the list to see if the value exists before I do the insert. I only want to insert if the value is different than what is in the list already.

IF $LF(context.Facilities,##class(Ens.Rule.FunctionSet).SubString(context.EpicDepartmentID,1,4)) = 0
{
do context.Facilities.Insert = ##class(Ens.Rule.FunctionSet).SubString(context.EpicDepartmentID,1,4)
}

I tried using $LF or $LISTFIND, but I keep getting the same error...

ERROR <Ens>ErrBPTerminated: Terminating BP EpicMFNToCPD # due to error: ERROR <Ens>ErrException: <LIST>S36+3 ^osuwmc.Epic.MFN.EpicMFNToCPD.Thread1.1 -- logged as '-'
number - @'
IF $LF(context.Facilities,##class(Ens.Rule.FunctionSet).SubString(context.EpicDepartmentID,1,4)) = 0'
> ERROR <Ens>ErrException: <LIST>S36+3 ^osuwmc.Epic.MFN.EpicMFNToCPD.Thread1.1 -- logged as '-'
number - @'
IF $LF(context.Facilities,##class(Ens.Rule.FunctionSet).SubString(context.EpicDepartmentID,1,4)) = 0'

Any guidance would be appreciated.

1 Comment
Discussão (1)1
Entre ou crie uma conta para continuar
Pergunta
· Mar. 4

Using Lists - LB and LI

I have a repeatable field within HL7 that I want to create a List from. Do I have to initialize the List by using $LB, or can I just use $LI to keep adding on to the end of the list as it is looping through the field?

4 Comments
Discussão (4)1
Entre ou crie uma conta para continuar