Writing a client program to evaluate ItemData elements
To evaluate the ItemData information for each InForm item, your program must find the root ItemDef elements (root controls) for each InForm item, and recursively process them and their child ItemDef elements (child controls) to determine the completeness of each InForm item. Match the ItemDef elements from metadata (from DownloadMetadataODM) to the corresponding ItemData elements from clinical data (from GetTransactions) to get the values of the controls.
To identify the ItemDefs of an InForm item:
An InForm item is represented in metadata by a pf:InFormItemDef element. Each pf:InFormItemDef has a list of ItemRefs, which represent all of the controls associated with the InForm item. The ItemRefs have corresponding ItemDefs.
- If the ItemDef has no pf:ParentType, then it is a root ItemDef.
- If the ItemDef has pf:ParentType of "ItemDef," then find the ItemDef whose OID matches the child’s pf:ParentOID.
- If the ItemDef has pf:ParentType of "CodeListItem," then find the CodeListItem whose pf:SelectionOID matches the ItemDef’s pf:ParentOID.
To find the root ItemDefs of an InForm item:
- From the InForm item’s ItemRefs, find the corresponding ItemDefs that do not have parents. These are the root ItemDefs.
To find the child ItemDefs of an ItemDef:
- If the ItemDef has pf:ControlType of "RadioGroup," then find the child ItemDefs whose pf:ParentOID match the pf:SelectionOID of the RadioGroup’s selected CodeListItem. The Clinical Data will determine which CodeListItem is selected from the RadioGroup.
- For ItemDefs that have other pf:ControlType values, find the child ItemDef whose pf:ParentOID matches the ItemDef’s OID.
Calculated controls:
Calculated controls are treated specially when determining completeness. When an item contains only a single calculated control, the item is considered complete, even if the calculated control has no value. Also, if a checkbox or radio group selection contains only a calculated control, that selection is considered to be complete. Otherwise, calculated controls are ignored.
An item is complete if:
- It has only calculated controls.
or
- It has at least one complete control, and no incomplete controls.
Note: Empty is not the same as Incomplete. A radio group or checkbox group is incomplete if it has a selection, and the selection's child control(s) are empty or incomplete.