deleted unneeded files not required for package operation.

KBAI* not in namespace.
LA7QRY1 renamed to C0CQRY1.
VWTIME is part of another package.
This commit is contained in:
sam 2012-10-02 01:14:28 +00:00
parent 7b9ca21049
commit e17daf40d2
4 changed files with 0 additions and 665 deletions

View File

@ -1,213 +0,0 @@
KBAICSNA ; CCDCCR/GPL - SNOMED CT ANALYSIS ROUTINES; 10/14/08
;;0.1;CCDCCR;nopatch;noreleasedate
;Copyright 2008 WorldVistA. Licensed under the terms of the GNU
;General Public License See attached copy of the License.
;
;This program is free software; you can redistribute it and/or modify
;it under the terms of the GNU General Public License as published by
;the Free Software Foundation; either version 2 of the License, or
;(at your option) any later version.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License along
;with this program; if not, write to the Free Software Foundation, Inc.,
;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
;
; THESE ROUTINES ANALYZE THE POTENTIAL RETRIEVAL OF SNOMED CT CODES
; FOR PATIENT DRUG ALLERGIES FOR INCLUSION IN THE CCR OR CCD
; USING THE VISTA LEXICON ^LEX
;
ANALYZE(BEGIEN,IENCNT) ; SNOMED RETRIEVAL ANALYSIS ROUTINE
; BEGINS AT BEGIEN AND GOES FOR IENCNT DRUGS IN GMRD
; TO RESUME AT NEXT DRUG, USE BEGIEN=""
; USE RESET^KBAICSNA TO RESET TO TOP OF DRUG LIST
;
N SNOARY,SNOTMP,SNOI,SNOIEN,RATTR
N CCRGLO
D ASETUP ; SET UP VARIABLES AND GLOBALS
D AINIT ; INITIALIZE ATTRIBUTE VALUE TABLE
I '$D(@SNOBASE@("RESUME")) S @SNOBASE@("RESUME")=$O(@GMRBASE@(1)) ;1ST TME
S RESUME=@SNOBASE@("RESUME") ; WHERE WE LEFT OFF LAST RUN
S SNOIEN=BEGIEN ; BEGIN WITH THE BEGIEN RECORD
I SNOIEN="" S SNOIEN=RESUME
I +SNOIEN=0 D Q ; AT THE END OF THE ALLERGY LIST
. W "END OF DRUG LIST, CALL RESET^KBAICSNA",!
F SNOI=1:1:IENCNT D Q:+SNOIEN=0 ; FOR IENCNT NUMBER OF PATIENTS OR END
. ;D CCRRPC^GPLCCR(.CCRGLO,SNOIEN,"CCR","","","") ;PROCESS THE CCR
. W SNOIEN,@GMRBASE@(SNOIEN,0),!
. N SNORTN,TTERM ; RETURN ARRAY
. S TTERM=$P(@GMRBASE@(SNOIEN,0),"^",1)_" ALLERGY"
. D TEXTRPC(.SNORTN,TTERM)
. I $D(SNORTN) D ;
. . S TVUID=$$GET1^DIQ(120.82,SNOIEN,"VUID")
. . W "VUID:",TVUID,!
. . K @SNOBASE@("VARS",SNOIEN) ; CLEAR OUT OLD VARS
. . I $P(TTMP,"^",1)=1 S @SNOBASE@("VARS",SNOIEN)=TTERM_"^"_TTMP_"^"_SNORTN(0)_"^"_TVUID_"^"_SNORTN("F")
. . ;
. . ; EVALUATE THE VARIABLES AND CREATE AN ATTRIBUTE MAP
. . ;
. . S RATTR=$$SETATTR(SNOIEN) ; SET THE ATTRIBUTE STRING BASED ON THE VARS
. . S @SNOBASE@("ATTR",SNOIEN)=RATTR ; SAVE THE ATRIBUTES FOR THIS DRUG
. . ;
. . N CATNAME,CATTBL
. . S CATNAME=""
. . D CPUSH(.CATNAME,SNOBASE,"SNOTBL",SNOIEN,RATTR) ; ADD TO CATEGORY
. . ; W "CATEGORY NAME: ",CATNAME,!
. . ;
. S SNOIEN=$O(@GMRBASE@(SNOIEN)) ; NEXT RECORD
. S @SNOBASE@("RESUME")=SNOIEN ; WHERE WE ARE LEAVING OFF THIS RUN
; D PARY^GPLXPATH(@SNOBASE@("ATTRTBL"))
Q
;
TEXTRPC(ORTN,ITEXT) ; CALL THE LEXICON WITH ITEXT AND RETURN RESULTS IN ORTN
;
;N TTMP
W ITEXT,!
S TTMP=$$TEXT^LEXTRAN(ITEXT,"","","SCT","ORTN")
Q
;
ASETUP ; SET UP GLOBALS AND VARS SNOBASE AND SNOTBL
I '$D(SNOBASE) S SNOBASE=$NA(^TMP("GPLSNO"))
I '$D(@SNOBASE) S @SNOBASE=""
I '$D(GMRBASE) S GMRBASE=$NA(^GMRD(120.82))
I '$D(SNOTBL) S SNOTBL=$NA(^TMP("GPLSNO","SNOTBL","TABLE")) ; ATTR TABLE
S ^TMP("GPLSNO","TABLES","SNOTBL")=SNOTBL ; TABLE OF TABLES
Q
;
AINIT ; INITIALIZE ATTRIBUTE TABLE
I '$D(SNOBASE) D ASETUP ; FOR COMMAND LINE CALLS
K @SNOTBL
D APUSH^GPLRIMA(SNOTBL,"CODE")
D APUSH^GPLRIMA(SNOTBL,"NOCODE")
D APUSH^GPLRIMA(SNOTBL,"MULTICODE")
D APUSH^GPLRIMA(SNOTBL,"SUBMULTI")
D APUSH^GPLRIMA(SNOTBL,"DONE")
Q
APOST(PRSLT,PTBL,PVAL) ; POST AN ATTRIBUTE PVAL TO PRSLT USING PTBL
; PSRLT AND PTBL ARE PASSED BY NAME. PVAL IS A STRING
; PTBL IS THE NAME OF A TABLE IN @SNOBASE@("TABLES") - "SNOTBL"=ALL VALUES
; PVAL WILL BE PLACED IN THE STRING PRSLT AT $P(X,U,@PTBL@(PVAL))
I '$D(SNOBASE) D ASETUP ; FOR COMMANDLINE PROCESSING
N USETBL
I '$D(@SNOBASE@("TABLES",PTBL)) D Q ; NO TABLE
. W "ERROR NO SUCH TABLE",!
S USETBL=@SNOBASE@("TABLES",PTBL)
S $P(@PRSLT,U,@USETBL@(PVAL))=PVAL
Q
SETATTR(SDFN) ; SET ATTRIBUTES BASED ON VARS
N SBASE,SATTR
S SBASE=$NA(@SNOBASE@("VARS",SDFN))
D APOST("SATTR","SNOTBL","DONE")
I $P(TTMP,"^",1)=1 D APOST("SATTR","SNOTBL","CODE")
I $P(TTMP,"^",1)=-1 D APOST("SATTR","SNOTBL","NOCODE")
Q SATTR ; GPL
I $D(@SBASE@("PROBLEMS",1)) D ;
. D APOST("SATTR","SNOTBL","PROBLEMS")
. ; W "POSTING PROBLEMS",!
I $D(@SBASE@("VITALS",1)) D APOST("SATTR","SNOTBL","VITALS")
I $D(@SBASE@("MEDS",1)) D ; IF THE PATIENT HAS MEDS VARIABLES
. D APOST("SATTR","SNOTBL","MEDS")
. N ZR,ZI
. D GETPA^GPLRIMA(.ZR,SDFN,"MEDS","MEDPRODUCTNAMECODEVALUE") ;CHECK FOR MED CODES
. I ZR(0)>0 D ; VAR LOOKUP WAS GOOD, CHECK FOR NON=NULL RETURN
. . F ZI=1:1:ZR(0) D ; LOOP THROUGH RETURNED VAR^VALUE PAIRS
. . . I $P(ZR(ZI),"^",2)'="" D APOST("SATTR","SNOTBL","MEDSCODE") ;CODES
. ; D PATD^KBAICSNA(2,"MEDS","MEDPRODUCTNAMECODEVALUE") CHECK FOR MED CODES
D APOST("SATTR","SNOTBL","NOTEXTRACTED") ; OUTPUT NOT YET PRODUCED
; W "ATTRIBUTES: ",SATTR,!
Q SATTR
;
RESET ; KILL RESUME INDICATOR TO START OVER. ALSO KILL SNO TMP VALUES
K ^TMP("GPLSNO","RESUME")
K ^TMP("GPLSNO")
Q
;
CLIST ; LIST THE CATEGORIES
;
I '$D(SNOBASE) D ASETUP ; FOR COMMAND LINE CALLS
N CLBASE,CLNUM,ZI,CLIDX
S CLBASE=$NA(@SNOBASE@("SNOTBL","CATS"))
S CLNUM=@CLBASE@(0)
F ZI=1:1:CLNUM D ; LOOP THROUGH THE CATEGORIES
. S CLIDX=@CLBASE@(ZI)
. W "(",$P(@CLBASE@(CLIDX),"^",1)
. W ":",$P(@CLBASE@(CLIDX),"^",2),") "
. W CLIDX,!
; D PARY^GPLXPATH(CLBASE)
Q
;
CPUSH(CATRTN,CBASE,CTBL,CDFN,CATTR) ; ADD PATIENTS TO CATEGORIES
; AND PASS BACK THE NAME OF THE CATEGORY TO WHICH THE PATIENT
; WAS ADDED IN CATRTN, WHICH IS PASSED BY REFERENCE
; CBASE IS WHERE TO PUT THE CATEGORIES PASSED BY NAME
; CTBL IS THE NAME OF THE TABLE USED TO CREATE THE ATTRIBUTES,
; PASSED BY NAME AND USED TO CREATE CATEGORY NAMES IE "@CTBL_X"
; WHERE X IS THE CATEGORY NUMBER. CTBL(0) IS THE NUMBER OF CATEGORIES
; CATBL(X)=CATTR STORES THE ATTRIBUTE IN THE CATEGORY
; CDFN IS THE PATIENT DFN, CATTR IS THE ATTRIBUTE STRING
; THE LIST OF PATIENTS IN A CATEGORY IS STORED INDEXED BY CATEGORY
; NUMBER IE CTBL_X(CDFN)=""
;
; N CCTBL,CENTRY,CNUM,CCOUNT,CPATLIST
S CCTBL=$NA(@CBASE@(CTBL,"CATS"))
; W "CBASE: ",CCTBL,!
;
I '$D(@CCTBL@(CATTR)) D ; FIRST PATIENT IN THIS CATEGORY
. D PUSH^GPLXPATH(CCTBL,CATTR) ; ADD THE CATEGORY TO THE ARRAY
. S CNUM=@CCTBL@(0) ; ARRAY ENTRY NUMBER FOR THIS CATEGORY
. S CENTRY=CTBL_"_"_CNUM_U_0 ; TABLE ENTRY DEFAULT
. S @CCTBL@(CATTR)=CENTRY ; DEFAULT NON INCREMENTED TABLE ENTRY
. ; NOTE THAT P1 IS THE CATEGORY NAME MADE UP OF THE TABLE NAME
. ; AND CATGORY ARRAY NUMBER. P2 IS THE COUNT WHICH IS INITIALLY 0
;
S CCOUNT=$P(@CCTBL@(CATTR),U,2) ; COUNT OF PATIENTS IN THIS CATEGORY
S CCOUNT=CCOUNT+1 ; INCREMENT THE COUNT
S $P(@CCTBL@(CATTR),U,2)=CCOUNT ; PUT IT BACK
;
S CATRTN=$P(@CCTBL@(CATTR),U,1) ; THE CATEGORY NAME WHICH IS RETURNED
;
S CPATLIST=$NA(@CBASE@(CTBL,"IENS",CATRTN)) ; BASE OF PAT LIST FOR THIS CAT
; W "IENS BASE: ",CPATLIST,!
S @CPATLIST@(CDFN)="" ; ADD THIS PATIENT TO THE CAT PAT LIST
;
Q
;
REUSE ; GET SAVED VALUES FROM ^TMP("GPLSAV") AND PUT THEM IN A DATABASE
;
D ASETUP
D AINIT
N SNOI,SNOJ,SNOK,SNOSNO,SNOSEC,SNOIEN,SNOOLD,SNOSRCH
D DO^KBAICX1 ; INITIALIZE GPLSAV VARIABLES
;S SAVBASE=$NA(^TMP("GPLSAV","VARS"))
S SAVBASE=$NA(@SNOBASE@("VARS"))
S CSVARY=$NA(^TMP("GPLSNO","CSV"))
K @CSVARY
D PUSH^GPLXPATH(CSVARY,"VUID|VUIDText|MediationCode|MediationText") ; header for CSV file
S SNOI=""
F D Q:$O(@SAVBASE@(SNOI))="" ;THE WHOLE LIST
. S SNOI=$O(@SAVBASE@(SNOI))
. S SNOJ=@SAVBASE@(SNOI)
. S SNOK=$P($P(SNOJ,"^",1)," ALLERGY",1)
. S SNOSRCH=$P(SNOJ,"^",1) ;SEARCH TERM USED TO OBTAIN SNOMED CODE
. S SNOIEN=$P(SNOJ,"^",3) ; IEN OF ELEMENT IN LEXICON
. S SNOSNO=$P(SNOJ,"^",4) ; SNOMED CODE
. S SNOSEC=$P(SNOJ,"^",5) ; SECTION OF SNOMED FOR THIS CODE
. S SNOOLD=$P(SNOJ,"^",7) ; OLD NUMBER FOR THIS CODE
. 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 SNOK,!
. W SNOJ,!
S OARY=$NA(@CSVARY@(1)) ; SETUP FOR OUTPUT ROUTINE
D PARY^GPLXPATH(CSVARY)
S OFILE="GMR_ALLERGY_MAPPING_TABLE.csv"
S ODIR="/home/vademo2/"
S ZY=$$OUTPUT^GPLXPATH(OARY,OFILE,ODIR)
I ZY W "WROTE ",OFILE," to ",ODIR,!
Q
;

