DGRP4 ;ALB/MRL - REGISTRATION SCREEN 4/EMPLOYMENT INFORMATION ;06 JUN 88@2300
;;5.3;Registration;**624,867**;Aug 13, 1993;Build 59
;
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
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 2415 printed Oct 16, 2024@18:56:12 Page 2
DGRP4 ;ALB/MRL - REGISTRATION SCREEN 4/EMPLOYMENT INFORMATION ;06 JUN 88@2300
+1 ;;5.3;Registration;**624,867**;Aug 13, 1993;Build 59
+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 ; spouse's employer only editable if married or separated
SET X=$PIECE($GET(^DIC(11,+$PIECE(DGRP(0),"^",5),0)),"^",3)
SET DGMRD=$SELECT("^M^S^"[("^"_X_"^"):1,1:0)
SET DGRPVV(4)=$EXTRACT(DGRPVV(4))_'DGMRD
+7 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)
+8 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)
+9 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
+10 WRITE !
IF $PIECE(DGRP(.311),"^",1)]""
WRITE ?7,"Phone: ",$SELECT($PIECE(DGRP(.311),"^",9)]"":$PIECE(DGRP(.311),"^",9),1:DGRPU)
+11 IF $PIECE(DGRP(.25),"^",1)]""
IF DGMRD
WRITE ?47,"Phone: ",$SELECT($PIECE(DGRP(.25),"^",8)]"":$PIECE(DGRP(.25),"^",8),1:DGRPU)
+12 WRITE !,?2,"Occupation: ",$SELECT($PIECE(DGRP(0),"^",7)]"":$PIECE(DGRP(0),"^",7),1:DGRPU)
+13 IF DGMRD
WRITE ?42,"Occupation: ",$SELECT($PIECE(DGRP(.25),"^",14)]"":$PIECE(DGRP(.25),"^",14),1:DGRPU)
+14 WRITE !
SET X1="EMPLOYED FULL TIME^EMPLOYED PART TIME^NOT EMPLOYED^SELF EMPLOYED^RETIRED^ACTIVE MILITARY DUTY^^^UNKNOWN"
+15 SET X=$PIECE(DGRP(.311),"^",15)
WRITE ?6,"Status: ",$SELECT($PIECE(X1,"^",X)]"":$PIECE(X1,"^",X),1:DGRPU)
+16 IF DGMRD
SET X=$PIECE(DGRP(.25),"^",15)
WRITE ?46,"Status: ",$SELECT($PIECE(X1,"^",X)]"":$PIECE(X1,"^",X),1:DGRPU)
+17 WRITE !
+18 WRITE ?1,"Retired Dt.: "
+19 IF +$PIECE(DGRP(.311),"^",15)=5
Begin DoDot:1
+20 IF +$PIECE($GET(DGRP(.311)),"^",16)>0
Begin DoDot:2
+21 NEW Y
+22 SET Y=$PIECE(DGRP(.311),"^",16)
+23 DO DD^%DT
+24 WRITE Y
+25 KILL Y
End DoDot:2
End DoDot:1
+26 IF +$PIECE(DGRP(.311),"^",15)'=5
Begin DoDot:1
+27 WRITE "NOT APPLICABLE"
End DoDot:1
+28 IF DGMRD
Begin DoDot:1
+29 WRITE ?41,"Retired Dt.: "
+30 IF +$PIECE(DGRP(.25),"^",15)=5
Begin DoDot:2
+31 IF +$PIECE($GET(DGRP(.25)),"^",16)>0
Begin DoDot:3
+32 NEW Y
+33 SET Y=$PIECE(DGRP(.25),"^",16)
+34 DO DD^%DT
+35 WRITE Y
+36 KILL Y
End DoDot:3
End DoDot:2
+37 IF +$PIECE(DGRP(.25),"^",15)'=5
Begin DoDot:2
+38 WRITE "NOT APPLICABLE"
End DoDot:2
End DoDot:1
+39 GOTO ^DGRPP
+40 QUIT
+41 ;
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