Comparing two instances (the clipboard structures)- Plan Compare
Pega Foundation for Healthcare has implemented a utility which could be utilized to compare any two instances (of their clip board structure). Demonstrated how the utility is utilized to do comparison of two plans and two benefits in the sample admin data portal.
There are three steps in this utility design.
- Configuring the data transforms to prepare the data modal required for compare utility and Opening the data instances.
- Passing the data instances (which need to be compared) and the source page (populating the data modal in point a).
- Populates the output on the compare results page (as a tree structure) for each property on the source page, which can be utilized for building UI as per the client needs.
Pega Foundation for Healthcare has demonstrated the usage of utility for plan comparison. The following rules can be verified for any of the implementations.
Data transforms Configured for preparing the input data modal:
The configuration should follow the same structure having pyName, pyCategory, pyCaseContext, and pyNote.
- pyName: Name of the property which need to be considered for the comparison.
- pyCategory: Type of the property Single/Page/List (only Page list and No group properties supported).
- pyCaseContext: Hardcoded (CompResults) path for building the Output in the same way the source structure. This value is needed only for the first level data transform (in the foundation scenario only at PegaHC-Data-Plan level data transform).
- pyNote: Only Needed for Lists and only if you need similar objects to the similar context.
Properties separated by comma, which need to be considered for the bringing the similar objects to the same level.
Passing the required Params to the compareutilwrapper utility:
Pega Foundation for Healthcare has created “PrepareSourceDataModel” activity for preparing plan instances and sourcePage and passing them to compareWrapper.
CompareWrapper utility is the extension activity provided for any data manipulation and/or implementing any business logic.
CompareUtil has all the core logic for comparing single / Page / List properties.
Logic Description CompareWrapper Extension activity and calling compreutil activity. CompareUtil Core activity doing whole process of comparison. CompareSingleProperties Activity performing the comparison on single type properties. CompareSingleProperties_Extn Extension provided in the single properties’ comparison. PageCompare Activity performing the Page type properties comparison. PageCompare_Extn Extension activity. PrepareSortedLists Activity running the algorithm to shuffle two list properties to bring the similar objects to the same level before performing the comparison, based on the comma separated value provided in the pyNote. IndexToIndexCompare Activity to compare each index page two list properties. IndexToIndexCompare_Extn Extension activity. ListToListCompare Activity to compare two List properties (not at the index level but the whole list level). This comparison can be turned on/off using “ListsComparision” parameter. SetContextAndSourcePage Activity used in the node of the output section to go to the next level and perform comparison, which would help going to Nth level in the clipboard structure. SetContext_Ext Extension activity. Previous topic Configuring DCR Next topic Managing custom code sets