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 { ...@@ -124,4 +124,9 @@ public class PrcSubjectsParser extends SubjectParser {
return getString(row.getCell(12)); return getString(row.getCell(12));
} }
@Override
protected SubjectType parseType(Row row) {
return SubjectType.SUBJECT;
}
} }
...@@ -6,30 +6,31 @@ import java.util.List; ...@@ -6,30 +6,31 @@ import java.util.List;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
public class Subject { public class Subject {
Logger logger = Logger.getLogger(Subject .class); Logger logger = Logger.getLogger(Subject.class);
private String name; private String name;
private String surname; private String surname;
private String ndNumber; private String ndNumber;
private String screeningNumber; private String screeningNumber;
private String sex; private String sex;
private String remarks; private String remarks;
private String birthDate; private String birthDate;
private String address; private String address;
private String zipCode; private String zipCode;
private String country; private String country;
private String city; private String city;
private String phone1; private String phone1;
private String phone2; private String phone2;
private String phone3; private String phone3;
private String mail; private String mail;
private String diagnosisYear; private String diagnosisYear;
private String diagnosis; private String diagnosis;
private String referal; private String referal;
private String addDate; private String addDate;
private String mPowerId; private String mPowerId;
private SubjectType type;
private List<String> languages = new ArrayList<>();
private List<String> languages = new ArrayList<>();
public Subject(String name, String surname, String ndNumber, String screeningNumber) { public Subject(String name, String surname, String ndNumber, String screeningNumber) {
this.name = name; this.name = name;
...@@ -160,7 +161,8 @@ public class Subject { ...@@ -160,7 +161,8 @@ public class Subject {
} }
/** /**
* @param languages the languages to set * @param languages
* the languages to set
* @see #languages * @see #languages
*/ */
public void setLanguages(List<String> languages) { public void setLanguages(List<String> languages) {
...@@ -176,7 +178,8 @@ public class Subject { ...@@ -176,7 +178,8 @@ public class Subject {
} }
/** /**
* @param remarks the remarks to set * @param remarks
* the remarks to set
* @see #remarks * @see #remarks
*/ */
public void setRemarks(String remarks) { public void setRemarks(String remarks) {
...@@ -192,7 +195,8 @@ public class Subject { ...@@ -192,7 +195,8 @@ public class Subject {
} }
/** /**
* @param address the address to set * @param address
* the address to set
* @see #address * @see #address
*/ */
public void setAddress(String address) { public void setAddress(String address) {
...@@ -208,7 +212,8 @@ public class Subject { ...@@ -208,7 +212,8 @@ public class Subject {
} }
/** /**
* @param zipCode the zipCode to set * @param zipCode
* the zipCode to set
* @see #zipCode * @see #zipCode
*/ */
public void setZipCode(String zipCode) { public void setZipCode(String zipCode) {
...@@ -224,7 +229,8 @@ public class Subject { ...@@ -224,7 +229,8 @@ public class Subject {
} }
/** /**
* @param country the country to set * @param country
* the country to set
* @see #country * @see #country
*/ */
public void setCountry(String country) { public void setCountry(String country) {
...@@ -240,7 +246,8 @@ public class Subject { ...@@ -240,7 +246,8 @@ public class Subject {
} }
/** /**
* @param city the city to set * @param city
* the city to set
* @see #city * @see #city
*/ */
public void setCity(String city) { public void setCity(String city) {
...@@ -256,7 +263,8 @@ public class Subject { ...@@ -256,7 +263,8 @@ public class Subject {
} }
/** /**
* @param phone1 the phone1 to set * @param phone1
* the phone1 to set
* @see #phone1 * @see #phone1
*/ */
public void setPhone1(String phone1) { public void setPhone1(String phone1) {
...@@ -272,7 +280,8 @@ public class Subject { ...@@ -272,7 +280,8 @@ public class Subject {
} }
/** /**
* @param phone2 the phone2 to set * @param phone2
* the phone2 to set
* @see #phone2 * @see #phone2
*/ */
public void setPhone2(String phone2) { public void setPhone2(String phone2) {
...@@ -288,7 +297,8 @@ public class Subject { ...@@ -288,7 +297,8 @@ public class Subject {
} }
/** /**
* @param phone3 the phone3 to set * @param phone3
* the phone3 to set
* @see #phone3 * @see #phone3
*/ */
public void setPhone3(String phone3) { public void setPhone3(String phone3) {
...@@ -304,7 +314,8 @@ public class Subject { ...@@ -304,7 +314,8 @@ public class Subject {
} }
/** /**
* @param mail the mail to set * @param mail
* the mail to set
* @see #mail * @see #mail
*/ */
public void setMail(String mail) { public void setMail(String mail) {
...@@ -320,7 +331,8 @@ public class Subject { ...@@ -320,7 +331,8 @@ public class Subject {
} }
/** /**
* @param diagnosisYear the diagnosisYear to set * @param diagnosisYear
* the diagnosisYear to set
* @see #diagnosisYear * @see #diagnosisYear
*/ */
public void setDiagnosisYear(String diagnosisYear) { public void setDiagnosisYear(String diagnosisYear) {
...@@ -336,7 +348,8 @@ public class Subject { ...@@ -336,7 +348,8 @@ public class Subject {
} }
/** /**
* @param diagnosis the diagnosis to set * @param diagnosis
* the diagnosis to set
* @see #diagnosis * @see #diagnosis
*/ */
public void setDiagnosis(String diagnosis) { public void setDiagnosis(String diagnosis) {
...@@ -352,7 +365,8 @@ public class Subject { ...@@ -352,7 +365,8 @@ public class Subject {
} }
/** /**
* @param referal the referal to set * @param referal
* the referal to set
* @see #referal * @see #referal
*/ */
public void setReferal(String referal) { public void setReferal(String referal) {
...@@ -368,7 +382,8 @@ public class Subject { ...@@ -368,7 +382,8 @@ public class Subject {
} }
/** /**
* @param mPowerId the mPowerId to set * @param mPowerId
* the mPowerId to set
* @see #mPowerId * @see #mPowerId
*/ */
public void setmPowerId(String mPowerId) { public void setmPowerId(String mPowerId) {
...@@ -384,11 +399,28 @@ public class Subject { ...@@ -384,11 +399,28 @@ public class Subject {
} }
/** /**
* @param addDate the addDate to set * @param addDate
* the addDate to set
* @see #addDate * @see #addDate
*/ */
public void setAddDate(String addDate) { public void setAddDate(String addDate) {
this.addDate = 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; ...@@ -22,9 +22,9 @@ import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory; import org.apache.poi.ss.usermodel.WorkbookFactory;
public abstract class SubjectParser { public abstract class SubjectParser {
private static final SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat("yyyy-MM-dd"); private static final SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat("yyyy-MM-dd");
Logger logger = Logger.getLogger(SubjectParser.class); Logger logger = Logger.getLogger(SubjectParser.class);
DataFormatter df = new DataFormatter(); DataFormatter df = new DataFormatter();
public List<Subject> processExcel(String filename) throws EncryptedDocumentException, InvalidFormatException, IOException, ParseException { public List<Subject> processExcel(String filename) throws EncryptedDocumentException, InvalidFormatException, IOException, ParseException {
List<Subject> result = new ArrayList<>(); List<Subject> result = new ArrayList<>();
...@@ -81,10 +81,13 @@ public abstract class SubjectParser { ...@@ -81,10 +81,13 @@ public abstract class SubjectParser {
result.setAddDate(parseAddDate(row)); result.setAddDate(parseAddDate(row));
result.setmPowerId(parsemPowerId(row)); result.setmPowerId(parsemPowerId(row));
result.setBirthDate(parseBirthDate(row)); result.setBirthDate(parseBirthDate(row));
result.setType(parseType(row));
return result; return result;
} }
protected abstract SubjectType parseType(Row row);
protected abstract String parseBirthDate(Row row); protected abstract String parseBirthDate(Row row);
protected abstract String parsemPowerId(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