org.openmrs.Obs.setValueDrug()方法的使用及代码示例

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

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

Obs.setValueDrug介绍

暂无

代码示例

代码示例来源:origin: openmrs/openmrs-core

Drug valueDrug = new Drug();
  valueDrug.setDrugId(Integer.valueOf(value.getAlternateIdentifier().getValue()));
  obs.setValueDrug(valueDrug);
} else {
  ConceptName valueConceptName = getConceptName(value);

代码示例来源:origin: openmrs/openmrs-core

/**
 * @see ObsValidator#validate(Object,Errors)
 */
@Test
public void validate_shouldPassIfAnswerConceptAndConceptOfValueDrugMatch() {
  Obs obs = new Obs();
  obs.setPerson(new Person(7));
  obs.setObsDatetime(new Date());
  Concept questionConcept = new Concept(100);
  ConceptDatatype dt = new ConceptDatatype(1);
  dt.setUuid(ConceptDatatype.CODED_UUID);
  questionConcept.setDatatype(dt);
  obs.setConcept(questionConcept);
  Concept answerConcept = new Concept(101);
  obs.setValueCoded(answerConcept);
  
  Drug drug = new Drug();
  drug.setConcept(answerConcept);
  obs.setValueDrug(drug);
  
  Errors errors = new BindException(obs, "obs");
  obsValidator.validate(obs, errors);
  assertFalse(errors.hasFieldErrors());
}

代码示例来源:origin: openmrs/openmrs-core

/**
 * @see ObsValidator#validate(Object,Errors)
 */
@Test
public void validate_shouldRejectAnInvalidConceptAndDrugCombination() {
  Obs obs = new Obs();
  obs.setPerson(new Person(7));
  obs.setObsDatetime(new Date());
  Concept questionConcept = new Concept(100);
  ConceptDatatype dt = new ConceptDatatype(1);
  dt.setUuid(ConceptDatatype.CODED_UUID);
  questionConcept.setDatatype(dt);
  obs.setConcept(questionConcept);
  obs.setValueCoded(new Concept(101));
  
  Drug drug = new Drug();
  drug.setConcept(new Concept(102));
  obs.setValueDrug(drug);
  
  Errors errors = new BindException(obs, "obs");
  obsValidator.validate(obs, errors);
  assertTrue(errors.hasFieldErrors("valueDrug"));
}

代码示例来源:origin: openmrs/openmrs-core

obs.setValueComplex("test");
obs.setValueDatetime(new Date());
obs.setValueDrug(Context.getConceptService().getDrug(3));
obs.setValueGroupId(getLoadCount());
obs.setValueModifier("test");

代码示例来源:origin: openmrs/openmrs-module-webservices.rest

if (valueDrug != null) {
  obs.setValueCoded(valueDrug.getConcept());
  obs.setValueDrug(valueDrug);
} else {
  throw new ObjectNotFoundException();

代码示例来源:origin: openmrs/openmrs-core

newObs.setAccessionNumber(obsToCopy.getAccessionNumber());
newObs.setValueCoded(obsToCopy.getValueCoded());
newObs.setValueDrug(obsToCopy.getValueDrug());
newObs.setValueGroupId(obsToCopy.getValueGroupId());
newObs.setValueDatetime(obsToCopy.getValueDatetime());

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

obs.setValueDrug((Drug) value);
  obs.setValueCoded(((Drug) value).getConcept());
} else if (value instanceof ConceptName) {

代码示例来源:origin: openmrs/openmrs-module-webservices.rest

private void clearAndSetValue(Obs obs, ObsType type, Object value) {
  obs.setValueCoded(type.equals(ObsType.CODED) ? (Concept) value : null);
  obs.setValueComplex(type.equals(ObsType.COMPLEX) ? (String) value : null);
  obs.setValueDatetime(type.equals(ObsType.DATETIME) ? (Date) value : null);
  obs.setValueDrug(type.equals(ObsType.DRUG) ? (Drug) value : null);
  obs.setValueNumeric(type.equals(ObsType.NUMERIC) ? (Double) value : null);
  obs.setValueText(type.equals(ObsType.TEXT) ? (String) value : null);
}

相关文章