- Log in to post comments
i have created a sample and expected output
- Log in to post comments
thank you for the solution provided, i will definitely try this, the challenge is that in the XML file is generated, will always not follow the same amount of columns, so i need to generate the xdata stylesheet on runtime.
- Log in to post comments
thanks a mil, xecute worked
- Log in to post comments
thank you,
I am using the following method
set tSC=oRpt.GenerateReport(filename,2) which the filename is a .pdf file, and when i check the output folder a .xml, which has my output and a .xsl file
tSC returns this
tSC="0 "_$lb($lb(5001,"Unable to create ReportDisplay object.",,,,,,,,$lb(,"TRAK",$lb("e^%DrawToXSLFO+7^%ZEN.Report.reportPage.1^1","e^%MakeToXSLFOFile+14^%ZEN.Report.reportPage.1^1","e^%DisplayPDF1+6^%ZEN.Report.reportPage.1^1","e^%DisplayPDF+7^%ZEN.Report.reportPage.1^1","e^zCallReport+33^%ZEN.Report.reportPage.1^1","e^zGenerateReport+4^%ZEN.Report.reportPage.1^1","e^zGenerateReport+38^Region.MEXX.Report.RQM.App.Utils.1^1","e^zRepotToCSV+27^Region.MEXX.Report.RQM.App.Utils.1^1","d^zProcessNextReport+27^Region.MEXX.Report.RQM.App.Utils.1^1","d^zDebugStub+30^%Debugger.System.1^2","d^^^0"))))/* ERROR #5001: Unable to create ReportDisplay object. */any idea why
- Log in to post comments
what is the data type of
RESTR_DATETo
and can you post the error that you are getting
- Log in to post comments
Hi,
Is it possible to share the entire query / code that you are using to perform the update?
- Log in to post comments
Thank you, i tried your solution, one issue that i noticed is;
Suppose if <Col1> </Col1> is empty, with the above solution
rdr.NodeType="chars"
will not evaluate, and the CSV file will be wrong.
tweaked it as follows;
#define DEL ","
#define DC """"if ##class(%XML.TextReader).ParseFile(myfile, .rdr) {
if rdr.Read(), rdr.NodeType="element", rdr.Name=ROOT {
if $t {
set (nodeType,nodeName,line,header,childElementValue) = ""
set cnt=1
while rdr.Read() {
set nodeType = rdr.NodeType, nodeName = rdr.Name, length = $length(rdr.Path,"/")
if nodeType="element",nodeName=NAME {
set line=""
}
elseif cnt=1,nodeType="element",(length>3){
set header = header_$$$DC_nodeName_$$$DC_$$$DEL
}
elseif ((nodeType="chars") & (length>3)) {
set childElementValue=rdr.Value
}
elseif nodeType="endelement",length=4 {
set line=line_$$$DC_childElementValue_$$$DC_$$$DEL,childElementValue=""
}
elseif nodeType="endelement",nodeName=NAME {
if cnt=1 {
do stream.WriteLine(header)
set cnt=0
}
do stream.WriteLine(line)
}
elseif nodeType="endelement",nodeName=ROOT {
quit
}
}
} else { w "file open problem",! }
} else { w "XML root-element problem",! }
} else { w "XML structure problem",! }Although when it comes to a large file ParseFile method takes a significant amount of time to process the file, and i want to improve the code to run faster.
for example calling stream.WriteLine for each line can slow down the process, i want to try and batch the data and send to the stream to make the process much faster, and there is a concern for the <MAXLENGH> error.
Any Ideas?
- Log in to post comments
Please try this;
DATEADD will return a timestamp, such as '2020-07-26 00:00:00',
Just need to convert it back to Date and insert
UPDATE RB_ResEffDateSessPayorRestr
SET RESTR_DATETo = DATE(DATEADD('year',1,RESTR_DATETo))
WHERE YEAR(RESTR_DATETo)=2020Hope this helps.
Rizmaan.
- Log in to post comments
Hello all, is the contest for May started? where can i find details about it?
- Log in to post comments
- Log in to post comments
Congratulations all, and happy new year
- Log in to post comments
Hi @Dhruva Mishra,
Try installing Cygwin, which allows you to run UNIX commands, find/xpath/zip etc, once you install and add it to environment path you can run the above command
for example, zipping a folder with some text files.png)
the exe can be downloaded here.
https://www.cygwin.com/setup-x86_64.exe
Hope this helps
- Log in to post comments
The best way i guess is to have the FHIR package installed and use the OOB transformations.
an alternative way would be something as follows;
ClassMethod TestHL7ToJson()
{
set hl7FilePath = "C:\Intersystems\file.hl7"#dim hl7Msg As EnsLib.HL7.Message
set hl7Msg=##class(EnsLib.HL7.Message).ImportFromFile(hl7FilePath, .sc)
set tMSH=hl7Msg.getSegmentByIndex(1)
set tName=tMSH.GetValueAt(9,":_~\&")
set hl7Msg.DocType = "2.5:"_tName
//Anticipating the PID element in line 3set tPID = hl7Msg.getSegmentByIndex(3)
set jsonObj= {}
do jsonObj.%Set("PatientID",tPID.GetValueAt(2))
do jsonObj.%Set("PatientIdentifierList",tPID.GetValueAt(3))
do jsonObj.%Set("AlternatePatientIDPID",tPID.GetValueAt(4))
do jsonObj.%Set("PatientName",tPID.GetValueAt(5))
do jsonObj.%Set("MothersMaidenName",tPID.GetValueAt(6))
do jsonObj.%Set("DateTimeofBirth",tPID.GetValueAt(7))
do jsonObj.%Set("AdministrativeSex",tPID.GetValueAt(8))
do jsonObj.%Set("PatientAlias",tPID.GetValueAt(9))
do jsonObj.%Set("Race",tPID.GetValueAt(10))
do jsonObj.%Set("PatientAddress",tPID.GetValueAt(11))
do jsonObj.%Set("CountyCode",tPID.GetValueAt(12))
do jsonObj.%Set("PhoneNumberBusiness",tPID.GetValueAt(14))
do jsonObj.%Set("PrimaryLanguage",tPID.GetValueAt(15))
do jsonObj.%Set("MaritalStatus",tPID.GetValueAt(16))
do jsonObj.%Set("Religion",tPID.GetValueAt(17))
do jsonObj.%Set("PatientAccountNumber",tPID.GetValueAt(18))
do jsonObj.%Set("SSNNumberPatient",tPID.GetValueAt(19))
do jsonObj.%Set("DriversLicenseNumberPatient",tPID.GetValueAt(20))
do jsonObj.%Set("MothersIdentifier",tPID.GetValueAt(21))
do jsonObj.%Set("EthnicGroup",tPID.GetValueAt(22))
do jsonObj.%Set("BirthPlace",tPID.GetValueAt(23))
do jsonObj.%Set("MultipleBirthIndicator",tPID.GetValueAt(24))
do jsonObj.%Set("BirthOrder",tPID.GetValueAt(25))
do jsonObj.%Set("Citizenship",tPID.GetValueAt(26))
W jsonObj.%ToJSON()
}the above code generates a json for PID as follows;
{
"PatientID": "1111111^^^TEST^MR",
"PatientIdentifierList": "6910315054084^^M10^RSAID^GOV",
"AlternatePatientIDPID": "",
"PatientName": "Geoe^Schz^^MR^^^^^^^^^^.",
"MothersMaidenName": "",
"DateTimeofBirth": "19330722",
"AdministrativeSex": "M",
"PatientAlias": "",
"Race": "",
"PatientAddress": "GRASRK^CAPE TOWN^AA^^0001",
"CountyCode": "",
"PhoneNumberBusiness": "0",
"PrimaryLanguage": "E^English",
"MaritalStatus": "",
"Religion": "",
"PatientAccountNumber": "",
"SSNNumberPatient": "",
"DriversLicenseNumberPatient": "",
"MothersIdentifier": "",
"EthnicGroup": "",
"BirthPlace": "",
"MultipleBirthIndicator": "N",
"BirthOrder": "",
"Citizenship": ""
}
- Log in to post comments
That’s awesome @Benjamin De Boe, glad this article helped, beautifulsoup is very powerful and fast, I did do some benchmark testing using the same code in python vs embedded python for beautiful soup and I do not see much difference
- Log in to post comments
@Robert Cemper , i believe this is possible,:
for example this Url is for Open exchange Object Script Package Manager Reviews;
https://openexchange.intersystems.com/package/ObjectScript-Package-Mana…
Each Review is enclosed within <oex-review-card ... />
Although, i have not tested this we could do a find_all get the cards and extract the stars within them
- Log in to post comments
thank you, hope you get to feeling better soon!
- Log in to post comments
Best bet it to take from the Cache Installation Directory, If not dbeaver maintains a driver repository, you can download the cacheDb driver below;
Cache driver : https://dbeaver.io/files/jdbc/drivers/cache/CacheDB.jar
- Log in to post comments
Yikes my bad, v 2022.1
Odbc 64 bit :https://wrc.intersystems.com/wrc/WRC.StreamServer.cls?FILE=/wrc/Live/Ge…
ODBC 32 bit" https://wrc.intersystems.com/wrc/WRC.StreamServer.cls?FILE=/wrc/Live/Ge…
- Log in to post comments
W$TR($ZDATETIME($HOROLOG,3,1)," ","T")//adapted from (HS.FHIRServer.Utils).ConvertToUTC#dim tSecondsPerDay = 86400// time with offsetset tTimeWithOffset = $ZDATETIME($HOROLOG,3,5)
if (tTimeWithOffset [ "-") { set tOffsetSign = "-" }
elseif (tTimeWithOffset [ "+") { set tOffsetSign = "+" }
else { set tOffsetSign = "" }
if (tOffsetSign'="") {
// compute offset in secondsset tOffset = $P(tTimeWithOffset,tOffsetSign,2)
set tOffsetHrs = $P(tOffset,":")
set tOffsetMins = $P(tOffset,":",2)
set tOffsetInSeconds = (3600*tOffsetHrs) + (60*tOffsetMins)
// get date/time in $H formatset tTime = $P(tTimeWithOffset,tOffsetSign)
set tDateTimeH = $ZDTH(tDate_"T"_tTime,3,1)
set tDateH = $P(tDateTimeH,",")
set tTimeH = $P(tDateTimeH,",",2)
// UTC time = timestamp value (+/-) offset// might have to increment or decrement the dateset tUTCDateH = tDateH
if (tOffsetSign = "-") {
set tUTCTimeH = tTimeH + tOffsetInSeconds
if (tUTCTimeH >= tSecondsPerDay) {
set tUTCDateH = tUTCDateH+1set tUTCTimeH = tUTCTimeH-tSecondsPerDay
}
}
else {
set tUTCTimeH = tTimeH - tOffsetInSeconds
if (tUTCTimeH < 0) {
set tUTCDateH = tUTCDateH-1set tUTCTimeH = tUTCTimeH+tSecondsPerDay
}
}
Set pDateTimeH = tUTCDateH_","_tUTCTimeH
quit$TR($ZDT(pDateTimeH,3,1)," ","T")_"Z"
}- Log in to post comments
Hi @Lucas Enard
Sure, you are most welcome.
- Log in to post comments
Hi @Caio Timm,
You can do something similar to this
SELECT ROW_NUMBER() OVER (ORDER BY <column_name>) AS RowNumber, <other_columns> FROM <table_name>
Eg:
.png)
- Log in to post comments
@Guillaume Rongier that’s awesome thank you for sharing, will check this out.
- Log in to post comments
Congratulations to all, amazing articles
- Log in to post comments
Have you tried using a Installation Manifest
https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cl…
- Log in to post comments