← Back to team overview

mlhim-specs-dev team mailing list archive

[Branch ~cdd-dev/cdd/trunk] Rev 277: Added cluster_subject for Admin, Care and Demographic entries.

 

------------------------------------------------------------
revno: 277
committer: Timothy W. Cook <timothywayne.cook@xxxxxxxxx>
branch nick: cdd
timestamp: Tue 2012-10-02 10:00:19 -0300
message:
  Added cluster_subject for Admin, Care and Demographic entries.
modified:
  src/xls2ccd/xls2ccdRM.py


--
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/xls2ccd/xls2ccdRM.py'
--- src/xls2ccd/xls2ccdRM.py	2012-09-30 10:20:23 +0000
+++ src/xls2ccd/xls2ccdRM.py	2012-10-02 13:00:19 +0000
@@ -26,6 +26,7 @@
     e_subject_type = "PartySelfType" #TODO for CDD add options for PartyIdentifiedType
     es_id = str(uuid.uuid4()) #entry-subject id
     ed_id = str(uuid.uuid4()) #entry-data id
+    cluster_subject = "Admin Cluster"
     defin_str = ''
     padding = ('').rjust(indent)
 
@@ -68,7 +69,7 @@
     elif e_data_type == "SlotType":
         pass #TODO for CDD
     elif e_data_type == "ClusterType":
-        defin_str += getClusterType(data_name, ed_id, dt_id, indent)
+        defin_str += getClusterType(data_name, ed_id, dt_id, cluster_subject, indent)
     else:
         raise TypeError(e_data_type + ": is not a valid CCD.definition type.")
 
@@ -91,6 +92,7 @@
     es_id = str(uuid.uuid4()) #entry-subject id
     ed_id = str(uuid.uuid4()) #entry-data id
     defin_str = ''
+    cluster_subject = "Care Cluster"
     padding = ('').rjust(indent)
 
     defin_str = '\n\n'+padding.rjust(indent) + ("<xs:complexType name='ct-"+ct_name+"'>\n")
@@ -132,7 +134,7 @@
     elif e_data_type == "SlotType":
         pass #TODO for CDD
     elif e_data_type == "ClusterType":
-        defin_str += getClusterType(data_name, ed_id, dt_id, indent)
+        defin_str += getClusterType(data_name, ed_id, dt_id, cluster_subject, indent)
     else:
         raise TypeError(e_data_type + ": is not a valid CCD.definition type.")
 
@@ -153,6 +155,7 @@
     es_id = str(uuid.uuid4()) #entry-subject id
     ed_id = str(uuid.uuid4()) #entry-data id
     defin_str = ''
+    cluster_subject = "Demographic Cluster"
     padding = ('').rjust(indent)
 
     defin_str = '\n\n'+padding.rjust(indent) + ("<xs:complexType name='ct-"+ct_name+"'>\n")
@@ -181,6 +184,7 @@
     defin_str += padding.rjust(indent+2) + ("<xs:element name='el-"+ed_id+"' substitutionGroup='mlhim2:entry-data' type='mlhim2:ct-"+ed_id+"'/>\n")
     defin_str += padding.rjust(indent+2) + ("<xs:element name='el-"+es_id+"' substitutionGroup='mlhim2:entry-subject' type='mlhim2:ct-"+es_id+"'/>\n")
 
+
     if e_subject_type == "PartyIdentifiedType":
         pass #TODO for CDD
     elif e_subject_type == "PartySelfType":
@@ -194,14 +198,14 @@
     elif e_data_type == "SlotType":
         pass #TODO for CDD
     elif e_data_type == "ClusterType":
-        defin_str += getClusterType(data_name, ed_id, dt_id, indent)
+        defin_str += getClusterType(data_name, ed_id, dt_id, cluster_subject, indent)
     else:
         raise TypeError(e_data_type + ": is not a valid CCD.definition type.")
 
     return defin_str
 
 
-def getClusterType(data_name, ed_id, dt_id, indent):
+def getClusterType(data_name, ed_id, dt_id, cluster_subject, indent):
     defin_str = ''
     il_id = str(uuid.uuid4()) #items list id
     et_id = str(uuid.uuid4()) #ElementType id
@@ -214,7 +218,7 @@
     defin_str += padding.rjust(indent+8) + ("<xs:element maxOccurs='unbounded' minOccurs='0' ref='mlhim2:links'/>\n")
     defin_str += padding.rjust(indent+8) + ("<xs:element maxOccurs='1' minOccurs='0' ref='mlhim2:feeder-audit'/>\n")
     defin_str += padding.rjust(indent+8) + ("<xs:element maxOccurs='1' minOccurs='0' name='annotation' type='xs:string'/>\n")
-    defin_str += padding.rjust(indent+8) + ("<xs:element maxOccurs='1' minOccurs='1' name='cluster-subject' type='xs:string' fixed='CareEntry Cluster'/>\n")
+    defin_str += padding.rjust(indent+8) + ("<xs:element maxOccurs='1' minOccurs='1' name='cluster-subject' type='xs:string' fixed="+cluster_subject+"/>\n")
     defin_str += padding.rjust(indent+8) + ("<xs:element maxOccurs='1' minOccurs='1' ref='mlhim2:el-"+il_id+"'/>\n")
     defin_str += padding.rjust(indent+6) + ("</xs:sequence>\n")
     defin_str += padding.rjust(indent+4) + ("</xs:restriction>\n")