View File

@ -1,90 +0,0 @@
KBAICX1 ; CCDCCR/GPL - LOADS SNOMED CODES INTO ^TMP; 10/15/08
;;0.2;CCDCCR;nopatch;noreleasedate
DO ;
S ^TMP("GPLSAV","VARS",3)="CHOCOLATE ALLERGY^1^7476359^300912001^disorder^20050701^F-C3111^1"
S ^TMP("GPLSAV","VARS",6)="STRAWBERRIES ALLERGY^1^7164395^91938006^disorder^20050701^D5-00331^1"
S ^TMP("GPLSAV","VARS",7)="EGGS ALLERGY^1^7164379^91930004^disorder^20050701^D5-00340^1"
S ^TMP("GPLSAV","VARS",9)="POLLEN ALLERGY^1^7476355^300910009^disorder^20050701^F-C310E^1"
S ^TMP("GPLSAV","VARS",10)="MOLD ALLERGY^1^7942600^419474003^disorder^20050701^F-C3128^1"
S ^TMP("GPLSAV","VARS",13)="ANIMAL HAIR ALLERGY^1^7476357^300911008^disorder^20050701^F-C310F^1"
S ^TMP("GPLSAV","VARS",14)="DUST ALLERGY^1^7561285^390952000^disorder^20050701^F-C300E^1"
S ^TMP("GPLSAV","VARS",15)="IODINE ALLERGY^1^7464505^294914009^disorder^20050701^DF-1006F^1"
S ^TMP("GPLSAV","VARS",20)="CHEESE ALLERGY^1^7476363^300914000^disorder^20050701^D5-00305^1"
S ^TMP("GPLSAV","VARS",22)="CITRUS ALLERGY^1^7939822^418085001^disorder^20050701^D5-00335^1"
S ^TMP("GPLSAV","VARS",24)="CORN ALLERGY^1^7942798^419573007^disorder^20050701^F-C3144^1"
S ^TMP("GPLSAV","VARS",26)="FISH ALLERGY^1^7608411^417532002^disorder^20050701^D5-00322^1"
S ^TMP("GPLSAV","VARS",29)="MILK ALLERGY^1^7414545^266931007^finding^20050701^C-F2979^1"
S ^TMP("GPLSAV","VARS",31)="NUTS ALLERGY^1^7164387^91934008^disorder^20050701^D5-00310^1"
S ^TMP("GPLSAV","VARS",33)="PEPPERMINT ALLERGY^1^7462059^293690005^disorder^20050701^DF-10F75^1"
S ^TMP("GPLSAV","VARS",36)="PORK ALLERGY^1^7939488^417918006^disorder^20050701^F-C312B^1"
S ^TMP("GPLSAV","VARS",37)="POTATO ALLERGY^1^7942890^419619007^disorder^20050701^F-C3136^1"
S ^TMP("GPLSAV","VARS",40)="SHRIMP ALLERGY^1^7943596^419972009^disorder^20050701^D5-00325^1"
S ^TMP("GPLSAV","VARS",44)="TOMATO ALLERGY^1^7941210^418779002^disorder^20050701^F-C3131^1"
S ^TMP("GPLSAV","VARS",46)="WHEAT ALLERGY^1^7944000^420174000^disorder^20050701^F-C3132^1"
S ^TMP("GPLSAV","VARS",52)="ALCOHOL ALLERGY^1^7463339^294330005^disorder^20050701^DF-1120D^1"
S ^TMP("GPLSAV","VARS",55)="ASCORBIC ACID ALLERGY^1^7464557^294940003^disorder^20050701^DF-10089^1"
S ^TMP("GPLSAV","VARS",56)="ASPARTAME ALLERGY^1^7942012^419180003^disorder^20050701^F-C312A^1"
S ^TMP("GPLSAV","VARS",57)="ASPIRIN ALLERGY^1^7461853^293586001^disorder^20050701^DF-10F0E^1"
S ^TMP("GPLSAV","VARS",62)="BOTULISM ANTITOXIN ALLERGY^1^7464013^294668002^disorder^20050701^DF-11358^1"
S ^TMP("GPLSAV","VARS",65)="CAFFEINE ALLERGY^1^7940340^418344001^disorder^20050701^DF-1144C^1"
S ^TMP("GPLSAV","VARS",66)="CALCITONIN, SALMON ALLERGY^1^7464357^294840004^disorder^20050701^DF-113FF^1"
S ^TMP("GPLSAV","VARS",69)="CETYLPYRIDINIUM ALLERGY^1^7463559^294441006^disorder^20050701^DF-1127A^1"
S ^TMP("GPLSAV","VARS",92)="FLUPHENAZINE DECANOATE ALLERGY^1^7462541^293931005^disorder^20050701^DF-11062^1"
S ^TMP("GPLSAV","VARS",94)="GELATIN ALLERGY^1^7464371^294847001^disorder^20050701^F-C3116^1"
S ^TMP("GPLSAV","VARS",98)="INSULIN ALLERGY^1^7464105^294714000^disorder^20050701^DF-11384^1"
S ^TMP("GPLSAV","VARS",109)="POVIDONE IODINE ALLERGY^1^7464509^294916006^disorder^20050701^DF-10073^1"
S ^TMP("GPLSAV","VARS",116)="SALICYLIC ACID ALLERGY^1^7463081^294201000^disorder^20050701^DF-1118F^1"
S ^TMP("GPLSAV","VARS",122)="TESTOSTERONE ALLERGY^1^7464229^294776007^disorder^20050701^DF-113C0^1"
S ^TMP("GPLSAV","VARS",125)="PENICILLIN ALLERGY^1^7164391^91936005^disorder^20050701^DF-10074^1"
S ^TMP("GPLSAV","VARS",131)="PEANUTS ALLERGY^1^7164389^91935009^disorder^20050701^D5-00311^1"
S ^TMP("GPLSAV","VARS",138)="APPLE JUICE ALLERGY^1^7940280^418314004^disorder^20050701^D5-00333^1"
S ^TMP("GPLSAV","VARS",144)="SULFA DRUGS ALLERGY^1^7164397^91939003^disorder^20050701^DF-10072^1"
S ^TMP("GPLSAV","VARS",161)="FERROUS SULFATE ALLERGY^1^7464481^294902001^disorder^20050701^DF-1006B^1"
S ^TMP("GPLSAV","VARS",199)="CONTRAST MEDIA ALLERGY^1^7461955^293637006^disorder^20050701^DF-10F41^1"
S ^TMP("GPLSAV","VARS",203)="WASP VENOM ALLERGY^1^7508115^320868003^product^20050701^C-B0508^1"
S ^TMP("GPLSAV","VARS",210)="COCONUT OIL ALLERGY^1^7943280^419814004^disorder^20050701^DF-1144E^1"
S ^TMP("GPLSAV","VARS",257)="NICKEL ALLERGY^1^7943228^419788000^disorder^20050701^F-C313B^1"
S ^TMP("GPLSAV","VARS",268)="MILDEW ALLERGY^1^7942600^419474003^disorder^20050701^F-C3128^1"
S ^TMP("GPLSAV","VARS",272)="METAL ALLERGY^1^7476365^300915004^disorder^20050701^F-C3112^1"
S ^TMP("GPLSAV","VARS",273)="METOCLOPRAMIDE ALLERGY^1^7462029^293675006^disorder^20050701^DF-10F66^1"
S ^TMP("GPLSAV","VARS",276)="MEAT ALLERGY^1^7941282^418815008^disorder^20050701^F-C312C^1"
S ^TMP("GPLSAV","VARS",289)="LEGUMES ALLERGY^1^7592039^409136006^disorder^20050701^F-C3123^1"
S ^TMP("GPLSAV","VARS",318)="VEGETABLES ALLERGY^1^7592039^409136006^disorder^20050701^F-C3123^1"
S ^TMP("GPLSAV","VARS",325)="TREE POLLEN ALLERGY^1^7942178^419263009^disorder^20050701^F-C3139^1"
S ^TMP("GPLSAV","VARS",337)="TAPE ALLERGY^1^7585411^405649006^disorder^20050701^F-C3122^1"
S ^TMP("GPLSAV","VARS",348)="SUNLIGHT ALLERGY^1^7399083^258155009^disorder^20050701^D0-75245^1"
S ^TMP("GPLSAV","VARS",355)="STRAW ALLERGY^1^7164395^91938006^disorder^20050701^D5-00331^1"
S ^TMP("GPLSAV","VARS",374)="SMALLPOX VACCINE ALLERGY^1^7463991^294657002^disorder^20050701^DF-1134D^1"
S ^TMP("GPLSAV","VARS",390)="WOOD ALLERGY^1^7579397^402595004^disorder^20050701^F-C311A^1"
S ^TMP("GPLSAV","VARS",394)="WEED POLLEN ALLERGY^1^7942072^419210001^disorder^20050701^F-C313A^1"
S ^TMP("GPLSAV","VARS",399)="SALT ALLERGY^1^7464471^294897002^disorder^20050701^DF-10066^1"
S ^TMP("GPLSAV","VARS",407)="RUBBER ALLERGY^1^7942476^419412007^disorder^20050701^F-C312E^1"
S ^TMP("GPLSAV","VARS",455)="PESTICIDES ALLERGY^1^7463933^294628001^disorder^20050701^DF-11332^1"
S ^TMP("GPLSAV","VARS",457)="PERFUME ALLERGY^1^7476351^300908007^disorder^20050701^F-C310D^1"
S ^TMP("GPLSAV","VARS",461)="PEPPERONI ALLERGY^1^7462059^293690005^disorder^20050701^DF-10F75^1"
S ^TMP("GPLSAV","VARS",462)="WATERMELONS ALLERGY^1^7942248^419298007^disorder^20050701^D5-00332^1"
S ^TMP("GPLSAV","VARS",464)="WALNUTS ALLERGY^1^7164399^91940001^disorder^20050701^D5-00312^1"
S ^TMP("GPLSAV","VARS",471)="SHELLFISH ALLERGY^1^7476361^300913006^disorder^20050701^D5-00321^1"
S ^TMP("GPLSAV","VARS",473)="SEAFOOD ALLERGY^1^7164393^91937001^disorder^20050701^D5-00320^1"
S ^TMP("GPLSAV","VARS",478)="RAGWEED ALLERGY^1^7940774^418561004^disorder^20050701^F-C312D^1"
S ^TMP("GPLSAV","VARS",486)="OATS ALLERGY^1^7942336^419342009^disorder^20050701^F-C3135^1"
S ^TMP("GPLSAV","VARS",488)="MUSTARD ALLERGY^1^7462171^293746007^disorder^20050701^DF-10FAB^1"
S ^TMP("GPLSAV","VARS",498)="ETHYL ALCOHOL ALLERGY^1^7943932^420140004^disorder^20050701^DF-1144D^1"
S ^TMP("GPLSAV","VARS",518)="GRASS ALLERGY^1^7941030^418689008^disorder^20050701^F-C3138^1"
S ^TMP("GPLSAV","VARS",522)="LOBSTER ALLERGY^1^7940904^418626004^disorder^20050701^D5-00323^1"
S ^TMP("GPLSAV","VARS",543)="SALMON ALLERGY^1^7464357^294840004^disorder^20050701^DF-113FF^1"
S ^TMP("GPLSAV","VARS",544)="RYE ALLERGY^1^7940020^418184004^disorder^20050701^F-C3134^1"
S ^TMP("GPLSAV","VARS",599)="BEE VENOM ALLERGY^1^7508115^320868003^product^20050701^C-B0508^1"
S ^TMP("GPLSAV","VARS",608)="ANTHRAX VACCINE ALLERGY^1^7463959^294641002^disorder^20050701^DF-1133E^1"
S ^TMP("GPLSAV","VARS",611)="ANIMAL DANDER ALLERGY^1^7351255^232347008^disorder^20050701^F-C3006^1"
S ^TMP("GPLSAV","VARS",613)="ALUMINUM ALLERGY^1^7578823^402306009^disorder^20050701^F-C3121^1"
S ^TMP("GPLSAV","VARS",621)="WOOL ALLERGY^1^7463339^294330005^disorder^20050701^DF-1120D^1"
S ^TMP("GPLSAV","VARS",634)="GRASS POLLEN ALLERGY^1^7941030^418689008^disorder^20050701^F-C3138^1"
S ^TMP("GPLSAV","VARS",645)="FRUIT ALLERGY^1^7164383^91932007^disorder^20050701^D5-00330^1"
S ^TMP("GPLSAV","VARS",686)="CITRUS FRUIT ALLERGY^1^7939822^418085001^disorder^20050701^D5-00335^1"
S ^TMP("GPLSAV","VARS",694)="DOG DANDER ALLERGY^1^7942194^419271008^disorder^20050701^F-C3014^1"
S ^TMP("GPLSAV","VARS",696)="JUICE ALLERGY^1^7940280^418314004^disorder^20050701^D5-00333^1"
S ^TMP("GPLSAV","VARS",703)="RED MEAT ALLERGY^1^7941282^418815008^disorder^20050701^F-C312C^1"
S ^TMP("GPLSAV","VARS",715)="PEPPER ALLERGY^1^7462059^293690005^disorder^20050701^DF-10F75^1"
Q
;

