This simple mapping specification maps a person entity in CDS to a household member evidence entity:
1 <?xml version="1.0" encoding="UTF-8"?> 2 <map xmlns="http://www.curamsoftware.com/schemas/GUMBO/Map" 3 name="TestMapping"> 4 <map-entity source="Person"> 5 <target-entity name="HouseholdMember" id="HouseholdMemberTarget"> 6 <map-attribute from="isNativeAmerican" to="natAlaskOrAmerInd"/> 7 <map-attribute from="comments" to="comments"/> 8 </target-entity> 9 </map-entity> 10 </map>
Line 4 indicates the source of the mapping while line 5 indicates the target. This rule can be paraphrased as "For each Person entity encountered in the CDS, create a corresponding HouseholdMember entity". The <target-entity> element contains two <map-attribute> elements on lines 6 and 7.
The <map-attribute> element on line 6 states that the isNativeAmerican attribute on the Person entity is mapped to the natAlaskOrAmerInd attribute on the HouseholdMember entity. Attributes are not mapped unless there is a <map-attribute> element specific. This is why line 6 states that the comments attribute in Person is mapped to the comments attribute in HouseholdMember.
In some cases, it is necessary to specify that a mapping only occurs under particular circumstances. For example, a HeadOfHousehold entity should only be created in the target system when the Mapping encounters a Person entity in the CDS that has an isPrimaryParticipant indicator set to true. The sample above can be expanded to include this rule as follows:
1 <?xml version="1.0" encoding="UTF-8"?> 2 <map xmlns="http://www.curamsoftware.com/schemas/GUMBO/Map" 3 name="TestMapping"> 4 <map-entity source="Person"> 5 <target-entity name="HouseholdMember" id="HouseholdMemberTarget"> 6 <map-attribute from="isNativeAmerican" to="natAlaskOrAmerInd"/> 7 <map-attribute from="comments" to="comments"/> 8 </target-entity> 9 </map-entity> 10 <condition expression="Person.isPrimaryParticipant==true"> 11 <target-entity name="HeadOfHousehold/> 12 </condition> 13 </map>