Cache Class compilation error using parent-child relationships and cache sql storage

StackOverflow https://stackoverflow.com/questions/10918418

  •  13-06-2021
  •  | 
  •  

Question

I have the global listed below that I'm trying to create a couple of cache classes using sql stoarage for:

^WHEAIPP(1,26,1)=2 
^WHEAIPP(1,26,1,1)="58074^^SMSNARE^58311" 
                2)="58074^59128^MPHILLIPS^59135" 
^WHEAIPP(1,29,1)=2 
^WHEAIPP(1,29,1,1)="58074^^SMSNARE^58311" 
                2)="58074^59128^MPHILLIPS^59135" 
^WHEAIPP(1,93,1)=2 
^WHEAIPP(1,93,1,1)="58884^^SSNARE^58948" 
                2)="58884^59128^MPHILLIPS^59135" 
^WHEAIPP(1,166,1)=2 
^WHEAIPP(1,166,1,1)="58407^^SMSNARE^58420" 
                 2)="58407^59128^MPHILLIPS^59135" 
^WHEAIPP(1,324,1)=2 
^WHEAIPP(1,324,1,1)="58884^^SSNARE^58948" 
                 2)="58884^59128^MPHILLIPS^59135" 
^WHEAIPP(1,419,1)=3 
^WHEAIPP(1,419,1,1)="59707^^SSNARE^59708" 
                 2)="59707^^MPHILLIPS^59910,58000^^^^" 
                 3)="59707^59981^SSNARE^60117,53241^^^^"

The first two subscripts of the global (Hmo and Keen) make a unique entry. The third subscript (Seq) has a property (IppLineCount) which is the number of IppLines in the fourth subscript level (Seq2). I create the class WIppProv below which is the parent class:

/// <PRE> 
/// ============================ 
/// Generated Class Definition 
/// Table:          WMCA_B_IPP_PROV 
/// Generated by:   FXALTMAN 
/// Generated on:   05/21/2012 13:46:41 
/// Generator:      XWESTblClsGenV2 
/// ---------------------------- 
/// </PRE> 
Class XFXA.MCA.WIppProv Extends (%Persistent, %XML.Adaptor) [ ClassType = persistent, Inheritance = right, ProcedureBlock, StorageStrategy = SQLMapping ]

{

/// .HMO 
Property Hmo As %Integer;

/// .KEEN 
Property Keen As %Integer;

/// .SEQ 
Property Seq As %String;

Property IppLineCount As %Integer;

Index iMaster On (Hmo, Keen, Seq) [ IdKey, Unique ];

Relationship IppLines As XFXA.MCA.WIppProvLine [ Cardinality = many, Inverse = relWIppProv ];

<Storage name="SQLMapping"> 
<DataLocation>^WHEAIPP</DataLocation> 
<ExtentSize>1000000</ExtentSize> 
<SQLMap name="DBMS"> 
<Data name="IppLineCount"> 
<Delimiter>"^"</Delimiter> 
<Node>+0</Node> 
<Piece>1</Piece> 
</Data> 
<Global>^WHEAIPP</Global> 
<PopulationType>full</PopulationType> 
<Subscript name="1"> 
<AccessType>Sub</AccessType> 
<Expression>{Hmo}</Expression> 
<LoopInitValue>1</LoopInitValue> 
</Subscript> 
<Subscript name="2"> 
<AccessType>Sub</AccessType> 
<Expression>{Keen}</Expression> 
</Subscript> 
<Subscript name="3"> 
<AccessType>Sub</AccessType> 
<LoopInitValue>1</LoopInitValue> 
<Expression>{Seq}</Expression> 
</Subscript> 
<Type>data</Type> 
</SQLMap> 
<StreamLocation>^XFXA.MCA.WIppProvS</StreamLocation> 
<Type>%Library.CacheSQLStorage</Type> 
</Storage> 
}

This class compiles fine. Next I created the WIppProvLine class listed below and made a parent-child relationship between the two:

/// Used to represent a single line of IPP data 
Class XFXA.MCA.WIppProvLine Extends (%Persistent, %XML.Adaptor) [ ClassType = persistent, Inheritance = right, ProcedureBlock, StorageStrategy = SQLMapping ]

