Eyal Levin · May 2, 2024 go to post

Thanks Marc,

that was exactly what I was trying to say, you just explained it much better now

Eyal Levin · Apr 18, 2024 go to post

Hi Kevin,

here is an example of my procedure


create procedure bidata.spObservationOS(IN maxDate VARCHAR) RESULT SETS
    LANGUAGE OBJECTSCRIPT
{
    do $system.SQL.Execute("TRUNCATE table bidata.ObservationsStg")
    do $system.SQL.Execute("INSERT %NOINDEX into bidata.ObservationsStg (ID, IssuedTime, Key, ObservationCategoryCode, ObservationCategoryDisplay, ObservationCode, ObservationCodeText, ObservationDisplay, ObservationEncounterReference, ObservationIdentifier, ObservationLastUpdated, ObservationSpecimenReference, ObservationStatus, ObservationSubjectReference, ObservationValueCode, ObservationValueDisplay, ObservationValueText, PerformerDisplay, PerformerIdentifier) select ID, IssuedTime, Key, ObservationCategoryCode, ObservationCategoryDisplay, ObservationCode, ObservationCodeText, ObservationDisplay, ObservationEncounterReference, ObservationIdentifier, ObservationLastUpdated, ObservationSpecimenReference, ObservationStatus, ObservationSubjectReference, ObservationValueCode, ObservationValueDisplay, ObservationValueText, PerformerDisplay, PerformerIdentifier FROM BIProjection.Observation where ObservationLastUpdated > maxDate")
    do $system.SQL.Execute("BUILD INDEX FOR TABLE bidata.ObservationsStg")
    do $system.SQL.Execute("UPDATE bidata.Observations set p.IssuedTime = s.IssuedTime, p.ObservationCategoryCode = s.ObservationCategoryCode, p.ObservationCategoryDisplay = s.ObservationCategoryDisplay, p.ObservationCode = s.ObservationCode, p.ObservationCodeText = s.ObservationCodeText, p.ObservationDisplay = s.ObservationDisplay, p.ObservationEncounterReference = s.ObservationEncounterReference, p.ObservationIdentifier = s.ObservationIdentifier, p.ObservationLastUpdated = s.ObservationLastUpdated, p.ObservationSpecimenReference = s.ObservationSpecimenReference, p.ObservationStatus = s.ObservationStatus, p.ObservationSubjectReference = s.ObservationSubjectReference, p.ObservationValueCode = s.ObservationValueCode, p.ObservationValueDisplay = s.ObservationValueDisplay, p.ObservationValueText = s.ObservationValueText, p.PerformerDisplay = s.PerformerDisplay, p.PerformerIdentifier = s.PerformerIdentifier from bidata.Observations p join bidata.ObservationsStg s on p.ID = s.ID")
    do $system.SQL.Execute("INSERT %NOINDEX into bidata.Observations (ID, IssuedTime, Key, ObservationCategoryCode, ObservationCategoryDisplay, ObservationCode, ObservationCodeText, ObservationDisplay, ObservationEncounterReference, ObservationIdentifier, ObservationLastUpdated, ObservationSpecimenReference, ObservationStatus, ObservationSubjectReference, ObservationValueCode, ObservationValueDisplay, ObservationValueText, PerformerDisplay, PerformerIdentifier) SELECT ID, IssuedTime, Key, ObservationCategoryCode, ObservationCategoryDisplay, ObservationCode, ObservationCodeText, ObservationDisplay, ObservationEncounterReference, ObservationIdentifier, ObservationLastUpdated, ObservationSpecimenReference, ObservationStatus, ObservationSubjectReference, ObservationValueCode, ObservationValueDisplay, ObservationValueText, PerformerDisplay, PerformerIdentifier FROM bidata.ObservationsStg where ID not in (select ID from bidata.Observations)")
    do $system.SQL.Execute("BUILD INDEX FOR TABLE bidata.Observations")
    do $system.SQL.Execute("UPDATE BIData.seqRunLog set LastRunTime = (select max(ObservationLastUpdated) from BIData.ObservationsStg) where processName = 'Observation'")
        
}

in the studio it looks like 

spObservationOS(maxDate As  String(MAXLEN=1))

I had to manually change the maxlen

Eyal Levin · Apr 11, 2024 go to post

Hi Vitaliy,

