← Back to team overview

mlhim-specs-dev team mailing list archive

[Branch ~cdd-dev/cdd/trunk] Rev 289: Updated the instance generator and xls2ccd to allow choice of RM versions. RM version default is...

 

------------------------------------------------------------
revno: 289
committer: timothywayne-cook <tim@xxxxxxxxx>
branch nick: cdd
timestamp: Thu 2012-12-20 10:34:40 -0200
message:
  Updated the instance generator and xls2ccd to allow choice of RM versions.  RM version default is now 2.4.1
modified:
  src/instance-gen/bmp.py
  src/instance-gen/ccd-949a53a0-0bc3-43ce-b900-1ff0b9c6798c.xsd
  src/instance-gen/ccd-ca92a9c1-275f-42ca-b1a0-ac0a20cb2ec9.xsd
  src/instance-gen/ccd-fa706c7a-f08a-4c80-8ce3-8ab7e2699517.xsd
  src/instance-gen/ccd2data.py
  src/instance-gen/demog.py
  src/instance-gen/vitals.py
  src/xls2ccd/README.txt
  src/xls2ccd/xls2ccd.py
  templates/CDD-2.5.0.xmt


--
lp:cdd
https://code.launchpad.net/~cdd-dev/cdd/trunk

Your team MLHIM Specifications Developers is subscribed to branch lp:cdd.
To unsubscribe from this branch go to https://code.launchpad.net/~cdd-dev/cdd/trunk/+edit-subscription
=== modified file 'src/instance-gen/bmp.py'
--- src/instance-gen/bmp.py	2012-11-08 23:07:30 +0000
+++ src/instance-gen/bmp.py	2012-12-20 12:34:40 +0000
@@ -29,9 +29,9 @@
 def makeBMP():
 
     bmp_str = """<?xml version="1.0" encoding="UTF-8"?>
-    <mlhim2:ccd-fa706c7a-f08a-4c80-8ce3-8ab7e2699517 xmlns:mlhim2="http://www.mlhim.org/xmlns/mlhim2/2_4_0";
+    <mlhim2:ccd-fa706c7a-f08a-4c80-8ce3-8ab7e2699517 xmlns:mlhim2="http://www.mlhim.org/xmlns/mlhim2/2_4_1";
         xmlns:data-view="http://www.w3.org/2003/g/data-view#"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-        xsi:schemaLocation="http://www.mlhim.org/xmlns/mlhim2/2_4_0 http://www.hkcr.net/ccd/ccd-fa706c7a-f08a-4c80-8ce3-8ab7e2699517.xsd";>
+        xsi:schemaLocation="http://www.mlhim.org/xmlns/mlhim2/2_4_1 file:../../ccd-fa706c7a-f08a-4c80-8ce3-8ab7e2699517.xsd">
         <mlhim2:el-ef7dc8ee-5cf5-47cc-92a5-7143094b88c8>
             <mlhim2:language>en-US</mlhim2:language>
             <mlhim2:encoding>utf-8</mlhim2:encoding>

=== modified file 'src/instance-gen/ccd-949a53a0-0bc3-43ce-b900-1ff0b9c6798c.xsd'
--- src/instance-gen/ccd-949a53a0-0bc3-43ce-b900-1ff0b9c6798c.xsd	2012-11-08 23:07:30 +0000
+++ src/instance-gen/ccd-949a53a0-0bc3-43ce-b900-1ff0b9c6798c.xsd	2012-12-20 12:34:40 +0000
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
-           xmlns:mlhim2="http://www.mlhim.org/xmlns/mlhim2/2_4_0";
+           xmlns:mlhim2="http://www.mlhim.org/xmlns/mlhim2/2_4_1";
            elementFormDefault="qualified"
-           targetNamespace="http://www.mlhim.org/xmlns/mlhim2/2_4_0";
+           targetNamespace="http://www.mlhim.org/xmlns/mlhim2/2_4_1";
            xmlns:data-view="http://www.w3.org/2003/g/data-view#";
            data-view:transformation="http://www.mlhim.org/ccd/ccd_md_view.xsl";>
 
@@ -40,7 +40,7 @@
      </xs:appinfo>
     </xs:annotation>
 
-    <xs:include schemaLocation="http://www.mlhim.org/xmlns/mlhim2/2_4_0/mlhim2.xsd"/>
+    <xs:include schemaLocation="http://www.mlhim.org/xmlns/mlhim2/2_4_1/mlhim2.xsd"/>
 
     <xs:element name='ccd-949a53a0-0bc3-43ce-b900-1ff0b9c6798c' type="mlhim2:ct-2762b0b5-49ff-47a1-8e52-9cb9c96f9e94"/>
 

=== modified file 'src/instance-gen/ccd-ca92a9c1-275f-42ca-b1a0-ac0a20cb2ec9.xsd'
--- src/instance-gen/ccd-ca92a9c1-275f-42ca-b1a0-ac0a20cb2ec9.xsd	2012-11-08 23:07:30 +0000
+++ src/instance-gen/ccd-ca92a9c1-275f-42ca-b1a0-ac0a20cb2ec9.xsd	2012-12-20 12:34:40 +0000
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
-	   xmlns:mlhim2="http://www.mlhim.org/xmlns/mlhim2/2_4_0"; 
+	   xmlns:mlhim2="http://www.mlhim.org/xmlns/mlhim2/2_4_1"; 
 	   elementFormDefault="qualified"
-	   targetNamespace="http://www.mlhim.org/xmlns/mlhim2/2_4_0";
+	   targetNamespace="http://www.mlhim.org/xmlns/mlhim2/2_4_1";
 	   xmlns:data-view="http://www.w3.org/2003/g/data-view#"; 
 	   data-view:transformation="http://www.mlhim.org/ccd/ccd_md_view.xsl";>
 
@@ -33,7 +33,7 @@
     </xs:appinfo>
   </xs:annotation>
 
-  <xs:include schemaLocation="http://www.mlhim.org/xmlns/mlhim2/2_4_0/mlhim2.xsd"/>
+  <xs:include schemaLocation="http://www.mlhim.org/xmlns/mlhim2/2_4_1/mlhim2.xsd"/>
 
   <xs:element name="ccd-ca92a9c1-275f-42ca-b1a0-ac0a20cb2ec9" type="mlhim2:ct-4e2099ab-e928-4b66-8d08-fb006b780b10"/>
   <xs:complexType name="ct-4e2099ab-e928-4b66-8d08-fb006b780b10">

=== modified file 'src/instance-gen/ccd-fa706c7a-f08a-4c80-8ce3-8ab7e2699517.xsd'
--- src/instance-gen/ccd-fa706c7a-f08a-4c80-8ce3-8ab7e2699517.xsd	2012-11-08 23:07:30 +0000
+++ src/instance-gen/ccd-fa706c7a-f08a-4c80-8ce3-8ab7e2699517.xsd	2012-12-20 12:34:40 +0000
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
-           xmlns:mlhim2="http://www.mlhim.org/xmlns/mlhim2/2_4_0";
+           xmlns:mlhim2="http://www.mlhim.org/xmlns/mlhim2/2_4_1";
            elementFormDefault="qualified"
-           targetNamespace="http://www.mlhim.org/xmlns/mlhim2/2_4_0";
+           targetNamespace="http://www.mlhim.org/xmlns/mlhim2/2_4_1";
            xmlns:data-view="http://www.w3.org/2003/g/data-view#";
            data-view:transformation="http://www.mlhim.org/ccd/ccd_md_view.xsl";>
 
@@ -40,7 +40,7 @@
      </xs:appinfo>
     </xs:annotation>
 
-    <xs:include schemaLocation="http://www.mlhim.org/xmlns/mlhim2/2_4_0/mlhim2.xsd"/>
+    <xs:include schemaLocation="http://www.mlhim.org/xmlns/mlhim2/2_4_1/mlhim2.xsd"/>
 
     <xs:element name='ccd-fa706c7a-f08a-4c80-8ce3-8ab7e2699517' type="mlhim2:ct-edf9f151-84e7-4207-861c-b5762974d781"/>
 

=== modified file 'src/instance-gen/ccd2data.py'
--- src/instance-gen/ccd2data.py	2012-11-08 23:07:30 +0000
+++ src/instance-gen/ccd2data.py	2012-12-20 12:34:40 +0000
@@ -34,9 +34,9 @@
 #read from ccd2data.cfg file
 f = open('ccd2data.cfg','r')
 cfg = f.readlines()
-numrecs = int(cfg[3][8:].strip())
-mininstances = int(cfg[4][13:].strip())
-maxinstances = int(cfg[5][13:].strip())
+numrecs = int(cfg[3].strip('records='))
+mininstances = int(cfg[4].strip('mininstances='))
+maxinstances = int(cfg[5].strip('maxinstances='))
 f.close()
 
 print numrecs

=== modified file 'src/instance-gen/demog.py'
--- src/instance-gen/demog.py	2012-11-08 23:07:30 +0000
+++ src/instance-gen/demog.py	2012-12-20 12:34:40 +0000
@@ -31,9 +31,9 @@
     dlnum = name[1][0] + '-'+str(randint(100,999))+ '-'+str(randint(1000,9999))+ '-'+str(randint(100,999))+'-'+city[1]
 
     demog_str = """<?xml version="1.0" encoding="UTF-8"?>
