/** * @see org.openmrs.hl7.HL7Service#loadHL7InArchiveData(HL7InArchive) */ @Override public void loadHL7InArchiveData(HL7InArchive archive) throws APIException { // quit early if there is no archive to work with if (archive == null) { return; } // quit early if the message is not migrated or already loaded if (!OpenmrsUtil.nullSafeEquals(archive.getMessageState(), HL7Constants.HL7_STATUS_MIGRATED) || archive.isLoaded()) { return; } try { archive.setHL7Data(OpenmrsUtil.getFileAsString(new File(new URI(archive.getHL7Data())))); archive.setLoaded(true); } catch (URISyntaxException e) { throw new APIException("Hl7Service.malformed.archive.location", new Object[] { archive.getHL7Data() }, e); } catch (IOException e) { throw new APIException("Hl7Service.unable.convert.archive", new Object[] { archive.getHL7Data() }, e); } }