当前位置: 首页>>代码示例>>C++>>正文


C++ Patient类代码示例

本文整理汇总了C++中Patient的典型用法代码示例。如果您正苦于以下问题:C++ Patient类的具体用法?C++ Patient怎么用?C++ Patient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Patient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sqlite3_get_table

QList<Patient*> LocalDatabaseStudyDAL::queryPatientStudy(const DicomMask &patientStudyMaskToQuery, QDate lastAccessDateMinor, QDate lastAccessDateEqualOrMajor)
{
    int columns, rows;
    char **reply = NULL;
    char **error = NULL;
    QList<Patient*> patientList;

    m_lastSqliteError = sqlite3_get_table(m_dbConnection->getConnection(),
                                          qPrintable(buildSqlSelectStudyPatient(patientStudyMaskToQuery, lastAccessDateMinor, lastAccessDateEqualOrMajor)),
                                          &reply, &rows, &columns, error);
    if (getLastError() != SQLITE_OK)
    {
        logError (buildSqlSelectStudyPatient(patientStudyMaskToQuery, lastAccessDateMinor, lastAccessDateEqualOrMajor));
        return patientList;
    }

    // index = 1 ignorem les capçaleres
    for (int index = 1; index <= rows; index++)
    {
        Patient *patient = fillPatient(reply, index, columns);
        patient->addStudy(fillStudy(reply, index, columns));

        patientList.append(patient);
    }

    sqlite3_free_table(reply);

    return patientList;
}
开发者ID:chinhtrandn,项目名称:starviewer,代码行数:29,代码来源:localdatabasestudydal.cpp

示例2: Patient

void ExamModelXmlReader::BuildPatient(Examination* exam){
  Patient* tmp = new Patient(GetPatientName());
  DateTime* birth = new DateTime(GetPatientBirthdate());
  tmp->SetBirthdate(*birth);
  
  exam->SetPatient(*tmp);
}
开发者ID:katcipis,项目名称:playground,代码行数:7,代码来源:ExamModelXmlReader.cpp

示例3: QString

bool PatientTreeModel::Create(Patient data)
{
  //Calculate Patient_ID = md5(datetime + patient:name)
  QString raw_id = QDateTime::currentDateTime().toString() + data.name() + data.surname();
  QString patient_id = QString(QCryptographicHash::hash(raw_id.toAscii(), QCryptographicHash::Md5).toHex());
  data.set_id(patient_id);
  //Create directory ./data/patients/Patient_ID
  QDir patient_dir(root_path_ + patient_id);
  if (!patient_dir.exists()) {
    if (!patient_dir.mkpath(".")) return false;
  }
  // Create directory for patient's scans ./data/patients/Patient_ID/scans
  QDir scans_dir(root_path_ + patient_id + "/scans");
  if (!scans_dir.exists()) {
    if (!scans_dir.mkpath(".")) return false;
  }
  //Create patient's metadata file in ./data/patients/Patient_ID/metadata.json
  QFile metadata_file(root_path_ + patient_id + "/metadata.json");
  if (!metadata_file.open(QIODevice::WriteOnly)) return false;
  metadata_file.write(QtJson::serialize(data.AsJsonObject()));
  metadata_file.close();

  patients_.push_back(data);
  // Rebuild tree model
  clear();
  Build();
  return true;
}
开发者ID:jinghuaguo,项目名称:BodyOfYours,代码行数:28,代码来源:patient_tree_model.cpp

示例4: apply

void Lobotomizer::apply(Patient& patient)
{
  patient.modify_mental_health(LOB_MENTAL_HEALTH_MODIFIER);
  patient.modify_physical_health(LOB_PHYSICAL_HEALTH_MODIFIER);
  if(rand()%100 < LOB_KILL_BRAIN_CHANCE)
    patient.modify_mental_health(-patient.get_mental_health());
  if(rand()%100 < LOB_RENAME_CHANCE)
    patient.add_to_name(get_random_name());

  m_num_uses++;

  return;
}
开发者ID:louman347,项目名称:CompSci2014,代码行数:13,代码来源:lobotomizer.cpp

示例5: main

int main()
{
  Patient quidam;
  double poids, taille;
  do {
    cout << "Entrez un poids (kg) et une taille (m) : ";
    cin >> poids >> taille;
    quidam.init(poids, taille);
    quidam.afficher();
    cout << "IMC : " << quidam.imc() << endl;
  } while (poids * taille != 0.0);
  return 0;
}
开发者ID:jnf611,项目名称:cpp_initobjprog,代码行数:13,代码来源:imc.cpp

示例6: BaseProcedureFrame