View File

@ -1,123 +0,0 @@
LA7QRY1 ;DALOI/JMC - Lab HL7 Query Utility ;01/19/99 13:48
;;5.2;AUTOMATED LAB INSTRUMENTS;**46,61**;Sep 27, 1994;Build 31
;
Q
;
CHKSC ; Check search NLT/LOINC codes
;
N J
;
S J=0
F S J=$O(LA7SC(J)) Q:'J D
. N X
. S X=LA7SC(J)
. I $P(X,"^",2)="NLT",$D(^LAM("E",$P(X,"^"))) D Q
. . S ^TMP("LA7-NLT",$J,$P(X,"^"))=""
. I $P(X,"^",2)="LN",$D(^LAB(95.3,$P($P(X,"^"),"-"))) D Q
. . S ^TMP("LA7-LN",$J,$P($P(X,"^"),"-"))=""
. S LA7ERR(6)="Unknown search code "_$P(X,"^")_" passed"
. K LA7SC(J)
Q
;
;
SPEC ; Convert HL7 Specimen Codes to File #61, Topography codes
; Find all topographies that use this HL7 specimen code
N J,K,L
;
S J=0
F S J=$O(LA7SPEC(J)) Q:'J D
. S K=LA7SPEC(J),L=0
. F S L=$O(^LAB(61,"HL7",K,L)) Q:'L S ^TMP("LA7-61",$J,L)=""
Q
;
;
BUILDMSG ; Build HL7 message with result of query
;
N HL,HLECH,HLFS,HLQ,LA,LA763,LA7ECH,LA7FS,LA7MSH,LA7NOMSG,LA7NTESN,LA7NVAF,LA7OBRSN,LA7OBXSN,LA7PIDSN,LA7ROOT,LA7X,X
;
I $L($G(LA7HL7))'=5 S LA7HL7="|^\~&"
S (HL("FS"),HLFS,LA7FS)=$E(LA7HL7),(HL("ECH"),HLECH,LA7ECH)=$E(LA7HL7,2,5)
S (HLQ,HL("Q"))=""""""
; Set flag to not send HL7 message
S LA7NOMSG=1
; Create dummy MSH to pass HL7 delimiters
S LA7MSH(0)="MSH"_LA7FS_LA7ECH_LA7FS
D FILESEG^LA7VHLU(GBL,.LA7MSH)
;
F X="AUTO-INST","LRDFN","LRIDT","SUB","HUID","NLT","RUID","SITE" S LA(X)=""
;
; Take search results and put in HL7 message structure
S LA7ROOT="^TMP(""LA7-QRY"",$J)",(LA7QUIT,LA7PIDSN)=0
; F S LA7ROOT=$Q(@LA7ROOT) Q:LA7QUIT D ;change per John M
F S LA7ROOT=$Q(@LA7ROOT) Q:LA7ROOT="" D Q:LA7QUIT
. I $QS(LA7ROOT,1)'="LA7-QRY"!($QS(LA7ROOT,2)'=$J) S LA7QUIT=1 Q
. I LA("LRDFN")'=$QS(LA7ROOT,3) D PID S LA7OBRSN=0
. I LA("LRIDT")'=$QS(LA7ROOT,4) D ORC,OBR
. I LA("SUB")'=$QS(LA7ROOT,5) D ORC,OBR
. I LA("NLT")'=$P($QS(LA7ROOT,6),"!") D ORC,OBR
. D OBX
;
Q
;
;
PID ; Build PID segment
;
N LA7PID
;
S (LA("LRDFN"),LRDFN)=$QS(LA7ROOT,3)
S LRDPF=$P(^LR(LRDFN,0),"^",2),DFN=$P(^(0),"^",3)
D DEM^LRX
D PID^LA7VPID(LA("LRDFN"),"",.LA7PID,.LA7PIDSN,.HL)
D FILESEG^LA7VHLU(GBL,.LA7PID)
S (LA("LRIDT"),LA("SUB"))=""
Q
;
;
ORC ; Build ORC segment
;
N X
;
S LA("LRIDT")=$QS(LA7ROOT,4),LA("SUB")=$QS(LA7ROOT,5)
S LA763(0)=$G(^LR(LA("LRDFN"),LA("SUB"),LA("LRIDT"),0))
S X=$G(^LR(LA("LRDFN"),LA("SUB"),LA("LRIDT"),"ORU"))
S LA("HUID")=$P(X,"^"),LA("SITE")=$P(X,"^",2),LA("RUID")=$P(X,"^",4)
I LA("HUID")="" S LA("HUID")=$P(LA763(0),"^",6)
S LA7NVAF=$$NVAF^LA7VHLU2(0),LA7NTESN=0
D ORC^LA7VORU
S LA("NLT")=""
;
Q
;
;
OBR ; Build OBR segment
;
N LA764,LA7NLT
;
S (LA("NLT"),LA7NLT)=$P($QS(LA7ROOT,6),"!"),(LA764,LA("ORD"))=""
I $L(LA7NLT) D
. S LA764=+$O(^LAM("E",LA7NLT,0))
. I LA764 S LA("ORD")=$$GET1^DIQ(64,LA764_",",.01)
I LA("SUB")="CH" D
. D OBR^LA7VORU
. D NTE^LA7VORU
. S LA7OBXSN=0
;
Q
;
;
OBX ; Build OBX segment
;
N LA7DATA,LA7VT
;
S LA7NTESN=0
I LA("SUB")="MI" D MI^LA7VORU1 Q
I "CYEMSP"[LA("SUB") D AP^LA7VORU2 Q
;
S LA7VT=$QS(LA7ROOT,7)
D OBX^LA7VOBX(LA("LRDFN"),LA("SUB"),LA("LRIDT"),LA7VT,.LA7DATA,.LA7OBXSN,LA7FS,LA7ECH)
I '$D(LA7DATA) Q
D FILESEG^LA7VHLU(GBL,.LA7DATA)
; Send any test interpretation from file #60
D INTRP^LA7VORUA
;
Q

View File

@ -1,239 +0,0 @@
VWTIME ; Report Age in Time / Date;5:33 AM 11 Feb 2010
;;1.0;WorldVistA;;WorldVistA 30-June-08;Build 2
;
;Modified from FOIA VISTA,
;Copyright 2008 WorldVistA. Licensed under the terms of the GNU
;General Public License See attached copy of the License.
;
;This program is free software; you can redistribute it and/or modify
;it under the terms of the GNU General Public License as published by
;the Free Software Foundation; either version 2 of the License, or
;(at your option) any later version.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License along
;with this program; if not, write to the Free Software Foundation, Inc.,
;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
;
QUIT ; No Fall Through
; =============
; FDT = First Date/Time (SD)
; W $$DIF^VWTIME(3090512.1145)
DIF(SD,ED) ; Now a Call will look like the above
N BUF,DED,DSD,EH,EI,FTD
S SD=$G(SD),ED=$G(ED)
I ED="" D NOW^%DTC S ED=%
I SD<.00001 D NOW^%DTC S SD=% ; Invalid start date is set to now
S X=SD
D
. I SD="" S ER=99 Q
. ;
. ; Convert both Values to Fileman Time to Decimal.
. ; We are interested in just the differences
. ;
. I SD>1400000 D
. . S X=$$F2D(SD)
. . D H^%DTC
. . S SD=%H_","_$TR($J(%T,5)," ","0")
. .QUIT
. S DST=$$F2D(SD)
. S DET=$$F2D(ED)
.QUIT
; Decimal Date/Times calculated in DST (start) and DET (end),
; differeence of DET-DST is FTD - First Time and Date, DTD - Declining Time and Date
S (DTD,FTD)=DET-DST
; Time Frames
; 1 Minute = .000694444444444444444
; 1 Hour = .0416666666666666666
; 1 Day = 1
; 1 WeeK = 7
; 1 Month = 30.5
; 1 Year = 365.249
N BUF,DAY,HR,MIN,MON,WK,YR
S BUF=""
S DAY=1
S SEP=""
D
. N HR,MON,YR,WEEK
. S MON=30.49,YR=365.249,HR=1/24,WEEK=7
. I FTD>(2*YR) D
. . S T=DTD\YR
. . S BUF=BUF_SEP_T_" Year"
. . S:T>1 BUF=BUF_"s"
. . S DTD=(DTD#YR),SEP=", "
. . .QUIT
. QUIT:FTD>(20*YR)
. ;
. ; Time Calculations
. I FTD>(4*MON) I FTD<(18*YR) D
. . S T=DTD\MON
. . S BUF=BUF_SEP_T_" Month"
. . S:T>1 BUF=BUF_"s"
. . S DTD=(DTD#MON),SEP=", "
. .QUIT
. QUIT:FTD>(18*YR)
. I FTD>29 I FTD<4*WEEK D
. . S T=DTD\WEEK
. . S BUF=BUF_SEP_T_" Week"
. . S:T>1 BUF=BUF_"s"
. . S DTD=(DTD#WEEK),SEP=", "
. .QUIT
. ; Time Calculations
. I FTD<29 I DTD'<2 D
. . S T=DTD\1
. . S BUF=BUF_SEP_T_" Day"
. . S:T>1 BUF=BUF_"s"
. . S DTD=(DTD#DAY),SEP=", "
. .QUIT
. I DTD>.999999&(FTD<4) D
. . S T=DTD\HR
. . S BUF=BUF_SEP_T_" Hour"
. . S:T>1 BUF=BUF_"s"
. . S DTD=(DTD#HR),SEP=", "
. .QUIT
. D:(FTD<4.00000001)
. . N MIN,HR
. . S HR=1/24,SEP=$G(SEP)
. . S MIN=HR/60
. . ;
. . I DTD>MIN D
. . . S T=DTD\MIN
. . . S BUF=BUF_SEP_T_" Minute"
. . . S:T>1 BUF=BUF_"s"
. . . S DTD=(DTD#MIN),SEP=", "
. .QUIT
. . ;
. . S SEC=MIN/60
. . I DTD>SEC D
. . . S T=DTD\SEC
. . . S BUF=BUF_SEP_T_" Second"
. . . S:T>1 BUF=BUF_"s"
. . . S DTD=(DTD#SEC),SEP=", "
. . .QUIT
. .QUIT
. ; I DTD S BUF=BUF_" Less than a Minute"
.QUIT
QUIT BUF
; ==========
; W $$BRIEF^VWTIME(DOB) >>> Years^Months^Weeks^Days^Hours^Minutes^Seconds
BRIEF(SD,ED) ; Now a Call will look like the above
N BUF,DED,DSD,EH,EI,FTD,BUF
S SD=$G(SD),ED=$G(ED)
I ED="" D NOW^%DTC S ED=%
S:SD<2 SD=""
S BUF="INVALID INPUT"
D:SD ; SD has been checked and passed if it passes here
. S X=SD
. ;
. ; Convert both Values to Fileman Time to Decimal.
. ; We are interested in just the differences
. ;
. ; I SD>1400000 D
. ; . S X=$$F2D(SD)
. ; . D H^%DTC
. ; . S SD=%H_","_$TR($J(%T,5)," ","0")
. ; .QUIT
. ; If we get here, we have the ST and ET defined and ready
. S DST=$$F2D(SD)
. S DET=$$F2D(ED)
. D TDIFF(.BUF)
.QUIT
QUIT BUF
; ===========
TDIFF(BF) ; Time Difference formulation
; Decimal Date/Times calculated in DST (start) and DET (end),
; differeence of DET-DST is FTD - First Time and Date, DTD - Declining Time and Date
S (DTD,FTD)=DET-DST
; Time Frames
; 1 Minute = .000694444444444444444
; 1 Hour = .0416666666666666666
; 1 Day = 1
; 1 WeeK = 7
; 1 Month = 30.5
; 1 Year = 365.249
N DAY,HR,MIN,MON,WK,YR
S $P(BF,"^",7)=""
S DAY=1
S SEP=""
D
. N HR,MON,YR,WEEK
. S MON=30.49,YR=365.249,HR=1/24,WEEK=7
. I FTD>(2*YR) D
. . S $P(BF,"^")=DTD\YR
. . S DTD=(DTD#YR)
. .QUIT
. ;
. ; Time Calculations
. I FTD>(4*MON) I FTD<(18*YR) D
. . S $P(BF,"^",2)=DTD\MON
. . S DTD=(DTD#MON)
. .QUIT
. D ; I FTD>29 I FTD<4*WEEK D
. . S $P(BF,"^",3)=DTD\WEEK
. . S DTD=(DTD#WEEK)
. .QUIT
. ; Time Calculations
. D ; I FTD<29 I DTD'<2 D
. . S $P(BF,"^",4)=DTD\1
. . S DTD=(DTD#DAY)
. .QUIT
. D ; I DTD>.999999&(FTD<4) D
. . S $P(BF,"^",5)=DTD\HR
. . S DTD=(DTD#HR)
. .QUIT
. S MIN=1/(24*60)
. D ; :(FTD<4.00000001)
. . N HR
. . S HR=1/24
. . S MIN=HR/60
. . ;
. . ; I DTD>MIN D
. . S $P(BF,"^",6)=DTD\MIN
. . S DTD=(DTD#MIN)
. .QUIT
. . ;
. S SEC=MIN/60
. ; I DTD>SEC D
. S $P(BF,"^",7)=DTD\SEC
. S DTD=(DTD#SEC)
. .QUIT
. ; I DTD S BF=BF_" Less than a Minute"
.QUIT
QUIT
; ==========
F2D(X) ; Conver FM Date/Time to Decimal
N %H,%T,%Y
D H^%DTC
QUIT $$H2D(%H_","_%T)
; ========
H2D(X) ; Convert Horolog to Decimal Days
N D,T
S D=$P(X,","),T=$P(X,",",2)/86400
QUIT D+T
; =============
LONGAGE(VWAGE,VWDFN) ; RPC FOR LONG AGE
N VWDOB
S VWDOB=$P(^DPT(VWDFN,0),"^",3)
S VWAGE=$$DIF(VWDOB)
QUIT
; =============
BRFAGE(VWAGE,VWDFN) ; RPC FOR BRIEF AGE
N VWDOB
S VWDOB=$P(^DPT(VWDFN,0),"^",3)
S VWAGE=$$BRIEF(VWDOB)
QUIT
; =============
RPCREG ; Register NEW RPCs
N MENU,RPC,FDA,FDAIEN,ERR,DIERR
S MENU="OR CPRS GUI CHART"
F RPC="VWTIME LONG AGE","VWTIME BRIEF AGE" D
. S FDA(19,"?1,",.01)=MENU
. S FDA(19.05,"?+2,?1,",.01)=RPC
. D UPDATE^DIE("E","FDA","FDAIEN","ERR")
.QUIT
QUIT
; ============