Skip to content

Commit

Permalink
Merge branch 'hotfix/3.1.2'
Browse files Browse the repository at this point in the history
Conflicts:
	setup.py
  • Loading branch information
xispa committed Jul 25, 2014
2 parents fcc8b12 + 0dc093a commit 45b8fb4
Show file tree
Hide file tree
Showing 19 changed files with 309 additions and 34 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
3.1.1
3.1.2 (2014-07-25)
------------------

HEALTH-104: Health Setup data failures
HEALTH-28: Health load setup data. Drugs and Treatments did not import
HEALTH-105: Case syndromic classifications site eror in setup
HEALTH-93: AR. Updating Info portion
HEALTH-27: AR Create. Copying Patient fields across does not autocomplete corresponding Name or ID

- Plus Bika-LIMS 3.1.2 and 3.1.3: http://git.io/MWb4dQ


3.1.1 (2014-07-11)
------------------

HEALTH-122: Client contact cannot open Client page/AR page blank
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Bika Health 3.1.1 (Naringenin)
Bika Health 3.1.2 (Naringenin)
================

Bika Laboratory Information Management System customised for use in Health laboratories.
Expand Down
49 changes: 28 additions & 21 deletions bika/health/content/casesyndromicclassification.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
from AccessControl import ClassSecurityInfo
from Products.Archetypes.public import BaseContent
from Products.Archetypes.public import registerType
from bika.lims.content.bikaschema import BikaSchema
from bika.health.config import PROJECTNAME

schema = BikaSchema.copy()
schema['description'].widget.visible = True
schema['description'].schemata = 'default'

class CaseSyndromicClassification(BaseContent):
security = ClassSecurityInfo()
displayContentsTab = False
schema = schema

_at_rename_after_creation = True
def _renameAfterCreation(self, check_auto_id=False):
from bika.lims.idserver import renameAfterCreation
renameAfterCreation(self)

registerType(CaseSyndromicClassification, PROJECTNAME)
from AccessControl import ClassSecurityInfo
from Products.ATExtensions.ateapi import RecordsField
from DateTime import DateTime
from Products.ATExtensions.ateapi import DateTimeField, DateTimeWidget
from Products.Archetypes.public import *
from Products.CMFCore.permissions import View, ModifyPortalContent
from bika.lims import bikaMessageFactory as _b
from bika.health import bikaMessageFactory as _
from bika.lims.content.bikaschema import BikaSchema
from bika.health.config import PROJECTNAME
from bika.lims.browser.widgets import RecordsWidget
from zope.interface import implements

schema = BikaSchema.copy()
schema['description'].widget.visible = True
schema['description'].schemata = 'default'

class CaseSyndromicClassification(BaseContent):
security = ClassSecurityInfo()
displayContentsTab = False
schema = schema

_at_rename_after_creation = True
def _renameAfterCreation(self, check_auto_id=False):
from bika.lims.idserver import renameAfterCreation
renameAfterCreation(self)

