WV7PST ;HCIOFO/FT-Patch 7 Post-Installation Routine ;10/1/99  18:00
 ;;1.0;WOMEN'S HEALTH;**7**;Sep 30, 1998
 ;
EN ; Start post-install
 D XREF,RCODE,ZERO
 D QMAIL
 Q
XREF ; Index new cross-reference added to File 790.2 (CPT CODE - .08)
 N DIK
 S DIK="^WV(790.2,",DIK(1)=".08"
 D ENALL^DIK
 Q
RCODE ; Put R code in PACKAGE (#.05), File 790.2
 N DA,DIE,DR,WVLOOP
 F WVLOOP="BREAST ULTRASOUND","MAMMOGRAM DX BILAT","MAMMOGRAM DX UNILAT","MAMMOGRAM SCREENING","PELVIC ULTRASOUND","VAGINAL ULTRASOUND" D
 .S DA=$O(^WV(790.2,"B",WVLOOP,0))
 .Q:'DA
 .S DR=".05///"_"R",DIE="^WV(790.2,"
 .D ^DIE
 .Q
 Q
QMAIL ; Queue mail message
 N ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
 S ZTRTN="MAIL^WV7PST",ZTDESC="WV*1*7 INSTALLED"
 S ZTIO="",ZTDTH=$H
 D ^%ZTLOAD
 Q
MAIL ; Send message to Default Case Managers to 
 ; 1) enter parameters for new procedures
 ; 2) include |APPOINTMENTS| on form letters (if desired).
 N XMDUZ,XMSUB,XMTEXT,XMY,WVSITE,WVIEN,WVLINE,WVMSG
 S (WVLINE,WVSITE)=0
 F  S WVSITE=$O(^WV(790.02,WVSITE)) Q:'WVSITE  D
 .S WVIEN=$P($G(^WV(790.02,WVSITE,0)),U,2) ;default case manager
 .Q:'WVIEN
 .S XMY(WVIEN)=""
 .Q
 I '$O(XMY(0)) Q
SEND ; Create mail message and send
 S XMDUZ=.5 ;message sender
 S XMSUB="Women's Health patch #7 installed"
 S WVMSG(+$$LINE())="Patch #7 for the Women's Health package was installed. This patch adds 3"
 S WVMSG(+$$LINE())="new procedures for tracking. They are: Tubal Ligation, Pelvic Ultrasound"
 S WVMSG(+$$LINE())="and Vaginal Ultrasound. Please update your site parameters:"
 S WVMSG(+$$LINE())=" "
 S WVMSG(+$$LINE())="   Go to the: File Maintenance menu"
 S WVMSG(+$$LINE())="  Select the: Edit Site Parameters option"
 S WVMSG(+$$LINE())=" Select your: Site/Facility"
 S WVMSG(+$$LINE())="Go to pages 5 and 6"
 S WVMSG(+$$LINE())=" "
 S WVMSG(+$$LINE())="Enter YES in the 'Active' column and a numeric value in the 'DAYS DELINQUENT'"
 S WVMSG(+$$LINE())="column for each new procedure."
 S WVMSG(+$$LINE())=" "
 S WVMSG(+$$LINE())="Exit and save your changes."
 S WVMSG(+$$LINE())=" "
 S WVMSG(+$$LINE())="==================================================="
 S WVMSG(+$$LINE())=" "
 S WVMSG(+$$LINE())="Also, you can automatically have a patient's future appointments display in"
 S WVMSG(+$$LINE())="a notification letter. To do so:"
 S WVMSG(+$$LINE())=" "
 S WVMSG(+$$LINE())="   Go to the: File Maintenance menu"
 S WVMSG(+$$LINE())="  Select the: Add/Edit a Notification Purpose & Letter option"
 S WVMSG(+$$LINE())=" "
 S WVMSG(+$$LINE())="Select the notification letter which will display the future appointments."
 S WVMSG(+$$LINE())=" "
 S WVMSG(+$$LINE())="Answer NO to the 'Do you wish to delete the old letter for this Purpose of"
 S WVMSG(+$$LINE())="Notification and replace it with the generic sample letter?"
 S WVMSG(+$$LINE())="Enter Yes or No: NO//' prompt."
 S WVMSG(+$$LINE())=" "
 S WVMSG(+$$LINE())="Navigate to the FORM LETTER (WP) field."
 S WVMSG(+$$LINE())=" "
 S WVMSG(+$$LINE())="In the text of the letter type ""|APPOINTMENTS|"" (without the quotes) along"
 S WVMSG(+$$LINE())="with any other text that should appear in the letter."
 S WVMSG(+$$LINE())=" "
 S WVMSG(+$$LINE())="For example, create a new paragraph:"
 S WVMSG(+$$LINE())=" "
 S WVMSG(+$$LINE())="Your future appointments are:"
 S WVMSG(+$$LINE())="|APPOINTMENTS|"
 S WVMSG(+$$LINE())=" "
 S WVMSG(+$$LINE())=" "
 S XMTEXT="WVMSG("
 D ^XMD
 Q
