← Back to team overview

oship-dev team mailing list archive

[Branch ~oship-dev/oship/devel] Rev 528: Fixed wrong file path references.

 

------------------------------------------------------------
revno: 528
committer: Diego Manhães Pinheiro <me@xxxxxxxxxxxxxx>
branch nick: trunk
timestamp: Tue 2010-12-21 07:28:21 -0200
message:
  Fixed wrong file path references.
modified:
  src/oeterm/src/oeterm/__init__.py
  src/rxterms/src/rxterms/__init__.py


--
lp:oship
https://code.launchpad.net/~oship-dev/oship/devel

Your team OSHIP Development Team is subscribed to branch lp:oship.
To unsubscribe from this branch go to https://code.launchpad.net/~oship-dev/oship/devel/+edit-subscription
=== modified file 'src/oeterm/src/oeterm/__init__.py'
--- src/oeterm/src/oeterm/__init__.py	2010-12-15 23:14:19 +0000
+++ src/oeterm/src/oeterm/__init__.py	2010-12-21 09:28:21 +0000
@@ -29,6 +29,8 @@
 
 _ = MessageFactory('oship')
 
+OPENEHR_TERMINOLOGY_FILE = os.path.join(os.path.dirname(__file__),"openehr_terminology_en.xml")
+
 
 class IopenEHRTerminology(Interface):
     """openEHR terminology codes"""
@@ -62,7 +64,7 @@
 
     termslist=[]
     #create an ElementTree instance from an XML file
-    doc = ElementTree(file=os.getcwd()+"/src/oship/oeterm/openehr_terminology_en.xml")
+    doc = ElementTree(file=OPENEHR_TERMINOLOGY_FILE)
     # now get an iterator and breakdown the Elements.
     tree=doc.getiterator()
     for x in tree:

=== modified file 'src/rxterms/src/rxterms/__init__.py'
--- src/rxterms/src/rxterms/__init__.py	2010-12-15 23:43:21 +0000
+++ src/rxterms/src/rxterms/__init__.py	2010-12-21 09:28:21 +0000
@@ -26,15 +26,16 @@
 
 _ = MessageFactory('oship')
 
+RELEASE = 'RxTerms200903' #change this with each new update.
+RXTERMS_FILE_PATH = os.path.join(os.path.dirname(__file__),''.join((RELEASE,'.txt',)))
 
 def CreateRxTerms():
     """ read the file and return a code structure"""
 
 
     vocab=[]
-    release="RxTerms200903" #change this with each new update.
 
-    rxfile=open(os.getcwd()+"/src/oship/rxterms/"+release+".txt",'r')
+    rxfile=open(RXTERMS_FILE_PATH,'r')
     print "Processing RxTerms Models. Please be patient ....."
 
     linecnt=0
@@ -56,7 +57,7 @@
             displayNameSynonym=rxterm[12]
             isRetired=rxterm[13]
             rxModel=RxTerm(rxcui,genericRxcui,tty,fullName,rxnDoseForm,fullGenericName,brandName,displayName,route,newDoseForm,strength,suppressFor,displayNameSynonym,isRetired)
-            vocab.append((release,rxcui,rxModel))
+            vocab.append((RELEASE,rxcui,rxModel))
         linecnt+=1
 
     return vocab