Saravanan666/pypi-org huggingface dataset:
Package: edc-label
edc-labelPrint labels from for clinic/edc projectsTo add print servers update settings.CUPS_SERVERS:# settings.py
...

CUPS_SERVERS = ["localhost", "prn.sample.org"]

...If not set, the default print server is “localhost”.Note: it is fine to just configure the local CUPS server (localhost) with remote printers as per below.CUPS and printer InstallationInstall CUPS Print Server:sudo apt-get install cups

sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.original

sudo chmod a-w /etc/cups/cupsd.conf.originalEdit/etc/cups/cupsd.confto listen on your public IP:sudo  nano /etc/cups/cupsd.confAdd the last line with your public IP:Listen 127.0.0.1:631           # existing loopback Listen
    Listen /var/run/cups/cups.sock # existing socket Listen
--> Listen PUBLIC_IP:631      # Listen on the LAN interface, Port 631 (IPP)Restart CUPS:sudo systemctl restart cups.serviceAdd a remote printer by name to your CUPS serverLOCAL_PRINTER_NAME: printer as named on the EDC, your serverREMOTE_CUPS_IP_ADDRESS: IP of remote CUPS serverREMOTE_PRINTER_NAME: printer name installed on remote CUPS serverlpadmin -p LOCAL_PRINTER_NAME -E -vipp://REMOTE_CUPS_IP_ADDRESS/printers/REMOTE_PRINTER_NAMEFor example:lpadmin -p ambition_clinic_label_printer -E -v ipp://154.70.150.42/printers/ambition_clinic_label_printer
lpadmin -p ambition_lab_label_printer -E -v ipp://154.70.150.42/printers/ambition_lab_label_printer
lpadmin -p specimen_reception_label_printer -E -v ipp://154.70.150.42/printers/specimen_reception_label_printerAdd an IP addressable remote printerREMOTE_CUPS_IP_ADDRESS: printer IP installed on remote CUPS serverlpadmin -p LOCAL_PRINTER_NAME -E -vipp://REMOTE_CUPS_IP_ADDRESS/ipp/print-m everywhereFor example:lpadmin -p PRINTER_NAME -E -v ipp://REMOTE_IP_ADDRESS/ipp/print -m everywhereSee alsohttp://labelary.com/viewer.html
Package: edc-list-data
edc-list-dataPopulate list data and other static model data onDjangostartup.To install addedc_list_data.apps.AppConfigto yourINSTALLED_APPS, then create alist_data.pyin the root of your app.Most commonly used to populate M2M data known here aslist_data. M2M field models should use theListModelMixin.The list models are populated using apost_migratesignal. Once everything is configured
or after changes are made, you need to runpython manage.py migrate.For example:classAntibiotic(ListModelMixin,BaseUuidModel):classMeta(ListModelMixin.Meta):passAn examplelist_data.py:fromedc_constants.constantsimportOTHERlist_data={'my_lists_app.antibiotic':[('flucloxacillin','Flucloxacillin'),('gentamicin','Gentamicin'),('ceftriaxone','Ceftriaxone'),('amoxicillin_ampicillin','Amoxicillin/Ampicillin'),('doxycycline','Doxycycline'),('erythromycin','Erythromycin'),('ciprofloxacin','Ciprofloxacin'),(OTHER,'Other, specify')],}Now run:>>> python manage.py migrateThe list data will be populated in the order in which the list items are declared.See also call tosite_list_data.autodiscoverandsite_list_data.load_datacalled inedc_list_data.apps.AppConfigusing apost_migratesignal.
Package: edc-locator
edc-locatorBase classes for participant locator form and processesOther edc modules will useget_locator_modelandget_locator_model_clsto access the
subject locator model class.get_locator_modeldefaults toedc_locator.subject_locator.
If you declare a custom locator model, add the name of the model tosettingsin label_lower format:# settings.py
SUBJECT_LOCATOR_MODEL="myapp.subject_locator"When declaring a custom locator model, you may only need to declare aproxymodel class.For example:# models.pyfromedc_locator.modelsimportSubjectLocatorasBaseModelclassSubjectLocator(BaseModel):classMeta:proxy=Trueverbose_name="Subject Locator"verbose_name_plural="Subject Locators"# forms.py# use the form class from edc_locatorUse the modeladmin mixin classSubjectLocatorModelAdminMixin.  Since you only want one
subject locator model accessible through admin in your EDC, unregister the default subject locator
before registering your custom modeladmin class.# admin.pyedc_locator_admin.unregister(DefaultSubjectLocator)@admin.register(SubjectLocator,site=intecomm_prn_admin)classSubjectLocatorAdmin(SubjectLocatorModelAdminMixin,SiteModelAdminMixin,ModelAdminSubjectDashboardMixin,SimpleHistoryAdmin,):pass
Package: edc-mnsi
edc-mnsiDjango classes for the Michigan Neuropathy Screening Instrument (MNSI).https://pubmed.ncbi.nlm.nih.gov/7821168/https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3641573/(omits monofilament testing)https://medicine.umich.edu/sites/default/files/downloads/MNSI_howto.pdfMNSI scores are calculated insignals.pythrough a call to theMnsiCalculatorand stored in two calculated fields on the model. The two calculated fields can also be viewed as read only on the form in Admin.See also:https://github.com/clinicedc/edchttps://github.com/meta-trial/meta-edcedc_mnsihas anMnsimodel. If the default model does not meet your needs,
you can use theMnsimodel mixin,MnsiModelMixin, and declare a customMnsimodel in your app.# models.pyfromedc_mnsi.model_mixinsimportMnsiModelMixinfromedc_modelimportmodelsasedc_models# a custom mixinfrom..model_mixinsimportCrfModelMixinclassMnsi(MnsiModelMixin,CrfModelMixin,edc_models.BaseUuidModel,):classMeta(MnsiModelMixin.Meta,CrfModelMixin.Meta,edc_models.BaseUuidModel.Meta):passAdd the following tosettingsif using a customMnsimodel:EDC_MNSI_MODEL = "my_app.mnsi"Note:settings.EDC_MNSI_MODELis needed byedc_mnsi.auths.pyto find theMnsimodel.
This is applicable if you are usingedc_auth.A custom admin class will be needed for your customMnsimodel. Here is an example of a customadminclass that refers to fields added to the customMnsimodel and adds a custommodeladminmixin.Note: In your customadminyou should unregister the defaultadminclass before registering your customadminclass.# admin.pyfromdjango.contribimportadminfromdjango_audit_fieldsimportaudit_fieldset_tuplefromedc_crf.adminimportcrf_status_fieldset_tuplefromedc_mnsi.admin_siteimportedc_mnsi_adminfromedc_mnsi.fieldsetsimportcalculated_values_fieldsetfromedc_mnsi.fieldsetsimportget_fieldsetsasget_mnsi_fieldsetsfromedc_mnsi.model_admin_mixinimportMnsiModelAdminMixin,radio_fieldsfromedc_mnsi.modelsimportMnsiasDefaultMnsifromedc_model_admin.historyimportSimpleHistoryAdmin# your app's admin sitefrom..admin_siteimportmy_app_admin# your custom formfrom..formsimportMnsiForm# your custom modelfrom..modelsimportMnsi# a custom mixinfrom.modeladminimportCrfModelAdmin# customize the fieldsets as neededdefget_fieldsets():fieldset=(None,{"fields":("subject_visit","report_datetime","mnsi_performed","mnsi_not_performed_reason",)},)fieldsets=(fieldset,)+get_mnsi_fieldsets()fieldsets+=(crf_status_fieldset_tuple,)fieldsets+=(calculated_values_fieldset,)fieldsets+=(audit_fieldset_tuple,)returnfieldsets# customize radio_fieldsradio_fields.update(crf_status=admin.VERTICAL)# unregister the default modeledc_mnsi_admin.unregister(DefaultMnsi)@admin.register(Mnsi,site=meta_subject_admin)classMnsiAdmin(MnsiModelAdminMixin,CrfModelAdmin,SimpleHistoryAdmin,):form=MnsiFormfieldsets=get_fieldsets()radio_fields=radio_fields
Package: edc-model
edc-modelBase model, manager, field, form and admin classes for Edc.All models in the Edc useBaseUuidModelfromedc_model.model_mixinsimportBaseUuidModelclassMyModel(BaseUuidModel):....The mixin:sets the id fields to aUUIDFieldinstead of an integer;adds audit fields throughBaseModel(user_created, user_modified, date_created, etc);addsUrlModelMixin,DeviceModelMixinMost models require an audit trail. If so, add theHistoricalRecordmodel manager.fromedc_model.model.modelsimportHistoricalRecordclassMyModel(BaseUuidModel):...history=HistoricalRecord()HistoricalRecordis an almost identical version ofsimple_history.models.HistoricalRecordwith the exception of two methods:get_extra_fields()andadd_extra_methods(). Methodget_extra_fields()is overridden to change thehistory_idprimary key from anIntegerFieldto aUUIDFieldso that it can work with moduledjango_collect_offline.The audit trail models created byHistoricalRecordhave a foreign key toauth.User. In order for the models to work withdjango_collect_offlinespecify the django_collect_offline User model in settings:AUTH_USER_MODEL='django_collect_offline.User'NotesUser created and modified fields behave as follows:created is only set on pre-save addmodified is always updated
Package: edc-model-admin
edc-model-adminEdc custom django ModelAdmin mixins, tags and templatesModelAdminFormAutoNumberMixinOverrides ModelAdmin’sget_formto insert question numbers and the DB field names.ModelAdminNextUrlRedirectMixinSkips thechangelistand redirects to the next CRF or Requisition listed in an edc visit schedule if “[Save and Next]”
is clicked instead of “[SAVE]”classBaseModelAdmin:search_fields=("subject_identifier",)add_form_template="edc_model_admin/admin/change_form.html"change_form_template="edc_model_admin/admin/change_form.html"change_list_template="edc_model_admin/admin/change_list.html"@admin.register(CrfTwo)classCrfTwoAdmin(BaseModelAdmin,ModelAdminNextUrlRedirectMixin,admin.ModelAdmin):show_save_next=Trueshow_cancel=TrueYou need to use the includedchange_form.htmlto override the submit buttons on theadminform.See also::edc_visit_scheduleModelAdminRedirectOnDeleteMixinRedirects the admin form on save to a view other than the defaultchangelistifpost_url_on_delete_nameis set.@admin.register(CrfFive)classCrfFiveAdmin(ModelAdminRedirectOnDeleteMixin,admin.ModelAdmin):post_url_on_delete_name="dashboard2_app:dashboard_url"defpost_url_on_delete_kwargs(self,request,obj):return{'subject_identifier':obj.subject_identifier}You can also store url names in the request object if used together with the Middleware fromedc_dashboardandedc_subject_dashboard.
This is useful if you do not know the namespace until deployment.For example, add to settings:MIDDLEWARE=[...,'edc_dashboard.middleware.DashboardMiddleware','edc_subject_dashboard.middleware.DashboardMiddleware',],DASHBOARD_URL_NAMES={'subject_dashboard_url':'dashboard_app:subject_dashboard_url',},and then declare the model admin class:@admin.register(CrfFive)classCrfFiveAdmin(ModelAdminRedirectOnDeleteMixin,admin.ModelAdmin):post_url_on_delete_name="subject_dashboard_url"defpost_url_on_delete_kwargs(self,request,obj):return{'subject_identifier':obj.subject_identifier}ModelAdminRedirectOnDeleteMixinwill attempt to get the urlname from the request object usingpost_url_on_delete_nameas a dictionary key.
Package: edc-model-wrapper
edc-model-wrapperWrap a model instance with a custom wrapper to add methods needed for Edc Dashboards and Listboards.classExampleModelWrapper(ModelWrapper):model='edc_model_wrapper.example'next_url_name='edc-model-wrapper:listboard_url'next_url_attrs=['f1']querystring_attrs=['f2','f3']defhello(self):return'hello'defgoodbye(self):return'goodbye'Instantiate with a model instance, persisted or not:model_obj=Example(f1=1,f2=2,f3=3)wrapper=ExampleExampleModelWrapper(model_obj=model_obj)Get the “admin” url with “next” for model objects in a Listboard, Dabsboard, etc,>>>wrapper.href'/admin/edc_model_wrapper/example/add/?next=edc-model-wrapper:listboard_url,f1&f1=1&f2=2&f3=3'Get the admin url without the “next” querystring data:>>>wrapper.admin_url_name'/admin/edc_model_wrapper/example/add/'Reverse the next_url:>>>wrapper.reverse()'/listboard/1/'Attributemodelis a model class regardless of how it was declared:>>>assertwrapper.model==ExampleTrueAll field attributes are converted to string and added to the wrapper, except foreign keys:>>>wrapper.f11>>>wrapper.f22Custom methods/properties are, of course, available:>>>wrapper.hello()'hello'>>>wrapper.goodbye()'goodbye'The original object is accessible, if needed:>>>wrapper.object<Example>for example to access original field values:>>>wrapper.report_datetime'2017-06-01 15:04:41.760296'>>>wrapper.object.report_datetimedatetime.datetime(2017,6,1,15,4,55,594512)
Package: edc-next-appointment
edc-next-appointmentBase classes for managing next appointment CRF at each timepointDeclare in your app as a longitudinal model / CRF.For example:# model.pyclassNextAppointment(NextAppointmentCrfModelMixin,CrfModelMixin,BaseUuidModel):classMeta(CrfModelMixin.Meta,BaseUuidModel.Meta):verbose_name="Next Appointment"verbose_name_plural="Next Appointments"# forms.pyclassNextAppointmentForm(NextAppointmentModelFormMixin,CrfModelFormMixin,forms.ModelForm):form_validator_cls=NextAppointmentFormValidatorclassMeta:model=NextAppointmentfields="__all__"# admin.py@admin.register(NextAppointment,site=intecomm_subject_admin)classNextAppointmentAdmin(NextAppointmentModelAdminMixin,CrfModelAdmin):form=NextAppointmentForm
Package: edc-offstudy
edc-offstudyBase classes for off study processThe offstudy model is linked to scheduled models by the visit schedule.# visit_schedule.py...visit_schedule1=VisitSchedule(name='visit_schedule1',offstudy_model='edc_offstudy.subjectoffstudy',...)...This module includes an offstudy modelSubjectOffstudy.You may also declare your own using theOffstudyModelMixin:classSubjectOffstudy(OffstudyModelMixin,BaseUuidModel):passIf you declare your own, be sure to reference it correctly in the visit schedule:# visit_schedule.py...visit_schedule1=VisitSchedule(name='visit_schedule1',offstudy_model='myapp.subjectoffstudy',...)...When the offstudy model is saved, the data is validated relative to the consent andvisit model. An offstudy datetime should make sense relative to these model instances for the subject.
Unused appointments in the future relative to the offstudy datetime will be removed.Note: There is some redundancy with this model and the offschedule model fromedc-visit-schedule. This needs to be resolved.
Package: edc-permissions
edc-permissionsSimple classes for setting group permissions required for Edc deployments.To add the default groups and permissions run the management command:pythonmanage.pyupdate_edc_permissionsDefault GroupsThe default groups are required for the normal operation of an EDC deployment. The default groups are:ACCOUNT_MANAGER: members may add/change and delete user accountsADMINISTRATION: members may view the Administration pageAUDITOR: members may view all forms but have no add/change permissions.CLINIC: members may add/edit/delete all CRFs, Requisitions, Actions and other required clinic trial data entry forms. They may also view the Requisition page of the Lab section;EVERYONE: members may access the EDC;LAB: members may perform all functions in the Lab section (Edit requisitions, receive, process, pack, manage manifests, etc);PHARMACY:PII: members may view all personally identifiable data and edit forms that manage such data (Screening, Consents, Patient registration);PII_VIEW: members may view personally identifiable data but have no add/edit permissions for any of the forms that store such data.Default membership for Clinical staff:EVERYONEADMINISTRATIONCLINICPIIDefault membership for Laboratory technicians:EVERYONEADMINISTRATIONLABPII_VIEWDefault membership for Auditors:EVERYONEADMINISTRATIONAUDITORPII_VIEW** Permissions **Permissions use Django’s permission framework,  therefore, all permissions are linked to some model.Permissions don’t always naturally link to a model. In such cases, a dummy model is created. For example, with Navigation bars fromedc_navbar. Permissions to follow an item on a navigation bar are associated with modeledc_navbar.Navbar. A similar approach is used forlistboardpermissions usingedc_dashboard.Dashboard.
Package: edc-qol
edc-qolDjango classes for Quality of Life instruments.Includes:EQ-5D-3L InstrumentSF-12 Health SurveySee:https://euroqol.org/eq-5d-instruments/eq-5d-3l-about/See also:https://github.com/clinicedc/edchttps://github.com/meta-trial/meta-edc
Package: edc-reference
edc-referencePivoted reference table for EDC modulesedc_referencecreates a pivoted table of CRF and Requisition records with a small subset of values that can be efficiently referenced. The module is used byedc_metadata_rulesto quickly determine if a CRF or Requisition model instance exists avoiding the need to query each individual model class.See alsoedc_metadata_rulesUsage and ConfigurationDeclare a model with theReferenceModelMixin.fromedc_reference.model_mixinsimportReferenceModelMixinclassCrfOne(ReferenceModelMixin,BaseUuidModel):subject_visit=models.ForeignKey(SubjectVisit,on_delete=PROTECT)report_datetime=models.DateTimeField(default=get_utcnow)f1=models.CharField(max_length=50)f2=models.CharField(max_length=50)f3=models.CharField(max_length=50)f4=models.DatetimeField(null=True)Register the model and the relevant fields with the site global,site_reference_configs:fromedc_reference.site_referenceimportReferenceModelConfigreference=ReferenceModelConfig(model='edc_reference.crfone',fields=['f1','f4'])site_reference_configs.register(reference)Create a model instance:crf_one=CrfOne.objects.create(subject_visit=subject_visit,f1='happiness'f4=get_utcnow())TheReferencemodel will be updated:fromedc_reference.modelsimportReferencereference=Reference.objects.get(identifier=self.subject_identifier,timepoint=self.subject_visit.visit_code,report_datetime=crf_one.report_datetime,field_name='f1')>>>reference.__dict__{...'datatype':'CharField','field_name':'f1','identifier':'1','model':'edc_reference.crfone','report_datetime':datetime.datetime(2017,7,7,13,30,6,545140,tzinfo=<UTC>),'timepoint':'code','value_date':None,'value_datetime':None,'value_int':None,'value_str':'happiness',...}Get thevaluefrom the reference instance:>>>reference.value'happiness'Model managers methods are also available, for example:reference=Reference.objects.crf_get_for_visit(model='edc_reference.crfone',visit=self.subject_visit,field_name='f1')>>>reference.value'happiness'Accessing pivoted data withLongitudinalRefsetTODO
Package: edc-registration
edc-registrationThe modelRegisteredSubjectis used by the Edc as the master subject registration table. Only one record may exist per individual. The table has space for PII so typically aRegisteredSubjectinstance is created or updated on completion of the informed consent. As always, PII in the Edc is encrypted at rest usingdjango-crypto-field.For the model and signal to be registered you need to add the AppConfig to your INSTALLED_APPS:INSTALLED_APPS=(....'edc_registration.apps.AppConfig',....)UpdatesOrCreatesRegistrationModelMixinRegisteredSubjectis never edited directly by the user. Instead some other model with the needed attributes is used as a proxy. To have a model perform the task of creating or updatingRegisteredSubject, declare it with theUpdatesOrCreatesRegistrationModelMixin.For example, a model,SubjectEligibilityor a screening model creates or updatesRegisteredSubjectwithout a subject identifier then a model such as theSubjectConsentintests.models, also creates or updates a subject’sRegisteredSubjectinstance on save. For this to happen, both models are declared with theUpdatesOrCreatesRegistrationModelMixin:classSubjectEligibility(UniqueSubjectIdentifierModelMixin,UpdatesOrCreatesRegistrationModelMixin,BaseUuidModel):screening_identifier=models.CharField(max_length=36,null=True,unique=True)@propertydefregistration_unique_field(self):return'screening_identifier'defupdate_subject_identifier_on_save(self):"""Overridden to not set the subject identifier on save.
        """ifnotself.subject_identifier:self.subject_identifier=self.subject_identifier_as_pk.hexself.subject_identifier_aka=self.subject_identifier_as_pk.hexreturnself.subject_identifierclassSubjectConsent(ConsentModelMixin,UpdatesOrCreatesRegistrationModelMixin,CreateAppointmentsMixin,IdentityFieldsMixin,ReviewFieldsMixin,PersonalFieldsMixin,CitizenFieldsMixin,VulnerabilityFieldsMixin,BaseUuidModel):@propertydefregistration_unique_field(self):return'screening_identifier'classMeta:app_label='my_app'The propertyregistration_unique_fieldreturns a model attribute that is used to set a registration identifier onRegisteredSubject.A subject’sRegisteredSubjectinstance is created and updated in apost_savesignal. As mentioned, it is never edited directly by the user.