-<mlhim2:ccd-ca92a9c1-275f-42ca-b1a0-ac0a20cb2ec9 xmlns:mlhim2="http://www.mlhim.org/xmlns/mlhim2/2_4_0";
+<mlhim2:ccd-ca92a9c1-275f-42ca-b1a0-ac0a20cb2ec9 xmlns:mlhim2="http://www.mlhim.org/xmlns/mlhim2/2_4_1";
     xmlns:data-view="http://www.w3.org/2003/g/data-view#"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-    xsi:schemaLocation="http://www.mlhim.org/xmlns/mlhim2/2_4_0 http://hkcr.net/ccd/ccd_ca92a9c1_275f_42ca_b1a0_ac0a20cb2ec9.xsd";>
+    xsi:schemaLocation="http://www.mlhim.org/xmlns/mlhim2/2_4_1 file:../../ccd-ca92a9c1-275f-42ca-b1a0-ac0a20cb2ec9.xsd">
     <mlhim2:el-249daa52-7cdc-44bb-8cd8-7071993de08b>
         <mlhim2:cluster-subject>Demographics Cluster</mlhim2:cluster-subject>
         <mlhim2:el-a2bc25db-3111-4cd5-9825-d9c448cdd1a5>

=== modified file 'src/instance-gen/vitals.py'
--- src/instance-gen/vitals.py	2012-11-08 23:07:30 +0000
+++ src/instance-gen/vitals.py	2012-12-20 12:34:40 +0000
@@ -18,9 +18,9 @@
 
 
     vitals_str = """<?xml version="1.0" encoding="UTF-8"?>
-    <mlhim2:ccd-949a53a0-0bc3-43ce-b900-1ff0b9c6798c xmlns:mlhim2="http://www.mlhim.org/xmlns/mlhim2/2_4_0";
+    <mlhim2:ccd-949a53a0-0bc3-43ce-b900-1ff0b9c6798c xmlns:mlhim2="http://www.mlhim.org/xmlns/mlhim2/2_4_1";
         xmlns:data-view="http://www.w3.org/2003/g/data-view#"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-        xsi:schemaLocation="http://www.mlhim.org/xmlns/mlhim2/2_4_0 http://www.hkcr.net/ccd/ccd-949a53a0-0bc3-43ce-b900-1ff0b9c6798c.xsd";>
+        xsi:schemaLocation="http://www.mlhim.org/xmlns/mlhim2/2_4_1 file:../../ccd-949a53a0-0bc3-43ce-b900-1ff0b9c6798c.xsd">
         <mlhim2:el-1ecee894-01a6-4736-bd95-6677bb70cb9e>
             <mlhim2:language>en-US</mlhim2:language>
             <mlhim2:encoding>utf-8</mlhim2:encoding>

=== modified file 'src/xls2ccd/README.txt'
--- src/xls2ccd/README.txt	2012-09-27 20:52:27 +0000
+++ src/xls2ccd/README.txt	2012-12-20 12:34:40 +0000
@@ -36,13 +36,16 @@
 how to use these in the context of creating larger, more common concept definitions. 
 
 Execute the tool with this commandline:
-python  xls2ccd.py [path/to/filename]
+python  xls2ccd.py [path/to/filename] [RM Version]
 
 replace the [path/to/filename] with the path/filename to where your spreadsheet is located.
 The CCDs will be generated in the currect (xls2ccd) directory.   
 For example to build the Test CCDS from the xls2ccd directory that was unpacked into your home directory:  
 
 ~/xls2ccd$python xls2ccd examples/ExampleTemplate/MLHIM_Std_Template-Examples.xls 
+
+[RM Version] should be replaced with the version identifier of the RM schema you want to use.  For version 2.3.0 use 2_3_0, 2.4.0 use 2_4_0.
+The default is 2_4_1 (2.4.1)   
  
 
 =========  EXAMPLES ===========

=== modified file 'src/xls2ccd/xls2ccd.py'
--- src/xls2ccd/xls2ccd.py	2012-10-27 22:03:51 +0000
+++ src/xls2ccd/xls2ccd.py	2012-12-20 12:34:40 +0000
@@ -2,7 +2,7 @@
 # -*- coding: utf-8 -*-
 #xls2ccd.py
 #REQUIRES: Python 2.6/2.7 and xlrd
-# Used with MLHIM RM 2.4.0
+# Used with MLHIM RM 2.4.1
 
 #This utility is used to create MLHIM CCDs  from standard template,
 #.xls downloads from the NCI CDE.
@@ -32,6 +32,20 @@
     exit()
 
 try:
+    rmversion = sys.argv[2]
+except:
+    rmversion = "2_4_1"    
+    
+validRMs = ("2_3_1","2_4_0", "2_4_1")    
+    
+if rmversion not in validRMs:
+    print "\n\n"+ rmversion + " is not a valid MLHIM RM version indicator. Use one of: "
+    for r in range(0,len(validRMs)):
+        print validRMs[r]
+    print "\n\n"        
+    exit()
+    
+try:
     wb = open_workbook(xlsfile)
 except:
     print "\n\nThere was an error opening the file: "+xlsfile+"\n\n"
@@ -180,11 +194,12 @@
 
     xsd_file.write("""<?xml version="1.0" encoding="UTF-8"?>
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
-           xmlns:mlhim2="http://www.mlhim.org/xmlns/mlhim2/2_4_0";
+           xmlns:mlhim2='http://www.mlhim.org/xmlns/mlhim2/"""+rmversion+""";'
            xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
            xmlns:dc= "http://purl.org/dc/elements/1.1/";
+           id='mlhim2-"""+ccd_id+"""'
            elementFormDefault="qualified"
-           targetNamespace="http://www.mlhim.org/xmlns/mlhim2/2_4_0";
+           targetNamespace='http://www.mlhim.org/xmlns/mlhim2/"""+rmversion+""";'
            xmlns:data-view="http://www.w3.org/2003/g/data-view#";
            data-view:transformation="http://www.mlhim.org/ccd/ccd_md_view.xsl";>
 
@@ -216,7 +231,7 @@
      </xs:appinfo>
     </xs:annotation>
 
-    <xs:include schemaLocation="http://www.mlhim.org/xmlns/mlhim2/2_4_0/mlhim2.xsd"/>
+    <xs:include schemaLocation='http://www.mlhim.org/xmlns/mlhim2/"""+rmversion+"""/mlhim2.xsd'/>
 
     <xs:element name='"""+ccd_id+"""' type="mlhim2:"""+ccdct+""""/>
 

=== modified file 'templates/CDD-2.5.0.xmt'
Binary files templates/CDD-2.5.0.xmt	2012-10-25 07:01:38 +0000 and templates/CDD-2.5.0.xmt	2012-12-20 12:34:40 +0000 differ