org.hl7.fhir.utilities.xhtml.XhtmlNode.allText()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(157)

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

XhtmlNode.allText介绍

暂无

代码示例

代码示例来源:origin: jamesagnew/hapi-fhir

public String allText() {
 if (childNodes == null || childNodes.isEmpty())
  return getContent();
 
 StringBuilder b = new StringBuilder();
 for (XhtmlNode n : childNodes)
  if (n.getNodeType() == NodeType.Text)
   b.append(n.getContent());
  else if (n.getNodeType() == NodeType.Element)
   b.append(n.allText());
 return b.toString();
}

代码示例来源:origin: jamesagnew/hapi-fhir

/**
 * Generate EFhirClientException indicating the cause of the exception
 * along with any OperationOutcome server error the server may have generated.
 * 
 * A default message of "One or more server side errors have occurred during this operation. Refer to e.getServerErrors() for additional details."
 * will be returned to users.
 * 
 * @param message
 * @param serverError
 */
public EFhirClientException(OperationOutcome serverError) {
  super("Error on the server: "+serverError.getText().getDiv().allText()+". Refer to e.getServerErrors() for additional details.");
  if(serverError != null) {
    errors.add(serverError);
  }
}

代码示例来源:origin: jamesagnew/hapi-fhir

else if (c.getNodeType() == NodeType.Element) {
 if (c.getName().equals("a")) {
  list.add(new Piece(c.getAttribute("href"), c.allText(), c.getAttribute("title")));                    
 } else if (c.getName().equals("b") || c.getName().equals("em") || c.getName().equals("strong")) {
  list.add(new Piece(null, c.allText(), null).setStyle("font-face: bold"));                    
 } else if (c.getName().equals("code")) {
  list.add(new Piece(null, c.allText(), null).setStyle("padding: 2px 4px; color: #005c00; background-color: #f9f2f4; white-space: nowrap; border-radius: 4px"));                    
 } else if (c.getName().equals("i")) {
  list.add(new Piece(null, c.allText(), null).setStyle("font-style: italic"));
 } else if (c.getName().equals("pre")) {
  Piece p = new Piece(c.getName()).setStyle("white-space: pre; font-family: courier");
  p.getChildren().addAll(c.getChildNodes());
 } else if (c.getName().equals("i")) {
  list.add(new Piece(null, c.allText(), null).setStyle("font-style: italic"));                    
 } else if (c.getName().equals("h1")||c.getName().equals("h2")||c.getName().equals("h3")||c.getName().equals("h4")) {
  Piece p = new Piece(c.getName());

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-utilities

public String allText() {
 if (childNodes == null || childNodes.isEmpty())
  return getContent();
 
 StringBuilder b = new StringBuilder();
 for (XhtmlNode n : childNodes)
  if (n.getNodeType() == NodeType.Text)
   b.append(n.getContent());
  else if (n.getNodeType() == NodeType.Element)
   b.append(n.allText());
 return b.toString();
}

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-structures-r4

/**
 * Generate EFhirClientException indicating the cause of the exception
 * along with any OperationOutcome server error the server may have generated.
 * 
 * A default message of "One or more server side errors have occurred during this operation. Refer to e.getServerErrors() for additional details."
 * will be returned to users.
 * 
 * @param message
 * @param serverError
 */
public EFhirClientException(OperationOutcome serverError) {
  super("Error on the server: "+serverError.getText().getDiv().allText()+". Refer to e.getServerErrors() for additional details.");
  if(serverError != null) {
    errors.add(serverError);
  }
}

代码示例来源:origin: apache/ctakes

public void parseResource( final JCas jCas, final Basic resource ) {

//      composition.addAuthor( practitioner.getPractitionerReference() );
//      composition.setId( FhirElementFactory.createId( jCas, ID_NAME_COMPOSITION, noteSpecs.getNoteTime() ) );
//      composition.setStatus( Composition.CompositionStatus.FINAL );
//      composition.setType( getCompositionType() );
//      composition.setLanguage( "English" );
//      composition.setSubject( noteSpecs.getSubjectReference( FhirNoteSpecs.SUBJECT_PATIENT ) );

   // The following claim to have a 0 .. 1 cardinality, but the doc also states that they SHALL be listed.
//      composition.setEncounter( noteSpecs.getEncounterReference() );
//      composition.setCustodian( practitioner.getOrganizationReference() );
//      composition.addEvent( noteSpecs.getEvent() );
//      composition.addAttester( practitioner.createAttester( noteSpecs ) );

//      composition.setText( FhirElementFactory.createNarrative( jCas.getDocumentText() ) );
   final Narrative narrative = resource.getText();
   final XhtmlNode htmlNode = narrative.getDiv();
   final String docText = htmlNode.allText();
   jCas.setDocumentText( docText );
  }

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-utilities

else if (c.getNodeType() == NodeType.Element) {
 if (c.getName().equals("a")) {
  list.add(new Piece(c.getAttribute("href"), c.allText(), c.getAttribute("title")));                    
 } else if (c.getName().equals("b") || c.getName().equals("em") || c.getName().equals("strong")) {
  list.add(new Piece(null, c.allText(), null).setStyle("font-face: bold"));                    
 } else if (c.getName().equals("code")) {
  list.add(new Piece(null, c.allText(), null).setStyle("padding: 2px 4px; color: #005c00; background-color: #f9f2f4; white-space: nowrap; border-radius: 4px"));                    
 } else if (c.getName().equals("i")) {
  list.add(new Piece(null, c.allText(), null).setStyle("font-style: italic"));
 } else if (c.getName().equals("pre")) {
  Piece p = new Piece(c.getName()).setStyle("white-space: pre; font-family: courier");
  p.getChildren().addAll(c.getChildNodes());
 } else if (c.getName().equals("i")) {
  list.add(new Piece(null, c.allText(), null).setStyle("font-style: italic"));                    
 } else if (c.getName().equals("h1")||c.getName().equals("h2")||c.getName().equals("h3")||c.getName().equals("h4")) {
  Piece p = new Piece(c.getName());

代码示例来源:origin: apache/ctakes

final Narrative narrative = ((Composition) resource).getText();
final XhtmlNode html = narrative.getDiv();
final String docText = html.allText();
jCas.setDocumentText( docText );
return null;

代码示例来源:origin: apache/ctakes

final Narrative narrative = ((Composition)resource).getText();
final XhtmlNode html = narrative.getDiv();
final String docText = html.allText();
jCas.setDocumentText( docText );
return null;

相关文章