Glad to hear!
Depending on the length of the incoming request, you may hit the length of the Stream Read Buffer. See my updated code for larger messages as you may need to loop your read() statement,
cheers :)
- Log in to post comments
Glad to hear!
Depending on the length of the incoming request, you may hit the length of the Stream Read Buffer. See my updated code for larger messages as you may need to loop your read() statement,
cheers :)
You can change the header keys of a %Net.HttpRequest
// Make Request
SET tHttpRequest=##class(%Net.HttpRequest).%New()
// Set header
SET tSC = tHttpRequest.SetHeader("Content-Type", "text/plain")
// Check for Errors
THROW:$$$ISERR(tSC) ##class(%Exception.StatusException).CreateFromStatus(tSC)Thus, to put this all together;
// Sample Code, Not Complete
Class Niko.EnsLib.HL7.Operation.HTTPOperation Extends EnsLib.HL7.Operation.HTTPOperation
{
Method SendMessage(pMsgOut As EnsLib.HL7.Message, Output pMsgIn As EnsLib.HL7.Message, pExpectedSequenceNumber As %String) As %Status
{
Set pMsgIn=$$$NULLOREF, tHttpRequest=##class(%Net.HttpRequest).%New(), tHttpRequest.WriteRawMode=1
// Add these two lines after the firt in SendMessage. Change the content type to your desired header.
SET tSC = tHttpRequest.SetHeader("Content-Type", "text/plain")
THROW:$$$ISERR(tSC) ##class(%Exception.StatusException).CreateFromStatus(tSC)
// Copy the rest of the SendMessage Method from the standard EnsLib.HL7.Operation.HTTPOperation
}
}To use FHIR in HealthConnect you will probably want to start with the installer kits. Each of these will add some bits and pieces of functionality to your current working production:
For example, to install a foundation namespace and add FHIR STU3 support to it:
SET nNamespace = "FHIR"
// Switch to the HSLIB so we can call our installer methods
ZN "HSLIB"
// Make the new namespace
SET sc = ##class(HS.HC.Util.Installer).InstallFoundation(nNamespace)
THROW:$$$ISERR(sc) ##class(%Exception.StatusException).CreateFromStatus(sc)
// Add in all of the FHIR components and create a web app
SET sc = ##class(HS.HC.Util.Installer.Kit.FHIR.HealthConnect).Add( , nNamespace, "STU3", "/csp/healthshare/" _ nNamespace _ "/fhir/stu3", "/csp/healthshare/" _ nNamespace _ "/fhir-oidc/stu3")
THROW:$$$ISERR(sc) ##class(%Exception.StatusException).CreateFromStatus(sc)Once you have this installed, you can use a custom business process to coordinate all of the downstream calls to the external systems. For example, your production might request downstream resources and construct a FHIR response bundle from them.
Hi Craig,
ImportFromString returns an HL7 Message, it does not populate an existing instance of EnsLib.HL7.Message.
Moreover, make sure that you are reading the entire message with %request.Content.Read, you'll probably want to wrap that in a loop.
Here is the code I get to work on my instance (2017.1)
Hi Dan, Can you please update the following to make this tutorial up-to-date?
.png)
+1 didn't know this existed, incredibly helpful!
I am not sure! This will secure any traffic hosted by the instance itself on the port added to the config (10443 in the example). It also does not change the way links are generated. If the portal webpage uses relative links, then it could secure those requests, but they ultimately don't connect through the instance so really security is out of our hands there.
This method simply opens an additional port on the included Apache server secured by the self-signed certificate. The non-secure ports will still work so this isn't a viable production strategy.
Sure, I will review the code and then add. I want to see if this could be accomplished with a ZPM package perhaps!
zpm "install code-server" would be very cool
If you're looking for how to run irispython --
In installation-dir/bin there is a binary irispython that is part of the installation Link
$ /usr/irissys/bin/irispython
Python 3.8.10 (default, Sep 28 2021, 16:10:42)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import iris
>>> iris.utils._OriginalNamespace()
'USER'
And to set the namespace:
import os
os.environ['IRISNAMESPACE'] = 'MyNamespace'
# must come after you set namespace or user
import iris
And to set the user credentials
import os
from getpass import getpass
os.environ['IRISUSERNAME'] = input('username> ')
os.environ['IRISPASSWORD'] = getpass('password >>>')
# must come after you set namespace or user
import iris
The method you want to change the language (locale or NLS) is Config.NLS.Locales -- Install()
You can see the available locales at this portal page: [System Administration] > [Configuration] > [National Language Settings] > Locale Definitions
So to put that into a manifest:
<Namespace Name="%SYS" Create="no">
<Log Text="Changing the Locale" Level="0"/>
<Invoke Class="Config.NLS.Locales" Method = "Install" CheckStatus="true">
<Arg Value="danw"/>
<!-- danw is the Danish Locale, Replace with Desired -->
</Invoke>
</Namespace>
Your driver is not accessible in the container. To make it accessible, you'll need to either copy it into the container filesystem using a dockerfile like so,
COPY /Users/joost/mysql-connector-java-8.0.29.jar /
OR mount a volume to the container when you start it with the driver in the host path
You could use a linked database (remote db projected as local tables) and then write an insert query to that linked table before it gets sent to a production.
As far as I know, they should be included in the output. If you want to force it you can add a property parameter on the relationship. https://docs.intersystems.com/irisforhealth20221/csp/docbook/DocBook.UI…
// Relationship to be includeed in JSONExport using JSON adaptor
Relationship Ingredients as Food.Item(%JSONINCLUDE = "inout", %JSONREFERENCE = "object") [ Cardinality = one, Inverse = Recipe ];6 years ago I designed such a system at Boston College:
This python code can easily be adapted for irispython. My suggestion, use a computer with modern graphics cards, and potentially outsource this ML work to one of the many AI companies that offer emotion detection these days.
Have you tried wrapping your message call (Ens.Director and OnProcessInput) in a class on the target machine.
ClassMethodConnectAndCall(host, port, namespace, user, pwd) As%Status
Glad it worked! Good luck with your project :)
Since the storage of passwords is only in salted & hashed format, you'll need to ask for the previous password, check that it logs the user in and then do the checking on the new password. That'll be your only time to view the previous password in plaintext.
As an aside, does the 1=1 portion of that query matter?
WHERE 1=1 ANDI think what you'll need is a write stream method below (I haven't had a chance to test this so the code comes with no guarantees). This will work for Non-Shared web-socket connections since I don't have the chance to test with shared pools at the moment.
Method Send(message As%Library.DynamicObject) As%Integer
{
Set stream = ##class(%Stream.TmpCharacter).%New()
Do message.Msg.%ToJSON(stream)
Set sc = ..WriteStream(stream)
If$$$ISERR(sc) $$$SysLog(2,"WebSocket","[Write] Error WRITE Stream on JSON Command",sc)
quit1
}
Method WriteStream(data As%Stream.Object) As%Status
{
Set$ZTrap="WriteError"If i%WSClassProtocolVersion > 1 & i%WSDataFraming = 1 {
Set head=$ZLChar(data.Size)
If i%BinaryData = 1 {
Set head=head_"8"
} Else {
Set head=head_"7"
}
} Else {
Set head=""
}
#; As there is activity on this session reset the session timeoutSet sc=$$updateTimeout^%SYS.cspServer(i%SessionId) If$$$ISERR(sc) $$$SysLog(2,"WebSocket","[Write] Error updating session timeout",sc)
#; Only return an error status if there's an issue with the write itself.Set sc=$$$OKIf (i%SharedConnection = 1) {
// If you want to try and play with the shared pools and large payloads, move the commented code to the loop below
#; Set sc=$$CSPGWClientRequest^%SYS.cspServer3(i%GWClientAddress,"WSW "_i%WebSocketID_" "_head_data1,-5,.response)
#; If $$$ISERR(sc) $$$SysLog(2,"WebSocket","[Write] Error sending request",sc)$$$SysLog(2,"WebSocket","[Write] Shared Connections Don't Support Stream Sizes over 3.6MB",sc)
Quit$$$Error($$$GeneralError, "[Write] Shared Connections Don't Support Stream Sizes over 3.6MB")
} else {
SET sc = $$$OK// Write headerWrite head
// Rewind StreamDo data.Rewind()
// Loop through stream and write 64kb chunkswhile (data.AtEnd = 0) {
// Set Buffer to 64KBSet BUFSZ = 65536// Read BufferSET BUFBLOCK = data.Read(.BUFSZ)
// Convert UTF8 if we aren't using Binary Web SocketsIf i%BinaryData '= 1 {
Try {
Set BUFBLOCK=$zconvert(BUFBLOCK,"O","UTF8")
} Catch exp {
$$$SysLog(2, "WebSocket", "[Write] Exception: "_exp.DisplayString(), data)
Set BUFBLOCK=BUFBLOCK
}
}
// Use DEVICE WRITE methodWrite BUFBLOCK
// Quit when done with streamBREAK:(BUFSZ < 65536)
}
// Send a flush command mnowWrite *-3Quit sc
}
Quit sc
WriteError
#; No interrupts during cleanup or error processingDo event^%SYS.cspServer2("WebSocket Write Error: "_$ZError)
$$$SetExternalInterrupts(0)
Set$ZTrap="WriteHalt"Hang5Close0
WriteHalt
Halt
}Great release! @Dmitry Maslennikov
For deployed code, does this prevent source (src or module.xml) from being stored on the disk as well?
good to know! how does ZPM do the actual pip installation? from pip._internal import pipmain or irispython -m pip install ...
Currently, product development is working on containerization and kubernetes support for healthshare. It might be worth waiting until it is officially supported.
Health Connect is containerized already and should have feature parity with InterSystems IRIS and IRIS for Health.
See here for some examples: https://github.com/kuszewski/iris-k3s
In the iko yaml files, you can change the iris tags to healthconnect and it works seamlessly.
In your docker build try this sequence:
USER root
RUN apt-get clean -yq && apt-get update -yq && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends openjdk-11-jdk
USER ${ISC_PACKAGE_MGRUSER}
Or install sudo (very bad practice in containers):
USER root
RUN apt-get clean -yq && apt-get update -yq && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata curl gnupg ca-certificates sudo
RUN /bin/echo -e ${ISC_PACKAGE_MGRUSER}\\tALL=\(ALL\)\\tNOPASSWD: ALL >> /etc/sudoers
RUN sudo -u ${ISC_PACKAGE_MGRUSER} sudo echo enabled passwordless sudo-ing for ${ISC_PACKAGE_MGRUSER}
USER ${ISC_PACKAGE_MGRUSER}
Will this change the commands from zpm to ipm?
Hi Laxmi,
I suggest reaching out to Athena IDX for such a documentation.
Please ensure that any dark version uses our white logo as the default color is invisible in dark mode.
set^Ens.Configuration("Queues","KeepInQueues")=1I use this tidbit to get an external ip
curl -s http://whatismyip.akamai.com/
If you want the docker-host ip and not the external ip, I use host networking and then use
hostname -I