=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java 2012-09-06 09:44:43 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java 2012-09-11 07:31:17 +0000 @@ -35,6 +35,7 @@ import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.program.Program; +import org.hisp.dhis.user.User; /** * @author Abyot Asalefew Gizaw @@ -101,6 +102,8 @@ private boolean underAge; private Character dobType; + + private User healthWorker; // ------------------------------------------------------------------------- // Constructors @@ -355,6 +358,16 @@ this.programs = programs; } + public User getHealthWorker() + { + return healthWorker; + } + + public void setHealthWorker( User healthWorker ) + { + this.healthWorker = healthWorker; + } + public void setRegistrationDate( Date registrationDate ) { this.registrationDate = registrationDate; === modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml' --- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml 2012-07-06 04:04:41 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml 2012-09-11 07:31:17 +0000 @@ -53,5 +53,7 @@ + + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java 2012-06-14 13:07:22 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java 2012-09-11 07:31:17 +0000 @@ -52,6 +52,7 @@ import org.hisp.dhis.patient.PatientIdentifierTypeService; import org.hisp.dhis.patient.PatientService; import org.hisp.dhis.patientattributevalue.PatientAttributeValue; +import org.hisp.dhis.user.UserService; import com.opensymphony.xwork2.Action; @@ -86,6 +87,8 @@ private PatientAttributeOptionService patientAttributeOptionService; + private UserService userService; + // ------------------------------------------------------------------------- // Input // ------------------------------------------------------------------------- @@ -110,6 +113,8 @@ private Integer relationshipTypeId; + private Integer healthWorkerId; + private String message; // ------------------------------------------------------------------------- @@ -169,6 +174,7 @@ patient.setPhoneNumber( phoneNumber ); patient.setUnderAge( underAge ); patient.setOrganisationUnit( organisationUnit ); + patient.setHealthWorker( userService.getUser( healthWorkerId ) ); Character dobType = (verified) ? 'V' : 'D'; @@ -310,12 +316,22 @@ // ----------------------------------------------------------------------------- // Getter/Setter // ----------------------------------------------------------------------------- + + public void setUserService( UserService userService ) + { + this.userService = userService; + } public String getMessage() { return message; } + public void setHealthWorkerId( Integer healthWorkerId ) + { + this.healthWorkerId = healthWorkerId; + } + public void setVerified( Boolean verified ) { this.verified = verified; === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java 2012-09-05 14:30:23 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java 2012-09-11 07:31:17 +0000 @@ -47,6 +47,7 @@ import org.hisp.dhis.program.ProgramService; import org.hisp.dhis.relationship.Relationship; import org.hisp.dhis.relationship.RelationshipService; +import org.hisp.dhis.user.User; import com.opensymphony.xwork2.Action; @@ -72,9 +73,9 @@ private PatientAttributeService patientAttributeService; private PatientIdentifierTypeService patientIdentifierTypeService; - + private RelationshipService relationshipService; - + // ------------------------------------------------------------------------- // Input/Output // ------------------------------------------------------------------------- @@ -104,9 +105,11 @@ private String systemIdentifier; private Relationship relationship; - + private Map> attributeGroupsMap = new HashMap>(); + private Collection healthWorkers; + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -117,7 +120,7 @@ patient = patientService.getPatient( id ); programs = programService.getAllPrograms(); - + // ------------------------------------------------------------------------- // Get identifier-types && attributes // ------------------------------------------------------------------------- @@ -126,27 +129,28 @@ identifierTypes = patientIdentifierTypeService.getAllPatientIdentifierTypes(); Collection patientAttributes = patientAttributeService.getAllPatientAttributes(); - + Collection programs = programService.getAllPrograms(); for ( Program program : programs ) { identifierTypes.removeAll( program.getPatientIdentifierTypes() ); patientAttributes.removeAll( program.getPatientAttributes() ); } - - for( PatientAttribute patientAttribute : patientAttributes ) + + for ( PatientAttribute patientAttribute : patientAttributes ) { PatientAttributeGroup attributeGroup = patientAttribute.getPatientAttributeGroup(); - if( attributeGroup!=null){ - if( attributeGroupsMap.containsKey( attributeGroup ) ) + if ( attributeGroup != null ) + { + if ( attributeGroupsMap.containsKey( attributeGroup ) ) { Collection attributes = attributeGroupsMap.get( attributeGroup ); - attributes.add(patientAttribute); + attributes.add( patientAttribute ); } else { - Collection attributes = new HashSet(); - attributes.add(patientAttribute); + Collection attributes = new HashSet(); + attributes.add( patientAttribute ); attributeGroupsMap.put( attributeGroup, attributes ); } } @@ -155,7 +159,7 @@ noGroupAttributes.add( patientAttribute ); } } - + // ------------------------------------------------------------------------- // Get data // ------------------------------------------------------------------------- @@ -165,7 +169,7 @@ PatientIdentifierType idType = null; Patient representative = patient.getRepresentative(); relationship = relationshipService.getRelationship( representative, patient ); - + if ( patient.isUnderAge() && representative != null ) { for ( PatientIdentifier representativeIdentifier : representative.getIdentifiers() ) @@ -173,8 +177,8 @@ if ( representativeIdentifier.getIdentifierType() != null && representativeIdentifier.getIdentifierType().isRelated() ) { - identiferMap.put( representativeIdentifier.getIdentifierType().getId(), representativeIdentifier - .getIdentifier() ); + identiferMap.put( representativeIdentifier.getIdentifierType().getId(), + representativeIdentifier.getIdentifier() ); } } } @@ -196,21 +200,21 @@ // ------------------------------------------------------------------------- // Get patient-attribute values // ------------------------------------------------------------------------- - - for( PatientAttribute patientAttribute : patientAttributes ) + for ( PatientAttribute patientAttribute : patientAttributes ) { PatientAttributeGroup attributeGroup = patientAttribute.getPatientAttributeGroup(); - if( attributeGroup!=null){ - if( attributeGroupsMap.containsKey( attributeGroup ) ) + if ( attributeGroup != null ) + { + if ( attributeGroupsMap.containsKey( attributeGroup ) ) { Collection attributes = attributeGroupsMap.get( attributeGroup ); - attributes.add(patientAttribute); + attributes.add( patientAttribute ); } else { - Collection attributes = new HashSet(); - attributes.add(patientAttribute); + Collection attributes = new HashSet(); + attributes.add( patientAttribute ); attributeGroupsMap.put( attributeGroup, attributes ); } } @@ -219,7 +223,7 @@ noGroupAttributes.add( patientAttribute ); } } - + Collection patientAttributeValues = patientAttributeValueService .getPatientAttributeValues( patient ); @@ -238,19 +242,26 @@ } } + healthWorkers = patient.getOrganisationUnit().getUsers(); + return SUCCESS; - + } // ----------------------------------------------------------------------------- // Getter / Setter // ----------------------------------------------------------------------------- - + + public Collection getHealthWorkers() + { + return healthWorkers; + } + public Map> getAttributeGroupsMap() { return attributeGroupsMap; } - + public void setPatientService( PatientService patientService ) { this.patientService = patientService; @@ -280,7 +291,7 @@ { this.patientAttributeService = patientAttributeService; } - + public void setPatientIdentifierTypeService( PatientIdentifierTypeService patientIdentifierTypeService ) { this.patientIdentifierTypeService = patientIdentifierTypeService; === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.java 2012-09-05 14:30:23 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.java 2012-09-11 07:31:17 +0000 @@ -41,6 +41,7 @@ import org.hisp.dhis.patient.PatientIdentifierTypeService; import org.hisp.dhis.program.Program; import org.hisp.dhis.program.ProgramService; +import org.hisp.dhis.user.User; import com.opensymphony.xwork2.Action; @@ -87,6 +88,13 @@ // Input/Output // ------------------------------------------------------------------------- + private Collection healthWorkers; + + public Collection getHealthWorkers() + { + return healthWorkers; + } + private Boolean addNewForm; public Boolean getAddNewForm() @@ -101,12 +109,32 @@ private Collection noGroupAttributes = new HashSet(); + public Collection getNoGroupAttributes() + { + return noGroupAttributes; + } + private Collection identifierTypes; + public Collection getIdentifierTypes() + { + return identifierTypes; + } + private OrganisationUnit organisationUnit; + public OrganisationUnit getOrganisationUnit() + { + return organisationUnit; + } + private Map> attributeGroupsMap = new HashMap>(); + public Map> getAttributeGroupsMap() + { + return attributeGroupsMap; + } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -147,7 +175,8 @@ } organisationUnit = selectionManager.getSelectedOrganisationUnit(); - + healthWorkers = organisationUnit.getUsers(); + return SUCCESS; } @@ -155,23 +184,4 @@ // Getter/Setter // ------------------------------------------------------------------------- - public Collection getIdentifierTypes() - { - return identifierTypes; - } - - public Collection getNoGroupAttributes() - { - return noGroupAttributes; - } - - public OrganisationUnit getOrganisationUnit() - { - return organisationUnit; - } - - public Map> getAttributeGroupsMap() - { - return attributeGroupsMap; - } } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java 2012-05-29 15:37:40 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java 2012-09-11 07:31:17 +0000 @@ -50,6 +50,7 @@ import org.hisp.dhis.patient.PatientService; import org.hisp.dhis.patientattributevalue.PatientAttributeValue; import org.hisp.dhis.patientattributevalue.PatientAttributeValueService; +import org.hisp.dhis.user.UserService; import com.opensymphony.xwork2.Action; @@ -80,6 +81,8 @@ private PatientAttributeOptionService patientAttributeOptionService; + private UserService userService; + // ------------------------------------------------------------------------- // Input // ------------------------------------------------------------------------- @@ -99,7 +102,7 @@ private Boolean verified; private String gender; - + private String phoneNumber; private boolean underAge; @@ -108,8 +111,10 @@ private Integer relationshipTypeId; + private Integer healthWorkerId; + private Character dobType; - + // ------------------------------------------------------------------------- // Output // ------------------------------------------------------------------------- @@ -166,13 +171,14 @@ patient.setGender( gender ); patient.setIsDead( isDead ); patient.setPhoneNumber( phoneNumber ); + patient.setHealthWorker( userService.getUser( healthWorkerId ) ); if ( deathDate != null ) { deathDate = deathDate.trim(); patient.setDeathDate( format.parseDate( deathDate ) ); } - + patient.setUnderAge( underAge ); patient.setOrganisationUnit( organisationUnit ); @@ -229,7 +235,6 @@ else if ( identifier != null ) { patient.getIdentifiers().remove( identifier ); -// patientIdentifierService.deletePatientIdentifier( identifier ); } } } @@ -325,6 +330,16 @@ // ----------------------------------------------------------------------------- // Getter/Setter // ----------------------------------------------------------------------------- + + public void setUserService( UserService userService ) + { + this.userService = userService; + } + + public void setHealthWorkerId( Integer healthWorkerId ) + { + this.healthWorkerId = healthWorkerId; + } public void setPatientIdentifierTypeService( PatientIdentifierTypeService patientIdentifierTypeService ) { @@ -395,7 +410,7 @@ { this.gender = gender; } - + public void setPhoneNumber( String phoneNumber ) { this.phoneNumber = phoneNumber; === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-09-07 07:57:47 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-09-11 07:31:17 +0000 @@ -33,7 +33,7 @@ - + - + - - + + - + - - + + @@ -193,19 +189,18 @@ - + - + - + - + - + - - - - + + - + - + @@ -404,7 +393,8 @@ scope="prototype"> - + @@ -427,20 +417,21 @@ - + - + - + @@ -493,6 +484,7 @@ ref="org.hisp.dhis.patient.PatientIdentifierTypeService" /> + + - - @@ -680,16 +674,15 @@ ref="org.hisp.dhis.patient.PatientAttributeOptionService" /> - - - + - + - + - + - - - + - + + class="org.hisp.dhis.caseentry.action.reminder.SendSmsAction" scope="prototype"> - + - + - + - - + + - + - + - + - + - + - + - + - + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-09-07 09:53:13 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-09-11 07:31:17 +0000 @@ -441,4 +441,5 @@ reschedule_due_date = Re-schedule due date status = Status skipped = Skipped -unknown = Unknown \ No newline at end of file +unknown = Unknown +health_worker = Health worker \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm 2012-09-07 09:53:13 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm 2012-09-11 07:31:17 +0000 @@ -40,6 +40,16 @@ #end + + $i18n.getString("health_worker") + + #if($!patient.healthWorker ) + $!patient.healthWorker.name + #else + [$i18n.getString('none')] + #end + + #foreach( $identifier in $identifiers ) #if($!identifier.identifierType) === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm 2012-09-05 14:30:23 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm 2012-09-11 07:31:17 +0000 @@ -59,6 +59,18 @@ + + + + + + + $i18n.getString("has_guardian") === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientProgramTracking.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientProgramTracking.vm 2012-09-10 10:28:33 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientProgramTracking.vm 2012-09-11 07:31:17 +0000 @@ -41,7 +41,17 @@
- #set( $mark = false ) + + + + + #set( $mark = true ) #foreach ($identifierType in $identifierTypes) #set( $identifier = '') #set( $identifier = $identiferMap.get( $identifierType.id ) ) === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm 2012-09-07 07:57:47 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm 2012-09-11 07:31:17 +0000 @@ -40,6 +40,16 @@ + + + + + + + + +
$i18n.getString("health_worker") + #if($!programInstance.patient.healthWorker ) + $!programInstance.patient.healthWorker.name + #else + [$i18n.getString('none')] + #end +
$i18n.getString("health_worker") + #if($!programStageInstance.programInstance.patient.healthWorker ) + $!programStageInstance.programInstance.patient.healthWorker.name + #else + [$i18n.getString('none')] + #end +

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm 2012-09-05 14:30:23 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm 2012-09-11 07:31:17 +0000 @@ -118,6 +118,18 @@
+ +