コード例 #1
0
void IPatient::registerPatientTokens()
{
#ifndef WITH_PAD
    return;
#else
    // Create and register namespaces
    TokenNamespace patientNs("Patient");
    patientNs.setUntranslatedHumanReadableName(Trans::Constants::PATIENT);
    patientNs.setUntranslatedHelpText(::NAMESPACE_DESCRIPTION);
    patientNs.setUntranslatedTooltip(::NAMESPACE_DESCRIPTION);

    TokenNamespace patientIdentNs("Identity");
    patientIdentNs.setUntranslatedHumanReadableName(Trans::Constants::IDENTITY_TEXT);

    TokenNamespace patientAgeNs("Age");
    patientAgeNs.setUntranslatedHumanReadableName(Trans::Constants::AGE);

    TokenNamespace patientAddressNs("Address");
    patientAddressNs.setUntranslatedHumanReadableName(Trans::Constants::ADDRESS);

    TokenNamespace patientContactNs("Contact");
    patientContactNs.setUntranslatedHumanReadableName(Trans::Constants::CONTACT);

    TokenNamespace patientMetricsNs("Metrics");
    patientMetricsNs.setUntranslatedHumanReadableName(Trans::Constants::METRICS);

    TokenNamespace patientBioNs("Biology");
    patientBioNs.setUntranslatedHumanReadableName(Trans::Constants::BIOLOGY);

    TokenNamespace patientInsuranceNs("Insurance");
    patientInsuranceNs.setUntranslatedHumanReadableName(Trans::Constants::INSURANCE);

    TokenNamespace patientDrugsNs("Drugs");
    patientInsuranceNs.setUntranslatedHumanReadableName(Trans::Constants::DRUGS);

    TokenNamespace patientDrugsLongTermNs("ChronicTherapeutics");
    patientDrugsLongTermNs.setUntranslatedHumanReadableName(Trans::Constants::LONG_TERM_THERAPY);
    patientDrugsNs.addChild(patientDrugsLongTermNs);

    TokenNamespace patientDrugsAllergiesNs("Allergies");
    patientDrugsAllergiesNs.setUntranslatedHumanReadableName(Trans::Constants::DRUGS_ALLERGIES);
    patientDrugsNs.addChild(patientDrugsAllergiesNs);

    TokenNamespace patientDrugsIntolerancesNs("Intolerances");
    patientDrugsIntolerancesNs.setUntranslatedHumanReadableName(Trans::Constants::DRUGS_INTOLERANCES);
    patientDrugsNs.addChild(patientDrugsIntolerancesNs);

    patientNs.addChild(patientIdentNs);
    patientNs.addChild(patientAgeNs);
    patientNs.addChild(patientAddressNs);
    patientNs.addChild(patientContactNs);
    patientNs.addChild(patientMetricsNs);
    patientNs.addChild(patientBioNs);
    patientNs.addChild(patientInsuranceNs);
    patientNs.addChild(patientDrugsNs);
    if (tokenPool())
        tokenPool()->registerNamespace(patientNs);

    // Create tokens
    Core::IToken *t;
    QVector<Core::IToken *> _tokens;

    // Identity
    t = new PatientToken(Constants::TOKEN_PATIENTUSUALNAME, UsualName);
    t->setUntranslatedHumanReadableName(Trans::Constants::USUALNAME);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTOTHERNAMES, OtherNames);
    t->setUntranslatedHumanReadableName(Trans::Constants::OTHERNAMES);
    _tokens << t;

    t = new PatientToken(Constants::TOKEN_PATIENTFIRSTNAME, Firstname);
    t->setUntranslatedHumanReadableName(Trans::Constants::FIRSTNAME);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTFULLNAME, FullName);
    t->setUntranslatedHumanReadableName(Trans::Constants::FULLNAME);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTTITLE, Title);
    t->setUntranslatedHumanReadableName(Trans::Constants::TITLE);
    _tokens << t;

    // Dates && age
    t = new PatientToken(Constants::TOKEN_PATIENTDATEOFBIRTH, DateOfBirth);
    t->setUntranslatedHumanReadableName(Trans::Constants::DATE_OF_BIRTH);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTDATEOFDEATH, DateOfDeath);
    t->setUntranslatedHumanReadableName(Trans::Constants::DATE_OF_DEATH);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTYEARSOLD, YearsOld);
    t->setUntranslatedHumanReadableName(Trans::Constants::AGE_IN_YEARS);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTAGE, Age);
    t->setUntranslatedHumanReadableName(Trans::Constants::AGE);
    _tokens << t;

    // Address & contact
    t = new PatientToken(Constants::TOKEN_PATIENTFULLADDRESS, FullAddress);
    t->setUntranslatedHumanReadableName(Trans::Constants::FULLADDRESS);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTADDRESS_STREET, Street);
    t->setUntranslatedHumanReadableName(Trans::Constants::STREET);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTADDRESS_CITY, City);
    t->setUntranslatedHumanReadableName(Trans::Constants::CITY);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTADDRESS_ZIP, ZipCode);
    t->setUntranslatedHumanReadableName(Trans::Constants::ZIPCODE);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTADDRESS_STATE, StateProvince);
    t->setUntranslatedHumanReadableName(Trans::Constants::STATE);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTADDRESS_COUNTRY, Country);
    t->setUntranslatedHumanReadableName(Trans::Constants::COUNTRY);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTCONTACT_EMAIL, Mails);
    t->setUntranslatedHumanReadableName(Trans::Constants::EMAIL);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTCONTACT_TELS, Tels);
    t->setUntranslatedHumanReadableName(Trans::Constants::TELS);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTCONTACT_FAX, Faxes);
    t->setUntranslatedHumanReadableName(Trans::Constants::FAX);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTCONTACT_MOBILEPHONE, MobilePhone);
    t->setUntranslatedHumanReadableName(Trans::Constants::MOBILEPHONE);
    _tokens << t;

    t = new PatientToken(Constants::TOKEN_WEIGHTINGRAMS, WeightInGrams);
    t->setUntranslatedHumanReadableName(Trans::Constants::WEIGHT);
    _tokens << t;

    t = new PatientToken(Constants::TOKEN_HEIGHTINCENTIMETERS, HeightInCentimeters);
    t->setUntranslatedHumanReadableName(Trans::Constants::HEIGHT);
    _tokens << t;

    t = new PatientToken(Constants::TOKEN_CLCR, CreatinClearance);
    t->setUntranslatedHumanReadableName(Trans::Constants::CREATININ_CLEARANCE);
    _tokens << t;

    t = new PatientToken(Constants::TOKEN_CLCR_UNIT, CreatinClearanceUnit);