I'm not using the TRUNCATE parameter, the class is created automatically with the create table.

I'm trying to raise an awareness to the different behavior between the JDBC/ODBC and the SQL GUI.
 

Eyal Levin · Apr 9, 2024 go to post

Just wondering, did you look at the table (class)  ERP.Arquivos  definition? what is the MAXLEN  of Blob?

I had an issue of that sort where MAXLEN  only affects  odbc/jdbc data

hth, Eyal

Eyal Levin · Mar 15, 2024 go to post

Keep in mind that there are jdbc versions and you will need to keep it updated, and maybe have several versions, other than that, great Idea

Eyal Levin · Feb 28, 2024 go to post

Thanks Russ,

I didn't want to link between patients, I wanted to pass all data from one patient to another and to mark the "empty" patient as inactive

Eyal Levin · Feb 28, 2024 go to post

Thanks Dean, I don't see merge operation in R4, only on R5.

I didn't want to link between patients, I wanted to pass all data from one patient to another and to mark the "empty" patient as inactive

Eyal Levin · Feb 1, 2024 go to post

It's a kubernetes setup, I can't use shadow copy or something like that

Thanks

Eyal

Eyal Levin · Jan 30, 2024 go to post

ok

Thanks
 

Eyal Levin · Jan 30, 2024 go to post

Hi Ambrogio,

here are my scripts:
Pre:

#!/bin/bash

 

LOG_DIR=~/Commvault_backup
LOG_FILE=$LOG_DIR/backup-log_$(date +'%d-%m-%y').txt
mkdir -p $LOG_DIR 2>/dev/null
touch $LOG_FILE
if [ `hostname | grep data`  ]; then 
  #Freeze Write Daemon
  echo -e "##################################\n"  | tee -a $LOG_FILE  >> /irissys/data/IRIS/mgr/messages.log
  echo "Freezing IRIS Write Daemon"  | tee -a $LOG_FILE  >> /irissys/data/IRIS/mgr/messages.log
  iris session iris -U%SYS "##Class(Backup.General).ExternalFreeze(,,,,,,,,,480)"
  status=$?
  if [[ $status -eq 5 ]]; then
    echo -e "$(date +'%m/%d/%y-%T.%3N') (Wizards) [Backup.Event] [Commvault Backup] IRIS WD IS FROZEN Performing backup (UTC time! +03:00) STATUS = $status (need to be 5) "  | tee -a $LOG_FILE  >> /irissys/data/IRIS/mgr/messages.log
    while [ true ]; do
      if [ "$(tail -n 1 /irissys/data/IRIS/mgr/messages.log | grep "Journal File Compression" | awk '{print $8}')" = "Compressed"  ]; then
        echo -e "$(date +'%m/%d/%y-%T.%3N') (Wizards) [Backup.Event] [Commvault Backup] Running... "  | tee -a $LOG_FILE  >>  /irissys/data/IRIS/mgr/messages.log
        echo -e "$(date +'%m/%d/%y-%T.%3N') (Wizards) [Backup.Event] [Commvault Backup] Starting Backup... (UTC time! +03:00) "  | tee -a $LOG_FILE  >>  /irissys/data/IRIS/mgr/messages.log
              break
      fi
          done
  elif [[ $status -eq 3 ]]; then
    echo -e "$(date +'%m/%d/%y-%T.%3N') (Wizards) [Backup.Event] [Commvault Backup] IRIS WD FREEZE FAILED  (UTC time! +03:00) STATUS = $status (need to be 5)"  | tee -a $LOG_FILE  >> /irissys/data/IRIS/mgr/messages.log
    exit 1
  fi
  echo 
else 
   echo -e "Not data Pod" | tee -a $LOG_FILE

fi

 The question is how do I tell commvault that it's backup actually failed?

thanks,

Eyal

Post:

