1

我有下面列出的全局,我正在尝试使用 sql 存储创建几个缓存类:

^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^^^^"

全局的前两个下标(Hmo 和 Keen)构成一个唯一条目。第三个下标 (Seq) 有一个属性 (IppLineCount),它是第四个下标级别 (Seq2) 中的 IppLine 的数量。我在下面创建了类 WIppProv,它是父类:

/// <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> 
}

这个类编译得很好。接下来我创建了下面列出的 WIppProvLine 类,并在两者之间建立了父子关系:

/// 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> 
}

当我尝试编译这个时,我收到以下错误:

错误 #5502:编译 SQL 表“XFXA_MCA.WIppProvLine %msg”时出错:表 XFXA_MCA.WIppProvLine 具有以下未映射(未在数据映射中定义)字段:relWIppProv

ERROR #5030:编译类 XFXA.MCA.WIppProvLine 时发生错误,在 2.745 秒内编译期间检测到 1 个错误。

我究竟做错了什么?

提前致谢,弗雷德

4

1 回答 1

0

当您有父子关系时,子类(XFXA.MCA.WIppProvLine)中的索引声明看起来像

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

不需要来自父级的属性。在子类中附加您没有在类定义中声明任何来自父类的属性,因此您不需要在子类中

属性 Hmo 作为 %Integer; 属性敏锐为 %Integer;

从 OO 的角度来看,您永远不会设置子级的 Hmo,而是设置父级的 Hmo,并且由于子级是相关的,因此它沿层次结构应用。

于 2012-06-06T17:17:02.170 回答