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

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

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

Obs.getComment介绍

暂无

代码示例

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

/**
 * @see Obs#isDirty()
 */
@Test
public void isDirty_shouldReturnTrueWhenAnImmutableFieldIsChangedFromANullToANonNullValueInExistingObs() throws Exception {
  Obs obs = new Obs(5);
  assertNull(obs.getComment());
  obs.setComment("some non null value");
  assertTrue(obs.isDirty());
}

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

/**
 * @see Obs#isDirty()
 */
@Test
public void isDirty_shouldReturnTrueWhenAnImmutableFieldIsChangedFromANonNullToANullValueForEditedObs() throws Exception {
  Obs obs = createObs(2);
  assertNotNull(obs.getComment());
  obs.setComment(null);
  assertTrue(obs.isDirty());
}

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

/**
 * @see Obs#isDirty()
 */
@Test
public void isDirty_shouldReturnFalsWhenAnImmutableFieldIsChangedFromANonNullToANullValueForNewObs() throws Exception {
  Obs obs = createObs(null);
  assertNotNull(obs.getComment());
  obs.setComment(null);
  assertFalse(obs.isDirty());
}

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

/**
 * @see Obs#isDirty()
 */
@Test
public void isDirty_shouldReturnFalseWhenAnImmutableFieldIsChangedFromANullToANonNullValueInNewObs() throws Exception {
  Obs obs = new Obs();
  assertNull(obs.getComment());
  obs.setComment("some non null value");
  assertFalse(obs.isDirty());
}

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

