YTWJSONE ;SLC/KCM - Simple Editor for JSON Instrument Spec ; 7/20/2018
Source file <YTWJSONE.m>
action | A | extended action | Ea | event driver | Ed | subscriber | Su | protocol | O | limited protocol | LP | run routine | RR | broker | B | edit | E | server | Se | P | screenman | SM | inquire | I |
Package | Total | Caller Graph |
---|---|---|
Mental Health | 1 | YTWJSONF |
Name | Comments | DBIA/ICR reference |
---|---|---|
EN | ; edit instrument Entry Specification
|
|
LOOKUP() | ; return 601.712 IEN for selected instrument
|
|
EDIT(TESTNM) | ; edit copy of document in ^TMP("YTQ-EDIT",$J,
|
|
HASMODS(SPEC) | ; return 1 if edited version differs from 601.712
|
|
OKSAVE() | ; return 1 if OK to save changes
|
|
EOP() | ; return 1 if continue, 0 if exit
|
|
CHKSPEC(SRC,ERRS,CRC) | ; parses JSON and calculates checksum
; .ERRS: returns 1 if JSON parses without errors ; .CRC: returns checksum |
|
FIXLF(SRC,DEST) | ; Load spec from SRC, cleaning up line feeds
; SPEC: reference to global with original JSON ; DEST: reference to global root for destination JSON |
|
CHKJSON(JSON,TREE,ERRS) | ; decode JSON and display any errors
; JSON: reference to JSON global ; TREE: reference to TREE global ; .ERRORS: return errors found or 0 |
|
NAMEVAL(TREE,LIST) | ; Convert TREE to external object name/value list in LIST
; TREE: reference to global containing documents tree structure ; LIST: reference to global where @LIST@(name)=value will be saved ; NOTE -- resulting names will collate as string, so the order may be odd ; for example, obj[1], obj[10], obj[11], obj[2], etc. |
|
JSONSTR(X) | ; return 1 if should be treated as a string
|
|
NVCRC(LIST) | ; return CRC32 for LIST(name)=value
; LIST: reference to global containing @LIST@(name)=value pairs |
|
TSCRC() | ; return CRC32 of all checksums for active instruments
|
|
SHA1ALL() | ; return SHA-1 of all checksums for active instruments
|
|
SAVE712(IEN,CRC) | ; save updated specification to 601.712
; expects ^TMP("YTQ-EDIT,$J,n,0) to be entry spec text |
|
VALIDATE | ; compare CRC with actual and check JSON structure
|
|
FILE(TEST,PATH) | ; write JSON from 601.712 to host file in PATH
|
|
LOAD(TEST,PATH) | ; read host file in PATH and load into 601.712
|
Name | Line Occurrences |
---|---|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Function Call: WRITE |
|
Routine Call |
|
Routine Call |
|
FileNo | Call Tags |
---|---|
^YTT(601.712 - [#601.712] | Classic Fileman Calls |
Name | Line Occurrences (* Changed, ! Killed) |
---|---|
^TMP("YTQ-EDIT" | EN+1!, EN+6*, EN+11, EN+15!, HASMODS+5, SAVE712+5, LOAD+8!, LOAD+9, LOAD+13, LOAD+16! |
^TMP("YTQ-JSON" | CHKSPEC+3!, CHKSPEC+5, CHKSPEC+12! |
^TMP("YTQ-LIST" | CHKSPEC+3!, CHKSPEC+7, CHKSPEC+12! |
^TMP("YTQ-TREE" | CHKSPEC+3!, CHKSPEC+6, CHKSPEC+12! |
^TMP($J | FILE+6!, FILE+7*, FILE+8!, FILE+9, FILE+11! |
^YTT(601.71 - [#601.71] | EN+4, VALIDATE+4, VALIDATE+6, FILE+2, FILE+4, LOAD+2, LOAD+3 |
^YTT(601.712 - [#601.712] | EN+4, EN+5, EN+6, HASMODS+3, HASMODS+4, TSCRC+2, TSCRC+3, SHA1ALL+3, VALIDATE+2, VALIDATE+3 , VALIDATE+5, VALIDATE+6, VALIDATE+8, VALIDATE+9, FILE+3, FILE+7, LOAD+4, LOAD+6 |
Name | Field # of Occurrence |
---|---|
^( | FIXLF+4, SHA1ALL+3 |
>> | Not killed explicitly |
* | Changed |
! | Killed |
~ | Newed |
Name | Field # of Occurrence |
---|---|
ADDQ | NAMEVAL+5~, NAMEVAL+13*, NAMEVAL+14*, NAMEVAL+15*, NAMEVAL+16 |
CHANGES | HASMODS+1~, HASMODS+2*, HASMODS+3, HASMODS+6*, HASMODS+7 |
CRC | CHKSPEC~, CHKSPEC+9*, CHKSPEC+11*, NVCRC+2~, NVCRC+3*, NVCRC+6*, NVCRC+7, TSCRC+1~, TSCRC+2*, TSCRC+3* , TSCRC+4, SAVE712~, SAVE712+4 |
CRCCALC | VALIDATE+7~, VALIDATE+9, VALIDATE+10, VALIDATE+11 |
CRCNEW | EN+2~, EN+11, EN+13, EN+14, LOAD+1~, LOAD+13, LOAD+14, LOAD+15 |
CRCOLD | EN+2~, EN+5*, EN+14, LOAD+1~, LOAD+6*, LOAD+15 |
CRCSAVED | VALIDATE+7~, VALIDATE+8*, VALIDATE+10, VALIDATE+11 |
DDWAUTO | EDIT+1~, EDIT+2* |
DDWFLAGS | EDIT+1~, EDIT+2* |
DEST | FIXLF~, FIXLF+5, FIXLF+9 |
DIC | LOOKUP+1~, LOOKUP+2*, EDIT+1~, EDIT+3* |
DIC(0 | LOOKUP+2* |
DIR | OKSAVE+1~, EOP+1~ |
DIR("A" | OKSAVE+2* |
DIR("B" | OKSAVE+2* |
DIR(0 | OKSAVE+2*, EOP+2* |
DIROUT | OKSAVE+1~, EOP+1~ |
DIRUT | OKSAVE+1~, EOP+1~ |
DIWESUB | EDIT+1~, EDIT+4* |
DIWETXT | EDIT+1~, EDIT+4* |
DONE | EN+2~, EN+7*, EN+8*, EN+12* |
DTOUT | OKSAVE+1~, EOP+1~ |
DUOUT | OKSAVE+1~, EOP+1~ |
DWLW | EDIT+1~, EDIT+4* |
DWPK | EDIT+1~, EDIT+4* |
EDIT | HASMODS+1~, HASMODS+5*, HASMODS+6 |
ERRORS | CHKJSON+4~ |
ERRORS( | CHKJSON+9 |
ERRORS(0 | CHKJSON+6, CHKJSON+7 |
ERRS | EN+2~, EN+8!, EN+11, EN+12, CHKSPEC~, CHKSPEC+9, CHKJSON~, CHKJSON+7*, VALIDATE+7~, VALIDATE+9 , VALIDATE+10, VALIDATE+12, LOAD+1~, LOAD+13 |
FILE | LOAD+1~, LOAD+5*, LOAD+9, LOAD+10 |
I | HASMODS+1~, HASMODS+3*, HASMODS+4, HASMODS+5, FIXLF+3~, FIXLF+4*, FIXLF+7*, FIXLF+8, CHKJSON+9~*, NAMEVAL+5~ , NAMEVAL+11* |
IEN | TSCRC+1~, TSCRC+2*, TSCRC+3, SHA1ALL+1~, SHA1ALL+3*, SAVE712~, SAVE712+6, FILE+1~, FILE+3*, FILE+7 |
J | FIXLF+3~, FIXLF+4*, FIXLF+5*, FIXLF+9 |
JSON | CHKSPEC+4~, CHKSPEC+5*, CHKSPEC+8, CHKSPEC+9, CHKJSON~, CHKJSON+5 |
LIST | CHKSPEC+4~, CHKSPEC+7*, CHKSPEC+10, CHKSPEC+11, NAMEVAL~, NAMEVAL+16, NVCRC~, NVCRC+4, NVCRC+5 |
LROOT | NAMEVAL+5~, NAMEVAL+6*, NAMEVAL+8 |
NAME | FILE+1~, FILE+4*, FILE+9, FILE+10 |
NM | NAMEVAL+5~, NAMEVAL+9*, NAMEVAL+11*, NAMEVAL+16 |
OK | FILE+1~, FILE+9*, FILE+10, LOAD+1~, LOAD+9*, LOAD+10 |
ORIG | HASMODS+1~, HASMODS+4*, HASMODS+6 |
PATH | FILE~, FILE+9, LOAD~, LOAD+9 |
REC | SAVE712+2~, SAVE712+6 |
REC( | SAVE712+3*, SAVE712+4* |
REC(1 | SAVE712+5* |
ROOT | NAMEVAL+5~, NAMEVAL+6*, NAMEVAL+8 |
S | NAMEVAL+5~, NAMEVAL+11* |
SB | NAMEVAL+5~, NAMEVAL+7*, NAMEVAL+11 |
SL | NAMEVAL+5~, NAMEVAL+9*, NAMEVAL+11 |
SPEC | EN+2~, EN+3*, EN+4, EN+5, EN+6, EN+10, EN+13, HASMODS~, HASMODS+3, HASMODS+4 , VALIDATE+1~, VALIDATE+2*, VALIDATE+3, VALIDATE+5, VALIDATE+6, VALIDATE+8, VALIDATE+9, LOAD+1~, LOAD+4*, LOAD+6 , LOAD+11, LOAD+14 |
SRC | CHKSPEC~, CHKSPEC+8, FIXLF~, FIXLF+4, FIXLF+7, FIXLF+8 |
STR | NVCRC+2~, NVCRC+5*, NVCRC+6 |
TEST | VALIDATE+1~, VALIDATE+3*, VALIDATE+4, VALIDATE+5, FILE~, FILE+2*, FILE+3, FILE+4, LOAD~, LOAD+2* , LOAD+3, LOAD+4 |
TESTNM | EN+2~, EN+4*, EN+9, EDIT~, EDIT+4, LOAD+1~, LOAD+3*, LOAD+5, LOAD+15 |
TREE | CHKSPEC+4~, CHKSPEC+6*, CHKSPEC+9, CHKSPEC+10, CHKJSON~, CHKJSON+5, NAMEVAL~, NAMEVAL+6, NAMEVAL+7 |
U | EN+4, EN+5, TSCRC+3, SHA1ALL+3, VALIDATE+3, VALIDATE+6, VALIDATE+8, FILE+4, LOAD+3, LOAD+6 |
VAL | NAMEVAL+5~, NAMEVAL+12*, NAMEVAL+13, NAMEVAL+16 |
X | LOOKUP+1~, OKSAVE+1~, EOP+1~, FIXLF+3~, FIXLF+4*, FIXLF+5, FIXLF+6, NAMEVAL+5~, NAMEVAL+7*, NAMEVAL+8* , NAMEVAL+9, NAMEVAL+10, NAMEVAL+11, NAMEVAL+12, NAMEVAL+14, NAMEVAL+15, JSONSTR~, JSONSTR+1, JSONSTR+2, JSONSTR+3 , JSONSTR+4, NVCRC+2~, NVCRC+4*, NVCRC+5, TSCRC+1~, SHA1ALL+1~, SHA1ALL+2*, SHA1ALL+3*, SHA1ALL+4, SHA1ALL+5 |
Y | LOOKUP+1~, LOOKUP+3, OKSAVE+1~, OKSAVE+3, EOP+1~, EOP+3, FIXLF+3~, FIXLF+7, FIXLF+8*, FIXLF+9 |