org.openmrs.Order.setDiscontinuedBy()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(150)

本文整理了Java中org.openmrs.Order.setDiscontinuedBy()方法的一些代码示例,展示了Order.setDiscontinuedBy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Order.setDiscontinuedBy()方法的具体详情如下:
包路径:org.openmrs.Order
类名称:Order
方法名:setDiscontinuedBy

Order.setDiscontinuedBy介绍

暂无

代码示例

代码示例来源:origin: openmrs/openmrs-module-htmlformentry

protected void enterStandardRegimen(FormEntrySession session, HttpServletRequest submission, String regCode, Date startDate,
    Date discontinuedDate, String discontinuedReasonStr) {
  RegimenSuggestion rs = RegimenUtil.getStandardRegimenByCode(possibleRegimens, regCode);
  //create new drugOrders
  Set<Order> ords = RegimenUtil.standardRegimenToDrugOrders(rs, startDate, session.getPatient());    
  for (Order o: ords){
    if (o.getDateCreated() == null)
      o.setDateCreated(new Date());
    if (o.getCreator() == null)
      o.setCreator(Context.getAuthenticatedUser());
    if (o.getUuid() == null)
      o.setUuid(UUID.randomUUID().toString());
    if (!StringUtils.isEmpty(discontinuedReasonStr))
      o.setDiscontinuedReason(HtmlFormEntryUtil.getConcept(discontinuedReasonStr));
    if (discontinuedDate != null){
      o.setDiscontinuedDate(discontinuedDate);
      o.setDiscontinued(true);
      o.setDiscontinuedBy(Context.getAuthenticatedUser());
    }    
    session.getSubmissionActions().getCurrentEncounter().addOrder(o);
  }
}

代码示例来源:origin: openmrs/openmrs-module-htmlformentry

@Override
public Encounter getEncounterToView(){
  Encounter e = new Encounter();
  Patient p = Context.getPatientService().getPatient(2);
  e.setPatient(p);
  e.setEncounterDatetime(date);
  e.setProvider(Context.getPersonService().getPerson(502));
  e.setEncounterType(Context.getEncounterService().getEncounterType(1));
  e.setLocation(Context.getLocationService().getLocation(2));
  //add standard regimen to encounter:
  List<RegimenSuggestion> rs = DrugOrderSupport.getInstance().getStandardRegimens();
  RegimenSuggestion rsug = RegimenUtil.getStandardRegimenByCode(rs, "all3");
  Set<Order> dors = RegimenUtil.standardRegimenToDrugOrders(rsug, date, p);
  for (Order o : dors){
    o.setDiscontinuedDate(new Date(date.getTime() + 10));
    o.setDiscontinuedBy(Context.getAuthenticatedUser());
    o.setDiscontinuedReason(Context.getConceptService().getConcept(102));
    o.setDiscontinued(true);
    o.setDiscontinuedReasonNonCoded("non-coded reason");
    e.addOrder(o);
  }    
  //save so interceptor sets missing mandatory values
  return Context.getEncounterService().saveEncounter(e);
}

相关文章