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

SDPPENR1.m

Go to the documentation of this file.
  1. SDPPENR1 ;ALB/CAW - Patient Profile - Enrollments ; 5/13/92
  1. ;;5.3;Scheduling;**6,140**;Aug 13, 1993
  1. ;
  1. ;
  1. EN1 ; Enrollments
  1. N SD,SD1,SDCL,SDEN,SDFLN,SDOPT,SDSTAT,SDSTART,SDSTOP
  1. S SD=0,SDFST=9,SDSEC=53,SDFLN=7,SDLEN=28,$P(SDASH,"-",IOM+1)="",SDSTART=$S($D(SDBEG):SDBEG,1:SDBD),SDSTOP=$S($D(SDEND):SDEND,1:SDED)
  1. F S SD=$O(^DPT(DFN,"DE",SD)) Q:'SD S SD1=0,SDCL=$G(^(SD,0)) F S SD1=$O(^DPT(DFN,"DE",SD,1,SD1)) Q:'SD1 S SDEN=$G(^(SD1,0)) D CHECKS
  1. S SD=-9999999.99 F S SD=$O(^TMP("SDENR",$J,SD)) Q:'SD S SD1=0 F S SD1=$O(^TMP("SDENR",$J,SD,SD1)) Q:'SD1 S SDCL=^(SD1,0),SDEN=^(1),SDDT=$E(SD,2,999) D INFO
  1. K ^TMP("SDENR",$J) Q
  1. ;
  1. CHECKS ; Checks
  1. ; Check for specified clinic
  1. I $D(SDY),SDY'=+SDCL Q
  1. ; Add all active enrollments if printing regardless of date range
  1. I SDPRINT,$P(SDEN,U,3)="" D CHKSET
  1. ; Check for active enrollments
  1. I SDACT,$P(SDEN,U,3)'="" Q
  1. ; Check for date range
  1. I +SDEN>SDSTOP!(+SDEN<SDSTART) Q
  1. ; Otherwise file info
  1. CHKSET S ^TMP("SDENR",$J,-$P(SDEN,U),SD1,0)=SDCL,^(1)=SDEN
  1. Q
  1. INFO ;
  1. ;
  1. CLINIC ; Enrollment Clinic and Enrollment Date
  1. S X="",X=$$SETSTR^VALM1("Clinic:",X,1,SDFLN)
  1. S X=$$SETSTR^VALM1($P($G(^SC(+SDCL,0)),U),X,SDFST,SDLEN)
  1. S X=$$SETSTR^VALM1("Enroll. Date:",X,39,13)
  1. S X=$$SETSTR^VALM1($TR($$FMTE^XLFDT(+SDEN,"5DF")," ","0"),X,SDSEC,SDLEN)
  1. D SET(X)
  1. STATUS ; Current Status and Enrollement Discharge Date
  1. S X="",X=$$SETSTR^VALM1("Status:",X,1,SDFLN)
  1. S SDSTAT=$S($P(SDEN,U,3)="":"ACTIVE",1:"INACTIVE")
  1. S X=$$SETSTR^VALM1(SDSTAT,X,SDFST,SDLEN)
  1. I $P(SDEN,U,3)'="" D
  1. .S X=$$SETSTR^VALM1("Disch. Date:",X,40,12)
  1. .S X=$$SETSTR^VALM1($$FDATE^VALM1($P(SDEN,U,3)),X,SDSEC,SDLEN)
  1. D SET(X)
  1. OPT ; OPT or AC and Review Date
  1. S X="",X=$$SETSTR^VALM1("OPT/AC:",X,1,SDFLN)
  1. S SDOPT=$S($P(SDEN,U,2)="O":"OPT",$P(SDEN,U,2)="A":"AC",1:"UNKNOWN")
  1. S X=$$SETSTR^VALM1(SDOPT,X,SDFST,SDLEN)
  1. I $P(SDEN,U,5)'="" D
  1. .S X=$$SETSTR^VALM1("Review Date:",X,40,12)
  1. .S X=$$SETSTR^VALM1($$FDATE^VALM1($P(SDEN,U,5)),X,SDSEC,SDLEN)
  1. D SET(X)
  1. REASON ; Reason for Discharge
  1. I $P(SDEN,U,4)'="" D
  1. .S X="",X=$$SETSTR^VALM1("Reason:",X,1,SDFLN)
  1. .S X=$$SETSTR^VALM1($P(SDEN,U,4),X,SDFST,70)
  1. .D SET(X)
  1. D SET("")
  1. Q
  1. SET(X) ; Set in ^TMP global for display
  1. ;
  1. S SDLN=SDLN+1,^TMP("SDPPALL",$J,SDLN,0)=X
  1. Q