← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11329: Change relationship of registration form and attributes/identifier-types from one-to-many to many...

 

------------------------------------------------------------
revno: 11329
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-07-04 12:57:36 +0700
message:
  Change relationship of registration form and attributes/identifier-types from one-to-many to many-to-many.
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientRegistrationForm.hbm.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/defaultPatientRegistationForm.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientRegistrationForm.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientRegistrationForm.hbm.xml	2013-07-03 15:40:29 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientRegistrationForm.hbm.xml	2013-07-04 05:57:36 +0000
@@ -30,15 +30,17 @@
     </list>
      
     <list name="dynamicAttributes" table="patientregistrationform_attributes">
-      <key column="patientregistrationformid" />
+      <key column="patientregistrationformid" foreign-key="fk_attributes_patientregistrationformid" />
       <list-index column="sort_order" base="1" />
-      <one-to-many class="org.hisp.dhis.patient.PatientAttribute" />
+      <many-to-many class="org.hisp.dhis.patient.PatientAttribute" column="patientattributeid" 
+      	foreign-key="fk_patientregistrationform_attributes_patientregistrationformid" />
     </list>
     
     <list name="identifierTypes" table="patientregistrationform_identifierTypes">
-      <key column="patientattributegroupid" />
+      <key column="patientregistrationformid" foreign-key="fk_identifierTypes_patientregistrationformid" />
       <list-index column="sort_order" base="1" />
-      <one-to-many class="org.hisp.dhis.patient.PatientIdentifierType" />
+      <many-to-many class="org.hisp.dhis.patient.PatientIdentifierType" column="patientidentifiertypeid"
+      	foreign-key="fk_patientregistrationform_identifiertype_patientregistrationformid" />
     </list>
     
   </class>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2013-07-03 15:40:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2013-07-04 05:57:36 +0000
@@ -439,4 +439,5 @@
 phoneNumber = Phone number
 deathDate = Date of death
 isDead = Is dead
-healthWorker = Health worker
\ No newline at end of file
+healthWorker = Health worker
+create_default_registration_form = Create default registration form
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/defaultPatientRegistationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/defaultPatientRegistationForm.vm	2013-07-04 04:50:21 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/defaultPatientRegistationForm.vm	2013-07-04 05:57:36 +0000
@@ -1,7 +1,7 @@
-<h3>$i18n.getString( "create_new_patient_attribute_group" )</h3>
+<h3>$i18n.getString( "create_default_registration_form" )</h3>
 																			
 <form id="defaultPatientRegistrationForm" name="defaultPatientRegistrationForm" action="saveDefaultPatientRegistrationForm.action" method="post" onsubmit="selectAllById('fixedAttributes');selectAllById('dynamicAttributeIds');selectAllById('identifierTypeIds');">
-
+<input type='hidden' id='programId' name='programId' value='$!program.id'/>
 <table>
 	<tr>
 		<th colspan="2">$i18n.getString( "default_registration_form" )</th>