Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
0 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25">
<Class name="EDIGW.Rules.RulesHelper">
<IncludeCode>EDIGW,Ensemble</IncludeCode>
<TimeCreated>65016,56130.852676</TimeCreated>
<Method name="CheckExpectedValue">
<ClassMethod>1</ClassMethod>
<FormalSpec>received:%String,pExpected:%String,errString:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set status = $$$OK
if received [ ":" set status = $$$ERROR($$$GeneralError,"Invalid "_errString) Quit status
set expected = ":"_$p(pExpected,"*",2)_":"
set received = ":"_received_":"
if expected '[ received set status = $$$ERROR($$$GeneralError,"Invalid "_errString)
Do ##class(EDIGW.Utility).DEBUG($$$DebugRules,"CheckExpectedValue "_pExpected_" --- "_received_" > "_+status)
Quit status
]]></Implementation>
</Method>
<Method name="CheckExpectedLength">
<ClassMethod>1</ClassMethod>
<FormalSpec>received:%String,pExpected:%String,errString:%String,*IK403</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set status = $$$OK, IK403 = 0
set expMin = $p($p(pExpected,"*",3),":",1)
set expMax = $p($p(pExpected,"*",3),":",2)
If ($Length(received) > expMax) Set IK403 = $$$DataElemTooLong
If ($Length(received) < expMin) Set IK403 = $Select($L(received)=0:$$$RequiredDataElemMissing,1:$$$DataElemTooShort)
if IK403 > 0 set status = $$$ERROR($$$GeneralError,"Invalid "_errString)
Do ##class(EDIGW.Utility).DEBUG($$$DebugRules,"CheckExpectedLength "_pExpected_" --- "_received_" > "_+status)
Quit status
]]></Implementation>
</Method>
<Method name="logError">
<ClassMethod>1</ClassMethod>
<FormalSpec>source:EnsLib.EDI.X12.Document,objTXNSET:CREPOS.TXNSET999,path:%String,elePos:%String,eleRef:%Integer,IK304:%String,IK403:%String,IK404:%String,rulNam:%String,status:%Status=0</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
S tSegIdx=0
If objTXNSET.valStatus {
// Save objTXNSET before we create CREPOS.TXNSETERR999 object in case of Error when saving the Error object
If $$$RubberStamp999 Set objTXNSET.valStatus = 1 // Rubberstamp all transactions as GOOD - remove this line when Rubberstamp expires
If '$$$RubberStamp999 Set objTXNSET.valStatus = 0
if rulNam="BadST" Set objTXNSET.valStatus = $$$ERROR($$$GeneralError,"Bad Transaction Type "_IK404),tSegIdx=1
Set retStatus = objTXNSET.%Save()
If $$$ISERR(retStatus) { }
}
Set retStatus = $$$OK
Set pathLoopSeg = $P(path,":",1)
Set pathLoopSegLen = $L(pathLoopSeg,".")
Set segName = $P(pathLoopSeg,".",pathLoopSegLen)
Set loopName = $P(pathLoopSeg,".",pathLoopSegLen-1)
Set loopID = $P(loopName,"loop",2)
set err = ##class(CREPOS.TXNSETERR999).%New()
set err.TXNSET = objTXNSET
set err.IK301 = segName
set err.IK302 = $S(tSegIdx:tSegIdx,1:source.GetSegmentIndex(pathLoopSeg,.tSC))
set err.IK303 = loopID
set err.IK304 = IK304
set err.IK401 = elePos
set err.IK402 = eleRef
set err.IK403 = IK403
set err.IK404 = IK404
set err.RuleName = rulNam
set err.RuleStatus = status
set retStatus = err.%Save()
if $$$ISERR(retStatus) {
Set msg = "ERROR in RulesHelper with Batch ID "_objTXNSET.BATCH.%Id()_" ST02 "_objTXNSET.ST02TXNCTLNBR_". "
Do ##class(EDIGW.Utility).DEBUG($$$DebugRules,msg_$system.Status.GetOneErrorText(retStatus))
$$$LOGERROR(msg_$system.Status.GetOneErrorText(retStatus))
}
Quit retStatus
]]></Implementation>
</Method>
</Class>
</Export>