Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Implement Drug, DrugOrder and multimedia module. #181

Open
wants to merge 4 commits into
base: 120_mk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions assets/config/opensrp.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ mcts-report-definition-path=/mcts-report-definition.json
mcts-report-delay-in-days=10
mcts.poll.time.interval.in.minutes=10

multimedia.DatabaseConnector=DatabaseConnector
multimedia.directory.name==/multimedia
multimedia.datastore.directory=D:/openSRP_server_workspace/opensrp-server/opensrp-web

# OpenMRS configuration
openmrs.url=http://localhost:8181/openmrs/
openmrs.url=http://localhost:8081/openmrs-standalone/
openmrs.username=admin
openmrs.password=Admin123

# make REST calls and push data while testing on the server specified above
openmrs.test.make-rest-call=false
openmrs.test.make-rest-call=true

openmrs.scheduletracker.syncer.interval-min=2

Expand All @@ -37,7 +41,7 @@ couchdb.atomfeed-db.revision-limit=2
jdbc.backend=mysql
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.username=root
jdbc.password=VA1913wm
jdbc.password=star
#jdbc url with server and port but without database
jdbc.url-wo-db=jdbc:mysql://localhost:3306

Expand Down
146 changes: 146 additions & 0 deletions opensrp-api/src/main/java/org/opensrp/api/domain/Drug.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
package org.opensrp.api.domain;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.codehaus.jackson.annotate.JsonProperty;
import org.ektorp.support.TypeDiscriminator;
import org.joda.time.LocalDate;
import org.motechproject.model.MotechBaseDataObject;

@TypeDiscriminator("doc.type === 'Drug'")
public class Drug extends BaseDataObject {
@JsonProperty
private String drugName;
@JsonProperty
private String drugBaseName;
@JsonProperty
private Map<String, String> codes;
@JsonProperty
private String route;
@JsonProperty
private String id;
@JsonProperty
private String creator;
@JsonProperty
private String doseStrength;
@JsonProperty
private String units;
@JsonProperty
private String maximumDailyDose;
@JsonProperty
private String minimumDailyDose;
@JsonProperty
private String description;


@JsonProperty
private String combination;


protected Drug() {

}

public Drug(String baseEntityId) {

}
public Drug(String drugName,String drugBaseName, Map<String, String> codes,
String route, String creator, String doseStrenght
, String units, String maxDailyDose,String miniDailyDose,String Description,String combination) {
this.drugName=drugName;
this.drugBaseName=drugBaseName;
this.codes=codes;
this.creator=creator;
this.doseStrength=doseStrenght;
this.route=route;
this.maximumDailyDose=maxDailyDose;
this.minimumDailyDose=miniDailyDose;
this.description=Description;
this.combination=combination;


}
@Override
public boolean equals(Object o) {
return EqualsBuilder.reflectionEquals(this, o);
}

@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this, "id");
}

@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
public String getDoseStrength() {
return doseStrength;
}

public void setDoseStrength(String doseStrength) {
this.doseStrength = doseStrength;
}

public String getUnits() {
return units;
}

public void setUnits(String units) {
this.units = units;
}

public String getMaximumDailyDose() {
return maximumDailyDose;
}

public void setMaximumDailyDose(String maximumDailyDose) {
this.maximumDailyDose = maximumDailyDose;
}

public String getMinimumDailyDose() {
return minimumDailyDose;
}

public void setMinimumDailyDose(String minimumDailyDose) {
this.minimumDailyDose = minimumDailyDose;
}

public String getRoute() {
return route;
}

public void setRoute(String route) {
this.route = route;
}

public String getDescription() {
return description;
}


public String getCreatorName() {
return creator;
}

public void setCreatorName(String creator) {
this.creator = creator;
}

public void setDescription(String description) {
this.description = description;
}

public String getCombination() {
return combination;
}

public void setCombination(String combination) {
this.combination = combination;
}
}
204 changes: 204 additions & 0 deletions opensrp-api/src/main/java/org/opensrp/api/domain/DrugOrder.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
package org.opensrp.api.domain;

