Changeset 217


Ignore:
Timestamp:
Oct 12, 2008, 11:36:54 PM (16 years ago)
Author:
George Lilly
Message:

routine to look up SNOMED codes for drug allergies in the lexicon

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccr/trunk/p/CCRUTIL.m

    r187 r217  
    7979 Q ZCNT
    8080 ;
     81DA2SNO(RTN,DNAME) ; LOOK UP DRUG ALLERGY CODE IN ^LEX
     82 ; RETURNS AN ARRAY RTN PASSED BY REFERENCE
     83 ; THIS ROUTINE CAN BE USED AS AN RPC
     84 ; RTN(0) IS THE NUMBER OF ELEMENTS IN THE ARRAY
     85 ; RTN(1) IS THE SNOMED CODE FOR THE DRUG ALLERGY
     86 ;
     87 N LEXIEN
     88 I $O(^LEX(757.21,"ADIS",DNAME))'="" D  ; IEN FOUND FOR THIS DRUG
     89 . S LEXIEN=$O(^LEX(757.21,"ADIS",DNAME)) ; GET THE IEN IN THE LEXICON
     90 . S RTN(1)=$P(^LEX(757.02,LEXIEN,0),"^",2) ; SNOMED CODE IN P2
     91 . S RTN(0)=1 ; ONE THING RETURNED
     92 E  S RTN(0)=0 ; NOT FOUND
     93 Q
     94 ;
     95DASNO(DANAME) ; PRINTS THE SNOMED CODE FOR ALLERGY TO DRUG DANAME
     96 ;
     97 N DARTN
     98 D DA2SNO(.DARTN,DANAME) ; CALL THE LOOKUP ROUTINE
     99 I DARTN(0)>0 D  ; GOT RESULTS
     100 . W !,RTN(1) ;PRINT THE SNOMED CODE
     101 E  W !,"NOT FOUND",!
     102 Q
     103 ;
Note: See TracChangeset for help on using the changeset viewer.