go to post Eduard Lebedyuk · Sep 16, 2022 Try to reload like this: set importlib = ##class(%SYS.Python).Import("importlib") do importlib.reload(helloWorld) Also, it not an IRIS-specific behavior, you'll get the same results in any python interpreter: import helloWorld helloWorld.helloWorld() >'Hello world' del helloWorld # modify helloWorld.py in text editor import helloWorld helloWorld.helloWorld() >'Hello world'
go to post Eduard Lebedyuk · Sep 13, 2022 Check this example. In short: Create class extending %SYS.Task.Definition Add properties - that's task settings Implement OnTask method, which returns %Status Set TaskName parameter After that you can add a task of TaskName type from the SMP.
go to post Eduard Lebedyuk · Sep 6, 2022 Assuming you have an EnsLib.HL7.Message object, call OutputHTMLZen method for it.
go to post Eduard Lebedyuk · Sep 1, 2022 1. Yes. Stopping primary makes backup a new primary. Before stopping you might want to validate that backup is caught up: set sql = "SELECT CASE WHEN DatabaseLatency=? THEN 1 ELSE 0 END IsCaughtUp FROM SYS.Mirror_MemberStatusList() WHERE CurrentRole = ?" set rs = ##class(%SQL.Statement).%ExecDirect(,sql, "Caught up", "Backup") do rs.%Next() if rs.IsCaughtUp { write "Caught up" halt } else { write "Not caught up" do $system.Process.Terminate(,1) } Or at least is not too far behind (check this post). 2. No. ^MIRROR does the same.
go to post Eduard Lebedyuk · Sep 1, 2022 There's a distinction between Background Jobs and Background Tasks. Backgound job is anything you run using JOB command. Background Task is a limited set of named actions (AuditCopy, AuditExport, AuditPurge, Backup, CompactDBSpace, CopyNamespaceMappings, CreateDatabase, Compile, DatabaseIntegrityCheck, DataMigration, DefragmentDB, Delete, EnableEnsNamespace, Export, ExternalLangServers, FileMan, Import, SQLExport, SQLImport, SQLExportStatement, SQLImportStatement, QueryExport, JournalIntegrityCheck, LinkTable, LinkProcedure, MirrorActivateCatchupDB, MirrorRemoveDB, MirrorMountDB, MirrorAddDatabases, ModifyDatabaseSize, RebuildIndices, TuneTable, TuneTables, PurgeAllCachedQueries, JobShowPlan, JobSaveQuery, JobPossiblePlans, JobComparePlans, ShardActivate, ShardAssign, ShardVerify, ShardRebalance) runnable through a special interface. Docs. You can run a Background Task (but probably should not - it's a system action) by calling: set parms("ClassName") = "Sample.Person" set tSC = ##class(%CSP.UI.System.BackgroundTask).RunTask("RebuildIndices", "SAMPLES", .parms, .job) As HIHLib.Support.GetHL7MessageStat:ISBListingQuery is not on the list you can't run it as a Background Task, but you can run it as a Job. Next - no output. Note that you do not specify these parameters: principal-input Principal input device for the process. The default is the null device. principal-output Principal output device for the process. The default is the device you specify for principal-input or the null device if neither device is specified. UNIX®: If you do not specify either device, the process uses the default principal device for processes started with the JOB command, which is /dev/null. Further: Only one process can own a device at a time. This means that a job executing in a JOB Server is unable to perform input or output to your principal I/O devices even though you may close device 0. So by default you run your job with stdio set to /dev/null and that's why there's no output. You can either pass a device to write output to or write a wrapper which would handle the output and job that.
go to post Eduard Lebedyuk · Aug 31, 2022 To install locale, execute during docker build: set sc = ##class(Config.NLS.Locales).Install("deuw")
go to post Eduard Lebedyuk · Aug 27, 2022 request should not contain process, there is a separate process variable for that.
go to post Eduard Lebedyuk · Aug 24, 2022 Users certainly should not be able access Ens_Config.Credentials table, maybe some user has permissions too broad? What you can do additionally is to store credentials in a separate SECONDARY database. When you create a new interoperability namespace (in non HS installs), it should be created automatically. Still, you can manually create this DB and related mappings by calling CreateNewDBForSecondary. After creating secondary db, check that no one has R on DB resouce. Additionally you can encrypt the db file.
go to post Eduard Lebedyuk · Aug 24, 2022 Sure. There are two ways: 1. Switch to another namespace to execute your query: /// Get a list of all mirrored databases as a $lb() ClassMethod GetMirroredDBs() As %List { new $namespace set $namespace = "%SYS" set sql = "SELECT LIST(Name) dbs FROM Config.Databases_MirrorDatabaseList()" set rs = ##class(%SQL.Statement).%ExecDirect(,sql) do rs.%Next() set dbs = $lfs(rs.dbs) kill rs quit dbs } Now you can have this method in USER namespace and it would automatically swith into %SYS, execute query, iterate over the results, write results into a local variable, switch back into USER namespace and return the value back to you. The main thing you need to remember is that result set iteration MUST happen in a target namespace. 2. Map classes and globals to your namespace. Docs. Table would be available as if it was created in your original namespace.
go to post Eduard Lebedyuk · Aug 19, 2022 Say you have this query: SELECT a, b, c FROM mytable WHERE d=1 AND e=2 If you want to change fields in SELECT or WHERE, you'll need to rewrite your query by adding or removing it's parts. Source control diff would also show a whole line change. But if you write it like this: SELECT 1 , a , b , c FROM mytable WHERE 1=1 AND d=1 AND e=2 You can comment out any field or condition simply by adding --: SELECT 1 --, a , b , c FROM mytable WHERE 1=1 --AND d=1 AND e=2 when you have a lot of conditions and need to iterate fast, this way of writing queries is much better for debugging and source control since diff is always contianed to the one line you edit.
go to post Eduard Lebedyuk · Aug 18, 2022 Ens, EnsLib and EnsPortal are system packages, developes can subclass them. To get class count call something like this: SELECT count(ID) FROM %Dictionary.ClassDefinition WHERE 1=1 AND System = 0 AND NOT (Name %STARTSWITH '%' OR Name %STARTSWITH 'Ens.' OR Name %STARTSWITH 'EnsLib.' OR Name %STARTSWITH 'EnsPortal.' OR Name %STARTSWITH 'HS.' OR Name %STARTSWITH 'SchemaMap') Missing: SQL way to filter out mapped classes.
go to post Eduard Lebedyuk · Aug 15, 2022 Use a Business Service with a basic Ens.InboundAdapter: Class test.BS Extends Ens.BusinessService { Parameter ADAPTER = "Ens.InboundAdapter"; Method OnProcessInput(pInput As %RegisteredObject, Output pOutput As %RegisteredObject) As %Status { $$$LOGINFO("In OnProcessInput") Quit $$$OK } } Add it to production and set Call Interval to X seconds (and Pool Size to 1). That would ensure OnProcessInput being called every X seconds after it's last completion.
go to post Eduard Lebedyuk · Aug 11, 2022 Component status Use Ens.Director to get enabled/disabled and status: set enabled = ##class(Ens.Director).IsItemEnabled(bh, .status) Queue depth SELECT Name, Count, Created, Active FROM EnsPortal.Queues_EnumerateQueues() Last activity date Do you see it in SMP somewhere?
go to post Eduard Lebedyuk · Aug 10, 2022 This is a limitation on a maximum resource length that was lifted in 2022.2 preview 4.
go to post Eduard Lebedyuk · Aug 10, 2022 I would start by observing the output of these two commands when run from a Dockerfile: set sc = ##class(Ens.Director).SetAutoStart("GOJ.IrisApp.ProductionDev") write $system.Status.GetErrorText(sc) set sc = ##class(Ens.Director).StartProduction("GOJ.IrisApp.ProductionDev") write $system.Status.GetErrorText(sc)
go to post Eduard Lebedyuk · Aug 9, 2022 HS.SDA3.Container is a registered object and not a persistent one, so you can't pass it directly. What you can do, however, is to pass existing stream id in your request, this way stream is not copied twice (you only pass an id) and receiver then can recreate the same HS.SDA3.Container from a stream.