This module aims to extend the Order API available in OpenMRS 1.9 and earlier, by building the following features:

Order Set Design

class OrderSet extends BaseOpenmrsMetadata {
  Operator operator;
  Concept indication;
  boolean cyclical
  Integer cycleLengthInDays;
  List<OrderSetMember> members;

abstract class OrderSetMember extends BaseOpenmrsObject {
  OrderSet orderSet;
  String title;
  String comment;
  boolean selected;
  Integer relativeStartDay;
  Integer lengthInDays;
  String template;

abstract class SingleOrderSetMember extends OrderSetMember {
  abstract OrderType getOrderType();
  Concept concept;
  Concept indication;
  String instructions;

class TestOrderSetMember extends SingleOrderSetMember {
  OrderType getOrderType() { test order }

class DrugOrderSetMember extends SingleOrderSetMember {
  OrderType getOrderType() { ORDERTYPE_DRUG }
  Drug drug;
  Double dose;
  String units;
  Concept route;
  String frequency;
  boolean asNeeded;
  String administrationInstructions;

class NestedOrderSetMember extends OrderSetMember {
  OrderSet nestedOrderSet;

Order Group Design

abstract class OrderGroup extends BaseOpenmrsData {
  OrderSet orderSet;

class DrugRegimen extends OrderGroup {
  List<ExtendedDrugOrder> members;
  Integer cycleNumber;

Order Extensions

interface GroupableOrder extends OpenmrsData {
  Integer getOrderId();
  void setOrderId(Integer orderId);
  Patient getPatient();
  void setPatient(Patient patient);
  OrderType getOrderType();
  void setOrderType(OrderType orderType);
  Concept getConcept();
  void setConcept(Concept concept);
  String getInstructions();
  void setInstructions(String instructions);
  Date getStartDate();
  void setStartDate(Date startDate);
  Date getAutoExpireDate();
  void setAutoExpireDate(Date autoExpireDate);
  Encounter getEncounter();
  void setEncounter(Encounter encounter);
  User getOrderer();
  void setOrderer(User orderer);
  Boolean getDiscontinued();
  void setDiscontinued(Boolean discontinued);
  User getDiscontinuedBy();
  void setDiscontinuedBy(User discontinuedBy);
  Date getDiscontinuedDate();
  void setDiscontinuedDate(Date discontinuedDate);
  Concept getDiscontinuedReason();
  void setDiscontinuedReason(Concept discontinuedReason);
  String getDiscontinuedReasonNonCoded();
  void setDiscontinuedReasonNonCoded(String discontinuedReasonNonCoded);
  String getAccessionNumber();
  void setAccessionNumber(String accessionNumber);

class ExtendedOrder extends Order implements GroupableOrder {
  OrderGroup group

class ExtendedDrugOrder extends DrugOrder implements GroupableOrder {
  OrderGroup group;
  Concept indication;
  Concept route;
  String administrationInstructions;