Android Open Source - clinicalguide Patient Details Data Source






From Project

Back to project page clinicalguide.

License

The source code is released under:

Apache License

If you think the Android project clinicalguide listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

//package org.get.oxicam.clinicalguide.db;
////w  ww .  j a  v  a2  s.  com
//import java.util.ArrayList;
//import java.util.List;
//
//import android.content.ContentValues;
//import android.content.Context;
//import android.database.Cursor;
//import android.database.SQLException;
//import android.database.sqlite.SQLiteDatabase;
//import android.util.Log;
//
///**
// * This DAO class. It maintains the database connection and supports adding new PatientDetailss and fetching all PatientDetailss.
// */
//public class PatientDetailsDataSource {
//
//  // Database fields
//  private SQLiteDatabase database;
//  private PatientDetailsSQLHelper dbHelper;
////  private String[] allColumns = { 
////      PatientDetailsSQLHelper.PATIENT_ID,
////      PatientDetailsSQLHelper.PATIENT_NAME,
////      PatientDetailsSQLHelper.PATIENT_SURNAME,
////      PatientDetailsSQLHelper.PATIENT_MOBILE,
////      PatientDetailsSQLHelper.PATIENT_HOME,
////      PatientDetailsSQLHelper.PATIENT_WORK,
////      PatientDetailsSQLHelper.PATIENT_ADDESS,
////      
////      PatientDetailsSQLHelper.PATIENT_HEIGHT,
////      PatientDetailsSQLHelper.PATIENT_WEIGHT,
////      PatientDetailsSQLHelper.PATIENT_GENDER,
////      PatientDetailsSQLHelper.PATIENT_KNOWNALIMENTS,
////      PatientDetailsSQLHelper.PATIENT_BIRTHDATE
////  };
//
//  public PatientDetailsDataSource(Context context) {
//    dbHelper = new PatientDetailsSQLHelper(context);
//  }
//
//  public void open() throws SQLException {
//    database = dbHelper.getWritableDatabase();
//  }
//
//  public void close() {
//    dbHelper.close();
//  }
//
//  /**
//   * Create a new patient details record in the database.
//   * @param patient The details to be inserted
//   * @return The patient record as read from the database after the insert. Used for validations
//   */
//  public PatientDetails createPatientDetailsRecord(PatientDetails patient) {
//    ContentValues values = new ContentValues();
//    values.put(PatientDetailsSQLHelper.PATIENT_NAME, patient.getName());
//    values.put(PatientDetailsSQLHelper.PATIENT_SURNAME, patient.getSurname());
//    values.put(PatientDetailsSQLHelper.PATIENT_ADDESS, patient.getAddress());
//    values.put(PatientDetailsSQLHelper.PATIENT_MOBILE, patient.getMobileNumber());
//    values.put(PatientDetailsSQLHelper.PATIENT_HOME, patient.getHomeNumber());
//    values.put(PatientDetailsSQLHelper.PATIENT_WORK, patient.getWorkNumber());
//
//    values.put(PatientDetailsSQLHelper.PATIENT_WEIGHT, patient.getHeight());
//    values.put(PatientDetailsSQLHelper.PATIENT_HEIGHT, patient.getWeight());
//    values.put(PatientDetailsSQLHelper.PATIENT_GENDER, patient.getGender());
//    values.put(PatientDetailsSQLHelper.PATIENT_KNOWNALIMENTS, patient.getKnownAliments());
//    values.put(PatientDetailsSQLHelper.PATIENT_BIRTHDATE, patient.getBirthDate());
//    
//    long insertId = database.insert(PatientDetailsSQLHelper.TABLE_PATIENT_DETAILS, null,
//        values);
//    Cursor cursor = database.query(PatientDetailsSQLHelper.TABLE_PATIENT_DETAILS,
//        allColumns, PatientDetailsSQLHelper.PATIENT_ID + " = " + insertId, null,
//        null, null, null);
//    cursor.moveToFirst();
//    PatientDetails newPatient = cursorToPatient(cursor);
//    cursor.close();
//    return newPatient;
//  }
//
//  /**
//   * Delete a patient record
//   * @param PatientDetails THe record to be deleted
//   */
//  public void deletePatientDetails(PatientDetails PatientDetails) {
//    long id = PatientDetails.getPatientID();
//    Log.d("PatientDB", "PatientDetails deleted with id: " + id);
//    database.delete(PatientDetailsSQLHelper.TABLE_PATIENT_DETAILS, 
//        PatientDetailsSQLHelper.PATIENT_ID + " = " + id, null);
//  }
//
//  public List<PatientDetails> getAllPatientDetailRecords() {
//    List<PatientDetails> PatientDetailsList = new ArrayList<PatientDetails>();
//
//    Cursor cursor = database.query(PatientDetailsSQLHelper.TABLE_PATIENT_DETAILS,
//        allColumns, null, null, null, null, null);
//
//    cursor.moveToFirst();
//    while (!cursor.isAfterLast()) {
//      PatientDetails patientDetails = cursorToPatient(cursor);
//      PatientDetailsList.add(patientDetails);
//      cursor.moveToNext();
//    }
//    // Make sure to close the cursor
//    cursor.close();
//    return PatientDetailsList;
//  }
//  
//  /**
//   * Update a patient record based on the ID provided in the patient record
//   * @param patient The patient record to be updated.
//   */
//  public void updatePatientRecord(PatientDetails patient)
//  {
//    long id = patient.getPatientID();
//    ContentValues values = new ContentValues();
//    values.put(PatientDetailsSQLHelper.PATIENT_NAME, patient.getName());
//    values.put(PatientDetailsSQLHelper.PATIENT_SURNAME, patient.getSurname());
//    values.put(PatientDetailsSQLHelper.PATIENT_ADDESS, patient.getAddress());
//    values.put(PatientDetailsSQLHelper.PATIENT_MOBILE, patient.getMobileNumber());
//    values.put(PatientDetailsSQLHelper.PATIENT_HOME, patient.getHomeNumber());
//    values.put(PatientDetailsSQLHelper.PATIENT_WORK, patient.getWorkNumber());
//
//    values.put(PatientDetailsSQLHelper.PATIENT_WEIGHT, patient.getHeight());
//    values.put(PatientDetailsSQLHelper.PATIENT_HEIGHT, patient.getWeight());
//    values.put(PatientDetailsSQLHelper.PATIENT_GENDER, patient.getGender());
//    values.put(PatientDetailsSQLHelper.PATIENT_KNOWNALIMENTS, patient.getKnownAliments());
//    values.put(PatientDetailsSQLHelper.PATIENT_BIRTHDATE, patient.getBirthDate());
//    
//    database.update(PatientDetailsSQLHelper.TABLE_PATIENT_DETAILS, values,
//        PatientDetailsSQLHelper.PATIENT_ID + " = " + id, null);    
//
//    Log.d("PatientDB", "PatientDetails updated id: " + id);
//  }
//
////  private PatientDetails cursorToPatient(Cursor cursor) {
//////    PatientDetails record = new PatientDetails();
//////    record.setPatientID(cursor.getLong(0));
//////    record.setName(cursor.getString(1));
//////    record.setSurname(cursor.getString(2));
//////    record.setAddress(cursor.getString(3));
//////    record.setMobileNumber(cursor.getString(4));
//////    record.setHomeNumber(cursor.getString(5));
//////    record.setWorkNumber(cursor.getString(6));
//////    
//////    record.setWeight(cursor.getDouble(7));
//////    record.setHeight(cursor.getDouble(8));
//////    record.setGender(cursor.getString(9));
//////    record.setKnownAliments(cursor.getString(10));
//////    record.setBirthDate(cursor.getString(11));
//////    return record;
////  }
//}





