Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Info |  Source |  Call Graph |  Caller Graph |  Entry Points |  External References |  Interaction Calls |  FileMan Files Accessed Via FileMan Db Call |  Global Variables Directly Accessed |  Label References |  Naked Globals |  Local Variables  | All
Print Page as PDF
Routine: YTWJSONE

Package: Mental Health

Routine: YTWJSONE


Information

YTWJSONE ;SLC/KCM - Simple Editor for JSON Instrument Spec ; 7/20/2018

Source Information

Source file <YTWJSONE.m>

Call Graph

Call Graph

Call Graph Total: 9

Package Total Call Graph
Kernel 5 ($$FTG,$$GTF)^%ZISH  $$CRC32^XLFCRC  $$NOW^XLFDT  DECODE^XLFJSON  $$SHAHASH^XUSHSH  
VA FileMan 3 ^DIC  ^DIR  EN^DIWE  
Mental Health 1 FMUPD^YTXCHGU  

Caller Graph

Legends:

Legend of Colors

Package Component Superscript legend

action A extended action Ea event driver Ed subscriber Su protocol O limited protocol LP run routine RR broker B edit E server Se print P screenman SM inquire I

Caller Graph

Caller Graph Total: 1

Package Total Caller Graph
Mental Health 1 YTWJSONF  

Entry Points

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

External References

Name Field # of Occurrence
$$FTG^%ZISH LOAD+9
$$GTF^%ZISH FILE+9
^DIC LOOKUP+2
^DIR OKSAVE+2, EOP+2
EN^DIWE EDIT+5
$$CRC32^XLFCRC NVCRC+6, TSCRC+3
$$NOW^XLFDT SAVE712+3
DECODE^XLFJSON CHKJSON+5
$$SHAHASH^XUSHSH SHA1ALL+5
FMUPD^YTXCHGU SAVE712+6

Interaction Calls

Name Line Occurrences
Function Call: WRITE
  • Prompt: !,"Nothing changed"
  • Line Location: EN+10
Function Call: WRITE
  • Prompt: !,"Changes saved. Old Checksum: ",CRCOLD," New Checksum: ",CRCNEW
  • Line Location: EN+14
Function Call: WRITE
  • Prompt: !,"ERRORS found while parsing JSON document"
  • Line Location: CHKJSON+8
Function Call: WRITE
  • Prompt: !,?2,ERRORS(I)
  • Line Location: CHKJSON+9
Function Call: WRITE
  • Prompt: !!,"Returning to editor..."
  • Line Location: CHKJSON+10
Function Call: WRITE
  • Prompt: !,"Length: ",$L(X)," X=",!,X
  • Line Location: SHA1ALL+4
Function Call: WRITE
  • Prompt: !,$$SHAHASH^XUSHSH(160,X,"H")
  • Line Location: SHA1ALL+5
Function Call: WRITE
  • Prompt: !,"Missing entry in 601.71: ",TEST," ",^YTT(601.712,SPEC,1,1,0)
  • Line Location: VALIDATE+5
Function Call: WRITE
  • Prompt: !,$P(^YTT(601.71,+^YTT(601.712,SPEC,0),0),U)
  • Line Location: VALIDATE+6
Function Call: WRITE
  • Prompt: ?30,"ok"
  • Line Location: VALIDATE+10
Function Call: WRITE
  • Prompt: ?30,"Saved Checksum: ",CRCSAVED," Actual: ",CRCCALC
  • Line Location: VALIDATE+11
Function Call: WRITE
  • Prompt: " JSON errors"
  • Line Location: VALIDATE+12
Function Call: WRITE
  • Prompt: !,"Error writing file: "_NAME
  • Line Location: FILE+10
Function Call: WRITE
  • Prompt: !,"Error reading file: "_FILE
  • Line Location: LOAD+10
Function Call: WRITE
  • Prompt: !,"Nothing changed"
  • Line Location: LOAD+11
Function Call: WRITE
  • Prompt: !,TESTNM," entry spec saved. Old Checksum: ",CRCOLD," New Checksum: ",CRCNEW
  • Line Location: LOAD+15
Routine Call
  • DIC
  • Line Location:
    • LOOKUP+2
Routine Call
  • DIR
  • Line Location:
    • OKSAVE+2
    • EOP+2

FileMan Files Accessed Via FileMan Db Call

FileNo Call Tags
^YTT(601.712 - [#601.712] Classic Fileman Calls

Global Variables Directly Accessed

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

Label References

Name Line Occurrences
$$EOP EN+12
$$HASMODS EN+10, LOAD+11
$$JSONSTR NAMEVAL+13
$$LOOKUP EN+3
$$NVCRC CHKSPEC+11
CHKJSON CHKSPEC+9
CHKSPEC EN+11, VALIDATE+9, LOAD+13
EDIT EN+9
FIXLF CHKSPEC+8
NAMEVAL CHKSPEC+10
SAVE712 EN+13, LOAD+14

Naked Globals

Name Field # of Occurrence
^( FIXLF+4, SHA1ALL+3

Local Variables

Legend:

>> 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
Info |  Source |  Call Graph |  Caller Graph |  Entry Points |  External References |  Interaction Calls |  FileMan Files Accessed Via FileMan Db Call |  Global Variables Directly Accessed |  Label References |  Naked Globals |  Local Variables  | All