- Timestamp:
- Nov 19, 2008, 12:01:28 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/KBAICSNA.m
r286 r288 43 43 . S TTERM=$P(@GMRBASE@(SNOIEN,0),"^",1)_" ALLERGY" 44 44 . D TEXTRPC(.SNORTN,TTERM) 45 . I '$D(SNORTN) Q;46 . S TVUID=$$GET1^DIQ(120.82,SNOIEN,"VUID")47 . W "VUID:",VUID,!48 . K @SNOBASE@("VARS",SNOIEN) ; CLEAR OUT OLD VARS49 . I $P(TTMP,"^",1)=1 S @SNOBASE@("VARS",SNOIEN)=TTERM_"^"_TTMP_"^"_SNORTN(0)50 . ;51 . ; EVALUATE THE VARIABLES AND CREATE AN ATTRIBUTE MAP52 . ;53 . S RATTR=$$SETATTR(SNOIEN) ; SET THE ATTRIBUTE STRING BASED ON THE VARS54 . S @SNOBASE@("ATTR",SNOIEN)=RATTR ; SAVE THE ATRIBUTES FOR THIS DRUG55 . ;56 . N CATNAME,CATTBL57 . S CATNAME=""58 . D CPUSH(.CATNAME,SNOBASE,"SNOTBL",SNOIEN,RATTR) ; ADD TO CATEGORY59 . ; W "CATEGORY NAME: ",CATNAME,!60 . ;45 . I $D(SNORTN) D ; 46 . . S TVUID=$$GET1^DIQ(120.82,SNOIEN,"VUID") 47 . . W "VUID:",TVUID,! 48 . . K @SNOBASE@("VARS",SNOIEN) ; CLEAR OUT OLD VARS 49 . . I $P(TTMP,"^",1)=1 S @SNOBASE@("VARS",SNOIEN)=TTERM_"^"_TTMP_"^"_SNORTN(0)_"^"_TVUID_"^"_SNORTN("F") 50 . . ; 51 . . ; EVALUATE THE VARIABLES AND CREATE AN ATTRIBUTE MAP 52 . . ; 53 . . S RATTR=$$SETATTR(SNOIEN) ; SET THE ATTRIBUTE STRING BASED ON THE VARS 54 . . S @SNOBASE@("ATTR",SNOIEN)=RATTR ; SAVE THE ATRIBUTES FOR THIS DRUG 55 . . ; 56 . . N CATNAME,CATTBL 57 . . S CATNAME="" 58 . . D CPUSH(.CATNAME,SNOBASE,"SNOTBL",SNOIEN,RATTR) ; ADD TO CATEGORY 59 . . ; W "CATEGORY NAME: ",CATNAME,! 60 . . ; 61 61 . S SNOIEN=$O(@GMRBASE@(SNOIEN)) ; NEXT RECORD 62 62 . S @SNOBASE@("RESUME")=SNOIEN ; WHERE WE ARE LEAVING OFF THIS RUN … … 183 183 N SNOI,SNOJ,SNOK,SNOSNO,SNOSEC,SNOIEN,SNOOLD,SNOSRCH 184 184 D DO^KBAICX1 ; INITIALIZE GPLSAV VARIABLES 185 S SAVBASE=$NA(^TMP("GPLSAV","VARS")) 185 ;S SAVBASE=$NA(^TMP("GPLSAV","VARS")) 186 S SAVBASE=$NA(@SNOBASE@("VARS")) 186 187 S CSVARY=$NA(^TMP("GPLSNO","CSV")) 187 188 K @CSVARY 188 D PUSH^GPLXPATH(CSVARY," OLDCODE|GMRText|MediationCode|MediationText") ; header for CSV file189 D PUSH^GPLXPATH(CSVARY,"VUID|VUIDText|MediationCode|MediationText") ; header for CSV file 189 190 S SNOI="" 190 191 F D Q:$O(@SAVBASE@(SNOI))="" ;THE WHOLE LIST … … 197 198 . S SNOSEC=$P(SNOJ,"^",5) ; SECTION OF SNOMED FOR THIS CODE 198 199 . S SNOOLD=$P(SNOJ,"^",7) ; OLD NUMBER FOR THIS CODE 199 . D PUSH^GPLXPATH(CSVARY,SNOOLD_"|"_$P(SNOSRCH," ALLERGY",1)_"|"_SNOSNO_"|"_SNOSRCH_"("_SNOSEC_")") 200 . S SNOVUID=$P(SNOJ,"^",9) ; VUID FOR THIS RECORD 201 . S SNOTXT=$P(SNOJ,"^",10) ; NOMED TEXT FOR CODE 202 . D PUSH^GPLXPATH(CSVARY,SNOVUID_"|"_$P(SNOSRCH," ALLERGY",1)_"|"_SNOSNO_"|"_SNOTXT) 200 203 . W "SEARCH:",SNOSRCH," IEN:",SNOIEN," CODE:",SNOSNO," SEC:",SNOSEC," OLD:",SNOOLD,! 201 204 . W SNOK,! … … 204 207 D PARY^GPLXPATH(CSVARY) 205 208 S OFILE="GMR_ALLERGY_MAPPING_TABLE.csv" 206 S ODIR="/home/ glilly/"209 S ODIR="/home/vademo2/" 207 210 S ZY=$$OUTPUT^GPLXPATH(OARY,OFILE,ODIR) 208 211 I ZY W "WROTE ",OFILE," to ",ODIR,!
Note:
See TracChangeset
for help on using the changeset viewer.