BetProcedureFrame::BetProcedureFrame(wxWindow* parent, const Patient& patient) :
		BaseProcedureFrame(parent), currents_graphic_(
				wxBitmap(wxT("graphic_small"), wxBITMAP_TYPE_PNG_RESOURCE).ConvertToImage(), 20, 15, 680, 120,
				DURATION_LIMIT + 30 * 60, //30min. for closing procedure
				80,
				{ wxColor(13, 193, 184), wxColor(0, 0, 255), wxColor(125, 0, 255), wxColor(255, 0, 0), wxColor(255, 125,
						0), wxColor(80, 170, 80) }), voltage_graphic_(
				wxBitmap(wxT("graphic_big"), wxBITMAP_TYPE_PNG_RESOURCE).ConvertToImage(), 26, 15, 674, 240,
				DURATION_LIMIT + 30 * 60, 120, { wxColor(0, 0, 225),
				wxColor(125, 0, 0),
				wxColor(0, 125, 0), wxColor(125, 0, 125) }), lightR_(wxT("lightr"), wxBITMAP_TYPE_PNG_RESOURCE), lightG_(
				wxT("lightg"), wxBITMAP_TYPE_PNG_RESOURCE), lightS_(wxT("lights"), wxBITMAP_TYPE_PNG_RESOURCE), switch1_(
		SW_OFF), switch2_(SW_OFF), switch3_(SW_OFF), switch4_(SW_OFF), switch5_(SW_OFF), switch6_(
		SW_OFF), cable_(CABLE_OUT), key_(KEY_ON), polarity_(false), voltage_(0), decrease_speed_(0.1), time_to_end_(60), q_(
				0), duration_(0), state_(
		STATE_INITIAL), conf_channel_alarm_wait_(10){
	for (int i = 0; i < 7; i++) {
		voltages_[i] = 0;
		currents_[i] = 0;
	}
	patient_id_ = patient.getPatientNumber();
	m_txtPatientName->SetLabel(patient.getFullName());
	m_txtTreatmentNumber->SetLabel(wxString::Format("%i", patient.getTreatmentCount() + 1));
	m_bmpElectrodes->SetBitmap(currents_graphic_.getImage());
	m_bmpVoltage->SetBitmap(voltage_graphic_.getImage());
	my_timer_.SetOwner(this);
	m_bmpInd1->SetBitmap(lightS_);
	m_bmpInd2->SetBitmap(lightS_);
	m_bmpInd3->SetBitmap(lightS_);
	m_bmpInd4->SetBitmap(lightS_);
	m_bmpInd5->SetBitmap(lightS_);
	m_bmpInd6->SetBitmap(lightS_);
	updateFloatValue(voltage_, m_txtVoltage);
	updateIntegerValue(0, m_txtCurrent);
	updateDurationValue(time_to_end_, m_txtDuration);
	parseOptions();
	Bind(wxEVT_TIMER, &BetProcedureFrame::OnTimer, this);

	if (options_.find(std::string("port")) == options_.end() )
		throw std::runtime_error("port not specified in configuration file");
	protocol_.start(options_[std::string("port")].as<std::string>());
	decrease_speed_ = options_[std::string("decrease_speed")].as<float>();
	regulator_speed_ = options_[std::string("regulator_speed")].as<float>();
	conf_channel_alarm_wait_ = options_[std::string("channel_alarm_wait")].as<unsigned int>();
	Bind(wxEVT_KEY_DOWN, &BetProcedureFrame::OnKeyEvent, this, wxID_ANY);
	DoGoInInitialState();
	my_timer_.Start(1000);
	wxGetApp().setProcedureFrame(this);
}
开发者ID:dimitarm,项目名称:bet1,代码行数:49,代码来源:BetProcedureFrame.cpp

示例7: AddPatient

bool AddPatient(Patient p)
{
    QSqlQuery query;
    query.exec("select * from TPatient");
    query.last();
    int id=query.value(0).toInt()+1;
    QString sql="insert into TPatient values("
            +QString::number(id)+","+"'"
            +p.getNom()+"' , '"
            +p.getPrenom() +"' , '"
            +p.getAdresse() +"' , '"
            +p.getVille()+"' , '"
            +QString::number(p.getCP())+"' , '"
            +p.getCommentaire()+"' , '"
            +p.getTelephone()+"' , '"
            +p.getDateDebut().toString("yyyy-MM-dd")+"' , '"
            +QString::number(p.getDuree())+"' , '"
            +QString::number(p.getPriorite())+"')";
    bool b_test=query.exec(sql);
    if(!b_test)
    {
        qDebug() << query.lastError().text();
        qDebug() << "Insertion de données dans TPatient impossible !\n";
        return false;
    }
    query.exec("select Id from TConsult");
    query.last();
    int idc=query.value(0).toInt()+1;
    for(int n=0; n<p.vIdRessource.size(); n++,idc++){
         b_test=query.exec("insert into TConsult values("
                           +QString::number(idc)+","
                           +QString::number(id)+","
                           +QString::number(p.vIdRessource.at(n))
                           +")");
        if(!b_test)
        {
            qDebug() << query.lastError().text();
            qDebug() << "Insertion de données dans TConsult impossible !\n";
            return false;
        }
    }
    return true;
}
开发者ID:pholien,项目名称:QtProjet,代码行数:43,代码来源:Controleur_patient.cpp