Package: edc-review-dashboard
Edc Review DashboardAn alternative dashboard of a subject’s visits, CRFs and Requisitions.Declare in your app:classSubjectReviewListboardView(Base):listboard_model='ambition_subject.subjectvisit'model_wrapper_cls=RelatedVisitModelWrappernavbar_name='ambition_dashboard'Add URLs:urlpatterns=....review_listboard_url_config=UrlConfig(url_name='subject_listboard_url',view_class=SubjectListboardView,label='subject_listboard',identifier_label='subject_identifier',identifier_pattern=subject_identifier)urlpatterns+=review_listboard_url_config.review_listboard_urls
Package: edcrop
ed_pyEvapotranspiration is one of the major components of Earth’s water balance, being the sum of evaporation
and plant transpiration from the land and ocean surface.Ed.py is a Python script that, using climate input, can be used to simulate field-scale evapotranspiration
and drainage from the root zone of an area covered with a crop, a wetland, or a forest.The conceptual model implemented in ed.py is a modification of the Evacrop model by Olesen and Heidmann (2002),
which itself builds on the Watcros model by Aslyng and Hansen (1982). The ed.py conceptualization is based on
considerations regarding the physical processes that are important for turning precipitation and irrigation
into either evaporation, transpiration, or drainage from the root zone: Temperature determines whether
precipitation falls as rain or snow, and it determines when snow thaws and infiltrates. The vegetation intercepts
a part of precipitation, while the rest infiltrates into the ground. The infiltrated water will either evaporate,
be absorbed by plant roots, be stored in the soil, or drain from the root zone. Potential evaporation is
distributed between vegetation and soil, where the former part drives evaporation of intercepted water and plant
transpiration from the green leaf area, while the latter part drives evaporation from the soil. The soil’s ability
to store water depends on its field capacity; when the water content exceeds field capacity, water will gradually
drain downwards. Furthermore, it is assumed that the annual life cycle of crops and wetland vegetation can be
described by growing degree-days alone, while for forests the life cycle is described by a calendar. For irrigation,
either (i) date and amount are input, or (ii) they are determined automatically by ed.py using certain criteria.There are two alternative soil water balance functions to choose between in ed.py. The first alternative is an
almost straight copy of the function used in the original Evacrop code by Olesen and Heidmann (2002), simulating
flow through the soil profile as flow through two linear reservoirs using daily time steps. However, it can simulate
macro-pore drainage, which the original Evacrop cannot. The second alternative simulates flow through the soil profile
as flow through four linear or nonlinear reservoirs using daily or sub-daily time steps. For nonlinear reservoirs,
ed.py uses Mualem – van Genuchten like functions. It also simulates gravity driven macro-pore flow as well as surface runoff.As input, given in text files, ed.py requires daily temperature, precipitation, and reference evapotranspiration. It also
requires information about combination(s) of soil type and vegetation type to simulate. One can choose between seven
default soil types and fifteen default vegetation types, or one can manually input information for other types of soil
or vegetation. In a single model run, ed.py can loop through lists of climate files, soils, and vegetation.