PSN566PO ;BIR/SJA-Post install routine for patch PSN*4*566 ; 02 Aug 2018 2:00 PM
;;4.0;NATIONAL DRUG FILE;**566**; 30 Oct 98;Build 2
;
Q
;
POST ; entry point
N CNT,DATA,II,NAME,NODE1,PSNDA
S CNT=4 K ^TMP("PSN",$J)
D BMES^XPDUTL(" Starting post-install for PSN*4*566")
;
D BMES^XPDUTL("Re-indexing the 'AQ1' of the CMOP ID field (#27) of the DRUG file (#50)...")
K ^PSDRUG("AQ1") K DIK S DIK="^PSDRUG(",DIK(1)="27^AQ1" D ENALL^DIK K DIK
;
D BMES^XPDUTL(" Restore GCNSEQNO field for specific VA Products....")
F II=1:1 S DATA=$P($T(@("LIST+"_II_"^PSN566PO")),";;",2) Q:DATA="" D
. S PSNDA=+DATA,NAME=$E($P($G(^PSNDF(50.68,PSNDA,0)),"^"),1,40),NODE1=$G(^PSNDF(50.68,PSNDA,1))
. I $D(^PSNDF(50.68,PSNDA,0)),'$P(NODE1,"^",5) S $P(^PSNDF(50.68,PSNDA,1),"^",5)=$E(1000000+$P(DATA,",",2),2,7) D
. . S CNT=CNT+1,^TMP("PSN",$J,CNT)=PSNDA_$J("",15-$L(PSNDA))_NAME_$J("",50-$L(NAME))_$E(1000000+$P(DATA,",",2),2,7)
D MSG K ^TMP("PSN",$J)
D BMES^XPDUTL(" Finished post-install for PSN*4*566")
Q
;
MSG ; Sends Mailman message about updates
N XMX,XMSUB,XMDUZ,XMTEXT
S II=0 F S II=$O(^XUSEC("PSNMGR",II)) Q:'II S XMY(II)=""
S XMY(DUZ)="",XMSUB="PSN*4*566 - GCNSEQNO field Update"
S ^TMP("PSN",$J,1)="The post-install routine restored the GCNSEQNO field value for the following VA PRODUCT entries:"
S ^TMP("PSN",$J,2)=""
S ^TMP("PSN",$J,3)="VA Product # Product Name GCNSEQNO "
S ^TMP("PSN",$J,4)="------------ ---------------------------------------- --------"
S:'$D(^TMP("PSN",$J,5)) ^TMP("PSN",$J,5)="No updates performed."
S XMDUZ=.5,XMTEXT="^TMP(""PSN"",$J," N DIFROM D ^XMD
Q
;
LIST ; VA PRODUCT entries missing GCNSEQNO field
;;5556,003242
;;19980,062059
;;21020,065368
;;26849,074811
;;7657,004247
;;7658,004247
;;15709,004053
;;16451,003298
;;25333,073234
;;27516,077118
;;27887,065744
;;28658,064056
;;28674,078605
;;28238,047061
;;1845,045155
;;2473,008764
;;8871,015612
;;16385,051884
;;18652,021444
;;23735,070630
;;25841,074409
;;25843,074410
;;26452,013648
;;26453,013649
;;3352,005154
;;12622,064400
;;27302,050831
;;6105,048520
;;16670,016963
;;24499,071837
;;26436,066702
;;26437,066702
;;27191,076607
;;27192,076608
;;28836,071475
;;28837,073153
;;28845,079002
;;52,000214
;;18283,062597
;;19294,042966
;;20737,061237
;;25133,072283
;;27435,072292
;;27452,072284
;;27454,072291
;;27581,031511
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSN566PO 2516 printed Nov 22, 2024@17:33:37 Page 2
PSN566PO ;BIR/SJA-Post install routine for patch PSN*4*566 ; 02 Aug 2018 2:00 PM
+1 ;;4.0;NATIONAL DRUG FILE;**566**; 30 Oct 98;Build 2
+2 ;
+3 QUIT
+4 ;
POST ; entry point
+1 NEW CNT,DATA,II,NAME,NODE1,PSNDA
+2 SET CNT=4
KILL ^TMP("PSN",$JOB)
+3 DO BMES^XPDUTL(" Starting post-install for PSN*4*566")
+4 ;
+5 DO BMES^XPDUTL("Re-indexing the 'AQ1' of the CMOP ID field (#27) of the DRUG file (#50)...")
+6 KILL ^PSDRUG("AQ1")
KILL DIK
SET DIK="^PSDRUG("
SET DIK(1)="27^AQ1"
DO ENALL^DIK
KILL DIK
+7 ;
+8 DO BMES^XPDUTL(" Restore GCNSEQNO field for specific VA Products....")
+9 FOR II=1:1
SET DATA=$PIECE($TEXT(@("LIST+"_II_"^PSN566PO")),";;",2)
if DATA=""
QUIT
Begin DoDot:1
+10 SET PSNDA=+DATA
SET NAME=$EXTRACT($PIECE($GET(^PSNDF(50.68,PSNDA,0)),"^"),1,40)
SET NODE1=$GET(^PSNDF(50.68,PSNDA,1))
+11 IF $DATA(^PSNDF(50.68,PSNDA,0))
IF '$PIECE(NODE1,"^",5)
SET $PIECE(^PSNDF(50.68,PSNDA,1),"^",5)=$EXTRACT(1000000+$PIECE(DATA,",",2),2,7)
Begin DoDot:2
+12 SET CNT=CNT+1
SET ^TMP("PSN",$JOB,CNT)=PSNDA_$JUSTIFY("",15-$LENGTH(PSNDA))_NAME_$JUSTIFY("",50-$LENGTH(NAME))_$EXTRACT(1000000+$PIECE(DATA,",",2),2,7)
End DoDot:2
End DoDot:1
+13 DO MSG
KILL ^TMP("PSN",$JOB)
+14 DO BMES^XPDUTL(" Finished post-install for PSN*4*566")
+15 QUIT
+16 ;
MSG ; Sends Mailman message about updates
+1 NEW XMX,XMSUB,XMDUZ,XMTEXT
+2 SET II=0
FOR
SET II=$ORDER(^XUSEC("PSNMGR",II))
if 'II
QUIT
SET XMY(II)=""
+3 SET XMY(DUZ)=""
SET XMSUB="PSN*4*566 - GCNSEQNO field Update"
+4 SET ^TMP("PSN",$JOB,1)="The post-install routine restored the GCNSEQNO field value for the following VA PRODUCT entries:"
+5 SET ^TMP("PSN",$JOB,2)=""
+6 SET ^TMP("PSN",$JOB,3)="VA Product # Product Name GCNSEQNO "
+7 SET ^TMP("PSN",$JOB,4)="------------ ---------------------------------------- --------"
+8 if '$DATA(^TMP("PSN",$JOB,5))
SET ^TMP("PSN",$JOB,5)="No updates performed."
+9 SET XMDUZ=.5
SET XMTEXT="^TMP(""PSN"",$J,"
NEW DIFROM
DO ^XMD
+10 QUIT
+11 ;
LIST ; VA PRODUCT entries missing GCNSEQNO field
+1 ;;5556,003242
+2 ;;19980,062059
+3 ;;21020,065368
+4 ;;26849,074811
+5 ;;7657,004247
+6 ;;7658,004247
+7 ;;15709,004053
+8 ;;16451,003298
+9 ;;25333,073234
+10 ;;27516,077118
+11 ;;27887,065744
+12 ;;28658,064056
+13 ;;28674,078605
+14 ;;28238,047061
+15 ;;1845,045155
+16 ;;2473,008764
+17 ;;8871,015612
+18 ;;16385,051884
+19 ;;18652,021444
+20 ;;23735,070630
+21 ;;25841,074409
+22 ;;25843,074410
+23 ;;26452,013648
+24 ;;26453,013649
+25 ;;3352,005154
+26 ;;12622,064400
+27 ;;27302,050831
+28 ;;6105,048520
+29 ;;16670,016963
+30 ;;24499,071837
+31 ;;26436,066702
+32 ;;26437,066702
+33 ;;27191,076607
+34 ;;27192,076608
+35 ;;28836,071475
+36 ;;28837,073153
+37 ;;28845,079002
+38 ;;52,000214
+39 ;;18283,062597
+40 ;;19294,042966
+41 ;;20737,061237
+42 ;;25133,072283
+43 ;;27435,072292
+44 ;;27452,072284
+45 ;;27454,072291
+46 ;;27581,031511
+47 ;