示例8: ModifierPatient

bool ModifierPatient(Patient p,QString id)
{
    QSqlQuery query;
    QString sql="update TPatient set Nom='"+p.getNom()+"' , "
            +"Prenom='"+p.getPrenom() +"' , "
            +"Adresse='"+p.getAdresse() +"' , "
            +"Ville='"+p.getVille()+"' , "
            +"CP='"+QString::number(p.getCP())+"' , "
            +"Commentaire='"+p.getCommentaire()+"' , "
            +"Tel='"+p.getTelephone()+"' , "
            +"DateConsultation='"+p.getDateDebut().toString("yyyy-MM-dd")+"' , "
            +"DureeConsultation="+QString::number(p.getDuree())+" , "
            +"Priorite="+QString::number(p.getPriorite())
            +" where id="+id;
    bool b_test= query.exec(sql);
    if(!b_test)
    {
        qDebug() << query.lastError().text();
        qDebug() << "Modifier de données dans TPatient impossible !\n";
        return false;
    }

    query.exec("delete from TConsult where IdPatient="+id);

    query.exec("select Id from TConsult");
    query.last();
    int idc=query.value(0).toInt()+1;
    for(int n=0; n<p.vIdRessource.size(); n++,idc++){
         b_test=query.exec("insert into TConsult values("
                           +QString::number(idc)+","
                           +id+","
                           +QString::number(p.vIdRessource.at(n))
                           +")");
        if(!b_test)
        {
            qDebug() << query.lastError().text();
            qDebug() << "Insertion de données dans TConsult impossible !\n";
            return false;
        }
    }
    return true;
}
开发者ID:pholien,项目名称:QtProjet,代码行数:42,代码来源:Controleur_patient.cpp

示例9: tr

void QInputOutputDicomdirWidget::view()
{
    QList<QPair<DicomMask, DICOMSource> > selectedDICOMITems = m_studyTreeWidget->getDicomMaskOfSelectedItems();
    DicomMask patientToProcessMask;
    Patient *patient;
    QList<Patient*> selectedPatientsList;

    if (selectedDICOMITems.isEmpty())
    {
        QMessageBox::warning(this, ApplicationNameString, tr("Select at least one study to view."));
        return;
    }

    QApplication::setOverrideCursor(Qt::WaitCursor);
    for (int index = 0; index < selectedDICOMITems.count(); index++)
    {
        patientToProcessMask.setStudyInstanceUID(selectedDICOMITems.at(index).first.getStudyInstanceUID());
        patient = m_readDicomdir.retrieve(patientToProcessMask);

        if (patient)
        {
            patient->setSelectedSeries(selectedDICOMITems.at(index).first.getSeriesInstanceUID());
            selectedPatientsList << patient;
        }
        else
        {
            DEBUG_LOG("No s'ha pogut obtenir l'estudi amb UID " + selectedDICOMITems.at(index).first.getStudyInstanceUID());
        }
    }

    QApplication::restoreOverrideCursor();

    if (!selectedPatientsList.isEmpty())
    {
        DEBUG_LOG("Llançat signal per visualitzar estudi del pacient " + patient->getFullName());
        emit viewPatients(selectedPatientsList);
    }
    else
    {
        QMessageBox::warning(this, ApplicationNameString, tr("No valid data found. Maybe some files are missing or corrupted."));
    }
}
开发者ID:151706061,项目名称:starviewer,代码行数:42,代码来源:qinputoutputdicomdirwidget.cpp

示例10: SensorSimulator

//-------------------------------------------------- Builder / Destructor
SensorSimulatorSunSpot::SensorSimulatorSunSpot(int id, Subject* r, float minL, float maxL, float minT, float maxT, float minM, float maxM) : SensorSimulator(id, EnOceanSensorAPI::ORG_4BS, r), minLum(minL), maxLum(maxL), minTemp(minT), maxTemp(maxT), minMov(minM), maxMov(maxM) {
//	illuminance = rand()%(int)(maxLum-minLum) - minLum;
//	voltage = rand()%(int)(maxV-minV) - minV;
//	pirStatus = false;
//	occupancy = false;
	Patient* patient = dynamic_cast<Patient*>(r);
	if (patient != 0) {
		float t, i, m;
		t = patient->getTemperature();
		i = patient->getRoom()->getLuminosity();
		m = patient->getMovement();
		EnOceanSensorAPI::setIlluminance(&frame, i, minLum, maxLum);
		EnOceanSensorAPI::setTemperature(&frame, t, minT, maxT);
		EnOceanSensorAPI::setMovement(&frame,  m, minM, maxM);
		cout << "<Sensor Simu n°" << id << "> Créé - Sunspot\n";

	} else { subject = NULL; }


} //----- End of SensorSimulatorSunSpot
开发者ID:Aldream,项目名称:PLD-SR,代码行数:21,代码来源:SensorSimulatorSunSpot.cpp