LINE() ; Increment line counter by 1
 S WVLINE=+$G(WVLINE)+1
 Q WVLINE
 ;
ZERO ; Set Fields .77, .78 and .79 in File 790.71 entries to zero
 ; (pieces 28, 29 & 30 of node 2).
 N WVLOOP,WVNODE,WVX
 S WVLOOP=0
 F  S WVLOOP=$O(^WV(790.71,WVLOOP)) Q:'WVLOOP  D
 .S WVNODE=$G(^WV(790.71,WVLOOP,2))
 .Q:WVNODE=""
 .F WVX=28,29,30 S:$P(WVNODE,U,WVX)="" $P(WVNODE,U,WVX)=0
 .S ^WV(790.71,WVLOOP,2)=WVNODE
 .Q
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HWV7PST   3877     printed  Sep 23, 2025@20:22:53                                                                                                                                                                                                      Page 2
WV7PST    ;HCIOFO/FT-Patch 7 Post-Installation Routine ;10/1/99  18:00
 +1       ;;1.0;WOMEN'S HEALTH;**7**;Sep 30, 1998
 +2       ;
EN        ; Start post-install
 +1        DO XREF
           DO RCODE
           DO ZERO
 +2        DO QMAIL
 +3        QUIT 
XREF      ; Index new cross-reference added to File 790.2 (CPT CODE - .08)
 +1        NEW DIK
 +2        SET DIK="^WV(790.2,"
           SET DIK(1)=".08"
 +3        DO ENALL^DIK
 +4        QUIT 
RCODE     ; Put R code in PACKAGE (#.05), File 790.2
 +1        NEW DA,DIE,DR,WVLOOP
 +2        FOR WVLOOP="BREAST ULTRASOUND","MAMMOGRAM DX BILAT","MAMMOGRAM DX UNILAT","MAMMOGRAM SCREENING","PELVIC ULTRASOUND","VAGINAL ULTRASOUND"
               Begin DoDot:1
 +3                SET DA=$ORDER(^WV(790.2,"B",WVLOOP,0))
 +4                if 'DA
                       QUIT 
 +5                SET DR=".05///"_"R"
                   SET DIE="^WV(790.2,"
 +6                DO ^DIE
 +7                QUIT 
               End DoDot:1
 +8        QUIT 
QMAIL     ; Queue mail message
 +1        NEW ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
 +2        SET ZTRTN="MAIL^WV7PST"
           SET ZTDESC="WV*1*7 INSTALLED"
 +3        SET ZTIO=""
           SET ZTDTH=$HOROLOG
 +4        DO ^%ZTLOAD
 +5        QUIT 
MAIL      ; Send message to Default Case Managers to 
 +1       ; 1) enter parameters for new procedures
 +2       ; 2) include |APPOINTMENTS| on form letters (if desired).
 +3        NEW XMDUZ,XMSUB,XMTEXT,XMY,WVSITE,WVIEN,WVLINE,WVMSG
 +4        SET (WVLINE,WVSITE)=0
 +5        FOR 
               SET WVSITE=$ORDER(^WV(790.02,WVSITE))
               if 'WVSITE
                   QUIT 
               Begin DoDot:1
 +6       ;default case manager
                   SET WVIEN=$PIECE($GET(^WV(790.02,WVSITE,0)),U,2)
 +7                if 'WVIEN
                       QUIT 
 +8                SET XMY(WVIEN)=""
 +9                QUIT 
               End DoDot:1
 +10       IF '$ORDER(XMY(0))
               QUIT 
