go to post Ashok Kumar · Sep 20, 2023 Hello @Padmaja Konduru The certificate and private key is configured for the your SSL/TLS connection. You can try executing the below code to get some certificates of the certificate I have attached my sample "test" SSL/TLS which is included the sample certificate and private key (x509) Call the SSLDetails method with your SSL name. This method will return an local array with some basic details like expire date , subject and so on. SSL configuration name was taken from the System > Security Management > SSL/TLS Configurations /// Call this method with your ssl name ClassMethod SSLDetails(SSLName As %String = "") As %Status { new $namespace set $namespace="%SYS" set ssl=##class(Security.SSLConfigs).%OpenId("test") set privateKeyFile = ssl.CertificateFile set file = ##class(%FileCharacterStream).%New() do file.LinkToFile(privateKeyFile) set str=file.Read($$$MaxLocalLength) do ..certificateDetails(str,.fields) zw fields return $$$OK } ClassMethod certificateDetails(str As %String, ByRef fields) { #;getting some basic details for field="SerialNumber","Issuer","ValidityNotAfter","ValidityNotBefore","Subject","SubjectKeyIdentifier" { set fields(field) = $SYSTEM.Encryption.X509GetField(str,field) } } output verify the local array fields("ValidityNotAfter") value for the expired date IRISMYDEV>do ##class(Sample.NewClass1).SSLDetails("test") fields("Issuer")="L=test,CN=test,O=test,ST=test,C=us" fields("SerialNumber")=0 fields("Subject")="L=test,CN=test,O=test,ST=test,C=us" fields("SubjectKeyIdentifier")=$c(144)_"¾&p"_$c(28)_"áÁZÀ"_$c(140)_"Ô4OÜ"_$c(24)_"º""=B"_$c(137) fields("ValidityNotAfter")="2023-09-21 06:13:50" fields("ValidityNotBefore")="2023-09-20 06:13:50"
go to post Ashok Kumar · Sep 19, 2023 Basically Summary Document Architecture aka SDA is an intersystems intermediary format to convert the HL7 Messages to FHIR or create an FHIR resource form custom data. vR4 is representing FHIR version. So I guess. You may need to upgrade the instance to get vR4 packages
go to post Ashok Kumar · Sep 19, 2023 Hello @Michael Wood, The line property is actually a list of string in address object property. So You should use direct Insert action instead of Set for that property when doing mapping in DTL for single values. If it's list/collection the you should foreach the list property and insert the values to the line() property. Refer the screenshots below for both scenarios. Direct single Insert XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ] { <transform sourceClass='CSVtoHL7.Inputfile.Record' targetClass='HS.FHIR.DTL.vR4.Model.Resource.Location' create='new' language='objectscript' > <assign value='source.FirstName' property='target.address.line' action='insert' key='1' /> </transform> } List XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ] { <transform sourceClass='CSVtoHL7.Inputfile.Record' targetClass='HS.FHIR.DTL.vR4.Model.Resource.Location' create='new' language='objectscript' > <foreach property='source.AddressLine()' key='k1' > <assign value='source.AddressLine.(k1)' property='target.address.line' action='insert' key='k1' /> </foreach> </transform> } result
go to post Ashok Kumar · Sep 19, 2023 Hello @Jimmy Christian You can use the foreach element instead of code block if it's direct set to target and no code logic required. I have attached the sample codes below. You can refer mr. @Sylvain Guilbaud samples as well. XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ] { <transform sourceClass='CSVtoHL7.Inputfile.Record' targetClass='CSVtoHL7.Test.NewClass2' targetDocType='2.5:ADT_A01' create='new' language='objectscript' > <foreach property='source.EmailList()' key='k1' > <assign value='source.EmailList.(k1)' property='target.ListOfEmails.(k1)' action='set' /> </foreach> </transform> } DTL output
go to post Ashok Kumar · Sep 18, 2023 You can use code block in DTL to write the iterate code fo the list or general loop iteration for item=1,3,4,5 /// code }
go to post Ashok Kumar · Sep 15, 2023 You can add sql from the add action and place your embedded sql query and get the values in host variable. Then set the sql return value to the field directly like below. XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ] { <transform sourceClass='EnsLib.HL7.Message' targetClass='EnsLib.HL7.Message' sourceDocType='2.3.1:ADT_A01' targetDocType='2.3.1:ADT_A01' create='new' language='objectscript' > <assign value='source.{PV1:SetIDPV1}' property='target.{PV1:SetIDPV1}' action='set' disabled='1' /> <sql> <![CDATA[ select count(id) INTO :value from Sample.Person]]></sql> <assign value='value' property='target.{PV1:AdmissionType}' action='set' /> </transform> }
go to post Ashok Kumar · Sep 12, 2023 May be you can try to take a clone of the object by %ConstructClone() I know it increments the reference count. However you can keep the old object for validation.
go to post Ashok Kumar · Sep 11, 2023 Hello smythe, There are couple of ways to import your file into stream and convert to Ens.StreamContianer First you can create a %FileCharacterStream object and link your file in to it. Create a streamcontainer object and send the created stream as a first parameter in %OnNew to Ens.StreamContiner class. ClassMethod StreamContainer() { set file="dir\file" ; Your directory and file name(C:\Intersystems\new13.txt) set file = ##class(%FileCharacterStream).%New() do file.LinkToFile(file) set strmContainer=##class(Ens.StreamContainer).%New(file) zwrite strmContainer.Stream.Read($$$MaxLocalLength) } Second, This way it's almost similar way. But Instead of pushing directly into Ens.Streamcontainer. You need to create a object for SDA. Import your file through XMLImportSDAString method to prepare SDA object. Now you have SDA object handy. So you can do any SDA stuffs with this object. Eventually it's an implicit step for validate your SDA file structure(Keep in mind the file structure should be exact XML format of SDA). Once the SDA object generated you can use Stream method generate stream from this SDA. Now you can convert to Ens.StreamContainer. Refer the below code to implement the above steps ClassMethod FileToSDAToEnsContainer() { set file = ##class(%FileCharacterStream).%New() do file.LinkToFile("C:\FHIRFILE\new13.txt") set SDA3Container=##class(HS.SDA3.Container).%New() do SDA3Container.XMLImportSDAString(file.Read($$$MaxLocalLength)) zwrite SDA3Container do SDA3Container.ToQuickXMLStream(.stream) set strmContainer=##class(Ens.StreamContainer).%New(stream) zwrite strmContainer.Stream.Read() }
go to post Ashok Kumar · Sep 11, 2023 No. GetColumnType() method returns an integer of the datatype.You can manually get the datatype from the integer. Class Sample.Person Extends %Persistent { Property FirstName As %String; Property LastName As %String; Property StartDate As %Library.TimeStamp ; Property Age As %Integer; Property TestCurrency As %Currency; Property TestBoolean As %Boolean; Property TestCharStream As %Stream.GlobalCharacter; Query TestQuery() As %SQLQuery [ SqlProc ] { select firstname,LastName,Age,TestCurrency,TestBoolean,TestCharStream from Sample.Person } ClassMethod GetDataTypeOfField() As %String { set result = ##class(%ResultSet).%New("Sample.Person:TestQuery") ; for I=1:1:result.GetColumnCount() { write "Column Name: ",result.GetColumnName(I)," " write "Datatype number: ",result.GetColumnType(I)," " write "DataType: ",..GetDataType(result.GetColumnType(I)),!! } } ///Get datatype from the integer ClassMethod GetDataType(type As %Integer=0) [ CodeMode = expression ] { $Case(type, 1:"BINARY", 2:"DATE", 3:"DOUBLE", 4:"HANDLE", 5:"INTEGER", 6:"LIST", 7:"LONGVARCHAR", 8:"TIME", 9:"TIMESTAMP", 10:"VARCHAR", 11:"STATUS", 12:"BINARYSTREAM", 13:"CHARACTERSTREAM", 14:"NUMERIC", 15:"CURRENCY", 16:"BOOLEAN", 17:"OID", 18:"BIGINT", 19:"FDATE", 20:"FTIMESTAMP", :"") } } The output when execute the method GetDataTypeOfField() IRISMYDEV>d ##class(Sample.Person).GetDataTypeOfField() Column Name: FirstName Datatype number: 10 DataType: VARCHAR Column Name: LastName Datatype number: 10 DataType: VARCHAR Column Name: Age Datatype number: 5 DataType: INTEGER Column Name: TestCurrency Datatype number: 15 DataType: CURRENCY Column Name: TestBoolean Datatype number: 16 DataType: BOOLEAN Column Name: TestCharStream Datatype number: 13 DataType: CHARACTERSTREAM refer the documentation here
go to post Ashok Kumar · Sep 11, 2023 I agree, it's a wonderful idea. Enable the auto save option periodically. It's better way to prevent the implementation lost. However, keep in mind to compile the code once all the implementation completed
go to post Ashok Kumar · Sep 10, 2023 Thank you @Robert Cemper for spending time on the evaluation on the IntegrityLog-Web , CSPFileViewDownload and System-Task-REST and provided valuable feedback.
go to post Ashok Kumar · Sep 8, 2023 Hello Scott, You have lot of object properties declared in your class definition. So, You should initialize the parameter to handle the unexpected fields like extending the %JSON.Adaptor in your class definitions. Otherwise it throw an error. So, Make sure the %JSONFIELDNAME was added if the JSON field name is different from your property and add parameter %JSONIGNOREINVALIDFIELD to avoid unexpected field while loading JSON into object. Here is the article about the JSON adaptor Parameter %JSONIGNOREINVALIDFIELD As BOOLEAN = 1 Yes, You can order your JSON structure by rearranging the property back and forth.
go to post Ashok Kumar · Sep 8, 2023 Hi Prashant, You can get the values from %Metadata.columns.GetAt(i).ODBCType the ODBC type is referred the datatype of the column. 12 for VARCHAR refer the ODBC type integer and datatype here ClassMethod GetColumnType() As %String { set statement = ##class(%SQL.Statement).%New() set tSC = statement.%PrepareClassQuery("Sample.Person","TestQuery") set result = statement.%Execute() #dim meta As %SQL.StatementMetadata set meta = result.%GetMetadata() write meta.columns.GetAt(1).ODBCType ;fetch first field }
go to post Ashok Kumar · Sep 8, 2023 Hi @Gautam Rishi , You can use the GetColumnType(columnnumber) to get the datatype of the particular field in the result set object. This GetColumnType Method returns an integer values from 1 to 20.each number represent unique datatype( 10 represents VARCHAR ). If the type cannot be determined, 0 is returned. For Dynamic SQL use %SQL.Statement It's preferable and suggested instead %Resultset. set result = ##class(%ResultSet).%New("Class:Query") while result.Next() { for I=1:1:result.GetColumnCount() { write "Column Name: ",result.GetColumnName(I),! write "Datatype: ",result.GetColumnType(I),! } } Column Name: FirstNameDatatype: 10Column Name: LastNameDatatype: 10
go to post Ashok Kumar · Sep 7, 2023 This is really useful when we working long strings. If we didn't declare any stream object for the temp variable and pass to %ToJSON(temp). In that case, a %Stream.FileCharacter stream is created