I modified the post slightly. I ran a routine via the terminal, and as expected, it threw a <SYNTAX> error because the variable x is undefined. Then I continued the program, and now both the single-line if statement and the block if statement (with braces) set all the global variable. I thought that block of code wouldn’t be executed

 if $D(@x@(a,b,c)) s ^zz1=1,^x=1,^y=2,^xx=1
 ;
 ;
 if $D(@x@(a,b,c)) {
     set ^zz1=1212
     set ^dd=1
     set ^fg=2
 }

Maybe can you try to wrap the HL7 message like below format and set the ContentType As "application/xml"  in additional setting in the Business operation "EnsLib.HL7.Operation.HTTPOperation" and check for the response headers as well if required.

<?xml version="1.0" encoding="UTF-8"?>
<HL7Message>
<![CDATA[
MSH|^~\&|... your message ...
PID|... etc ...
]]>
</HL7Message>

We can use the %IsDefined method  to check the key is defined, and %Size() to determine the number of the elements in an Object or Array. These methods help to prevent from the <INVALID OREF> and <UNDEFINED>

// verify the "items" is present and it has values
If responseData.%IsDefined("items")&&(responseData.items.%Size()) {
    Set item1 = responseData.items.%Get(0)
    If $IsObject(item1) {
        Write item1.portalUrl
    }
    /*another*/
    If $IsObject(item1)&&(item1.%IsDefined("portalUrl")) {
        Write item1.portalUrl
    }
}

The %GetTypeOf method is used to determine the type of a key, and it returns 'unassigned' if the key does not exist

If responseData.%GetTypeOf("items")="array" {
    Set item1 = responseData.items.%Get(0)
    If $IsObject(item1) {
        Write item1.portalUrl
    }
}

We can use the %SYS.LockQuery class and its List query function to check whether the global is already locked. If it is, we can skip attempting to acquire the lock.

Check for the specific process

ClassMethod LOCK(Lock, Mode)
{
    If '..IsLocked("^A","X") {
        Lock +^A
    }
    Else {
        Write "Locked"
    }
}
// X - Exclusive
// S - Shared
ClassMethod IsLocked(Global As %String, Mode As %String)
{
    #dim status = 0
    Set tResult = ##class(%SYS.LockQuery).ListFunc($J)
    While tResult.%Next() {
        If tResult.Mode=Mode&&(tResult.LockString=Global) Set status= 1
    }
    Return status
}

However, the above code only checks for a specific process and does not account for other processes with Xclusive or Shared locks. The sample below checks for all acquired locks, returning their status and lock type.

ClassMethod IsLocked(Global As %String, Mode As %String)
{
	#dim status = 0
	Set tResult = ##class(%SYS.LockQuery).ListFunc()
	While tResult.%Next() {
		If tResult.LockString=Global {
			If tResult.Mode?1(1"X",1"S") Set status= 1_","_tResult.Mode
		}
	}
	Return status #; status be like "1,S" or "1,X"
}

Thank you for sharing this @Keren Skubach

The SDA to FHIR / FHIR to SDA DTL(which is the primary method we're using for conversion) doesn't support primitive Extension conversion by default. I'll need to implement a custom DTL to achieve this. Alternatively, I can handle it in the code if I generate the FHIR resource programmatically. Can you attach the documentation link for the set resource.property = $listbuild(""original property value",<primitive extension index>,...) primitive extension index set as well. I could see the HS.FHIRModel.R4.Patient from 2024.1 version

Thank you!

When you extend a class with %JSON.Adaptor, you must also ensure that any child classes or classes used as object properties also extend %JSON.Adaptor. Otherwise, you'll encounter an error like:
" ERROR #9411: A class referenced by a %JSONENABLED class must be a subclass of %JSON.Adaptor" during JSON export.

In your case, %DynamicObject/%DynamicArray is a system class that does not extend %JSON.Adaptor, which is why you're unable to export it using methods like %JSONExport, %JSONExportString, or %JSONExportToStream.

To work around this, you can use the Property xAxis As %Library.DynamicObject(%JSONINCLUDE="NONE"); parameter on the problematic field to exclude it from the JSON export.

That's correct. I’ve explored the new UI feature, and it appears to be a commendable initiative. The following observations have been noted.

  • The shortcuts for Rules, DTL, and Production at the top of the page, along with their options (Partial/Full/Open in New Tab), greatly improve navigation and allow for quick access within a single page.
  • The file paths (File Path, Archive Path, and Work Path) within the File Service configuration are not selectable, and the target configuration name is not rendered correctly.
  • The absence of the target configuration results in improper rendering of the connection arrows.
  • In the new user interface, the Production Settings—specifically Queues, Logs, Messages, and Jobs—are not displaying any data, and the Action tab is missing. These elements function as expected in the standard interface.
  • While small Data Transformation Layers (DTLs) and mappings display correctly, larger DTLs and mappings exhibit instability and are not consistently reliable in production configuration Singe page application.
  • The popup displayed during the start or stop of a business host or production instance is helpful for identifying errors; and the 'Update' button is absent.
  • And The dots appear feels somewhat unusual.

It takes some time to adapt to the new UI; however, it is quite effective and well-designed.

Thanks! 

Hi @Pravin Barton

The {Contents} has the id of the stream property. So, We can open the the stream object  by using OID and then convert to JSON like below. and the stream write need to use %ToJSON() for JSON serialization stream.Write({"msg":"hello world!"}.%ToJSON())


Trigger ExtractKeys [ Event = INSERT/UPDATE, Foreach = row/object, Time = AFTER ]
{
    new contentsJSON, id, msg
    
    if {Contents*C} {
        set contentsJSON = {}.%FromJSON(##class(%Stream.GlobalCharacter).%Open($lb({Contents},"%Stream.GlobalCharacter","^PAB.DebugStreamS")))
        set id = {ID}
        set msg = contentsJSON.msg
        &sql(update learn_Smp.NewClass13 set msg = :msg where Id = :id)
        $$$ThrowSQLIfError(SQLCODE, %msg)
    }
}

Thanks!