Extending mapping using the MapToEntity pattern
The Provider and Authorization APIs are configured using this extension pattern.
MapToEntityWrapper - Rather than implementing individual Data Transforms in each class of the object hierarchy, a single MapToEntityWrapper rule is configured @baseclass and is available across the entire system. This rule accepts a single Page Name parameter called Integration Page. This is defined on the “Pages & Classes” tab as being of type PegaHC-Int. As all incoming JSON request pages adhere to this contract, the run time parameters passed will be acceptable.
- Open Data Transform rule: MapToEntityWrapper configured @baseclass. This
rule provides two extension data transform placeholder rules in addition to the
MapToEntity rule for the pre-configured mapping provided by the
Foundation:
- Copy the PreMapToEntity_EXT rule into your ruleset at the
appropriate PegaHC- Int resource class that requires pre-processing
ahead of the standard mapping.
You may need to create implementations of this rule when you have created subclasses of the PegaHC-Int domain entity that is being mapped and need to ensure that the appropriate custom class is instantiated at run-time via dynamic class injection (the Dynamic Class Referencing pattern). This allows for proper use of polymorphism throughout the system and minimizes the instances of override properties being created for each Page, Page List and Page Group property provided by the Foundation.
- Copy the PostMapToEntity_EXT rule into your appropriate resource class and extend for post-processing after the mapping is done.
- Copy the PreMapToEntity_EXT rule into your ruleset at the
appropriate PegaHC- Int resource class that requires pre-processing
ahead of the standard mapping.
- Open Data Transform rule: MapToEntity configured at the PegaHC-Int class for each domain e.g. PegaHC-Int-Authorization. This rule provides the pre-configured mapping for the Resource and its subpages. It provides a placeholder extension rule called MapToExtensionDetails_EXT.
- Copy the MapToExtensionDetails_EXT into your ruleset for the desired Resource or its sub- page class to extend the mapping beyond what is pre-configured.
Previous topic Extending the mapping Next topic Step 2: Integrating using HL7 FHIR REST APIs