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

PSNPPSI1.m

Go to the documentation of this file.
PSNPPSI1 ;HP/MJE-PPSN update NDF data for parsing DATANT records ; 05 Mar 2014  1:20 PM
 ;;4.0;NATIONAL DRUG FILE;**513**; 30 Oct 98;Build 53
 ;
 Q
 ;
 ;This routine parses DATANT records which add .01 fields to files and sub-files
DATANT ;
 K FDA
 S FDA(57.231,CTRLXIEN_","_CTRLIEN_",",6)="DATANT"
 D UPDATE^DIE("","FDA","CTRLIEN")
 K FDA
 D CTRLFILE^PSNPPSMS(0)
 D CTRLSS^PSNPPSMS(0)
 D CTRLIEN^PSNPPSMS(0)
 S FILE=0,GROOT=$NA(^TMP("PSN PPSN PARSED",$J,"DATANT")),PSNTMPN="DATANT"
 F  S FILE=$O(@GROOT@(FILE)) Q:'FILE  D CTRLFILE^PSNPPSMS(FILE) S ROOT=$$ROOT^DILFD(FILE) I ROOT]"" S GROOT1=$NA(@GROOT@(FILE)) F JJ=1:2 Q:'$D(@GROOT1@(JJ))  D
 .S (DIA,NEW)=""
 .S DIA=@GROOT1@(JJ) I $G(@GROOT1@(JJ+1))]"" S NEW=@GROOT1@(JJ+1)
 .D CTRLSS^PSNPPSMS($TR(GROOT1,"^")_","_JJ)
 .S DA=+DIA K FDA,IENS
 .I FILE=50.68 S ^TMP("PSN PPSN PARSED",$J,"AE_PRODUCTS",DA)="" S:$P(DIA,"^",3)=.01 ^TMP("PSN PPSN PARSED",$J,"NEW PRODUCTS",DA)=""
 .;
 .I PSNPS="N",FILE=50.416 D INGRED^PSNPPSNK
 .I PSNPS="N",FILE=56 D
 ..K STAT
 ..S STAT="A"
 ..I $D(^PS(56,DA)) S STAT="E" S:$$GET1^DIQ(56,DA,7)'="" STAT="I"
 ..S ^TMP("PSN PPSN PARSED",$J,"POST_RUN",5000.56,FILE,DA,.01)=STAT
 .;
 .I PSNPS="N",FILE=50.68 D
 ..D NDFK^PSNPPSNK
 ..K FDA,ORD,ERROR
 ..S ORD=""
 ..I $D(^PSNDF(50.68,DA)) S ORD=$$GET1^DIQ(FILE,DA_",",31,"I","ERROR")
 ..S ^TMP("PSN PPSN PARSED",$J,"POST_RUN",5000.608,FILE,DA,.01)=ORD
 .;
 .I $$GET1^DIQ(FILE,DA,.01)]"" S FDA(FILE,DA_",",.01)=NEW D FILE^DIE("","FDA"),CTRLIEN^PSNPPSMS(DA) Q
 .S DINUM=DA,X=NEW,DIC=ROOT,DIC(0)="L",DIC("DR")="S Y=0" K DD,DO D FILE^DICN
 ;
 D DATAN^PSNPPSI2
 Q