本文整理了Java中org.openmrs.Obs.setAccessionNumber()
方法的一些代码示例,展示了Obs.setAccessionNumber()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Obs.setAccessionNumber()
方法的具体详情如下:
包路径:org.openmrs.Obs
类名称:Obs
方法名:setAccessionNumber
暂无
代码示例来源:origin: openmrs/openmrs-core
/**
* @see ObsValidator#validate(java.lang.Object, org.springframework.validation.Errors)
*/
@Test
public void validate_shouldPassValidationIfFieldLengthsAreCorrect() {
Obs obs = new Obs();
obs.setPerson(Context.getPersonService().getPerson(2));
obs.setConcept(Context.getConceptService().getConcept(5089));
obs.setObsDatetime(new Date());
obs.setValueNumeric(1.0);
obs.setAccessionNumber("AccessionNumber");
obs.setValueModifier("m");
obs.setValueComplex("ValueComplex");
obs.setVoidReason("VoidReason");
obs.setComment("comment");
Errors errors = new BindException(obs, "obs");
obsValidator.validate(obs, errors);
assertFalse(errors.hasErrors());
}
代码示例来源:origin: openmrs/openmrs-core
/**
* @see ObsValidator#validate(java.lang.Object, org.springframework.validation.Errors)
*/
@Test
public void validate_shouldFailValidationIfFieldLengthsAreNotCorrect() {
Obs obs = new Obs();
obs.setPerson(Context.getPersonService().getPerson(2));
obs.setConcept(Context.getConceptService().getConcept(5089));
obs.setObsDatetime(new Date());
obs.setValueNumeric(1.0);
obs.setAccessionNumber("too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text");
obs.setValueModifier("too long text");
obs.setValueComplex("too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text");
obs.setVoidReason("too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text");
obs.setComment("too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text");
Errors errors = new BindException(obs, "obs");
obsValidator.validate(obs, errors);
assertTrue(errors.hasFieldErrors("accessionNumber"));
assertTrue(errors.hasFieldErrors("valueModifier"));
assertTrue(errors.hasFieldErrors("valueComplex"));
assertTrue(errors.hasFieldErrors("comment"));
assertTrue(errors.hasFieldErrors("voidReason"));
}
代码示例来源:origin: openmrs/openmrs-core
newObs.setAccessionNumber(obsToCopy.getAccessionNumber());
newObs.setValueCoded(obsToCopy.getValueCoded());
newObs.setValueDrug(obsToCopy.getValueDrug());
代码示例来源:origin: openmrs/openmrs-module-htmlformentry
obs.setObsDatetime(datetime);
if (accessionNumber != null)
obs.setAccessionNumber(accessionNumber);
return obs;
内容来源于网络,如有侵权,请联系作者删除!