//    t->setUntranslatedHumanReadableName(Trans::Constants::);
    _tokens << t;

    t = new PatientToken(Constants::TOKEN_PATIENTSOCIALNUMBER, SocialNumber);
    t->setUntranslatedHumanReadableName(Trans::Constants::SOCIAL_NUMBER);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTSOCIALNUMBER2, SocialNumber2);
    t->setUntranslatedHumanReadableName(Trans::Constants::SOCIAL_NUMBER);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTSOCIALNUMBER3, SocialNumber3);
    t->setUntranslatedHumanReadableName(Trans::Constants::SOCIAL_NUMBER);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTSOCIALNUMBER4, SocialNumber4);
    t->setUntranslatedHumanReadableName(Trans::Constants::SOCIAL_NUMBER);
    _tokens << t;
//    t = new PatientToken(Constants::TOKEN_PATIENTSOCIALNUMBERS, SocialNumbers);
//    t->setUntranslatedHumanReadableName(Trans::Constants::SOCIAL_NUMBERS);
//    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTSOCIALNUMBEROWNERNAME, SocialNumberOwnerFullName);
    t->setUntranslatedHumanReadableName(Trans::Constants::SOCIAL_NUMBER_OWNER_NAME);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_PATIENTSOCIALNUMBEROWNERADDRESS, SocialNumberOwnerFullAddress);
    t->setUntranslatedHumanReadableName(Trans::Constants::SOCIAL_NUMBER_OWNER_ADDRESS);
    _tokens << t;

    t = new PatientToken(Constants::TOKEN_DRUGS_CHRONIC_XML, DrugsChronicTherapeutics);
    t->setUntranslatedHumanReadableName(Trans::Constants::LONG_TERM_THERAPY);
    _tokens << t;
    t = new PatientToken(Constants::TOKEN_DRUGS_CHRONIC_HTML, DrugsChronicTherapeuticsHtml);
    t->setUntranslatedHumanReadableName(Trans::Constants::LONG_TERM_THERAPY);
    _tokens << t;

    if (tokenPool()) {
        LOG("Registering Core::IPatient tokens");
        tokenPool()->addTokens(_tokens);
    } else {
        LOG_ERROR("PadTools object is not available, can not register the Core::IPatient tokens");
    }
