我在下面列出了全局,我正在尝试使用 sql stoarage 创建几个缓存类:
^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) 中的 IppLines 的数量。我在下面创建了类 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"时出错。维普罗夫线%msg: 表 XFXA_MCA。WIppProvLine 具有以下未映射(未在数据映射上定义)字段:relWIppProv'
错误 #5030:编译类 XFXA 时出错。马华。维普罗夫线 在 2.745s 的编译过程中检测到 1 个错误。
我做错了什么?
提前致谢,佛瑞德
当你有父子关系时,子类(XFXA.马华。WIppProvLine)看起来像
Index iMaster On (hmo, keen , seq, seq2) [ IdKey, PrimaryKey, Unique ];
不需要来自父级的属性。 子类中的附加项,您不会在类定义中声明来自父类的任何属性,因此在子类中不需要
属性 hmo 作为 %整数;属性 Keen 作为 %整数;
从 OO 的角度来看,您永远不会设置子项的 Hmo,而是设置父项的 Hmo,并且由于子项是相关的,因此它向下应用层次结构。