SEND      ; Create mail message and send
 +1       ;message sender
           SET XMDUZ=.5
 +2        SET XMSUB="Women's Health patch #7 installed"
 +3        SET WVMSG(+$$LINE())="Patch #7 for the Women's Health package was installed. This patch adds 3"
 +4        SET WVMSG(+$$LINE())="new procedures for tracking. They are: Tubal Ligation, Pelvic Ultrasound"
 +5        SET WVMSG(+$$LINE())="and Vaginal Ultrasound. Please update your site parameters:"
 +6        SET WVMSG(+$$LINE())=" "
 +7        SET WVMSG(+$$LINE())="   Go to the: File Maintenance menu"
 +8        SET WVMSG(+$$LINE())="  Select the: Edit Site Parameters option"
 +9        SET WVMSG(+$$LINE())=" Select your: Site/Facility"
 +10       SET WVMSG(+$$LINE())="Go to pages 5 and 6"
 +11       SET WVMSG(+$$LINE())=" "
 +12       SET WVMSG(+$$LINE())="Enter YES in the 'Active' column and a numeric value in the 'DAYS DELINQUENT'"
 +13       SET WVMSG(+$$LINE())="column for each new procedure."
 +14       SET WVMSG(+$$LINE())=" "
 +15       SET WVMSG(+$$LINE())="Exit and save your changes."
 +16       SET WVMSG(+$$LINE())=" "
 +17       SET WVMSG(+$$LINE())="==================================================="
 +18       SET WVMSG(+$$LINE())=" "
 +19       SET WVMSG(+$$LINE())="Also, you can automatically have a patient's future appointments display in"
 +20       SET WVMSG(+$$LINE())="a notification letter. To do so:"
 +21       SET WVMSG(+$$LINE())=" "
 +22       SET WVMSG(+$$LINE())="   Go to the: File Maintenance menu"
 +23       SET WVMSG(+$$LINE())="  Select the: Add/Edit a Notification Purpose & Letter option"
 +24       SET WVMSG(+$$LINE())=" "
 +25       SET WVMSG(+$$LINE())="Select the notification letter which will display the future appointments."
 +26       SET WVMSG(+$$LINE())=" "
 +27       SET WVMSG(+$$LINE())="Answer NO to the 'Do you wish to delete the old letter for this Purpose of"
 +28       SET WVMSG(+$$LINE())="Notification and replace it with the generic sample letter?"
 +29       SET WVMSG(+$$LINE())="Enter Yes or No: NO//' prompt."
 +30       SET WVMSG(+$$LINE())=" "
 +31       SET WVMSG(+$$LINE())="Navigate to the FORM LETTER (WP) field."
 +32       SET WVMSG(+$$LINE())=" "
 +33       SET WVMSG(+$$LINE())="In the text of the letter type ""|APPOINTMENTS|"" (without the quotes) along"
 +34       SET WVMSG(+$$LINE())="with any other text that should appear in the letter."
 +35       SET WVMSG(+$$LINE())=" "
 +36       SET WVMSG(+$$LINE())="For example, create a new paragraph:"
 +37       SET WVMSG(+$$LINE())=" "
 +38       SET WVMSG(+$$LINE())="Your future appointments are:"
 +39       SET WVMSG(+$$LINE())="|APPOINTMENTS|"
 +40       SET WVMSG(+$$LINE())=" "
 +41       SET WVMSG(+$$LINE())=" "
 +42       SET XMTEXT="WVMSG("
 +43       DO ^XMD
 +44       QUIT 
LINE()    ; Increment line counter by 1
 +1        SET WVLINE=+$GET(WVLINE)+1
 +2        QUIT WVLINE
 +3       ;
ZERO      ; Set Fields .77, .78 and .79 in File 790.71 entries to zero
 +1       ; (pieces 28, 29 & 30 of node 2).
 +2        NEW WVLOOP,WVNODE,WVX
 +3        SET WVLOOP=0
 +4        FOR 
               SET WVLOOP=$ORDER(^WV(790.71,WVLOOP))
               if 'WVLOOP
                   QUIT 
               Begin DoDot:1
 +5                SET WVNODE=$GET(^WV(790.71,WVLOOP,2))
 +6                if WVNODE=""
                       QUIT 
 +7                FOR WVX=28,29,30
                       if $PIECE(WVNODE,U,WVX)=""
                           SET $PIECE(WVNODE,U,WVX)=0
 +8                SET ^WV(790.71,WVLOOP,2)=WVNODE
 +9                QUIT 
               End DoDot:1
 +10       QUIT