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.

Hi Suman,

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

Kind Regards,

Salma

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

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

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

Salma

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

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

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

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.

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.