Package ca.uhn.hl7v2.conf

Examples of ca.uhn.hl7v2.conf.ProfileException


        struct.setMax((short) -1);
      } else {
        struct.setMax(Short.parseShort(max));
      }
    } catch (NumberFormatException e) {
      throw new ProfileException("Min and max must be short integers: " + min + ", " + max, e);
    }

    struct.setImpNote(getValueOfFirstElement("ImpNote", elem));
    struct.setDescription(getValueOfFirstElement("Description", elem));
    struct.setReference(getValueOfFirstElement("Reference", elem));
View Full Code Here


    try {
      if (itemNo.length() > 0) {
        field.setItemNo(Short.parseShort(itemNo));
      }
    } catch (NumberFormatException e) {
      throw new ProfileException("Invalid ItemNo: " + itemNo + "( for name " + elem.getAttribute("Name") + ")", e);
    } // try-catch

    try {
      field.setMin(Short.parseShort(min));
      if (max.indexOf('*') >= 0) {
        field.setMax((short) -1);
      } else {
        field.setMax(Short.parseShort(max));
      }
    } catch (NumberFormatException e) {
      throw new ProfileException("Min and max must be short integers: " + min + ", " + max, e);
    }

    parseAbstractComponentData(field, elem);

    int childIndex = 1;
View Full Code Here

    String length = elem.getAttribute("Length");
    if (length != null && length.length() > 0) {
      try {
        comp.setLength(Long.parseLong(length));
      } catch (NumberFormatException e) {
        throw new ProfileException("Length must be a long integer: " + length, e);
      }
    }
    comp.setConstantValue(elem.getAttribute("ConstantValue"));
    String table = elem.getAttribute("Table");
    if (table != null && table.length() > 0) {
      try {
        comp.setTable(table);
      } catch (NumberFormatException e) {
        throw new ProfileException("Table must be a short integer: " + table, e);
      }
    }

    comp.setImpNote(getValueOfFirstElement("ImpNote", elem));
    comp.setDescription(getValueOfFirstElement("Description", elem));
View Full Code Here

        parser.parse(new InputSource(new StringReader(profileString)));
        log.debug("DOM parse complete");
        doc = parser.getDocument();
      }
    } catch (SAXException se) {
      throw new ProfileException("SAXException parsing message profile: " + se.getMessage());
    } catch (IOException ioe) {
      throw new ProfileException("IOException parsing message profile: " + ioe.getMessage());
    }
    return doc;
  }
View Full Code Here

        Node n = el.getFirstChild();
        if (n.getNodeType() == Node.TEXT_NODE) {
          val = n.getNodeValue();
        }
      } catch (Exception e) {
        throw new ProfileException("Unable to get value of node " + name, e);
      }
    }
    return val;
  }
View Full Code Here

                                    + " appears in the message but not in the profile");
                            exList.add(e);
                        }
                    }
                } catch (HL7Exception he) {
                    throw new ProfileException("Problem checking profile", he);
                }
            }
        }
        return toArray(exList);
    }
View Full Code Here

                                "Field " + i + " in " + segment.getName() + " appears in the message but not in the profile");
                            exList.add(e);
                        }
                    }
                } catch (HL7Exception he) {
                    throw new ProfileException("Problem testing against profile", he);
                }
            }
        }    
        return this.toArray(exList);
    }
View Full Code Here

                if (s.length() > 0) {
                    extra.append(s);
                    extra.append(enc.getComponentSeparator());
                }
            } catch (DataTypeException de) {
                throw new ProfileException("Problem testing against profile", de);
            }
        }
       
        if (extra.toString().length() > 0) {
            exList.add(new XElementPresentException("The following components are not defined in the profile: " + extra.toString()));
View Full Code Here

   *
   */
  public ProfileCodeStore(String uri) throws ProfileException, IOException {
    try {
      if (uri == null) {
        throw new ProfileException("The input url parameter cannot be null");
      }
      XMLReader reader = XMLReaderFactory.createXMLReader();
      reader.setContentHandler(new ProfileCodeStoreHandler());
      reader.parse(uri);
    } catch (IOException e) {
      throw e;
    } catch (Exception e) {
      throw new ProfileException(e.toString(), e);
    }
  }
View Full Code Here

   *
   */
  public String[] getValidCodes(String codeSystem) throws ProfileException {
    List<String> result = getCodeTable(codeSystem);
    if (result == null)
      throw new ProfileException("Unknown code system: " + codeSystem);
    return result.toArray(new String[result.size()]);
  }
View Full Code Here

TOP

Related Classes of ca.uhn.hl7v2.conf.ProfileException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.