本文整理了Java中org.openmrs.Obs.getValueCodedName()
方法的一些代码示例,展示了Obs.getValueCodedName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Obs.getValueCodedName()
方法的具体详情如下:
包路径:org.openmrs.Obs
类名称:Obs
方法名:getValueCodedName
[英]Gets the specific name used for the coded value.
[中]
代码示例来源:origin: openmrs/openmrs-core
return getValueDrug().getFullName(locale);
} else {
ConceptName codedName = getValueCodedName();
if (codedName != null) {
return getValueCoded().getName(locale, false).getName();
return getValueDrug().getFullName(locale);
} else {
ConceptName valudeCodedName = getValueCodedName();
if (valudeCodedName != null) {
return valudeCodedName.getName();
代码示例来源:origin: openmrs/openmrs-core
obs.setConcept(c);
String title = null;
if (obs.getValueCodedName() != null) {
title = obs.getValueCodedName().getName();
代码示例来源:origin: openmrs/openmrs-core
ConceptName name = obss.get(0).getValueCodedName();
Assert.assertNotNull(name);
Assert.assertEquals("The valueCodedName should be 2471", 2471, name.getId().intValue());
代码示例来源:origin: openmrs/openmrs-core
/**
* @see ConceptService#mapConceptProposalToConcept(ConceptProposal,Concept,Locale)
*/
@Test
public void mapConceptProposalToConcept_shouldSetValueCodedNameWhenAddSynonymIsSelected() {
ConceptProposal cp = conceptService.getConceptProposal(2);
Assert.assertEquals(OpenmrsConstants.CONCEPT_PROPOSAL_UNMAPPED, cp.getState());
final Concept civilStatusConcept = conceptService.getConcept(4);
final int mappedConceptId = 6;
final String finalText = "Weight synonym";
Assert.assertTrue(Context.getObsService().getObservationsByPersonAndConcept(cp.getEncounter().getPatient(),
civilStatusConcept).isEmpty());
Concept mappedConcept = conceptService.getConcept(mappedConceptId);
mappedConcept.addDescription(new ConceptDescription("some description",Context.getLocale()));
cp.setFinalText(finalText);
cp.setObsConcept(civilStatusConcept);
cp.setState(OpenmrsConstants.CONCEPT_PROPOSAL_SYNONYM);
conceptService.mapConceptProposalToConcept(cp, mappedConcept, null);
mappedConcept = conceptService.getConcept(mappedConceptId);
List<Obs> observations = Context.getObsService().getObservationsByPersonAndConcept(cp.getEncounter().getPatient(),
civilStatusConcept);
Assert.assertEquals(1, observations.size());
Obs obs = observations.get(0);
Assert.assertNotNull(obs.getValueCodedName());
Assert.assertEquals(finalText, obs.getValueCodedName().getName());
}
代码示例来源:origin: openmrs/openmrs-core
/**
* @see ConceptService#mapConceptProposalToConcept(ConceptProposal,Concept,Locale)
*/
@Test
public void mapConceptProposalToConcept_shouldNotSetValueCodedNameWhenAddConceptIsSelected() {
ConceptProposal cp = conceptService.getConceptProposal(2);
Assert.assertEquals(OpenmrsConstants.CONCEPT_PROPOSAL_UNMAPPED, cp.getState());
final Concept civilStatusConcept = conceptService.getConcept(4);
final int mappedConceptId = 6;
Assert.assertTrue(Context.getObsService().getObservationsByPersonAndConcept(cp.getEncounter().getPatient(),
civilStatusConcept).isEmpty());
Concept mappedConcept = conceptService.getConcept(mappedConceptId);
cp.setObsConcept(civilStatusConcept);
cp.setState(OpenmrsConstants.CONCEPT_PROPOSAL_CONCEPT);
conceptService.mapConceptProposalToConcept(cp, mappedConcept, null);
mappedConcept = conceptService.getConcept(mappedConceptId);
List<Obs> observations = Context.getObsService().getObservationsByPersonAndConcept(cp.getEncounter().getPatient(),
civilStatusConcept);
Assert.assertEquals(1, observations.size());
Obs obs = observations.get(0);
Assert.assertNull(obs.getValueCodedName());
}
代码示例来源:origin: openmrs/openmrs-core
else if (obs.getValueBoolean() == null && obs.getValueCoded() == null && obs.getValueCodedName() == null
&& obs.getValueComplex() == null && obs.getValueDatetime() == null && obs.getValueDrug() == null
&& obs.getValueModifier() == null && obs.getValueNumeric() == null && obs.getValueText() == null
代码示例来源:origin: openmrs/openmrs-module-htmlformentry
} else if (value instanceof ConceptName) {
obs.setValueCodedName((ConceptName) value);
obs.setValueCoded(obs.getValueCodedName().getConcept());
} else if (value instanceof Concept) {
obs.setValueCoded((Concept) value);
代码示例来源:origin: openmrs/openmrs-module-htmlformentry
@Test
@Verifies(value="shouldSetValueCodedNameGivenAConceptName",method="createObs(Concept concept, Object value, Date datetime, String accessionNumber)")
public void createObs_shouldSetValueCodedNameGivenAConceptName() {
Concept answerConcept = new Concept();
ConceptName answer = new ConceptName("Answer", Context.getLocale());
answerConcept.addName(answer);
Concept question = new Concept();
question.setUuid(UUID.randomUUID().toString());
question.setDatatype(Context.getConceptService().getConceptDatatypeByName("Coded"));
Obs created = HtmlFormEntryUtil.createObs(question, answer, new Date(), "");
assertThat(created.getValueCodedName(), is(answerConcept.getPreferredName(Context.getLocale())));
assertThat(created.getValueCoded(), is(answerConcept));
}
代码示例来源:origin: openmrs/openmrs-module-htmlformentry
ConceptName conceptName7 = new ConceptName();
conceptName7.setName("TB");
when(obs7.getValueCodedName()).thenReturn(conceptName7);
field7.setExistingObs(obs7);
section1.addField(field7);
代码示例来源:origin: openmrs/openmrs-module-htmlformentry
value = field.getExistingObs().getValueCodedName() != null ?
field.getExistingObs().getValueCodedName().getName() :
field.getExistingObs().getValueCoded() != null ?
field.getExistingObs().getValueCoded().getName().getName() : "";
内容来源于网络,如有侵权,请联系作者删除!