本文整理汇总了Java中ca.uhn.hl7v2.util.Terser.get方法的典型用法代码示例。如果您正苦于以下问题:Java Terser.get方法的具体用法?Java Terser.get怎么用?Java Terser.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca.uhn.hl7v2.util.Terser
的用法示例。
在下文中一共展示了Terser.get方法的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: getOBXSourceOrganization
import ca.uhn.hl7v2.util.Terser; //导入方法依赖的package包/类
public String getOBXSourceOrganization(int i, int j, int nteNum) {
try {
String[] segments = terser.getFinder().getRoot().getNames();
int k = getNTELocation(i, j);
if (nteNum > 0) {
k = indexOfNextNTE(segments, k, nteNum + 1);
}
k++;
Structure[] ZNTSegs = terser.getFinder().getRoot().getAll(segments[k]);
Segment ZNTSeg = (Segment) ZNTSegs[0];
String key = Terser.get(ZNTSeg, 1, 0, 2, 1);
if (key == null || key.indexOf(":") == -1) {
return "";
}
String ident = key.substring(0, key.indexOf(":"));
ident = getOrganizationType(ident);
key = key.substring(key.indexOf(":") + 1);
return String.format("%s (%s %s)", sourceOrganizations.get(key), ident, key);
} catch (Exception e) {
logger.error("Could not retrieve OBX comment ZNT", e);
return ("");
}
}
示例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: 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;
}
示例6: 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 />");
}
示例7: 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("");
}
}
示例8: 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 "";
}
示例9: getOBXIdentifier
import ca.uhn.hl7v2.util.Terser; //导入方法依赖的package包/类
public String getOBXIdentifier(int i, int j){
try{ // no value for TRUENORTH
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.debug("returning obx identifier: "+ident);
return(ident);
}catch(Exception e){
logger.error("error returning obx identifier", e);
return("");
}
}
示例10: parseERRSegment
import ca.uhn.hl7v2.util.Terser; //导入方法依赖的package包/类
private void parseERRSegment() throws HL7Exception {
Segment err = terser.getSegment("/.ERR");
errors = new ArrayList<OLISError>();
String segment, sequence, field, identifier, text;
int rep = -1;
while ((identifier = Terser.get(err, 1, ++rep, 4, 1)) != null) {
if (identifier.trim().equals("320")) {
reportBlocked = true;
}
segment = Terser.get(err, 1, rep, 1, 1);
sequence = Terser.get(err, 1, rep, 1, 2);
field = Terser.get(err, 1, rep, 1, 3);
text = Terser.get(err, 1, rep, 4, 2);
errors.add(new OLISError(segment, sequence, field, identifier, text));
}
}
示例11: 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{
Terser terser = new Terser(msg);
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;
}
示例12: 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;
}
示例13: getOBXComment
import ca.uhn.hl7v2.util.Terser; //导入方法依赖的package包/类
public String getOBXComment(int i, int j, int k)
{
String comment = ""; String newComment = "";
int len = 80; String concatComment = "";
try
{
Terser terser = new Terser(this.msg);
comment = Terser.get(this.obxseg, 5, 0, 1, 1);
this.logger.info("Modified comment =" + newComment);
return comment;
}
catch (Exception e) {
this.logger.error("getOBRComment error", e);
}return "";
}
示例14: getOBXIdentifier
import ca.uhn.hl7v2.util.Terser; //导入方法依赖的package包/类
public String getOBXIdentifier(int i, int j)
{
try
{
Segment obxSeg = (Segment)((ArrayList)this.obrSegMap.get(this.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 = new StringBuilder().append(ident).append("&").append(subIdent).toString();
}
this.logger.info(new StringBuilder().append("returning obx identifier: ").append(ident).toString());
return ident;
} catch (Exception e) {
this.logger.error("error returning obx identifier", e);
}return "";
}
示例15: getCCDocs
import ca.uhn.hl7v2.util.Terser; //导入方法依赖的package包/类
public String getCCDocs(){
String docNames = "";
try {
Terser terser = new Terser(msg);
String givenName = terser.get("/.ZDR(0)-4-1");
String middleName = terser.get("/.ZDR(0)-4-3");
String familyName = terser.get("/.ZDR(0)-4-2");
int i=1;
while (givenName != null){
if (i==1)
docNames = givenName;
else
docNames = docNames+", "+givenName;
if (middleName != null)
docNames = docNames+" "+middleName;
if (familyName != null)
docNames = docNames+" "+familyName;
givenName = terser.get("/.ZDR("+i+")-4-1");
middleName = terser.get("/.ZDR("+i+")-4-3");
familyName = terser.get("/.ZDR("+i+")-4-2");
i++;
}
return(docNames);
} catch (Exception e) {
//ignore error... it will occur when the zdr segment is not present
//logger.error("Could not retrieve cc'd docs", e);
return("");
}
}