#endif

}
コード例 #2
0
ファイル: iuser.cpp プロジェクト: NyFanomezana/freemedforms
void IUser::registerUserTokens() const
{
#ifndef WITH_PAD
    return;
#else
    // Create and register namespaces
    TokenNamespace userNs(Constants::TOKEN_USER_NAMESPACE);
    userNs.setUntranslatedHumanReadableName(Trans::Constants::USER);
    userNs.setUntranslatedHelpText(::NAMESPACE_DESCRIPTION);
    userNs.setUntranslatedTooltip(::NAMESPACE_DESCRIPTION);

    TokenNamespace userIdentNs("Identity");
    userIdentNs.setUntranslatedHumanReadableName(Trans::Constants::IDENTITY_TEXT);

    TokenNamespace userAgeNs("Age");
    userAgeNs.setUntranslatedHumanReadableName(Trans::Constants::AGE);

    TokenNamespace userContactNs("Contact");
    userContactNs.setUntranslatedHumanReadableName(Trans::Constants::CONTACT);

    TokenNamespace userProfNs("Professional");
    userProfNs.setUntranslatedHumanReadableName(Trans::Constants::PROFESSIONAL);

    userNs.addChild(userIdentNs);
    userNs.addChild(userAgeNs);
    userNs.addChild(userContactNs);
    userNs.addChild(userProfNs);
    if (tokenPool())
        tokenPool()->registerNamespace(userNs);

    // Create tokens
    Core::IToken *t;
    QVector<Core::IToken *> _tokens;
    t = new UserToken(Constants::TOKEN_USERUSUALNAME, UsualName);
    t->setUntranslatedHumanReadableName(Trans::Constants::USUALNAME);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USEROTHERNAMES, OtherNames);
    t->setUntranslatedHumanReadableName(Trans::Constants::OTHERNAMES);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERFIRSTNAME, Firstname);
    t->setUntranslatedHumanReadableName(Trans::Constants::FIRSTNAME);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERFULLNAME, FullName);
    t->setUntranslatedHumanReadableName(Trans::Constants::FULLNAME);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERDATEOFBIRTH, DateOfBirth);
    t->setUntranslatedHumanReadableName(Trans::Constants::DATE_OF_BIRTH);
    _tokens << t;

    //    t = new UserToken(Constants::TOKEN_USERYEARSOLD, YearsOld);
//    t->setUntranslatedHumanReadableName(Trans::Constants::);
//    _tokens << t;

//    t = new UserToken(Constants::TOKEN_USERAGE, Age);
//    t->setUntranslatedHumanReadableName(Trans::Constants::);
//    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERTITLE, Title);
    t->setUntranslatedHumanReadableName(Trans::Constants::TITLE);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERSPECIALITIES, Specialities);
    t->setUntranslatedHumanReadableName(Trans::Constants::SPECIALTIES);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERIDENTIFIER, ProfessionalIdentifiants);
    t->setUntranslatedHumanReadableName(Trans::Constants::IDENTIFIANTS);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERQUALIFICATIONS, Qualifications);
    t->setUntranslatedHumanReadableName(Trans::Constants::QUALIFICATIONS);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERFULLCONTACT_HTML, FullHtmlContact);
    t->setUntranslatedHumanReadableName(Trans::Constants::FULLCONTACT_HTML);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERFULLADDRESS_HTML, FullHtmlAddress);
    t->setUntranslatedHumanReadableName(Trans::Constants::FULLADDRESS_HTML);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERFULLADDRESS, FullAddress);
    t->setUntranslatedHumanReadableName(Trans::Constants::FULLADDRESS);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERSTREET, Street);
    t->setUntranslatedHumanReadableName(Trans::Constants::STREET);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERZIP, Zipcode);
    t->setUntranslatedHumanReadableName(Trans::Constants::ZIPCODE);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERCITY, City);
    t->setUntranslatedHumanReadableName(Trans::Constants::CITY);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERSTATE, StateProvince);
    t->setUntranslatedHumanReadableName(Trans::Constants::STATE);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERCOUNTRY, Country);
    t->setUntranslatedHumanReadableName(Trans::Constants::COUNTRY);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERMAIL, Mail);
    t->setUntranslatedHumanReadableName(Trans::Constants::MAIL);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERTEL1, Tel1);
    t->setUntranslatedHumanReadableName(Trans::Constants::TELS);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERTEL2, Tel2);
    t->setUntranslatedHumanReadableName(Trans::Constants::TELS);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERTEL3, Tel3);
    t->setUntranslatedHumanReadableName(Trans::Constants::TELS);
    _tokens << t;

    t = new UserToken(Constants::TOKEN_USERFAX, Fax);
    t->setUntranslatedHumanReadableName(Trans::Constants::FAX);
    _tokens << t;

    if (tokenPool()) {
        LOG("Registering Core::IUser tokens");
        tokenPool()->addTokens(_tokens);
    } else {
        LOG_ERROR("PadTools object is not available, can not register the Core::IUser tokens");
    }
#endif
}