This allows for mapping of VistA FileMan files to Octo SQL tables. Mapping is supported by FileMan's SQLI utilities.
- YottaDB and Octo must be installed
Copy the _YDBOCTOVISTAM.m
routine into your routines directory.
The software has two modes of operation:
- Map all VistA files
- Map a selected VistA file
Both utilities require that you have a DUZ
set to allow modification of the SQLI Files for keywords and the SQLI mapping. The following examples can be copied and pasted; but you can adapt them if you already have a VistA symbol table properly set-up (e.g. by using ^XUP
).
To map all VistA FileMan Files run the following command:
YDB>S DUZ=.5,DIQUIET=1,DUZ(0)="@" D DT^DICRW,MAPALL^%YDBOCTOVISTAM("vista.sql")
This will create a file in the current directory named vista.sql
that can be used with Octo to generate a mapping between Octo/SQL and FileMan files. You can change the vista.sql
argument to another filename or complete file path if required.
MAPALL
takes an optional 2nd parameter by reference for options. A currently
supported option of ExternalDates
is to add an extra field after each Fileman
formatted date for that date presented in a ISO 8601 format, as in the
following example:
YDB>S DUZ=.5,DIQUIET=1,DUZ(0)="@",O("ExternalDates")=1 D DT^DICRW,MAPALL^%YDBOCTOVISTAM("vista_ext_dates.sql",.O)
To map a single VistA FileMan File run the following command (shown with File 200)
YDB>S DUZ=.5,DIQUIET=1,DUZ(0)="@",FileNumber=200 D DT^DICRW,MAPONE^%YDBOCTOVISTAM("vista"_FileNumber_".sql",FileNumber)
File or Subfile Number: (.11-9999999.9201): 200// <enter>
Done. See SQLI files for changes.
Error count: 0
This will create a file in the current directory named vista200.sql
that can
be used with Octo to generate a mapping between Octo/SQL and FileMan files. You
can change the vista200.sql
argument to another filename or complete file
path if required.
If you get a crash at SETOF+3^DMSQD
, this is caused by bad Fileman Data
Dictionaries sent in patch ECX*3.0*178
. See
https://gitlab.com/YottaDB/DBMS/YDBOctoVistA/-/issues/26 for how to fix this.
Contained in _YDBOCTOVISTAF.m
file. Copy to your routines directory to use
and then load _YDBOCTOVISTAF.sql
to define the functions in Octo. After that,
you should be able to embed the code in SQL.
Contains a number of functions written in M that serve as helpers to extend the SQL dialect for specific use cases as follows.
THIS FUNCTION IS NOW REMOVED AS IT IS AVAILABLE IN OCTO.
Returns today's date/time. Without any arguments, returns today's date in the $HOROLOG format. V: Fileman Format. S: US Format. M: $HOROLOG format.
To perform the same operations in Octo:
- V:
select timestamp_to_fileman(now()::timestamp);
- S:
select now()::date;
(outputs Octo default formatted date) - M:
select timestamp_to_horolog(now()::timestamp);
Formats datetime based on datetime type returns MM/DD/YYYY HH:MM:SS as default. Function Uses "5ZSP" for fileman dates unless formatcode is otherwise specified. If fileman date is detected function calls VA routine $$FMTE^XLFDT(value,format)
to format
Call $$FMADD^XLFDT to add/subtract date/time to produce another Fileman date. See https://hardhats.org/kernel/html/x-fmadd-xlfdt.html for more information.
Call $$FMDIFF^XLFDT to return the difference between two Fileman dates. See https://hardhats.org/kernel/html/x-fmdiff-xlfdt.html for more information.
Call $$NOW^XLFDT to return the current date/time in Fileman Format. Can be combined with other FM* date functions to calculate date differences.
Takes a passed field and replaces a null value with whatever is passes as the second argument
Return left x characters from value
Function returns the mumps equivalent of +value, numeric portion returned only
Function returns the position of the first occruence of search string in value
Function returns right x characters from value
THIS FUNCTION IS NOW REMOVED AS IT IS AVAILABLE IN OCTO.
Remapper for Mumps $Piece
function
VistA Fileman specific, uses VA Routine $$GET1^DIQ
to take foreign keys (up to 6) and fetch a field from the specified file