updated alert coding analysis
This commit is contained in:
parent
d8b48f2e5d
commit
879c00d44a
43
p/KBAICSNA.m
43
p/KBAICSNA.m
|
@ -42,22 +42,22 @@ ANALYZE(BEGIEN,IENCNT) ; SNOMED RETRIEVAL ANALYSIS ROUTINE
|
||||||
. N SNORTN,TTERM ; RETURN ARRAY
|
. N SNORTN,TTERM ; RETURN ARRAY
|
||||||
. S TTERM=$P(@GMRBASE@(SNOIEN,0),"^",1)_" ALLERGY"
|
. S TTERM=$P(@GMRBASE@(SNOIEN,0),"^",1)_" ALLERGY"
|
||||||
. D TEXTRPC(.SNORTN,TTERM)
|
. D TEXTRPC(.SNORTN,TTERM)
|
||||||
. I '$D(SNORTN) Q ;
|
. I $D(SNORTN) D ;
|
||||||
. S TVUID=$$GET1^DIQ(120.82,SNOIEN,"VUID")
|
. . S TVUID=$$GET1^DIQ(120.82,SNOIEN,"VUID")
|
||||||
. W "VUID:",VUID,!
|
. . W "VUID:",TVUID,!
|
||||||
. K @SNOBASE@("VARS",SNOIEN) ; CLEAR OUT OLD VARS
|
. . K @SNOBASE@("VARS",SNOIEN) ; CLEAR OUT OLD VARS
|
||||||
. I $P(TTMP,"^",1)=1 S @SNOBASE@("VARS",SNOIEN)=TTERM_"^"_TTMP_"^"_SNORTN(0)
|
. . I $P(TTMP,"^",1)=1 S @SNOBASE@("VARS",SNOIEN)=TTERM_"^"_TTMP_"^"_SNORTN(0)_"^"_TVUID_"^"_SNORTN("F")
|
||||||
. ;
|
. . ;
|
||||||
. ; EVALUATE THE VARIABLES AND CREATE AN ATTRIBUTE MAP
|
. . ; EVALUATE THE VARIABLES AND CREATE AN ATTRIBUTE MAP
|
||||||
. ;
|
. . ;
|
||||||
. S RATTR=$$SETATTR(SNOIEN) ; SET THE ATTRIBUTE STRING BASED ON THE VARS
|
. . S RATTR=$$SETATTR(SNOIEN) ; SET THE ATTRIBUTE STRING BASED ON THE VARS
|
||||||
. S @SNOBASE@("ATTR",SNOIEN)=RATTR ; SAVE THE ATRIBUTES FOR THIS DRUG
|
. . S @SNOBASE@("ATTR",SNOIEN)=RATTR ; SAVE THE ATRIBUTES FOR THIS DRUG
|
||||||
. ;
|
. . ;
|
||||||
. N CATNAME,CATTBL
|
. . N CATNAME,CATTBL
|
||||||
. S CATNAME=""
|
. . S CATNAME=""
|
||||||
. D CPUSH(.CATNAME,SNOBASE,"SNOTBL",SNOIEN,RATTR) ; ADD TO CATEGORY
|
. . D CPUSH(.CATNAME,SNOBASE,"SNOTBL",SNOIEN,RATTR) ; ADD TO CATEGORY
|
||||||
. ; W "CATEGORY NAME: ",CATNAME,!
|
. . ; W "CATEGORY NAME: ",CATNAME,!
|
||||||
. ;
|
. . ;
|
||||||
. S SNOIEN=$O(@GMRBASE@(SNOIEN)) ; NEXT RECORD
|
. S SNOIEN=$O(@GMRBASE@(SNOIEN)) ; NEXT RECORD
|
||||||
. S @SNOBASE@("RESUME")=SNOIEN ; WHERE WE ARE LEAVING OFF THIS RUN
|
. S @SNOBASE@("RESUME")=SNOIEN ; WHERE WE ARE LEAVING OFF THIS RUN
|
||||||
; D PARY^GPLXPATH(@SNOBASE@("ATTRTBL"))
|
; D PARY^GPLXPATH(@SNOBASE@("ATTRTBL"))
|
||||||
|
@ -182,10 +182,11 @@ REUSE ; GET SAVED VALUES FROM ^TMP("GPLSAV") AND PUT THEM IN A DATABASE
|
||||||
D AINIT
|
D AINIT
|
||||||
N SNOI,SNOJ,SNOK,SNOSNO,SNOSEC,SNOIEN,SNOOLD,SNOSRCH
|
N SNOI,SNOJ,SNOK,SNOSNO,SNOSEC,SNOIEN,SNOOLD,SNOSRCH
|
||||||
D DO^KBAICX1 ; INITIALIZE GPLSAV VARIABLES
|
D DO^KBAICX1 ; INITIALIZE GPLSAV VARIABLES
|
||||||
S SAVBASE=$NA(^TMP("GPLSAV","VARS"))
|
;S SAVBASE=$NA(^TMP("GPLSAV","VARS"))
|
||||||
|
S SAVBASE=$NA(@SNOBASE@("VARS"))
|
||||||
S CSVARY=$NA(^TMP("GPLSNO","CSV"))
|
S CSVARY=$NA(^TMP("GPLSNO","CSV"))
|
||||||
K @CSVARY
|
K @CSVARY
|
||||||
D PUSH^GPLXPATH(CSVARY,"OLDCODE|GMRText|MediationCode|MediationText") ; header for CSV file
|
D PUSH^GPLXPATH(CSVARY,"VUID|VUIDText|MediationCode|MediationText") ; header for CSV file
|
||||||
S SNOI=""
|
S SNOI=""
|
||||||
F D Q:$O(@SAVBASE@(SNOI))="" ;THE WHOLE LIST
|
F D Q:$O(@SAVBASE@(SNOI))="" ;THE WHOLE LIST
|
||||||
. S SNOI=$O(@SAVBASE@(SNOI))
|
. S SNOI=$O(@SAVBASE@(SNOI))
|
||||||
|
@ -196,14 +197,16 @@ REUSE ; GET SAVED VALUES FROM ^TMP("GPLSAV") AND PUT THEM IN A DATABASE
|
||||||
. S SNOSNO=$P(SNOJ,"^",4) ; SNOMED CODE
|
. S SNOSNO=$P(SNOJ,"^",4) ; SNOMED CODE
|
||||||
. S SNOSEC=$P(SNOJ,"^",5) ; SECTION OF SNOMED FOR THIS CODE
|
. S SNOSEC=$P(SNOJ,"^",5) ; SECTION OF SNOMED FOR THIS CODE
|
||||||
. S SNOOLD=$P(SNOJ,"^",7) ; OLD NUMBER FOR THIS CODE
|
. S SNOOLD=$P(SNOJ,"^",7) ; OLD NUMBER FOR THIS CODE
|
||||||
. D PUSH^GPLXPATH(CSVARY,SNOOLD_"|"_$P(SNOSRCH," ALLERGY",1)_"|"_SNOSNO_"|"_SNOSRCH_"("_SNOSEC_")")
|
. S SNOVUID=$P(SNOJ,"^",9) ; VUID FOR THIS RECORD
|
||||||
|
. S SNOTXT=$P(SNOJ,"^",10) ; NOMED TEXT FOR CODE
|
||||||
|
. D PUSH^GPLXPATH(CSVARY,SNOVUID_"|"_$P(SNOSRCH," ALLERGY",1)_"|"_SNOSNO_"|"_SNOTXT)
|
||||||
. W "SEARCH:",SNOSRCH," IEN:",SNOIEN," CODE:",SNOSNO," SEC:",SNOSEC," OLD:",SNOOLD,!
|
. W "SEARCH:",SNOSRCH," IEN:",SNOIEN," CODE:",SNOSNO," SEC:",SNOSEC," OLD:",SNOOLD,!
|
||||||
. W SNOK,!
|
. W SNOK,!
|
||||||
. W SNOJ,!
|
. W SNOJ,!
|
||||||
S OARY=$NA(@CSVARY@(1)) ; SETUP FOR OUTPUT ROUTINE
|
S OARY=$NA(@CSVARY@(1)) ; SETUP FOR OUTPUT ROUTINE
|
||||||
D PARY^GPLXPATH(CSVARY)
|
D PARY^GPLXPATH(CSVARY)
|
||||||
S OFILE="GMR_ALLERGY_MAPPING_TABLE.csv"
|
S OFILE="GMR_ALLERGY_MAPPING_TABLE.csv"
|
||||||
S ODIR="/home/glilly/"
|
S ODIR="/home/vademo2/"
|
||||||
S ZY=$$OUTPUT^GPLXPATH(OARY,OFILE,ODIR)
|
S ZY=$$OUTPUT^GPLXPATH(OARY,OFILE,ODIR)
|
||||||
I ZY W "WROTE ",OFILE," to ",ODIR,!
|
I ZY W "WROTE ",OFILE," to ",ODIR,!
|
||||||
Q
|
Q
|
||||||
|
|
Loading…
Reference in New Issue