Base django classes for health economics
Project description
edc-he
Health economics model, form mixins for clinicedc / Django
Declare in settings if using concrete models not included in this app:
EDC_HE_ASSETS_MODEL = "<label_lower>" EDC_HE_HOUSEHOLDHEAD_MODEL = "<label_lower>" EDC_HE_INCOME_MODEL = "<label_lower>" EDC_HE_PATIENT_MODEL = "<label_lower>" EDC_HE_PROPERTY_MODEL = "<label_lower>"
See also module intecomm_subject at https://github.com/intecomm-trial/intecomm-edc.
If you need to declare the Health Economics models in your app, use the provided model mixins.
For example, the HealthEconomicsHouseholdHead model would be declared like this:
# models.py
class HealthEconomicsHouseholdHead(
SingletonCrfModelMixin,
HouseholdHeadModelMixin,
HouseholdModelMixin,
CrfModelMixin,
BaseUuidModel,
):
class Meta(CrfModelMixin.Meta, BaseUuidModel.Meta):
verbose_name = "Health Economics: Household head"
verbose_name_plural = "Health Economics: Household head"
# forms.py
class HealthEconomicsHouseholdHeadForm(
CrfSingletonModelFormMixin, CrfModelFormMixin, forms.ModelForm
):
form_validator_cls = HealthEconomicsHouseholdHeadFormValidator
def clean(self):
self.raise_if_singleton_exists()
raise_if_clinical_review_does_not_exist(self.cleaned_data.get("subject_visit"))
return super().clean()
# admin.py
@admin.register(HealthEconomicsHouseholdHead, site=intecomm_subject_admin)
class HealthEconomicsHouseholdHeadAdmin(
HealthEconomicsHouseholdHeadModelAdminMixin, CrfModelAdmin
):
form = HealthEconomicsHouseholdHeadForm
The metadata rules may also be declared locally
# metadata_rules.py
from edc_he.rule_groups import Predicates as BaseHealthEconomicsPredicates
from edc_he.rule_groups import HealthEconomicsRuleGroup as BaseHealthEconomicsRuleGroup
class HealthEconomicsPredicates(BaseHealthEconomicsPredicates):
app_label = "intecomm_subject"
visit_model = "intecomm_subject.subjectvisit"
@register()
class HealthEconomicsRuleGroup(BaseHealthEconomicsRuleGroup):
class Meta:
app_label = "intecomm_subject"
source_model = "intecomm_subject.subjectvisit"
predicates = HealthEconomicsPredicates()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file edc_he-1.5.4.tar.gz.
File metadata
- Download URL: edc_he-1.5.4.tar.gz
- Upload date:
- Size: 78.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
737e0b556310ae5fae2e9b4eed183daab719b79d53739bf9bb08143cba17f5af
|
|
| MD5 |
d0f7e36263d37b421e582f4aee41e692
|
|
| BLAKE2b-256 |
03ea5ba49521434678bd583569cdcb785357c5a482b65bd5f6fdb1dbd93cb44b
|
File details
Details for the file edc_he-1.5.4-py3-none-any.whl.
File metadata
- Download URL: edc_he-1.5.4-py3-none-any.whl
- Upload date:
- Size: 115.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8223eda14b963303f79dae59c11ba4d3cd266da912495579c010bd3a8cba99b7
|
|
| MD5 |
66679494abc9c3cc805bd60abd894916
|
|
| BLAKE2b-256 |
75ee98d247d48ad29466af8c8a5ab355e7ffeb09b2607fff6f48528ccb250aee
|