本文整理汇总了Java中ca.uhn.hl7v2.util.Terser类的典型用法代码示例。如果您正苦于以下问题:Java Terser类的具体用法?Java Terser怎么用?Java Terser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Terser类属于ca.uhn.hl7v2.util包,在下文中一共展示了Terser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: next
import ca.uhn.hl7v2.util.Terser; //导入依赖的package包/类
@Override
public Message next() throws IOException, HL7Exception {
Message ret = null;
while (psqlReaderNextmsg != null && ret == null) {
Message nextMsg = psqlReaderNextmsg;
readNextPsqlMessage();
if (skipMessages) {
Terser nextMsgTerser = new Terser(nextMsg);
String currMSH10 = nextMsgTerser.get("/MSH-10");
if (lastSuccessSendMsgId.compareTo(currMSH10) == 0) {
LOG.info("Skip message (for the last time):" + currMSH10);
skipMessages = false;
} else {
LOG.info("Skip message:" + currMSH10);
}
} else {
ret = nextMsg;
}
}
return ret;
}
示例2: next
import ca.uhn.hl7v2.util.Terser; //导入依赖的package包/类
@Override
public Message next() throws HL7Exception {
Message ret = null;
while (hapiIter.hasNext() && ret == null) {
Message nextMsg = hapiIter.next();
if (skipMessages) {
Terser nextMsgTerser = new Terser(nextMsg);
String currMSH10 = nextMsgTerser.get("/MSH-10");
if (lastSuccessSendMsgId.compareTo(currMSH10) == 0) {
LOG.info("Skip message (for the last time):" + currMSH10);
skipMessages = false;
} else {
LOG.info("Skip message:" + currMSH10);
}
} else {
ret = nextMsg;
}
}
return ret;
}
示例3: getOBXCommentCount
import ca.uhn.hl7v2.util.Terser; //导入依赖的package包/类
/**
* Methods to get information from observation notes
*/
public int getOBXCommentCount(int i, int j){
int count = 0;
try{
String comment = "";
OBX obxSeg = ( obrSegMap.get(obrSegKeySet.get(i))).get(j);
while(comment != null){
count++;
comment = Terser.get(obxSeg,7,count,1,1);
if (comment == null)
comment = Terser.get(obxSeg,7,count,2,1);
}
count--;
}catch(Exception e){
logger.error("Exception retrieving obx comment count", e);
count = 0;
}
return count;
}
示例4: getOBXIdentifier
import ca.uhn.hl7v2.util.Terser; //导入依赖的package包/类
public String getOBXIdentifier(int i, int j) {
try {
Terser t = new Terser(msg);
Segment obxSeg = ((ca.uhn.hl7v2.model.v25.segment.OBX) ((ArrayList) obrSegMap.get(obrSegKeySet.get(i)))
.get(j));
String ident = getString(Terser.get(obxSeg, 3, 0, 1, 1));
String subIdent = Terser.get(obxSeg, 3, 0, 1, 2);
if (subIdent != null)
ident = ident + "&" + subIdent;
//logger.info("returning obx identifier: " + ident);
return (ident);
} catch (Exception e) {
logger.error("error returning obx identifier", e);
}
return "";
}
示例5: getOBXUnits
import ca.uhn.hl7v2.util.Terser; //导入依赖的package包/类
public String getOBXUnits(int i, int j) {
String ret = "";
try {
ca.uhn.hl7v2.model.v25.segment.OBX obxSeg = (obrSegMap.get(obrSegKeySet.get(i))).get(j);
ret = getString(obxSeg.getUnits().getIdentifier().getValue());
// if there are no units specified check the formatted reference
// range for the units
if (ret.equals("")) {
Terser terser = new Terser(msg);
ret = getString(Terser.get(obxSeg, 7, 0, 2, 1));
// only display units from the formatted reference range if they
// have not already been displayed as the reference range
if (ret.contains("-") || ret.contains("<") || ret.contains(">") || ret.contains("NEGATIVE"))
ret = "";
}
} catch (Exception e) {
logger.error("Exception retrieving units", e);
}
return ret.replaceAll("\\\\\\.br\\\\", "");
}
示例6: getOBXCommentCount
import ca.uhn.hl7v2.util.Terser; //导入依赖的package包/类
/**
* Methods to get information from observation notes
*/
public int getOBXCommentCount(int i, int j) {
int count = 0;
try {
//for ITS^REPORT return the fields of the ITS REPORT as comments
if (isReport(i, j))
return 1; //1 line of report per OBX line as comment
Terser terser = new Terser(msg);
String comment = "";
OBX obxSeg = getOBX(i, j);
while (comment != null) {
count++;
comment = Terser.get(obxSeg, 7, count, 1, 1);
if (comment == null)
comment = Terser.get(obxSeg, 7, count, 2, 1);
}
count--;
} catch (Exception e) {
logger.error("Exception retrieving obx comment count", e);
count = 0;
}
return count;
}
示例7: getOBXComment
import ca.uhn.hl7v2.util.Terser; //导入依赖的package包/类
public String getOBXComment(int i, int j, int k) {
String comment = "";
try {
if (isReport(i, j)) {
return getOBXResult(i, j, true);
}
k++;
Terser terser = new Terser(msg);
ca.uhn.hl7v2.model.v25.segment.OBX obxSeg = (ca.uhn.hl7v2.model.v25.segment.OBX) ((ArrayList) obrSegMap
.get(obrSegKeySet.get(i))).get(j);
comment = Terser.get(obxSeg, 7, k, 1, 1);
if (comment == null)
comment = Terser.get(obxSeg, 7, k, 2, 1);
} catch (Exception e) {
logger.error("Cannot return comment", e);
}
return comment.replaceAll("\\\\\\.br\\\\", "<br />");
}
示例8: getOBXResult
import ca.uhn.hl7v2.util.Terser; //导入依赖的package包/类
public String getOBXResult(int i, int j){
String result = "";
try{
Terser terser = new Terser(msg);
result = getString(Terser.get(msg.getRESPONSE().getORDER_OBSERVATION(i).getOBSERVATION(j).getOBX(),5,0,1,1));
// format the result
if (result.endsWith("."))
result = result.substring(0, result.length()-1);
}catch(Exception e){
logger.error("Exception returning result", e);
}
return result;
}
示例9: getOBXComment
import ca.uhn.hl7v2.util.Terser; //导入依赖的package包/类
public String getOBXComment(int i, int j, int k){
String comment = "";
try{
k++;
Terser terser = new Terser(msg);
OBX obxSeg = msg.getRESPONSE().getORDER_OBSERVATION(i).getOBSERVATION(j).getOBX();
comment = Terser.get(obxSeg,7,k,1,1);
if (comment == null)
comment = Terser.get(obxSeg,7,k,2,1);
}catch(Exception e){
logger.error("Cannot return comment", e);
}
return comment.replaceAll("\\\\\\.br\\\\", "<br />");
}
示例10: getOBXIdentifier
import ca.uhn.hl7v2.util.Terser; //导入依赖的package包/类
public String getOBXIdentifier(int i, int j){
try{
Segment obxSeg = ((obrSegMap.get(obrSegKeySet.get(i))).get(j));
String ident = getString(Terser.get(obxSeg, 3, 0, 1, 1 ));
String subIdent = Terser.get(obxSeg, 3, 0, 1, 2);
if (subIdent != null)
ident = ident+"&"+subIdent;
logger.info("returning obx identifier: "+ident);
return(ident);
}catch(Exception e){
logger.error("error returning obx identifier", e);
return("");
}
}
示例11: getOBXResult
import ca.uhn.hl7v2.util.Terser; //导入依赖的package包/类
public String getOBXResult(int i, int j){
String result = "";
try{
result = getString(Terser.get(((OBX) ((ArrayList) obrSegMap.get(obrSegKeySet.get(i))).get(j)),5,0,1,1));
// format the result
if (result.endsWith("."))
result = result.substring(0, result.length()-1);
}catch(Exception e){
logger.error("Exception returning result", e);
}
logger.info("OBX Result = "+result);
return result.replaceAll("\\\\\\.br\\\\", "<br />");
}
示例12: getOBXUnits
import ca.uhn.hl7v2.util.Terser; //导入依赖的package包/类
public String getOBXUnits(int i, int j){
String ret = "";
try{
OBX obxSeg = (obrSegMap.get(obrSegKeySet.get(i))).get(j);
ret = getString(obxSeg.getUnits().getIdentifier().getValue());
// if there are no units specified check the formatted reference
// range for the units
if (ret.equals("")){
ret = getString(Terser.get(obxSeg,7,0,2,1));
// only display units from the formatted reference range if they
// have not already been displayed as the reference range
if (ret.contains("-") || ret.contains("<") || ret.contains(">") || ret.contains("NEGATIVE"))
ret = "";
}
}catch(Exception e){
logger.error("Exception retrieving units", e);
}
return ret.replaceAll("\\\\\\.br\\\\", "");
}
示例13: getOBXCommentCount
import ca.uhn.hl7v2.util.Terser; //导入依赖的package包/类
/**
* Methods to get information from observation notes
*/
public int getOBXCommentCount(int i, int j){
int count = 0;
try{
int obxcount;
OBX obxSeg = (obrSegMap.get(obrSegKeySet.get(i))).get(j);
obxcount = (obrSegMap.get(obrSegKeySet.get(i))).size();
for (int k=0;k<obxcount;k++) {
if (Terser.get(obxSeg,7,k,1,1)!=null && !Terser.get(obxSeg,7,k,1,1).equals("") && (Terser.get(obxSeg,7,count,2,1)!=null && !Terser.get(obxSeg,7,count,2,1).equals(""))) {
count++;
}
}
}catch(Exception e){
logger.error("Exception retrieving obx comment count", e);
count = 0;
}
return count;
}
示例14: getOBXIdentifier
import ca.uhn.hl7v2.util.Terser; //导入依赖的package包/类
public String getOBXIdentifier(int i, int j) {
try {
Terser t = new Terser(msg);
String ident = getString(Terser.get(obxseg, 3, 0, 1, 1));
String subIdent = Terser.get(obxseg, 3, 0, 1, 2);
if (subIdent != null)
ident = ident + "&" + subIdent;
//logger.info("returning obx identifier: " + ident);
return (ident);
} catch (Exception e) {
logger.error("error returning obx identifier", e);
}
return "";
}
示例15: getOBXIdentifier
import ca.uhn.hl7v2.util.Terser; //导入依赖的package包/类
public String getOBXIdentifier(int i, int j){
try{
Segment obxSeg = (( obrSegMap.get(obrSegKeySet.get(i))).get(j));
String ident = getString(Terser.get(obxSeg, 3, 0, 1, 1 ));
String subIdent = Terser.get(obxSeg, 3, 0, 1, 2);
if (subIdent != null)
ident = ident+"&"+subIdent;
logger.info("returning obx identifier: "+ident);
return(ident);
}catch(Exception e){
logger.error("error returning obx identifier", e);
return("");
}
}