DGRP4 ;ALB/MRL,ARF - REGISTRATION SCREEN 4/EMPLOYMENT INFORMATION ;06 JUN 88@2300
;;5.3;Registration;**624,867,1121**;Aug 13, 1993;Build 14
;
N DGMRD
D NEWB ;determine newborn status before building local array
S DGRPS=4 D H^DGRPU S DGRPW=1 F I=0,.311,.25 S DGRP(I)=$S($D(^DPT(DFN,I)):^(I),1:"")
;S X=$P($G(^DIC(11,+$P(DGRP(0),"^",5),0)),"^",3) S DGMRD=$S("^M^S^"[("^"_X_"^"):1,1:0),DGRPVV(4)=$E(DGRPVV(4))_'DGMRD ; spouse's employer only editable if married or separated-DG*5.3*1121-commented out and replaced with the following code
S X=$P($G(^DIC(11,+$P(DGRP(0),"^",5),0)),"^",3) S DGMRD=$S("^M^S^"[("^"_X_"^"):1,1:0) ;DG*5.3*1121- made the "Applicant Employer, Address" and the "Spouses Employer, Address" DATA GROUPS
; ;not editable on APPLICANT/SPOUSE EMPLOYMENT DATA, SCREEN <4> by removing the DGRPVV(4) array.
S DGAD=.311,DGA1=3,DGA2=1 D:$P(DGRP(.311),"^",1)]"" AL^DGRPU(26) S DGAD=.25,(DGA1,DGA2)=2 I $P(DGRP(.25),"^",1)]"",DGMRD D AL^DGRPU(26)
S Z=1 D WW^DGRPV W " Employer: " S Z=$S($P(DGRP(.311),"^",1)]"":$E($P(DGRP(.311),"^",1),1,23),1:DGRPU),Z1=26 D WW1^DGRPV S DGRPW=0,Z=2 D WW^DGRPV W " Spouse's: ",$S('DGMRD:"NOT APPLICABLE",$P(DGRP(.25),"^",1)]"":$P(DGRP(.25),"^",1),1:DGRPU)
F I=0:0 S I=$O(DGA(I)) Q:'I S Z=DGA(I) S:(I#2) Z=" "_Z W:(I#2)!($X>50) ! W:(I#2) Z I '(I#2) W ?54,Z
W ! I $P(DGRP(.311),"^",1)]"" W ?7,"Phone: ",$S($P(DGRP(.311),"^",9)]"":$P(DGRP(.311),"^",9),1:DGRPU)
I $P(DGRP(.25),"^",1)]"",DGMRD W ?47,"Phone: ",$S($P(DGRP(.25),"^",8)]"":$P(DGRP(.25),"^",8),1:DGRPU)
W !,?2,"Occupation: ",$S($P(DGRP(0),"^",7)]"":$P(DGRP(0),"^",7),1:DGRPU)
I DGMRD W ?42,"Occupation: ",$S($P(DGRP(.25),"^",14)]"":$P(DGRP(.25),"^",14),1:DGRPU)
W ! S X1="EMPLOYED FULL TIME^EMPLOYED PART TIME^NOT EMPLOYED^SELF EMPLOYED^RETIRED^ACTIVE MILITARY DUTY^^^UNKNOWN"
S X=$P(DGRP(.311),"^",15) W ?6,"Status: ",$S($P(X1,"^",X)]"":$P(X1,"^",X),1:DGRPU)
I DGMRD S X=$P(DGRP(.25),"^",15) W ?46,"Status: ",$S($P(X1,"^",X)]"":$P(X1,"^",X),1:DGRPU)
W !
W ?1,"Retired Dt.: "
I +$P(DGRP(.311),"^",15)=5 DO
. I +$P($G(DGRP(.311)),"^",16)>0 DO
. . N Y
. . S Y=$P(DGRP(.311),"^",16)
. . D DD^%DT
. . W Y
. . K Y
I +$P(DGRP(.311),"^",15)'=5 DO
. W "NOT APPLICABLE"
I DGMRD DO
. W ?41,"Retired Dt.: "
. I +$P(DGRP(.25),"^",15)=5 DO
. . I +$P($G(DGRP(.25)),"^",16)>0 DO
. . . N Y
. . . S Y=$P(DGRP(.25),"^",16)
. . . D DD^%DT
. . . W Y
. . . K Y
. I +$P(DGRP(.25),"^",15)'=5 DO
. . W "NOT APPLICABLE"
G ^DGRPP
Q
;
NEWB ;-- check patient DOB, if DOB<365 days, set employment status to "not employed"
N DOB,NOW
S DOB=$P(^DPT(DFN,0),"^",3)
D NOW^%DTC S NOW=X
I $$FMDIFF^XLFDT(NOW,DOB,1)>365 Q ;patient is not a newborn
S $P(^DPT(DFN,.311),"^",15)=3 ;patient is a newborn
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGRP4 2860 printed Dec 13, 2024@02:55:38 Page 2
DGRP4 ;ALB/MRL,ARF - REGISTRATION SCREEN 4/EMPLOYMENT INFORMATION ;06 JUN 88@2300
+1 ;;5.3;Registration;**624,867,1121**;Aug 13, 1993;Build 14
+2 ;
+3 NEW DGMRD
+4 ;determine newborn status before building local array
DO NEWB
+5 SET DGRPS=4
DO H^DGRPU
SET DGRPW=1
FOR I=0,.311,.25
SET DGRP(I)=$SELECT($DATA(^DPT(DFN,I)):^(I),1:"")
+6 ;S X=$P($G(^DIC(11,+$P(DGRP(0),"^",5),0)),"^",3) S DGMRD=$S("^M^S^"[("^"_X_"^"):1,1:0),DGRPVV(4)=$E(DGRPVV(4))_'DGMRD ; spouse's employer only editable if married or separated-DG*5.3*1121-commented out and replaced with the following code
+7 ;DG*5.3*1121- made the "Applicant Employer, Address" and the "Spouses Employer, Address" DATA GROUPS
SET X=$PIECE($GET(^DIC(11,+$PIECE(DGRP(0),"^",5),0)),"^",3)
SET DGMRD=$SELECT("^M^S^"[("^"_X_"^"):1,1:0)
+8 ; ;not editable on APPLICANT/SPOUSE EMPLOYMENT DATA, SCREEN <4> by removing the DGRPVV(4) array.
+9 SET DGAD=.311
SET DGA1=3
SET DGA2=1
if $PIECE(DGRP(.311),"^",1)]""
DO AL^DGRPU(26)
SET DGAD=.25
SET (DGA1,DGA2)=2
IF $PIECE(DGRP(.25),"^",1)]""
IF DGMRD
DO AL^DGRPU(26)
+10 SET Z=1
DO WW^DGRPV
WRITE " Employer: "
SET Z=$SELECT($PIECE(DGRP(.311),"^",1)]"":$EXTRACT($PIECE(DGRP(.311),"^",1),1,23),1:DGRPU)
SET Z1=26
DO WW1^DGRPV
SET DGRPW=0
SET Z=2
DO WW^DGRPV
WRITE " Spouse's: ",$SELECT('DGMRD:"NOT APPLICABLE",$PIECE(DGRP(.25),"^",1)]"":$PIECE(DGRP(.25),"^",1),1:DGRPU)
+11 FOR I=0:0
SET I=$ORDER(DGA(I))
if 'I
QUIT
SET Z=DGA(I)
if (I#2)
SET Z=" "_Z
if (I#2)!($X>50)
WRITE !
if (I#2)
WRITE Z
IF '(I#2)
WRITE ?54,Z
+12 WRITE !
IF $PIECE(DGRP(.311),"^",1)]""
WRITE ?7,"Phone: ",$SELECT($PIECE(DGRP(.311),"^",9)]"":$PIECE(DGRP(.311),"^",9),1:DGRPU)
+13 IF $PIECE(DGRP(.25),"^",1)]""
IF DGMRD
WRITE ?47,"Phone: ",$SELECT($PIECE(DGRP(.25),"^",8)]"":$PIECE(DGRP(.25),"^",8),1:DGRPU)
+14 WRITE !,?2,"Occupation: ",$SELECT($PIECE(DGRP(0),"^",7)]"":$PIECE(DGRP(0),"^",7),1:DGRPU)
+15 IF DGMRD
WRITE ?42,"Occupation: ",$SELECT($PIECE(DGRP(.25),"^",14)]"":$PIECE(DGRP(.25),"^",14),1:DGRPU)
+16 WRITE !
SET X1="EMPLOYED FULL TIME^EMPLOYED PART TIME^NOT EMPLOYED^SELF EMPLOYED^RETIRED^ACTIVE MILITARY DUTY^^^UNKNOWN"
+17 SET X=$PIECE(DGRP(.311),"^",15)
WRITE ?6,"Status: ",$SELECT($PIECE(X1,"^",X)]"":$PIECE(X1,"^",X),1:DGRPU)
+18 IF DGMRD
SET X=$PIECE(DGRP(.25),"^",15)
WRITE ?46,"Status: ",$SELECT($PIECE(X1,"^",X)]"":$PIECE(X1,"^",X),1:DGRPU)
+19 WRITE !
+20 WRITE ?1,"Retired Dt.: "
+21 IF +$PIECE(DGRP(.311),"^",15)=5
Begin DoDot:1
+22 IF +$PIECE($GET(DGRP(.311)),"^",16)>0
Begin DoDot:2
+23 NEW Y
+24 SET Y=$PIECE(DGRP(.311),"^",16)
+25 DO DD^%DT
+26 WRITE Y
+27 KILL Y
End DoDot:2
End DoDot:1
+28 IF +$PIECE(DGRP(.311),"^",15)'=5
Begin DoDot:1
+29 WRITE "NOT APPLICABLE"
End DoDot:1
+30 IF DGMRD
Begin DoDot:1
+31 WRITE ?41,"Retired Dt.: "
+32 IF +$PIECE(DGRP(.25),"^",15)=5
Begin DoDot:2
+33 IF +$PIECE($GET(DGRP(.25)),"^",16)>0
Begin DoDot:3
+34 NEW Y
+35 SET Y=$PIECE(DGRP(.25),"^",16)
+36 DO DD^%DT
+37 WRITE Y
+38 KILL Y
End DoDot:3
End DoDot:2
+39 IF +$PIECE(DGRP(.25),"^",15)'=5
Begin DoDot:2
+40 WRITE "NOT APPLICABLE"
End DoDot:2
End DoDot:1
+41 GOTO ^DGRPP
+42 QUIT
+43 ;
NEWB ;-- check patient DOB, if DOB<365 days, set employment status to "not employed"
+1 NEW DOB,NOW
+2 SET DOB=$PIECE(^DPT(DFN,0),"^",3)
+3 DO NOW^%DTC
SET NOW=X
+4 ;patient is not a newborn
IF $$FMDIFF^XLFDT(NOW,DOB,1)>365
QUIT
+5 ;patient is a newborn
SET $PIECE(^DPT(DFN,.311),"^",15)=3
+6 QUIT