Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: INHMG

INHMG.m

Go to the documentation of this file.
  1. INHMG ;KN; 24 May 99 13:41; Script Generator Message
  1. ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. ;
  1. ; MODULE NAME: Script Generator Message (INHMG)
  1. ;
  1. ; PURPOSE:
  1. ; The purpose of the Script Generator Message Module (INHMG)
  1. ; is to accept user input of script generator message,get
  1. ; user's option of displaying common segments, set up the
  1. ; the output device, and call module INHMG1 for processing
  1. ; and display/print the Script Generator Message.
  1. ;
  1. ; DESCRIPTION:
  1. ; The processing of this routine will ask user for a script
  1. ; generator message. The Module INHMG will prompt the user
  1. ; for option to display the common segments ( MSH and PID ).
  1. ; After accepting the user input, this module will set up
  1. ; the output device, set up the tasking logic, build DXS array,
  1. ; then call module INMHMG1 to process a listing for the Script
  1. ; Generator Message selected.
  1. ;
  1. ; Return: None
  1. ; Parameters:
  1. ; None
  1. ;
  1. ; Code begins:
  1. EN ; Main entry point for the Script Generator Message
  1. ;
  1. N %ZIS,A,EXIT,HDR,INPAGE,X,ZTDESC,ZTIO,ZTRTN,ZTSAVE,DXS
  1. ;
  1. ENUSE ; User input
  1. ;
  1. ; Description: The ENUSE entry point is used for accepting
  1. ; user's input message. Also the user will be
  1. ; prompted for the option to print the common
  1. ; segments.
  1. ;
  1. ; Return: None
  1. ; Parameters: None
  1. ;
  1. ; Code begins:
  1. ; Prompt for message and look up the internal entry number
  1. S DIWF="",DIC="^INTHL7M(",DIC(0)="AEQ",DIC("A")="PLEASE SELECT SCRIPT GENERATOR MESSAGE : "
  1. D ^DIC
  1. I ($G(Y)<0)!($G(DUOUT)) Q
  1. ;Save message name and parameters for look up
  1. S INAM=$P($G(Y),U,2),D0=+Y,D1=0
  1. ;Prompt for display of common segments option and validate input
  1. S INCOMSEG=$$YN^UTSRD("Do you wish to print the COMMON SEGMENTS (MSH and PID) <Y/N> ")
  1. ;Device handling & Tasking logic
  1. K IOP S %ZIS("A")="QUEUE ON DEVICE: ",%ZIS("B")="",%ZIS="NQ" D ^%ZIS G:POP QUIT
  1. S IOP=ION_";"_IOST_";"_IOM_";"_IOSL
  1. I IO=IO(0) S %ZIS="" D ^%ZIS I POP W *7,!,"Sorry, unable to find device..." G QUIT
  1. I IO'=IO(0) S ZTDESC="Description of job",ZTIO=IOP,ZTRTN="ENQUE^INHMG" D G QUIT
  1. .F X="U","IO*","D*","HDR(","INAM","INDT","INPAGE","INCOMSEG" S ZTSAVE(X)=""
  1. .D ^%ZTLOAD
  1. ENQUE ; Taskman entry point
  1. ;
  1. ; Description: ENQUE is the entry point for Taskman. It will call
  1. ; module INHMG1 for the script generator message
  1. ; processing.
  1. ;
  1. ; Return: None
  1. ; Parameter: None
  1. ;
  1. ; Code begins:
  1. S INPAGE=0,EXIT=0
  1. W @IOF D HSET,HEADER
  1. D INBUILD^INHMG1(INCOMSEG)
  1. G QUIT
  1. ;
  1. ;
  1. ; Description: The function HEADER is used to display header when
  1. ; reaching the end of page/screen, and give user the
  1. ; option to continue or to abort.
  1. ;
  1. ;
  1. ; Input:
  1. ; INPAGE - page number
  1. ; HDR - array containing header lines of the report
  1. ; INNOOUT- if 1 means do not allow the user to abort
  1. ; Output:
  1. ; DUOUT - if 1 means user wants to abort
  1. ;
  1. ; Code begins:
  1. N INA,I,X,Y
  1. ; Check for end of page/screen and give option to continue or quit
  1. I ($P(IOST,"-")["C")&('$D(IO("Q")))&(IO=IO(0))&(INPAGE>0) Q:$G(DUOUT) D
  1. .I $Y<(IOSL-3) D
  1. ..F X=$Y:1:(IOSL-4) W !
  1. .I $G(INNOOUT) W ! D ^UTSRD("Press <RETURN> to continue;;;;;;;0;;;;DTIME;;X","","",1)
  1. .E W ! D ^UTSRD("Press <RETURN> to continue or ^ to quit;;;;;;;0;;;;DTIME;;X","","",1) S:(X=1)!(X=2) DUOUT=1
  1. Q:$G(DUOUT)
  1. ; Display new page and header
  1. S INPAGE=INPAGE+1 W @IOF
  1. S INA=0 F S INA=$O(HDR(INA)) Q:'INA U IO W !,@HDR(INA)
  1. Q
  1. ;
  1. HSET ; set up header
  1. ;
  1. ; Description: The function HSET is used to set up the header with
  1. ; the current page and current date/time.
  1. ;
  1. ; Return: None
  1. ; Parameters: None
  1. ;
  1. ; Code Begins:
  1. D NOW^%DTC S Y=$J(%,12,4) D DD^%DT S INDT=Y
  1. S HDR(1)="""SCRIPT GENERATOR MESSAGE LISTING"",?(IOM-30),INDT,?(IOM-10),""PAGE: "",INPAGE"
  1. S HDR(2)="""Message: "",INAM"
  1. S HDR(3)="",$P(HDR(3),"-",IOM-1)="",HDR(3)=""""_HDR(3)_""",!"
  1. Q
  1. ;
  1. INDXS ; Build array DXS
  1. ; Description: The function INDXS is used to build the DXS array of
  1. ; the MUMPS code to support for the INHMG, INHMG1 and
  1. ; INHMG2 modules. The MUMPS code will be used to search
  1. ; the following globals ^INTHL7M, ^INTHL7S, ^INTHL7F
  1. ; for the segments, and fields of the selected Script
  1. ; Generator Message.
  1. ;
  1. ; Return: None
  1. ; Parameter:
  1. ;
  1. ; Code begins:
  1. K DXS
  1. ; Get the segment name
  1. S DXS(2,9.2)="S I(1,0)=$G(D1),I(0,0)=$G(D0),DIP(1)=$G(^INTHL7M(D0,1,D1,0)),D0=$P(DIP(1),U) S:'$D(^INTHL7S(+D0,0)) D0=-1 S DIP(101)=$G(^INTHL7S(D0,0)) S X=$P(DIP(101),U,2) S D0=I(0,0)"
  1. ; Used as look up table for display purpose ( int val - ext val )
  1. ; Yes or No
  1. S DXS(18,0)="NO"
  1. S DXS(18,1)="YES"
  1. ; Processing ID
  1. S DXS(19,"D")="DEBUG"
  1. S DXS(19,"P")="PRODUCTION"
  1. S DXS(19,"T")="TRAINING"
  1. ; Look Up Parameter
  1. S DXS(20,"F")="FORCED LAYGO"
  1. S DXS(20,"L")="LAYGO ALLOWED"
  1. S DXS(20,"N")="NO LAYGO"
  1. S DXS(20,"O")="LOOKUP ONLY"
  1. S DXS(20,"P")="PARSE ONLY"
  1. ; Accept Acknowledge
  1. S DXS(21,"AL")="ALWAYS"
  1. S DXS(21,"ER")="ERROR/REJECT"
  1. S DXS(21,"NE")="NEVER"
  1. S DXS(21,"SU")="SUCCESS ONLY"
  1. ; Application Ack
  1. S DXS(22,"AL")="ALWAYS"
  1. S DXS(22,"ER")="ERROR/REJECT"
  1. S DXS(22,"NE")="NEVER"
  1. S DXS(22,"SU")="SUCCESS ONLY"
  1. Q
  1. ;
  1. QUIT ;exit module
  1. ;
  1. ; Description: The function QUIT is used to close the ouput
  1. ; device, reset IO variables back to the home
  1. ; device and exit the module.
  1. ;
  1. ; Return: None
  1. ; Parameters: None
  1. ;
  1. ; Code Begins:
  1. ;
  1. D ^%ZISC K IO("Q"),IOP,POP
  1. Q