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

ACHSSDA.m

Go to the documentation of this file.
ACHSSDA ;IHS/OIT/FCJ - ADD DATA TO CHS SERV DEL AREA FILE
 ;;3.1;CONTRACT HEALTH MANAGEMENT SYSTEM;**18**;JUNE 11,2001
 ;ACHS*3.1*18 NEW ROUTINE
 ;
ADD ;ADD DATA TO THE CHS SERVICE DELIVERY AREA FILE
 S ACHST=0,CT=0
 F  S ACHST=$O(^ACHSTMP(ACHST)) Q:ACHST'?1N.N  D
 .S ACHSTRC=$P(^ACHSTMP(ACHST),U,2)
 .S X=$O(^AUTTTRI("C",ACHSTRC,0))
 .I 'X S $P(^ACHSTMP(ACHST),U,3)="NOT FOUND" Q
 .S CT=CT+1
 .S ^ACHSSDA(ACHST,0)=X,^ACHSSDA("B",X,ACHST)=""
 .S ACHSC=0,CT1=0 F  S ACHSC=$O(^ACHSTMP(ACHST,ACHSC)) Q:ACHSC'?1N.N  D
 ..S ACHSCC=$P(^ACHSTMP(ACHST,ACHSC),U)
 ..S X1=$O(^AUTTCTY("C",ACHSCC,0))
 ..I 'X1 S $P(^ACHSTMP(ACHST,ACHSC),U,2)="NOT FOUND" Q
 ..S CT1=CT1+1
 ..S ^ACHSSDA(ACHST,30,CT1,0)=X1,^ACHSSDA(ACHST,30,"B",X1,CT1)=""
 .I CT1>0 S ^ACHSSDA(ACHST,30,0)="^9002073.31P^"_CT1_U_CT1
 S $P(^ACHSSDA(0),U,3,4)=CT_U_CT
 K ACHST,ACHSTRC,ACHSC,ACHSCC,CT,CT1,X,X1
TMP ;SET TMP FILE FROM THE ACHSSDA GLOBAL
 S ACHSIEN=0,CT=0
 F  S ACHSIEN=$O(^ACHSSDA(ACHSIEN)) Q:ACHSIEN'?1N.N  D
 .S CT=CT+1
 .S ^ACHSTMP(CT)=$P(^AUTTTRI($P(^ACHSSDA(ACHSIEN,0),U),0),U,1,2)
 .S ACHSCTY=0,CT1=0 F  S ACHSCTY=$O(^ACHSSDA(ACHSIEN,30,ACHSCTY)) Q:ACHSCTY'?1N.N  D
 ..S CT1=CT1+1
 ..S ACHSC=$P(^ACHSSDA(ACHSIEN,30,ACHSCTY,0),U)
 ..S ^ACHSTMP(CT,CT1)=$P(^AUTTCTY(ACHSC,0),U,4)
 Q