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

GMRAPNA.m

Go to the documentation of this file.
  1. GMRAPNA ;HIRMFO/WAA-PATIENT NOT ASKED ABOUT ALLERGIES ;12/1/95 14:15
  1. ;;4.0;Adverse Reaction Tracking;**30,33**;Mar 29, 1996;Build 5
  1. EN1 ; Entry for LIST BY LOCATION OF UNDOCUMENTED ALLERGIES option
  1. D EN1^GMRACMR G:GMRAOUT EXIT
  1. D DEV
  1. D EXIT
  1. Q
  1. DEV ; *** Select output device, force queuing
  1. ;***** NOTE: CHECKS TO SEE IF VALID DEVICE IS SELECTED THEN ALL I HAVE TO DO IS RUN TASK MAN.
  1. S GMRAZIS="" S:GMRASEL'="1," GMRAZIS="Q"
  1. W !! D DEV^GMRAUTL I POP G EXIT
  1. I $D(IO("Q")) D G EXIT
  1. . K IO("Q")
  1. . S ZTRTN="ENTSK^GMRAPNA"
  1. . S ZTSAVE("GMRA*")="",ZTSAVE("^TMP($J,")=""
  1. . S ZTDESC="List of patients who have not been asked of allergies"
  1. . D ^%ZTLOAD
  1. . W !!,$S($D(ZTSK):"Request queued...",1:"Request NOT queued please try later...")
  1. . Q
  1. E D ENTSK
  1. Q
  1. ENTSK U IO
  1. D EN1^GMRACMR2,EN1^GMRACMR3
  1. S GMRAPAGE=0,X="NOW" D ^%DT S GMRAPDT=$$DATE^GMRAUTL1(Y)
  1. D PRINT
  1. G EXIT
  1. PRINT ;PRINT THE DATE
  1. D PRE
  1. S GMRAHLOC="" F S GMRAHLOC=$O(^TMP($J,"GMRAWC","C",GMRAHLOC)) Q:GMRAHLOC=""!(GMRAOUT) S GMRAX=0 F S GMRAX=$O(^(GMRAHLOC,GMRAX)) Q:GMRAX<1 D Q:GMRAOUT
  1. .S GMRA=$G(^TMP($J,"GMRAWC",GMRAX)),GMRACNT=0
  1. .I GMRA="" Q
  1. .D HEAD Q:GMRAOUT
  1. .W !!,?10,$S(GMRA="W":"WARD",GMRA="M":"MODULE",GMRA="C":"CLINIC",1:"UNKNOWN"),": ",$P(^SC(GMRAX,0),U)
  1. .S GMRADATE=0 F S GMRADATE=$O(^TMP($J,"GMRAWC",GMRAX,GMRADATE)) Q:GMRADATE="" S GMRADFN=0 Q:GMRAOUT F S GMRADFN=$O(^TMP($J,"GMRAWC",GMRAX,GMRADATE,GMRADFN)) Q:GMRADFN<1 D Q:GMRAOUT
  1. ..I '$D(^GMR(120.86,GMRADFN,0))
  1. ..E I +$P(^GMR(120.86,GMRADFN,0),U,4)<$G(GMRAED,9999999) Q
  1. ..Q:'$D(^DPT(GMRADFN,0))
  1. ..Q:$$DECEASED^GMRAFX(GMRADFN) ;GMRA*4*30 Prevent deceased patients from appearing on this report.
  1. ..Q:'$$PRDTST^GMRAUTL1(GMRADFN) ;GMRA*4*33 Exclude test patient from report if production or legacy environment.
  1. ..S GMRACNT=GMRACNT+1
  1. ..W !,$P(^DPT(GMRADFN,0),U) S DFN=GMRADFN,VAINDT=$S(GMRADATE="CURRENT":DT,1:GMRADATE) D 1^VADPT W ?30,VA("PID") W:GMRA'="C" ?45,$P(VAIN(2),U,2)
  1. ..I VAIN(5)'="" W !,?5,"Room/Bed: ",VAIN(5)
  1. ..D KVAR^VADPT K VA,DFN
  1. ..I $Y>(IOSL-4) D HEAD Q:GMRAOUT
  1. ..Q
  1. .D NOPAT
  1. .Q
  1. D CLOSE^GMRAUTL
  1. Q
  1. NOPAT ; If there are no patients print informational message
  1. Q:GMRACNT
  1. W !,?24,"* No Patients for this ",$S(GMRA="W":"Ward",GMRA="M":"Module",GMRA="C":"Clinic",1:"UNKNOWN")," *"
  1. W !
  1. Q
  1. S GMRAPAGE=GMRAPAGE+1,GMRATL="" I $E(IOST,1)="C",GMRAPAGE=1 W @IOF
  1. I $E(IOST,1)="C",GMRAPAGE'=1 D Q:GMRAOUT
  1. .S DIR(0)="E" D ^DIR I 'Y S GMRAOUT=1
  1. .K Y
  1. .Q
  1. I GMRAPAGE'=1 W @IOF
  1. W !,GMRAPDT,?23,"PATIENTS NOT ASKED ABOUT ALLERGIES",?70,"PAGE ",GMRAPAGE
  1. I GMRASEL["1" S GMRATL="CURRENT INPATIENTS"
  1. I GMRASEL["2" S GMRATL=$S(GMRATL="":"OUTPATIENTS",1:GMRATL_" / OUTPATIENTS")
  1. I GMRASEL["3" S GMRATL=$S(GMRATL="":"NEW ADMISSIONS",1:GMRATL_" / NEW ADMISSIONS")
  1. W !,?(40-($L(GMRATL)/2)),GMRATL
  1. I (GMRASEL["2"!(GMRASEL["3")) W !,?23,"FROM ",$$DATE^GMRAUTL1(GMRAST),?42,"TO ",$$DATE^GMRAUTL1(GMRAED)
  1. W !!,"PATIENT",?30,"SSN" W:GMRA'="C" ?45,"PROVIDER"
  1. W !,$$REPEAT^XLFSTR("-",78)
  1. I $D(ZTQUEUED) S:$$STPCK^GMRAUTL1 GMRAOUT=1 ; Check if stopped by user
  1. Q
  1. PRE ; This will validate the TMP global and fire off Xref
  1. N GMRAX,GMRAY,GMRAT1,GMRAT2,GMRAT3
  1. Q:'$D(^TMP($J,"GMRAWC"))
  1. S GMRAX=0 F S GMRAX=$O(^TMP($J,"GMRAWC",GMRAX)) Q:GMRAX<1 D
  1. .S GMRAY=^TMP($J,"GMRAWC",GMRAX)
  1. .S GMRAT1=$P($G(^SC(GMRAX,0)),U,2)
  1. .S GMRAT2=$P($G(^SC(GMRAX,0)),U)
  1. .S GMRAT3=$S(GMRAT1'="":GMRAT1,1:GMRAT2)
  1. .S ^TMP($J,"GMRAWC","C",GMRAT3,GMRAX)=""
  1. .Q
  1. Q
  1. EXIT ;
  1. K ^TMP($J,"GMRAWC")
  1. D KILL^XUSCLEAN
  1. Q