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

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

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

Obs.getValueComplex介绍

[英]Get the value for the ComplexData. This method is used by the ComplexObsHandler. The valueComplex has two parts separated by a bar '|' character: part A) the title; and part B) the URI. The title is the readable description of the valueComplex that is returned by Obs#getValueAsString(). The URI is the location where the ComplexData is stored.
[中]获取ComplexData的值。ComplexObsHandler使用此方法。valueComplex有两个部分,由一个“|”字符分隔:部分a)标题;第二部分是URI。标题是Obs#getValueAsString()返回的valueComplex的可读描述。URI是存储ComplexData的位置。

代码示例

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

/**
 * Convenience method to create and return a file for the stored ComplexData.data Object
 * 
 * @param obs
 * @return File object
 */
public static File getComplexDataFile(Obs obs) {
  String[] names = obs.getValueComplex().split("\\|");
  String filename = names.length < 2 ? names[0] : names[names.length - 1];
  File dir = OpenmrsUtil.getDirectoryInApplicationDataDirectory(
    Context.getAdministrationService().getGlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_COMPLEX_OBS_DIR));
  return new File(dir, filename);
}

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

public Obs getObs(Obs obs, String view) {
  File file = getComplexDataFile(obs);
  log.debug("value complex: " + obs.getValueComplex());
  log.debug("file path: " + file.getAbsolutePath());
  ComplexData complexData = null;
    String[] names = obs.getValueComplex().split("\\|");
    String originalFilename = names[0];
    originalFilename = originalFilename.replaceAll(",", "").replaceAll(" ", "").replaceAll("file$", "");

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

public Obs getObs(Obs obs, String view) {
  File file = getComplexDataFile(obs);
  log.debug("value complex: " + obs.getValueComplex());
  log.debug("file path: " + file.getAbsolutePath());
  ComplexData complexData = null;
    String[] names = obs.getValueComplex().split("\\|");
    String originalFilename = names[0];
    originalFilename = originalFilename.replaceAll(",", "").replaceAll(" ", "").replaceAll("file$", "");

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

/**
 * @see org.openmrs.obs.ComplexObsHandler#getObs(Obs, String)
 */
public Obs getObs(Obs obs, String view) {
  File file = BinaryDataHandler.getComplexDataFile(obs);
  log.debug("value complex: " + obs.getValueComplex());
  log.debug("file path: " + file.getAbsolutePath());
  ComplexData complexData = null;
  try {
    complexData = new ComplexData(file.getName(), OpenmrsUtil.getFileAsBytes(file));
  }
  catch (IOException e) {
    log.error("Trying to read file: " + file.getAbsolutePath(), e);
  }
  String mimeType = OpenmrsUtil.getFileMimeType(file);
  complexData.setMimeType(mimeType);
  obs.setComplexData(complexData);
  
  return obs;
}

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

String[] names = obs.getValueComplex().split("\\|");
String originalFilename = names[0];
originalFilename = originalFilename.replace(",", "").replace(" ", "");

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

try {
  file = getComplexDataFile(obs);
  String[] names = obs.getValueComplex().split("\\|");
  String originalFilename = names[0];
  originalFilename = originalFilename.replace(",", "").replace(" ", "");

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

} else if ("ST".equals(abbrev)) {
    return getValueText();
  } else if ("ED".equals(abbrev) && getValueComplex() != null) {
    String[] valuesComplex = getValueComplex().split("\\|");
    for (String value : valuesComplex) {
      if (StringUtils.isNotEmpty(value)) {
if (getValueComplex() != null) {
  String[] valuesComplex = getValueComplex().split("\\|");
  for (String value : valuesComplex) {
    if (StringUtils.isNotEmpty(value)) {

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

String valueComplex = obsToSave.getValueComplex();
String filename = valueComplex.substring(valueComplex.indexOf("|") + 1).trim();
newComplexFile = new File(complexObsDir, filename);

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

Assert.assertNotNull(complexObs.getValueComplex());
Assert.assertNotNull(complexObs.getComplexData());
Assert.assertEquals(complexObs, os.getObsByUuid(complexObs.getUuid()));

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

if (obs.getValueComplex() != null) {
  errors.rejectValue("valueComplex", "error.not.null");
  && obs.getValueComplex() == null && obs.getValueDatetime() == null && obs.getValueDrug() == null
  && obs.getValueModifier() == null && obs.getValueNumeric() == null && obs.getValueText() == null
  && obs.getComplexData() == null) {

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

newObs.setInterpretation(obsToCopy.getInterpretation());
newObs.setValueComplex(obsToCopy.getValueComplex());
newObs.setComplexData(obsToCopy.getComplexData());
newObs.setFormField(obsToCopy.getFormFieldNamespace(),obsToCopy.getFormFieldPath());

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

String lookFor = existingObs == null ? null : existingObs.getValueComplex();
Obs initialValue = null;
if (lookFor != null) {

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

value = new ComplexData(existingObs.getValueComplex(), null);

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

if (obs.getValueComplex() != null) {
  return obs.getValueComplex();

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

@Test
@Verifies(value="shouldSetTheValueComplexOfObsIfConceptIsComplex",method="createObs(Concept concept, Object value, Date datetime, String accessionNumber)")
public void createObs_shouldSetTheValueComplexOfObsIfConceptIsComplex(){
  
  ComplexData complexData=new ComplexData("test", null);
  Concept c=new Concept();
  ConceptDatatype cd=new ConceptDatatype();
  cd.setUuid(HtmlFormEntryConstants.COMPLEX_UUID);
  c.setDatatype(cd);
  Obs o=HtmlFormEntryUtil.createObs(c, complexData, null, null);
  Assert.assertEquals(o.getValueComplex(),complexData.getTitle());
  
}

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

if (o.getValueCoded() != null || o.getValueComplex() != null || o.getValueDatetime() != null
    || o.getValueDrug() != null || o.getValueNumeric() != null || o.getValueText() != null) {
  Assert

相关文章