HMPDJFSG ;SLC/KCM,ASMR/RRB,CPC,JD,ASF,CK -- GET for Extract and Freshness Stream;Aug 11, 2016 10:35:07
Source file <HMPDJFSG.m>
| Name | Comments | DBIA/ICR reference | 
|---|---|---|
| GETSUB(HMPFRSP,ARGS) | ; retrieve items from stream
 ; GET from: /hmp/subscription/{hmpSrvId}/{last}?limit={limit} ; ARGS("last") : date-seq of last item retrieved (ex. 3131206-27) ; ARGS("max") : maximum number of items to return (default 99999) *S68-JCH* ; ARGS("maxSize"): approximate number bytes to return *S68-JCH*  | 
|
| DOMITMS | ;loop thru extract items, OFFSET is last sent
 | 
|
| MIDXTRCT() | ; Return true if mid-extract
 | 
|
| NXTSTRM | ; Reset variables for next date in this HMP stream
 ; from GETSUB expects HMPFSTRM,HMPFDT,HMPFIDX ; HMPFSTRM set to "" if no next stream ; HMPFIDX set to 0 if next stream, or left as is ; HMPFDT set to last date actually used  | 
|
| SETLIMIT(ARGS) | ; sets HMPFLIM, HMPFMAX, HMPFSIZE variables  *BEGIN*S68-JCH*
 | 
|
| INCITEM(DOMAIN) | ; increment counters as item added *BEGIN*S68-JCH*
 | 
|
| FINISH(HMPDEL,HMPERR) | ;reset the FIRST object delimiter, add header and tail
 ; expects HMPFCNT,HMPFDT,HMPFSEQ,HMPFHMP,HMPFLAST  | 
|
| TIDYX(STREAM,SEQ) | ; clean up extracts after they have been retrieved
 ; from FINISH  | 
|
| SYNCCMD(SEQNODE) | ; Build syncCommand object and stick in ^TMP
 ; expects: HMPSYS, HMPFCNT  | 
|
| SYNCSTRT(SEQNODE) | ;Build syncStart object with demograhics
 | 
|
| SYNCDONE(SEQNODE) | ; Build syncStatus object and stick in ^TMP
 | 
|
| SYNCMETA(SNODE) | ;US11019 Build NEW syncStart object
 | 
|
| SYNCERR(SNODE,HMPERR) | ;
 | 
|
| FRESHITM(SEQNODE,DELETE,ERROR) | ;Get freshness item and stick in ^TMP
 ; expects HMPFSYS, HMPFHMP  | 
|
| BLDSERR(DFN,ERROR) | ;Create syncError object in ERRJSON
 | 
|
| WRAPPER(DOMAIN,PIDS,OFFSET,DOMSIZE,FROMXTR) | ;return JSON wrapper for each item *S68-JCH*
 | 
|
| APIHDR(COUNT,LASTITM) | ;return JSON
 | 
|
| NOOP(LASTITM) | ;No-op, don't return any items
 | 
|
| VERMATCH(HMPIEN,VERSION) | ;true if middle tier HMP and VistA version match
 | 
|
| LASTUPD(HMPSRV,LASTUPD) | ;save the last update
 ; TODO: change this to use Fileman call  | 
|
| JSONOUT | ;Write out JSON in ^TMP
 | 
| Name | Line Occurrences | 
|---|---|
| Function Call: WRITE | 
  |