SD53P812 ;TMP/SA - POST INSTALL FOR PATCH SD*5.3*812 ;March 10, 2022
;;5.3;Scheduling;**812**;May 29, 2018;Build 17
;
; load new Stop codes to the SD TELE HEALTH STOP CODE FILE #40.6.
; *** post install can be rerun with no harm ***
;
EN ; entry point
N ERRCNT,II,SDI,SDLIST,STP,STP1,STP2 S ERRCNT=0
D MES^XPDUTL("")
D MES^XPDUTL("Beginning update of SD TELE HEALTH STOP CODE FILE...")
D MES^XPDUTL("") H 1
F II=1:1 S SDLIST=$P($T(CODES+II),";;",2) Q:SDLIST="END" F SDI=1:1 S STP=$P(SDLIST,",",SDI) Q:STP="" D
. K DIE,FDA,SDIEN,TMPERR
. I $O(^SD(40.6,"B",STP,"")) D MES^XPDUTL(STP_" already on file") Q
. I $L(STP)=3 D Q
. . I '$$CHKSTOP^SDTMPEDT(STP) D MES^XPDUTL(STP_" ** Not added, invalid stop code") Q
. . S FDA(40.6,"+1,",.01)=STP D UPDATE^DIE("","FDA","SDIEN","TMPERR")
. . D:'$D(TMPERR) MES^XPDUTL(STP_" added stop code")
. . I $D(TMPERR) D MES^XPDUTL(STP_" failed an attempt to add to the file.") S ERRCNT=ERRCNT+1
. I $L(STP)=6 D Q
. . S STP1=$E(STP,1,3),STP2=$E(STP,4,6)
. . I ('$$CHKSTOP^SDTMPEDT(STP1))!('$$CHKSTOP^SDTMPEDT(STP2)) D MES^XPDUTL(STP_" ** Not added, one or both stop codes in pair is invalid") Q
. . S FDA(40.6,"+1,",.01)=STP D UPDATE^DIE("","FDA","SDIEN","TMPERR")
. . D:'$D(TMPERR) MES^XPDUTL(STP_" added stop code pair")
. . I $D(TMPERR) D MES^XPDUTL(STP_" failed an attempt to add to the file.") S ERRCNT=ERRCNT+1
. K DIE,FDA,SDIEN,TMPERR
D MES^XPDUTL("")
D MES^XPDUTL("Stop Code Update completed. "_ERRCNT_" error(s) found.")
D MES^XPDUTL("")
Q
;
CODES ;Add Clinic/Telephone stop codes (only valid stop codes on file #40.7 1st)
;;103,104,105,106,107,108,109,110,111,115,116,117,118,119,120,121,123,124,125,126,128,130,131,135,136,137
;;139,142,143,145,147,148,149,150,151,153,156,157,158,159,160,162,165,166,167,168,169,170,171,172,173,174
;;175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,195,196,197,198,199,201,202,203
;;204,205,206,209,210,211,212,214,215,216,217,218,220,221,224,225,229,230,231,240,241,250,301,302,303,304
;;305,306,307,308,309,310,311,312,313,314,315,316,317,318,321,322,323,324,325,326,327,328,329,330,332,333
;;334,335,336,327,337,338,339,340,341,342,344,345,346,347,348,349,350,351,352,353,354,356,369,370,371,372,373
;;391,392,394,401,402,403,404,405,406,407,408,409,410,411,413,414,415,417,418,419,420,421,423,424,425,427
;;428,429,430,432,434,435,436,437,438,439,440,441,443,444,445,446,447,448,449,450,457,474,481,486,487,488
;;489,490,491,499,502,504,507,508,509,510,511,513,514,516,519,522,523,524,527,528,529,530,533,534,535,536
;;538,539,542,545,546,550,552,555,556,560,562,564,565,566,567,568,573,574,575,576,577,579,582,583,584,586
;;587,591,592,593,596,597,598,599,602,603,604,606,607,608,611,644,645,646,647,648,651,652,656,658,669,673
;;674,679,680,681,682,683,684,685,686,690,692,693,694,695,696,697,698,699,701,703,704,706,707,708,710,713
;;714,717,718,719,720,721,722,723,724,901,999,103801,103802,103803,323531,338531,339184,568535,674685
;;END
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSD53P812 3046 printed Dec 13, 2024@02:46:43 Page 2
SD53P812 ;TMP/SA - POST INSTALL FOR PATCH SD*5.3*812 ;March 10, 2022
+1 ;;5.3;Scheduling;**812**;May 29, 2018;Build 17
+2 ;
+3 ; load new Stop codes to the SD TELE HEALTH STOP CODE FILE #40.6.
+4 ; *** post install can be rerun with no harm ***
+5 ;
EN ; entry point
+1 NEW ERRCNT,II,SDI,SDLIST,STP,STP1,STP2
SET ERRCNT=0
+2 DO MES^XPDUTL("")
+3 DO MES^XPDUTL("Beginning update of SD TELE HEALTH STOP CODE FILE...")
+4 DO MES^XPDUTL("")
HANG 1
+5 FOR II=1:1
SET SDLIST=$PIECE($TEXT(CODES+II),";;",2)
if SDLIST="END"
QUIT
FOR SDI=1:1
SET STP=$PIECE(SDLIST,",",SDI)
if STP=""
QUIT
Begin DoDot:1
+6 KILL DIE,FDA,SDIEN,TMPERR
+7 IF $ORDER(^SD(40.6,"B",STP,""))
DO MES^XPDUTL(STP_" already on file")
QUIT
+8 IF $LENGTH(STP)=3
Begin DoDot:2
+9 IF '$$CHKSTOP^SDTMPEDT(STP)
DO MES^XPDUTL(STP_" ** Not added, invalid stop code")
QUIT
+10 SET FDA(40.6,"+1,",.01)=STP
DO UPDATE^DIE("","FDA","SDIEN","TMPERR")
+11 if '$DATA(TMPERR)
DO MES^XPDUTL(STP_" added stop code")
+12 IF $DATA(TMPERR)
DO MES^XPDUTL(STP_" failed an attempt to add to the file.")
SET ERRCNT=ERRCNT+1
End DoDot:2
QUIT
+13 IF $LENGTH(STP)=6
Begin DoDot:2
+14 SET STP1=$EXTRACT(STP,1,3)
SET STP2=$EXTRACT(STP,4,6)
+15 IF ('$$CHKSTOP^SDTMPEDT(STP1))!('$$CHKSTOP^SDTMPEDT(STP2))
DO MES^XPDUTL(STP_" ** Not added, one or both stop codes in pair is invalid")
QUIT
+16 SET FDA(40.6,"+1,",.01)=STP
DO UPDATE^DIE("","FDA","SDIEN","TMPERR")
+17 if '$DATA(TMPERR)
DO MES^XPDUTL(STP_" added stop code pair")
+18 IF $DATA(TMPERR)
DO MES^XPDUTL(STP_" failed an attempt to add to the file.")
SET ERRCNT=ERRCNT+1
End DoDot:2
QUIT
+19 KILL DIE,FDA,SDIEN,TMPERR
End DoDot:1
+20 DO MES^XPDUTL("")
+21 DO MES^XPDUTL("Stop Code Update completed. "_ERRCNT_" error(s) found.")
+22 DO MES^XPDUTL("")
+23 QUIT
+24 ;
CODES ;Add Clinic/Telephone stop codes (only valid stop codes on file #40.7 1st)
+1 ;;103,104,105,106,107,108,109,110,111,115,116,117,118,119,120,121,123,124,125,126,128,130,131,135,136,137
+2 ;;139,142,143,145,147,148,149,150,151,153,156,157,158,159,160,162,165,166,167,168,169,170,171,172,173,174
+3 ;;175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,195,196,197,198,199,201,202,203
+4 ;;204,205,206,209,210,211,212,214,215,216,217,218,220,221,224,225,229,230,231,240,241,250,301,302,303,304
+5 ;;305,306,307,308,309,310,311,312,313,314,315,316,317,318,321,322,323,324,325,326,327,328,329,330,332,333
+6 ;;334,335,336,327,337,338,339,340,341,342,344,345,346,347,348,349,350,351,352,353,354,356,369,370,371,372,373
+7 ;;391,392,394,401,402,403,404,405,406,407,408,409,410,411,413,414,415,417,418,419,420,421,423,424,425,427
+8 ;;428,429,430,432,434,435,436,437,438,439,440,441,443,444,445,446,447,448,449,450,457,474,481,486,487,488
+9 ;;489,490,491,499,502,504,507,508,509,510,511,513,514,516,519,522,523,524,527,528,529,530,533,534,535,536
+10 ;;538,539,542,545,546,550,552,555,556,560,562,564,565,566,567,568,573,574,575,576,577,579,582,583,584,586
+11 ;;587,591,592,593,596,597,598,599,602,603,604,606,607,608,611,644,645,646,647,648,651,652,656,658,669,673
+12 ;;674,679,680,681,682,683,684,685,686,690,692,693,694,695,696,697,698,699,701,703,704,706,707,708,710,713
+13 ;;714,717,718,719,720,721,722,723,724,901,999,103801,103802,103803,323531,338531,339184,568535,674685
+14 ;;END