import java.util.Map;

import org.codehaus.jackson.annotate.JsonProperty;
import org.ektorp.support.TypeDiscriminator;

@TypeDiscriminator("doc.type == 'DrugOrder'")
public class DrugOrder extends BaseDataObject {

@JsonProperty
private Map<String, String> codes;
@JsonProperty
private String orderType;
@JsonProperty
private String drugName;
@JsonProperty
private String orderNumber;
@JsonProperty
private String action;
@JsonProperty
private String previousOrder;
@JsonProperty
private String dateActivated;
@JsonProperty
private String dateStopped;
@JsonProperty
private String autoExpireDate;
@JsonProperty
private String urgency;
@JsonProperty
private String instructions;
@JsonProperty
private String orderReason;
@JsonProperty
private String dosingType;
@JsonProperty
private String dose;
@JsonProperty
private String descriptions;
@JsonProperty
private String quantity;

public DrugOrder(String drugName,String orderType, Map<String, String> codes,
String orderNumber, String action, String previousOrder
, String dateActivated, String dateStopped,String autoExpireDate,String urgency,
String instructions, String dosingType, String description,String quantity)
{
this.drugName=drugName;
this.orderType=orderType;
this.codes=codes;
this.orderNumber=orderNumber;
this.action=action;
this.previousOrder=previousOrder;
this.dateActivated=dateActivated;
this.dateStopped=dateStopped;
this.autoExpireDate=autoExpireDate;
this.urgency=urgency;
this.instructions=instructions;
this.dosingType=dosingType;
this.descriptions=description;
this.quantity=quantity;
}

public DrugOrder()
{

}

public DrugOrder(String drugName)
{
this.drugName=drugName;
}
public Map<String, String> getCodes() {
return codes;
}

public void setCodes(Map<String, String> codes) {
this.codes = codes;
}



public String getOrderType() {
return orderType;
}

public void setOrderType(String orderType) {
this.orderType = orderType;
}

public String getDrugName() {
return drugName;
}

public void setDrugName(String drugName) {
this.drugName = drugName;
}

public String getOrderNumber() {
return orderNumber;
}

public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber;
}

public String getAction() {
return action;
}

public void setAction(String action) {
this.action = action;
}

public String getPreviousOrder() {
return previousOrder;
}

public void setPreviousOrder(String previousOrder) {
this.previousOrder = previousOrder;
}

public String getDateActivated() {
return dateActivated;
}

public void setDateActivated(String dateActivated) {
this.dateActivated = dateActivated;
}

public String getDateStopped() {
return dateStopped;
}

public void setDateStopped(String dateStopped) {
this.dateStopped = dateStopped;
}

public String getAutoExpireDate() {
return autoExpireDate;
}

public void setAutoExpireDate(String autoExpireDate) {
this.autoExpireDate = autoExpireDate;
}

public String getUrgency() {
return urgency;
}

public void setUrgency(String urgency) {
this.urgency = urgency;
}

public String getInstructions() {
return instructions;
}

public void setInstructions(String instructions) {
this.instructions = instructions;
}

public String getOrderReason() {
return orderReason;
}

public void setOrderReason(String orderReason) {
this.orderReason = orderReason;
}

public String getDosingType() {
return dosingType;
}

public void setDosingType(String dosingType) {
this.dosingType = dosingType;
}

public String getDose() {
return dose;
}

public void setDose(String dose) {
this.dose = dose;
}

public String getDescriptions() {
return descriptions;
}

public void setDescriptions(String descriptions) {
this.descriptions = descriptions;
}

public String getQuantity() {
return quantity;
}

public void setQuantity(String quantity) {
this.quantity = quantity;
}

}
3 changes: 3 additions & 0 deletions opensrp-api/src/test/java/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Class-Path:

1 change: 1 addition & 0 deletions opensrp-common/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
Loading