本文整理汇总了Java中ca.uhn.hl7v2.model.Structure类的典型用法代码示例。如果您正苦于以下问题:Java Structure类的具体用法?Java Structure怎么用?Java Structure使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Structure类属于ca.uhn.hl7v2.model包,在下文中一共展示了Structure类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOBRCommentCount
import ca.uhn.hl7v2.model.Structure; //导入依赖的package包/类
/**
* Methods to get information from observation notes
*/
public int getOBRCommentCount(int i){
try{
String[] segments = terser.getFinder().getRoot().getNames();
int k = getNTELocation(i, -1);
int count = 0;
// make sure to count all the nte segments in the group
if (k < segments.length && segments[k].substring(0, 3).equals("NTE")){
Structure[] nteSegs = terser.getFinder().getRoot().getAll(segments[k]);
for (int l=0; l < nteSegs.length; l++){
count++;
}
}
return(count);
}catch(Exception e){
logger.error("OBR Comment count error", e);
return(0);
}
}
示例2: getOBRComment
import ca.uhn.hl7v2.model.Structure; //导入依赖的package包/类
public String getOBRComment(int i, int j){
try{
String[] segments = terser.getFinder().getRoot().getNames();
int k = getNTELocation(i, -1);
Structure[] nteSegs = terser.getFinder().getRoot().getAll(segments[k]);
Segment nteSeg = (Segment) nteSegs[j];
return(getString(Terser.get(nteSeg,3,0,1,1)));
}catch(Exception e){
logger.error("Could not retrieve OBX comments", e);
return("");
}
}
示例3: getOBXCommentCount
import ca.uhn.hl7v2.model.Structure; //导入依赖的package包/类
/**
* Methods to get information from observation notes
*/
public int getOBXCommentCount(int i, int j){
// jth obx of the ith obr
try{
String[] segments = terser.getFinder().getRoot().getNames();
int k = getNTELocation(i, j);
int count = 0;
if (k < segments.length && segments[k].substring(0, 3).equals("NTE")){
Structure[] nteSegs = terser.getFinder().getRoot().getAll(segments[k]);
for (int l=0; l < nteSegs.length; l++){
count++;
}
}
return(count);
}catch(Exception e){
logger.error("OBR Comment count error", e);
return(0);
}
}
示例4: getNTELocation
import ca.uhn.hl7v2.model.Structure; //导入依赖的package包/类
private int getNTELocation(int i, int j) throws HL7Exception{
int k = 0;
int obrCount = 0;
int obxCount = 0;
String[] segments = terser.getFinder().getRoot().getNames();
while (k != segments.length && obrCount != i+1){
if (segments[k].substring(0, 3).equals("OBR"))
obrCount++;
k++;
}
Structure[] obxSegs;
while (k != segments.length && obxCount != j+1){
if (segments[k].substring(0, 3).equals(("OBX"))){
obxSegs = terser.getFinder().getRoot().getAll(segments[k]);
obxCount = obxCount + obxSegs.length;
}
k++;
}
return(k);
}
示例5: getOBRComment
import ca.uhn.hl7v2.model.Structure; //导入依赖的package包/类
@Override
public String getOBRComment(int i, int j){
try{
String[] segments = terser.getFinder().getRoot().getNames();
int k = getNTELocation(i, -1);
Structure[] nteSegs = terser.getFinder().getRoot().getAll(segments[k]);
Segment nteSeg = (Segment) nteSegs[j];
return(getString(Terser.get(nteSeg,3,0,1,1)));
}catch(Exception e){
logger.error("Could not retrieve OBX comments", e);
return("");
}
}
示例6: getOBXCommentCount
import ca.uhn.hl7v2.model.Structure; //导入依赖的package包/类
@Override
public int getOBXCommentCount(int i, int j){
// jth obx of the ith obr
try{
String[] segments = terser.getFinder().getRoot().getNames();
int k = getNTELocation(i, j);
int count = 0;
if (k < segments.length && segments[k].substring(0, 3).equals("NTE")){
Structure[] nteSegs = terser.getFinder().getRoot().getAll(segments[k]);
for (int l=0; l < nteSegs.length; l++){
count++;
}
}
return(count);
}catch(Exception e){
logger.error("OBR Comment count error", e);
return(0);
}
}
示例7: getOBXComment
import ca.uhn.hl7v2.model.Structure; //导入依赖的package包/类
@Override
public String getOBXComment(int i, int j, int nteNum){
try{
String[] segments = terser.getFinder().getRoot().getNames();
int k = getNTELocation(i, j);
Structure[] nteSegs = terser.getFinder().getRoot().getAll(segments[k]);
Segment nteSeg = (Segment) nteSegs[nteNum];
return(getString(Terser.get(nteSeg,3,0,1,1)));
}catch(Exception e){
logger.error("Could not retrieve OBX comments", e);
return("");
}
}
示例8: getNTELocation
import ca.uhn.hl7v2.model.Structure; //导入依赖的package包/类
private int getNTELocation(int i, int j) throws HL7Exception{
int k = 0;
int obrCount = 0;
int obxCount = 0;
String[] segments = terser.getFinder().getRoot().getNames();
while (k != segments.length && obrCount != i+1){
if (segments[k].substring(0, 3).equals("OBR"))
obrCount++;
k++;
}
Structure[] obxSegs;
while (k != segments.length && obxCount != j+1){
if (segments[k].substring(0, 3).equals(("OBX"))){
obxSegs = terser.getFinder().getRoot().getAll(segments[k]);
obxCount = obxCount + obxSegs.length;
}
k++;
}
return(k);
}
示例9: mapOBXSortKey
import ca.uhn.hl7v2.model.Structure; //导入依赖的package包/类
private void mapOBXSortKey(int obr) {
HashMap<String, Integer> obxMap = null;
int k;
String tempKey;
obxMap = new HashMap<String, Integer>();
for (int i = 0; i < getOBXCount(obr); i++) {
try {
k = getZBXLocation(obr, i);
String[] segments = terser.getFinder().getRoot().getNames();
if (!segments[k].startsWith("ZBX")) {
continue;
}
Structure[] zbxSegs = terser.getFinder().getRoot().getAll(segments[k]);
Segment zbxSeg = (Segment) zbxSegs[0];
tempKey = getString(Terser.get(zbxSeg, 2, 0, 1, 1));
obxMap.put(tempKey.equals("") ? String.valueOf(i) : tempKey, i);
} catch (Exception e) {
MiscUtils.getLogger().error("OLIS HL7 Error", e);
}
}
obxSortMap.put(obr, obxMap);
}
示例10: getOBRComment
import ca.uhn.hl7v2.model.Structure; //导入依赖的package包/类
@Override
public String getOBRComment(int i, int j) {
try {
String[] segments = terser.getFinder().getRoot().getNames();
int k = getNTELocation(i, -1);
if (j > 0) {
k = indexOfNextNTE(segments, k + 1, j);
}
Structure[] nteSegs = terser.getFinder().getRoot().getAll(segments[k]);
Segment nteSeg = (Segment) nteSegs[0];
return formatString(getString(Terser.get(nteSeg, 3, 0, 1, 1)));
} catch (Exception e) {
logger.error("Could not retrieve OBR comments", e);
return ("");
}
}
示例11: getOBRSourceOrganization
import ca.uhn.hl7v2.model.Structure; //导入依赖的package包/类
public String getOBRSourceOrganization(int i, int j) {
try {
String[] segments = terser.getFinder().getRoot().getNames();
int k = getNTELocation(i, -1);
if (j > 0) {
k = indexOfNextNTE(segments, k + 1, j);
}
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 sourceOrganizations.get(key) + " (" + ident + " " + key + ")";
} catch (Exception e) {
logger.error("Could not retrieve OBX comment ZNT", e);
return ("");
}
}
示例12: getReportComment
import ca.uhn.hl7v2.model.Structure; //导入依赖的package包/类
public String getReportComment(int j) {
try {
String[] segments = terser.getFinder().getRoot().getNames();
int k = getNTELocation(-1, -1);
if (j > 0) {
k = indexOfNextNTE(segments, k + 1, j);
}
Structure[] nteSegs = terser.getFinder().getRoot().getAll(segments[k]);
Segment nteSeg = (Segment) nteSegs[0];
return formatString(getString(Terser.get(nteSeg, 3, 0, 1, 1)));
} catch (Exception e) {
logger.error("Could not retrieve OBR comments", e);
return ("");
}
}
示例13: getReportSourceOrganization
import ca.uhn.hl7v2.model.Structure; //导入依赖的package包/类
public String getReportSourceOrganization(int j) {
try {
String[] segments = terser.getFinder().getRoot().getNames();
int k = getNTELocation(-1, -1);
if (j > 0) {
k = indexOfNextNTE(segments, k + 1, j);
}
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 ("");
}
}
示例14: getOBXComment
import ca.uhn.hl7v2.model.Structure; //导入依赖的package包/类
@Override
public String getOBXComment(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);
}
Structure[] nteSegs = terser.getFinder().getRoot().getAll(segments[k]);
Segment nteSeg = (Segment) nteSegs[0];
return formatString(getString(Terser.get(nteSeg, 3, 0, 1, 1))).replace(" ", " ");
} catch (Exception e) {
logger.error("Could not retrieve OBX comments", e);
return ("");
}
}
示例15: getOBXSourceOrganization
import ca.uhn.hl7v2.model.Structure; //导入依赖的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 ("");
}
}