New post

Find

Question
· Oct 13, 2022

How to convert xlsx to csv

Hi ommunity,

I am downloading an Excel xlsx from the web with the below method and saving it as xlsx, how do I convert and save xlsx as csv?

ClassMethod DownloadFileUrl()
{
        
        Set httprequest = ##class(%Net.HttpRequest).%New()
        Set httprequest.Server = "www.health.gov.za"
        Set httprequest.SSLConfiguration = "SSL_OAUTH_Client"
        Do httprequest.Get("/wp-content/uploads/2021/04/ICD-10_MIT_2021_Excel_16-March_2021.xlsx")
        write httprequest.HttpResponse.StatusLine         
        Set stream=##class(%FileBinaryStream).%New()
        Set stream.Filename="/home/Data/March_2021.xlsx"
        Write stream.CopyFrom(httprequest.HttpResponse.Data)
        Write stream.%Save()
        Write stream.%Close()
}
6 Comments
Discussion (6)2
Log in or sign up to continue
Question
· Oct 10, 2022

Converting XML message Type to HL7 Message

Hi ,

Still a newbie for ensemble, I am trying to convert XML message to HL7 Message. I am using Custom schema for XML structure which includes MSH and PID segments from HL7 Message.

These are the service, process, Operation classes i am using 

Business service-EnsLib.EDI.XML.Service.FileService

Business Process-EnsLib.MsgRouter.RoutingEngine

Business operation -EnsLib.HL7.Operation.FileOperation

I am using data transformation to convert XML message to HL7 message  and data transformation is working fine and im getting this in the business operation.

 

ERROR <Ens>ErrGeneral: Not routing to target(s) 'HL7Output' because of error in Transform 'CSTOM.TXML.XMLToHL7' : ERROR <Ens>ErrException: <PROPERTY DOES NOT EXIST>zTransform+7^CSTOM.TXML.XMLToHL7.1 *MSH,EnsLib.EDI.XML.Document -- logged as '-' number - @' Set tSC1=target.SetValueAt(source.MSH.EncodingCharacters,"MSH:EncodingCharacters","set","")'

 

Please let me know if i missed any thing in this process?

 

Thanks,

Smythee

8 Comments
Discussion (8)1
Log in or sign up to continue
Question
· Oct 5, 2022

Share ZPM technique?

Anybody willing to share a method form the ZPM cli (or othewise) where zpm will "Install package if not already installed?"  I would want this to count for updates too I think as I would want to control that too.

The use case is in a CI-CD pipeline, where the pipeline can be used to provision start to state, but for somethings only do once.  An example would be I have a package that provisions a fhir package or search parameter in my own way, but doesnt do it again when somebody merges operational code and the pipeline fires again, it would not attempt to load the fhir package again.

6 Comments
Discussion (6)3
Log in or sign up to continue
Question
· Sep 22, 2022

How to open a zip file from a website using the %Net.HttpRequest.Get() and extract a certain file from within that zip file

Hello,

I am trying to grab a specific zip file from a webpage but once I grab the zip file I need to grab a specific file within that zip file and I was hoping someone could explain how to do this or provide an example

3 Comments
Discussion (3)1
Log in or sign up to continue
Discussion (2)1
Log in or sign up to continue