registerType(CaseSyndromicClassification, PROJECTNAME)
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from AccessControl.SecurityInfo import ClassSecurityInfo
from Products.ATContentTypes.content import schemata
from Products.Archetypes import atapi
from Products.Archetypes.ArchetypeTool import registerType
from bika.lims.browser.bika_listing import BikaListingView
from bika.health.config import PROJECTNAME
from bika.lims import bikaMessageFactory as _b
from bika.health import bikaMessageFactory as _
from bika.lims.content.bikaschema import BikaFolderSchema
from bika.health.interfaces import ICaseSyndromicClassifications
from plone.app.layout.globals.interfaces import IViewView
from plone.app.content.browser.interfaces import IFolderContentsView
Expand All @@ -16,7 +19,7 @@ class CaseSyndromicClassificationsView(BikaListingView):
def __init__(self, context, request):
super(CaseSyndromicClassificationsView, self).__init__(context, request)
self.catalog = 'bika_setup_catalog'
self.contentFilter = {'portal_type': 'CaseSyndromicClassifications',
self.contentFilter = {'portal_type': 'CaseSyndromicClassification',
'sort_on': 'sortable_title'}
self.context_actions = {_('Add'):
{'url': 'createObject?type_name=CaseSyndromicClassification',
Expand Down
2 changes: 1 addition & 1 deletion bika/health/controlpanel/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<browser:page
for="bika.health.interfaces.ICaseSyndromicClassifications"
name="folder_view"
class=".bika_casesyndromicclassifications.CaseSyndromicClassifications"
class=".bika_casesyndromicclassifications.CaseSyndromicClassificationsView"
permission="bika.lims.ManageBika"
layer="bika.lims.interfaces.IBikaLIMS"
/>
Expand Down
4 changes: 2 additions & 2 deletions bika/health/profiles/default/cssregistry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

<stylesheet
id="++resource++bika.health.css/hide_contentmenu.css"
expression="python:here.portal_type in ['Doctors', 'Patients', 'Doctor', 'Patient', 'Drug', 'Treatment', 'DrugProhibition', 'VaccinationCenter', 'VaccinationCenters', 'Immunization', 'Immunizations', 'Disease', 'Diseases', 'CaseStatus', 'CaseStatuses', 'CaseOutcome', 'CaseOutcomes']"
expression="python:here.portal_type in ['Doctors', 'Patients', 'Doctor', 'Patient', 'Drug', 'Treatment', 'DrugProhibition', 'VaccinationCenter', 'VaccinationCenters', 'Immunization', 'Immunizations', 'Disease', 'Diseases', 'CaseStatus', 'CaseStatuses', 'CaseOutcome', 'CaseOutcomes', 'CaseSyndromicClassification', 'CaseSyndromicClassifications']"
media="screen"
rel="stylesheet"
rendering="link"
insert-before="*"/>

<stylesheet
id="++resource++bika.health.css/hide_editable_border.css"
expression="python:here.portal_type in ['Doctors', 'Patients', 'Drug', 'Drugs', 'Treatment', 'Treatments', 'Symptom', 'Symptoms', 'DrugProhibitions', 'VaccinationCenter', 'VaccinationCenters', 'Immunization', 'Immunizations', 'Disease', 'Diseases', 'CaseStatus', 'CaseStatuses', 'CaseOutcome', 'CaseOutcomes']"
expression="python:here.portal_type in ['Doctors', 'Patients', 'Drug', 'Drugs', 'Treatment', 'Treatments', 'Symptom', 'Symptoms', 'DrugProhibitions', 'VaccinationCenter', 'VaccinationCenters', 'Immunization', 'Immunizations', 'Disease', 'Diseases', 'CaseStatus', 'CaseStatuses', 'CaseOutcome', 'CaseOutcomes', 'CaseSyndromicClassification', 'CaseSyndromicClassifications']"
media="screen"
rel="stylesheet"
rendering="link"
Expand Down
1 change: 1 addition & 0 deletions bika/health/profiles/default/factorytool.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<type portal_type="AetiologicAgent"/>
<type portal_type="CaseOutcome"/>
<type portal_type="CaseStatus"/>
<type portal_type="CaseSyndromicClassification"/>
<type portal_type="Disease"/>
<type portal_type="Doctor"/>
<type portal_type="Drug"/>
Expand Down
2 changes: 1 addition & 1 deletion bika/health/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<metadata>
<version>3004</version>
<version>3005</version>
<dependencies>
<dependency>profile-bika.lims:default</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
bika_aetiologicagents
bika_caseoutcomes
bika_casesyndromicclassifications
bika_casestatuses
bika_diseases
bika_drugprohibitions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<property name="global_allow">False</property>
<property name="filter_content_types">True</property>
<property name="allowed_content_types">
<element value="CaseStatus"/>
<element value="CaseSyndromicClassification"/>
</property>
<property name="allow_discussion">False</property>
<property name="default_view_fallback">False</property>
Expand Down
159 changes: 159 additions & 0 deletions bika/health/setupdata/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.utils import safe_unicode, _createObjectByType
from bika.lims import logger
from bika.lims.exportimport.dataimport import SetupDataSetList as SDL
from bika.lims.exportimport.setupdata import WorksheetImporter
Expand Down Expand Up @@ -35,6 +36,164 @@ def Import(self):
renameAfterCreation(obj)


class Treatments(WorksheetImporter):

def Import(self):
folder = self.context.bika_setup.bika_treatments
for row in self.get_rows(3):
obj = _createObjectByType('Treatment', folder, tmpID())
obj = folder[_id]
if row['title']:
obj.edit(title=row['title'],
description=row.get('description', ''),
Type=row.get('Type', 'active'),
Procedure=row.get('Procedure', ''),
Care=row.get('Care', ''),
SubjectiveClinicalFindings=row.get('SubjectiveClinicalFindings', ''),
ObjectiveClinicalFindings=row.get('ObjectiveClinicalFindings', ''),)
obj.unmarkCreationFlag()
renameAfterCreation(obj)


class Aetiologic_Agents(WorksheetImporter):

def get_subtypes(self):
sheetname = 'Aetiologic Agents Subtypes'
worksheet = self.workbook.get_sheet_by_name(sheetname)
if not worksheet:
return
subtypes = {}
rows = self.get_rows(3, worksheet=worksheet)
for row in rows:
ae_title = row['aetiologicagent_title']
if ae_title not in subtypes.keys():
subtypes[ae_title] = []
subtypes[ae_title].append({'Subtype': row.get('Subtype', ''),
'SubtypeRemarks': row.get('SubtypeRemarks', '')})
return subtypes

def Import(self):
subtypes = self.get_subtypes()
folder = self.context.bika_setup.bika_aetiologicagents
for row in self.get_rows(3):
obj = _createObjectByType('AetiologicAgent', folder, tmpID())
obj = folder[_id]
if not row['title']:
continue
ae_title = row['title']
ae_subtypes = subtypes.get(ae_title, [])
obj.edit(title=row['title'],
description=row.get('description', ''),
AetiologicAgentSubtypes=ae_subtypes)
obj.unmarkCreationFlag()
renameAfterCreation(obj)


class Case_Syndromic_Classifications(WorksheetImporter):

def Import(self):
folder = self.context.bika_setup.bika_casesyndromicclassifications
for row in self.get_rows(3):
obj = _createObjectByType('CaseSyndromicClassification', folder, tmpID())
obj = folder[_id]
if row['title']:
obj.edit(title=row['title'],
description=row.get('description', ''),)
obj.unmarkCreationFlag()
renameAfterCreation(obj)


class Drugs(WorksheetImporter):

def Import(self):
folder = self.context.bika_setup.bika_drugs
for row in self.get_rows(3):
obj = _createObjectByType('Drug', folder, tmpID())
obj = folder[_id]
if row['title']:
obj.edit(title=row['title'],
description=row.get('description', ''),
Category=row.get('Category', ''),
Indications=row.get('Indications', ''),
Posology=row.get('Posology', ''),
SideEffects=row.get('SideEffects', ''),
Preservation=row.get('Preservation', ''),)
obj.unmarkCreationFlag()
renameAfterCreation(obj)


class Drug_Prohibitions(WorksheetImporter):

def Import(self):
folder = self.context.bika_setup.bika_drugprohibitions
for row in self.get_rows(3):
obj = _createObjectByType('DrugProhibition', folder, tmpID())
obj = folder[_id]
if row['title']:
obj.edit(title=row['title'],
description=row.get('description', ''),)
obj.unmarkCreationFlag()
renameAfterCreation(obj)


class Identifier_Types(WorksheetImporter):

def Import(self):
folder = self.context.bika_setup.bika_identifiertypes
for row in self.get_rows(3):
obj = _createObjectByType('IdentifierType', folder, tmpID())
obj = folder[_id]
if row['title']:
obj.edit(title=row['title'],
description=row.get('description', ''),)
obj.unmarkCreationFlag()
renameAfterCreation(obj)


class Immunizations(WorksheetImporter):

def Import(self):
folder = self.context.bika_setup.bika_immunizations
for row in self.get_rows(3):
obj = _createObjectByType('Immunization', folder, tmpID())
obj = folder[_id]
if row['title']:
obj.edit(title=row['title'],
description=row.get('description', ''),
Form=row.get('Form', 'active'),
RelevantFacts=row.get('RelevantFacts', ''),
GeographicalDistribution=row.get('GeographicalDistribution', ''),
Transmission=row.get('Transmission', ''),
Symptoms=row.get('Symptoms', ''),
Risk=row.get('Risk', ''),
Treatment=row.get('Treatment', ''),
Prevention=row.get('Prevention', ''),)
obj.unmarkCreationFlag()
renameAfterCreation(obj)


class Vaccination_Centers(WorksheetImporter):

def Import(self):
folder = self.context.bika_setup.bika_vaccinationcenters
for row in self.get_rows(3):
obj = _createObjectByType("VaccinationCenter", folder, tmpID())
if row['Name']:
obj.edit(
Name=row.get('Name', ''),
TaxNumber=row.get('TaxNumber', ''),
AccountType=row.get('AccountType', {}),
AccountName=row.get('AccountName', {}),
AccountNumber=row.get('AccountNumber', ''),
BankName=row.get('BankName', ''),
BankBranch=row.get('BankBranch', ''),
)
self.fill_contactfields(row, obj)
self.fill_addressfields(row, obj)
obj.unmarkCreationFlag()
renameAfterCreation(obj)


class Case_Outcomes(WorksheetImporter):

def Import(self):
Expand Down
48 changes: 48 additions & 0 deletions bika/health/setupdata/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,54 @@
provides="bika.lims.interfaces.ISetupDataImporter"
for="Products.CMFPlone.interfaces.IPloneSiteRoot"/>

<adapter
name="Treatments"
factory="bika.health.setupdata.Treatments"
provides="bika.lims.interfaces.ISetupDataImporter"
for="Products.CMFPlone.interfaces.IPloneSiteRoot"/>

<adapter
name="Aetiologic_Agents"
factory="bika.health.setupdata.Aetiologic_Agents"
provides="bika.lims.interfaces.ISetupDataImporter"
for="Products.CMFPlone.interfaces.IPloneSiteRoot"/>

<adapter
name="Case_Syndromic_Classifications"
factory="bika.health.setupdata.Case_Syndromic_Classifications"
provides="bika.lims.interfaces.ISetupDataImporter"
for="Products.CMFPlone.interfaces.IPloneSiteRoot"/>

<adapter
name="Drugs"
factory="bika.health.setupdata.Drugs"
provides="bika.lims.interfaces.ISetupDataImporter"
for="Products.CMFPlone.interfaces.IPloneSiteRoot"/>

<adapter
name="Drug_Prohibitions"
factory="bika.health.setupdata.Drug_Prohibitions"
provides="bika.lims.interfaces.ISetupDataImporter"
for="Products.CMFPlone.interfaces.IPloneSiteRoot"/>

<adapter
name="Identifier_Types"
factory="bika.health.setupdata.Identifier_Types"
provides="bika.lims.interfaces.ISetupDataImporter"
for="Products.CMFPlone.interfaces.IPloneSiteRoot"/>

<adapter
name="Immunizations"
factory="bika.health.setupdata.Immunizations"
provides="bika.lims.interfaces.ISetupDataImporter"
for="Products.CMFPlone.interfaces.IPloneSiteRoot"/>

<adapter
name="Vaccination_Centers"
factory="bika.health.setupdata.Vaccination_Centers"
provides="bika.lims.interfaces.ISetupDataImporter"
for="Products.CMFPlone.interfaces.IPloneSiteRoot"/>

<adapter
name="Case_Outcomes"
factory="bika.health.setupdata.Case_Outcomes"
Expand Down
3 changes: 3 additions & 0 deletions bika/health/setuphandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def setupHealthVarious(context):
'bika_caseoutcomes',
'bika_epidemiologicalyears',
'bika_identifiertypes'
'bika_casesyndromicclassifications',
):
obj = bika_setup._getOb(obj_id)
obj.unmarkCreationFlag()
Expand Down Expand Up @@ -300,6 +301,8 @@ def addColumn(cat, col):
at.setCatalogsByType('CaseOutcome', ['bika_setup_catalog', ])
at.setCatalogsByType('EpidemiologicalYear', ['bika_setup_catalog', ])
at.setCatalogsByType('IdentifierType', ['bika_setup_catalog', ])
at.setCatalogsByType('CaseSyndromicClassification', ['bika_setup_catalog', ])

addIndex(bsc,'getGender', 'FieldIndex')
addColumn(bsc,'getGender')

Expand Down
Loading

0 comments on commit 45b8fb4

Please sign in to comment.