Eform Default Values

From CaisisWiki

(Difference between revisions)
Jump to: navigation, search
(Examples)
m (RequireSiblings)
 
(13 intermediate revisions not shown)
Line 4: Line 4:
Each XML node requiring a default value requires specialized attribute to set the rules for cascading and setting default values automatically.
Each XML node requiring a default value requires specialized attribute to set the rules for cascading and setting default values automatically.
-
==== SourceTable ====
+
==== DefaultSource ====
-
The name of the table which triggers a default value event.
+
The source table, column and record which triggers use of the default value. Uses the form "TableName.FieldName,RecordId", e.g., "Encounters.EncDateText,1"
-
==== SourceField ====
+
 
-
The name of the field which triggers a default value event (no field == all table fields).
+
Additionally, if the node does not specify a value for DefaultValue, the value of the field specified in DefaultSource is used as the default value.
-
==== SourceRecordId ====
+
 
-
The RecordId of the source table.
+
==== DefaultValue ====
==== DefaultValue ====
-
A static default value. If none set, use Source value.
+
A static default value. If none set and DefaultSource is specified, use the value of the specified DefaultSource as the default value.
-
==== TargetTable ====
+
 
-
The current xml node's table.
+
-
==== TargetField ====
+
-
The current xml node's field.
+
-
==== TargetRecord ====
+
-
The current xml node's RecordId.
+
==== RequireSiblings ====
==== RequireSiblings ====
-
True or false if the field requires a sibling value before setting the DefaultValue.
+
True or false if the field requires a sibling value before setting the DefaultValue. Defaults to "True".
 +
 
 +
==== TriggeredBySiblings ====
 +
If True, setting any of the field's siblings will activate the DefaultValue.  Defaults to "True".
 +
==== TriggeredByChildren ====
 +
If True, when child control value set, activate parent default value logic. Defaults to "True"
===Examples===
===Examples===
Line 34: Line 33:
         <LabQuality DefaultValue="STD"></LabQuality>
         <LabQuality DefaultValue="STD"></LabQuality>
     </LabTests>
     </LabTests>
-
 
====Trigger Static Value ====
====Trigger Static Value ====
Line 42: Line 40:
         <LabDate></LabDate>
         <LabDate></LabDate>
         <LabDateText></LabDateText>
         <LabDateText></LabDateText>
-
         <LabTest NotNull="True" DefaultValueSourceTable="Encounters" DefaultValueSourceField="EncChiefComplaint" DefaultValueSourceRecordId="1" DefaultValue="PSA"></LabTest>
+
         <LabTest NotNull="True" DefaultSource="Encounters.EncChiefComplaint,1" DefaultValue="PSA"></LabTest>
         <LabResult></LabResult>
         <LabResult></LabResult>
         <LabUnits></LabUnits>
         <LabUnits></LabUnits>
-
         <LabQuality DefaultValueSourceTable="Encounters" DefaultValueSourceField="EncChiefComplaint"  DefaultValueSourceRecordId="1"  DefaultValue="STD"></LabQuality>
+
         <LabQuality DefaultSource="Encounters.EncChiefComplaint,1"  DefaultValue="STD"></LabQuality>
     </LabTests>
     </LabTests>
-
 
====Copy Dynamic Value (activate source) ====
====Copy Dynamic Value (activate source) ====
Line 53: Line 50:
     <LabTests RecordId="1">
     <LabTests RecordId="1">
-
         <LabDate DefaultValueSourceTable="Encounters" DefaultValueSourceField="EncDate"  DefaultValueSourceRecordId="1" ></LabDate>
+
         <LabDate DefaultSource="Encounters.EncDate,1" ></LabDate>
-
         <LabDateText DefaultValueSourceTable="Encounters" DefaultValueSourceField="EncDateText"  DefaultValueSourceRecordId="1" ></LabDateText>
+
         <LabDateText DefaultSource="Encounters.EncDateText,1" ></LabDateText>
         <LabTest NotNull="True"></LabTest>
         <LabTest NotNull="True"></LabTest>
         <LabResult></LabResult>
         <LabResult></LabResult>
