Thanks Eduard but SourceConfigName returns the processes setting not the service.

So there is a PGP library is Cache, I was unable to find anything related to PGP.

Thanks Jeff, is there anyway to do it without defining the doctype?

Thanks, Are you able to have multiple conditions?

if ReceivingFacility="A" or ReceivingFacility="B" or ReceivingFacility="C" {

Thanks Sean, One of the things I wanted to avoid was the schema path. Using the 2.4 schema I would need extra DTL to do the same function and wanted to see if there was a way to make it not bound to a schema.

So you are thinking something like this may work?

S sNewSeg = ##class(EnsLib.HL7.Segment).%New()
    d sNewSeg.init(target.getSegmentIdByIndex(idx),0,"2.3", pOBXSegment)

I still has OBX segments, with adding target.SetSegmentAt class.

  FOR idx = pSegCount {
          s seg=target.GetSegmentAt(idx)
        if seg.Name="OBX"
            #;Get OBX5 Value
            s pObservationValue = seg.GetValueAt(5)
            #;Create Identifier Value
            s pObservationIdentifier = pObservationIdentifier+1
            #;Build New NTE Segment
            s pOBXSegment="NTE" _"|" _pObservationIdentifier _"|" _pObservationValue
            d seg.ImportFromString(pOBXSegment,"","")
            d target.SetSegmentAt(seg,idx)