本文整理了Java中org.carewebframework.common.StrUtil.piece()
方法的一些代码示例,展示了StrUtil.piece()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StrUtil.piece()
方法的具体详情如下:
包路径:org.carewebframework.common.StrUtil
类名称:StrUtil
方法名:piece
[英]Returns the first piece of text as delimited by delimiter.
[中]返回由分隔符分隔的第一段文本。
代码示例来源:origin: org.carewebframework/org.carewebframework.common
/**
* Returns the first piece of text as delimited by delimiter.
*
* @param text Text to piece.
* @param delimiter Delimiter for piecing.
* @return First piece of text.
*/
public static String piece(String text, String delimiter) {
return piece(text, delimiter, 1);
}
代码示例来源:origin: org.carewebframework/org.carewebframework.common
/**
* Returns the specified piece of text as delimited by delimiter.
*
* @param text Text to piece.
* @param delimiter Delimiter for piecing.
* @param position Position of piece to extract.
* @return The requested text piece.
*/
public static String piece(String text, String delimiter, int position) {
return piece(text, delimiter, position, position);
}
代码示例来源:origin: org.carewebframework/org.carewebframework.rpms.ui.anticoag
private void errorCheck(String msg) {
if (msg != null && msg.startsWith("-")) {
throw new RuntimeException(StrUtil.piece(msg, StrUtil.U, 2));
}
}
代码示例来源:origin: org.carewebframework/org.carewebframework.help.chm.adapter
@Override
public HelpTopic getTopic(String topicId) {
HelpTopic topic = topics.get(topicId);
if (topic == null && ("/" + topicId).startsWith(baseURL)) {
int i = topicId.lastIndexOf('/');
topicId = StrUtil.piece(topicId.substring(i + 1).replace('_', ' '), ".htm");
return getTopic(topicId);
}
return topic;
}
代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.cwad
@Override
protected void renderItem(Listitem item, String data) {
createCell(item, StrUtil.piece(data, U, 2));
createCell(item, StrUtil.piece(data, U, 3));
createCell(item, StrUtil.piece(data, U, 4));
}
代码示例来源:origin: org.carewebframework/org.carewebframework.vista.api.notification
/**
* Extract a parameter from name/value pairs in extra info.
*
* @param param Parameter name.
* @return Parameter value, or null if not found.
*/
public String getParam(String param) {
int i = findParam(param);
return i < 0 ? null : StrUtil.piece(extraInfo[i], "=", 2);
}
代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.context.encounter
private Encounter parse(String value) {
return EncounterUtil.decode(StrUtil.piece(value, StrUtil.U));
}
}
代码示例来源:origin: org.carewebframework/org.carewebframework.rpms.ui.core
private static void addModifier(Combobox cbo, String modifier) {
Comboitem item = cbo.appendItem(StrUtil.piece(modifier, StrUtil.U));
item.setValue(Integer.parseInt(StrUtil.piece(modifier, StrUtil.U, 3)));
}
代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.encounter
private Encounter parse(String value) {
return EncounterUtil.decode(StrUtil.piece(value, StrUtil.U));
}
}
代码示例来源:origin: org.carewebframework/org.carewebframework.rpms.ui.anticoag
private void getChoices(String file, String field, List<String> result) {
result.clear();
broker.callRPCList("BGOUTL3 GETSET", result, file, field, "");
errorCheck(result);
for (int i = 0; i < result.size(); i++) {
result.set(i, StrUtil.piece(result.get(i), StrUtil.U, 2));
}
}
代码示例来源:origin: org.carewebframework/org.carewebframework.rpms.ui.medlist
private boolean checkInOut(String data) {
String inout = piece(data, ";", 2);
String opt = (String) rgInOut.getSelectedItem().getValue();
return opt.contains(inout);
}
代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.allergies
@Override
protected void renderItem(Listitem item, String dao) {
super.renderItem(item, dao);
if ("1".equals(piece(dao, U, 5))) {
ZKUtil.updateStyle(item, "font-color", "blue");
}
}
代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.cwad
@Override
protected void renderItem(Listitem item, String data) {
createCell(item, StrUtil.piece(data, U, 2));
createCell(item, StrUtil.piece(data, U, 3));
FMDate date = FMDate.fromString(StrUtil.piece(data, U, 5));
createCell(item, DateUtil.formatDate(date));
}
代码示例来源:origin: org.carewebframework/org.carewebframework.vista.api.core
public static boolean setSysParam(String param, String value) {
String s = StrUtil.piece(getBrokerSession().callRPC("RGCWFPAR SETPAR", param, value, "USR"), StrUtil.U, 2);
return s.isEmpty();
}
代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.core
protected String getLogicalId(T data) {
return data instanceof String ? piece((String) data, U) : data instanceof IReferenceable ? ((IReferenceable) data)
.getId().getIdPart() : "";
}
代码示例来源:origin: org.carewebframework/org.carewebframework.common
@Test
public void testPiece() {
String text = "pc1^pc2^pc3^^pc5^pc6^^^";
String delm = "^";
assertEquals("pc1", StrUtil.piece(text, delm));
assertEquals("pc2", StrUtil.piece(text, delm, 2));
assertEquals("pc3^^pc5", StrUtil.piece(text, delm, 3, 5));
assertEquals("pc6^^^", StrUtil.piece(text, delm, 6, 9999));
assertEquals("", StrUtil.piece(text, delm, 0));
assertEquals("", StrUtil.piece(text, delm, 0, 0));
assertEquals("pc1^pc2^pc3^^pc5", StrUtil.piece(text, delm, 0, 5));
}
代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.laborders
/**
* Logic to return detail information for specified item.
*
* @param data The item data.
* @return The detail information.
*/
@Override
protected String getDetail(String data) {
data = piece(data, U);
return data.isEmpty() ? null : fromList(getBroker().callRPCList(detailRPC, null, patient.getId().getIdPart(), data,
data));
}
代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.context.encounter
@Override
public void renderItem(Listitem item, Object data) {
Practitioner provider = data instanceof Practitioner ? (Practitioner) data : ProviderUtil.fetchProvider(StrUtil
.piece((String) data, StrUtil.U));
item.setValue(provider);
createCell(item, provider.getName());
Practitioner primaryProvider = encounterProvider.getPrimaryProvider();
item.setSclass(primaryProvider == null || !provider.equals(primaryProvider) ? null : Constants.SCLASS_PRIMARY);
item.addForward(Events.ON_DOUBLE_CLICK, item.getListbox(), null);
}
代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.cwad
public void onClick$lstAllergies() {
Listitem item = lstAllergies.getSelectedItem();
if (item != null) {
lstAllergies.clearSelection();
String s = item.getValue();
List<String> lst = broker.callRPCList("RGCWARCV DETAIL", null, patientId, StrUtil.piece(s, U));
ReportBox.modal(lst, code2Text('A'), allowPrint);
}
}
代码示例来源:origin: org.carewebframework/org.carewebframework.rpms.ui.core
public static String addProblem(String sICDIEN, String narrative, String onset) {
BrokerSession broker = VistAUtil.getBrokerSession();
String institution = UserContext.getActiveUser().getSecurityDomain().getLogicalId();
Patient patient = PatientContext.getActivePatient();
if (onset == null) {
onset = StrUtil.piece(broker.getHostTime().toString(), " ");
}
// ICD IEN or Code [1] ^ Narrative [2] ^ Location IEN [3] ^ Date of Onset [4] ^ Class [5] ^
// Status [6] ^ Patient IEN [7] ^ Problem IEN [8] ^ Problem # [9]
String s = VistAUtil.concatParams(sICDIEN, narrative, institution, onset, null, "A", patient.getId().getIdPart(),
null, null);
return broker.callRPC("BGOPROB SET", s);
}
内容来源于网络,如有侵权,请联系作者删除!