The effects of selecting and field selection criteria

For a segment to be selected for display, the following conditions must be met:

  • The segment type is selected in the View Segment Selection panel or the Database Positioning panel.
  • The relevant values in the segment satisfy the Layout Identification criteria for a layout of the segment type (set in the Template Segment Layout panel). The layout is called the matching layout. If there is only one layout, there are no Layout Identification criteria, and the segment is automatically matched with the layout.
  • The matching layout is selected for display in the View Segment Layout Selection panel. If there is only one layout, the segment layout is automatically selected.
  • The relevant values in the segment satisfy the Field Selection criteria for the matching layout (set in the View Segment Layout panel). The short-hand way of saying this is that the segment satisfies the criteria.
  • The parent and child segments of the segment match the field selection criteria for their segments.

    If the view contains field selection criteria for a child segment layout, then the parent segment is selected only if at least one child segment satisfies the criteria. If no child segments satisfy the criteria or the parent has no child segments, then the parent segment is not selected.

If a segment fails any of these tests, then it is a not-selected segment, and it is not displayed.

If a segment passes all these tests, but FM/IMS finds that the length of the segment does not match the length of the matching layout, then the segment is displayed as a not-matched shadow line.

The effect of criteria ripples up the database hierarchy. Consider a database hierarchy that has three levels: Level 1 (root segment); Level 2 (child of Level 1); and Level 3 (child of Level 2).

If field selection criteria are specified on the Level 3 segment, then the Level 1 segment is selected only if it has at least one Level 2 child segment that, in turn, has at least one Level 3 child that satisfies the field selection criteria in the Level 3 layout. If criteria is set in each level, the Level 1 segment is only selected when all of these conditions are true:
  • The Level 1 segment satisfies the field selection criteria for the Level 1 layout.
  • The Level 1 segment has at least one Level 2 child that satisfies the field selection criteria for a Level 2 layout.
  • That Level 2 segment has at least one Level 3 child that satisfies the field selection criteria for a Level 3 layout.

The effect of criteria also ripples down the database hierarchy. That is, if the Level 1 (root) segment has two child segment types, and it has no child segments that satisfy the selection criteria in one child type, then none of the second type of child segments are selected either.

If there are two or more layouts for a child segment, then the parent segment is not selected only if all the child segments of either layout are not selected.

Note: When determining if a segment satisfies the field selection criteria, it does not matter whether or not you have chosen to display a child segment type.
Here are some examples, to show you how the selection criteria are applied:

              ┌───────────────────┐
              │ Patient:          │
              │   Si Key          │
              └─────────┬─────────┘
                        │
          ┌─────────────┴─────────────┐
          │                           │
┌─────────┴─────────┐       ┌─────────┴─────────┐
│ Doctor:           │       │ Illness:          │
│   Spock           │       │   influenza       │
└───────────────────┘       └─────────┬─────────┘
                                      │
                              ┌───────┴─────────────┐
                              │ Treatment: Hot bath │
                            ┌─────────────────────┐ │
                            │ Treatment:          │─┘
                            │   Antibiotics       │
                            └─────────────────────┘

For these examples, the root segment is Patient. It has two child segments, Doctor and Illness, and the Illness segment has two occurrences of its child segment Treatment. Here are some possibilities:

  • Example One

    Select for display:

    • Doctor segment

    Supply Field Selection criteria:

    • Treatment segment: Treatment=Antibiotics

    FM/IMS displays:

    • Doctor: Spock segment
  • Example Two

    Select for display:

    • Patient segment

    Supply Field Selection criteria:

    • Doctor segment: Doctor=Spock
    • Treatment segment: Treatment=Vitamin C

    FM/IMS displays:

    • Nothing. The Doctor segment satisfies its Field Selection criteria. However, there is no Treatment segment to satisfy the Treatment segment Field Selection criteria, which means that no Illness segment is selected, so no Patient segment is selected.
  • Example Three

    Select for display:

    • Patient segment and Illness segment

    Supply Field Selection criteria:

    • Doctor segment: Doctor=Spock
    • Treatment segment: Treatment=Antibiotics

    FM/IMS displays:

    • Patient: Si Key segment
    • Illness: influenza segment