{

/// .CLM_AMT_ALLOWED node: 0 piece: 6<BR> 
/// This field should be used in conjunction with the Claim Operator field to 
/// define a whole claim dollar amount at which a particular claim should be 
/// flagged with a Pend status. 
Property ClmAmtAllowed As %String;

/// .CLM_LINE_AMT_ALLOWED node: 0 piece: 8<BR> 
/// This field should be used in conjunction with the Clm Line Operator field to 
/// define a claim line dollar amount at which a particular claim should be flagged 
/// with a Pend status. 
Property ClmLineAmtAllowed As %String;

/// .CLM_LINE_OP node: 0 piece: 7<BR> 
/// A new Table/Column Reference that gives the SIU (Special Investigative Unit) 
/// the ability to look for claim line dollars above, below, or equal to a set 
/// amount. 
Property ClmLineOp As %String;

/// .CLM_OP node: 0 piece: 5<BR> 
/// A new Table/Column Reference that gives the SIU (Special Investigative Unit) 
/// the ability to look for claim dollars above, below, or equal to a set amount. 
Property ClmOp As %String;

Property EffDt As %Date;

Property Hmo As %Integer;

/// .IPP_REASON node: 0 piece: 10<BR> 
/// IPP Reason Code   
Property IppCode As %Integer;

Property Keen As %Integer;

/// .LAST_CHG_DT node: 0 piece: 4<BR> 
/// Last Changed Date 
Property LastChgDt As %Date;

/// .PX_DX_CDE_FLAG node: 0 piece: 9<BR> 
/// A Flag to indicate whether or not Procedure Codes or Diagnosis Codes are to be 
/// associated with this SIU Flag Type Entry. If the Flag = Y, then control would 
/// jump to a new screen where the user can enter the necessary codes. 
Property PxDxCdeFlag As %String;

Property Seq As %String;

Property Seq2 As %String;

Index iMaster On (Hmo, Keen, Seq, Seq2) [ IdKey, PrimaryKey, Unique ];

/// .TERM_DT node: 0 piece: 2<BR> 
/// Term Date 
Property TermDt As %Date;

/// .USER_INI node: 0 piece: 3 
Property UserIni As %String;

Relationship relWIppProv As XFXA.MCA.WIppProv [ Cardinality = one, Inverse = IppLines ];

Index relWIppProvIndex On relWIppProv;

//Index NewIndex1 On (RelWIppProv, Seq2) [ IdKey, PrimaryKey, Unique ];

<Storage name="SQLMapping"> 
<ExtentSize>1000000</ExtentSize> 
<SQLMap name="DBMS"> 
<ConditionalWithHostVars></ConditionalWithHostVars> 
<Data name="ClmAmtAllowed"> 
<Delimiter>"^"</Delimiter> 
<Node>+0</Node> 
<Piece>6</Piece> 
</Data> 
<Data name="ClmLineAmtAllowed"> 
<Delimiter>"^"</Delimiter> 
<Node>+0</Node> 
<Piece>8</Piece> 
</Data> 
<Data name="ClmLineOp"> 
<Delimiter>"^"</Delimiter> 
<Node>+0</Node> 
<Piece>7</Piece> 
</Data> 
<Data name="ClmOp"> 
<Delimiter>"^"</Delimiter> 
<Node>+0</Node> 
<Piece>5</Piece> 
</Data> 
<Data name="EffDt"> 
<Delimiter>"^"</Delimiter> 
<Node>+0</Node> 
<Piece>1</Piece> 
</Data> 
<Data name="Hmo"> 
<Delimiter>"^"</Delimiter> 
<Node>+0</Node> 
<Piece>11</Piece> 
</Data> 
<Data name="IppCode"> 
<Delimiter>"^"</Delimiter> 
<Node>+0</Node> 
<Piece>10</Piece> 
</Data> 
<Data name="LastChgDt"> 
<Delimiter>"^"</Delimiter> 
<Node>+0</Node> 
<Piece>4</Piece> 
</Data> 
<Data name="PxDxCdeFlag"> 
<Delimiter>"^"</Delimiter> 
<Node>+0</Node> 
<Piece>9</Piece> 
</Data> 
<Data name="TermDt"> 
<Delimiter>"^"</Delimiter> 
<Node>+0</Node> 
<Piece>2</Piece> 
</Data> 
<Data name="UserIni"> 
<Delimiter>"^"</Delimiter> 
<Node>+0</Node> 
<Piece>3</Piece> 
</Data> 
<Global>^WHEAIPP</Global> 
<Subscript name="1"> 
<AccessType>Sub</AccessType> 
<Expression>{Hmo}</Expression> 
<LoopInitValue>1</LoopInitValue> 
</Subscript> 
<Subscript name="2"> 
<AccessType>Sub</AccessType> 
<Expression>{Keen}</Expression> 
<LoopInitValue>1</LoopInitValue> 
</Subscript> 
<Subscript name="3"> 
<AccessType>Sub</AccessType> 
<Expression>{Seq}</Expression> 
<LoopInitValue>1</LoopInitValue> 
</Subscript> 
<Subscript name="4"> 
<AccessType>Sub</AccessType> 
<Expression>{Seq2}</Expression> 
<LoopInitValue>1</LoopInitValue> 
</Subscript> 
<Type>data</Type> 
</SQLMap> 
<StreamLocation>^XFXA.MCA.WIppProvLineS</StreamLocation> 
<Type>%Library.CacheSQLStorage</Type> 
</Storage> 
}

When I try to compile this one I get the following error:

ERROR #5502: Error compiling SQL Table 'XFXA_MCA.WIppProvLine %msg: Table XFXA_MCA.WIppProvLine has the following unmapped (not defined on the data map) fields: relWIppProv'

ERROR #5030: An error occurred while compiling class XFXA.MCA.WIppProvLine Detected 1 errors during compilation in 2.745s.

What am I doing wrong?

Thanks in Advance, Fred

Was it helpful?

Solution

When you have parent child relationships the index declaration in the child class(XFXA.MCA.WIppProvLine) that looks like

Index iMaster On (Hmo, Keen, Seq, Seq2) [ IdKey, PrimaryKey, Unique ];

does not need the properties which are from the parent. Additional in the child class you do not declare in the class definition any property that is from the parent so you do not need in the child class

Property Hmo As %Integer; Property Keen As %Integer;

From an OO perspective you would never set the Hmo of the Child, you set the Hmo of the parent and since the child is related it applies down the hierarchy.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top