Pesquisar

Anúncio
· Set. 3, 2024

Winner of the InterSystems Developer Community AI Sweepstakes

Hi Community!

We hope you enjoyed our Developer Community AI sweepstakes and learned something new while interacting with our DC AI. Now, it's time to announce the winner!

And the winner of the sweepstakes is @Akio Hashimoto. Congratulations! We will get in touch soon to deliver your prize, which is a Patagonia Black Hole® MLC™ Cube:

Our sincerest congratulations to our winner! And better luck next time to everyone else who took part!

1 Comment
Discussão (1)3
Entre ou crie uma conta para continuar
Pergunta
· Set. 3, 2024

Count XML Elements EnsLib.EDI.XML.Document

Hello everyone,

I'm a bit confused about the number of elements in an XML object.
I have an object of the class EnsLib.EDI.XML.Document
The xsd structure ( DocType)  is an SDA Object

</container>
<Patient>
</Patient>
<Documents>
<Document>
    <DocumentNumber>0000000000000010008162012</DocumentNumber>
    <DocumentCompletionStatus><Code>IP</Code></DocumentCompletionStatus>
    <FileType>XML</FileType>
    <Stream>PD...</Stream>
</Document>
<Document>
    <DocumentNumber>0000000000000010008157893</DocumentNumber>
    <DocumentCompletionStatus><Code>IP</Code></DocumentCompletionStatus>
    <FileType>XML</FileType>
    <Stream>PD94bT....4=</Stream>
</Document>
</Documents>
</container>

 

How can I count the number of document? I have already tried to use the method choiceGetCount but get no result.

Generating an Xpath object and counting the elements did not work either.

Does anyone have an idea for me. I am sure that it is actually not difficult :-(

Kind regards

Armin

2 Comments
Discussão (2)1
Entre ou crie uma conta para continuar
Pergunta
· Set. 3, 2024

Autocommit pandas dataframe rows into IRIS

Hi,

I'm getting an unexpected behavior when using pandas function to_sql(), which uses sqlalchemy-iris. After the first execution, a transaction seems to be opened and all rows inserted are lost after closing the connection:

engine = create_engine(f"iris://{args['username']}:{args['password']}@{args['hostname']}:{args['port']}/{args['namespace']}")
conn = engine.connect()

# rows are kept after close connection
train_df.to_sql(name='table1', con=conn, if_exists='replace', index=False)

# rows **aren't** kept after close connection
train_df.to_sql(name='table2', con=conn, if_exists='replace', index=False)

conn.close()
engine.dispose()

I did some research and based on this stackoverflow post and this and this doc pages, I changed the connection and it worked:

conn = engine.connect().execution_options(isolation_level="AUTOCOMMIT")

Is this the best way to achive the desired behavior?

2 Comments
Discussão (2)1
Entre ou crie uma conta para continuar
Pergunta
· Set. 3, 2024

Wrong data conversion when returning ZTIMEH and ZTIME

I encountered an unexpected behavior while working with the $ZTIMEH and $ZTIME functions, specifically with times between 12:00 and 13:00. Here's what I observed:

 

W $ZTIMEH("08:50:38.975411826")
Output: 31838 

W $ZTIME(31838,1)
Output: 08:50:38
 

This behavior is correct as $ZTIME returns the expected time of 08:50:38.

However, with the following example:
 

W $ZTIMEH("12:05:38.975411826")
Output: 338

W $ZTIME(338,1)
Output: 00:05:38

 

This seems incorrect to me. $ZTIME should have returned 12:05:38, but instead it returns 00:05:38.

Based on our findings, this appears to only occur at times between 12pm and 1pm (12h/13h).

Has anyone else had this problem or found a workaround?

2 Comments
Discussão (2)1
Entre ou crie uma conta para continuar
Pergunta
· Set. 3, 2024

$ZDATETIME($h,3,1,3)

Hi,

I am using this "$ZDATETIME($h,3,1,3)" and getting response as 2024-09-03 12:07:45.000
But I need proper values at the end instead of zeros (000)

Something like below -
2024-09-03 12:07:45.658

6 Comments
Discussão (6)1
Entre ou crie uma conta para continuar