NURSUT6 ;HIRMFO/KJS-API FOR NURS LOCATION (#211.4) FILE ;8-18-2011
;;4.0;NURSING SERVICE;**43**;APR 25, 1997;Build 19
;;Per VHA Directive 2004-038, this routine should not be modified.
;
Q
;
SERVICE ; set the Service date multiple (field 16) in file 211.4, whenever
; the inactive flag (1.5) is changed (called from index on field 1.5)
;
Q:$G(DA)'>0!($G(X)="")
N REC,RECEXIST,IENS
S RECEXIST=0
S REC=$O(^NURSF(211.4,DA,7,"B",DT,0))
I REC S RECEXIST=$D(^NURSF(211.4,DA,7,REC,0))
I RECEXIST D
. S IENS=REC_","_DA_","
. S PRSFDA(211.416,IENS,1)=X
. D FILE^DIE(,"PRSFDA",)
E D
. N PRSFDA,IENS
. S IENS="+1,"_DA_","
. S PRSFDA(211.416,IENS,.01)=DT
. S PRSFDA(211.416,IENS,1)=X
. D UPDATE^DIE("","PRSFDA","IENS")
D MSG^DIALOG()
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HNURSUT6 775 printed Sep 02, 2024@19:07:44 Page 2
NURSUT6 ;HIRMFO/KJS-API FOR NURS LOCATION (#211.4) FILE ;8-18-2011
+1 ;;4.0;NURSING SERVICE;**43**;APR 25, 1997;Build 19
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 QUIT
+5 ;
SERVICE ; set the Service date multiple (field 16) in file 211.4, whenever
+1 ; the inactive flag (1.5) is changed (called from index on field 1.5)
+2 ;
+3 if $GET(DA)'>0!($GET(X)="")
QUIT
+4 NEW REC,RECEXIST,IENS
+5 SET RECEXIST=0
+6 SET REC=$ORDER(^NURSF(211.4,DA,7,"B",DT,0))
+7 IF REC
SET RECEXIST=$DATA(^NURSF(211.4,DA,7,REC,0))
+8 IF RECEXIST
Begin DoDot:1
+9 SET IENS=REC_","_DA_","
+10 SET PRSFDA(211.416,IENS,1)=X
+11 DO FILE^DIE(,"PRSFDA",)
End DoDot:1
+12 IF '$TEST
Begin DoDot:1
+13 NEW PRSFDA,IENS
+14 SET IENS="+1,"_DA_","
+15 SET PRSFDA(211.416,IENS,.01)=DT
+16 SET PRSFDA(211.416,IENS,1)=X
+17 DO UPDATE^DIE("","PRSFDA","IENS")
End DoDot:1
+18 DO MSG^DIALOG()
+19 QUIT