Salma Sarwar · Oct 6, 2020 go to post

Just an update I have tried the following however, the MSH segment seems to be getting overwritten, any ideas why?

s tMsg = ##class(EnsLib.HL7.Message).%New()
s tMsg.DocType ="2.3.1:DFT_P03"
s tSeg = ##class(EnsLib.HL7.Segment).%New()
set tSeg.DocType="2.3.1:PID"
s tsc = tMsg.SetValueAt("abc","MSH:9")
s tsc = tSeg.SetValueAt("PID","1")
s tsc = tSeg.SetValueAt("TEST","3.1")
set tsc=tMsg.SetSegmentAt(tSeg,2)
w tMsg.OutputToString()

I have also tried set tsc=  tMsg.AppendSegment(tSeg) which seems to be overwriting the MSH segment.

Any help would be great.

Salma Sarwar · Jun 22, 2020 go to post

Hi Suman,

Thank you for your reply, do you have any sample code for this?

Kind Regards,

Salma

Salma Sarwar · Jun 18, 2020 go to post

Hi Katherine,

Thank you for your prompt reply in our version of Healthcare I don't see the option for Authorization Instance ID do you happen to know why this is would be the case and is this required?

Kind Regards,

Salma

Salma Sarwar · Jun 18, 2020 go to post

Hi

Thank  you so much for your help I will be looking to test this AbortMessage and I will get back to about my results :)  Thanks for pointing me in the right direction.

Kind Regards,

Salma

Salma Sarwar · Aug 30, 2019 go to post

Thank you so much, this is exactly what I was after. :)
Kind Regards,

Salma

Salma Sarwar · Aug 30, 2019 go to post

Hi Alexander,

Thank you for reply, I am looking more to export the lut file from within code if possible and would like it be compatible with studio so that it can be imported back.

Kind Regards,

Salma

Salma Sarwar · Aug 23, 2019 go to post

Hi

I would like to use this code to export the custom  schema files to a specific directory.  Is that possible, at the moment this only presents me with a list of names.

Thank you for your help.

Kind Regards,

Salma

Salma Sarwar · Aug 23, 2019 go to post

Hi

Thank you for this link it seems very useful and has pointed me in the right direction.  I noticed when I exported the code it didn't seem to pick up the look up tables or the HL7 schemas? Also I was wondering if I gave the export routine a studio project path, would it be able to export the project.  Thanks so much for this as I can start thinking of ways to tweak this.

Kind Regards,

Salma

Salma Sarwar · Aug 19, 2019 go to post

Hi

This is exactly what I am looking for, are you able to get the code for me please so I have a starting point.  Thank you.

Salma Sarwar · Aug 19, 2019 go to post

Hi

This is exactly what I am looking for, are you able to get the code for me please so I have a starting point.  Thank you.

Salma Sarwar · Aug 14, 2019 go to post

Thank you for your reply, this was very useful as I could not figure out why Status='Suspended' was not returning any rows in the raw mode. You have saved me a lot of time :)

Thanks again.

Salma

Salma Sarwar · Aug 14, 2019 go to post

Hi 

I am looking for something very similar to this as I would like to pick up suspended messages and resubmit them using SQL.  Are you able to advise how I could modify the SQL in your code to filter suspended messages?

Thank you for your help.

Kind Regards,

Salma

Salma Sarwar · Aug 9, 2019 go to post

Hi 

This is great thanks, it's exactly what I was looking for.  Thank you so much.

Kind Regards,

Salma

Salma Sarwar · Aug 9, 2019 go to post

Hi 

Thank you for your reply, I am already using the gitlab hook within Studio, what I wanted to do was export all the files with the relevant folder paths which I have done so using ##class(%SYSTEM.OBJ).ExportAllClassesIndividual however, if I create a project and try to export the files from within studio I can't find an easy way of maintaining the folder structure, it just exports all the classes in to one folder.

Kind Regards,

Salma

Salma Sarwar · Aug 8, 2019 go to post

Hi Jenna,

I was interested in doing something that you are mentioning.  Do you have anything that could start me off?

Thank you.

Kind Regards,

Salma

Salma Sarwar · Feb 5, 2018 go to post

Hi,

Thank you for your comment are you able to provide me with an example? My assumption is that you are suggesting to define a class and create a list of objects which then get passed back to the BPL. At the moment I have a SQL resultset which I have assigned to a snapshot and returned it to the BPL. 

Kind Regards,

Salma

Salma

Salma Sarwar · Feb 2, 2018 go to post

Hi

This is what my business operation looks like method looks like.