while (newObservation == null && thisIndex < newList.size()) {
  Obs newObs = newList.get(thisIndex++);
  if (!oldList.contains(newObs) && !newObs.isObsGrouping() && newObs.getComment() != null)
    newObservation = newObs;
Assert.assertEquals("This is a comment that spans two lines", newObservation.getComment());

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

/**
 * @see PatientService#mergePatients(Patient,Patient)
 */
@Test
public void mergePatients_shouldAuditMovedIndependentObservations() throws Exception {
  //retrieve patients
  Patient preferred = patientService.getPatient(999);
  Patient notPreferred = patientService.getPatient(7);
  voidOrders(Collections.singleton(notPreferred));
  
  //get an observation for notPreferred and make it independent from any encounter
  Obs obs = Context.getObsService().getObs(7);
  obs.setEncounter(null);
  obs.setComment("this observation is for testing the merge");
  Context.getObsService().saveObs(obs, "Reason cannot be blank");
  
  //merge the two patients and retrieve the audit object
  PersonMergeLog audit = mergeAndRetrieveAudit(preferred, notPreferred);
  String uuid = null;
  List<Obs> observations = Context.getObsService().getObservationsByPerson(preferred);
  for (Obs o : observations) {
    if (obs.getComment().equals(o.getComment())) {
      uuid = o.getUuid();
    }
  }
  Assert.assertTrue("moving of independent observation was not audited",
    isValueInList(uuid, audit.getPersonMergeLogData().getMovedIndependentObservations()));
}

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

/**
 * @see ORUR01Handler#parseObs(Encounter,OBX,OBR,String)
 */
@Test
public void parseObs_shouldAddCommentsToAnObservationGroup() throws Exception {
  ObsService os = Context.getObsService();
  String hl7string = "MSH|^~\\&|FORMENTRY|AMRS.ELD|HL7LISTENER|AMRS.ELD|20080226102656||ORU^R01|JqnfhKKtouEz8kzTk6Zo|P|2.5|1||||||||16^AMRS.ELD.FORMID\r"
      + "PID|||7^^^^||Collet^Test^Chebaskwony||\r"
      + "PV1||O|1^Unknown Location||||1^Super User (1-8)|||||||||||||||||||||||||||||||||||||20080212|||||||V\r"
      + "ORC|RE||||||||20080226102537|1^Super User\r"
      + "OBR|1|||23^FOOD CONSTRUCT^99DCT\r"
      + "NTE|1|L|This is a comment\r"
      + "OBX|1|NM|5497^CD4, BY FACS^99DCT||1|||||||||20080206\r"
      + "NTE|1|L|This should not be considered :-)";
  List<Obs> oldList = os.getObservationsByPersonAndConcept(new Person(7), new Concept(23));
  Message hl7message = parser.parse(hl7string);
  router.processMessage(hl7message);
  List<Obs> newList = os.getObservationsByPersonAndConcept(new Person(7), new Concept(23));
  Obs newObservation = null;
  for (Obs newObs : newList) {
    if (!oldList.contains(newObs) && newObs.isObsGrouping()) {
      newObservation = newObs;
    }
  }
  Assert.assertEquals("This is a comment", newObservation.getComment());
}

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

/**
 * @see ORUR01Handler#parseObs(Encounter,OBX,OBR,String)
 */
@Test
public void parseObs_shouldAddCommentsToAnObservationFromNTESegments() throws Exception {
  ObsService os = Context.getObsService();
  String hl7string = "MSH|^~\\&|FORMENTRY|AMRS.ELD|HL7LISTENER|AMRS.ELD|20080226102656||ORU^R01|JqnfhKKtouEz8kzTk6Zo|P|2.5|1||||||||16^AMRS.ELD.FORMID\r"
      + "PID|||7^^^^||Collet^Test^Chebaskwony||\r"
      + "PV1||O|1^Unknown Location||||1^Super User (1-8)|||||||||||||||||||||||||||||||||||||20080212|||||||V\r"
      + "ORC|RE||||||||20080226102537|1^Super User\r"
      + "OBR|1|||1238^MEDICAL RECORD OBSERVATIONS^99DCT\r"
      + "OBX|1|NM|5497^CD4, BY FACS^99DCT||1|||||||||20080206\r" + "NTE|1|L|This is a comment";
  // the expected question for the obs in the hl7 message has to be
  // numeric
  Assert.assertEquals("Numeric", Context.getConceptService().getConcept(5497).getDatatype().getName());
  List<Obs> oldList = os.getObservationsByPersonAndConcept(new Person(7), new Concept(5497));
  Message hl7message = parser.parse(hl7string);
  router.processMessage(hl7message);
  List<Obs> newList = os.getObservationsByPersonAndConcept(new Person(7), new Concept(5497));
  Obs newObservation = null;
  for (Obs newObs : newList) {
    if (!oldList.contains(newObs) && !newObs.isObsGrouping()) {
      newObservation = newObs;
    }
  }
  Assert.assertEquals("This is a comment", newObservation.getComment());
}

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

sb.append(DEFAULT_COLUMN_SEPARATOR);
sb.append(DEFAULT_QUOTE);        
sb.append((o != null && o.getComment() != null) ? o.getComment():EMPTY);                                   
sb.append(DEFAULT_QUOTE);

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

assertEquals(comment, saved.getComment());
assertEquals(concept, saved.getConcept());
assertEquals(encounter, saved.getEncounter());

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

newObs.setValueModifier(obsToCopy.getValueModifier());
newObs.setValueText(obsToCopy.getValueText());
newObs.setComment(obsToCopy.getComment());
newObs.setEncounter(obsToCopy.getEncounter());
newObs.setCreator(obsToCopy.getCreator());

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

context.registerErrorWidget(commentFieldWidget, errorWidget);
if (existingObs != null) {
  commentFieldWidget.setInitialValue(existingObs.getComment());

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

@Override
public void testEditedResults(SubmissionResults results) {
  results.assertNoErrors();;
  results.assertProvider(502);
  results.assertLocation(2);
  results.assertObsCreatedCount(1);
  Obs locationObs = results.getEncounterCreated().getObs().iterator().next();
  Assert.assertEquals("3", locationObs.getValueText());
  Assert.assertNull(locationObs.getValueCoded());
  Assert.assertEquals("org.openmrs.Location", locationObs.getComment());
};

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

@Override
  public void testResults(SubmissionResults results) {
    results.assertNoErrors();
    results.assertEncounterCreated();
    results.assertProvider(502);
    results.assertLocation(2);
    results.assertObsCreatedCount(1);
    Obs locationObs = results.getEncounterCreated().getObs().iterator().next();
    Assert.assertEquals("2", locationObs.getValueText());
    Assert.assertNull(locationObs.getValueCoded());
    Assert.assertEquals("org.openmrs.Location", locationObs.getComment());
  }
}.run();

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

} else if (datatype.isText()) {
  if ("org.openmrs.Location".equals(field.getExistingObs().getComment())) {
    value = locationService.getLocation(new Integer(field.getExistingObs().getValueText())).getName();

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

if ("org.openmrs.Location".equals(obs.getComment())) { // string first to make it null-safe
  try {
    return Context.getLocationService().getLocation(new Integer(obs.getValueText()));

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

@Override
public void validateDefaultRepresentation() throws Exception {
  super.validateDefaultRepresentation();
  assertPropPresent("person");
  assertPropPresent("concept");
  assertPropPresent("value");
  assertPropEquals("obsDatetime", getObject().getObsDatetime());
  assertPropEquals("accessionNumber", getObject().getAccessionNumber());
  assertPropEquals("obsGroup", getObject().getObsGroup());
  assertPropPresent("groupMembers");
  assertPropEquals("comment", getObject().getComment());
  assertPropPresent("location");
  assertPropPresent("order");
  assertPropPresent("encounter");
  assertPropEquals("voided", getObject().getVoided());
}

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

@Override
public void validateFullRepresentation() throws Exception {
  super.validateFullRepresentation();
  assertPropPresent("person");
  assertPropPresent("concept");
  assertPropPresent("value");
  assertPropEquals("obsDatetime", getObject().getObsDatetime());
  assertPropEquals("accessionNumber", getObject().getAccessionNumber());
  assertPropEquals("obsGroup", getObject().getObsGroup());
  assertPropPresent("groupMembers");
  assertPropEquals("comment", getObject().getComment());
  assertPropPresent("location");
  assertPropPresent("order");
  assertPropPresent("encounter");
  assertPropEquals("voided", getObject().getVoided());
  assertPropPresent("auditInfo");
}

相关文章