Skip to content

Commit

Permalink
Fix javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
mwithi committed Nov 29, 2024
1 parent a522883 commit dfe86f2
Show file tree
Hide file tree
Showing 34 changed files with 301 additions and 288 deletions.
12 changes: 6 additions & 6 deletions src/main/java/org/isf/accounting/manager/BillBrowserManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ public List<BillPayments> getPayments(int billID) throws OHServiceException {
* Stores a new {@link Bill} along with all its {@link BillItems} and {@link BillPayments}
*
* @param bill the bill to store.
* @param billItems - the list of bill's items
* @param billPayments - the list of bill's payments
* @param billItems the list of bill's items
* @param billPayments the list of bill's payments
* @returns the persisted Bill object
* @throws OHServiceException
*/
Expand Down Expand Up @@ -208,9 +208,9 @@ private void newBillPayments(int billID, List<BillPayments> payItems) throws OHS
/**
* Updates the specified {@link Bill} along with all its {@link BillItems} and {@link BillPayments}
*
* @param updateBill - the bill to update.
* @param billItems - the list of bill's items
* @param billPayments - the list of bill's payments
* @param updateBill the bill to update.
* @param billItems the list of bill's items
* @param billPayments the list of bill's payments
* @return the updated Bill object
* @throws OHServiceException
*/
Expand Down Expand Up @@ -331,7 +331,7 @@ public List<BillPayments> getPayments(List<Bill> billArray) throws OHServiceExce
/**
* Retrieves all the {@link Bill}s associated to the specified {@link Patient}.
*
* @param patID - the Patient's ID
* @param patID the Patient's ID
* @return the list of {@link Bill}s
* @throws OHServiceException
*/
Expand Down
63 changes: 33 additions & 30 deletions src/main/java/org/isf/dicom/manager/FileSystemDicomManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public FileSystemDicomManager() {

/**
* Constructor
* @throws OHDicomException
*
* @throws OHDicomException
*/
public FileSystemDicomManager(Properties externalPrp) throws OHDicomException {
try {
Expand All @@ -90,12 +91,12 @@ public FileSystemDicomManager(Properties externalPrp) throws OHDicomException {
} catch (Exception exception) {
LOGGER.error(exception.getMessage(), exception);
throw new OHDicomException(exception,
new OHExceptionMessage(MessageBundle.formatMessage("angal.dicommanager.genericerror.fmt.msg", exception.getMessage())));
new OHExceptionMessage(MessageBundle.formatMessage("angal.dicommanager.genericerror.fmt.msg", exception.getMessage())));
}
}

/**
* @param externalPrp - the properties to set
* @param externalPrp the properties to set
*/
public void setDir(Properties externalPrp) {
this.dir = new File(externalPrp.getProperty("dicom.storage.filesystem"));
Expand All @@ -107,7 +108,7 @@ public void setDir(Properties externalPrp) {
* @param patientID, the patient id
* @param seriesNumber, the series number
* @return
* @throws OHDicomException
* @throws OHDicomException
*/
@Override
public Long[] getSeriesDetail(int patientID, String seriesNumber) throws OHDicomException {
Expand Down Expand Up @@ -141,10 +142,10 @@ public Long[] getSeriesDetail(int patientID, String seriesNumber) throws OHDicom
return _Longs;
} catch (Exception exception) {
throw new OHDicomException(exception,
new OHExceptionMessage(MessageBundle.formatMessage("angal.dicommanager.genericerror.fmt.msg", exception.getMessage())));
new OHExceptionMessage(MessageBundle.formatMessage("angal.dicommanager.genericerror.fmt.msg", exception.getMessage())));
}
}

/**
* Delete series
*
Expand Down Expand Up @@ -173,7 +174,7 @@ public void deleteSeries(int patientId, String seriesNumber) throws OHDicomExcep

} catch (Exception exception) {
throw new OHDicomException(exception,
new OHExceptionMessage(MessageBundle.formatMessage("angal.dicommanager.genericerror.fmt.msg", exception.getMessage())));
new OHExceptionMessage(MessageBundle.formatMessage("angal.dicommanager.genericerror.fmt.msg", exception.getMessage())));
}
}

Expand All @@ -182,7 +183,7 @@ public void deleteSeries(int patientId, String seriesNumber) throws OHDicomExcep
*
* @param idFile
* @return FileDicom
* @throws OHDicomException
* @throws OHDicomException
*/
@Override
public FileDicom loadDetails(Long idFile, int patientId, String seriesNumber) throws OHDicomException {
Expand All @@ -201,15 +202,15 @@ public FileDicom loadDetails(Long idFile, int patientId, String seriesNumber) th
*
* @param idFile
* @return details
* @throws OHDicomException
* @throws OHDicomException
*/
@Override
public FileDicom loadDetails(long idFile, int patientId, String seriesNumber) throws OHDicomException {
try {
return loadData(idFile, patientId, seriesNumber);
} catch (Exception exception) {
throw new OHDicomException(exception,
new OHExceptionMessage(MessageBundle.formatMessage("angal.dicommanager.genericerror.fmt.msg", exception.getMessage())));
new OHExceptionMessage(MessageBundle.formatMessage("angal.dicommanager.genericerror.fmt.msg", exception.getMessage())));
}
}

Expand All @@ -218,7 +219,7 @@ public FileDicom loadDetails(long idFile, int patientId, String seriesNumber) th
*
* @param patientId
* @return
* @throws OHDicomException
* @throws OHDicomException
*/
@Override
public FileDicom[] loadPatientFiles(int patientId) throws OHDicomException {
Expand All @@ -236,15 +237,15 @@ public FileDicom[] loadPatientFiles(int patientId) throws OHDicomException {
return db;
} catch (Exception exception) {
throw new OHDicomException(exception,
new OHExceptionMessage(MessageBundle.formatMessage("angal.dicommanager.genericerror.fmt.msg", exception.getMessage())));
new OHExceptionMessage(MessageBundle.formatMessage("angal.dicommanager.genericerror.fmt.msg", exception.getMessage())));
}
}

/**
* Save the DICOM file and metadata
*
* @param dicom
* @throws OHDicomException
* @throws OHDicomException
*/
@Override
public void saveFile(FileDicom dicom) throws OHDicomException {
Expand All @@ -261,7 +262,7 @@ public void saveFile(FileDicom dicom) throws OHDicomException {
if (seriesNumber == null || seriesNumber.trim().isEmpty() || seriesNumber.equalsIgnoreCase("null")) {
seriesNumber = SourceFiles.generateSeriesNumber(patId);
dicom.setDicomSeriesNumber(seriesNumber);
dicom.setDicomSeriesInstanceUID("<org_root>."+seriesNumber);
dicom.setDicomSeriesInstanceUID("<org_root>." + seriesNumber);
}

long idFile = nextId();
Expand All @@ -274,7 +275,7 @@ public void saveFile(FileDicom dicom) throws OHDicomException {

File df = getSerieDir(patId, seriesNumber, true);
File properties = new File(df, idFile + ".properties");
try (FileOutputStream fos = new FileOutputStream(properties, false); PrintStream ps = new PrintStream(fos)) {
try (FileOutputStream fos = new FileOutputStream(properties, false); PrintStream ps = new PrintStream(fos)) {
ps.println("idFile =" + idFile);
ps.println("patId =" + patId);
ps.println("fileName =" + dicom.getFileName());
Expand Down Expand Up @@ -313,7 +314,7 @@ public void saveFile(FileDicom dicom) throws OHDicomException {
save(thumn, blobAsBytes);
} catch (Exception exception) {
throw new OHDicomException(exception,
new OHExceptionMessage(MessageBundle.formatMessage("angal.dicommanager.genericerror.fmt.msg", exception.getMessage())));
new OHExceptionMessage(MessageBundle.formatMessage("angal.dicommanager.genericerror.fmt.msg", exception.getMessage())));
}
}

Expand All @@ -334,9 +335,9 @@ private FileDicom loadMetadata(long idFile, int patientId, String series) throws
}

/*
* Load DICOM data + Image
*/
private FileDicom loadData(long idFile, int patientId, String series) throws IOException, SQLException, OHDicomException {
* Load DICOM data + Image
*/
private FileDicom loadData(long idFile, int patientId, String series) throws IOException, SQLException, OHDicomException {
// Series must exist, so we need to check it and return null in case
if (series == null || series.trim().isEmpty() || series.equalsIgnoreCase("null")) {
return null;
Expand Down Expand Up @@ -396,8 +397,9 @@ private void parseDicomProperties(long idFile, FileDicom rv, File sd) throws IOE

/**
* Load image for thumbnail
* @throws SQLException
* @throws SerialException
*
* @throws SQLException
* @throws SerialException
*/
private Blob loadThumbnail(File sd, long idFile) throws IOException, SerialException, SQLException {
File fdc = new File(sd, idFile + ".thumn");
Expand All @@ -411,8 +413,9 @@ private Blob loadThumbnail(File sd, long idFile) throws IOException, SerialExcep

/**
* Load DICOM image
* @throws SQLException
* @throws SerialException
*
* @throws SQLException
* @throws SerialException
*/
private Blob loadDicomData(File sd, long idFile) throws IOException, SQLException {
File fdc = new File(sd, idFile + ".data");
Expand Down Expand Up @@ -451,7 +454,7 @@ public boolean exist(FileDicom dicom) throws OHDicomException {
}
} catch (Exception exception) {
throw new OHDicomException(exception,
new OHExceptionMessage(MessageBundle.formatMessage("angal.dicommanager.genericerror.fmt.msg", exception.getMessage())));
new OHExceptionMessage(MessageBundle.formatMessage("angal.dicommanager.genericerror.fmt.msg", exception.getMessage())));
}
return rv;
}
Expand Down Expand Up @@ -560,8 +563,8 @@ private void recourse(File f) throws IOException {
/**
* Save content in specified file
*
* @param outFile - the file to write into
* @param content - byte vector to write
* @param outFile the file to write into
* @param content byte vector to write
*/
private void save(File outFile, byte[] content) throws IOException {
try (FileOutputStream fos = new FileOutputStream(outFile)) {
Expand Down Expand Up @@ -608,9 +611,9 @@ private FileDicom[] compact(FileDicom[] db) {

return ret;
}

public static class DicomDateComparator implements Comparator<FileDicom> {

@Override
public int compare(FileDicom object1, FileDicom object2) {
if (object1.getDicomStudyDate() == null) {
Expand All @@ -628,7 +631,7 @@ public static class DicomTypeDateComparator implements Comparator<FileDicom> {
@Override
public int compare(FileDicom object1, FileDicom object2) {

//default comparing
// default comparing
int result = object1.getDicomStudyDate().compareTo(object2.getDicomStudyDate());

if (object1.getDicomType() == null || object2.getDicomType() == null) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/isf/dicom/manager/SqlDicomManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void deleteSeries(int patientID, String seriesNumber) throws OHServiceExc
/**
* Check if dicom is loaded
*
* @param dicom - the detail of the dicom
* @param dicom the detail of the dicom
* @return true if file exist
* @throws OHServiceException
*/
Expand Down
35 changes: 23 additions & 12 deletions src/main/java/org/isf/exa/manager/ExamBrowsingManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
import org.springframework.stereotype.Component;

/**
* Class that provides gui separation from database operations and gives some useful logic
* manipulations of the dynamic data (memory)
* Class that provides gui separation from database operations and gives some useful logic manipulations of the dynamic data (memory)
*/
@Component
public class ExamBrowsingManager {
Expand All @@ -49,6 +48,7 @@ public ExamBrowsingManager(ExamIoOperations examIoOperations) {

/**
* Verify if the object is valid for CRUD and return a list of errors, if any
*
* @param exam
* @param insert {@code true} or updated {@code false}
* @throws OHServiceException
Expand All @@ -73,6 +73,7 @@ protected void validateExam(Exam exam, boolean insert) throws OHServiceException

/**
* Returns the list of {@link Exam}s
*
* @return the list of {@link Exam}s. It could be {@code null}
* @throws OHServiceException
*/
Expand All @@ -82,7 +83,8 @@ public List<Exam> getExams() throws OHServiceException {

/**
* Returns the list of {@link Exam}s that matches passed description
* @param description - the exam description
*
* @param description the exam description
* @return the list of {@link Exam}s. It could be {@code null}
* @throws OHServiceException
*/
Expand All @@ -92,7 +94,8 @@ public List<Exam> getExams(String description) throws OHServiceException {

/**
* Returns the list of {@link Exam}s by {@link ExamType} description
* @param description - the exam description
*
* @param description the exam description
* @return the list of {@link Exam}s. It could be {@code null}
* @throws OHServiceException
*/
Expand All @@ -102,6 +105,7 @@ public List<Exam> getExamsByTypeDescription(String description) throws OHService

/**
* Returns the list of {@link ExamType}s
*
* @return the list of {@link ExamType}s. It could be {@code null}
* @throws OHServiceException
*/
Expand All @@ -111,6 +115,7 @@ public List<ExamType> getExamType() throws OHServiceException {

/**
* This function controls the presence of a record with the same key as in the parameter; Returns false if the query finds no record, else returns true
*
* @param exam the {@link Exam}
* @return {@code true} if the Exam code has already been used, {@code false} otherwise
* @throws OHServiceException
Expand All @@ -121,8 +126,9 @@ public boolean isKeyPresent(Exam exam) throws OHServiceException {

/**
* Insert a new {@link Exam} with exam rows.
* @param payload - the {@link Exam} to insert
* @param rows - the {@link List<String>} to associate as exam rows
*
* @param payload the {@link Exam} to insert
* @param rows the {@link List<String>} to associate as exam rows
* @return the newly persisted {@link Exam}.
* @throws OHServiceException
*/
Expand All @@ -132,8 +138,9 @@ public Exam create(Exam payload, List<String> rows) throws OHServiceException {

/**
* Update an existing {@link Exam}with exam rows.
* @param payload - the {@link Exam} to insert
* @param rows - the {@link List<String>} to associate as exam rows
*
* @param payload the {@link Exam} to insert
* @param rows the {@link List<String>} to associate as exam rows
* @return the newly persisted {@link Exam}.
* @throws OHServiceException
*/
Expand All @@ -143,7 +150,8 @@ public Exam update(Exam payload, List<String> rows) throws OHServiceException {

/**
* Insert a new {@link Exam}.
* @param exam - the {@link Exam} to insert
*
* @param exam the {@link Exam} to insert
* @return the newly persisted {@link Exam}.
* @throws OHServiceException
*/
Expand All @@ -154,7 +162,8 @@ public Exam newExam(Exam exam) throws OHServiceException {

/**
* Updates an existing {@link Exam}.
* @param exam - the {@link Exam} to update
*
* @param exam the {@link Exam} to update
* @return {@code true} if the existing {@link Exam} has been updated, {@code false} otherwise
* @throws OHServiceException
*/
Expand All @@ -165,7 +174,8 @@ public Exam updateExam(Exam exam) throws OHServiceException {

/**
* Delete an {@link Exam}
* @param exam - the {@link Exam} to delete
*
* @param exam the {@link Exam} to delete
* @throws OHServiceException
*/
public void deleteExam(Exam exam) throws OHServiceException {
Expand All @@ -174,7 +184,8 @@ public void deleteExam(Exam exam) throws OHServiceException {

/**
* Find exam by code
* @param code - the code
*
* @param code the code
* @return The exam if found, {@code null} otherwise.
* @throws OHServiceException
*/
Expand Down
Loading

0 comments on commit dfe86f2

Please sign in to comment.