Hi @Herman Slagman, I totally agree with you, we have already discussed the issues and errors of "ObjectScript Quality Tool" rules in this post where I commented some of the errors in the ruses and there are indeed many more errors and, as you mentioned, some rule is debatable (or silly, as you said) to say the least.

Since that post and the errors I reported there nothing has changed, the rules are still there, wrong and unchanged.

What's the sense of having a "ObjectScript Quality Tool" with....such a poor quality itself?

To @Evgeny Shvarov, you say:

It’s difficult to introduce rules that will satisfy everyone.

Do you think that contradictory rules and rules with errors (plain errors) can satisfy anyone?!

what prevents you from introducing your own rules?

Time and probably I think it wouldn't be fun.

Let’s discuss....

We have started a discussion in the post linked above, I have reported some of the errors in the rules, nothing has been done/fixed. This gives the impression that "ObjectScript Quality Tool" is a dead project.
 

Hi @Eduard Lebedyuk , I was testing various options for configuring Apache (RHEL in my case), so I read the documentation (unbelievable, isn't it? 😂) and performed a number of tests, the I found this article  in the community and....I was kind of surprised because you suggest using CSP On/Off within a <VirtualHost> directive block.

I was surprised because the I excluded using <VirtualHost> directive block since the documentation suggests not using it (emphasis mine):

Note:

Although the Web Gateway supports the use of virtual host names in application access profiles, issuing Apache configuration directives to invoke the Web Gateway (that is, CSPFileTypes and CSP On/Off) within a <VirtualHost> directive block is not supported and will yield an error. In other words, you cannot enable the Web Gateway for the desired Virtual Hosts alone; you must enable the Web Gateway within the web server’s global configuration.

My my first thought was, well, this is a case where the documentation is wrong, sometimes it has happened.

At that point I was puzzled, so I tried using <VirtualHost> and, to my surprise, it worked!

Then I tried to validate my Apache config using "apachectl configtest" and:

[root@localhost conf]# apachectl configtest
[Sat Dec 21 17:22:39.632408 2024] [:warn] [pid 151005:tid 151005] Apache Configuration: CSP directive 'csp' detected in VirtualHost, only supported at default server level
[Sat Dec 21 17:22:39.632471 2024] [:warn] [pid 151005:tid 151005] Apache Configuration: CSP directive 'csp' detected in VirtualHost, only supported at default server level
[Sat Dec 21 17:22:39.632480 2024] [:warn] [pid 151005:tid 151005] Apache Configuration: CSP directive 'csp' detected in VirtualHost, only supported at default server level
Syntax OK

Not only is documented that using CSP On/Off within a <VirtualHost>, there is also some code implemented in CSPa24.so IRIS module to check for this and provide a warning message that says this is not supported.

Personally I'll avoid using CSP On/Off within a <VirtualHost> (at least) in production systems, unless some more info is found on this.

Is return supposed to return a boolean (0/1) or the non empty value of check1?

I'm asking because you write "will return false even for non-empty strings (due to conversion to integers for string prefixes)".

In general to check for not empty string (check1'="") is used.

If you need to return a boolean depending of empty/not empty, then you can use:

return (check1'="") 

If/when you set KeepIntegrity to True, then ALL messages and message headers belonging to a session containing ANY message with status Created or Queued or Delivered or Suspended or Deferred are NOT deleted/purged, same goes for the headers (Ens.MessageHeader).

Since your is a test environment, it's (very?) likely having "messed" sessions that are not purged using KeepIntegrity  = True.
Sometimes even production systems do have sessions that are not purged using KeepIntegrity  = True.

While setting using KeepIntegrity  = True is "best practice" and prevent purging "uncompleted sessions", I suggest to run a purge with KeepIntegrity  = False with a (much?) longer DaysToKeep parameter, unless you do need/want to keep uncompleted sessions and messages for.....ever and ever.

For example, if you purge with KeepIntegrity  = True and DaysToKeep=30, you may run a second purge with KeepIntegrity  = false and DaysToKeep=90 (or longer) to purge really old messages belonging to "uncompleted" sessions.

Code adapted with your details:

Set objHttpRequest = ##class(%Net.HttpRequest).%New()
Set objHttpRequest.ContentType = "application/fhir+json"
Set objHttpRequest.Server = "localhost"
Set objHttpRequest.Port = "52773"
Set pRequest = {"asd":"asd"}
Do objHttpRequest.EntityBody.Write(pRequest.%ToJSON())
If objHttpRequest.Send("POST", "/aktest/test") {
    Set objHttpResponse = objHttpRequest.HttpResponse
    If $IsObject(objHttpResponse.Data) {
        Set objStream = objHttpResponse.Data
        Set json = ""
        While ('objStream.AtEnd) {
            Set json = json _ objStream.ReadLine()
        }
    } Else {
        Set json = objHttpResponse.Data
    }
    Set httpStatus = objHttpResponse.StatusCode
    Write "Status: ", httpStatus, !
    Write "Response: ", json, !
}

I do not understand your question, can you please explain what you need to achieve?

%Net.HttpRequest class is used to create an HTTP request that is sent to the counterpart/endpoint and a response message is then received from the counterpart. How can you possibly generate a response that, by definition, has to be received from a remote system?

Clearly I'm missing something.

You may try with:

set tQuery="{ CALL dbo.SavePatientDetails (?) }"

Set tParams=1
Set tParams(1)=xmlContent
Set tParams(1,"SqlType")=$$$SqlVarchar ; or 12 if macro does not resolve
Set tSC = ..Adapter.ExecuteProcedureParmArray(.tResultSnapshots, .tOutputParms, tQuery,,.tParams)

For details see the SQL adapters documentation on Using Parameters.