WVNOTIF1 ;HCIOFO/FT,JR IHS/ANMC/MWR - WV ADD/EDIT WV NOTIFICATIONS;
;;1.0;WOMEN'S HEALTH;;Sep 30, 1998
;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
;; STUFFS A NORMAL LETTER FOR THIS PATIENT. CALLED BY WVNOTIF.
;
;
NORMALL(WVDFN,WVACCN,WVSPEC,WVSPTX) ;EP
;---> STUFF A NORMAP PAP/MAM RESULT LETTER ENTRY IN WV NOTIF FILE.
;---> REQUIRED VARIABLES: WVDFN=IEN OF WV PATIENT (FILE 790),
;---> WVACCN=ACCESSION# FOR PROCEDURE.
;---> WVSPEC=1 FOR PAP, 3,4 OR 5 FOR MAM.
;---> WVSPTX=TEXT OF THE SPECIAL PROCEDURE.
N WVPC,WVPURP,X
;
I '$D(WVDFN)!('$D(WVACCN))!('$D(WVSPEC)) D D NOLETT Q
.W !!?5,"* Patient DFN or Accession# or Special Procedure Code "
.W "undefined.",!," Contact Site Manager."
;
I '$D(^WV(790.02,DUZ(2),0)) D D NOLETT Q
.W !!?5,"* Site Parameters for ",$$INSTTX^WVUTL6(DUZ(2))
.W " have not been set."
;
;---> FIND PIECE OF ^WV(790.02, THAT IDENTIFIES PAP/MAM NORMAL LETTER.
S WVPC=$S(WVSPEC=1:4,WVSPEC=2:8,1:0)
S WVPURP=$P(^WV(790.02,DUZ(2),0),U,WVPC)
I 'WVPURP D D NOLETT Q
.W !!?5,"* The Normal ",WVSPTX," Result Letter is not identified in"
.W !?7,"the Site Parameter file. Check the Site Parameter File."
;
I '$O(^WV(790.404,WVPURP,1,0)) D D NOLETT Q
.W !!?5,"* In the Site Parameter file, the Normal ",WVSPTX
.W " Result letter"
.W !?7,"chosen has no letter text entered. Check the Notification "
.W !?7,"Purpose&Letter File."
;
;---> NOW STUFF A PAP/MAM RESULT NORMAL LETTER WITH ALL FIELDS ENTERED,
;---> QUEUED TO BE PRINTED TODAY.
N DIC,Y
S X=WVDFN
K DD,DO S DIC="^WV(790.4,",DIC(0)="ML",DLAYGO=790
S DIC("DR")=".02///T;.03///LETTER, FIRST;.04///"_WVPURP
S DIC("DR")=DIC("DR")_";.05///"_WVSPTX_" NORMAL LETTER SENT;.06///"
S DIC("DR")=DIC("DR")_WVACCN_";.07////"_DUZ(2)_";.08///T;.11///T"
S DIC("DR")=DIC("DR")_";.13///T;.14///CLOSED"
D FILE^DICN
;---> IF Y<0, CHECK PERMISSIONS.
D:Y<0
.W !!?5,"COULD NOT ADD NOTIFICATION, PERMISSION PROBLEM."
.W !?5,"CONTACT YOUR SITE MANAGER." D NOLETT
Q
;
NOLETT ;EP
W !?5,"* NO LETTER QUEUED!" D DIRZ^WVUTL3
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HWVNOTIF1 2160 printed Oct 16, 2024@18:47:48 Page 2
WVNOTIF1 ;HCIOFO/FT,JR IHS/ANMC/MWR - WV ADD/EDIT WV NOTIFICATIONS;
+1 ;;1.0;WOMEN'S HEALTH;;Sep 30, 1998
+2 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
+3 ;; STUFFS A NORMAL LETTER FOR THIS PATIENT. CALLED BY WVNOTIF.
+4 ;
+5 ;
NORMALL(WVDFN,WVACCN,WVSPEC,WVSPTX) ;EP
+1 ;---> STUFF A NORMAP PAP/MAM RESULT LETTER ENTRY IN WV NOTIF FILE.
+2 ;---> REQUIRED VARIABLES: WVDFN=IEN OF WV PATIENT (FILE 790),
+3 ;---> WVACCN=ACCESSION# FOR PROCEDURE.
+4 ;---> WVSPEC=1 FOR PAP, 3,4 OR 5 FOR MAM.
+5 ;---> WVSPTX=TEXT OF THE SPECIAL PROCEDURE.
+6 NEW WVPC,WVPURP,X
+7 ;
+8 IF '$DATA(WVDFN)!('$DATA(WVACCN))!('$DATA(WVSPEC))
Begin DoDot:1
+9 WRITE !!?5,"* Patient DFN or Accession# or Special Procedure Code "
+10 WRITE "undefined.",!," Contact Site Manager."
End DoDot:1
DO NOLETT
QUIT
+11 ;
+12 IF '$DATA(^WV(790.02,DUZ(2),0))
Begin DoDot:1
+13 WRITE !!?5,"* Site Parameters for ",$$INSTTX^WVUTL6(DUZ(2))
+14 WRITE " have not been set."
End DoDot:1
DO NOLETT
QUIT
+15 ;
+16 ;---> FIND PIECE OF ^WV(790.02, THAT IDENTIFIES PAP/MAM NORMAL LETTER.
+17 SET WVPC=$SELECT(WVSPEC=1:4,WVSPEC=2:8,1:0)
+18 SET WVPURP=$PIECE(^WV(790.02,DUZ(2),0),U,WVPC)
+19 IF 'WVPURP
Begin DoDot:1
+20 WRITE !!?5,"* The Normal ",WVSPTX," Result Letter is not identified in"
+21 WRITE !?7,"the Site Parameter file. Check the Site Parameter File."
End DoDot:1
DO NOLETT
QUIT
+22 ;
+23 IF '$ORDER(^WV(790.404,WVPURP,1,0))
Begin DoDot:1
+24 WRITE !!?5,"* In the Site Parameter file, the Normal ",WVSPTX
+25 WRITE " Result letter"
+26 WRITE !?7,"chosen has no letter text entered. Check the Notification "
+27 WRITE !?7,"Purpose&Letter File."
End DoDot:1
DO NOLETT
QUIT
+28 ;
+29 ;---> NOW STUFF A PAP/MAM RESULT NORMAL LETTER WITH ALL FIELDS ENTERED,
+30 ;---> QUEUED TO BE PRINTED TODAY.
+31 NEW DIC,Y
+32 SET X=WVDFN
+33 KILL DD,DO
SET DIC="^WV(790.4,"
SET DIC(0)="ML"
SET DLAYGO=790
+34 SET DIC("DR")=".02///T;.03///LETTER, FIRST;.04///"_WVPURP
+35 SET DIC("DR")=DIC("DR")_";.05///"_WVSPTX_" NORMAL LETTER SENT;.06///"
+36 SET DIC("DR")=DIC("DR")_WVACCN_";.07////"_DUZ(2)_";.08///T;.11///T"
+37 SET DIC("DR")=DIC("DR")_";.13///T;.14///CLOSED"
+38 DO FILE^DICN
+39 ;---> IF Y<0, CHECK PERMISSIONS.
+40 if Y<0
Begin DoDot:1
+41 WRITE !!?5,"COULD NOT ADD NOTIFICATION, PERMISSION PROBLEM."
+42 WRITE !?5,"CONTACT YOUR SITE MANAGER."
DO NOLETT
End DoDot:1
+43 QUIT
+44 ;
NOLETT ;EP
+1 WRITE !?5,"* NO LETTER QUEUED!"
DO DIRZ^WVUTL3
+2 QUIT