Skip to content

Instantly share code, notes, and snippets.

@shabiel
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save shabiel/89063ff0ce9b1fee14bb to your computer and use it in GitHub Desktop.

Select an option

Save shabiel/89063ff0ce9b1fee14bb to your computer and use it in GitHub Desktop.
taskman sample
; This code is public domain.
VISTA ; [Internal Only] EP Print VISTA Health Summary
; ZEXCEPT: BIDFN (This is for the Eclipse editor parser checking that we don't have leaking variables)
; Use IA 242
; IA = Integration Agreement. VISTA's poor way of deciding which API's are public, protected, or private
; http://foia-vista.osehra.org/VistA_Integration_Agreement/
;
; Here is what it says:
; NUMBER: 242 IA #: 242
; DATE CREATED: JUN 15, 1993 CUSTODIAL PACKAGE: HEALTH SUMMARY
; CUSTODIAL ISC: Salt Lake City USAGE: Private
; TYPE: Routine DBIC APPROVAL STATUS: APPROVED
; ROUTINE: GMTSDVR NAME: DBIA242-A
; ORIGINAL NUMBER: 242 ID: GMTSDVR
; GENERAL DESCRIPTION: PIMS (MAS) users often have a need to print a Health
; Summary after printing the 10-10. PIMS, therefore, is given permission for a
; database integration agreement with Health Summary to allow PIMS to call the
; line tag ENXQ^GMTSDVR. This call allows tasked or non-tasked Health Summary
; printout. Prior to the call, the following two variables will be defined:
; STATUS: Active DURATION: Till Otherwise Agreed
; COMPONENT/ENTRY POINT: ENXQ
; VARIABLES: DFN TYPE: Input
; VARIABLES DESCRIPTION: (the internal entry number for the Patient File)
; VARIABLES: GMTSTYP TYPE: Input
; VARIABLES DESCRIPTION: (the internal entry number for the desired Health
; Summary type)
; SUBSCRIBING PACKAGE: REGISTRATION ISC: Albany
;
;
; I will put the links for each of the APIs I invoke below.
;
; DIC: http://www.hardhats.org/fileman/pm/cl_dic.htm
N DIC,X,Y,DLAYGO,DINUM,DTOUT,DUOUT
S DIC=142,DIC(0)="AEMQ" D ^DIC ; Select Health Summary type
I $G(DTOUT)!$G(DUOUT) QUIT
N TYP S TYP=+Y
;
; %ZIS: http://hardhats.org/kernel/html/zis.shtml
N %ZIS S %ZIS="Q" ; queueing allowed
D ^%ZIS
Q:$G(POP)
;
; Taskman ^%ZTLOAD: http://hardhats.org/kernel/html/ztload.shtml
I $D(IO("Q")) D ; queueing requested
. N ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTUCI,ZTCPU,ZTPRI,ZTSAVE,ZTKIL,ZTSYNC,ZTSK
. S ZTRTN="ENX^GMTSDVR(BIDFN,TYP)",ZTDTH=$H,ZTDESC="Health Summary from Immunizations Package"
. S ZTSAVE("BIDFN")="",ZTSAVE("TYP")=""
. D ^%ZTLOAD
. I $G(ZTSK) W "Printing off as task number "_ZTSK_" ."
. E W "Couldn't task this. Please call support."
. ;
. ; DIR: http://www.hardhats.org/fileman/pm/cl_dir.htm
. N DIR,X,Y,DA,DTOUT,DUOUT,DIRUT,DIROUT
. S DIR(0)="E" D ^DIR
;
E D ; no queueing. Print in process.
. U IO
. D ENX^GMTSDVR(BIDFN,TYP)
;
D ^%ZISC ; close device in either case
QUIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment