Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SD53P812

SD53P812.m

Go to the documentation of this file.
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