示例11: patientsPath

//!----------------------------------------------------------------------------------------------------
//!
//! \brief Patients::findPatientExisted
//!
int Patients::findPatientExisted(){

    QDir patientsPath(this->patients_path);

    patientsPath.setFilter(QDir::Dirs);

    QFileInfoList list = patientsPath.entryInfoList();

    for(unsigned char cpt = 0; cpt < list.size(); cpt++){
        if(list.at(cpt).filePath().contains(".") || list.at(cpt).filePath().contains("..")){
            continue;
        }

        Patient *patient = new Patient(list.at(cpt).filePath(), id);
        patient->setImageProcessingFactory(this->imageProcessingFactory);
        patients.append(patient);
        id++;
    }
    return id;
}
开发者ID:UMAHunter,项目名称:piss,代码行数:24,代码来源:Patients.cpp

示例12: update

void SensorSimulatorSunSpot::update() {
//	float voltage = t;
//	if (voltage > maxV) { t = maxV; }
//	else if (voltage < minV) { t = minV; }
	Patient* patient = dynamic_cast<Patient*>(subject);
	if (patient != 0) {
		float t, i, m;
		t = patient->getTemperature();
		if (t > maxTemp) { t = maxTemp; }
		else if (t < minTemp) { t = minTemp; }
		i = patient->getRoom()->getLuminosity();
		if (i > maxLum) { i = maxLum; }
		else if (i < minLum) { i = minLum; }
		m = patient->getMovement();
		if (m > maxMov) { m = maxMov; }
		else if (m < minMov) { m = minMov; }
		EnOceanSensorAPI::setIlluminance(&frame, i, minLum, maxLum);
		EnOceanSensorAPI::setTemperature(&frame, t, minTemp, maxTemp);
		EnOceanSensorAPI::setMovement(&frame,  m, minMov, maxMov);
	}
}
开发者ID:Aldream,项目名称:PLD-SR,代码行数:21,代码来源:SensorSimulatorSunSpot.cpp

示例13: system

void EmergencyRoom::reviewPatient() {
	system("cls");

	for (int i = 0; i < 80; i++)
		cout << "=";
	cout << "|                                PATIENT REVIEW                                |";
	for (int i = 0; i < 80; i++)
		cout << "=";

	char answer = ' ';
	cout << "Doc, would you like to review any of the patients files? (Y/N): ";
	cin >> answer;
	while (answer == 'Y' || answer == 'y'){
		string userInput = "";
		cout << "Enter the name of the patient whose file you wish to review: ";
		cin >> userInput;

		bool found = false;
		Patient *foundPatient = nullptr;
		for (int currentIndex = 0; currentIndex <= patientCount; currentIndex++){
			if (userInput == patients[currentIndex].getName()){
				foundPatient = &patients[currentIndex];
				cout << "Name: " << foundPatient->getName() << endl;
				cout << "Severity: " << foundPatient->getPriorityValue() << endl;
				cout << "Arrival Time: " << timeInString(foundPatient->getArrivalTime()) << endl;
				found = true;
				break;
			}
		}
		if (!found){
			cout << userInput << " has not been found!" << endl;
		}

		cout << "Is there another patient whose file you would like to review? (Y/N): ";
		cin >> answer;
		cout << endl;
	}
}
开发者ID:chriswongtv,项目名称:teamx,代码行数:38,代码来源:EmergencyRoom.cpp

示例14:

// Copy constructor.  
Patient::Patient(const Patient & p) 
{ 
    id = p.id;
    first_name = p.first_name;
    last_name = p.last_name;
    
    // Add xrays.
    list<Xray> xrs = p.getXrays();
    list<Xray>::const_iterator xi;
    for (xi = xrs.begin(); xi != xrs.end(); ++xi) {
        xrays.push_back(*xi);
    }
    
}
开发者ID:fduckart,项目名称:frd-cpp-patients-xrays,代码行数:15,代码来源:patient.cpp

示例15: it

bool PatientPrivate ::submitAll()
{
    if(cData.size() == 0)
        return false;
    QHashIterator<int,QString> it(cData);
    while(it.hasNext())
    {
        it.next();
        if(it.value() == "true")
        {
            r->modifyRow(it.key(),"checked",it.value());
        }
    }
    return true;
}
开发者ID:321281199206103917,项目名称:Patient,代码行数:15,代码来源:patient.cpp


注:本文中的Patient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。