- BHLIQUI ; cmi/sitka/maw - BHL HL7 Immunization Query User Interface ;
- ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
- ;
- ;this routine will generate a standard query message based upon
- ;the selected criteria. The message type being generated will depend
- ;upon the type of query. We will try to use defined query messages
- ;for each query. (ie. VXQ/V01, etc)
- ;
- MAIN ;-- this is the main routine driver
- K INA
- D REG
- D PT Q:$D(DUOUT)!($D(DTOUT)) Q:Y<0
- D DTR Q:$D(DIRUT)
- D REC Q:$D(DIRUT)
- K DIC,DIR,Y
- S X=$S(BHLREG:"BHL SEND IMMUNIZATION QUERY REGISTRY",1:"BHL SEND IMMUNIZATION QUERY"),DIC=101 D EN^XQOR
- D EOJ
- Q
- ;
- REG ;-- ask if this is going to a registry or not
- S DIR(0)="Y"
- S DIR("A")="Query a State Registry: "
- D ^DIR
- Q:Y<1
- S BHLREG=1
- Q
- ;
- ;
- PT ;-- get the patient
- S DIC=9000001,DIC(0)="AEMQZ",DIC("A")="Select Patient for Query: "
- D ^DIC
- Q:$D(DUOUT)!($D(DTOUT))
- Q:Y<0
- S INA("QNM",+Y)=$$VAL^XBDIQ1(2,+Y,.01)
- S BHLQDA=+Y
- K DIC
- Q
- ;support for multiples maybe later
- W !
- S DIR(0)="Y"
- S DIR("A")="Would you like to select an additional patient: "
- D ^DIR
- Q:Y<1
- S BHLQMPT=1
- G PT
- Q
- ;
- DTR ;-- get the date ranges
- W !
- S DIR(0)="Y",DIR("A")="Would like to specify a date range "
- D ^DIR
- Q:$D(DIRUT)
- Q:Y<1
- K DIR,Y
- W !
- S %DT="AE",%DT("A")="Select beginning date: "
- D ^%DT
- Q:Y<0
- S INA("QBDT")=+Y
- W !
- K %DT,Y
- S %DT="AE",%DT("A")="Select ending date: "
- D ^%DT
- Q:Y<0
- S INA("QEDT")=+Y
- K %DT,Y
- Q
- ;
- REC ;-- limit the query to number of records
- K DIR,Y
- W !
- S DIR(0)="N",DIR("A")="Please enter the number of responses "
- D ^DIR
- Q:$D(DIRUT)
- Q:Y<1
- S INA("QTY")=+Y
- K DIR,Y
- Q
- ;
- EOJ ;-- kill variables
- K BHLREG,BHLQDT,BHLQDA
- Q
- ;
- BHLIQUI ; cmi/sitka/maw - BHL HL7 Immunization Query User Interface ;
- +1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
- +2 ;
- +3 ;this routine will generate a standard query message based upon
- +4 ;the selected criteria. The message type being generated will depend
- +5 ;upon the type of query. We will try to use defined query messages
- +6 ;for each query. (ie. VXQ/V01, etc)
- +7 ;
- MAIN ;-- this is the main routine driver
- +1 KILL INA
- +2 DO REG
- +3 DO PT
- IF $DATA(DUOUT)!($DATA(DTOUT))
- QUIT
- IF Y<0
- QUIT
- +4 DO DTR
- IF $DATA(DIRUT)
- QUIT
- +5 DO REC
- IF $DATA(DIRUT)
- QUIT
- +6 KILL DIC,DIR,Y
- +7 SET X=$SELECT(BHLREG:"BHL SEND IMMUNIZATION QUERY REGISTRY",1:"BHL SEND IMMUNIZATION QUERY")
- SET DIC=101
- DO EN^XQOR
- +8 DO EOJ
- +9 QUIT
- +10 ;
- REG ;-- ask if this is going to a registry or not
- +1 SET DIR(0)="Y"
- +2 SET DIR("A")="Query a State Registry: "
- +3 DO ^DIR
- +4 IF Y<1
- QUIT
- +5 SET BHLREG=1
- +6 QUIT
- +7 ;
- +8 ;
- PT ;-- get the patient
- +1 SET DIC=9000001
- SET DIC(0)="AEMQZ"
- SET DIC("A")="Select Patient for Query: "
- +2 DO ^DIC
- +3 IF $DATA(DUOUT)!($DATA(DTOUT))
- QUIT
- +4 IF Y<0
- QUIT
- +5 SET INA("QNM",+Y)=$$VAL^XBDIQ1(2,+Y,.01)
- +6 SET BHLQDA=+Y
- +7 KILL DIC
- +8 QUIT
- +9 ;support for multiples maybe later
- +10 WRITE !
- +11 SET DIR(0)="Y"
- +12 SET DIR("A")="Would you like to select an additional patient: "
- +13 DO ^DIR
- +14 IF Y<1
- QUIT
- +15 SET BHLQMPT=1
- +16 GOTO PT
- +17 QUIT
- +18 ;
- DTR ;-- get the date ranges
- +1 WRITE !
- +2 SET DIR(0)="Y"
- SET DIR("A")="Would like to specify a date range "
- +3 DO ^DIR
- +4 IF $DATA(DIRUT)
- QUIT
- +5 IF Y<1
- QUIT
- +6 KILL DIR,Y
- +7 WRITE !
- +8 SET %DT="AE"
- SET %DT("A")="Select beginning date: "
- +9 DO ^%DT
- +10 IF Y<0
- QUIT
- +11 SET INA("QBDT")=+Y
- +12 WRITE !
- +13 KILL %DT,Y
- +14 SET %DT="AE"
- SET %DT("A")="Select ending date: "
- +15 DO ^%DT
- +16 IF Y<0
- QUIT
- +17 SET INA("QEDT")=+Y
- +18 KILL %DT,Y
- +19 QUIT
- +20 ;
- REC ;-- limit the query to number of records
- +1 KILL DIR,Y
- +2 WRITE !
- +3 SET DIR(0)="N"
- SET DIR("A")="Please enter the number of responses "
- +4 DO ^DIR
- +5 IF $DATA(DIRUT)
- QUIT
- +6 IF Y<1
- QUIT
- +7 SET INA("QTY")=+Y
- +8 KILL DIR,Y
- +9 QUIT
- +10 ;
- EOJ ;-- kill variables
- +1 KILL BHLREG,BHLQDT,BHLQDA
- +2 QUIT
- +3 ;