Java Source Code List

.PatientDetailsDataSource.java
org.get.oxicam.clinicalguide.ClinicalGuideActivity.java
org.get.oxicam.clinicalguide.FileUtils.java
org.get.oxicam.clinicalguide.LoginActivity.java
org.get.oxicam.clinicalguide.db.DatabaseHelper.java
org.get.oxicam.clinicalguide.db.Database.java
org.get.oxicam.clinicalguide.db.FollowupDataSource.java
org.get.oxicam.clinicalguide.db.FollowupDetails.java
org.get.oxicam.clinicalguide.db.FollowupSQLHelper.java
org.get.oxicam.clinicalguide.db.HistoryDetailsDataSource.java
org.get.oxicam.clinicalguide.db.HistoryDetailsSQLHelper.java
org.get.oxicam.clinicalguide.db.HistoryDetails.java
org.get.oxicam.clinicalguide.db.PatientDetailsSQLHelper.java
org.get.oxicam.clinicalguide.db.PatientDetails.java
org.get.oxicam.clinicalguide.db.RegistrationValidator.java
org.get.oxicam.clinicalguide.db.Validator.java
org.get.oxicam.clinicalguide.encryption.Encryption.java
org.get.oxicam.clinicalguide.ui.AnswersReviewFragment.java
org.get.oxicam.clinicalguide.ui.AssessmentDetailFragment.java
org.get.oxicam.clinicalguide.ui.ClassificationFragment.java
org.get.oxicam.clinicalguide.ui.ClassificationListItem.java
org.get.oxicam.clinicalguide.ui.DatePickerFragment.java
org.get.oxicam.clinicalguide.ui.ExportFragment.java
org.get.oxicam.clinicalguide.ui.ExportscreenListItem.java
org.get.oxicam.clinicalguide.ui.FollowUpFragment.java
org.get.oxicam.clinicalguide.ui.FormScreenFragment.java
org.get.oxicam.clinicalguide.ui.HomescreenFragment.java
org.get.oxicam.clinicalguide.ui.HomescreenListItem.java
org.get.oxicam.clinicalguide.ui.ListItemOnClickListener.java
org.get.oxicam.clinicalguide.ui.MainSymptomFragment.java
org.get.oxicam.clinicalguide.ui.MainSymptomListItem.java
org.get.oxicam.clinicalguide.ui.NumberTickerValueChangeListener.java
org.get.oxicam.clinicalguide.ui.NumberTicker.java
org.get.oxicam.clinicalguide.ui.PatientDetailsFragment.java
org.get.oxicam.clinicalguide.ui.PatientHistoryFragment.java
org.get.oxicam.clinicalguide.ui.PatientsFragment.java
org.get.oxicam.clinicalguide.ui.QuestionListItem.java
org.get.oxicam.clinicalguide.ui.QuestionnaireFragment.java
org.get.oxicam.clinicalguide.ui.StatScreenFragment.java
org.get.oxicam.clinicalguide.ui.SummaryScreenFragment.java
org.get.oxicam.clinicalguide.ui.TextViewCustomFont.java
org.get.oxicam.clinicalguide.ui.TreatmentConfirmationDialog.java
org.get.oxicam.clinicalguide.ui.TreatmentFragment.java
org.get.oxicam.clinicalguide.ui.TreatmentListItem.java
org.get.oxicam.clinicalguide.ui.ViewDetailScreenFragment.java
org.get.oxicam.clinicalguide.xml.CGFormParser.java
org.get.oxicam.clinicalguide.xml.CGParser.java
org.get.oxicam.clinicalguide.xml.CGStatsParser.java
org.get.oxicam.clinicalguide.xml.DateHelper.java
org.get.oxicam.clinicalguide.xml.FormGenerator.java
org.get.oxicam.clinicalguide.xml.ParserHelper.java
org.get.oxicam.clinicalguide.xml.StatsGenerator.java
org.get.oxicam.clinicalguide.xml.XMLHandler.java
org.get.oxicam.clinicalguide.xml.data.AbstractAnswer.java
org.get.oxicam.clinicalguide.xml.data.Annotation.java
org.get.oxicam.clinicalguide.xml.data.AnswerValidator.java
org.get.oxicam.clinicalguide.xml.data.Answer.java
org.get.oxicam.clinicalguide.xml.data.Assessment.java
org.get.oxicam.clinicalguide.xml.data.CombinedAnswer.java
org.get.oxicam.clinicalguide.xml.data.FollowUp.java
org.get.oxicam.clinicalguide.xml.data.FormQuery.java
org.get.oxicam.clinicalguide.xml.data.Info.java
org.get.oxicam.clinicalguide.xml.data.Option.java
org.get.oxicam.clinicalguide.xml.data.PatientAttribute.java
org.get.oxicam.clinicalguide.xml.data.Question.java
org.get.oxicam.clinicalguide.xml.data.Questionnaire.java
org.get.oxicam.clinicalguide.xml.data.SimpleAnswer.java
org.get.oxicam.clinicalguide.xml.data.Symptom.java
org.get.oxicam.clinicalguide.xml.data.TreatmentAction.java
org.get.oxicam.clinicalguide.xml.data.Treatment.java
org.get.oxicam.clinicalguide.xml.data.User.java
org.get.oxicam.clinicalguide.xml.forms.FormCell.java
org.get.oxicam.clinicalguide.xml.forms.FormColumn.java
org.get.oxicam.clinicalguide.xml.forms.FormDuration.java
org.get.oxicam.clinicalguide.xml.forms.Form.java
org.get.oxicam.clinicalguide.xml.query.QueryHelper.java
org.get.oxicam.clinicalguide.xml.query.QueryResultCell.java
org.get.oxicam.clinicalguide.xml.query.QueryResultRow.java
org.get.oxicam.clinicalguide.xml.query.QueryResultTable.java
org.get.oxicam.clinicalguide.xml.stats.AbstractStatsQuestion.java
org.get.oxicam.clinicalguide.xml.stats.StatsAnswerHolder.java
org.get.oxicam.clinicalguide.xml.stats.StatsColumnCompare.java
org.get.oxicam.clinicalguide.xml.stats.StatsComparatorOperator.java
org.get.oxicam.clinicalguide.xml.stats.StatsCompareConstraint.java
org.get.oxicam.clinicalguide.xml.stats.StatsConstraint.java
org.get.oxicam.clinicalguide.xml.stats.StatsQuestionAverage.java
org.get.oxicam.clinicalguide.xml.stats.StatsQuestionCount.java
org.get.oxicam.clinicalguide.xml.stats.StatsQuestionExtrema.java
org.get.oxicam.clinicalguide.xml.stats.StatsQuestionFactory.java
org.get.oxicam.clinicalguide.xml.stats.StatsQuestionList.java
org.get.oxicam.clinicalguide.xml.stats.StatsQuestionPercentage.java
org.get.oxicam.clinicalguide.xml.stats.StatsQuestionRatio.java
org.get.oxicam.clinicalguide.xml.stats.StatsSubject.java
org.get.oxicam.clinicalguide.xml.stats.StatsTimespan.java
org.get.oxicam.clinicalguide.xml.stats.Stats.java