Line 65: Line 62:
     <LabTests RecordId="1">
     <LabTests RecordId="1">
-
         <LabDate DefaultValueSourceTable="Encounters" DefaultValueSourceField="EncDate"  DefaultValueSourceRecordId="1" TriggerSibling="True></LabDate>
+
         <LabDate DefaultSource="Encounters.EncDate,1" TriggeredBySiblings="True></LabDate>
-
         <LabDateText DefaultValueSourceTable="Encounters" DefaultValueSourceField="EncDateText"  DefaultValueSourceRecordId="1" TriggerSibling="True"></LabDateText>
+
         <LabDateText DefaultSource="Encounters.EncDateText,1" TriggeredBySiblings="True"></LabDateText>
         <LabTest NotNull="True"></LabTest>
         <LabTest NotNull="True"></LabTest>
         <LabResult></LabResult>
         <LabResult></LabResult>

Current revision as of 16:00, 13 November 2012

Contents

Default Values (v6.x)

Attributes

Each XML node requiring a default value requires specialized attribute to set the rules for cascading and setting default values automatically.

DefaultSource

The source table, column and record which triggers use of the default value. Uses the form "TableName.FieldName,RecordId", e.g., "Encounters.EncDateText,1"

Additionally, if the node does not specify a value for DefaultValue, the value of the field specified in DefaultSource is used as the default value.

DefaultValue

A static default value. If none set and DefaultSource is specified, use the value of the specified DefaultSource as the default value.

RequireSiblings

True or false if the field requires a sibling value before setting the DefaultValue. Defaults to "True".

TriggeredBySiblings

If True, setting any of the field's siblings will activate the DefaultValue. Defaults to "True".

TriggeredByChildren

If True, when child control value set, activate parent default value logic. Defaults to "True"

Examples

Static Value

In the following example, the LabTest field will default to "PSA" and the LabQuality will default to "STD" when a value is entered for any field in the LabTest record.

   <LabTests RecordId="1">
       <LabDate></LabDate>
       <LabDateText></LabDateText>
       <LabTest NotNull="True" DefaultValue="PSA"></LabTest>
       <LabResult></LabResult>
       <LabUnits></LabUnits>
       <LabQuality DefaultValue="STD"></LabQuality>
   </LabTests>

Trigger Static Value

In the following example LabTest field gets populated with "PSA" and the LabQuality field get populated with "STD" when the user enters a chief complaint.

   <LabTests RecordId="1">
       <LabDate></LabDate>
       <LabDateText></LabDateText>
       <LabTest NotNull="True" DefaultSource="Encounters.EncChiefComplaint,1" DefaultValue="PSA"></LabTest>
       <LabResult></LabResult>
       <LabUnits></LabUnits>
       <LabQuality DefaultSource="Encounters.EncChiefComplaint,1"  DefaultValue="STD"></LabQuality>
   </LabTests>

Copy Dynamic Value (activate source)

In the following example, the LabTest date (LabDate) gets populated with the Encounter date (EncDate) when the user selected an Encounter date.

   <LabTests RecordId="1">
       <LabDate DefaultSource="Encounters.EncDate,1" ></LabDate>
       <LabDateText DefaultSource="Encounters.EncDateText,1" ></LabDateText>
       <LabTest NotNull="True"></LabTest>
       <LabResult></LabResult>
       <LabUnits></LabUnits>
       <LabQuality></LabQuality>
   </LabTests>

Copy Dynamic Value (activate sibling)

In the following example, the LabTest date (LabDate) gets populated with the Encounter date (EncDate) ONLY when a field in the LabTest record has a value.

   <LabTests RecordId="1">
       <LabDate DefaultSource="Encounters.EncDate,1" TriggeredBySiblings="True></LabDate>
       <LabDateText DefaultSource="Encounters.EncDateText,1" TriggeredBySiblings="True"></LabDateText>
       <LabTest NotNull="True"></LabTest>
       <LabResult></LabResult>
       <LabUnits></LabUnits>
       <LabQuality></LabQuality>
   </LabTests>
Personal tools