| Contents: | Main | Chapter | See Also: | Getting Started Manual | Advanced User Manual | |||
| Reference Type | Category | ICR # |
|---|---|---|
| Supported | Database Server (DBS) | 2056 |
The $$GET1^DIQ extrinsic function retrieves data from a single field in a file.
Data can be retrieved from any field, including COMPUTED or WORD-PROCESSING fields, and fields specified using relational syntax. A basic call does not require that any local variables be present, and the symbol table is not changed by this utility. However, computed expressions can require certain variables be present and can change the symbol table, because the data retriever does execute Data Dictionary nodes.
The text for WORD-PROCESSING fields is returned in a target array. If data exists for WORD-PROCESSING fields, this function returns the resolved target_root; otherwise, NULL is returned.
$$GET1^DIQ(file,iens,field[,flags],target_root[,msg_root])
| file |
(Required) A file number or subfile number. |
|
| iens |
(Required) Standard Internal Entry Number String (IENS) indicating internal entry numbers. |
|
| field |
(Required) Any of the following:
|
|
| flags |
(Optional) Flags to control processing. The possible values are: |
|
| I | Internal format is returned. (The default is external.) | |
| Z | Zero node included for WORD-PROCESSING fields on target array. | |
| A# | Audit Trail is used to retrieve the value of "FIELD" at a particular point in time. # is a date/time in VA FileMan internal format (e.g., 3021015.8). The value retrieved is the (audited) value of the field as of that date/time. | |
| target_root |
(Required for WORD-PROCESSING fields only) The root of an array into which word-processing text is copied. |
|
| msg_root |
(Optional) Closed root into which the error message arrays are put. If this parameter is not passed, the arrays are put into nodes descendent from ^TMP. |
|
Figure 209 is an example of retrieving the value from the .01 field of record #1 in (fictitious) File #999000:
Figure 209: $$GET1^DIQ API—Example 1: Input and Output
>W $$GET1^DIQ(999000,"1,",.01) <Enter>
FMPATIENT,TWENTY
Figure 210 is an example of retrieving the internally-formatted value from the SEX field of Record #1 in (fictitious) File #999000:
Figure 210: $$GET1^DIQ API—Example 2: Input and Output
>S X=$$GET1^DIQ(999000,"1,","SEX","I") <Enter>
>W X
M
Use the SUBTYPE POINTER field in the DEVICE (#3.5) file to navigate to the TERMINAL TYPE (#3.2) file and retrieve the DESCRIPTION field as follows:
Figure 211: $$GET1^DIQ API—Example 3: Input and Output
>S X=$$GET1^DIQ(3.5,"55,","SUBTYPE:DESCRIPTION") <Enter>
>W X
WYSE 85
Figure 212 is an example of retrieving the contents of a WORD-PROCESSING field and storing the text in the target array, WP:
Figure 212: $$GET1^DIQ API—Example 4: Input and Output
>S X=$$GET1^DIQ(999000,"1,",12,"","WP") <Enter>
>ZW <Enter>
WP(1)=THIS WP LINE 1
WP(2)=WP LINE2
WP(3)=AND SO ON
X=WP
Retrieve the contents of a WORD-PROCESSING field, storing the text in the target array, WP. The format parameter Z means the target array is formatted like the nodes of a VA FileMan WORD-PROCESSING field. If no data exists, WP is equal to NULL as shown in Figure 213:
Figure 213: $$GET1^DIQ API—Example 5: Input and Output
>S WP=$$GET1^DIQ(999000,1,12,"Z","WP") ZW WP <Enter>
WP=WP
WP(1,0)=THIS WP LINE 1
WP(2,0)=WP LINE2
WP(3,0)=AND SO ON
Figure 214 is an example of retrieving data from a subfile. Here is a partial record entry, number 323, in ^DIZ(999000:
Figure 214: $$GET1^DIQ API—Example 6: Input and Output
^DIZ(999000,323...
.
.
^DIZ(999000,323,4,2,1,0) = ^999000.163^1^1
^DIZ(999000,323,4,2,1,1,0) = XXX2M3F.01^XXX2M3F1^XXX2M3F2
^DIZ(999000,323,4,2,1,"B","XXX2M3F.01",1) =
^DIZ(999000,323,4,"B","XXX1",1) =
^DIZ(999000,323,4,"B","XXX2",2) =
>S IENS="1,2,323," <Enter>
>W $$GET1^DIQ(999000.163,IENS,2) <Enter>
XXX2M3F2
Figure 215 retrieves the value of the .01 field of record #1 in (fictitious) File #999000 as of 1 January, 2000. Suppose that auditing has been turned on for that field, and that early in 2000, an incorrect spelling of "FMPATIENCE,TWENTY" had been corrected:
Figure 215: $$GET1^DIQ API—Example 7: Input and Output
>W $$GET1^DIQ(999000,"1,",.01,"A3000000") <Enter>
FMPATIENCE,TWENTY
Table 69 lists the possible error codes returned with the $$GET1^DIQ API:
Table 69: $$GET1^DIQ API—Error Codes Returned
| Code | Description |
|---|---|
| 200 | There is an error in one of the variables passed. |
| 202 | Missing or invalid input parameter. |
| 301 | Flags passed are unknown or incorrect. |
| 309 | Either the root of the Multiple or the necessary entry numbers are missing. |
| 348 | The passed value points to a file that does not exist or lacks a Header Node. |
| 401 | The specified file or subfile does not exist. |
| 403 | The file lacks a Header Node. |
| 404 | The file Header Node lacks a file #. |
| 501 | The field name or number does not exist. |
| 505 | The field name passed is ambiguous. |
| 510 | The data type for the specified field cannot be determined. |
| 520 | An incorrect kind of field is being processed. |
| 537 | Field has a corrupted pointer definition. |
| 601 | The entry does not exist. |
| 602 | The entry is not available for editing. |
| 603 | A specific entry in a specific file lacks a value for a required field. |
| 648 | The value points to a file that does not exist or lacks a Header Node. |
Reviewed/Updated: May 2026