#!/bin/bash
LOG_DIR=~/Commvault_backup
LOG_FILE=$LOG_DIR/backup-log_$(date +'%d-%m-%y').txt
mkdir -p $LOG_DIR 2>/dev/null
touch $LOG_FILE
if [ `hostname | grep data`  ]; then 
  #Thaw Write Daemon
  echo -e "\nThaw Write Daemon" | tee -a $LOG_FILE  >> /irissys/data/IRIS/mgr/messages.log
  iris session iris -U%SYS "##Class(Backup.General).ExternalThaw()"
  status=$?
  if [[ $status -eq 5 ]]; then
    while [ true ]; do  
      if [ "$(tail -n 1 /irissys/data/IRIS/mgr/messages.log | grep "Backup.General.ExternalThaw: System resumed" | awk '{print $6,$7}')" = "System resumed"  ]; then
        echo -e "$(date +'%m/%d/%y-%T.%3N') (Wizards) [Backup.Event] [Commvault Backup] IRIS WD IS THAW! (UTC time! +03:00) STATUS = $status (need to be 5) "  | tee -a $LOG_FILE  >>  /irissys/data/IRIS/mgr/messages.log
        break
      else
        echo "wait"
      fi
    done
  elif [[ $status -eq 3 ]]; then
    echo -e "$(date +'%m/%d/%y-%T.%3N') (Wizards) [Backup.Event] [Commvault Backup] IRIS WD THAW FAILED  (UTC time! +03:00) STATUS = $status (need to be 5)"  | tee -a $LOG_FILE  >>  /irissys/data/IRIS/mgr/messages.log
    exit 1
  fi
  echo -e "##################################\n"  | tee -a $LOG_FILE  >> /irissys/data/IRIS/mgr/messages.log
else 
  echo -e "Not data Pod" | tee -a $LOG_FILE
fi

 

Eyal Levin · Jan 29, 2024 go to post

Hi Ambrogio, 

I have configured pre and post scripts and the system should thaw itself after 8 min if an external thaw was not issued, but I need to pass this to my backup software (commvault) in order for it to know it actually failed.

Eyal Levin · Jan 20, 2024 go to post

Hi,

I've got the same issue, I've started to container without running the IRIS on startup -u=false

and found that there is only HSPD installed, so here is the command that worked for me:

docker run -d --name providerdirectory -p 52773:52773 -p 1972:1972 -p 2187:2187 containers.intersystems.com/intersystems/healthshare_providerdirectory:2023.2 -i HSPD

hth

Eyal

Eyal Levin · Jan 17, 2024 go to post

Hi,

could you consider using a different date format such as YYYY-MM-DDTHH:MI:SS which is more robust and less dependent on specific settings, CONVERT(datetime, '2023-12-12T11:27:00', 126)

HTH

Eyal Levin · Jan 17, 2024 go to post

Hi,
can you try:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <!-- Match the root ORU_R01 message -->
  <xsl:template match="ORU_R01">
    <html>
      <body>
        <!-- Apply the transformation to each OBR segment -->
        <xsl:apply-templates select="//OBR"/>
      </body>
    </html>
  </xsl:template>

  <!-- Match each OBR segment -->
  <xsl:template match="OBR">
    <div>
      <!-- Output custom table header for OBR -->
      <h2>OBR Segment</h2>
      <table border="1">
        <tr>
          <th>Field 1</th>
          <th>Field 2</th>
          <!-- Add more headers as needed -->
        </tr>
        <tr>
          <!-- Output data for each field in the OBR segment -->
          <td><xsl:value-of select="OBR-1"/></td>
          <td><xsl:value-of select="OBR-2"/></td>
          <!-- Add more fields as needed -->
        </tr>
      </table>

      <!-- Apply the transformation to each OBX segment under the current OBR -->
      <xsl:apply-templates select="following-sibling::OBX[count(. | following-sibling::OBR[1]/preceding-sibling::OBX) = count(following-sibling::OBR[1]/preceding-sibling::OBX)]"/>
    </div>
  </xsl:template>

  <!-- Match each OBX segment under the current OBR -->
  <xsl:template match="OBX">
    <table border="1">
      <tr>
        <th>Custom Header 1</th>
        <th>Custom Header 2</th>
        <!-- Add more custom headers as needed -->
      </tr>
      <tr>
        <!-- Output data for each field in the OBX segment -->
        <td><xsl:value-of select="OBX-1"/></td>
        <td><xsl:value-of select="OBX-3"/></td> <!-- Adjust this line based on the actual field you want to display -->
        <!-- Add more fields as needed -->
      </tr>
    </table>
  </xsl:template>

</xsl:stylesheet>

Note that in the OBX template, I've used OBX-3 to display the data from the third field of each OBX segment. You should adjust this line based on the actual field you want to display in your PDF. If you have specific field names for OBX segments, replace them accordingly in the XSLT