-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #507 from opensrp/create-mybatis-artifacts-for-tem…
…plate-table Implement case triggered plan generation
- Loading branch information
Showing
42 changed files
with
4,767 additions
and
4 deletions.
There are no files selected for viewing
Submodule configs
updated
11 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package org.opensrp.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.google.gson.annotations.SerializedName; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.smartregister.domain.Condition; | ||
import org.smartregister.domain.DynamicValue; | ||
import org.smartregister.domain.Trigger; | ||
|
||
import java.io.Serializable; | ||
import java.util.Set; | ||
|
||
@Getter | ||
@Setter | ||
@AllArgsConstructor | ||
public class ActionTemplate implements Serializable { | ||
private static final long serialVersionUID = 1L; | ||
private String identifier; | ||
private int prefix; | ||
private String title; | ||
private String description; | ||
private String code; | ||
private PeriodTemplate timingPeriod; | ||
private String reason; | ||
private String goalId; | ||
private ActionTemplate.SubjectConcept subjectCodableConcept; | ||
private String taskTemplate; | ||
private Set<Trigger> trigger; | ||
private Set<Condition> condition; | ||
private String definitionUri; | ||
private Set<DynamicValue> dynamicValue; | ||
private ActionTemplate.ActionType type; | ||
|
||
public ActionTemplate() { | ||
this.type = ActionTemplate.ActionType.CREATE; | ||
} | ||
|
||
@Getter | ||
@Setter | ||
@AllArgsConstructor | ||
public static class SubjectConcept implements Serializable { | ||
private String text; | ||
|
||
|
||
} | ||
|
||
public static enum ActionType { | ||
@JsonProperty("create") | ||
@SerializedName("create") | ||
CREATE, | ||
@JsonProperty("update") | ||
@SerializedName("update") | ||
UPDATE, | ||
@JsonProperty("remove") | ||
@SerializedName("remove") | ||
REMOVE, | ||
@JsonProperty("fire-event") | ||
@SerializedName("fire-event") | ||
FIRE_EVENT; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.opensrp.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.google.gson.annotations.SerializedName; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class GoalTemplate implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
private String id; | ||
private String description; | ||
private String priority; | ||
@JsonProperty("target") | ||
@SerializedName("target") | ||
private List<TargetTemplate> targets; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.opensrp.domain; | ||
|
||
import java.io.Serializable; | ||
|
||
public class PeriodTemplate implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
private String start; | ||
private String end; | ||
|
||
public String getStart() { | ||
return start; | ||
} | ||
|
||
public void setStart(String start) { | ||
this.start = start; | ||
} | ||
|
||
public String getEnd() { | ||
return end; | ||
} | ||
|
||
public void setEnd(String end) { | ||
this.end = end; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
package org.opensrp.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.google.gson.annotations.SerializedName; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import org.smartregister.domain.Jurisdiction; | ||
import org.smartregister.domain.PlanDefinition; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class PlanTemplate implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
@JsonProperty | ||
private String identifier; | ||
@JsonProperty | ||
private String description; | ||
@JsonProperty | ||
private String version; | ||
@JsonProperty | ||
private String name; | ||
@JsonProperty | ||
private String title; | ||
@JsonProperty | ||
private String status; | ||
@JsonProperty | ||
private String date; | ||
@JsonProperty | ||
private PeriodTemplate effectivePeriod; | ||
@JsonProperty | ||
private List<PlanDefinition.UseContext> useContext; | ||
@JsonProperty | ||
private List<Jurisdiction> jurisdiction; | ||
private Long serverVersion; | ||
@JsonProperty("goal") | ||
@SerializedName("goal") | ||
private List<GoalTemplate> goals; | ||
@JsonProperty("action") | ||
@SerializedName("action") | ||
private List<ActionTemplate> actions; | ||
@JsonProperty | ||
private boolean experimental; | ||
|
||
public int compareTo(PlanDefinition o) { | ||
return this.getName().equals(o.getName()) ? this.getName().compareTo(o.getIdentifier()) : this.getName().compareTo(o.getName()); | ||
} | ||
|
||
public static enum PlanStatus { | ||
@SerializedName("draft") | ||
DRAFT("draft"), | ||
@SerializedName("active") | ||
ACTIVE("active"), | ||
@SerializedName("retired") | ||
RETIRED("retired"), | ||
@SerializedName("complete") | ||
COMPLETED("complete"), | ||
@SerializedName("unknown") | ||
UNKNOWN("unknown"); | ||
|
||
private final String value; | ||
|
||
private PlanStatus(String value) { | ||
this.value = value; | ||
} | ||
|
||
public String value() { | ||
return this.value; | ||
} | ||
|
||
public static PlanTemplate.PlanStatus from(String value) { | ||
PlanTemplate.PlanStatus[] var1 = values(); | ||
int var2 = var1.length; | ||
|
||
for(int var3 = 0; var3 < var2; ++var3) { | ||
PlanTemplate.PlanStatus c = var1[var3]; | ||
if (c.value.equals(value)) { | ||
return c; | ||
} | ||
} | ||
|
||
throw new IllegalArgumentException(value); | ||
} | ||
} | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public static class UseContext implements Serializable { | ||
private String code; | ||
private String valueCodableConcept; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package org.opensrp.domain; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.io.Serializable; | ||
import java.util.AbstractMap; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class TargetTemplate implements Serializable { | ||
private static final long serialVersionUID = 1L; | ||
private String measure; | ||
private TargetTemplate.Detail detail; | ||
private String due; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
static class DetailCodableConcept { | ||
private String text; | ||
|
||
} | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
static class MeasureRange implements Serializable { | ||
private TargetTemplate.Measure high; | ||
private TargetTemplate.Measure low; | ||
} | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
static class Measure implements Serializable { | ||
private float value; | ||
private String comparator; | ||
private String unit; | ||
|
||
} | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
static class Detail implements Serializable { | ||
private TargetTemplate.Measure detailQuantity; | ||
private TargetTemplate.MeasureRange detailRange; | ||
private AbstractMap.SimpleEntry<String, String> detailCodableConcept; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.opensrp.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.io.Serializable; | ||
|
||
public class Template implements Serializable { | ||
private static final long serialVersionUID = 1L; | ||
@JsonProperty | ||
private Integer templateId; | ||
@JsonProperty | ||
private PlanTemplate template; | ||
@JsonProperty | ||
private String type; | ||
@JsonProperty | ||
private int version; | ||
|
||
public Integer getTemplateId() { | ||
return templateId; | ||
} | ||
|
||
public void setTemplateId(Integer templateId) { | ||
this.templateId = templateId; | ||
} | ||
|
||
public PlanTemplate getTemplate() { | ||
return template; | ||
} | ||
|
||
public void setTemplate(PlanTemplate template) { | ||
this.template = template; | ||
} | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
public void setType(String type) { | ||
this.type = type; | ||
} | ||
|
||
public int getVersion() { | ||
return version; | ||
} | ||
|
||
public void setVersion(int version) { | ||
this.version = version; | ||
} | ||
} |
Oops, something went wrong.