Method GetResultspRequest As GOSHPackage.Messages.PPID.Request.MyRequest, Output pResponse As GOSHPackage.Messages.PPID.Response.MyResponse) As %Status
{
Set tSC = $$$OK
Set pResponse = ##class(GOSHPackage.Messages.PPID.Response.MyResponse).%New()
Try
{
Set tSC = ..Adapter.Connect()
Throw:($$$ISERR(tSC))
Set tSC = ..Adapter.SetAutoCommit(1)
Throw:($$$ISERR(tSC))
$$$LOGINFO("2")
Set tQuery = "SELECT top 3 surname, forename FROM [dbo].[tblTest]"
//set tQuery =..Adapter.Query
$$$LOGINFO("3")
Set tSC = ..Adapter.ExecuteQuery(.tResults,tQuery,)
Throw:($$$ISERR(tSC))
set snap=##class(EnsLib.SQL.Snapshot).%New()
set tSC = tResults.GetSnapshot(.snap)
set pResponse.TestRS =snap
Throw:($$$ISERR(tSC))
$$$LOGINFO("5")
}
Catch tException
{
Set tSC = ##class(%SYSTEM.Status).Error(tException.AsStatus,tException.Name_" Threw an Error "_tException.DisplayString)
}                                                                          
Quit tSC
}

This populates the snapshot however when I am trying to get the response back in to the BPL I get the following error

ERROR <Ens>ErrBPTerminated: Terminating BP PPID Shadow Processor # due to error: ERROR <Ens>ErrException: <INVALID OREF>zOnResponse1+2^GOSHPackage.Process.PPID.PPIDShadowProcess.Context.1 -- logged as '-' number - @' Set status=1,context.TestRS=callresponse.TestRS' > ERROR <Ens>ErrException: <INVALID OREF>zOnResponse1+2^GOSHPackage.Process.PPID.PPIDShadowProcess.Context.1 -- logged as '-' number - @' Set status=1,context.TestRS=callresponse.TestRS'

I am unsure whether this is the right approach, any help would be appreciated.

Thank you.

Salma

Salma Sarwar · Jan 22, 2018 go to post

Hi All,

Thank you all for your comments, I am currently using 2017.1 of Healthshare/Healthconnect, I am assuming I can use Atelier with this version.  How different is Atelier to studio and are there downsides to using Atelier.  Thank you so much for your help.

Kind Regards,

Salma

Salma

Salma Sarwar · Aug 1, 2017 go to post

Hi Both,

Thank you for the suggestions, the fundamental requirement is that the PDF file needs to reach the target folder before the xml.  Also these files come in pairs so before processing it is important to check that the matching xml actually exists.  What I ended up doing was once the check was complete move the xml file in to a secondary folder which was getting polled by another business service, the xml would only reach the secondary folder once the PDF had been processed and archived this resolved the issue but again I am not sure whether it was the right solution.

I will give your suggestion a go too.  Thanks again for your help.

Kind Regards,

Salma

Salma Sarwar · Jul 24, 2017 go to post

Hi

The issue of having this code within the business process is that there is no transparency in doing a copy over, so I personally don't think that this is the best approach, there must be a better way if someone can recommend the correct way of transferring a file from a business process to a business operation that would be great.

Kind Regards,

Salma

Salma Sarwar · Jul 24, 2017 go to post

Hi

The issue of having this code within the business process is that there is no transparency is doing a copy over, so I personally don't think that this is the best approach there must be a better way.

Kind Regards,

Salma

Salma Sarwar · Jul 24, 2017 go to post

Hi ,

What I have done is using code I have copied the associated xml file to the target folder. I am not sure whether this is the best approach for doing a task like this.

The code snippet used to achieve this is below:

  //copy to target directory

  set targetFilePath= "\\serverName\targetPath\" _ context.XMLFileName
 
  set archiveFilePath = "\\serverName\archive\" _ $PIECE(context.XMLFileName,".",1) _$ZDATE($H,8)_".xml"
 
  set res=##class(%Library.File).CopyFile(context.XMLFilePath,targetFilePath)
  //Move file to archive folder with filename
  set res=##class(%Library.File).CopyFile(context.XMLFilePath,archiveFilePath)
 
  //compare that the files are the same and then delete
 
  if (##class(%Library.File).Compare(context.XMLFilePath, targetFilePath))
  {
    //delete from the current filepath
    do ##class(%Library.File).Delete(context.XMLFilePath)
  }

 

Is this the best approach or could you suggest a better approach?

Kind Regards,

Salma

Salma Sarwar · Jul 24, 2017 go to post

hi

I was thinking maybe it can be achieved by opening a file using a filepath or using an inbound file passthrough adapter and giving it a particular filename to process but I don't think that would be the right approach?  Any help would be appreciated.

Kind Regards,

Salma