Skip to content
Snippets Groups Projects
Commit 9089df0a authored by Piotr Gawron's avatar Piotr Gawron
Browse files

subject has a type

parent c2878ccb
No related branches found
No related tags found
1 merge request!1Appointments dev
......@@ -124,4 +124,9 @@ public class PrcSubjectsParser extends SubjectParser {
return getString(row.getCell(12));
}
@Override
protected SubjectType parseType(Row row) {
return SubjectType.SUBJECT;
}
}
......@@ -6,30 +6,31 @@ import java.util.List;
import org.apache.log4j.Logger;
public class Subject {
Logger logger = Logger.getLogger(Subject .class);
private String name;
private String surname;
private String ndNumber;
private String screeningNumber;
private String sex;
private String remarks;
private String birthDate;
private String address;
private String zipCode;
private String country;
private String city;
private String phone1;
private String phone2;
private String phone3;
private String mail;
private String diagnosisYear;
private String diagnosis;
private String referal;
private String addDate;
private String mPowerId;
private List<String> languages = new ArrayList<>();
Logger logger = Logger.getLogger(Subject.class);
private String name;
private String surname;
private String ndNumber;
private String screeningNumber;
private String sex;
private String remarks;
private String birthDate;
private String address;
private String zipCode;
private String country;
private String city;
private String phone1;
private String phone2;
private String phone3;
private String mail;
private String diagnosisYear;
private String diagnosis;
private String referal;
private String addDate;
private String mPowerId;
private SubjectType type;
private List<String> languages = new ArrayList<>();
public Subject(String name, String surname, String ndNumber, String screeningNumber) {
this.name = name;
......@@ -160,7 +161,8 @@ public class Subject {
}
/**
* @param languages the languages to set
* @param languages
* the languages to set
* @see #languages
*/
public void setLanguages(List<String> languages) {
......@@ -176,7 +178,8 @@ public class Subject {
}
/**
* @param remarks the remarks to set
* @param remarks
* the remarks to set
* @see #remarks
*/
public void setRemarks(String remarks) {
......@@ -192,7 +195,8 @@ public class Subject {
}
/**
* @param address the address to set
* @param address
* the address to set
* @see #address
*/
public void setAddress(String address) {
......@@ -208,7 +212,8 @@ public class Subject {
}
/**
* @param zipCode the zipCode to set
* @param zipCode
* the zipCode to set
* @see #zipCode
*/
public void setZipCode(String zipCode) {
......@@ -224,7 +229,8 @@ public class Subject {
}
/**
* @param country the country to set
* @param country
* the country to set
* @see #country
*/
public void setCountry(String country) {
......@@ -240,7 +246,8 @@ public class Subject {
}
/**
* @param city the city to set
* @param city
* the city to set
* @see #city
*/
public void setCity(String city) {
......@@ -256,7 +263,8 @@ public class Subject {
}
/**
* @param phone1 the phone1 to set
* @param phone1
* the phone1 to set
* @see #phone1
*/
public void setPhone1(String phone1) {
......@@ -272,7 +280,8 @@ public class Subject {
}
/**
* @param phone2 the phone2 to set
* @param phone2
* the phone2 to set
* @see #phone2
*/
public void setPhone2(String phone2) {
......@@ -288,7 +297,8 @@ public class Subject {
}
/**
* @param phone3 the phone3 to set
* @param phone3
* the phone3 to set
* @see #phone3
*/
public void setPhone3(String phone3) {
......@@ -304,7 +314,8 @@ public class Subject {
}
/**
* @param mail the mail to set
* @param mail
* the mail to set
* @see #mail
*/
public void setMail(String mail) {
......@@ -320,7 +331,8 @@ public class Subject {
}
/**
* @param diagnosisYear the diagnosisYear to set
* @param diagnosisYear
* the diagnosisYear to set
* @see #diagnosisYear
*/
public void setDiagnosisYear(String diagnosisYear) {
......@@ -336,7 +348,8 @@ public class Subject {
}
/**
* @param diagnosis the diagnosis to set
* @param diagnosis
* the diagnosis to set
* @see #diagnosis
*/
public void setDiagnosis(String diagnosis) {
......@@ -352,7 +365,8 @@ public class Subject {
}
/**
* @param referal the referal to set
* @param referal
* the referal to set
* @see #referal
*/
public void setReferal(String referal) {
......@@ -368,7 +382,8 @@ public class Subject {
}
/**
* @param mPowerId the mPowerId to set
* @param mPowerId
* the mPowerId to set
* @see #mPowerId
*/
public void setmPowerId(String mPowerId) {
......@@ -384,11 +399,28 @@ public class Subject {
}
/**
* @param addDate the addDate to set
* @param addDate
* the addDate to set
* @see #addDate
*/
public void setAddDate(String addDate) {
this.addDate = addDate;
}
/**
* @return the type
* @see #type
*/
public SubjectType getType() {
return type;
}
/**
* @param type the type to set
* @see #type
*/
public void setType(SubjectType type) {
this.type = type;
}
}
......@@ -22,9 +22,9 @@ import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
public abstract class SubjectParser {
private static final SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat("yyyy-MM-dd");
Logger logger = Logger.getLogger(SubjectParser.class);
DataFormatter df = new DataFormatter();
private static final SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat("yyyy-MM-dd");
Logger logger = Logger.getLogger(SubjectParser.class);
DataFormatter df = new DataFormatter();
public List<Subject> processExcel(String filename) throws EncryptedDocumentException, InvalidFormatException, IOException, ParseException {
List<Subject> result = new ArrayList<>();
......@@ -81,10 +81,13 @@ public abstract class SubjectParser {
result.setAddDate(parseAddDate(row));
result.setmPowerId(parsemPowerId(row));
result.setBirthDate(parseBirthDate(row));
result.setType(parseType(row));
return result;
}
protected abstract SubjectType parseType(Row row);
protected abstract String parseBirthDate(Row row);
protected abstract String parsemPowerId(Row row);
......
package smash.appointment.parse;
public enum SubjectType {
SUBJECT, CONTROL;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment