dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #22836
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11110: Web api for events, changed element naming style from programId to program to make it consistent ...
------------------------------------------------------------
revno: 11110
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-05-30 10:57:44 +0200
message:
Web api for events, changed element naming style from programId to program to make it consistent with other resources
modified:
dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/BaseEventService.java
dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/DataValue.java
dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/Event.java
dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/Events.java
--
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-dxf2/src/main/java/org/hisp/dhis/dxf2/event/BaseEventService.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/BaseEventService.java 2013-05-24 07:24:49 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/BaseEventService.java 2013-05-30 08:57:44 +0000
@@ -104,13 +104,13 @@
{
Program program;
- if ( event.getProgramId() != null )
+ if ( event.getProgram() != null )
{
- program = programService.getProgram( event.getProgramId() );
+ program = programService.getProgram( event.getProgram() );
}
- else if ( event.getProgramStageId() != null )
+ else if ( event.getProgramStage() != null )
{
- ProgramStage programStage = programStageService.getProgramStage( event.getProgramStageId() );
+ ProgramStage programStage = programStageService.getProgramStage( event.getProgramStage() );
program = programStage.getProgram();
}
else
@@ -132,7 +132,7 @@
}
}
- OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( event.getOrganisationUnitId() );
+ OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( event.getOrgUnit() );
if ( organisationUnit == null )
{
@@ -218,11 +218,11 @@
for ( DataValue dataValue : event.getDataValues() )
{
- DataElement dataElement = dataElementService.getDataElement( dataValue.getDataElementId() );
+ DataElement dataElement = dataElementService.getDataElement( dataValue.getDataElement() );
if ( dataElement == null )
{
- importSummary.getConflicts().add( new ImportConflict( "dataElementId", dataValue.getDataElementId() + " is not a valid dataElementId." ) );
+ importSummary.getConflicts().add( new ImportConflict( "dataElementId", dataValue.getDataElement() + " is not a valid dataElementId." ) );
importSummary.getDataValueCount().incrementIgnored();
}
else
=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/DataValue.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/DataValue.java 2013-05-17 03:29:07 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/DataValue.java 2013-05-30 08:57:44 +0000
@@ -38,7 +38,7 @@
{
private String value;
- private String dataElementId;
+ private String dataElement;
private Boolean providedElsewhere = false;
@@ -60,14 +60,14 @@
@JsonProperty
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0, isAttribute = true )
- public String getDataElementId()
+ public String getDataElement()
{
- return dataElementId;
+ return dataElement;
}
- public void setDataElementId( String dataElementId )
+ public void setDataElement( String dataElement )
{
- this.dataElementId = dataElementId;
+ this.dataElement = dataElement;
}
@JsonProperty
@@ -87,7 +87,7 @@
{
return "DataValue{" +
"value='" + value + '\'' +
- ", dataElementId='" + dataElementId + '\'' +
+ ", dataElement='" + dataElement + '\'' +
", providedElsewhere=" + providedElsewhere +
'}';
}
=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/Event.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/Event.java 2013-05-24 08:40:53 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/Event.java 2013-05-30 08:57:44 +0000
@@ -42,15 +42,15 @@
@JacksonXmlRootElement( localName = "event", namespace = DxfNamespaces.DXF_2_0 )
public class Event
{
- private String programId;
-
- private String programStageId;
-
- private String eventId;
-
- private String organisationUnitId;
-
- private String patientId;
+ private String program;
+
+ private String programStage;
+
+ private String event;
+
+ private String orgUnit;
+
+ private String patient;
private String eventDate;
@@ -68,62 +68,62 @@
@JsonProperty( required = true )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0, isAttribute = true )
- public String getProgramId()
- {
- return programId;
- }
-
- public void setProgramId( String programId )
- {
- this.programId = programId;
- }
-
- @JsonProperty( required = true )
- @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0, isAttribute = true )
- public String getProgramStageId()
- {
- return programStageId;
- }
-
- public void setProgramStageId( String programStageId )
- {
- this.programStageId = programStageId;
- }
-
- @JsonProperty( required = true )
- @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0, isAttribute = true )
- public String getEventId()
- {
- return eventId;
- }
-
- public void setEventId( String eventId )
- {
- this.eventId = eventId;
- }
-
- @JsonProperty
- @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0, isAttribute = true )
- public String getOrganisationUnitId()
- {
- return organisationUnitId;
- }
-
- public void setOrganisationUnitId( String organisationUnitId )
- {
- this.organisationUnitId = organisationUnitId;
- }
-
- @JsonProperty
- @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0, isAttribute = true )
- public String getPatientId()
- {
- return patientId;
- }
-
- public void setPatientId( String patientId )
- {
- this.patientId = patientId;
+ public String getProgram()
+ {
+ return program;
+ }
+
+ public void setProgram( String program )
+ {
+ this.program = program;
+ }
+
+ @JsonProperty( required = true )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0, isAttribute = true )
+ public String getProgramStage()
+ {
+ return programStage;
+ }
+
+ public void setProgramStage( String programStage )
+ {
+ this.programStage = programStage;
+ }
+
+ @JsonProperty( required = true )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0, isAttribute = true )
+ public String getEvent()
+ {
+ return event;
+ }
+
+ public void setEvent( String event )
+ {
+ this.event = event;
+ }
+
+ @JsonProperty
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0, isAttribute = true )
+ public String getOrgUnit()
+ {
+ return orgUnit;
+ }
+
+ public void setOrgUnit( String orgUnit )
+ {
+ this.orgUnit = orgUnit;
+ }
+
+ @JsonProperty
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0, isAttribute = true )
+ public String getPatient()
+ {
+ return patient;
+ }
+
+ public void setPatient( String patient )
+ {
+ this.patient = patient;
}
@JsonProperty( required = true )
@@ -191,11 +191,11 @@
public String toString()
{
return "Event{" +
- "programId='" + programId + '\'' +
- ", programStageId='" + programStageId + '\'' +
- ", eventId='" + eventId + '\'' +
- ", organisationUnitId='" + organisationUnitId + '\'' +
- ", patientId='" + patientId + '\'' +
+ "program='" + program + '\'' +
+ ", programStage='" + programStage + '\'' +
+ ", eventId='" + event + '\'' +
+ ", orgUnit='" + orgUnit + '\'' +
+ ", patient='" + patient + '\'' +
", eventDate='" + eventDate + '\'' +
", completed=" + completed +
", storedBy='" + storedBy + '\'' +
=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/Events.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/Events.java 2013-05-24 07:38:03 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/Events.java 2013-05-30 08:57:44 +0000
@@ -42,9 +42,9 @@
@JacksonXmlRootElement( localName = "events", namespace = DxfNamespaces.DXF_2_0 )
public class Events
{
- private String programId;
+ private String program;
- private String programInstanceId;
+ private String programInstance;
private List<Event> events = new ArrayList<Event>();
@@ -54,26 +54,26 @@
@JsonProperty
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0, isAttribute = true )
- public String getProgramId()
+ public String getProgram()
{
- return programId;
+ return program;
}
- public void setProgramId( String programId )
+ public void setProgram( String program )
{
- this.programId = programId;
+ this.program = program;
}
@JsonProperty
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0, isAttribute = true )
- public String getProgramInstanceId()
+ public String getProgramInstance()
{
- return programInstanceId;
+ return programInstance;
}
- public void setProgramInstanceId( String programInstanceId )
+ public void setProgramInstance( String programInstance )
{
- this.programInstanceId = programInstanceId;
+ this.programInstance = programInstance;
}
@JsonProperty( "eventList" )
@@ -93,8 +93,8 @@
public String toString()
{
return "Events{" +
- "programId='" + programId + '\'' +
- ", programInstanceId='" + programInstanceId + '\'' +
+ "program='" + program + '\'' +
+ ", programInstance='" + programInstance + '\'' +
", events=" + events +
'}';
}